/* SPA Dashboard. Apple Health-style cards, one accent, system type. */
:root {
  --bg: #f2f2f7;
  --side: #f7f7f9;
  --card: #ffffff;
  --ink: #1d1d1f;
  --ink-2: #515154;
  --ink-3: #86868b;
  --line: rgba(0, 0, 0, .08);
  --line-2: rgba(0, 0, 0, .05);
  --fill: rgba(118, 118, 128, .12);
  --fill-2: rgba(118, 118, 128, .08);
  --accent: #ff4b00;
  --accent-ink: #e04200;
  --accent-soft: rgba(255, 75, 0, .1);
  --green: #1f9d55;
  --green-soft: rgba(31, 157, 85, .12);
  --amber: #c27400;
  --amber-soft: rgba(255, 159, 10, .16);
  --red: #d70015;
  --red-soft: rgba(215, 0, 21, .1);
  --pill-dark: #1d1d1f;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 4px 14px rgba(0, 0, 0, .04);
  --r: 18px;
  --r-sm: 12px;
  --side-w: 256px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000; --side: #0b0b0d; --card: #1c1c1e; --ink: #f5f5f7; --ink-2: #c7c7cc; --ink-3: #8e8e93;
    --line: rgba(255, 255, 255, .1); --line-2: rgba(255, 255, 255, .06); --fill: rgba(118, 118, 128, .24); --fill-2: rgba(118, 118, 128, .16);
    --accent: #ff5f1f; --accent-ink: #ff7a45; --accent-soft: rgba(255, 95, 31, .16); --green: #30d158; --green-soft: rgba(48, 209, 88, .16);
    --amber: #ffb340; --amber-soft: rgba(255, 179, 64, .16); --red: #ff6961; --red-soft: rgba(255, 105, 97, .16); --pill-dark: #f5f5f7;
    --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #000; --side: #0b0b0d; --card: #1c1c1e; --ink: #f5f5f7; --ink-2: #c7c7cc; --ink-3: #8e8e93;
  --line: rgba(255, 255, 255, .1); --line-2: rgba(255, 255, 255, .06); --fill: rgba(118, 118, 128, .24); --fill-2: rgba(118, 118, 128, .16);
  --accent: #ff5f1f; --accent-ink: #ff7a45; --accent-soft: rgba(255, 95, 31, .16); --green: #30d158; --green-soft: rgba(48, 209, 88, .16);
  --amber: #ffb340; --amber-soft: rgba(255, 179, 64, .16); --red: #ff6961; --red-soft: rgba(255, 105, 97, .16); --pill-dark: #f5f5f7;
  --shadow: none; color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 15px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased; letter-spacing: -.005em;
}
h1, h2, h3 { margin: 0; color: var(--ink); font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", system-ui, sans-serif; }
h1 { font-size: 30px; line-height: 1.12; font-weight: 700; letter-spacing: -.025em; }
h2 { font-size: 19px; line-height: 1.25; font-weight: 650; letter-spacing: -.015em; }
h3 { font-size: 16px; line-height: 1.3; font-weight: 600; letter-spacing: -.01em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); font-size: 13px; }
.small { font-size: 13px; }
em { font-style: normal; color: var(--ink-3); font-weight: 400; }
.ic { width: 20px; height: 20px; flex: none; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; border-radius: 8px; }

