/* Tokens: dark first, light follows the device setting. Sizes, spacing, radii and shadows come only from this block. */
@font-face { font-family: Inter; src: url(inter.woff2) format("woff2"); font-weight: 100 900; font-display: swap; } /* SIL OFL, see inter-LICENSE.txt */
:root {
  --bg: #0a0a0c; --surface: #16161a; --surface2: #24242b; --sheet: #1d1d23; --text: #f4f4f6; --muted: #9a9aa6; --line: #2c2c34; --line-strong: #6a6a78;
  --accent: #7f8cff; --on-accent: #0a0a0c; --good: #3ddc97; --warn: #f7b955; --error: #ff7a7a;
  --c1: #7f8cff; --c2: #3ddc97; --c3: #f7b955; --c4: #ff8fb1; --c5: #5cc8f0;
  --fs-1: .75rem; --fs-2: .875rem; --fs-3: 1rem; --fs-4: 1.125rem; --fs-45: 1.375rem; --fs-5: 1.625rem; --fs-6: clamp(2.6rem, 13vw, 3.5rem);
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px;
  --r: 16px; --r-hero: 24px;
  --e1: inset 0 0 0 1px rgba(255, 255, 255, .06); --e2: 0 12px 32px rgba(0, 0, 0, .5); --edge: 0 -1px 0 rgba(255, 255, 255, .08);
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f3f3f6; --surface: #ffffff; --surface2: #e9e9ef; --sheet: #ffffff; --text: #0d0d12; --muted: #5d5d6b; --line: #dcdce4; --line-strong: #8e8e9c;
    --accent: #3346e6; --on-accent: #ffffff; --good: #066b43; --warn: #8a5a00; --error: #b3261e;
    --c1: #3346e6; --c2: #0a9c66; --c3: #9a6700; --c4: #d6457a; --c5: #1987b8;
    --e1: inset 0 0 0 1px var(--line), 0 1px 3px rgba(20, 20, 40, .06); --e2: 0 12px 32px rgba(20, 20, 40, .18); --edge: 0 0 0 transparent;
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html { overscroll-behavior-y: none; }
/* the glow belongs to the page, not to a box: it fades out with no edge */
body { margin: 0; background: radial-gradient(120% 340px at 50% 0, color-mix(in srgb, var(--accent) 20%, transparent), transparent) no-repeat var(--bg); color: var(--text);
  font: var(--fs-3)/1.45 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-feature-settings: "tnum";
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
.col { max-width: 640px; margin: 0 auto; padding: env(safe-area-inset-top) max(var(--s4), env(safe-area-inset-right)) calc(104px + env(safe-area-inset-bottom)) max(var(--s4), env(safe-area-inset-left)); }
h1, h2, h3, p { margin: 0; }
h2 { font-size: var(--fs-4); margin: var(--s6) var(--s1) var(--s3); }
h3 { font-size: var(--fs-3); margin: var(--s5) 0 var(--s2); }
p + p { margin-top: var(--s2); }
a { color: var(--accent); }
small, .small, .hint, .intro, .legend { color: var(--muted); font-size: var(--fs-2); }
small { display: block; }
.intro { font-size: var(--fs-3); margin: var(--s1) var(--s1) var(--s5); }
.hint { margin-bottom: var(--s4); }
.warn { color: var(--warn); margin-top: var(--s3); }
.good { color: var(--good); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
#error { background: color-mix(in srgb, var(--error) 16%, var(--surface)); color: var(--error); border-radius: var(--r); padding: var(--s3) var(--s4); margin-top: var(--s3); }

/* Screen header */
.top { display: flex; align-items: center; gap: var(--s2); min-height: 64px; padding-top: var(--s2); }
.top h1 { flex: 1; font-size: var(--fs-5); font-weight: 700; letter-spacing: -.025em; outline: none; }
.icon { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--surface); box-shadow: var(--e1); color: var(--text); font: inherit; cursor: pointer; }
.link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--s1); border: 0; background: none; color: var(--accent); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.link.danger { color: var(--error); }

/* Money */
.figure { font-size: var(--fs-45); font-weight: 650; letter-spacing: -.03em; line-height: 1.1; margin: var(--s2) 0; }
.figure span { font-size: .42em; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.figure.big { font-size: var(--fs-6); font-weight: 600; letter-spacing: -.045em; }
.figure.muted { color: var(--muted); }
.hero { padding: var(--s4) var(--s1) var(--s5); }
.hero .btn { margin-top: var(--s4); }
.label { color: var(--muted); font-weight: 600; font-size: var(--fs-2); }
.delta { color: var(--muted); font-size: var(--fs-2); font-weight: 600; }
.delta:is(.up, .down) { display: inline-block; padding: var(--s1) var(--s3); border-radius: 999px; }
.delta.up { color: var(--good); background: color-mix(in srgb, var(--good) 14%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--good) 25%, transparent); }
.delta.down { color: var(--error); background: color-mix(in srgb, var(--error) 14%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--error) 25%, transparent); }
.delta span { color: var(--muted); font-weight: 400; }
.spark { display: block; width: 100%; height: 64px; margin-top: var(--s4); }
.spark polyline { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; vector-effect: non-scaling-stroke; }

