:root {
  --brown: #6B4A34;
  --brown-2: #8a6448;
  --tan: #DECAA5;
  --cream: #F5EFE4;
  --bg: #FBF8F3;
  --surface: #FFFFFF;
  --ink: #2a211b;
  --ink-2: #5e5147;
  --muted: #8b7d71;
  --line: #e7ddcf;
  --good: #2f7a4f;
  --warn: #a15c00;
  --bad: #b3261e;
  --bar: #6B4A34;
  --focus: #1a5fb4;
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brown: #e2c29f; --brown-2: #c9a47f; --tan: #5a4636; --cream: #2b231d;
    --bg: #17120e; --surface: #211a15; --ink: #f3ebe1; --ink-2: #cdbfb1; --muted: #9d8f82;
    --line: #3a3029; --good: #6fcf97; --warn: #f2b35a; --bad: #ff8a80; --bar: #d8b48c; --focus: #8ab4f8;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --brown: #e2c29f; --brown-2: #c9a47f; --tan: #5a4636; --cream: #2b231d;
  --bg: #17120e; --surface: #211a15; --ink: #f3ebe1; --ink-2: #cdbfb1; --muted: #9d8f82;
  --line: #3a3029; --good: #6fcf97; --warn: #f2b35a; --bad: #ff8a80; --bar: #d8b48c; --focus: #8ab4f8;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brown); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { color: var(--brown); line-height: 1.2; margin: 0 0 .5em; font-family: Georgia, "Times New Roman", serif; font-weight: 600; }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.35rem; margin-top: 1.6em; }
h3 { font-size: 1.05rem; font-family: inherit; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* ---------- Login ---------- */
.login {
  min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(ellipse at top, var(--cream), var(--bg) 70%);
}
.login-card {
  width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 20px; padding: 32px 28px; box-shadow: 0 10px 40px rgba(60, 40, 20, .08);
}
.logo { font-family: Georgia, serif; color: var(--brown); font-size: 1.6rem; letter-spacing: .02em; text-align: center; margin-bottom: 4px; }
.logo span { font-style: italic; font-weight: 400; }
.login-card p { text-align: center; margin: 0 0 22px; }
label { display: block; font-size: .85rem; color: var(--ink-2); margin-bottom: 6px; }
input[type=password], input[type=text] {
  width: 100%; padding: 12px 14px; font-size: 1rem; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); color: var(--ink);
}
button, .btn {
  font: inherit; cursor: pointer; border: 1px solid var(--brown); background: var(--brown); color: #fff;
  border-radius: 10px; padding: 11px 16px; font-weight: 600;
}
:root[data-theme="dark"] button:not(.ghost), :root[data-theme="dark"] .btn { color: #1a130e; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) button:not(.ghost) { color: #1a130e; } }
button.ghost { background: transparent; color: var(--brown); border-color: var(--line); font-weight: 500; padding: 8px 12px; }
button:disabled { opacity: .6; cursor: wait; }
.login button[type=submit] { width: 100%; margin-top: 14px; }
.error { color: var(--bad); font-size: .9rem; min-height: 1.4em; margin-top: 10px; text-align: center; }

/* ---------- App shell ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.topbar-in { max-width: 1120px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 12px; }
.topbar .logo { font-size: 1.25rem; margin: 0; text-decoration: none; }
.topbar .spacer { flex: 1; }
.crumbs { font-size: .9rem; color: var(--muted); }
.crumbs a { text-decoration: none; }
main { max-width: 1120px; margin: 0 auto; padding: 24px 16px 64px; }

.hero { padding: 8px 0 16px; }
.hero p { color: var(--ink-2); margin: 0; max-width: 60ch; }

.tiles { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin-top: 20px; }
.tile {
  display: block; text-decoration: none; color: inherit; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px; transition: transform .12s, box-shadow .12s, border-color .12s;
}
.tile:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(60, 40, 20, .08); border-color: var(--tan); }
.tile.big { padding: 28px; background: linear-gradient(160deg, var(--surface), var(--cream)); }
.tile h3 { font-family: Georgia, serif; font-size: 1.3rem; margin-bottom: 4px; }
.tile .kpi-row { display: flex; gap: 24px; margin-top: 14px; flex-wrap: wrap; }
.tile .k { font-size: 1.25rem; font-weight: 650; }
.tile .kl { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.tiles.small .tile { padding: 16px 18px; }
.tiles.small .tile h3 { font-size: 1.05rem; font-family: inherit; }

.badge { display: inline-block; font-size: .75rem; padding: 2px 9px; border-radius: 999px; background: var(--cream); color: var(--ink-2); border: 1px solid var(--line); }
.badge.good { color: var(--good); }
.badge.warn { color: var(--warn); }
.badge.bad { color: var(--bad); }

.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); margin: 8px 0 20px; scrollbar-width: thin; }
.tabs a { padding: 10px 14px; text-decoration: none; color: var(--ink-2); white-space: nowrap; border-bottom: 3px solid transparent; }
.tabs a[aria-current=page] { color: var(--brown); border-color: var(--brown); font-weight: 600; }

.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.stat .v { font-size: 1.45rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.stat .l { font-size: .8rem; color: var(--muted); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-top: 16px; }
.card > h3:first-child { margin-top: 0; }
.grid2 { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

.table-wrap { overflow-x: auto; margin-top: 8px; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--line); }
thead th { background: var(--tan); color: #000; font-weight: 600; font-size: .82rem; white-space: nowrap; }
:root[data-theme="dark"] thead th { color: var(--ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) thead th { color: var(--ink); } }
td.r, th.r { text-align: right; font-variant-numeric: tabular-nums; }
tr.total td { font-weight: 700; border-top: 2px solid var(--ink-2); }
tr.sub td { background: var(--cream); }
tr.closed td { color: var(--muted); }
.neg { color: var(--bad); }
.pos { color: var(--good); }

dl.kv { display: grid; grid-template-columns: minmax(120px, max-content) 1fr; gap: 6px 18px; margin: 0; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.missing { color: var(--warn); font-style: italic; font-weight: 400; }

.note { border-left: 4px solid var(--tan); background: var(--cream); padding: 10px 14px; border-radius: 0 10px 10px 0; margin-top: 12px; color: var(--ink-2); }
.note.warn { border-color: var(--warn); }
ul.clean { padding-left: 1.1em; margin: .4em 0; }
ul.clean li { margin: .25em 0; }

.doc { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.doc:last-child { border-bottom: 0; }
.doc .icon { width: 36px; height: 36px; border-radius: 9px; background: var(--cream); display: grid; place-items: center; color: var(--brown); font-weight: 700; font-size: .75rem; flex: none; }
.doc .t { flex: 1; min-width: 0; }
.doc .t a { font-weight: 600; text-decoration: none; }
.doc .t a:hover { text-decoration: underline; }

.chart { position: relative; margin-top: 8px; }
.chart svg { display: block; width: 100%; height: auto; }
.chart .grid line { stroke: var(--line); }
.chart .axis text { fill: var(--muted); font-size: 11px; }
.chart .bar { fill: var(--bar); }
.chart .bar.dim { opacity: .35; }
.chart .hit { fill: transparent; cursor: default; }
.tip {
  position: absolute; pointer-events: none; background: var(--ink); color: var(--bg); font-size: .82rem;
  padding: 6px 10px; border-radius: 8px; white-space: nowrap; transform: translate(-50%, -110%); display: none;
}

.waterfall td:first-child { width: 70%; }
select { font: inherit; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }

footer { max-width: 1120px; margin: 0 auto; padding: 0 16px 40px; color: var(--muted); font-size: .8rem; }

@media (max-width: 560px) {
  h1 { font-size: 1.55rem; }
  .crumbs { display: none; }
  dl.kv { grid-template-columns: 1fr; gap: 0 0; }
  dl.kv dd { margin-bottom: 8px; }
}
@media print {
  .topbar, .tabs, button { display: none !important; }
  body { background: #fff; }
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
label.gap { margin-top: 14px; }
.topbar .user { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 560px) { .topbar .user { display: none; } }
input[type=email] { width: 100%; padding: 12px 14px; font-size: 1rem; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); }

/* ---------- Main location tabs ---------- */
.maintabs { border-top: 1px solid var(--line); }
.maintabs-in { max-width: 1120px; margin: 0 auto; padding: 0 16px; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.maintab {
  flex: none; padding: 12px 18px 10px; text-decoration: none; color: var(--ink-2); font-weight: 600;
  border-bottom: 3px solid transparent; white-space: nowrap;
}
.maintab:hover { color: var(--brown); }
.maintab[aria-current=page] { color: var(--brown); border-color: var(--brown); background: var(--cream); border-radius: 10px 10px 0 0; }
.maintab.company { margin-left: auto; font-weight: 500; }
@media (max-width: 560px) { .maintab { padding: 10px 12px 8px; font-size: .92rem; } }

/* ---------- Login photo ---------- */
.login { position: relative; overflow: hidden; }
.login-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 72% 60%; }
.login.has-photo::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20,14,10,.15), rgba(20,14,10,.55)); z-index: 1; }
.login.has-photo .login-card { position: relative; z-index: 2; background: color-mix(in srgb, var(--surface) 35%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.login.has-photo input { background: color-mix(in srgb, var(--surface) 70%, transparent); }
.login.has-photo label { color: var(--ink); }
.login.has-photo .login-card p { color: var(--ink-2); }
.login-logo { display: block; width: 150px; height: 150px; margin: -4px auto 10px; border-radius: 50%; object-fit: cover; box-shadow: 0 6px 24px rgba(40, 25, 10, .25); border: 3px solid rgba(255, 255, 255, .7); }
@media (max-width: 560px) { .login-logo { width: 120px; height: 120px; } }
.topbar .brand { display: flex; align-items: center; gap: 10px; }
.topbar-logo { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex: none; box-shadow: 0 1px 4px rgba(40, 25, 10, .25); }

/* ---------- Miss Ann Boat Trips palette (from missannboattrips.com) ----------
   ocean blue #00628C · slate teal #3E5B60 · turquoise #1FA9BA · sea mist #ECF3F6 */
body[data-area="missann"] {
  --brown: #00628C; --brown-2: #3E5B60; --tan: #CFE6EE; --cream: #ECF3F6;
  --bg: #F5F9FB; --surface: #FFFFFF; --ink: #263538; --ink-2: #3E5B60; --muted: #6f878c;
  --line: #d6e5eb; --bar: #00628C; --accent: #1FA9BA;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body[data-area="missann"] {
    --brown: #7cc7e0; --brown-2: #9fc9d2; --tan: #1f3a44; --cream: #16262c;
    --bg: #0f1a1e; --surface: #15232a; --ink: #e6f1f4; --ink-2: #b7ccd3; --muted: #86a0a7;
    --line: #26404a; --bar: #5bb8d6; --accent: #3cc3d3;
  }
}
:root[data-theme="dark"] body[data-area="missann"] {
  --brown: #7cc7e0; --brown-2: #9fc9d2; --tan: #1f3a44; --cream: #16262c;
  --bg: #0f1a1e; --surface: #15232a; --ink: #e6f1f4; --ink-2: #b7ccd3; --muted: #86a0a7;
  --line: #26404a; --bar: #5bb8d6; --accent: #3cc3d3;
}
body[data-area="missann"] .maintab.missann[aria-current=page] { border-color: var(--accent); }
body[data-area="missann"] .tabs a[aria-current=page] { border-color: var(--accent); }
body[data-area="missann"] .tile.big { background: linear-gradient(160deg, var(--surface), var(--cream)); }

/* ---------- Mermaid Boat Trips palette (from mermaidboattrips.com) ----------
   navy #223774 · deep navy #19334D · orange #FF9100 · light grey #F5F5F5 */
body[data-area="mermaid"] {
  --brown: #223774; --brown-2: #19334D; --tan: #DDE3F0; --cream: #F5F5F5;
  --bg: #FAFAFA; --surface: #FFFFFF; --ink: #363636; --ink-2: #19334D; --muted: #707070;
  --line: #e3e5ea; --bar: #223774; --accent: #FF9100;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body[data-area="mermaid"] {
    --brown: #9fb2ea; --brown-2: #c3cfee; --tan: #232f52; --cream: #181d2c;
    --bg: #10131c; --surface: #171c29; --ink: #eceef4; --ink-2: #c3cfee; --muted: #9098ad;
    --line: #2a3148; --bar: #8ea3e6; --accent: #ffa733;
  }
}
:root[data-theme="dark"] body[data-area="mermaid"] {
  --brown: #9fb2ea; --brown-2: #c3cfee; --tan: #232f52; --cream: #181d2c;
  --bg: #10131c; --surface: #171c29; --ink: #eceef4; --ink-2: #c3cfee; --muted: #9098ad;
  --line: #2a3148; --bar: #8ea3e6; --accent: #ffa733;
}
body[data-area="mermaid"] .maintab.mermaid[aria-current=page],
body[data-area="mermaid"] .tabs a[aria-current=page] { border-color: var(--accent); }
body[data-area="mermaid"] .note { border-left-color: var(--accent); }