/* ---------- shell ---------- */
#app { min-height: 100vh; }
.side {
  position: fixed; inset: 0 auto 0 0; width: var(--side-w); background: var(--side);
  border-right: 1px solid var(--line-2); display: flex; flex-direction: column; padding: 18px 12px 16px; overflow-y: auto; z-index: 5;
}
.who { display: flex; gap: 12px; align-items: center; padding: 14px 12px; margin-bottom: 14px; background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); }
.who b { display: block; font-size: 15px; font-weight: 600; line-height: 1.25; }
.who small { display: block; font-size: 12.5px; color: var(--ink-2); line-height: 1.35; }
.who small.faint { color: var(--ink-3); }
.avatar { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(140deg, #ff7a3d, var(--accent)); color: #fff; font-weight: 600; font-size: 13px; flex: none; letter-spacing: 0; }
.avatar.lg { width: 42px; height: 42px; font-size: 15px; }
.avatar.xl { width: 64px; height: 64px; font-size: 22px; }
.nav-h { margin: 16px 12px 6px; font-size: 11.5px; font-weight: 600; color: var(--ink-3); letter-spacing: .02em; }
.side nav a, .side-foot a, .side-foot button {
  display: flex; align-items: center; gap: 11px; padding: 8px 12px; border-radius: 10px; color: var(--ink-2);
  font-size: 14.5px; font-weight: 500; border: 0; background: none; width: 100%; text-align: left; transition: background .15s, color .15s, transform .1s;
}
.side nav a:hover, .side-foot a:hover, .side-foot button:hover { background: var(--fill-2); color: var(--ink); }
.side nav a:active, .side-foot button:active { transform: scale(.98); }
.side nav a.on { background: var(--pill-dark); color: var(--card); }
.side nav a.on .ic { color: var(--card); }
.side-foot { margin-top: auto; padding-top: 16px; }
.side-foot .brand { display: block; margin: 14px 12px 2px; font-size: 12px; font-weight: 600; color: var(--ink-3); letter-spacing: .01em; }

.main { margin-left: var(--side-w); min-height: 100vh; }
.top { position: sticky; top: 0; z-index: 4; height: 52px; display: flex; align-items: center; justify-content: space-between; padding: 0 32px;
  background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); }
.top-title { font-weight: 600; font-size: 15px; opacity: 0; transition: opacity .2s; }
.save { font-size: 12.5px; color: var(--ink-3); display: inline-flex; gap: 8px; align-items: center; margin-left: auto; }
.save::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.save.saving::before { background: var(--amber); }
.save.error { color: var(--red); }
.save.error::before { background: var(--red); }
.save button { border: 0; background: none; color: var(--accent-ink); font-weight: 600; padding: 0; }

#view { outline: none; }
.page { max-width: 1120px; margin: 0 auto; padding: 8px 32px 72px; }
.page.narrow, .sub.narrow { max-width: 720px; }
.arrive { animation: arrive .32s var(--ease) both; }
@keyframes arrive { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .arrive { animation: fade .2s both; } @keyframes fade { from { opacity: 0; } } }

.tabbar { display: none; }
.sheet, .sheet-scrim { display: none; }

/* ---------- page parts ---------- */
.hello { padding: 22px 0 22px; }
.hello .date { font-size: 13px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.hello h1 { font-size: 34px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 22px 0 22px; }
.page-head p { margin-top: 6px; max-width: 620px; }
.section-h { display: flex; align-items: baseline; justify-content: space-between; margin: 32px 2px 12px; }
.section-h h2 { font-size: 21px; }
.eyebrow { font-size: 12.5px; font-weight: 600; color: var(--accent-ink); margin-bottom: 6px; }

.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.two-one { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); align-items: start; }
.grid.one-one { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; }
.grid.calc { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: start; }
.page > * + .grid, .page > * + .card, .sub > * + .grid, .sub > * + .card { margin-top: 16px; }
.page > :is(.section-h, .page-head, .hello, .toolbar, .tally, .chips, .step-hero, .banner, .stepper-dots, .back, .client-hero, .tabs) + *,
.sub > :is(.section-h, .page-head, .hello, .toolbar, .tally, .banner) + * { margin-top: 0; }

.card { background: var(--card); border-radius: var(--r); padding: 18px 20px; box-shadow: var(--shadow); min-width: 0; }
a.card { display: block; transition: transform .12s var(--ease), box-shadow .2s; }
a.card:active { transform: scale(.985); }
a.card:hover .chev { transform: translateX(2px); color: var(--ink-2); }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; min-height: 22px; }
.card-h.pad { margin-bottom: 4px; }
.card-f { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line-2); }
.card-f .link { margin-left: auto; }
.label { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.label .ic { width: 17px; height: 17px; }
.label.orange { color: var(--accent-ink); }
.label.green { color: var(--green); }
.chev { width: 16px; height: 16px; color: var(--ink-3); transition: transform .15s var(--ease); }

.pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; background: var(--fill); color: var(--ink-2); font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill.orange { background: var(--accent-soft); color: var(--accent-ink); }
.pill.green { background: var(--green-soft); color: var(--green); }
.pill.red { background: var(--red-soft); color: var(--red); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 0 16px; border-radius: 999px; border: 0;
  background: var(--fill); color: var(--ink); font-weight: 600; font-size: 14.5px; transition: transform .1s var(--ease), background .15s, opacity .15s; white-space: nowrap; }
.btn .ic { width: 17px; height: 17px; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-ink); }
.btn.ghost { background: var(--fill-2); }
.btn.ghost:hover { background: var(--fill); }
.btn.danger { color: var(--red); }
.btn.wide { width: 100%; }
.btn.sm { min-height: 32px; padding: 0 12px; font-size: 13.5px; }
.btn:disabled { opacity: .5; pointer-events: none; }
.link { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; padding: 0; color: var(--accent-ink); font-weight: 600; font-size: 14px; }
.link .ic { width: 16px; height: 16px; }
.link.danger { color: var(--red); }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--fill-2); color: var(--ink-2); flex: none; }
.icon-btn:active { transform: scale(.94); }
.icon-btn:disabled { opacity: .35; }
.icon-btn .ic { width: 17px; height: 17px; }

