/* Easy Stepping — one design system for every page.
   Brand: lagoon teal, sunshine, coral, sand, shallows, deep ink (see /styleguide and brand/README.md).
   Phone first: a bottom tab bar under 760px, a top nav above it. Light and dark via prefers-color-scheme,
   overridable with data-theme on <html>. */

@font-face { font-family: "Baloo 2"; font-style: normal; font-weight: 400 800; font-display: swap; src: url("/static/fonts/baloo2-latin.woff2") format("woff2"); }
@font-face { font-family: "Figtree"; font-style: normal; font-weight: 300 900; font-display: swap; src: url("/static/fonts/figtree-latin.woff2") format("woff2"); }

:root {
  /* brand palette */
  --lagoon: #0f7c80;
  --deep-teal: #0b5b5f;
  --sunshine: #ffc53d;
  --coral: #ff6f59;
  --sand: #fbeed6;
  --shallows: #e7f5f4;
  --deep-ink: #16313a;

  /* surfaces + text */
  --bg: #f4faf9;
  --surface: #ffffff;
  --surface-2: #f6fbfa;
  --surface-warm: #fdf6ea;
  --border: #dbe9e8;
  --border-strong: #c3d8d7;
  --text: #16313a;
  --text-2: #33505a;
  --muted: #5d767d;
  --on-brand: #ffffff;
  --track: #e3eeed;
  --chrome-bg: rgb(255 255 255 / 0.94);  /* top bar + tab bar */

  --brand: #0f7c80;
  --brand-strong: #0b5b5f;
  --brand-soft: #e7f5f4;
  --brand-line: #b4dcd9;
  --accent: #ff6f59;          /* coral: the one loud call to action */
  --accent-strong: #f0563f;
  --on-accent: #16313a;       /* ink on coral reads better than white */
  --highlight: #ffc53d;       /* sunshine: focus rings, small highlights */

  --good: #18794e;   --good-soft: #e6f6ee;  --good-line: #b9e3cc;
  --warn: #8a5a00;   --warn-soft: #fff4d6;  --warn-line: #f5d58a;
  --bad:  #b9381f;   --bad-soft:  #ffece8;  --bad-line:  #f6c3b8;
  --info: #1d5fa8;   --info-soft: #edf4fc;  --info-line: #c4daf3;
  --neutral-soft: #eef3f3;   --neutral-text: #56676c;
  --pending: #e9a23b;   --draft: #7fc4ba;
  --danger-strong: #96301a;

  --font-display: "Baloo 2", "Trebuchet MS", system-ui, sans-serif;
  --font-body: "Figtree", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --radius: 16px;
  --radius-sm: 11px;
  --shadow: 0 1px 2px rgb(22 49 58 / 0.05), 0 2px 6px rgb(22 49 58 / 0.06);
  --tabbar-h: 64px;

  font-family: var(--font-body);
  color: var(--text);
  color-scheme: light;
  -webkit-text-size-adjust: 100%;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1c21; --surface: #132a31; --surface-2: #17323a; --surface-warm: #2a2a22;
    --border: #23444d; --border-strong: #2f5761; --text: #e6f2f1; --text-2: #c2d6d6; --muted: #93adb2;
    --track: #21414a; --chrome-bg: rgb(19 42 49 / 0.94);
    --brand: #4fb8b7; --brand-strong: #7fd0cd; --brand-soft: #173f44; --brand-line: #2a6268; --on-brand: #0d1c21;
    --good: #5ccf93; --good-soft: #143528; --good-line: #22573f;
    --warn: #f3c25a; --warn-soft: #372b0f; --warn-line: #5e4813;
    --bad: #ff8a73; --bad-soft: #3b1d17; --bad-line: #66302a;
    --info: #86b6f0; --info-soft: #172a40; --info-line: #27466b;
    --neutral-soft: #1d363d; --neutral-text: #a6bcc0; --danger-strong: #ffb0a0;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 2px 8px rgb(0 0 0 / 0.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d1c21; --surface: #132a31; --surface-2: #17323a; --surface-warm: #2a2a22;
  --border: #23444d; --border-strong: #2f5761; --text: #e6f2f1; --text-2: #c2d6d6; --muted: #93adb2;
  --track: #21414a; --chrome-bg: rgb(19 42 49 / 0.94);
  --brand: #4fb8b7; --brand-strong: #7fd0cd; --brand-soft: #173f44; --brand-line: #2a6268; --on-brand: #0d1c21;
  --good: #5ccf93; --good-soft: #143528; --good-line: #22573f;
  --warn: #f3c25a; --warn-soft: #372b0f; --warn-line: #5e4813;
  --bad: #ff8a73; --bad-soft: #3b1d17; --bad-line: #66302a;
  --info: #86b6f0; --info-soft: #172a40; --info-line: #27466b;
  --neutral-soft: #1d363d; --neutral-text: #a6bcc0; --danger-strong: #ffb0a0;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 2px 8px rgb(0 0 0 / 0.25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); font-size: 15px; line-height: 1.5; }

a { color: var(--brand); text-decoration: none; font-weight: 600; }
svg.ico { width: 1.1em; height: 1.1em; flex: 0 0 auto; }
.row .chev svg.ico { width: 16px; height: 16px; }
a:hover { color: var(--brand-strong); text-decoration: underline; }

h1, h2, h3, h4 { color: var(--text); line-height: 1.2; margin: 0; font-family: var(--font-display); text-wrap: balance; }
h1 { font-size: 1.8rem; font-weight: 800; }
h2 { font-size: 1.2rem; font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0.5rem 0; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.good { color: var(--good); }
.warn { color: var(--warn); }
.bad { color: var(--bad); }
.num { font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- top bar + nav */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--chrome-bg);
  backdrop-filter: saturate(1.4) blur(8px);
  -webkit-backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner { max-width: 1080px; margin: 0 auto; padding: 0 1.25rem; height: 58px; display: flex; align-items: center; gap: 1.5rem; }
.brand { display: flex; align-items: center; gap: 0.55rem; color: var(--text); font-family: var(--font-display); font-weight: 800; font-size: 1.2rem; white-space: nowrap; }
.brand:hover { text-decoration: none; color: var(--text); }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; overflow: hidden; }
.brand-mark img { width: 100%; height: 100%; display: block; }
.brand-mark svg { width: 18px; height: 18px; }

.topnav { display: flex; gap: 0.15rem; flex: 1; }
.topnav a { color: var(--text-2); font-weight: 600; font-size: 0.9rem; padding: 0.45rem 0.75rem; border-radius: 8px; }
.topnav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.topnav a.active { background: var(--brand-soft); color: var(--brand-strong); }
.topbar .btn { margin-left: auto; }
.account-link { font-weight: 700; color: var(--text-2); padding: 0.35rem 0.7rem; border-radius: 999px; background: var(--brand-soft); white-space: nowrap; }
@media (max-width: 759px) { .account-link { margin-left: auto; } }

.tabbar { display: none; }

main { max-width: 1080px; margin: 0 auto; padding: 1.75rem 1.25rem 3rem; }

@media (max-width: 759px) {
  .topnav, .topbar .btn { display: none; }
  .topbar-inner { height: 52px; padding: 0 1rem; }
  main { padding: 1.1rem 0.9rem 1rem; }

  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--chrome-bg);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    border-top: 1px solid var(--border);
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: 0.7rem; font-weight: 600; }
  .tabbar a:hover { text-decoration: none; }
  .tabbar a svg { width: 23px; height: 23px; }
  .tabbar a.active { color: var(--brand); }
  .tabbar a.tab-upload .tab-icon { width: 42px; height: 42px; margin-top: -6px; border-radius: 13px; background: var(--brand); color: var(--on-brand); display: grid; place-items: center; box-shadow: 0 4px 12px -2px rgb(0 121 109 / 0.45); }
  .tabbar a.tab-upload svg { width: 22px; height: 22px; }
}