/* ---------- Location logos ---------- */
.maintab { display: inline-flex; align-items: center; gap: 8px; }
.loc-logo { display: block; object-fit: contain; flex: none; }
.loc-logo.missann { background: #00628C; }
.loc-logo.mermaid { background: #fff; }
.loc-logo.tab.missann { width: 26px; height: 26px; padding: 3px; border-radius: 50%; }
.loc-logo.tab.mermaid { height: 22px; width: auto; padding: 3px 6px; border-radius: 6px; border: 1px solid var(--line); }
.area-head { display: flex; align-items: center; gap: 16px; margin-bottom: .3em; }
.area-head h1 { margin: 0; }
.loc-logo.head.missann { width: 72px; height: 72px; padding: 8px; border-radius: 16px; box-shadow: 0 4px 14px rgba(0, 60, 90, .25); }
.loc-logo.head.mermaid { height: 56px; width: auto; padding: 8px 14px; border-radius: 12px; border: 1px solid var(--line); box-shadow: 0 4px 14px rgba(20, 30, 70, .12); }
@media (max-width: 560px) {
  .loc-logo.tab { display: none; }
  .loc-logo.head.missann { width: 56px; height: 56px; }
  .loc-logo.head.mermaid { height: 44px; }
}

/* ---------- Invoice dialog ---------- */
.inv-btn { margin-left: auto; }
@media (max-width: 560px) { .area-head { flex-wrap: wrap; } .inv-btn { margin-left: 0; width: 100%; } }
.inv-dialog { width: min(860px, calc(100vw - 24px)); max-height: calc(100vh - 24px); border: 1px solid var(--line); border-radius: 16px; padding: 0; background: var(--surface); color: var(--ink); }
.inv-dialog::backdrop { background: rgba(20, 14, 10, .55); }
.inv-body { padding: 18px 20px 20px; }
.inv-head { display: flex; align-items: center; justify-content: space-between; }
.inv-head h2 { margin: 0; }
.inv-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin: 14px 0; }
.inv-grid label, .inv-inline label { display: flex; flex-direction: column; gap: 4px; }
.inv-dialog input[type=date], .inv-dialog input[type=text], .inv-dialog input[type=number] {
  font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink);
}
.inv-period { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px 12px; margin: 0 0 12px; display: grid; gap: 6px; }
.inv-period legend { padding: 0 6px; color: var(--ink-2); font-size: .85rem; }
.inv-radio { display: flex; gap: 8px; align-items: center; color: var(--ink); font-size: .95rem; margin: 0; }
.inv-inline { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; margin-top: 4px; font-size: .85rem; color: var(--ink-2); }
.inv-table td { vertical-align: middle; }
.inv-no { width: 130px; }
.inv-adv { width: 100px; text-align: right; }
.inv-actions { display: flex; gap: 10px; align-items: center; justify-content: flex-end; margin-top: 14px; flex-wrap: wrap; }
.inv-actions .small { margin-right: auto; }