/* banner */
.banner { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: var(--r); background: var(--accent); color: #fff; margin-bottom: 16px; transition: transform .12s var(--ease); }
.banner:active { transform: scale(.99); }
.banner b { display: block; font-size: 16px; }
.banner small { display: block; opacity: .9; font-size: 13.5px; }
.banner .chev { color: #fff; margin-left: auto; }
.banner-ic { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: rgba(255, 255, 255, .2); }

/* plan */
.plan-card h2 { font-size: 22px; margin-bottom: 6px; }
.summary { color: var(--ink-2); margin-bottom: 10px; }
.checklist { list-style: none; margin: 6px 0 0; padding: 0; }
.checklist li + li { border-top: 1px solid var(--line-2); }
.check { display: flex; gap: 12px; align-items: flex-start; padding: 11px 0; cursor: pointer; }
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check .box { flex: none; display: grid; place-items: center; width: 22px; height: 22px; margin-top: 1px; border-radius: 50%; border: 1.7px solid var(--ink-3); transition: background .18s var(--ease), border-color .18s, transform .1s; }
.check .box .ic { width: 14px; height: 14px; color: #fff; opacity: 0; transform: scale(.6); transition: opacity .15s, transform .2s var(--ease); stroke-width: 2.4; }
.check:active .box { transform: scale(.9); }
.check.done .box { background: var(--accent); border-color: var(--accent); }
.check.done .box .ic { opacity: 1; transform: none; }
.check .txt b { font-weight: 500; display: block; transition: color .2s; }
.check.done .txt b { color: var(--ink-3); }
.check .txt small { display: block; color: var(--ink-3); font-size: 13px; margin-top: 2px; }
.check input:focus-visible + .box { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }
.check input:disabled ~ * { cursor: default; }
.empty-sm { padding: 14px 0 6px; }
.empty-sm h2 { font-size: 18px; margin-bottom: 6px; }

.next-card h2 { font-size: 20px; margin-bottom: 6px; }
.next-card .btn { margin-top: 16px; }
.meter { height: 6px; border-radius: 99px; background: var(--fill); overflow: hidden; margin: 16px 0 8px; }
.meter i { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .4s var(--ease); }

/* metric card (Apple Health) */
.metric .card-h { margin-bottom: 18px; }
.metric .label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.metric-b { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.metric strong, .big { font-size: 34px; font-weight: 650; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.big { display: block; margin: 2px 0 10px; }
.huge { display: block; font-size: 46px; font-weight: 700; letter-spacing: -.035em; line-height: 1; margin: 10px 0 18px; font-variant-numeric: tabular-nums; }
.unit { display: inline-block; margin-left: 6px; font-size: 15px; font-weight: 500; color: var(--ink-3); letter-spacing: 0; }
.bars { display: inline-flex; align-items: flex-end; gap: 4px; flex: none; }
.bars i { display: block; width: 7px; border-radius: 3px; background: var(--fill); }
.bars i.zero { opacity: .55; }
.bars i.now { background: var(--accent); }

.row-kv { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line-2); font-size: 14.5px; }
.row-kv span { color: var(--ink-2); }
.row-kv b { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.row-kv.stack { flex-direction: column; gap: 2px; }
.row-kv.stack b { text-align: left; font-weight: 500; }

.ring-track { fill: none; stroke: var(--fill); stroke-width: 4.5; }
.ring-fill { fill: none; stroke: var(--accent); stroke-width: 4.5; stroke-linecap: round; transition: stroke-dashoffset .6s var(--ease); }
.ring { flex: none; }

/* six-step strip */
.steps-strip { margin-top: 16px; }
.steps-strip ol { list-style: none; margin: 4px 0 0; padding: 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.steps-strip a { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border-radius: 14px; transition: background .15s; }
.steps-strip a:hover { background: var(--fill-2); }
.steps-strip .n { position: absolute; top: 20px; font-size: 13px; font-weight: 650; }
.steps-strip b { font-size: 14px; font-weight: 600; margin-top: 4px; }
.steps-strip small { font-size: 12px; color: var(--ink-3); }
.steps-strip li.now a { background: var(--accent-soft); }
.steps-strip li.now b { color: var(--accent-ink); }

/* toolbar / segmented */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.week-nav { display: flex; align-items: center; gap: 12px; }
.week-nav b { display: block; font-size: 16px; }
.week-nav small { display: block; font-size: 12.5px; color: var(--ink-3); }
.seg { display: inline-flex; padding: 3px; border-radius: 11px; background: var(--fill); gap: 2px; max-width: 100%; }
.seg.scroll { overflow-x: auto; scrollbar-width: none; }
.seg button { border: 0; background: none; padding: 6px 14px; border-radius: 8px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); white-space: nowrap; transition: background .15s, color .15s; }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }
.tally { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; color: var(--ink-2); }
.tally .ring { width: 28px; height: 28px; }

/* KPI entry */
.kpi h3 { margin-bottom: 14px; }
.kpi-row { display: flex; align-items: center; gap: 14px; }
.kpi-row .bars { margin-left: auto; }
.stepper { display: inline-flex; align-items: center; background: var(--fill-2); border-radius: 999px; padding: 3px; }
.stepper button { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--card); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); transition: transform .1s; }
.stepper button:active { transform: scale(.9); }
.stepper button .ic { width: 16px; height: 16px; }
.stepper input { width: 52px; border: 0; background: none; text-align: center; font-size: 22px; font-weight: 650; font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
.target { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-3); }
.target input { width: 52px; padding: 5px 6px; border: 1px solid var(--line); border-radius: 8px; background: transparent; text-align: center; font-variant-numeric: tabular-nums; }
.why { margin-top: 14px; border-top: 1px solid var(--line-2); padding-top: 10px; }
.why summary { cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--ink-2); list-style: none; }
.why summary::-webkit-details-marker { display: none; }
.why summary::after { content: " +"; color: var(--ink-3); }
.why[open] summary::after { content: " −"; }
.why p { font-size: 14px; color: var(--ink-2); margin-top: 8px; }

/* deals */
.deal { cursor: pointer; transition: transform .12s var(--ease); }
.deal:active { transform: scale(.985); }
.deal h3 { margin-bottom: 8px; }
.deal .next { display: flex; gap: 6px; align-items: flex-start; margin-top: 10px; font-size: 14px; color: var(--ink-2); }
.deal .next .ic { width: 16px; height: 16px; margin-top: 2px; color: var(--accent); }
.deal .link { margin-top: 10px; }
.fold-plain { margin-top: 18px; }
.fold-plain summary { cursor: pointer; font-weight: 600; color: var(--ink-2); padding: 6px 2px; }
.fold-plain > .grid { margin-top: 10px; }

/* forms */
.form-card { padding: 22px; }
.form-card > h2 { margin-bottom: 4px; }
.form-card > p.muted { margin-bottom: 14px; }
.field { display: block; margin-top: 14px; }
.field > span:first-child { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.field small { display: block; font-size: 12.5px; color: var(--ink-3); margin-top: 5px; }
.field input:not([type=checkbox]), .field select, .field textarea, .save-row input, .search input {
  width: 100%; padding: 11px 13px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--bg); font-size: 16px;
  transition: border-color .15s, box-shadow .15s, background .15s; -webkit-appearance: none; appearance: none;
}
.field select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2386868b' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 18px; padding-right: 36px; }
.field textarea { resize: vertical; min-height: 84px; line-height: 1.45; }
.field input:focus, .field select:focus, .field textarea:focus, .save-row input:focus, .search input:focus { outline: none; border-color: var(--accent); background: var(--card); box-shadow: 0 0 0 4px var(--accent-soft); }
.field input:disabled, .field select:disabled, .field textarea:disabled { opacity: .55; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.field-row.three { grid-template-columns: repeat(3, 1fr); }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.field-grid .field:nth-child(-n+2) { margin-top: 0; }
.money-in, .unit-in { position: relative; display: block; }
.money-in i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); font-style: normal; color: var(--ink-3); }
.money-in input { padding-left: 28px !important; }
.unit-in i { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-style: normal; color: var(--ink-3); font-size: 13px; pointer-events: none; }
.unit-in input { padding-right: 40px !important; }
.form-error { color: var(--red); font-size: 14px; min-height: 0; margin-top: 10px; }
.form-error:empty { display: none; }
.form-f { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 20px; }
.btn-pair { display: inline-flex; gap: 8px; }
.form-card > .small.faint { margin-top: 12px; }
.pot { margin-top: 18px; padding: 16px; border-radius: var(--r-sm); background: var(--green-soft); }
.pot span { display: block; font-size: 13.5px; font-weight: 600; color: var(--green); }
.pot strong { display: block; font-size: 30px; font-weight: 700; letter-spacing: -.03em; margin: 2px 0 4px; }
.pot small { color: var(--ink-2); font-size: 13px; }
.stepper-dots { list-style: none; margin: 0 0 16px; padding: 0; display: flex; gap: 8px; flex-wrap: wrap; }
.stepper-dots button { display: inline-flex; align-items: center; gap: 8px; border: 0; background: var(--fill-2); color: var(--ink-2); padding: 6px 14px 6px 6px; border-radius: 999px; font-weight: 600; font-size: 13.5px; }
.stepper-dots button span { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--card); font-size: 12px; }
.stepper-dots button span .ic { width: 14px; height: 14px; stroke-width: 2.4; }
.stepper-dots .on button { background: var(--pill-dark); color: var(--card); }
.stepper-dots .on button span { color: var(--ink); }
.stepper-dots .past button span { background: var(--accent); color: #fff; }
.answers h2 { margin-bottom: 8px; }
.qa { padding: 10px 0; border-top: 1px solid var(--line-2); }
.qa span { display: block; font-size: 13px; color: var(--ink-3); font-weight: 600; }
.qa p { white-space: pre-wrap; }

/* dialog as sheet */
.sheet-dialog { border: 0; padding: 0; border-radius: 22px; background: var(--card); color: var(--ink); width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); box-shadow: 0 24px 80px rgba(0, 0, 0, .25); }
.sheet-dialog::backdrop { background: rgba(0, 0, 0, .3); backdrop-filter: blur(2px); }
.sheet-dialog[open] { animation: pop .28s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.sheet-dialog form { padding: 20px 22px 22px; }
.dialog-h { display: flex; justify-content: space-between; align-items: center; }
.dialog-f { display: flex; justify-content: space-between; gap: 10px; margin-top: 20px; }
.dialog-f .btn.primary { margin-left: auto; }

/* empty states */
.empty { text-align: center; padding: 56px 24px; background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); }
.empty h2 { margin: 14px 0 6px; font-size: 20px; }
.empty p { max-width: 420px; margin: 0 auto 16px; }
.empty-ic { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); }
.empty-ic .ic { width: 26px; height: 26px; }