/* ---------------------------------------------------------------- page header */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.page-head .sub { color: var(--muted); margin: 0.3rem 0 0; }
.page-head .actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.back { display: inline-flex; align-items: center; gap: 0.25rem; font-size: 0.85rem; margin-bottom: 0.6rem; }
.eyebrow { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }

/* ---------------------------------------------------------------- layout */
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid > .card { margin-bottom: 0; }
.cols { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }
.cols > * { min-width: 0; }
@media (max-width: 899px) { .cols { grid-template-columns: 1fr; } }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin: 1.75rem 0 0.75rem; }
.section-title:first-child { margin-top: 0; }

/* ---------------------------------------------------------------- cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.15rem 1.25rem; margin-bottom: 1rem; }
.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; }
.card-head .sub { color: var(--muted); font-size: 0.85rem; margin: 0.15rem 0 0; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush .card-head { padding: 1rem 1.25rem 0; margin-bottom: 0.75rem; }
@media (max-width: 759px) { .card { padding: 1rem; border-radius: 12px; } .card.flush .card-head { padding: 0.9rem 1rem 0; } }

/* ---------------------------------------------------------------- stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 0.75rem; }
.stat { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.7rem 0.85rem; }
.stat .label { font-size: 0.75rem; font-weight: 600; color: var(--muted); }
.stat .value { font-size: 1.2rem; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 0.1rem; }
.stat .hint { font-size: 0.75rem; color: var(--muted); }
.stat.hero { background: var(--brand-soft); border-color: var(--brand-line); }
.stat.hero .value { color: var(--brand-strong); font-size: 1.45rem; }
.stat.over { background: var(--bad-soft); border-color: var(--bad-line); }
.stat.over .value { color: var(--bad); }
.kid-summary { container-type: inline-size; }
.stats.kid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stats.kid .hero { grid-column: 1 / -1; }
@container (min-width: 620px) {
  .stats.kid { grid-template-columns: 1.3fr repeat(3, minmax(0, 1fr)); }
  .stats.kid .hero { grid-column: auto; }
}

.progress { height: 8px; background: var(--track); border-radius: 999px; overflow: hidden; margin: 0.85rem 0 0.4rem; display: flex; }
.progress span { display: block; height: 100%; }
.progress .p-approved { background: var(--good); }
.progress .p-pending { background: var(--pending); }
.progress .p-marketplace { background: var(--info); }
.progress .p-draft { background: var(--draft); }
.legend { display: flex; flex-wrap: wrap; gap: 0.35rem 0.9rem; font-size: 0.75rem; color: var(--muted); }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 0.3rem; }

/* ---------------------------------------------------------------- lists (replace most tables) */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { border-top: 1px solid var(--border); }
.list > li:first-child { border-top: none; }
.card.flush .list { border-top: 1px solid var(--border); }
.row { display: flex; align-items: center; gap: 0.85rem; padding: 0.8rem 1.25rem; color: inherit; font-weight: 400; }
a.row:hover { background: var(--surface-2); text-decoration: none; color: inherit; }
.row .main { flex: 1; min-width: 0; }
.row .title { font-weight: 600; color: var(--text); }
.row .meta { font-size: 0.82rem; color: var(--muted); margin-top: 0.1rem; }
.row .side { text-align: right; flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: 0.25rem; }
.row .amount { font-weight: 700; font-variant-numeric: tabular-nums; }
.row .chev { color: var(--border-strong); flex: 0 0 auto; width: 16px; height: 16px; }
.card:not(.flush) .row { padding-left: 0; padding-right: 0; }
@media (max-width: 759px) { .row { padding: 0.75rem 1rem; } }
.empty { color: var(--muted); padding: 1rem 1.25rem; font-size: 0.9rem; }
.card:not(.flush) .empty { padding: 0.25rem 0; }