/* ---------- Contractor edit + toast ---------- */
.card-head { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.edit-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin: 14px 0; }
.edit-grid label { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; color: var(--ink-2); }
.edit-grid .span2 { grid-column: 1 / -1; }
.inv-dialog textarea, .inv-dialog select, .edit-grid input {
  font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink);
}
.inv-table input[type=number] { width: 90px; font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 100; max-width: min(520px, calc(100vw - 32px));
  background: var(--ink); color: var(--bg); padding: 12px 16px; border-radius: 12px; box-shadow: 0 8px 30px rgba(0,0,0,.25);
  font-size: .92rem; transition: opacity .5s;
}
.toast.good { border-left: 5px solid var(--good); }
.toast.bad { border-left: 5px solid var(--bad); }
.toast.out { opacity: 0; }
@media (max-width: 560px) {
  .topbar .brand-text { display: none; }
  .topbar-in { gap: 8px; }
  .topbar button.ghost { padding: 7px 10px; }
}

/* ---------- Contractor file ---------- */
.card-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.btn.ghost { background: transparent; color: var(--brown); border: 1px solid var(--line); font-weight: 500; padding: 8px 12px; text-decoration: none; border-radius: 10px; display: inline-block; }
.card h3 a { text-decoration: none; }
.card h3 a:hover { text-decoration: underline; }
.doc-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.doc-row:last-child { border-bottom: 0; }
.doc-row .t { flex: 1; min-width: 0; display: grid; gap: 4px; }
.doc-status { width: 30px; height: 30px; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--cream); color: var(--muted); }
.doc-status.ok { background: color-mix(in srgb, var(--good) 18%, transparent); color: var(--good); }
.doc-status.todo { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.doc-file { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; overflow-wrap: anywhere; }
.small-btn { padding: 3px 9px !important; font-size: .8rem; }
.danger { color: var(--bad) !important; }
.upload-btn { cursor: pointer; margin: 0; flex: none; }
.upload-btn:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.btn.ghost { color: var(--brown) !important; background: transparent !important; border: 1px solid var(--line); }

/* ---------- Data checks ---------- */
.check-banner { display: block; text-decoration: none; margin-top: 16px; }
.note.bad { border-color: var(--bad); }
.check-list li { padding: 6px 0 6px 12px; border-left: 3px solid var(--line); margin: 6px 0; }
.check-list li.error { border-color: var(--bad); }
.check-list li.warning { border-color: var(--warn); }

.stat-link { text-decoration: none; color: inherit; border-color: var(--tan); }
.stat-link:hover { border-color: var(--brown); }
.owner-net .stats { margin-bottom: 12px; }

/* ---------- Animations ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes kenburns { from { transform: scale(1.12); } to { transform: scale(1); } }
@keyframes floaty { 50% { transform: translateY(-5px); } }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes toastin { from { opacity: 0; transform: translate(-50%, 20px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* A: page content floats in, one block after another */
main.enter > * { animation: rise .5s cubic-bezier(.2,.7,.2,1) both; }
main.enter > *:nth-child(2) { animation-delay: .05s; }
main.enter > *:nth-child(3) { animation-delay: .1s; }
main.enter > *:nth-child(4) { animation-delay: .15s; }
main.enter > *:nth-child(5) { animation-delay: .2s; }
main.enter > *:nth-child(n+6) { animation-delay: .25s; }
main.enter .stats > * { animation: rise .5s cubic-bezier(.2,.7,.2,1) both; }
main.enter .stats > *:nth-child(2) { animation-delay: .06s; }
main.enter .stats > *:nth-child(3) { animation-delay: .12s; }
main.enter .stats > *:nth-child(n+4) { animation-delay: .18s; }

/* B: login screen */
.login-photo { animation: kenburns 14s ease-out both; }
.login-card { animation: rise .7s .2s cubic-bezier(.2,.7,.2,1) both; }
.login-logo { animation: floaty 4s 1s ease-in-out infinite; }

/* D: chart bars grow from the baseline */
.chart .bar { transform-box: fill-box; transform-origin: 50% 100%; animation: grow .6s cubic-bezier(.2,.7,.2,1) both; }

/* E: sliding underline under the active tab */
.maintabs-in, .tabs { position: relative; }
.ink { position: absolute; bottom: 0; height: 3px; border-radius: 3px; background: var(--accent, var(--brown)); pointer-events: none;
  transition: left .32s cubic-bezier(.2,.7,.2,1), width .32s cubic-bezier(.2,.7,.2,1); }
.has-ink [aria-current=page] { border-bottom-color: transparent !important; }

/* F: hover lift and press feedback */
.tile, .stat-link { transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.stat-link:hover { transform: translateY(-3px); box-shadow: 0 8px 22px rgba(60, 40, 20, .12); }
.tile:active, .stat-link:active { transform: translateY(-1px) scale(.98); }
button, .btn { transition: transform .12s ease, filter .12s ease, background-color .15s ease; }
button:hover:not(:disabled), .btn:hover { filter: brightness(1.08); }
button:active:not(:disabled), .btn:active { transform: scale(.96); }

/* G: messages slide up */
.toast { animation: toastin .4s cubic-bezier(.2,.7,.2,1) backwards; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Net-after-tax goal ---------- */
.goal { border-left: 5px solid var(--line); }
.goal-good { color: var(--good); } .goal-warn { color: var(--warn); } .goal-bad { color: var(--bad); }
.stat.goal .l { color: var(--muted); }
.stat.goal-good { border-left-color: var(--good); } .stat.goal-good .v { color: var(--good); }
.stat.goal-warn { border-left-color: var(--warn); } .stat.goal-warn .v { color: var(--warn); }
.stat.goal-bad { border-left-color: var(--bad); } .stat.goal-bad .v { color: var(--bad); }
.goal-line { font-size: .8rem; font-weight: 600; margin-top: 2px; }
.stat.goal-good .goal-line { color: var(--good); } .stat.goal-warn .goal-line { color: var(--warn); } .stat.goal-bad .goal-line { color: var(--bad); }
td .goal-good, td .goal-warn, td .goal-bad { font-weight: 700; }
.goal-tag { display: inline-block; font-size: .78rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: color-mix(in srgb, currentColor 14%, transparent); white-space: nowrap; }

/* ---------- Goal tracker ---------- */
.progress { position: relative; height: 16px; border-radius: 999px; background: var(--cream); border: 1px solid var(--line); overflow: visible; margin: 6px 0 8px; }
.progress-fill { height: 100%; border-radius: 999px; background: var(--brown); transition: width .8s cubic-bezier(.2,.7,.2,1); }
.goal-bg-good { background: var(--good); } .goal-bg-warn { background: var(--warn); } .goal-bg-bad { background: var(--bad); }
.progress-mark { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); border-radius: 2px; }
.chart .bar.under { opacity: .55; }
.chart .target-line { stroke: var(--ink-2); stroke-width: 1.5; stroke-dasharray: 5 4; }
.chart .target-label { fill: var(--ink-2); font-size: 11px; font-weight: 600; }

/* ---------- Invoice preview ---------- */
.inv-viewer { width: min(900px, calc(100vw - 16px)); max-height: calc(100vh - 16px); padding: 0; border: 1px solid var(--line); border-radius: 16px; background: var(--bg); color: var(--ink); }
.inv-viewer::backdrop { background: rgba(20, 14, 10, .65); }
.inv-viewer-bar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; background: var(--surface); border-bottom: 1px solid var(--line); }
.inv-pages { padding: 16px; display: grid; gap: 18px; justify-items: center; }
.inv-pages figure { margin: 0; width: 100%; max-width: 760px; text-align: center; }
.inv-page { width: 100%; height: auto; display: block; border-radius: 6px; box-shadow: 0 6px 24px rgba(0, 0, 0, .18); background: #fff; }

/* ================= Redesign (Sept 2026) ================= */
:root { --mix1: #A0521D; --mix2: #0E8A74; --mix3: #3F63C4; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --mix1: #C0662B; --mix2: #1FA08A; --mix3: #6E8FE0; } }
:root[data-theme="dark"] { --mix1: #C0662B; --mix2: #1FA08A; --mix3: #6E8FE0; }
.ic { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.mt { margin-top: 18px; }

/* 1. Home */
.home { background: linear-gradient(170deg, var(--surface), var(--cream)); border: 1px solid var(--line); border-radius: 22px; padding: 22px; }
.home-hello { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.hello { font-family: Georgia, serif; font-size: 1.75rem; color: var(--brown); line-height: 1.2; }
.hello-logo { width: 54px; height: 54px; border-radius: 50%; box-shadow: 0 3px 12px rgba(0, 0, 0, .15); flex: none; }
.home-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); margin-top: 18px; }
.ring-card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 18px; display: grid; justify-items: center; text-decoration: none; color: inherit; transition: transform .18s ease, box-shadow .18s ease; }
.ring-card:hover { transform: translateY(-3px); box-shadow: 0 10px 26px rgba(60, 40, 20, .12); }
.ring { width: 210px; height: 210px; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--cream); stroke-width: 16; }
.ring-fg { fill: none; stroke: var(--brown); stroke-width: 16; stroke-linecap: round; transition: stroke-dashoffset 1.2s cubic-bezier(.2,.7,.2,1); }
.ring-fg.good { stroke: var(--good); } .ring-fg.warn { stroke: var(--warn); } .ring-fg.bad { stroke: var(--bad); }
.ring-text { position: absolute; top: 18px; height: 210px; display: grid; place-content: center; text-align: center; }
.ring-v { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.ring-l { font-size: .8rem; color: var(--muted); }
.ring-tag { margin: 6px auto 0; font-size: .8rem; font-weight: 700; padding: 2px 10px; border-radius: 999px; }
.ring-tag.good { color: var(--good); background: color-mix(in srgb, var(--good) 15%, transparent); }
.ring-tag.warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 15%, transparent); }
.ring-tag.bad { color: var(--bad); background: color-mix(in srgb, var(--bad) 15%, transparent); }
.ring-sub { font-size: .8rem; color: var(--muted); margin-top: 6px; text-align: center; }
.today-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 18px; }
.today-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.today-list li { display: flex; gap: 12px; align-items: flex-start; }
.ti { width: 34px; height: 34px; flex: none; display: grid; place-items: center; background: var(--cream); border-radius: 10px; }
.quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 16px; }
button.qa { display: flex; align-items: center; gap: 10px; justify-content: flex-start; background: var(--surface) !important; color: var(--ink) !important; border: 1px solid var(--line) !important; padding: 12px 14px; font-weight: 600; }
button.qa span { font-size: 1.15rem; }