/* folds */
.fold summary { display: flex; align-items: center; gap: 12px; cursor: pointer; list-style: none; }
.fold summary::-webkit-details-marker { display: none; }
.fold summary > span:first-child { flex: 1; }
.fold summary b { display: block; }
.fold summary small { display: block; color: var(--ink-3); font-size: 13px; }
.fold[open] summary .chev { transform: rotate(90deg); }
.fold[open] summary { margin-bottom: 10px; }
.list { display: grid; gap: 10px; }

/* steps */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 18px 0 4px; scrollbar-width: none; }
.chips a { display: inline-flex; align-items: center; gap: 7px; padding: 6px 14px 6px 8px; border-radius: 999px; background: var(--card); font-weight: 600; font-size: 13.5px; color: var(--ink-2); white-space: nowrap; box-shadow: var(--shadow); }
.chips a:not(:has(svg)) { padding-left: 14px; }
.chips a.on { background: var(--pill-dark); color: var(--card); }
.chips .ring { width: 22px; height: 22px; }
.chips a.on .ring-track { stroke: rgba(255, 255, 255, .25); }
.step-hero { display: flex; gap: 20px; align-items: flex-start; padding: 22px 0 26px; }
.step-num { flex: none; display: grid; place-items: center; width: 64px; height: 64px; border-radius: 20px; background: var(--accent); color: #fff; font-size: 30px; font-weight: 700; }
.step-hero h1 { margin-bottom: 8px; }
.step-hero .muted { max-width: 640px; font-size: 16px; }
.lessons { display: grid; gap: 10px; }
.lesson { display: flex; gap: 14px; background: var(--card); border-radius: var(--r); padding: 16px 18px; box-shadow: var(--shadow); }
.lesson > span { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--fill); font-size: 13px; font-weight: 650; }
.lesson h3 { margin-bottom: 4px; }
.lesson p { color: var(--ink-2); font-size: 14.5px; }
.sticky { position: sticky; top: 68px; margin-top: 44px; }
.gate { margin: 14px 0; padding: 14px; border-radius: var(--r-sm); background: var(--fill-2); font-size: 14px; }
.gate b { display: block; margin-bottom: 4px; }
.gate p { color: var(--ink-2); }
.list-card { padding: 6px 20px; }
.acc { border-top: 1px solid var(--line-2); }
.list-card > .acc:first-child, .list-card > .card-h + .acc { border-top: 0; }
.acc summary { display: flex; align-items: center; gap: 12px; padding: 14px 0; cursor: pointer; list-style: none; }
.acc summary::-webkit-details-marker { display: none; }
.acc summary b { flex: 1; font-weight: 600; }
.acc summary .n { font-size: 12.5px; font-weight: 650; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.acc .plus { width: 16px; height: 16px; color: var(--ink-3); transition: transform .2s var(--ease); }
.acc[open] .plus { transform: rotate(45deg); }
.acc p { padding: 0 0 16px; color: var(--ink-2); font-size: 14.5px; }
.acc .n + b + .plus { margin-left: auto; }
.ticks, .dots { margin: 0; padding: 0; list-style: none; }
.ticks li, .dots li { position: relative; padding: 8px 0 8px 26px; border-top: 1px solid var(--line-2); font-size: 14.5px; }
.ticks li:first-child, .dots li:first-child { border-top: 0; }
.ticks li::before { content: ""; position: absolute; left: 0; top: 11px; width: 16px; height: 16px; border-radius: 50%; background: var(--green-soft); }
.ticks li::after { content: ""; position: absolute; left: 5px; top: 15px; width: 6px; height: 3px; border-left: 1.8px solid var(--green); border-bottom: 1.8px solid var(--green); transform: rotate(-45deg); }
.dots li::before { content: ""; position: absolute; left: 6px; top: 16px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.example { margin-top: 16px; }
.example h2 { margin-bottom: 6px; }
.kv-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line-2); border-radius: var(--r-sm); overflow: hidden; margin: 16px 0; }
.kv-grid div { background: var(--card); padding: 12px 14px; }
.kv-grid dt { font-size: 12.5px; color: var(--ink-3); font-weight: 600; }
.kv-grid dd { margin: 2px 0 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.lesson-line { padding: 12px 14px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 10px 10px 0; margin-bottom: 14px; }
.sources { margin-top: 28px; }
.call h3 { margin: 4px 0 6px; }
.call .muted { font-size: 14.5px; margin-bottom: 12px; }
.call .btn .ic { width: 14px; height: 14px; fill: currentColor; }
.search { position: relative; flex: 1; min-width: 220px; max-width: 380px; display: block; }
.search .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--ink-3); }
.search input { padding-left: 38px !important; background: var(--card) !important; border-color: transparent !important; box-shadow: var(--shadow); }