/* ---------------------------------------------------------------- badges + chips */
.badge { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.15rem 0.55rem; border-radius: 999px; font-size: 0.72rem; font-weight: 700; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.8; }
.badge.plain::before { display: none; }
.badge.draft { background: var(--neutral-soft); color: var(--neutral-text); }
.badge.ready { background: var(--brand-soft); color: var(--brand-strong); }
.badge.submitted, .badge.pending { background: var(--warn-soft); color: var(--warn); }
.badge.approved, .badge.good { background: var(--good-soft); color: var(--good); }
.badge.denied, .badge.changes_requested, .badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.ordered { background: var(--info-soft); color: var(--info); }
.badge.cancelled { background: var(--neutral-soft); color: var(--neutral-text); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.info { background: var(--info-soft); color: var(--info); }

.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.8rem; font-weight: 600; padding: 0.25rem 0.6rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); }
.chip.good { background: var(--good-soft); border-color: var(--good-line); color: var(--good); }
.chip.bad { background: var(--bad-soft); border-color: var(--bad-line); color: var(--bad); }

/* ---------------------------------------------------------------- callouts */
.callout { border: 1px solid var(--info-line); background: var(--info-soft); color: var(--text); border-radius: var(--radius-sm); padding: 0.75rem 0.9rem; margin-bottom: 1rem; font-size: 0.92rem; }
.callout > :first-child { margin-top: 0; } .callout > :last-child { margin-bottom: 0; }
.callout.good { border-color: var(--good-line); background: var(--good-soft); }
.callout.warn { border-color: var(--warn-line); background: var(--warn-soft); }
.callout.bad { border-color: var(--bad-line); background: var(--bad-soft); }
.callout ul { margin: 0.35rem 0 0; padding-left: 1.1rem; }
.callout li + li { margin-top: 0.25rem; }