/* Cards and rows */
.card { display: block; background: var(--surface); box-shadow: var(--e1); border-radius: var(--r); padding: var(--s4); margin: var(--s3) 0; color: inherit; text-decoration: none; }
.card h2, .card h3 { margin: 0 0 var(--s2); }
.card .btn { margin-top: var(--s3); }
.card.empty { text-align: center; padding: var(--s6) var(--s4); }
.card.review { box-shadow: inset 0 0 0 1.5px var(--warn); }
.card.review .rows { background: var(--surface2); margin-top: var(--s3); }
.eyebrow { display: block; color: var(--muted); font-size: var(--fs-1); font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.card.next { border-radius: var(--r-hero); padding: var(--s5); background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 34%, var(--surface)), var(--surface) 75%); }
.card.next h2 { font-size: var(--fs-45); letter-spacing: -.02em; line-height: 1.15; margin: var(--s2) 0; }
.card.next :is(.eyebrow, .more, .clamp) { color: var(--text); } /* accent and muted text fail contrast on the tint */
.card.next .clamp { opacity: .85; }
.more { display: inline-flex; align-items: center; margin-top: var(--s3); color: var(--accent); font-weight: 600; }
.more svg { width: 18px; height: 18px; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--muted); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); margin: var(--s3) 0; }
.grid2 .card { margin: 0; }
.stat { display: grid; gap: var(--s1); align-content: start; }
.stat b { font-size: var(--fs-45); font-weight: 650; letter-spacing: -.03em; }
.save { color: var(--good); font-weight: 700; margin-bottom: var(--s1); }

.rows { background: var(--surface); box-shadow: var(--e1); border-radius: var(--r); overflow: hidden; }
.row { display: flex; align-items: center; gap: var(--s3); width: 100%; min-height: 64px; padding: var(--s3) var(--s4); border: 0; background: none;
  color: var(--text); font: inherit; text-align: left; text-decoration: none; cursor: pointer; }
.row + .row { border-top: 1px solid var(--line); }
.row:hover { background: var(--surface2); }
.row:focus-visible { outline-offset: -2px; }
.row .grow, .step .grow { flex: 1; min-width: 0; display: grid; gap: 2px; justify-items: start; }
.row .val { font-weight: 600; white-space: nowrap; }
.row > svg, .step > svg { flex: none; width: 18px; height: 18px; color: var(--muted); }
.row.add { color: var(--accent); font-weight: 600; }
/* colour of a chart part; the same class tints the icon circle of the matching row */
.c1 { --c: var(--c1); } .c2 { --c: var(--c2); } .c3 { --c: var(--c3); } .c4 { --c: var(--c4); } .c5 { --c: var(--c5); } .cd { --c: var(--warn); }
.ic { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%; color: var(--c); background: color-mix(in srgb, var(--c) 20%, transparent); }
.ic svg { width: 20px; height: 20px; }
.meter { display: block; width: 100%; height: 6px; margin: var(--s2) 0 2px; border-radius: 3px; background: var(--surface2); overflow: hidden; }
.row:hover .meter { background: var(--line); }
.meter i { display: block; height: 100%; border-radius: 3px; background: var(--good); }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 var(--s5); border: 0; border-radius: 999px;
  background: var(--surface2); color: var(--text); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; transition: transform .12s; }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.danger { color: var(--error); }