/* calculator */
#results > * + * { margin-top: 16px; }
@media (max-width: 760px) { #results > * + * { margin-top: 12px; } }
.hero-result .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hero-result .pair div { padding: 12px 14px; border-radius: var(--r-sm); background: var(--fill-2); }
.hero-result .pair span { display: block; font-size: 12.5px; color: var(--ink-3); font-weight: 600; }
.hero-result .pair b { font-size: 20px; font-variant-numeric: tabular-nums; }
.check-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line-2); }
.check-row .dot { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; flex: none; font-weight: 700; font-size: 13px; }
.check-row .dot .ic { width: 14px; height: 14px; stroke-width: 2.4; }
.check-row.pass .dot { background: var(--green-soft); color: var(--green); }
.check-row.fail .dot { background: var(--amber-soft); color: var(--amber); }
.check-row span:nth-child(2) { flex: 1; }
.check-row b { display: block; font-weight: 500; font-size: 14.5px; }
.check-row small { display: block; color: var(--ink-3); font-size: 12.5px; }
.check-row strong { font-variant-numeric: tabular-nums; font-weight: 650; }
.warn { background: var(--amber-soft); box-shadow: none; }
.warn h3 { margin-bottom: 4px; }
.save-row { display: flex; gap: 10px; margin-bottom: 14px; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; font-variant-numeric: tabular-nums; }
th, td { padding: 10px 12px; text-align: right; border-top: 1px solid var(--line-2); white-space: nowrap; }
thead th { border-top: 0; color: var(--ink-3); font-weight: 600; font-size: 12.5px; vertical-align: bottom; }
tbody th, thead th:first-child { text-align: left; font-weight: 600; color: var(--ink-2); }
td.good { color: var(--green); font-weight: 600; }
td.bad { color: var(--red); font-weight: 600; }
.th-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 4px; }
.th-actions .link { font-size: 12.5px; }