/* ---------------------------------------------------------------- key/value */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 0.45rem 1.25rem; margin: 0; }
.kv dt { color: var(--muted); font-size: 0.85rem; }
.kv dd { margin: 0; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }

/* ---------------------------------------------------------------- buttons */
.btn, button {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  font: inherit; font-weight: 600; font-size: 0.9rem; line-height: 1.2;
  padding: 0.6rem 1rem; border-radius: 10px; cursor: pointer;
  background: var(--brand); color: var(--on-brand); border: 1px solid var(--brand);
  text-decoration: none; white-space: nowrap;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.btn:hover, button:hover { background: var(--brand-strong); border-color: var(--brand-strong); color: var(--on-brand); text-decoration: none; }
.btn:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid rgb(0 121 109 / 0.3); outline-offset: 2px; }
button:disabled { opacity: 0.55; cursor: not-allowed; }
.btn.secondary, button.secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn.secondary:hover, button.secondary:hover { background: var(--surface-2); color: var(--text); border-color: var(--border-strong); }
.btn.ghost, button.ghost { background: transparent; color: var(--brand); border-color: transparent; padding-left: 0.5rem; padding-right: 0.5rem; }
.btn.ghost:hover, button.ghost:hover { background: var(--brand-soft); color: var(--brand-strong); }
.btn.danger, button.danger { background: var(--bad); border-color: var(--bad); }
.btn.danger:hover, button.danger:hover { background: var(--danger-strong); border-color: var(--danger-strong); }
.btn.danger-outline, button.danger-outline { background: var(--surface); color: var(--bad); border-color: var(--bad-line); }
.btn.danger-outline:hover, button.danger-outline:hover { background: var(--bad-soft); color: var(--bad); border-color: var(--bad-line); }
.btn.sm, button.sm { padding: 0.35rem 0.65rem; font-size: 0.8rem; border-radius: 8px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-top: 0.75rem; }
@media (max-width: 759px) {
  .page-head .actions { width: 100%; }
  .page-head .actions .btn { flex: 1 1 auto; }
}
form.inline { display: inline; margin: 0; }

/* ---------------------------------------------------------------- forms */
label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--text-2); margin: 0.85rem 0 0.3rem; }
.hint { display: block; font-size: 0.78rem; font-weight: 400; color: var(--muted); margin-top: 0.15rem; }
input, select, textarea {
  width: 100%; font: inherit; font-size: 0.95rem; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 9px;
  padding: 0.55rem 0.7rem; min-height: 2.5rem;
}
input[type=checkbox], input[type=radio] { width: 1.05rem; height: 1.05rem; min-height: 0; accent-color: var(--brand); margin: 0; }
input[type=file] { padding: 0.45rem; background: var(--surface-2); }
textarea { min-height: 5.5rem; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgb(0 121 109 / 0.14); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 1rem; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 759px) { .form-grid { grid-template-columns: 1fr; } input, select, textarea { font-size: 16px; } }
.check { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; color: var(--text); }
.form-actions { margin-top: 1.1rem; display: flex; gap: 0.5rem; flex-wrap: wrap; }
form > label:first-child { margin-top: 0; }
.form-grid > div > label:first-child { margin-top: 0.85rem; }

.dropzone { border: 2px dashed var(--brand-line); background: var(--brand-soft); border-radius: var(--radius); padding: 1.5rem 1rem; text-align: center; }
.dropzone svg { width: 34px; height: 34px; color: var(--brand); }
.dropzone input[type=file] { background: var(--surface); max-width: 26rem; margin: 0.6rem auto 0; display: block; }