.btn:active { transform: scale(.97); }
.row:active, .card[href]:active { opacity: .7; }
.tag { display: inline-block; padding: 2px var(--s2); border-radius: 999px; background: var(--surface2); color: var(--muted); font-size: var(--fs-1); font-weight: 600; vertical-align: middle; }
.tag.exact { color: var(--good); background: color-mix(in srgb, var(--good) 14%, transparent); }
.tag.urgent { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
.tag.assume { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
.term { border: 0; padding: 0; background: none; color: inherit; font: inherit; text-decoration: underline dotted; text-underline-offset: 3px; cursor: pointer; }

/* Plan: one card, a rail through the step circles */
.steps-list { list-style: none; padding: var(--s2) 0; margin: 0; background: var(--surface); box-shadow: var(--e1); border-radius: var(--r); }
.step { position: relative; display: flex; align-items: center; gap: var(--s3); }
.steps-list .step { margin: 0; padding: var(--s3) var(--s4); background: none; box-shadow: none; border-radius: 0; }
.step::before { content: ""; position: absolute; left: calc(var(--s4) + 17px); top: 0; bottom: 0; width: 2px; background: var(--line); }
li:first-child > .step::before { top: 50%; }
li:last-child > .step::before { bottom: 50%; }
.step .n { position: relative; display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--surface2); font-weight: 700; }
.step.done :is(b, svg) { opacity: .6; }
.step.done .n { background: var(--surface); box-shadow: inset 0 0 0 2px var(--good); color: var(--good); }
.step.done::before { background: color-mix(in srgb, var(--good) 60%, var(--line)); }
.step .n svg { width: 18px; height: 18px; }
.step.current { background: color-mix(in srgb, var(--accent) 8%, transparent) !important; }
.step.current .n { background: var(--accent); color: var(--on-accent); }
.step.current b { color: var(--accent); }
.detail { padding: var(--s2) var(--s1); }
.detail .title { font-size: var(--fs-45); letter-spacing: -.025em; line-height: 1.15; margin: var(--s2) 0 var(--s3); }
.lead { font-size: var(--fs-4); margin: var(--s3) 0; }
.howto { padding-left: 20px; margin: var(--s3) 0; }
.howto li { margin: var(--s2) 0; }
.actions { display: flex; flex-wrap: wrap; gap: var(--s2); margin: var(--s4) 0; }
.actions:empty { display: none; }
.kv { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); margin-top: var(--s3); }
.kv b { white-space: nowrap; }
.examples { padding-left: 18px; margin: 0 0 var(--s2); font-size: var(--fs-2); color: var(--muted); }
.examples li { margin: var(--s2) 0; }
.examples .stale { color: var(--warn); }
.pager { display: flex; gap: var(--s3); margin-top: var(--s6); }
.pager > * { flex: 1; }