/* 5. Needs your attention */
.attn h3 { display: flex; align-items: center; gap: 8px; }
.attn-row { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-top: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.attn-row:hover { background: var(--cream); }
.attn-row > div { flex: 1; min-width: 0; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.dot.warn { background: var(--warn); } .dot.bad { background: var(--bad); } .dot.info { background: var(--muted); }
.go { color: var(--muted); font-size: 1.4rem; }

/* 2. Banners + icon tiles */
.banners { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); margin-top: 16px; }
.banner { position: relative; min-height: 150px; border-radius: 18px; overflow: hidden; display: flex; align-items: flex-end; color: #fff; text-decoration: none; margin-bottom: 14px; }
.banners .banner { margin-bottom: 0; }
a.banner { transition: transform .18s ease, box-shadow .18s ease; }
a.banner:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(0, 0, 0, .2); }
.banner-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 70% 55%; }
.banner-missann { background: linear-gradient(120deg, #003b55, #00628C 60%, #1FA9BA); }
.banner-mermaid { background: linear-gradient(120deg, #19334D, #223774 60%, #2e4f9a); }
.banner.has-photo .banner-deco { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0, 45, 70, .8), rgba(0, 45, 70, .15)); }
.banner-mermaid .banner-deco { position: absolute; inset: auto 0 0 0; height: 60px; background: radial-gradient(circle at 20px -10px, transparent 30px, rgba(255, 145, 0, .2) 31px) 0 0 / 60px 60px repeat-x; }
.banner-in { position: relative; z-index: 2; display: flex; gap: 14px; align-items: center; padding: 16px 18px; width: 100%; flex-wrap: wrap; }
.banner-text { flex: 1; min-width: 180px; }
.banner-t { font-family: Georgia, serif; font-size: 1.5rem; font-weight: 600; margin: 0; color: #fff; line-height: 1.2; }
.banner-s { opacity: .92; font-size: .9rem; }
.banner-spark { display: grid; justify-items: end; opacity: .95; }
.banner-spark .spark { width: 120px; height: 38px; }
.banner-spark .spark polyline { stroke: #fff; }
.banner-spark .spark circle { fill: #fff; }
.loc-logo.bnr { flex: none; }
.loc-logo.bnr.missann { width: 64px; height: 64px; padding: 6px; border-radius: 14px; background: #00628C; }
.loc-logo.bnr.mermaid { height: 46px; width: auto; padding: 6px 12px; border-radius: 10px; background: #fff; }
.banner .inv-btn { margin-left: auto; background: rgba(255, 255, 255, .95) !important; color: #1b2a33 !important; border-color: transparent !important; }
.icon-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 16px; }
.itile { display: grid; gap: 2px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); text-decoration: none; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.itile:hover { transform: translateY(-3px); box-shadow: 0 8px 22px rgba(60, 40, 20, .12); border-color: var(--tan); }
.itile .ic { width: 30px; height: 30px; color: var(--brown); margin-bottom: 6px; }
.itile span { font-size: .8rem; color: var(--muted); }

/* 4. Charts */
.spark polyline { fill: none; stroke: var(--brown); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.spark circle { fill: var(--brown); }
.spark-tile { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.spark-tile .spark { width: 160px; height: 48px; }
.spark-tile .v { font-size: 1.3rem; font-weight: 700; } .spark-tile .l { font-size: .8rem; color: var(--muted); }
.mix { display: flex; gap: 2px; height: 34px; border-radius: 8px; overflow: hidden; }
.mix div { display: grid; place-items: center; color: #fff; font-size: .78rem; font-weight: 700; min-width: 0; }
.mix .mix1, .mix-legend .mix1 { background: var(--mix1); } .mix .mix2, .mix-legend .mix2 { background: var(--mix2); } .mix .mix3, .mix-legend .mix3 { background: var(--mix3); }
.mix-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; color: var(--ink-2); }
.mix-legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; margin-right: 6px; vertical-align: -1px; }
.heat-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin: 8px 0; }
.heat-grid .hd { font-size: .7rem; color: var(--muted); text-align: center; }
.heat-cell { aspect-ratio: 1; border-radius: 6px; display: grid; place-items: center; font-size: .72rem; color: var(--ink-2); background: var(--cream); }
.heat-cell.h1, .heat-legend .h1 { background: color-mix(in srgb, var(--brown) 22%, var(--surface)); }
.heat-cell.h2, .heat-legend .h2 { background: color-mix(in srgb, var(--brown) 45%, var(--surface)); }
.heat-cell.h3, .heat-legend .h3 { background: color-mix(in srgb, var(--brown) 70%, var(--surface)); }
.heat-cell.h4, .heat-legend .h4 { background: var(--brown); }
.heat-cell.h3, .heat-cell.h4 { color: var(--surface); }
.heat-cell.hx, .heat-legend .hx { background: repeating-linear-gradient(45deg, var(--cream), var(--cream) 3px, var(--line) 3px, var(--line) 6px); color: var(--muted); }
.heat-cell.future { background: transparent; border: 1px dashed var(--line); color: var(--muted); }
.heat-cell.blank { background: transparent; }
.heat-legend { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.heat-legend i { width: 14px; height: 14px; border-radius: 3px; display: inline-block; }

/* 6. Small touches */
.empty { text-align: center; }
.empty-art { width: 160px; height: 80px; }
.empty-art .w1 { fill: color-mix(in srgb, var(--brown) 25%, var(--surface)); }
.empty-art .w2 { fill: color-mix(in srgb, var(--brown) 45%, var(--surface)); }
.empty-art .boat { fill: var(--brown); } .empty-art .sail { fill: var(--tan); }
details.more > summary { cursor: pointer; color: var(--brown); font-weight: 600; list-style: none; }
details.more > summary::before { content: '▸ '; display: inline-block; transition: transform .2s; }
details.more[open] > summary::before { transform: rotate(90deg); }
details.more > summary::-webkit-details-marker { display: none; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 200; width: 100vw; height: 100vh; }

/* 3. Phone: bottom menu + tables as cards */
.bottomnav { display: none; }
@media (max-width: 700px) {
  .bottomnav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding: 6px 0 calc(8px + env(safe-area-inset-bottom)); }
  .bottomnav a { display: grid; justify-items: center; gap: 2px; font-size: .7rem; color: var(--muted); text-decoration: none; }
  .bottomnav a .ic { width: 22px; height: 22px; }
  .bottomnav a[aria-current=page] { color: var(--brown); font-weight: 700; }
  body { padding-bottom: 70px; }
  .maintabs { display: none; }
  .hello { font-size: 1.4rem; }
  .banner-spark { display: none; }
  .banner .inv-btn { width: 100%; margin-left: 0; }
  table.rt thead { display: none; }
  table.rt, table.rt tbody, table.rt tr, table.rt td { display: block; width: 100%; }
  table.rt tr { border: 1px solid var(--line); border-radius: 12px; padding: 6px 12px; margin-bottom: 10px; background: var(--surface); }
  table.rt tr.total { border-color: var(--ink-2); }
  table.rt td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 5px 0; text-align: right; }
  table.rt td::before { content: attr(data-label); color: var(--muted); text-align: left; font-weight: 500; }
  table.rt td:first-child { font-weight: 700; justify-content: flex-start; font-size: 1rem; }
  table.rt td:first-child::before { content: ''; }
  table.rt td:empty { display: none; }
  table.rt tr.total td { border-top: 0; }
}

details.attn > summary { list-style: none; cursor: pointer; }
details.attn > summary::-webkit-details-marker { display: none; }
details.attn > summary h3 { margin: 0; }
details.attn[open] > summary h3 { margin-bottom: .5em; }
.attn-chev { margin-left: auto; color: var(--muted); transition: transform .2s ease; }
details.attn:not([open]) .attn-chev { transform: rotate(-90deg); }
.home details.attn { margin-top: 16px; }

.ob-next { margin: 0 0 14px; }
.ob-next > strong { display: block; margin-bottom: 8px; }
.ob-kv { grid-template-columns: minmax(180px, max-content) 1fr; }
.ob-kv dd { font-variant-numeric: tabular-nums; }

/* ---------- Schedule ---------- */
.sch-bar { gap: 8px; }
.sch-bar .spacer { flex: 1; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg button { border: 0 !important; border-radius: 0 !important; padding: 8px 14px; }
.seg button.on { background: var(--brown) !important; color: var(--bg) !important; }
.sch-title { margin-top: 10px; }
.sch-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.sch-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.sch-month .hd { font-size: .75rem; color: var(--muted); text-align: center; }
.sch-day { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px; min-height: 120px; display: grid; align-content: start; gap: 6px; }
.sch-month .sch-day { min-height: 90px; padding: 6px; }
.sch-day.closed { background: repeating-linear-gradient(45deg, var(--cream), var(--cream) 6px, var(--bg) 6px, var(--bg) 12px); }
.sch-day.today { border-color: var(--brown); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brown) 30%, transparent); }
.sch-day.blank { background: transparent; border: 0; }
.sch-date { font-size: .85rem; color: var(--ink-2); }
.sch-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.sch-chip { display: inline-block; font-size: .8rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; border: 2px solid var(--c); color: #fff; background: var(--c); white-space: nowrap; }
.sch-chip small { font-weight: 500; opacity: .9; }
.sch-chip.p0 { --c: var(--mix1); } .sch-chip.p1 { --c: var(--mix2); } .sch-chip.p2 { --c: var(--mix3); } .sch-chip.p3 { --c: var(--ink-2); }
.sch-chip.k-usually { background: transparent; color: var(--c); border-style: dashed; }
.sch-chip.k-either { background: transparent; color: var(--c); border-style: dotted; }
.sch-chip.k-extra { --c: var(--good); }
.sch-chip.k-off { background: var(--cream); color: var(--muted); border-color: var(--line); text-decoration: line-through; }
.sch-note { color: var(--ink-2); }
.sch-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 10px 0 4px; }
.sch-form { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); align-items: end; margin-bottom: 12px; }
.sch-form label { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; color: var(--ink-2); }
.sch-form input, .sch-form select, details.more select, details.more input[type=text] { font: inherit; padding: 7px 9px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); color: var(--ink); }
.sch-form .span2 { grid-column: span 2; }
.sch-img { width: 100%; height: auto; border-radius: 8px; box-shadow: 0 6px 24px rgba(0,0,0,.18); background: #fff; }
@media (max-width: 700px) {
  .sch-week { grid-template-columns: 1fr; }
  .sch-week .sch-day { min-height: 0; }
  .sch-month .sch-day { min-height: 64px; font-size: .75rem; }
  .sch-month .sch-chip { font-size: .62rem; padding: 1px 5px; }
  .sch-month .sch-chip small { display: none; }
  .sch-form .span2 { grid-column: auto; }
}

/* ---------- Staffing: standby, gaps, priority ---------- */
.sch-chip.k-standby { background: transparent; color: var(--muted); border-color: var(--line); border-style: dashed; }
.sch-day.short { border-color: var(--warn, #C98A1B); }
.sch-short { color: var(--warn, #C98A1B); font-weight: 600; }
.prio { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; }
.prio .small-btn { padding: 2px 6px; }

/* ---------- Schedule: tap to choose "one of these days" ---------- */
.sch-chip.k-picked { background: var(--c); color: #fff; }
.sch-chip.pickable { cursor: pointer; font: inherit; font-size: .8rem; font-weight: 700; line-height: 1.2; }
.sch-chip.pickable:hover { filter: brightness(1.08); box-shadow: 0 0 0 2px color-mix(in srgb, var(--c) 35%, transparent); }
.sch-chip.pickable:focus-visible { outline: 2px solid var(--c); outline-offset: 2px; }

/* ---------- Special scheduling + minimums ---------- */
.sch-chip.k-special { --c: #7b4bb3; background: var(--c); color: #fff; }
.sch-day.closed .sch-chips { margin-top: 4px; }
.min-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; margin: 8px 0; }
.min-grid label { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; color: var(--ink-2); }
.min-grid input { font: inherit; width: 100%; padding: 7px 6px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); color: var(--ink); }
@media (max-width: 700px) { .min-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ---------- One colour per person (same at Miss Ann and Mermaid) ---------- */
.sch-chip.sch-chip.c0 { --c: #A0521D; } .sch-chip.sch-chip.c1 { --c: #0E8A74; }
.sch-chip.sch-chip.c2 { --c: #3F63C4; } .sch-chip.sch-chip.c3 { --c: #B8336A; }
.sch-chip.sch-chip.c4 { --c: #7A6A00; } .sch-chip.sch-chip.c5 { --c: #7A3FB0; }
.sch-chip.sch-chip.c6 { --c: #2F7A4F; } .sch-chip.sch-chip.c7 { --c: #C2410C; }
.sch-chip.k-extra, .sch-chip.k-special { background: var(--c); color: #fff; }
.sch-chip.k-off { --c: var(--line); }

/* ---------- Month-end checklist ---------- */
.me-month { min-width: 160px; text-align: center; font-size: 1.1rem; }
.me-progress > div:first-child { display: flex; gap: 10px; align-items: center; }
.me-bar { height: 10px; border-radius: 999px; background: var(--cream); overflow: hidden; margin: 10px 0 6px; }
.me-fill { display: block; height: 100%; width: 0; background: var(--good); border-radius: 999px; transition: width .4s ease; }
.me-item { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--line); }
.me-item:first-of-type { border-top: 0; }
.me-row { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; flex: 1; }
.me-row input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--good); flex: none; }
.me-t { font-weight: 600; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.me-item.done .me-t { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 60%, transparent); }

.attn-grow { flex: 1; min-width: 0; }
.attn-bar { margin: 8px 0 2px; height: 8px; width: 100%; background: color-mix(in srgb, var(--muted) 28%, transparent); }

/* ---------- checklist due dates + one-off day change ---------- */
.badge.muted { color: var(--muted); }
.me-item.overdue { background: color-mix(in srgb, var(--bad) 7%, transparent); border-radius: 8px; padding-left: 6px; }
.me-item.soon { background: color-mix(in srgb, var(--warn) 8%, transparent); border-radius: 8px; padding-left: 6px; }
.sch-date { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.sch-edit { margin-left: auto; padding: 2px 8px !important; font-size: .85rem; line-height: 1.2; }
.day-change .sch-form { margin-top: 8px; }

.small-h { font-size: .95rem; margin: 16px 0 6px; }

.sch-day.other-month { opacity: .55; }