/* ---------------------------------------------------------------- disclosure */
details > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 0.45rem; font-weight: 600; color: var(--brand); padding: 0.5rem 0; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: ""; flex: 0 0 auto; width: 6px; height: 6px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform 0.15s ease; }
details[open] > summary::before { transform: rotate(45deg); }
details.card > summary { padding: 0; color: var(--text); font-size: 1.05rem; font-weight: 700; }
details.card > summary .sub { color: var(--muted); font-size: 0.85rem; font-weight: 400; margin-left: auto; }
details.card[open] > summary { margin-bottom: 0.75rem; }

/* ---------------------------------------------------------------- tables (desktop) → stacked rows (phone) */
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th { text-align: left; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--border); }
td { padding: 0.6rem; border-bottom: 1px solid var(--border); vertical-align: top; }
tr:last-child td { border-bottom: none; }
td.r, th.r { text-align: right; }
@media (max-width: 759px) {
  table.stack thead { display: none; }
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack tr { border-bottom: 1px solid var(--border); padding: 0.5rem 0; }
  table.stack tr:last-child { border-bottom: none; }
  table.stack td { border: none; padding: 0.15rem 0; text-align: left; }
  table.stack td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); font-size: 0.78rem; font-weight: 600; }
}

/* ---------------------------------------------------------------- purchase line items */
.item { padding: 0.85rem 0; border-top: 1px solid var(--border); }
.item:first-child { border-top: none; padding-top: 0.25rem; }
.item-top { display: flex; gap: 0.75rem; align-items: flex-start; }
.item-top .main { flex: 1; min-width: 0; }
.item-top .title { font-weight: 600; }
.item-top .meta { font-size: 0.82rem; color: var(--muted); margin-top: 0.15rem; }
.item-top .side { text-align: right; flex: 0 0 auto; }
.item.excluded .title { color: var(--muted); text-decoration: line-through; }
.item .why { font-size: 0.85rem; color: var(--text-2); margin-top: 0.35rem; }
.item details > summary { font-size: 0.85rem; padding: 0.4rem 0 0; }
.total-row { display: flex; justify-content: space-between; align-items: baseline; border-top: 2px solid var(--border); margin-top: 0.5rem; padding-top: 0.75rem; font-weight: 700; }

/* ---------------------------------------------------------------- EMA copy sheet */
.steps { counter-reset: step; }
.step .card-head h2::before { counter-increment: step; content: counter(step); display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--brand); color: var(--on-brand); font-size: 0.8rem; margin-right: 0.55rem; vertical-align: 1px; }
.field { display: grid; grid-template-columns: 1fr auto; column-gap: 0.6rem; row-gap: 0.1rem; align-items: center; border-bottom: 1px solid var(--border); padding: 0.55rem 0; }
.field:last-child { border-bottom: none; }
.field .k { grid-column: 1 / -1; color: var(--muted); font-size: 0.78rem; font-weight: 600; }
.field .v { min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.field .v .muted { font-weight: 400; }
.field input { min-width: 0; margin: 0; }
.field.long .v { font-weight: 400; }
.field.three { grid-template-columns: 1fr auto auto; }
button.copy { padding: 0.35rem 0.75rem; font-size: 0.8rem; border-radius: 8px; background: var(--brand-soft); color: var(--brand-strong); border: 1px solid var(--brand-line); }
button.copy:hover { background: var(--brand-soft); color: var(--brand-strong); border-color: var(--brand-line); }
button.copy.done { background: var(--good); border-color: var(--good); color: var(--on-brand); }
.pick { font-size: 0.72rem; color: var(--muted); border: 1px dashed var(--border-strong); border-radius: 7px; padding: 0.2rem 0.45rem; white-space: nowrap; }
.sub-card { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.2rem 0.9rem 0.5rem; margin: 0.75rem 0; background: var(--surface); }
.sub-card > h3 { padding: 0.65rem 0 0.2rem; }
.sub-card.skip { background: var(--surface-2); color: var(--muted); padding: 0.6rem 0.9rem; }
.sub-card.skip .title { text-decoration: line-through; }
.tick { font-weight: 700; }
.tick.yes { color: var(--good); }
.tick.no { color: var(--bad); }

/* ---------------------------------------------------------------- split */
.split-line { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.75rem 0.9rem; margin: 0.6rem 0; }
.split-line .title { font-weight: 600; }
.split-line .meta { color: var(--muted); font-size: 0.82rem; margin-bottom: 0.35rem; }
.kidrow { display: grid; grid-template-columns: 1fr 5.5rem; gap: 0.5rem; align-items: center; margin: 0.3rem 0; }
.kidrow label { margin: 0; }
.kidrow input { text-align: center; margin: 0; }
.left { font-size: 0.8rem; margin-top: 0.25rem; }
@media (min-width: 760px) {
  .split-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 1.25rem; align-items: center; }
  .split-line .kids { display: flex; gap: 1rem; }
  .split-line .kidrow { grid-template-columns: auto 4.5rem; }
  .split-line .left { grid-column: 1 / -1; }
}