/* Tax */
.bar { display: flex; gap: 2px; height: 12px; border-radius: 4px; overflow: hidden; }
.bar i, .dot { background: var(--c); }
.dot { display: inline-block; width: 10px; height: 10px; margin-right: var(--s3); border-radius: 50%; }
.legend-rows { margin: var(--s3) 0 0; }
.legend-rows div { display: flex; justify-content: space-between; gap: var(--s3); padding: var(--s2) 0; }
.legend-rows dd { margin: 0; font-weight: 600; }
.legend-rows dd small { display: inline-block; min-width: 3.2em; text-align: right; font-weight: 400; }
.legend-rows .zero { opacity: .7; }
.legend-rows.sub { border-top: 1px solid var(--line); padding-top: var(--s2); }
.legend-rows.sub dt { color: var(--muted); }
details { margin-top: var(--s2); }
summary { padding: var(--s3) 0; color: var(--accent); font-weight: 600; cursor: pointer; }
details p { color: var(--muted); font-size: var(--fs-2); }
table { width: 100%; margin-top: var(--s3); border-collapse: collapse; }
th { color: var(--muted); font-size: var(--fs-1); font-weight: 600; text-align: left; padding: 0 var(--s2) var(--s2); }
td { padding: var(--s3) var(--s2); border-top: 1px solid var(--line); }
:is(th, td):not(:first-child) { text-align: right; }
caption { caption-side: top; text-align: left; color: var(--muted); font-size: var(--fs-2); padding-bottom: var(--s2); }
tr.best td { background: color-mix(in srgb, var(--good) 10%, transparent); }
tr.best td:first-child { box-shadow: inset 3px 0 0 var(--good); }
.out:not(:empty) { margin-top: var(--s4); padding: var(--s4); border-radius: 12px; background: var(--surface2); }
.out .legend-rows { margin: 0; }
.out .delta { margin-left: var(--s1); }
td small { display: inline; }
.cards { list-style: none; padding: 0; margin: 0; }
.saved { list-style: none; padding: 0; margin: var(--s2) 0 0; }
.saved li { display: flex; align-items: center; gap: var(--s3); }
.saved span { flex: 1; color: var(--muted); }