/* coach */
.tiles .tile { padding: 16px 18px; }
.tile strong { display: block; font-size: 30px; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; }
.tile span { color: var(--ink-2); font-size: 13.5px; }
.tile.green strong { color: var(--green); }
.tile.amber strong { color: var(--amber); }
.table-card { padding: 4px 8px; margin-top: 16px; }
.client-head, .client-row { display: grid; grid-template-columns: minmax(200px, 2.2fr) 1fr 1.6fr 1.6fr 1fr 18px; gap: 12px; align-items: center; padding: 12px; }
.client-head { font-size: 12.5px; font-weight: 600; color: var(--ink-3); }
.client-row { border-top: 1px solid var(--line-2); border-radius: 12px; transition: background .15s; font-size: 14.5px; }
.client-row:hover { background: var(--fill-2); }
.client-row:active { transform: scale(.995); }
.client-row.paused { opacity: .55; }
.client-row small { display: block; font-size: 12.5px; color: var(--ink-3); }
.who-cell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.who-cell b { font-weight: 600; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; background: var(--ink-3); vertical-align: 1px; }
.dot.green { background: var(--green); }
.dot.amber { background: #ff9f0a; }
.dot.red { background: var(--red); }
.back { display: inline-flex; align-items: center; gap: 2px; margin-top: 16px; color: var(--accent-ink); font-weight: 600; font-size: 14.5px; }
.back .ic { width: 18px; height: 18px; }
.client-hero { display: flex; gap: 18px; align-items: center; padding: 16px 0 18px; }
.client-hero .meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 10px 12px; font-weight: 600; font-size: 14.5px; color: var(--ink-3); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a.on { color: var(--ink); border-color: var(--accent); }
.sub { max-width: none; }
.sub .page-head { display: none; }
.sub .hello { display: none; }
.private { border: 1px solid var(--accent-soft); }
.private textarea { width: 100%; border: 0; background: var(--fill-2); border-radius: var(--r-sm); padding: 12px; resize: vertical; font-size: 15px; line-height: 1.5; }
.private textarea:focus { outline: none; box-shadow: 0 0 0 4px var(--accent-soft); }
.item-row { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line-2); }
.item-row:first-child { border-top: 0; }
.item-row .n { flex: none; display: grid; place-items: center; width: 26px; height: 26px; margin-top: 8px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); font-weight: 650; font-size: 13px; }
.item-fields { flex: 1; display: grid; gap: 6px; }
.item-fields input { width: 100%; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); font-size: 15px; }
.item-fields .it-detail { font-size: 14px; color: var(--ink-2); }
.item-fields input:focus { outline: none; border-color: var(--accent); background: var(--card); box-shadow: 0 0 0 4px var(--accent-soft); }
.item-act { display: flex; gap: 4px; margin-top: 4px; }
.item-row .pill { margin-top: 10px; }
#add-item { margin-top: 10px; }
.week-link { display: flex; justify-content: space-between; align-items: center; padding: 10px 10px; margin: 0 -10px; border-radius: 10px; }
.week-link:hover { background: var(--fill-2); }
.week-link.on { background: var(--accent-soft); }
.week-link b { display: block; font-size: 14.5px; }
.week-link small { display: block; font-size: 12.5px; color: var(--ink-3); }
.coming { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line-2); }
.success { margin-top: 16px; }
.success blockquote { margin: 10px 0 0; padding: 14px 16px; border-radius: var(--r-sm); background: var(--fill-2); font-size: 14.5px; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; align-content: center; padding: 24px 16px; gap: 18px; }
.login-card { width: min(400px, 100%); background: var(--card); border-radius: 26px; padding: 32px 28px 28px; box-shadow: 0 2px 6px rgba(0, 0, 0, .04), 0 18px 48px rgba(0, 0, 0, .08); text-align: center; }
.login-card form { text-align: left; margin-top: 8px; }
.login-mark { width: 64px; height: 64px; border-radius: 16px; margin-bottom: 18px; }
.login-card h1 { font-size: 26px; margin-bottom: 8px; }
.login-card > p.muted { font-size: 15px; }
.login-card .btn { margin-top: 18px; min-height: 48px; font-size: 16px; }
.login-card .small { margin-top: 16px; }
.login-card .link { margin-top: 12px; }
.code { text-align: center; font-size: 26px !important; letter-spacing: .35em; font-variant-numeric: tabular-nums; font-weight: 600; }
.login-foot { font-size: 13px; color: var(--ink-3); }
.boot { min-height: 100vh; display: grid; place-items: center; }
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 2.5px solid var(--fill); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* toast */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 16px); opacity: 0; pointer-events: none; z-index: 50;
  padding: 11px 18px; border-radius: 999px; background: rgba(29, 29, 31, .92); color: #fff; font-weight: 500; font-size: 14.5px;
  backdrop-filter: blur(12px); transition: opacity .2s, transform .3s var(--ease); max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: var(--red); }