/* ---------------------------------------------------------------- chart */
.bar-chart { display: block; max-width: 100%; height: auto; }
.bar-chart rect { fill: var(--brand); }
.bar-chart text { font-family: inherit; }

/* ---------------------------------------------------------------- chat */
.chat-msg + .chat-msg { border-top: 1px solid var(--border); padding-top: 0.9rem; margin-top: 0.9rem; }
.chat-q { font-weight: 600; }
.chat-a { white-space: pre-wrap; color: var(--text-2); margin-top: 0.35rem; }
.chat-meta { font-size: 0.78rem; color: var(--muted); margin-top: 0.4rem; }

/* ---------------------------------------------------------------- tasks */
.task { display: flex; align-items: flex-start; gap: 0.75rem; padding: 0.75rem 0; border-top: 1px solid var(--border); }
.task:first-child { border-top: none; padding-top: 0.25rem; }
.task .main { flex: 1; min-width: 0; }
.task .title { font-weight: 600; }
.task .meta { font-size: 0.82rem; color: var(--muted); margin-top: 0.1rem; }
.task .due { font-size: 0.8rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.task .due.overdue { color: var(--bad); }
.task .due.soon { color: var(--warn); }
button.done-btn { width: 1.7rem; height: 1.7rem; min-height: 0; padding: 0; border-radius: 50%; background: var(--surface); border: 2px solid var(--border-strong); color: transparent; font-size: 0.8rem; }
button.done-btn:hover { background: var(--good-soft); border-color: var(--good); color: var(--good); }

/* ---------------------------------------------------------------- more menu */
.menu .row .ico { width: 2.1rem; height: 2.1rem; border-radius: 9px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; flex: 0 0 auto; }
.menu .row .ico svg { width: 18px; height: 18px; }

/* ---------------------------------------------------------------- processing overlay */
.processing-overlay { position: fixed; inset: 0; background: rgb(15 23 42 / 0.6); z-index: 1000; display: none; align-items: center; justify-content: center; flex-direction: column; gap: 1rem; padding: 1.5rem; text-align: center; }
.processing-overlay.visible { display: flex; }
.processing-spinner { width: 3rem; height: 3rem; border-radius: 50%; border: 5px solid rgb(255 255 255 / 0.25); border-top-color: #fff; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.processing-message { color: #fff; font-weight: 700; font-size: 1.1rem; max-width: 26rem; }
.processing-submessage { color: rgb(255 255 255 / 0.8); font-size: 0.85rem; max-width: 24rem; }

/* ---------------------------------------------------------------- approval tracker (dashboard) */
.tracker .tr-h { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin: 1.1rem 0 0.4rem; }
.tr-req { border-top: 1px solid var(--border); padding: 0.6rem 0; }
.tr-req > summary { display: block; position: relative; padding: 0 0 0 1rem; color: var(--text); font-weight: 400; }
.tr-req > summary::before { position: absolute; left: 0.1rem; top: 0.5rem; color: var(--muted); }
.tr-req > summary > * { display: block; }
.tr-req > summary > .tr-top { display: flex; justify-content: space-between; gap: 0.75rem; align-items: baseline; }
.tr-name { font-weight: 650; color: var(--text); }
.tr-meta { font-size: 0.8rem; color: var(--muted); margin-top: 0.1rem; }
.tr-amt { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.tr-bar { height: 6px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; margin-top: 0.4rem; overflow: hidden; }
.tr-bar span { display: block; height: 100%; background: var(--good); border-radius: 999px; }
.tr-items { list-style: none; margin: 0.4rem 0 0; padding: 0; font-size: 0.88rem; }
.tr-items li { display: flex; justify-content: space-between; gap: 0.75rem; padding: 0.3rem 0; }
.tr-items:not(.recent) li { padding-left: 0.75rem; border-left: 2px solid var(--border); }
.tr-items.recent li { border-top: 1px solid var(--border); padding: 0.5rem 0; align-items: center; }
.tr-items.recent li:first-child { border-top: 0; }
.tr-main { min-width: 0; }
.tr-main a { color: var(--text); font-weight: 600; }
.tr-side { display: flex; gap: 0.5rem; align-items: center; flex-shrink: 0; }
.tr-est { color: var(--brand-strong); }
.tr-est.late { color: var(--warn); }
table.timeline td { vertical-align: top; }
.warn-text { color: var(--warn); }
.table-wrap { overflow-x: auto; }

/* ---------------------------------------------------------------- brand extras */
.btn.accent, button.accent { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.accent:hover, button.accent:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--on-accent); }
:where(a, button, .btn, input, select, textarea, summary):focus-visible { outline: 3px solid var(--highlight); outline-offset: 2px; }
.stat .value, .tr-amt, .amount { font-variant-numeric: tabular-nums; }
.stat .value { font-family: var(--font-display); }
.site-foot { max-width: 1080px; margin: 0.5rem auto 0; padding: 1rem 1.25rem calc(var(--tabbar-h) + 1.25rem + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); color: var(--muted); font-size: 0.8rem; display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; justify-content: space-between; }
.site-foot a { color: var(--muted); font-weight: 500; }
@media (min-width: 760px) { .site-foot { padding-bottom: 1.5rem; } }

/* setup checklist + feedback link */
.setup { border-color: var(--brand-line); background: linear-gradient(180deg, var(--brand-soft), var(--surface) 70%); }
.setup-list { list-style: none; margin: 0.4rem 0 0; padding: 0; display: grid; gap: 0.6rem; }
.setup-list li { display: flex; gap: 0.75rem; align-items: flex-start; }
.setup-list .tick { flex: 0 0 auto; width: 1.7rem; height: 1.7rem; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-family: var(--font-display); background: var(--surface); border: 2px solid var(--brand-line); color: var(--brand-strong); }
.setup-list li.done .tick { background: var(--good); border-color: var(--good); color: var(--on-brand); }
.setup-list li.done .title { color: var(--muted); text-decoration: line-through; }
.setup-list li.soon { opacity: 0.75; }
.setup-list .title { font-weight: 650; }
.setup-list .meta { color: var(--muted); font-size: 0.85rem; }
.feedback-link { color: var(--muted); font-weight: 600; font-size: 0.85rem; white-space: nowrap; }
@media (max-width: 759px) { .feedback-link { margin-left: auto; } .feedback-link + .account-link { margin-left: 0.5rem; } }

/* Set up with EMA + import review */
.setup-steps { list-style: none; margin: 0; padding: 0; }
.setup-steps > li.card.done { border-color: var(--good-line); background: var(--good-soft); }
.setup-steps > li.card.done h2::after { content: " ✓"; color: var(--good); }
.change-list { list-style: none; margin: 0; padding: 0; }
.change-list li { display: flex; gap: 0.7rem; padding: 0.7rem 0; border-top: 1px solid var(--border); }
.change-list li:first-child { border-top: 0; }
.change-list input[type=checkbox] { margin-top: 0.25rem; flex: none; width: 1.1rem; height: 1.1rem; }
.change-list .title { font-weight: 600; }
.change-list ul { margin: 0.2rem 0 0; padding-left: 1.1rem; color: var(--muted); font-size: 0.92rem; }
.change-list li.skip { opacity: 0.7; }
.setup-steps > li.card.current { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.setup-steps > li.card.done .sub { color: var(--good); }
.substeps { list-style: none; margin: 0.4rem 0 0; padding: 0; }
.substeps > li { display: flex; gap: 0.7rem; padding: 0.6rem 0; border-top: 1px solid var(--border); }
.substeps > li:first-child { border-top: 0; }
.substeps .sub-n { flex: none; width: 1.6rem; height: 1.6rem; border-radius: 50%; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand-strong); font-weight: 700; font-size: 0.85rem; }
.substeps > li.done .sub-n { background: var(--good); color: var(--on-brand); }
.substeps p { margin: 0.35rem 0 0; }
.ok-text { color: var(--good); font-weight: 600; }