/* Charts. max-width keeps strokes and the 11px labels the same size on a wide card. */
.chart { display: block; width: 100%; max-width: 460px; height: auto; margin: 0 auto; }
.chart text { font-size: 12px; fill: var(--muted); }
.chart .band { fill: color-mix(in srgb, var(--accent) 24%, transparent); }
.chart .median { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .goal { stroke: var(--warn); stroke-dasharray: 4 3; }
.chart .axis { stroke: var(--line); }
.chart .grid { stroke: var(--line); stroke-dasharray: 2 4; }
.chart .end { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.chart text.pill { fill: var(--warn); font-weight: 600; paint-order: stroke; stroke: var(--surface); stroke-width: 4px; }
.sw.goal { border-top: 2px dashed var(--warn); height: 0; }
.sw { display: inline-block; width: 14px; height: 10px; margin: 0 var(--s1) 0 var(--s2); vertical-align: middle; }
.sw:first-child { margin-left: 0; }
.sw.band { background: color-mix(in srgb, var(--accent) 24%, transparent); }
.sw.median { border-top: 2.5px solid var(--accent); height: 0; }

/* Forms */
.field { display: block; margin-bottom: var(--s4); }
.field > span { display: block; margin-bottom: var(--s2); color: var(--muted); font-size: var(--fs-2); font-weight: 600; }
input[type=number], input[type=text], select { display: block; width: 100%; height: 52px; padding: 0 var(--s4); border: 0; border-radius: var(--r);
  background: var(--surface2); color: var(--text); font: inherit; font-weight: 600; box-shadow: inset 0 0 0 1px var(--line-strong); }
:is(input[type=number], input[type=text], select):focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--accent); }
select { appearance: none; padding: 0 40px 0 var(--s4); background: var(--surface2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%239a9aa6' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E") no-repeat right 14px center; }
.card.form .grid2 { gap: var(--s4) var(--s3); }
.grid2 .field { margin: 0; }
input::placeholder { color: var(--muted); font-weight: 400; }
.field small { margin-top: var(--s2); }
.form > :last-child { margin-bottom: 0; }
.switch { display: flex; align-items: flex-start; gap: var(--s3); min-height: 44px; margin-bottom: var(--s4); cursor: pointer; }
.switch input { appearance: none; flex: none; position: relative; width: 50px; height: 30px; margin: 0; border-radius: 15px; background: var(--surface2); box-shadow: inset 0 0 0 1.5px var(--muted); cursor: pointer; transition: background .15s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .15s; }
.switch input:checked { background: var(--good); box-shadow: none; }
.switch input:checked::after { transform: translateX(20px); }
.switch span { padding-top: 3px; }
.to-review input { box-shadow: 0 0 0 2px var(--warn); }
.steps { display: flex; gap: var(--s2); margin: var(--s1) var(--s1) var(--s5); }
.steps i { flex: 1; height: 4px; border-radius: 2px; background: var(--surface2); }
.steps .on { background: var(--accent); }

/* Tab bar; a labelled sidebar on wide screens */
.tabs { position: fixed; inset: auto 0 0 0; z-index: 5; display: flex; padding: var(--s2) max(var(--s2), env(safe-area-inset-right)) calc(var(--s2) + env(safe-area-inset-bottom)) max(var(--s2), env(safe-area-inset-left));
  background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-top: 1px solid var(--line); }
.tabs a { position: relative; flex: 1; display: grid; justify-items: center; gap: 2px; min-height: 52px; padding: var(--s2) 0; border-radius: var(--r); color: var(--muted); font-size: var(--fs-1); font-weight: 600; text-decoration: none; }
.tabs a[aria-current] { color: var(--text); }
.tabs .brand { display: none; }
.tabs a[aria-current]::before { content: ""; position: absolute; top: 0; width: 24px; height: 3px; border-radius: 2px; background: var(--accent); } /* not by colour alone */
body[data-screen=setup] .tabs { display: none; }
@media (min-width: 900px) {
  .tabs { inset: 0 auto 0 0; width: 220px; flex-direction: column; justify-content: flex-start; gap: var(--s1); padding: var(--s6) var(--s3); border-top: 0; border-right: 1px solid var(--line); }
  .tabs a { flex: none; display: flex; align-items: center; justify-content: flex-start; gap: var(--s3); padding: 0 var(--s4); font-size: var(--fs-3); }
  .tabs a[aria-current] { background: var(--surface); box-shadow: var(--e1); }
  .tabs .brand { display: flex; align-items: center; gap: var(--s2); padding: 0 var(--s4) var(--s5); font-size: var(--fs-3); font-weight: 700; color: var(--text); }
  .tabs a[aria-current]::before { top: auto; left: 0; width: 3px; height: 24px; }
  body:not([data-screen=setup]) { padding-left: 220px; }
  .col { padding-bottom: var(--s6); }
  /* dashboards flow into two columns; forms, the plan and details keep the reading width */
  body:is([data-screen=home], [data-screen=tax], [data-screen=wealth], [data-screen=tools]) .col { max-width: 1040px; }
  body:is([data-screen=home], [data-screen=tax], [data-screen=wealth], [data-screen=tools]) #screen { columns: 2; column-gap: var(--s5); }
  #screen > :is(.top, .hero) { column-span: all; }
  #screen > :is(.card, .rows, .grid2, section), #screen .card { break-inside: avoid; }
  #screen > h2 { break-after: avoid; }
  #screen > h2:first-of-type { margin-top: 0; }
}

/* Bottom sheet */
#sheet { width: 100%; max-width: 640px; max-height: 92dvh; margin: auto auto 0; padding: 0; border: 0; border-radius: var(--r-hero) var(--r-hero) 0 0; background: var(--sheet); box-shadow: var(--edge), var(--e2); color: var(--text); overscroll-behavior: contain; }
#sheet[open] { animation: up .28s cubic-bezier(.2, .8, .2, 1); }
#sheet::backdrop { background: rgba(0, 0, 0, .5); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
#sheet form { display: flex; flex-direction: column; max-height: 92dvh; }
#sheet form::before { content: ""; align-self: center; flex: none; width: 40px; height: 5px; margin-top: var(--s3); border-radius: 3px; background: color-mix(in srgb, var(--muted) 50%, transparent); } /* grab handle, decoration only */
#sheet header { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s3) var(--s4) var(--s2) var(--s5); }
#sheet h2 { margin: 0; font-size: var(--fs-4); }
#sheet h2::first-letter { text-transform: uppercase; }
#sheet .icon { background: var(--surface2); }
#sheet .body { overflow: auto; overscroll-behavior: contain; padding: var(--s3) var(--s5); }
#sheet footer { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s5) calc(var(--s4) + env(safe-area-inset-bottom)); }
#sheet footer .btn { flex: 1; }
@media (min-width: 700px) { #sheet { margin: auto; border-radius: var(--r-hero); } #sheet form::before { display: none; } }
#screen.in > * { animation: in .28s ease-out both; }
#screen.in > :nth-child(2) { animation-delay: 30ms; } #screen.in > :nth-child(3) { animation-delay: 60ms; } #screen.in > :nth-child(4) { animation-delay: 90ms; }
#screen.in > :nth-child(5) { animation-delay: 120ms; } #screen.in > :nth-child(n+6) { animation-delay: 150ms; }
@keyframes in { from { opacity: 0; transform: translateY(8px); } }
@keyframes up { from { transform: translateY(100%); } }

[aria-invalid="true"] { outline: 2px solid var(--error); outline-offset: 1px; }
.dates { list-style: none; margin: 0 0 var(--s4); padding: 0; }
.dates li { display: flex; align-items: flex-start; gap: var(--s3); padding: var(--s3) 0; border-bottom: 1px solid var(--line); }
.dates li:first-child { padding-top: 0; }
.dates li:last-child { border-bottom: 0; }
.dates small { display: block; margin-top: var(--s1); }
.date { display: grid; place-items: center; flex: none; width: 48px; height: 52px; border-radius: 12px; background: var(--surface2); line-height: 1.1; }
.date small { margin: 0; font-size: var(--fs-1); font-weight: 700; text-transform: uppercase; color: var(--muted); }
.date b { font-size: var(--fs-4); }
.dates .grow, .card .grow { flex: 1; min-width: 0; }
.dated { display: flex; align-items: center; gap: var(--s3); box-shadow: var(--e1), inset 3px 0 0 var(--warn); }
.card.form .grid2 { align-items: end; margin: 0; }
.notes { margin: 0; padding-left: 18px; display: grid; gap: var(--s2); font-size: var(--fs-2); color: var(--muted); }
/* A small pill above the tab bar. inset/margin/border undo the browser's popover defaults; display follows .show where popovers are not supported */
#toast { position: fixed; inset: auto auto calc(84px + env(safe-area-inset-bottom)) 50%; margin: 0; border: 0; z-index: 10; width: max-content; max-width: min(92vw, 420px); padding: var(--s2) var(--s4);
  border-radius: var(--r-hero); background: var(--text); color: var(--bg); box-shadow: var(--edge), var(--e2); font-size: var(--fs-2); font-weight: 600; opacity: 0; transform: translate(-50%, 16px); pointer-events: none; transition: opacity .2s, transform .2s; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 900px) { #toast { bottom: var(--s5); } }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
/* M15: inline field errors, toast action, jump chips, review rows, glossary */
.field .err { display: block; margin-top: var(--s1); color: var(--error); font-weight: 600; }
#toast button { margin-left: var(--s2); border: 0; background: none; color: inherit; font: inherit; text-decoration: underline; cursor: pointer; padding: var(--s1); pointer-events: auto; }
#toast.show { pointer-events: auto; }
.chips { display: flex; gap: var(--s2); overflow-x: auto; padding: var(--s1) 0 var(--s2); scrollbar-width: none; }
.chip { flex: none; border: 0; border-radius: 999px; padding: var(--s2) var(--s3); background: var(--surface2); color: var(--text); font: inherit; font-size: var(--fs-2); font-weight: 600; cursor: pointer; }
.review-row { display: flex; align-items: center; gap: var(--s2); }
.review-row .row { flex: 1; min-width: 0; }
.btn.small { padding: var(--s2) var(--s3); font-size: var(--fs-2); white-space: nowrap; }
.glossary dt { font-weight: 700; margin-top: var(--s3); }
.glossary dd { margin: var(--s1) 0 0; color: var(--muted); }
h2[id] { scroll-margin-top: var(--s4); }
small b.good { color: var(--good); } small b.warn { color: var(--warn); }

@media print {
  body { background: #fff; color: #000; padding: 0 !important; }
  .tabs, .icon, .btn, #toast, #sheet, .chips, .pager { display: none !important; }
  .card, .rows, .steps-list { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  .col { max-width: none; padding: 0; }
}
.card.form > p.small { margin-bottom: var(--s4); }
.out table + p, .out p + p { margin-top: var(--s3); }
.out table { margin-top: 0; }