/* ---------- tablet ---------- */
@media (max-width: 1080px) {
  .grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.calc, .grid.one-one { grid-template-columns: 1fr; }
  .sticky { position: static; margin-top: 0; }
  .client-head { display: none; }
  .client-row { grid-template-columns: 1fr auto; grid-template-areas: "who chev" "a chev" "b chev"; row-gap: 6px; }
  .client-row > .who-cell { grid-area: who; }
  .client-row > span[data-l] { grid-column: 1; font-size: 13.5px; color: var(--ink-2); }
  .client-row > span[data-l="Step"], .client-row > span[data-l="Active"] { display: none; }
  .client-row > .chev { grid-row: 1 / span 3; grid-column: 2; }
}

/* ---------- phone ---------- */
@media (max-width: 760px) {
  body { font-size: 16px; }
  .side { display: none; }
  .main { margin-left: 0; padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
  .top { padding: 0 16px; padding-top: env(safe-area-inset-top); height: calc(48px + env(safe-area-inset-top)); }
  .top-title { opacity: 1; }
  .page { padding: 0 16px 32px; }
  .hello { padding: 10px 0 18px; }
  .hello h1 { font-size: 30px; }
  .page-head { padding: 8px 0 18px; flex-direction: column; align-items: stretch; }
  .page-head .btn { align-self: flex-start; }
  h1 { font-size: 28px; }
  .grid.two, .grid.three, .grid.two-one { grid-template-columns: 1fr; }
  .grid.four { grid-template-columns: 1fr 1fr; gap: 10px; }
  .grid { gap: 12px; }
  .page > * + .grid, .page > * + .card, .sub > * + .grid, .sub > * + .card { margin-top: 12px; }
  .card { padding: 16px; }
  .steps-strip ol { grid-template-columns: repeat(3, 1fr); }
  .field-row, .field-row.three, .field-grid { grid-template-columns: 1fr; }
  .field-grid .field:nth-child(2) { margin-top: 14px; }
  .kv-grid { grid-template-columns: 1fr 1fr; }
  .step-hero { gap: 14px; padding-top: 14px; }
  .step-num { width: 52px; height: 52px; font-size: 24px; border-radius: 16px; }
  .kpi-row { flex-wrap: wrap; }
  .client-hero .avatar.xl { width: 52px; height: 52px; font-size: 18px; }
  .form-f { flex-wrap: wrap; }
  .toast { bottom: calc(96px + env(safe-area-inset-bottom)); }

  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--card) 80%, transparent); backdrop-filter: saturate(180%) blur(22px); -webkit-backdrop-filter: saturate(180%) blur(22px);
    border-top: 1px solid var(--line-2); }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0; font-size: 10.5px; font-weight: 600; color: var(--ink-3); transition: transform .1s; }
  .tabbar a:active { transform: scale(.92); }
  .tabbar a .ic { width: 25px; height: 25px; }
  .tabbar a.on { color: var(--accent); }

  .sheet-scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .3); z-index: 20; opacity: 0; transition: opacity .25s; }
  .sheet { display: block; position: fixed; left: 8px; right: 8px; bottom: 8px; z-index: 21; background: var(--card); border-radius: 26px; padding: 8px 8px calc(10px + env(safe-area-inset-bottom));
    transform: translateY(110%); transition: transform .32s var(--ease); box-shadow: 0 -10px 40px rgba(0, 0, 0, .15); }
  .more-open .sheet { transform: none; }
  .more-open .sheet-scrim { opacity: 1; }
  .sheet[hidden], .sheet-scrim[hidden] { display: none; }
  .grabber { width: 36px; height: 5px; border-radius: 3px; background: var(--fill); margin: 2px auto 8px; }
  .sheet a { display: flex; align-items: center; gap: 14px; padding: 14px 14px; border-radius: 14px; font-weight: 500; font-size: 16px; }
  .sheet a:active { background: var(--fill-2); }
  .sheet a .chev { margin-left: auto; }
  .sheet a + a { border-top: 1px solid var(--line-2); }

  .sheet-dialog { width: 100vw; max-width: 100vw; max-height: 92vh; margin: auto 0 0; border-radius: 22px 22px 0 0; }
  .sheet-dialog form { padding-bottom: calc(22px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-transparency: reduce) { .top, .tabbar { background: var(--card); backdrop-filter: none; } }

/* ---------- drop a call ---------- */
.drop { margin-bottom: 16px; padding: 0; overflow: hidden; }
.drop > summary { display: flex; align-items: center; gap: 14px; padding: 16px 20px; cursor: pointer; list-style: none; }
.drop > summary::-webkit-details-marker { display: none; }
.drop > summary > span:nth-child(2) { flex: 1; }
.drop > summary b { display: block; font-size: 16px; }
.drop > summary small { display: block; color: var(--ink-2); font-size: 13.5px; margin-top: 2px; }
.drop[open] > summary .chev { transform: rotate(90deg); }
.drop-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); flex: none; }
.drop-body { padding: 0 20px 20px; border-top: 1px solid var(--line-2); }
.drop-f { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.file-btn { cursor: pointer; }
.spinner.sm { width: 15px; height: 15px; border-width: 2px; border-color: rgba(255, 255, 255, .35); border-top-color: #fff; }
.draft-note { margin-top: 16px; padding: 14px 16px; border-radius: var(--r-sm); background: var(--green-soft); display: grid; gap: 8px; }
.private-note { padding: 12px 14px; border-radius: 10px; background: var(--card); }
.private-note b { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--accent-ink); }
.private-note b .ic { width: 15px; height: 15px; }
.private-note p { white-space: pre-wrap; font-size: 14px; color: var(--ink-2); margin: 6px 0 8px; }
.target-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line-2); }
.target-row:first-child { border-top: 0; }
.target-row span { font-size: 14.5px; }
.target-row small { display: block; color: var(--ink-3); font-size: 12.5px; }
.field .target-row input { flex: none; width: 76px !important; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); text-align: center; font-variant-numeric: tabular-nums; }
.field .target-row input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.banner.soft { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.banner.soft small { color: var(--ink-2); opacity: 1; }
.banner.soft .banner-ic { background: var(--accent-soft); color: var(--accent); }
.banner.soft .btn { margin-left: auto; }
.banner.soft .icon-btn { margin-left: 4px; }
.banner.soft > span:nth-child(2) { flex: 1; }
