/* GuudTax design system — every value on the page comes from these tokens. */
:root {
  /* Palette (WCAG AA on their intended backgrounds) */
  --c-bg: #f6f8f4;
  --c-surface: #ffffff;
  --c-surface-2: #eef3ec;
  --c-ink: #10201a;
  --c-ink-2: #3f5249;
  --c-muted: #56675f; /* ≥4.97:1 on every surface incl. brand-soft (P8c; was #5f7068, 4.35:1 there) */
  --c-line: #d8e1da;
  --c-brand: #0f6b4a;
  --c-brand-strong: #0a4f36;
  --c-brand-soft: #d9efe4;
  --c-accent: #f2c14e;
  --c-accent-ink: #3a2a00;
  --c-danger: #b4232c;
  --c-focus: #1f8f66;

  /* Type scale (1.25 modular) */
  --font: "Inter", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --fs--1: 0.8rem;
  --fs-0: 1rem;
  --fs-1: 1.25rem;
  --fs-2: 1.563rem;
  --fs-3: 1.953rem;
  --fs-4: 2.441rem;
  --fs-5: 3.052rem;
  --lh-tight: 1.15;
  --lh-body: 1.6;

  /* Spacing rhythm (4/8px grid) */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 96px;

  --radius-s: 8px;
  --radius-m: 12px;
  --radius-l: 20px;
  --shadow-s: 0 1px 2px rgba(16, 32, 26, 0.06), 0 1px 3px rgba(16, 32, 26, 0.08);
  --shadow-m: 0 8px 24px rgba(16, 32, 26, 0.1);
  --container: 1120px;
  --header-h: 72px;
  --ease: 180ms ease;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-0);
  line-height: var(--lh-body);
  color: var(--c-ink);
  background: var(--c-bg);
}
img, svg { display: block; max-width: 100%; }
h1, h2, h3, h4 { margin: 0; line-height: var(--lh-tight); letter-spacing: -0.01em; font-weight: 700; }
h1 { font-size: var(--fs-4); }
h2 { font-size: var(--fs-3); }
h3 { font-size: var(--fs-1); }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
a { color: var(--c-brand); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--c-brand-strong); }
:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 2px; border-radius: var(--radius-s); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: var(--s-4); top: -100px; background: var(--c-ink); color: #fff; padding: var(--s-2) var(--s-4); border-radius: var(--radius-s); z-index: 100; }
.skip-link:focus { top: var(--s-4); }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--s-5); }
.stack > * + * { margin-top: var(--s-4); }
.eyebrow { display: inline-block; font-size: var(--fs--1); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--c-brand); margin-bottom: var(--s-3); }
.lead { font-size: var(--fs-1); color: var(--c-ink-2); }
.muted { color: var(--c-muted); }
.section { padding-block: var(--s-8); }
.section--alt { background: var(--c-surface); border-block: 1px solid var(--c-line); }
.section--dark { background: var(--c-ink); color: #fff; }
.section--dark .eyebrow { color: var(--c-accent); }
.section--dark .muted { color: #b7c6be; }
.section-head { max-width: 640px; margin-bottom: var(--s-6); }
.section-head p { margin-top: var(--s-3); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 48px; padding: var(--s-3) var(--s-5);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  border-radius: var(--radius-m); border: 1px solid transparent;
  transition: background var(--ease), color var(--ease), transform var(--ease), box-shadow var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--c-brand); color: #fff; }
.btn--primary:hover { background: var(--c-brand-strong); color: #fff; }
.btn--accent { background: var(--c-accent); color: var(--c-accent-ink); }
.btn--accent:hover { background: #ffd166; color: var(--c-accent-ink); }
.btn--ghost { background: transparent; color: var(--c-ink); border-color: var(--c-line); }
.btn--ghost:hover { background: var(--c-surface-2); color: var(--c-ink); }
.section--dark .btn--ghost { color: #fff; border-color: rgba(255,255,255,0.3); }
.section--dark .btn--ghost:hover { background: rgba(255,255,255,0.08); color: #fff; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: 0.88; cursor: not-allowed; } /* 0.88 keeps button labels ≥4.5:1 (P8c) */
.btn-row { display: flex; flex-wrap: wrap; gap: var(--s-3); }

/* Header */
.header { position: sticky; top: 0; z-index: 50; background: rgba(246, 248, 244, 0.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--c-line); }
.header__inner { display: flex; align-items: center; justify-content: space-between; min-height: var(--header-h); gap: var(--s-4); }
.brand { display: inline-flex; align-items: center; gap: var(--s-2); font-weight: 800; font-size: var(--fs-1); color: var(--c-ink); text-decoration: none; letter-spacing: -0.02em; }
.brand__logo { height: 52px; width: auto; display: block; }
@media (max-width: 480px) { .brand__logo { height: 42px; } }
.brand em { font-style: normal; color: var(--c-brand); }
.nav { display: flex; align-items: center; gap: var(--s-5); }
.nav__link { color: var(--c-ink-2); text-decoration: none; font-weight: 500; padding: var(--s-2) 0; border-bottom: 2px solid transparent; transition: color var(--ease), border-color var(--ease); }
.nav__link:hover { color: var(--c-ink); border-color: var(--c-brand); }
.nav__cta { display: flex; gap: var(--s-2); margin-left: var(--s-2); }
.nav__cta .btn { min-height: 40px; padding-block: var(--s-2); }
.nav-toggle { display: none; margin-left: auto; width: 48px; height: 48px; padding: 0; border: 1px solid var(--c-line); border-radius: var(--radius-m); background: var(--c-surface); cursor: pointer; align-items: center; justify-content: center; }
.nav-toggle svg { width: 24px; height: 24px; stroke: var(--c-ink); }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-open { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--c-surface); border-bottom: 1px solid var(--c-line); box-shadow: var(--shadow-m);
    padding: var(--s-2) 0 var(--s-4);
  }
  .nav.is-open { display: flex; }
  .nav__link { display: block; width: 100%; padding: var(--s-4) var(--s-5); border-bottom: 1px solid var(--c-line); font-size: var(--fs-1); }
  .nav__link:hover { background: var(--c-surface-2); }
  .nav__cta { flex-direction: column; margin: var(--s-4) var(--s-5) 0; }
  .nav__cta .btn { width: 100%; min-height: 52px; }
}

/* Hero */
.hero { padding-block: var(--s-8) var(--s-9); }
.hero__grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: var(--s-8); align-items: center; }
.hero h1 { font-size: clamp(var(--fs-4), 5vw, var(--fs-5)); }
.hero .lead { margin-top: var(--s-5); max-width: 520px; }
.hero__bullets { margin-top: var(--s-5); display: grid; gap: var(--s-3); }
.hero__bullets li { display: flex; gap: var(--s-3); align-items: flex-start; color: var(--c-ink-2); }
.hero__bullets svg { flex: none; width: 22px; height: 22px; margin-top: 3px; }
.hero .btn-row { margin-top: var(--s-6); }
.hero__note { margin-top: var(--s-3); font-size: var(--fs--1); color: var(--c-muted); }
.hero__art { border-radius: var(--radius-l); overflow: hidden; box-shadow: var(--shadow-m); background: var(--c-surface); border: 1px solid var(--c-line); }
.hero__art img { width: 100%; height: auto; }
@media (max-width: 860px) {
  .hero { padding-block: var(--s-7); }
  .hero__grid { grid-template-columns: 1fr; gap: var(--s-6); }
  .hero__art { order: -1; }
}

/* Cards & grids */
.grid { display: grid; gap: var(--s-5); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 960px) { .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; } }
.card { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius-m); padding: var(--s-5); box-shadow: var(--shadow-s); }
.card h3 { margin-bottom: var(--s-2); }
.card p { color: var(--c-ink-2); }
.card--pain { border-left: 4px solid var(--c-danger); }
.icon-bubble { width: 44px; height: 44px; display: grid; place-items: center; border-radius: var(--radius-s); background: var(--c-brand-soft); color: var(--c-brand); margin-bottom: var(--s-4); }
.icon-bubble svg { width: 24px; height: 24px; }

/* Steps */
.steps { counter-reset: step; }
.step { position: relative; padding-left: var(--s-8); }
.step::before { counter-increment: step; content: counter(step); position: absolute; left: 0; top: 0; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: var(--c-brand); color: #fff; font-weight: 700; }
.step h3 { margin-bottom: var(--s-2); }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-5); }
@media (max-width: 620px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat { padding: var(--s-5); border-radius: var(--radius-m); background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12); }
.stat__n { font-size: var(--fs-3); font-weight: 800; letter-spacing: -0.02em; color: var(--c-accent); line-height: 1.1; }
.stat__l { margin-top: var(--s-2); color: #c7d4cc; font-size: var(--fs--1); }

/* Testimonials */
.quote { display: flex; flex-direction: column; gap: var(--s-4); height: 100%; }
.quote blockquote { margin: 0; font-size: var(--fs-1); line-height: 1.45; color: var(--c-ink); }
.quote footer { display: flex; align-items: center; gap: var(--s-3); margin-top: auto; }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--c-brand); color: #fff; font-weight: 700; font-size: var(--fs--1); }
.quote cite { font-style: normal; font-size: var(--fs--1); color: var(--c-muted); }
.quote cite strong { display: block; color: var(--c-ink); font-size: var(--fs-0); }
.stars { color: var(--c-accent); letter-spacing: 2px; font-size: var(--fs--1); }

/* Offer */
.plan { display: flex; flex-direction: column; gap: var(--s-4); }
.plan--featured { border-color: var(--c-brand); box-shadow: 0 0 0 3px var(--c-brand-soft); }
.plan__price { font-size: var(--fs-4); font-weight: 800; letter-spacing: -0.02em; }
.plan__price small { font-size: var(--fs-0); font-weight: 500; color: var(--c-muted); }
.plan ul { display: grid; gap: var(--s-2); }
.plan li { display: flex; gap: var(--s-2); color: var(--c-ink-2); }
.plan li::before { content: "✓"; color: var(--c-brand); font-weight: 700; }
.plan .btn { margin-top: auto; }
.pill { display: inline-block; padding: 2px var(--s-3); border-radius: 999px; background: var(--c-brand-soft); color: var(--c-brand-strong); font-size: var(--fs--1); font-weight: 600; }

/* Guarantee */
.guarantee { display: grid; grid-template-columns: auto 1fr; gap: var(--s-5); align-items: center; padding: var(--s-6); border-radius: var(--radius-l); background: var(--c-brand-soft); border: 1px solid #b9dcc9; }
.guarantee__badge { width: 88px; height: 88px; }
@media (max-width: 620px) { .guarantee { grid-template-columns: 1fr; } }

/* FAQ */
.faq { display: grid; gap: var(--s-3); max-width: 800px; }
.faq details { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius-m); }
.faq summary { cursor: pointer; padding: var(--s-4) var(--s-5); font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: var(--s-4); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: var(--fs-2); line-height: 1; color: var(--c-brand); transition: transform var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 var(--s-5) var(--s-5); color: var(--c-ink-2); }
.faq details ul { margin: 0 var(--s-5) var(--s-3); padding-left: var(--s-5); list-style: disc; color: var(--c-ink-2); }

/* CTA band */
.cta-band { text-align: center; padding-block: var(--s-9); }
.cta-band h2 { font-size: clamp(var(--fs-3), 4vw, var(--fs-4)); }
.cta-band p { max-width: 560px; margin: var(--s-4) auto 0; }
.cta-band .btn-row { justify-content: center; margin-top: var(--s-6); }

/* Footer */
.footer { padding-block: var(--s-7); border-top: 1px solid var(--c-line); color: var(--c-muted); font-size: var(--fs--1); }
.footer__inner { display: flex; flex-wrap: wrap; gap: var(--s-5); justify-content: space-between; align-items: center; }
.footer ul { display: flex; flex-wrap: wrap; gap: var(--s-4); }
.footer a { color: var(--c-ink-2); text-decoration: none; }
.footer a:hover { color: var(--c-brand); text-decoration: underline; }

/* Forms */
.form { display: grid; gap: var(--s-4); }
.field { display: grid; gap: var(--s-2); }
.field label { font-weight: 600; font-size: var(--fs--1); }
.field .hint { font-size: var(--fs--1); color: var(--c-muted); }
.input, select.input {
  width: 100%; min-height: 48px; padding: var(--s-3) var(--s-4);
  font: inherit; color: var(--c-ink); background: var(--c-surface);
  border: 1px solid var(--c-line); border-radius: var(--radius-s);
  transition: border-color var(--ease), box-shadow var(--ease);
}
.input::placeholder { color: var(--c-muted); opacity: 1; } /* browser defaults (Firefox fades to ~0.54) fall below 4.5:1 */
.input:focus { outline: none; border-color: var(--c-focus); box-shadow: 0 0 0 3px var(--c-brand-soft); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4); }
@media (max-width: 520px) { .form-row { grid-template-columns: 1fr; } }
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); }
.choice label { display: flex; gap: var(--s-3); align-items: flex-start; padding: var(--s-4); border: 1px solid var(--c-line); border-radius: var(--radius-m); cursor: pointer; background: var(--c-surface); }
.choice label:has(input:checked) { border-color: var(--c-brand); box-shadow: 0 0 0 3px var(--c-brand-soft); }
.choice input { margin-top: 4px; accent-color: var(--c-brand); }
.choice strong { display: block; }
.choice span { font-size: var(--fs--1); color: var(--c-muted); }
.alert { padding: var(--s-3) var(--s-4); border-radius: var(--radius-s); font-size: var(--fs--1); border: 1px solid; }
.alert--error { background: #fdecec; border-color: #f2b8bc; color: var(--c-danger); }
.alert--ok { background: var(--c-brand-soft); border-color: #b9dcc9; color: var(--c-brand-strong); }
.alert--warn { background: #fff4d6; border-color: #e8cf90; color: #6b4d00; }
.alert[hidden] { display: none; }
.unread-docs { margin-top: var(--s-3); }
.unread-docs__list { margin: var(--s-2) 0; padding-left: var(--s-4); }
.unread-docs__list li + li { margin-top: var(--s-1); }
.unread-docs p { margin: 0; }
.unread-docs a { color: inherit; text-decoration: underline; }
.support-banner { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap; border-radius: 0; position: sticky; top: 0; z-index: 50; }

/* Auth page */
.auth { min-height: calc(100vh - var(--header-h)); display: grid; grid-template-columns: 1fr 1fr; }
.auth__side { background: var(--c-ink); color: #fff; padding: var(--s-8) var(--s-7); display: flex; flex-direction: column; justify-content: center; gap: var(--s-5); }
.auth__side h2 { font-size: var(--fs-3); }
.auth__side li { display: flex; gap: var(--s-3); color: #c7d4cc; }
.auth__side li::before { content: "✓"; color: var(--c-accent); font-weight: 700; }
.auth__main { padding: var(--s-8) var(--s-5); display: grid; place-items: start center; }
.auth__panel { width: 100%; max-width: 480px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--c-surface-2); padding: var(--s-1); border-radius: var(--radius-m); margin-bottom: var(--s-6); }
.tab { min-height: 44px; border: 0; border-radius: var(--radius-s); background: transparent; font: inherit; font-weight: 600; color: var(--c-muted); cursor: pointer; transition: background var(--ease), color var(--ease); }
.tab[aria-selected="true"] { background: var(--c-surface); color: var(--c-ink); box-shadow: var(--shadow-s); }
.tabpanel[hidden] { display: none; }
@media (max-width: 860px) { .auth { grid-template-columns: 1fr; } .auth__side { order: 1; padding: var(--s-7) var(--s-5); } }

/* App page */
.app-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: var(--s-4); margin-bottom: var(--s-6); }
.app-grid { display: grid; grid-template-columns: 2fr 1fr; gap: var(--s-5); }
@media (max-width: 860px) { .app-grid { grid-template-columns: 1fr; } }
.checklist { display: grid; gap: var(--s-2); }
.checklist label { display: flex; gap: var(--s-3); align-items: center; padding: var(--s-3) var(--s-4); border: 1px solid var(--c-line); border-radius: var(--radius-s); background: var(--c-surface); cursor: pointer; }
.checklist input { accent-color: var(--c-brand); width: 18px; height: 18px; }
.checklist label { flex-wrap: wrap; }
.checklist .badge--auto { background: var(--c-brand-soft); color: var(--c-brand-strong); text-transform: none; margin-left: auto; text-decoration: none; }
.checklist label:has(input:checked) { background: var(--c-surface-2); text-decoration: line-through; color: var(--c-muted); }
.progress { height: 8px; border-radius: 999px; background: var(--c-surface-2); overflow: hidden; margin: var(--s-3) 0 var(--s-4); }
.progress > span { display: block; height: 100%; background: var(--c-brand); transition: width var(--ease); }
.list { display: grid; gap: var(--s-3); }
.row { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); padding: var(--s-3) var(--s-4); border: 1px solid var(--c-line); border-radius: var(--radius-s); background: var(--c-surface); }
.row small { color: var(--c-muted); }
.badge { display: inline-block; padding: 2px var(--s-2); border-radius: 999px; font-size: var(--fs--1); font-weight: 600; background: var(--c-surface-2); color: var(--c-ink-2); text-transform: capitalize; }
.badge--draft { background: #fff4d6; color: #6b4d00; }
/* Return lifecycle: draft -> documents_uploaded -> interview_complete -> calculated -> packet_ready. */
.badge--documents_uploaded { background: #e4eefc; color: #17457f; }
.badge--interview_complete { background: #e8e6fb; color: #3c2f8f; }
.badge--calculated { background: #dff2e6; color: #1c5c37; }
.badge--packet_ready { background: var(--c-brand-soft); color: var(--c-brand-strong); }
.badge--cpa_review { background: #e8e6fb; color: #3c2f8f; }
.badge--cpa_approved { background: #dcf5e6; color: #14663c; }
.badge--approved, .badge--filed { background: var(--c-brand-soft); color: var(--c-brand-strong); }
.badge--basis-unreported { background: #fff4d6; color: #6b4d00; text-transform: none; font-weight: 500; white-space: nowrap; }
.empty { padding: var(--s-5); text-align: center; color: var(--c-muted); border: 1px dashed var(--c-line); border-radius: var(--radius-m); }
.cpa { display: flex; gap: var(--s-3); align-items: center; }
.cpa__meta { font-size: var(--fs--1); color: var(--c-muted); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } html { scroll-behavior: auto; } }

/* Return workspace (return.html) */
.return-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: var(--s-4); margin-bottom: var(--s-6); }
.return-head .badge { margin-left: var(--s-2); vertical-align: middle; }
.return-head__step { margin: var(--s-1) 0 0; font-size: var(--fs--1); }
.row__status { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.row__step { font-size: var(--fs--1); }
.backlink { display: inline-flex; align-items: center; gap: var(--s-2); font-size: var(--fs--1); font-weight: 600; text-decoration: none; }
.backlink::before { content: "←"; }
.return-grid { display: grid; grid-template-columns: 260px 1fr; gap: var(--s-5); align-items: start; }
@media (max-width: 860px) { .return-grid { grid-template-columns: 1fr; } }

.rail { display: grid; gap: var(--s-2); counter-reset: rail; }
.rail__step {
  display: grid; grid-template-columns: 32px 1fr; gap: var(--s-3); align-items: center;
  width: 100%; text-align: left; font: inherit; cursor: pointer;
  padding: var(--s-3) var(--s-4); background: var(--c-surface);
  border: 1px solid var(--c-line); border-radius: var(--radius-m);
  transition: background var(--ease), border-color var(--ease);
}
.rail__step:hover { background: var(--c-surface-2); }
.rail__step::before {
  counter-increment: rail; content: counter(rail);
  width: 32px; height: 32px; display: grid; place-items: center;
  border-radius: 50%; background: var(--c-surface-2); color: var(--c-ink-2); font-weight: 700; font-size: var(--fs--1);
}
.rail__step[aria-current="step"] { border-color: var(--c-brand); box-shadow: 0 0 0 3px var(--c-brand-soft); }
.rail__step[aria-current="step"]::before { background: var(--c-brand); color: #fff; }
.rail__name { font-weight: 600; }
.rail__hint { display: block; font-size: var(--fs--1); color: var(--c-muted); font-weight: 400; }
@media (max-width: 860px) {
  .rail { grid-auto-flow: column; grid-auto-columns: minmax(180px, 1fr); overflow-x: auto; padding-bottom: var(--s-2); }
}
.step-panel[hidden] { display: none; }
.step-panel__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--s-3); margin-bottom: var(--s-2); }
.meta-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--s-4); margin-top: var(--s-4); }
.meta-list dt { font-size: var(--fs--1); color: var(--c-muted); }
.meta-list dd { margin: var(--s-1) 0 0; font-weight: 600; }
a.row:hover { border-color: var(--c-brand); background: var(--c-surface-2); }

/* Document upload (return.html → Documents step) */
.dropzone {
  display: grid; place-items: center; gap: var(--s-2); text-align: center;
  padding: var(--s-6) var(--s-5); margin-top: var(--s-4);
  border: 2px dashed var(--c-line); border-radius: var(--radius-m); background: var(--c-surface-2);
  transition: border-color var(--ease), background var(--ease);
}
.dropzone.is-dragover { border-color: var(--c-brand); background: var(--c-brand-soft); }
.dropzone__hint { font-size: var(--fs--1); color: var(--c-muted); }
.dropzone input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.upload-list { display: grid; gap: var(--s-3); margin-top: var(--s-4); }
.upload { padding: var(--s-3) var(--s-4); border: 1px solid var(--c-line); border-radius: var(--radius-s); background: var(--c-surface); }
.upload__top { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-3); }
.upload__name { font-weight: 600; word-break: break-word; }
.upload__state { font-size: var(--fs--1); color: var(--c-muted); white-space: nowrap; }
.upload .progress { margin: var(--s-2) 0 0; }
.upload--error { border-color: #f2b8bc; }
.upload--error .upload__state { color: var(--c-danger); }
.upload--done .upload__state { color: var(--c-brand-strong); }
.upload--reading .upload__state { color: #17457f; }
.doc-row__meta { font-size: var(--fs--1); color: var(--c-muted); }

/* Extraction results (return.html → Documents step) */
.doc-card { padding: var(--s-4); border: 1px solid var(--c-line); border-radius: var(--radius-m); background: var(--c-surface); }
.doc-card--review { border-color: #f0c274; background: #fffdf7; }
.doc-card__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: start; gap: var(--s-3); }
.doc-card__name { font-weight: 600; word-break: break-word; }
.doc-card__badges { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.doc-card__review { margin: var(--s-3) 0 0; font-size: var(--fs--1); color: #6b4d00; }
.badge--form { background: var(--c-brand-soft); color: var(--c-brand-strong); text-transform: none; }
.badge--review { background: #fdecec; color: var(--c-danger); }
.badge--reading { background: #e4eefc; color: #17457f; text-transform: none; }
.badge--owner { background: #e4eefc; color: #17457f; text-transform: none; }
.badge--owner-unset { background: #fff4d6; color: #6b4d00; }
.badge--year { background: #fff4d6; color: #6b4d00; text-transform: none; }
.first-doc { margin-top: var(--s-4); padding: var(--s-4) var(--s-5); border: 1px solid #b9dcc9; border-radius: var(--radius-m); background: var(--c-brand-soft); }
.first-read { margin-top: var(--s-5); padding: var(--s-4) var(--s-5); border: 1px solid var(--c-brand); border-radius: var(--radius-m); background: var(--c-surface); box-shadow: 0 0 0 3px var(--c-brand-soft); }
.first-read__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-2); }
.first-read__fields { margin-top: var(--s-3); }
.first-read__value { font-weight: 700; color: var(--c-brand-strong); }
.owner-picker { margin-top: var(--s-4); margin-bottom: var(--s-4); max-width: 34rem; }
.extract { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--s-3) var(--s-4); margin: var(--s-4) 0 0; }
.extract dt { font-size: var(--fs--1); color: var(--c-muted); }
.extract dd { margin: 2px 0 0; font-weight: 600; word-break: break-word; }

/* Inline "Correct this" editor (return.html → Documents step) */
.btn--sm { min-height: 40px; padding: var(--s-2) var(--s-4); font-size: var(--fs--1); }
.doc-card__actions { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-4); }
.doc-edit { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--s-3) var(--s-4); margin-top: var(--s-3); }
.doc-edit .field__label { font-weight: 600; font-size: var(--fs--1); color: var(--c-muted); }
.doc-edit .input { min-height: 44px; }
.doc-edit .doc-card__actions { grid-column: 1 / -1; }

/* Income sources summary (return.html → Documents step) */
.income-card { margin-top: var(--s-5); padding: var(--s-4); border: 1px solid var(--c-line); border-radius: var(--radius-m); background: var(--c-surface); }
.income-card__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--s-2); }
.income-card__body { margin-top: var(--s-3); overflow-x: auto; }
.income-table { width: 100%; border-collapse: collapse; font-size: var(--fs--1); }
.income-table th, .income-table td { padding: var(--s-2) var(--s-3); text-align: left; border-bottom: 1px solid var(--c-line); vertical-align: top; }
.income-table thead th { font-size: var(--fs--1); color: var(--c-muted); font-weight: 600; white-space: nowrap; }
.income-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.income-table tbody th { font-weight: 400; }
.income-table__name { display: block; font-weight: 600; }
.income-table tbody th .badge { margin-top: var(--s-2); }
.income-table tfoot th, .income-table tfoot td { font-weight: 700; border-bottom: 0; }

/* Guided interview (return.html → Interview step) */
.interview { margin-top: var(--s-5); gap: var(--s-5); }
.interview fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: var(--s-3); }
.interview legend { padding: 0; font-weight: 700; font-size: var(--fs-0); }
.interview .fieldset__hint { font-size: var(--fs--1); color: var(--c-muted); }
.interview .choice { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.interview .form-row--three { display: grid; grid-template-columns: 2fr 1fr 2fr; gap: var(--s-4); }
.interview .form-row--city { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: var(--s-4); }
@media (max-width: 640px) { .interview .form-row--three, .interview .form-row--city { grid-template-columns: 1fr; } }
.interview .field__error { font-size: var(--fs--1); color: var(--c-danger); }
.interview .field.is-invalid .input { border-color: var(--c-danger); }
.interview .field.is-invalid .input:focus { box-shadow: 0 0 0 3px #f2b8bc; }
.interview .ssn { display: flex; gap: var(--s-2); align-items: center; }
.interview .ssn .input { font-variant-numeric: tabular-nums; letter-spacing: 0.04em; }
.interview .ssn__toggle { flex: none; min-height: 48px; padding: 0 var(--s-3); font: inherit; font-size: var(--fs--1); font-weight: 600; color: var(--c-brand-strong); background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius-s); cursor: pointer; }
.interview .ssn__toggle:hover { border-color: var(--c-brand); }
.interview__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-4); }

/* Interview step 2 — dependents add/remove list */
.dependent { border: 1px solid var(--c-line); border-radius: var(--radius-m); padding: var(--s-4); margin-bottom: var(--s-4); background: var(--c-surface); display: grid; gap: var(--s-4); }
.dependent__head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
.dependent__title { font-size: var(--fs-0); }
.dependent .field__label { font-weight: 600; font-size: var(--fs--1); color: var(--c-muted); }
.dependent .check { display: flex; align-items: center; gap: var(--s-2); font-size: var(--fs--1); cursor: pointer; }
.dependent .check input { accent-color: var(--c-brand); }
.dependent .hint { font-size: var(--fs--1); color: var(--c-muted); }

.interview .check { display: flex; align-items: flex-start; gap: var(--s-2); font-size: var(--fs--1); cursor: pointer; }
.interview .check input { accent-color: var(--c-brand); margin-top: 2px; }
.checkgroup { display: grid; gap: var(--s-2); }
.deduction { border: 1px solid var(--c-line); border-radius: var(--radius-m); padding: var(--s-4); background: var(--c-surface); }
.deduction .deduction__detail { display: grid; gap: var(--s-4); padding-top: var(--s-2); border-top: 1px dashed var(--c-line); }
.deduction .hint { font-size: var(--fs--1); color: var(--c-muted); }
.deduction .form-row--three { grid-template-columns: repeat(3, 1fr); }
/* Standard vs itemized comparison (return.html → Interview step) */
.card-compare { display: grid; gap: var(--s-4); margin-top: var(--s-6); padding: var(--s-5); border: 1px solid var(--c-line); border-radius: var(--radius-m); background: var(--c-surface); }
.card-compare__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--s-2); }
.card-compare__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-4); }
@media (max-width: 640px) { .card-compare__grid { grid-template-columns: 1fr; } }
.ded-option { border: 1px solid var(--c-line); border-radius: var(--radius-m); padding: var(--s-4); background: var(--c-bg, #fff); }
.ded-option.is-chosen { border-color: var(--c-brand); box-shadow: 0 0 0 1px var(--c-brand) inset; }
.ded-option__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-2); }
.ded-option__title { font-size: var(--fs-0); margin: 0; }
.ded-option__total { margin: var(--s-2) 0 0; font-size: var(--fs-2); font-weight: 700; font-variant-numeric: tabular-nums; }
.ded-option__lines { list-style: none; margin: var(--s-3) 0 0; padding: 0; display: grid; gap: var(--s-2); font-size: var(--fs--1); }
.ded-option__lines li { display: flex; justify-content: space-between; gap: var(--s-3); border-top: 1px dashed var(--c-line); padding-top: var(--s-2); }
.ded-option__lines .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.badge--recommended { background: var(--c-brand-soft); color: var(--c-brand-strong); text-transform: none; }
.ded-option__verdict { margin: 0; font-size: var(--fs--1); color: var(--c-muted); }
.choice--compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--s-3); }

.btn--small { min-height: 40px; padding: 0 var(--s-3); font-size: var(--fs--1); }

/* Review step: federal result and the line-by-line table. */
.calc-cards { margin-top: var(--s-4); display: grid; gap: var(--s-4); grid-template-columns: 1fr; align-items: start; }
@media (min-width: 900px) { .calc-cards { grid-template-columns: 1fr 1fr; } }
.calc-card { padding: var(--s-4); border: 1px solid var(--c-line); border-radius: var(--radius-m); min-width: 0; }
.calc-card__title { margin: 0; font-size: var(--fs-0); }
.calc-card .calc-outcome { margin-top: var(--s-3); }
.calc-unsupported { margin-top: var(--s-3); padding: var(--s-4); border: 1px dashed var(--c-line); border-radius: var(--radius-m); background: var(--c-surface); }
.calc-unsupported__head { margin: 0; font-weight: 700; }
.calc-unsupported .muted { margin: var(--s-2) 0 0; font-size: var(--fs--1); }
.calc-extra-state { margin-top: var(--s-4); padding-top: var(--s-4); border-top: 1px solid var(--c-line); }
.calc-extra-state__warnings { margin: var(--s-3) 0 0; padding-left: var(--s-4); font-size: var(--fs--1); }
.calc-attach { margin-top: var(--s-3); padding: var(--s-3); border: 1px solid #e8cf90; background: #fff4d6; color: #6b4d00; border-radius: var(--radius-s); }
.calc-attach__title { margin: 0 0 var(--s-2); font-size: var(--fs--1); }
.calc-attach__list { margin: 0; padding-left: var(--s-4); font-size: var(--fs--1); }
.calc-attach__list li + li { margin-top: var(--s-1); }
.calc-outcome { margin-top: var(--s-4); padding: var(--s-4); border: 1px solid var(--c-line); border-left-width: 4px; border-radius: var(--radius-m); background: var(--c-surface); }
.calc-outcome--refund { border-left-color: var(--c-brand); }
.calc-outcome--owed { border-left-color: var(--c-danger); }
.calc-outcome__label { margin: 0; font-size: var(--fs--1); font-weight: 600; color: var(--c-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.calc-outcome__amount { margin: var(--s-2) 0 0; font-size: var(--fs-3); font-weight: 700; font-variant-numeric: tabular-nums; }
.calc-outcome__note { margin: var(--s-2) 0 0; font-size: var(--fs--1); }
.calc-table__wrap { margin-top: var(--s-4); overflow-x: auto; }
.calc-table { width: 100%; border-collapse: collapse; }
.calc-table th, .calc-table td { padding: var(--s-3); text-align: left; border-bottom: 1px solid var(--c-line); vertical-align: top; }
.calc-table thead th { font-size: var(--fs--1); color: var(--c-muted); font-weight: 600; }
.calc-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.calc-table tbody th { font-weight: 400; }
.calc-row__label { display: block; font-weight: 600; }
.calc-row__toggle { width: 1%; white-space: nowrap; }
.calc-row.is-open > th, .calc-row.is-open > td { border-bottom: 0; }
.calc-toggle { font: inherit; font-size: var(--fs--1); font-weight: 600; color: var(--c-brand-strong); background: none; border: 1px solid var(--c-line); border-radius: var(--radius-s); padding: var(--s-2) var(--s-3); min-height: 36px; cursor: pointer; }
.calc-toggle:hover { border-color: var(--c-brand); }
.calc-toggle[aria-expanded="true"] { background: var(--c-brand-soft); border-color: var(--c-brand); }
.calc-detail td { background: var(--c-surface); }
.calc-detail__list { margin: 0; padding-left: var(--s-4); display: grid; gap: var(--s-2); font-size: var(--fs--1); color: var(--c-muted); }

/* Review: "What changed" diff between two calculation runs */
.calc-diff { margin-top: var(--s-4); padding: var(--s-4); border: 1px solid var(--c-brand); border-radius: var(--radius-m); background: var(--c-brand-soft); }
.calc-diff__head { margin: 0; font-size: var(--fs--1); font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.calc-diff__note { margin: var(--s-2) 0 0; font-size: var(--fs--1); }
.calc-diff__list { margin: var(--s-3) 0 0; padding: 0; list-style: none; display: grid; gap: var(--s-2); font-size: var(--fs--1); }
.calc-diff__list li { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: baseline; }
.calc-diff__name { font-weight: 600; }
.calc-diff__from { color: var(--c-muted); font-variant-numeric: tabular-nums; }
.calc-delta { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.calc-delta--up { color: var(--c-brand-strong); }
.calc-delta--down { color: var(--c-danger); }
.calc-row--changed > th, .calc-row--changed > td { background: var(--c-brand-soft); }
.calc-row--changed > th { box-shadow: inset 3px 0 0 var(--c-brand); }
.calc-row__delta { display: block; font-size: var(--fs--1); font-weight: 700; font-variant-numeric: tabular-nums; }
.calc-row__was { display: block; font-size: var(--fs--1); font-weight: 400; color: var(--c-muted); font-variant-numeric: tabular-nums; }

/* Forms step: the IRS forms this return needs, each with a PDF preview */
.forms-list { margin: var(--s-4) 0 0; padding: 0; list-style: none; display: grid; gap: var(--s-3); }
.forms-list[hidden] { display: none; }
.form-item { display: flex; flex-wrap: wrap; gap: var(--s-3); justify-content: space-between; align-items: center; padding: var(--s-4); border: 1px solid var(--c-line); border-radius: var(--radius-m); background: var(--c-surface); }
.form-item__main { min-width: 0; }
.form-item__head { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; }
.form-item__name { font-weight: 600; }
.form-item__desc { margin: var(--s-2) 0 0; font-size: var(--fs--1); }
.badge--optional { background: #fff4d6; color: #6b4d00; text-transform: none; }
.badge--ready { background: #dff2e6; color: #1c5c37; text-transform: none; }
.badge--pending { background: #fff4d6; color: #6b4d00; text-transform: none; }
.form-item--pending { border-style: dashed; }
.form-item__why { margin: var(--s-2) 0 0; font-size: var(--fs--1); color: var(--c-ink-2); }
.form-item__blocked { margin: var(--s-2) 0 0; font-size: var(--fs--1); color: #6b4d00; }
.form-item__warn-head { margin: var(--s-2) 0 0; font-size: var(--fs--1); font-weight: 600; color: #6b4d00; }
.form-item__warnings { margin: var(--s-1) 0 0; padding-left: var(--s-5, 20px); font-size: var(--fs--1); color: #6b4d00; }
.form-item__warnings li { margin-top: 2px; }

/* Signing packet: build + download the ZIP, then what's inside and what to mail */
.packet { margin-top: var(--s-5); padding-top: var(--s-5); border-top: 1px solid var(--c-line); }
.packet__status { margin: var(--s-3) 0 0; font-size: var(--fs--1); color: var(--c-muted); }
.packet__status[hidden] { display: none; }
.packet__subhead { margin: var(--s-5) 0 var(--s-2); font-size: var(--fs-0); }
.packet__contents { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--s-2); }
.packet__contents li { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: baseline; padding: var(--s-2) var(--s-3); border: 1px solid var(--c-line); border-radius: var(--radius-s); background: var(--c-surface); }
.packet__file { font-weight: 600; }
.packet__meta { font-size: var(--fs--1); }
.packet__steps { margin: 0; padding-left: var(--s-5); display: grid; gap: var(--s-2); }
.packet__steps li { line-height: 1.5; }
.btn.is-busy { position: relative; padding-left: calc(var(--s-5) + var(--s-3)); }
.btn.is-busy::before {
  content: ''; position: absolute; left: var(--s-3); top: 50%; width: 0.9em; height: 0.9em; margin-top: -0.45em;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: packet-spin 0.7s linear infinite;
}
@keyframes packet-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .btn.is-busy::before { animation-duration: 2.4s; } }

/* Panel states: loading / empty / error / coming soon (return.html panels). */
.panel-state { display: flex; align-items: center; justify-content: center; gap: var(--s-3); padding: var(--s-5); text-align: center; border: 1px dashed var(--c-line); border-radius: var(--radius-m); color: var(--c-muted); font-size: var(--fs--1); }
.panel-state__text { margin: 0; max-width: 46ch; }
.panel-state--soon { background: var(--c-brand-soft); border-color: #b9dcc9; color: var(--c-brand-strong); border-style: solid; }
.panel-state--error { background: #fdecec; border-color: #f2b8bc; color: var(--c-danger); border-style: solid; }
.panel-state__spinner { width: 16px; height: 16px; flex: none; border-radius: 50%; border: 2px solid var(--c-line); border-top-color: var(--c-brand); animation: panel-spin 0.8s linear infinite; }
@keyframes panel-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .panel-state__spinner { animation-duration: 3s; } }

/* ---- Signature step -------------------------------------------------- */
/* The preview stands in for a wet signature: a handwriting-style face over a
   signing rule, so what the signer types is what appears on the 1040. */
.signature-preview { border: 1px solid var(--c-line); border-radius: var(--radius-m); background: var(--c-surface); padding: var(--s-4); }
.signature-preview__label { margin: 0 0 var(--s-3); }
.signature-preview__row { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: var(--s-4); align-items: end; }
.signature-preview__slot { display: grid; gap: var(--s-2); min-width: 0; }
.signature-preview__caption { font-size: var(--fs--1); border-top: 1px solid var(--c-line); padding-top: var(--s-2); }
.signature-script {
  font-family: "Snell Roundhand", "Segoe Script", "Brush Script MT", "Lucida Handwriting", cursive;
  font-size: var(--fs-2); line-height: 1.4; color: var(--c-ink);
  overflow-wrap: break-word; min-height: 1.6em;
}
.signature-script.is-placeholder { color: var(--c-muted); opacity: 0.6; }
.signature-preview__date { font-variant-numeric: tabular-nums; min-height: 1.6em; }
.signature-preview__slot--initials .signature-script { letter-spacing: 0.06em; }
.packet__lock { margin-top: var(--s-2); }
.packet__progress { margin: var(--s-3) 0 0; }
.packet__progress[hidden] { display: none; }
.packet__forms { list-style: none; margin: var(--s-3) 0 0; padding: 0; font-size: var(--fs--1); }
.packet__forms[hidden] { display: none; }
.packet__form-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-1) 0; border-bottom: 1px solid var(--c-line); }
.packet__form-row:last-child { border-bottom: 0; }
.packet__form-row.is-waiting .packet__form-name { color: var(--c-muted); }
/* Indeterminate: the backend sent no Content-Length, so we sweep instead of lying about a percentage. */
.progress--indeterminate > span { animation: progress-sweep 1.2s ease-in-out infinite; transform-origin: left center; }
@keyframes progress-sweep { 0% { transform: scaleX(0.15); } 50% { transform: scaleX(1); } 100% { transform: scaleX(0.15); } }
@media (prefers-reduced-motion: reduce) { .progress--indeterminate > span { animation: none; } }
.packet__retry { margin-top: var(--s-3); }
.packet__fee { margin: var(--s-3) 0 0; padding: var(--s-4); border: 1px solid #b9dcc9; border-radius: var(--radius-s); background: var(--c-brand-soft); }
.packet__fee[hidden] { display: none; }
.packet__fee-head { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: baseline; justify-content: space-between; }
.packet__fee-title { margin: 0; font-size: var(--fs-0); }
.packet__fee-blurb { margin: var(--s-1) 0 0; font-size: var(--fs--1); }
.packet__fee-total { margin: 0; font-size: var(--fs-2); font-weight: 700; font-variant-numeric: tabular-nums; color: var(--c-brand-strong); }
.packet__fee-note { margin: var(--s-3) 0 0; font-size: var(--fs--1); }
.packet__missing { margin: var(--s-3) 0 0; padding: var(--s-3); border: 1px solid #e6c98a; border-radius: var(--radius-s); background: #fff8e6; font-size: var(--fs--1); }
.packet__missing[hidden] { display: none; }
.packet__missing-title { margin: 0; font-weight: 700; }
.packet__missing-list { margin: var(--s-1) 0 0; padding-left: var(--s-4); }
.packet__fee-actions { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; margin-top: var(--s-3); }
.packet__fee-status { font-size: var(--fs--1); }
.packet__fee-was { margin-right: var(--s-1); font-size: var(--fs-0); font-weight: 400; color: var(--c-muted); }
.packet__fee-was[hidden] { display: none; }
.packet__fee-applied { margin: var(--s-1) 0 0; font-size: var(--fs--1); text-align: right; }
.packet__promo { display: grid; gap: var(--s-2); margin-top: var(--s-3); }
.packet__promo label { font-weight: 600; font-size: var(--fs--1); }
.packet__promo-row { display: flex; gap: var(--s-2); align-items: center; max-width: 360px; }
.packet__promo-row .input { flex: 1 1 auto; min-width: 0; min-height: 40px; padding: var(--s-2) var(--s-3); text-transform: uppercase; }
.packet__promo.is-invalid .input { border-color: var(--c-danger); }
.packet__promo-error { margin: 0; font-size: var(--fs--1); color: var(--c-danger); }
.packet__receipt { margin: var(--s-3) 0 0; font-size: var(--fs--1); color: var(--c-brand-strong); }
.packet__receipt[hidden] { display: none; }
.packet__count { margin: var(--s-2) 0 0; font-size: var(--fs--1); }
.packet__address { margin: 0; font-style: normal; line-height: 1.6; padding: var(--s-3); border: 1px solid var(--c-line); border-radius: var(--radius-s); background: var(--c-surface); }
.packet__addresses { display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.packet__address-block[hidden] { display: none; }
.packet__address-title { margin: 0 0 var(--s-2); font-size: var(--fs--1); text-transform: uppercase; letter-spacing: .04em; color: var(--c-muted); }
.packet__voucher { margin: var(--s-2) 0 0; font-size: var(--fs--1); }
.packet__voucher[hidden] { display: none; }
@media (max-width: 640px) {
  .signature-preview__row { grid-template-columns: 1fr; }
}

/* Business P&L: entity list, ledger add-row form and inline row editing. */
.pl-subhead { font-size: var(--fs-0); margin-top: var(--s-5); }
.entity-list { list-style: none; margin: var(--s-3) 0 0; padding: 0; display: grid; gap: var(--s-2); }
.entity-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-3); border: 1px solid var(--c-line); border-radius: var(--radius-m); }
.entity-row__meta { display: block; font-size: var(--fs--1); }
.pl-form { margin-top: var(--s-3); }
.property-card { display: block; padding: var(--s-3); border: 1px solid var(--c-line); border-radius: var(--radius-m); }
.property-card__head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
.property-card__actions { display: flex; gap: var(--s-2); flex-shrink: 0; }
.property-ledger { margin-top: var(--s-3); padding-top: var(--s-3); border-top: 1px solid var(--c-line); }
.property-ledger .calc-outcome { margin-top: var(--s-3); }
.cost-seg .calc-table .input { max-width: 7rem; margin-left: auto; text-align: right; }
.cost-seg__preview { margin-top: var(--s-3); }
.home-office__methods { display: grid; gap: var(--s-2); margin-top: var(--s-3); }
.home-office .pl-row { margin-top: var(--s-3); }
.home-office__result { margin-top: var(--s-4); }
.vehicles__result { margin-top: var(--s-4); }
.vehicle-card { padding: var(--s-3); border: 1px solid var(--c-line); border-radius: var(--radius-m); margin-top: var(--s-3); }
.vehicle-card .pl-row { margin-top: var(--s-3); }
.vehicle-card__note { margin: var(--s-3) 0 0; }
.pl-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-3); }
@media (max-width: 720px) { .pl-row { grid-template-columns: 1fr; } }
.ledger-actions { white-space: nowrap; text-align: right; }
.ledger-actions .btn + .btn { margin-left: var(--s-2); }
.ledger-row--editing td { vertical-align: top; }
.ledger-row--editing .input { min-width: 8ch; }
.ledger-row--editing select + select { margin-top: var(--s-2); }
.prop-flag { margin-left: var(--s-2); }

/* Depreciation: Section 179 / bonus election limits and the per-asset toggles. */
.election-limits { margin-top: var(--s-4); padding: var(--s-4); border: 1px solid var(--c-line); border-radius: var(--radius-m); background: var(--c-surface-2); }
.election-limits__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-3); margin: 0; }
.election-limits__grid dt { font-size: var(--fs--1); color: var(--c-muted); }
.election-limits__grid dd { margin: var(--s-1) 0 0; font-weight: 600; font-variant-numeric: tabular-nums; }
@media (max-width: 720px) { .election-limits__grid { grid-template-columns: repeat(2, 1fr); } }
.election-cell { min-width: 15ch; }
.election-cell .check { display: flex; align-items: center; gap: var(--s-2); font-size: var(--fs--1); cursor: pointer; }
.election-cell .check input { accent-color: var(--c-brand); }
.election-cell__amount { margin: var(--s-2) 0; max-width: 14ch; }
.election-cell__over { display: block; margin-top: var(--s-2); font-size: var(--fs--1); color: var(--c-danger); }
/* Capital-purchase flag in the business and property ledgers: a row over the
   capitalisation threshold that can be depreciated instead of deducted. */
.badge--capital { background: #fff4d6; color: #6b4d00; text-transform: none; }
.capital-cell { min-width: 22ch; }
.capital-cell .entity-row__meta { display: block; margin: var(--s-2) 0; }

/* Forms step: federal and state jurisdiction groups. */
.forms-group { margin-top: var(--s-5); }
.forms-group__head { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: baseline; }
.forms-group__title { margin: 0; font-size: var(--fs-0); }
.badge--jurisdiction { background: var(--c-surface-2, #f2f3f5); color: var(--c-ink-2); text-transform: none; }
.forms-group__empty { margin: var(--s-3) 0 0; padding: var(--s-4); border: 1px dashed var(--c-line); border-radius: var(--radius-m); }
.forms-group__empty--unsupported { color: #6b4d00; background: #fff8e6; border-color: #e6d3a3; }
.forms-checks__ok { margin: 0 0 var(--s-4); color: var(--c-brand-strong); font-weight: 600; }
.forms-checks__ok::before { content: "\2713\00a0"; }
.forms-checks__ok[hidden], .forms-checks[hidden] { display: none; }
.forms-checks { margin: 0 0 var(--s-4); padding: var(--s-4); border: 1px solid #e8cf90; border-radius: var(--radius-m); background: #fff4d6; color: #6b4d00; }
.forms-checks__title { margin: 0 0 var(--s-2); font-size: var(--fs-0); }
.forms-checks__lead { margin: 0 0 var(--s-3); font-size: var(--fs--1); }
.forms-checks__list { margin: 0 0 var(--s-3); padding-left: var(--s-5); font-size: var(--fs--1); }
.forms-checks__contact { font-weight: 600; color: inherit; }

/* Signature placements: page-by-page preview of where the signature lands. */
.sig-form { border: 1px solid var(--c-line); border-radius: var(--radius-m); background: var(--c-surface); padding: var(--s-4); margin-bottom: var(--s-4); }
.sig-form__head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); margin-bottom: var(--s-3); }
.sig-form__title { margin: 0; font-size: var(--fs-0); }
.sig-form__pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--s-4); }
.sig-page { display: grid; gap: var(--s-2); }
.sig-page__sheet { position: relative; aspect-ratio: 8.5 / 11; border: 1px solid var(--c-line); border-radius: var(--radius-s); background: #fff; overflow: hidden; }
.sig-page__block { position: absolute; display: grid; gap: 2px; border-bottom: 1px solid var(--c-ink); padding-bottom: 2px; }
.sig-page__value { font-size: var(--fs--1); line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sig-page__block--name .sig-page__value, .sig-page__block--initials .sig-page__value { font-family: "Segoe Script", "Brush Script MT", cursive; }
.sig-page__caption { font-size: 9px; color: var(--c-muted); white-space: nowrap; }
.sig-page__block.is-unfilled { border-bottom-color: var(--c-danger); background: #fdecec; }
.sig-page__block.is-unfilled .sig-page__value { color: var(--c-danger); opacity: 0.7; }
.sig-page__label { margin: 0; font-size: var(--fs--1); }
.sig-form__check { display: flex; align-items: center; gap: var(--s-2); margin-top: var(--s-3); font-size: var(--fs--1); }

/* ---- CPA review (return.html Forms step) ---- */
/* Add-ons card on the Forms step (return.html #addons). */
.addons { margin-top: var(--s-5); padding-top: var(--s-5); border-top: 1px solid var(--c-line); }
.addons[hidden] { display: none; }
.addons-list { list-style: none; margin: var(--s-4) 0 0; padding: 0; display: grid; gap: var(--s-3); }
.addon-row { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; justify-content: space-between; padding: var(--s-3) var(--s-4); border: 1px solid var(--c-line); border-radius: var(--radius-m); background: var(--c-surface); }
.addon-row.is-paid { border-color: #b9dcc9; background: var(--c-brand-soft); }
.addon-row__label { font-weight: 600; }
.addon-row__side { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; }
.addon-row__price { font-variant-numeric: tabular-nums; font-weight: 600; }
.badge--paid { background: #dff2e6; color: #1c5c37; text-transform: none; }
.cpa { margin-top: var(--s-5); padding-top: var(--s-5); border-top: 1px solid var(--c-line); }
.cpa.is-locked .cpa-list { display: none; }
.cpa__lock { margin-top: var(--s-2); }
.cpa-list { list-style: none; margin: var(--s-4) 0 0; padding: 0; display: grid; gap: var(--s-3); }
.cpa-list[hidden] { display: none; }
.cpa-list__heading { list-style: none; margin-top: var(--s-3); }
.cpa-list__title { font-size: 1rem; margin: 0; }
.cpa-list__note { list-style: none; }
.cpa-card { border: 1px solid var(--c-line); border-radius: var(--radius-m); background: var(--c-surface); }
.cpa-card.is-chosen { border-color: var(--c-brand); box-shadow: 0 0 0 1px var(--c-brand) inset; }
.cpa-card__label { display: flex; gap: var(--s-3); align-items: flex-start; padding: var(--s-3) var(--s-4); cursor: pointer; }
.cpa-card__body { display: grid; gap: var(--s-2); }
.cpa-card__head { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; }
.cpa-card__name { font-weight: 600; }
.cpa-card__meta { font-size: var(--fs--1); }
.cpa-card__fee { font-variant-numeric: tabular-nums; font-weight: 600; }
.cpa__confirm[hidden] { display: none; }
.cpa__actions { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-4); }
.cpa-fees { margin: 0; display: grid; gap: var(--s-2); }
.cpa-fees__row { display: flex; justify-content: space-between; gap: var(--s-3); border-top: 1px dashed var(--c-line); padding-top: var(--s-2); }
.cpa-fees__row dt, .cpa-fees__row dd { margin: 0; font-size: var(--fs--1); }
.cpa-fees__row dd { font-variant-numeric: tabular-nums; }
.cpa-fees__row--total dt, .cpa-fees__row--total dd { font-weight: 700; font-size: var(--fs-0); }
.cpa__done[hidden] { display: none; }
.pay { margin-top: var(--s-4); padding-top: var(--s-4); border-top: 1px dashed var(--c-line); }
.pay[hidden] { display: none; }
.pay .cpa-fees { margin-top: var(--s-3); }
.pay .cpa-fees[hidden] { display: none; }

/* CPA review status card (return.html) + matching row badge (app.html) */
.badge--review-pending { background: #fff4d6; color: #6b4d00; text-transform: none; }
.badge--review-accepted { background: #e8e6fb; color: #3c2f8f; text-transform: none; }
.badge--review-changes_requested { background: #fdecec; color: var(--c-danger); text-transform: none; }
.badge--review-approved { background: var(--c-brand-soft); color: var(--c-brand-strong); text-transform: none; }
.badge--review-declined { background: var(--c-surface-2); color: var(--c-ink-2); text-transform: none; }
.review-status { margin-top: var(--s-4); border: 1px solid var(--c-line); border-radius: var(--radius-m); padding: var(--s-4); background: var(--c-surface); }
.review-status[hidden] { display: none; }
.rate-cpa { margin-top: var(--s-4); display: grid; gap: var(--s-2); }
.rate-cpa[hidden] { display: none; }
.rate-cpa__stars { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: var(--s-3); }
.rate-cpa__stars span { color: var(--c-accent); }
.rate-cpa textarea { width: 100%; }
.review-status__head { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; justify-content: space-between; }
.review-status__title { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; }
.review-status__blurb { margin-top: var(--s-2); }
.review-status__meta { margin-top: var(--s-2); font-size: var(--fs--1); color: var(--c-muted); }
.review-notes { list-style: none; margin: var(--s-3) 0 0; padding: 0; display: grid; gap: var(--s-2); }
.review-notes__item { border-left: 3px solid var(--c-danger); border-radius: var(--radius-s, 6px); background: var(--c-surface-2); padding: var(--s-2) var(--s-3); }
.review-notes__line { font-weight: 600; font-size: var(--fs--1); }
.review-notes__note { margin: 2px 0 0; }
.review-8821 { margin-top: var(--s-4); padding-top: var(--s-3); border-top: 1px dashed var(--c-line); }
.review-8821__state { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; }
.review-8821__link { margin-top: var(--s-3); display: inline-block; }
/* Sign step: where the refund goes (return.html #refund-card). */
.refund-card { margin-top: var(--s-6); padding: var(--s-4); border: 1px solid var(--c-line); border-radius: var(--radius-m); background: var(--c-surface); }
.refund-card[hidden], .refund-card [hidden] { display: none; }
.refund-card__saved { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; justify-content: space-between; margin-top: var(--s-3); }
.refund-card__saved p { margin: 0; font-weight: 600; }
.refund-card__types { display: flex; flex-wrap: wrap; gap: var(--s-4); }
.refund-card__types input { accent-color: var(--c-brand); }

/* CPA review workspace (review.html): the note the CPA leaves against one
   calculated line or one form, folded away until they ask for it. */
.rev-note { margin-top: var(--s-2); display: grid; gap: var(--s-2); justify-items: start; }
.rev-note__input { min-width: 14rem; width: 100%; }
.rev-note__input[hidden] { display: none; }
.calc-table .rev-note { justify-items: end; }
/* Accessibility pass (review.html only, scoped by .review-ws). Text inputs
   swap the browser outline for a soft halo that is too faint to find by
   keyboard, so they get the same 3px ring as every other focusable control;
   the buttons get it explicitly so no later rule can take it away. Placeholder
   text and the unsigned signature preview were below 4.5:1 and now use the
   muted ink at full opacity (5.2:1 on white). */
.review-ws .btn:focus-visible,
.review-ws .calc-toggle:focus-visible,
.review-ws .input:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 2px; }
.review-ws .input::placeholder { color: var(--c-muted); opacity: 1; }
.review-ws .signature-script.is-placeholder { opacity: 1; }

/* Public CPA vanity profile (cpa.html): a signed-out landing page, so it reads
   like the marketing site rather than the workspace. */
.cpa-profile { padding-block: var(--s-7) var(--s-8); }
.cpa-hero { display: grid; grid-template-columns: auto 1fr auto; gap: var(--s-6); align-items: start; background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius-l); padding: var(--s-6); box-shadow: var(--shadow-s); }
.cpa-hero__photo { width: 112px; height: 112px; border-radius: 50%; object-fit: cover; border: 3px solid var(--c-brand-soft); }
.cpa-hero__initials { width: 112px; height: 112px; border-radius: 50%; display: grid; place-items: center; background: var(--c-brand); color: #fff; font-weight: 800; font-size: var(--fs-3); letter-spacing: -0.02em; }
.cpa-hero__body { display: grid; gap: var(--s-3); min-width: 0; }
.cpa-hero__name { font-size: var(--fs-3); }
.cpa-hero__facts { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-4); font-size: var(--fs--1); color: var(--c-muted); }
.cpa-hero__facts strong { color: var(--c-ink); font-weight: 600; }
.cpa-hero__bio { color: var(--c-ink-2); max-width: 62ch; }
.cpa-tags { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.cpa-cta { display: grid; gap: var(--s-3); justify-items: stretch; min-width: 260px; padding: var(--s-5); border-radius: var(--radius-m); background: var(--c-brand-soft); border: 1px solid #b9dcc9; text-align: center; }
.cpa-cta__fee { font-size: var(--fs-3); font-weight: 800; letter-spacing: -0.02em; color: var(--c-brand-strong); font-variant-numeric: tabular-nums; }
.cpa-cta__label { font-size: var(--fs--1); color: var(--c-brand-strong); }
.cpa-cta .btn { width: 100%; }
.cpa-rating { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: baseline; }
.cpa-rating__score { font-size: var(--fs-2); font-weight: 800; letter-spacing: -0.02em; }
.cpa-reviews { display: grid; gap: var(--s-4); margin-top: var(--s-5); }
.cpa-review { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius-m); padding: var(--s-5); box-shadow: var(--shadow-s); display: grid; gap: var(--s-3); }
.cpa-review__head { display: flex; gap: var(--s-3); align-items: center; flex-wrap: wrap; }
.cpa-review__who { display: grid; }
.cpa-review__who strong { font-size: var(--fs-0); }
.cpa-review__meta { font-size: var(--fs--1); color: var(--c-muted); }
.cpa-review__body { color: var(--c-ink-2); }
@media (max-width: 900px) {
  .cpa-hero { grid-template-columns: auto 1fr; }
  .cpa-cta { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .cpa-hero { grid-template-columns: 1fr; justify-items: start; }
}

/* CPA profile fields (auth.html signup, app.html profile card) */
.cpa-profile-fields { display: grid; gap: var(--s-4); }
.checkgroup--cols { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.checkgroup--cols .check { display: flex; align-items: flex-start; gap: var(--s-2); font-size: var(--fs--1); cursor: pointer; }
.checkgroup--cols .check input { accent-color: var(--c-brand); margin-top: 2px; }
.statepick { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: var(--s-2); max-height: 220px; overflow-y: auto; padding: var(--s-3); border: 1px solid var(--c-line); border-radius: var(--radius-s); background: var(--c-surface); }
.statepick__item { display: flex; align-items: center; gap: 6px; font-size: var(--fs--1); font-variant-numeric: tabular-nums; cursor: pointer; }
.statepick__item input { accent-color: var(--c-brand); }
.statepick__item input:disabled { opacity: 0.6; }
.statepick__item:has(input:checked) { font-weight: 700; color: var(--c-brand-strong); }
.slug { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
.slug__prefix { font-size: var(--fs--1); color: var(--c-muted); white-space: nowrap; }
.slug .input { flex: 1 1 200px; }
.slug__status { font-size: var(--fs--1); color: var(--c-muted); margin: 0; }
.slug__status--ok { color: var(--c-brand-strong); font-weight: 600; }
.slug__status--bad { color: var(--c-danger); font-weight: 600; }
.cpa-profile-summary dt { font-weight: 600; font-size: var(--fs--1); color: var(--c-muted); }
.cpa-profile-summary dd { margin: 0 0 var(--s-3); }
.earn-stats { display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); margin: 0; }
.earn-stat { border: 1px solid var(--c-line); border-radius: var(--radius-s); padding: var(--s-3) var(--s-4); }
.earn-stat dt { font-weight: 600; font-size: var(--fs--1); color: var(--c-muted); }
.earn-stat dd { margin: var(--s-1) 0 0; font-size: var(--fs-1); font-weight: 800; font-variant-numeric: tabular-nums; }
.earn-empty a { word-break: break-all; }

/* ── Structure interview ────────────────────────────────────────────────────
   Conversation on the left, the structure it builds on the right. The two
   columns are one story, so they share a height and scroll independently. */
.struct { padding-block: var(--s-6) var(--s-8); }
.struct__intro { max-width: 620px; margin-bottom: var(--s-6); }
.struct__intro .lead { margin-top: var(--s-3); }
/* One column: the interview is its own section (.is-interview), and on every
   other section it is a popout behind .chat-fab, so the panes get the width. */
.struct__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-5); align-items: start; }
.struct__view { order: 1; }
.struct__grid .struct__chat { order: 2; }
.struct__grid.is-interview { row-gap: 0; }

.struct__chat { display: flex; flex-direction: column; padding: var(--s-4); }
.struct__grid:not(.is-interview) .struct__chat { display: none; }
.struct__grid:not(.is-interview) .struct__chat.is-open {
  display: flex; position: fixed; right: var(--s-5); bottom: 88px; z-index: 70;
  width: min(420px, calc(100vw - 32px)); height: min(620px, calc(100vh - 120px));
  box-shadow: var(--shadow-m);
}
.struct__grid .struct__chat.is-open .chat__log { flex: 1 1 auto; height: auto; min-height: 0; }
.chat__close { display: none; font-size: 1.25rem; line-height: 1; }
.struct__chat.is-open .chat__close { display: inline-flex; }
.chat-fab {
  position: fixed; right: var(--s-5); bottom: var(--s-5); z-index: 70;
  display: inline-flex; align-items: center; gap: var(--s-2); min-height: 52px; padding: 0 var(--s-5) 0 var(--s-4);
  border: 0; border-radius: 999px; background: var(--c-brand); color: #fff; font: inherit; font-weight: 600;
  box-shadow: var(--shadow-m); cursor: pointer; transition: background var(--ease);
}
.chat-fab:hover { background: var(--c-brand-strong); }
.chat-fab[hidden] { display: none; }
.chat-fab svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 600px) {
  .struct__grid:not(.is-interview) .struct__chat.is-open { left: 8px; right: 8px; width: auto; bottom: 80px; height: calc(100vh - 110px); }
  .chat-fab { right: var(--s-4); bottom: var(--s-4); }
}
.struct__chat-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); margin-bottom: var(--s-3); }
.struct__h { font-size: var(--fs-1); }
.btn--tiny { min-height: 34px; padding: var(--s-1) var(--s-3); font-size: var(--fs--1); }

.chat__log { flex: 1; min-height: 280px; overflow-y: auto; display: flex; flex-direction: column; gap: var(--s-3); padding: var(--s-2) var(--s-1); }
/* Desktop: half the height the log used to take (it filled the viewport). */
@media (min-width: 981px) { .chat__log { flex: none; height: calc(50vh - 161px); min-height: 200px; } }
.chat__msg { display: flex; }
.chat__msg--user { justify-content: flex-end; }
.chat__bubble { max-width: 90%; padding: var(--s-3) var(--s-4); border-radius: var(--radius-m); background: var(--c-surface-2); color: var(--c-ink); white-space: pre-wrap; }
.chat__msg--user .chat__bubble { background: var(--c-brand); color: #fff; border-bottom-right-radius: var(--s-1); }
.chat__msg--assistant .chat__bubble { border-bottom-left-radius: var(--s-1); }
.chat__msg--typing .chat__bubble { color: var(--c-muted); letter-spacing: 0.2em; }
.chat__form { display: flex; gap: var(--s-2); align-items: flex-end; margin-top: var(--s-3); }
.chat__form textarea { flex: 1; resize: vertical; min-height: 52px; font: inherit; padding: var(--s-3); border: 1px solid var(--c-line); border-radius: var(--radius-s); background: var(--c-surface); color: var(--c-ink); }
.chat__note { font-size: var(--fs--1); margin-top: var(--s-2); }

.struct__stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-3); margin-bottom: var(--s-5); }
@media (max-width: 620px) { .struct__stats { grid-template-columns: repeat(2, 1fr); } }
.sstat { padding: var(--s-3) var(--s-4); border: 1px solid var(--c-line); border-radius: var(--radius-m); background: var(--c-surface); }
.sstat__n { display: block; font-size: var(--fs-2); font-weight: 800; letter-spacing: -0.02em; color: var(--c-ink); }
.sstat__l { display: block; font-size: var(--fs--1); color: var(--c-muted); }
.sstat--warn { border-color: #f2b8bc; background: #fdecec; }
.sstat--warn .sstat__n { color: var(--c-danger); }
.sstat--good { border-color: #b9dcc9; background: var(--c-brand-soft); }
.sstat--good .sstat__n { color: var(--c-brand-strong); }

.tabs--four { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 720px) { .tabs--four { grid-template-columns: repeat(2, 1fr); } }
.tab__n { display: inline-block; min-width: 20px; margin-left: var(--s-1); padding: 0 var(--s-1); border-radius: 999px; background: var(--c-brand); color: #fff; font-size: 0.7rem; line-height: 18px; }
.tab__n:empty { display: none; }

/* The org chart. Nested lists with drawn connectors: it reflows to one column on a
   phone instead of becoming a diagram that scrolls off the side of the screen. */
.orgchart { overflow-x: auto; padding: var(--s-4) var(--s-2); background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius-m); }
.orgchart__empty { padding: var(--s-6) var(--s-4); text-align: center; }
.orgroot, .orgchildren { display: flex; flex-direction: column; gap: var(--s-2); }
.orgchildren { margin-left: var(--s-5); padding-left: var(--s-5); border-left: 2px solid var(--c-line); margin-top: var(--s-2); }
.orgbranch { position: relative; }
.orgchildren > .orgbranch::before { content: ""; position: absolute; left: calc(var(--s-5) * -1 - 2px); top: 22px; width: var(--s-5); height: 2px; background: var(--c-line); }
.orgnode { display: grid; gap: 2px; width: 100%; max-width: 460px; text-align: left; padding: var(--s-3) var(--s-4); border: 1px solid var(--c-line); border-radius: var(--radius-m); background: var(--c-surface); font: inherit; cursor: pointer; position: relative; transition: border-color var(--ease), box-shadow var(--ease); }
.orgnode:hover { border-color: var(--c-brand); box-shadow: var(--shadow-s); }
.orgnode__name { font-weight: 700; color: var(--c-ink); }
.orgnode__meta { display: flex; gap: var(--s-2); font-size: var(--fs--1); color: var(--c-muted); }
.orgnode__pct { color: var(--c-brand); font-weight: 600; }
.orgnode__tax { font-size: var(--fs--1); color: var(--c-ink-2); }
.orgnode__co { display: block; font-size: var(--fs--1); color: var(--c-muted); }
.orgnode__tax--unknown { color: var(--c-danger); }
.orgnode--you { border-color: var(--c-brand); background: var(--c-brand-soft); }
.orgnode--flag { border-left: 4px solid var(--c-accent); }
.orgnode__flag { position: absolute; top: var(--s-3); right: var(--s-3); min-width: 22px; height: 22px; display: grid; place-items: center; border-radius: 999px; background: var(--c-accent); color: var(--c-accent-ink); font-size: 0.72rem; font-weight: 700; }

.detail { margin-top: var(--s-4); padding: var(--s-5); border: 1px solid var(--c-line); border-radius: var(--radius-m); background: var(--c-surface-2); }
.detail h3 { margin-bottom: var(--s-3); }
.detail h4 { margin-top: var(--s-4); margin-bottom: var(--s-2); font-size: var(--fs-0); }
.detail__facts { display: grid; grid-template-columns: auto 1fr; gap: var(--s-1) var(--s-4); margin: 0; font-size: var(--fs--1); }
.detail__facts dt { color: var(--c-muted); }
.detail__facts dd { margin: 0; color: var(--c-ink); }
.detail__flow { margin-top: var(--s-4); padding: var(--s-3) var(--s-4); border-left: 3px solid var(--c-brand); background: var(--c-surface); border-radius: var(--radius-s); color: var(--c-ink-2); }
.detail__list { display: grid; gap: var(--s-2); }
.detail__list li { font-size: var(--fs--1); color: var(--c-ink-2); }
.detail__route { display: block; color: var(--c-brand); font-weight: 600; }

/* Findings. Each is a claim, its reasoning, what to do and the authority for it —
   in that order, because a conclusion without its reasoning is just an assertion. */
.finding, .docreq { padding: var(--s-5); border: 1px solid var(--c-line); border-left: 4px solid var(--c-line); border-radius: var(--radius-m); background: var(--c-surface); margin-bottom: var(--s-3); }
.finding--conflict { border-left-color: var(--c-danger); }
.finding--risk { border-left-color: var(--c-accent); }
.finding--question { border-left-color: var(--c-brand); }
.finding--opportunity { border-left-color: var(--c-brand-strong); }
.finding--conclusion { border-left-color: var(--c-line); background: var(--c-surface-2); }
.finding--done { opacity: 0.55; }
.finding__head, .docreq__head { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; margin-bottom: var(--s-2); }
.finding__tag, .docreq__tag { font-size: var(--fs--1); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--c-muted); }
.finding__blocks { font-size: var(--fs--1); font-weight: 600; padding: 2px var(--s-2); border-radius: 999px; background: #fdecec; color: var(--c-danger); }
.finding__save, .docreq__got { font-size: var(--fs--1); font-weight: 700; padding: 2px var(--s-2); border-radius: 999px; background: var(--c-brand-soft); color: var(--c-brand-strong); }
.finding__statement, .docreq__title { font-size: var(--fs-0); font-weight: 700; margin-bottom: var(--s-2); }
.finding__why, .docreq__why { color: var(--c-ink-2); font-size: var(--fs--1); }
.finding__action { margin-top: var(--s-3); padding: var(--s-2) var(--s-3); border-radius: var(--radius-s); background: var(--c-surface-2); color: var(--c-ink); font-size: var(--fs--1); font-weight: 600; }
.finding__foot { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-3); font-size: var(--fs--1); color: var(--c-muted); }
.finding__deadline { color: var(--c-danger); font-weight: 600; }
.finding > .btn { margin-top: var(--s-3); }

/* Answering an item where it is asked. An open question has three real answers — say it,
   upload the paper, or point at one already uploaded — so the row offers all three and puts
   the one this question actually wants first. */
.answer { margin-top: var(--s-3); }
.answer__row { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.answer__form { display: flex; flex-direction: column; gap: var(--s-2); margin-top: var(--s-3); }
.answer__form .btn { align-self: flex-start; }
.answer__text {
  width: 100%; padding: var(--s-2) var(--s-3); font: inherit; font-size: var(--fs--1);
  color: var(--c-ink); background: var(--c-surface); border: 1px solid var(--c-line);
  border-radius: var(--radius-s); resize: vertical;
}
.answer__text:focus, .answer__pick:focus { outline: 2px solid var(--c-brand); outline-offset: 1px; }
.answer__pick {
  padding: var(--s-2) var(--s-3); font: inherit; font-size: var(--fs--1); color: var(--c-ink);
  background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius-s);
}
.answer__reply {
  margin-top: var(--s-3); padding: var(--s-2) var(--s-3); font-size: var(--fs--1);
  border-left: 3px solid var(--c-brand); background: var(--c-surface-2); color: var(--c-ink);
}
.answer__reply--err { border-left-color: var(--c-danger); color: var(--c-danger); }

.docreq--required { border-left-color: var(--c-danger); }
.docreq--valuable { border-left-color: var(--c-accent); }
.docreq--done { opacity: 0.6; }
.docreq__row { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-3); }
.struct__review { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; justify-content: space-between; padding: var(--s-4); margin-bottom: var(--s-4); border: 1px dashed var(--c-line); border-radius: var(--radius-m); }
.struct__review p { flex: 1; min-width: 260px; font-size: var(--fs--1); }

/* Positions — the CPA's view. Longer prose than anything else on the page, because a
   reviewer needs the argument in full, not a summary of it. */
.tabs--five { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 860px) { .tabs--five { grid-template-columns: repeat(2, 1fr); } }
.tabs--six { grid-template-columns: repeat(6, 1fr); }
@media (max-width: 1040px) { .tabs--six { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 720px) { .tabs--six { grid-template-columns: repeat(2, 1fr); } }
.tabs--eight { grid-template-columns: repeat(8, 1fr); }
@media (max-width: 1180px) { .tabs--eight { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 720px) { .tabs--eight { grid-template-columns: repeat(2, 1fr); } }
.tabs--seven { grid-template-columns: repeat(7, 1fr); }
@media (max-width: 1180px) { .tabs--seven { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 720px) { .tabs--seven { grid-template-columns: repeat(2, 1fr); } }

/* What it cost — the expense ledger. Totals by treatment up top, one table per treatment. */
.cost__bar { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-bottom: var(--s-4); }
.cost__pill { border: 1px solid var(--c-border); border-radius: 999px; padding: .3rem .8rem; font-size: .88rem; background: var(--c-surface); }
.cost__pill strong { font-variant-numeric: tabular-nums; }
.cost__pill--deduct { border-color: rgba(15,118,110,.45); }
.cost__pill--unknown { border-color: rgba(180,83,9,.5); background: rgba(180,83,9,.06); }
.cost__group { margin-bottom: var(--s-5); }
.cost__group summary { cursor: pointer; font-weight: 600; padding: var(--s-2) 0; }
.cost__group summary .muted { font-weight: 400; margin-left: .5rem; }
.cost__t { width: 100%; border-collapse: collapse; font-size: .9rem; }
.cost__t th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--c-ink-2); padding: var(--s-1) var(--s-2) var(--s-1) 0; border-bottom: 1px solid var(--c-border); }
.cost__t td { padding: var(--s-2) var(--s-2) var(--s-2) 0; border-bottom: 1px solid var(--c-border); vertical-align: top; }
.cost__d { white-space: nowrap; color: var(--c-ink-2); font-variant-numeric: tabular-nums; }
.cost__a { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cost__why { display: block; font-size: .82rem; color: var(--c-ink-2); margin-top: .15rem; }
.cost__sel { font: inherit; font-size: .86rem; padding: .25rem .4rem; border: 1px solid var(--c-border); border-radius: var(--radius-s); background: var(--c-surface); max-width: 100%; }
.cost__row--low .cost__a { color: #92400e; }
.cost__conf { font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: #92400e; margin-left: .35rem; }
.cost__scroll { overflow-x: auto; }
/* A grid child defaults to min-width:auto, so a wide table inside it widens the whole page
   instead of scrolling inside its box. The overflow lives on the scroll wrapper; the column
   has to be allowed to shrink for that to mean anything. */
.struct__view, .struct__chat, .pane, .cost__group, .task { min-width: 0; }
.cost__group { display: block; }
.ws__cap { font-size: .9rem; }

/* What GuudTax owes the taxpayer. Deliberately shaped like the document requests beside it —
   the two are the same kind of thing pointing in opposite directions. */
.task { border: 1px solid var(--c-border); border-radius: var(--radius-m); padding: var(--s-4); margin-bottom: var(--s-3); background: var(--c-surface); }
.task--blocked { background: var(--c-surface-2); }
.task--done { opacity: .72; }
.task__head { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; margin-bottom: var(--s-2); }
.task__tag { font-size: .74rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: .18rem .5rem; border-radius: 999px; background: var(--c-surface-2); color: var(--c-ink-2); }
.task--ready .task__tag { background: rgba(16,132,90,.12); color: #0b6b48; }
.task--blocked .task__tag { background: rgba(180,83,9,.12); color: #92400e; }
.task--done .task__tag { background: rgba(37,99,235,.12); color: #1d4ed8; }
.task__title { font-size: 1.02rem; margin: 0 0 var(--s-2); }
.task__why { color: var(--c-ink-2); margin: 0 0 var(--s-3); }
.task__blocked { border-left: 3px solid rgba(180,83,9,.5); padding-left: var(--s-3); color: var(--c-ink-2); margin: 0 0 var(--s-3); }
.task__result { color: var(--c-ink-2); font-size: .92rem; margin: var(--s-2) 0 0; }
.task__err { color: #b91c1c; font-size: .92rem; margin: var(--s-2) 0 0; }
.task__row { display: flex; gap: var(--s-2); flex-wrap: wrap; }
.position { padding: var(--s-5); border: 1px solid var(--c-line); border-left: 4px solid var(--c-brand); border-radius: var(--radius-m); background: var(--c-surface); margin-bottom: var(--s-4); }
.position--settled { border-left-color: var(--c-brand-strong); background: var(--c-surface-2); }
.position--accepted_risk { border-left-color: var(--c-accent); }
.position__head { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: baseline; margin-bottom: var(--s-2); }
.position__status { font-size: var(--fs--1); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--c-brand-strong); }
.position__meta { font-size: var(--fs--1); color: var(--c-muted); }
.position__topic { font-size: var(--fs-1); margin-bottom: var(--s-3); }
.position__label { font-size: var(--fs--1); font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--c-muted); margin-top: var(--s-3); }
.position__body { color: var(--c-ink-2); margin-top: var(--s-1); }
.position__auth { margin-top: var(--s-3); font-size: var(--fs--1); color: var(--c-muted); font-style: italic; }
.position__row { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-4); padding-top: var(--s-3); border-top: 1px solid var(--c-line); }
.detail__sched { margin-top: var(--s-2); padding-left: var(--s-4); display: grid; gap: 2px; }
.detail__sched li { font-size: var(--fs--1); color: var(--c-muted); font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------- cost segregation
   The headline number and the three reasons it might be worth less sit in the
   same block, deliberately: someone who reads only the big figure has still
   read the passive-activity question and the recapture. */
.cs-card + .cs-card { margin-top: var(--s-5); }
.cs-list { display: grid; gap: var(--s-3); margin-top: var(--s-4); grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.cs-prop { border: 1px solid var(--c-line); border-radius: var(--radius-s); padding: var(--s-4); display: flex; flex-direction: column; gap: var(--s-2); }
.cs-prop--on { border-color: var(--c-brand); box-shadow: 0 0 0 2px var(--c-brand-soft); }
.cs-prop__name { font-size: var(--fs-0); margin: 0; }
.cs-prop__meta { font-size: var(--fs--1); margin: 0; }
.cs-prop__note { font-size: var(--fs--1); margin: 0; color: var(--c-ink-2); }
.cs-prop__win { font-size: var(--fs--1); font-weight: 700; color: var(--c-brand); margin: 0; font-variant-numeric: tabular-nums; }
.cs-prop .btn { margin-top: auto; align-self: flex-start; }

.cs-headline { border: 1px solid var(--c-line); border-radius: var(--radius-m); padding: var(--s-5); margin: var(--s-4) 0; background: var(--c-brand-soft); }
.cs-headline__label { margin: 0; font-size: var(--fs--1); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--c-ink-2); }
.cs-headline__amount { margin: var(--s-1) 0 0; font-size: var(--fs-3); font-weight: 800; font-variant-numeric: tabular-nums; }
.cs-headline__note { margin: var(--s-2) 0 0; color: var(--c-ink-2); }
.cs-headline__badge { margin: var(--s-3) 0 0; padding: var(--s-2) var(--s-3); border-radius: var(--radius-s); background: var(--c-surface); font-weight: 600; font-size: var(--fs--1); }
.cs-headline__small { margin: var(--s-3) 0 0; font-size: var(--fs--1); }

.cs-checks { display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin-bottom: var(--s-4); }
.cs-check { border: 1px solid var(--c-line); border-left-width: 4px; border-radius: var(--radius-s); padding: var(--s-3) var(--s-4); }
.cs-check h4 { margin: 0 0 var(--s-2); font-size: var(--fs--1); }
.cs-check p { margin: 0 0 var(--s-2); font-size: var(--fs--1); color: var(--c-ink-2); }
.cs-check p:last-child { margin-bottom: 0; }
.cs-check__q { font-weight: 600; color: var(--c-ink) !important; }
.cs-check__auth { font-style: italic; }
.cs-check--ok { border-left-color: var(--c-brand); }
.cs-check--warn { border-left-color: var(--c-warn, #b8860b); }
.cs-check--info { border-left-color: var(--c-line); }
.cs-warnings { border: 1px solid var(--c-line); border-radius: var(--radius-s); padding: var(--s-4); margin-bottom: var(--s-4); }
.cs-warnings h4 { margin: 0 0 var(--s-2); font-size: var(--fs--1); }
.cs-warnings p { margin: 0 0 var(--s-2); font-size: var(--fs--1); color: var(--c-ink-2); }
.cs-warnings p:last-child { margin-bottom: 0; }
.cs-blocked { padding: var(--s-4); border: 1px dashed var(--c-line); border-radius: var(--radius-s); color: var(--c-ink-2); }

.cs-form { margin-top: var(--s-4); }
.cs-grid { display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin-top: var(--s-3); }
.cs-hint { font-size: var(--fs--1); margin: var(--s-3) 0; }
.cs-row { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-3); }
.cs-row--end { justify-content: flex-end; margin-top: var(--s-5); padding-top: var(--s-3); border-top: 1px solid var(--c-line); }

.cs-basis { display: grid; grid-template-columns: 1fr auto; gap: var(--s-1) var(--s-4); margin: var(--s-3) 0; max-width: 34rem; }
.cs-basis dt { color: var(--c-ink-2); font-size: var(--fs--1); }
.cs-basis dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; font-size: var(--fs--1); }
.cs-basis__total { font-weight: 700; border-top: 1px solid var(--c-line); padding-top: var(--s-1); }
.cs-basis dt:last-of-type { font-weight: 700; border-top: 1px solid var(--c-line); padding-top: var(--s-1); }
.cs-basis__warn { color: var(--c-danger); }

/* Long schedules scroll inside their own box rather than pushing the page sideways.
   The overflow goes on a WRAPPER, never on the table: `display:block` on a table drops it out
   of table layout, so `width:100%` stops meaning anything and the whole thing collapses to the
   width of its text. */
.cs-scroll { overflow-x: auto; max-width: 100%; }
.cs-scroll--tall { max-height: 26rem; overflow-y: auto; }
.cs-table { width: 100%; border-collapse: collapse; margin: var(--s-3) 0; font-size: var(--fs--1); }
.cs-table th, .cs-table td { text-align: left; padding: var(--s-2) var(--s-3); border-bottom: 1px solid var(--c-line); white-space: nowrap; }
.cs-table th { font-size: var(--fs--1); color: var(--c-muted); font-weight: 600; }
.cs-table .cs-num { text-align: right; font-variant-numeric: tabular-nums; }
.cs-table__range { display: block; font-size: var(--fs--1); }
.cs-row--now td { font-weight: 700; background: var(--c-brand-soft); }

.cs-comp { display: grid; gap: var(--s-2); grid-template-columns: minmax(150px, 1fr) minmax(150px, 2fr) minmax(90px, 1fr) minmax(120px, 1fr) auto; align-items: center; margin-top: var(--s-2); }
@media (max-width: 700px) { .cs-comp { grid-template-columns: 1fr; } }
.finding__tool { margin-top: var(--s-3); }

/* "What we work out" tiers: open cards, one-line conclusions, folded handled items. */
.tier { margin-bottom: var(--s-6); }
.tier__head, .tier__summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s-2) var(--s-3); margin-bottom: var(--s-3); }
.tier__summary { cursor: pointer; list-style: none; padding: var(--s-3) 0; border-top: 1px solid var(--c-line); }
.tier__summary::-webkit-details-marker { display: none; }
.tier__summary::before { content: '\25B8'; color: var(--c-muted); font-size: var(--fs--1); }
.tier--done[open] > .tier__summary::before { content: '\25BE'; }
.tier__title { font-size: var(--fs-1); font-weight: 700; margin: 0; }
.tier__n { font-size: var(--fs--1); font-weight: 700; padding: 1px var(--s-2); border-radius: 999px; background: var(--c-surface-2); color: var(--c-ink-2); }
.tier__hint { flex-basis: 100%; color: var(--c-muted); font-size: var(--fs--1); }
.finding--compact { padding: 0; margin-bottom: var(--s-2); }
.finding--compact > .finding__line { display: flex; gap: var(--s-3); align-items: baseline; padding: var(--s-3) var(--s-4); cursor: pointer; list-style: none; }
.finding--compact > .finding__line::-webkit-details-marker { display: none; }
.finding--compact > .finding__line .finding__statement { margin: 0; font-weight: 600; font-size: var(--fs--1); flex: 1; }
.finding--compact > .finding__line .finding__tag:empty { display: none; }
.finding--compact > .finding__body { padding: 0 var(--s-4) var(--s-4); }
.finding--compact.finding--medium > .finding__line .finding__tag,
.finding--compact.finding--high > .finding__line .finding__tag { color: var(--c-brand-strong); }
.finding--done.finding--compact { opacity: 0.7; }


/* A draft return shown as the form it is. Read as a worksheet, not a report: the line number
   leads, the provenance sits under the label, and an empty line says so rather than showing a
   zero somebody could mistake for a computed answer. */
.ws { margin-top: var(--s-4); border-top: 1px solid var(--c-border); padding-top: var(--s-3); }
.ws__h { font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; color: var(--c-ink-2); margin: var(--s-4) 0 var(--s-2); }
.ws__h:first-child { margin-top: 0; }
.ws__scroll { overflow-x: auto; }
.ws__t { width: 100%; border-collapse: collapse; font-size: .93rem; }
.ws__r { border-bottom: 1px solid var(--c-border); }
.ws__r--missing, .ws__r--empty { color: var(--c-ink-2); }
.ws__r--blocked .ws__v { color: #92400e; font-weight: 600; }
.ws__n { padding: var(--s-2) var(--s-3) var(--s-2) 0; white-space: nowrap; color: var(--c-ink-2); font-variant-numeric: tabular-nums; vertical-align: top; }
.ws__l { padding: var(--s-2) var(--s-3) var(--s-2) 0; }
.ws__l span { display: block; }
.ws__why { font-size: .84rem; color: var(--c-ink-2); margin-top: .15rem; }
.ws__v { padding: var(--s-2) 0; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; vertical-align: top; }
.ws__note { border-left: 3px solid var(--c-border); padding-left: var(--s-3); margin-bottom: var(--s-3); }
.ws__note--warn { border-left-color: rgba(180,83,9,.5); }
.ws__note strong { display: block; }
.ws__note span { display: block; color: var(--c-ink-2); font-size: .9rem; margin-top: .15rem; }
.ws__unblocks { font-style: italic; }
.ws__note .ws__pill { display: inline-block; margin: 0 0 0 .35rem; padding: .05rem .55rem; border: 1px solid var(--c-border); border-radius: 999px; font-size: .78rem; font-weight: 600; color: var(--c-ink-2); vertical-align: middle; }
.ws__note .ws__pill--final { border-color: rgba(15,118,110,.45); color: #0f766e; }
.ws__note .ws__pill--amended { border-color: rgba(180,83,9,.5); color: #92400e; background: rgba(180,83,9,.06); }
.ws__note .ws__pill--draft { border-style: dashed; }
.ws__issued-row .task__row { margin-top: var(--s-2); }

/* Admin gate (assets/admin-auth.js). The document stays blank until the backend has confirmed
   an admin session, so an unauthenticated visitor never sees the back office for a frame. */
html[data-admin-gate="checking"] body { visibility: hidden; }
html[data-admin-gate="error"] body > :not(.admin-gate-error) { display: none; }
.admin-gate-error { display: block; max-width: 32rem; margin: 4rem auto; padding: var(--s-3); display: grid; gap: var(--s-4); }
.admin-gate-error p { padding-left: var(--s-3); border-left: 3px solid rgba(180,83,9,.5); color: var(--c-ink-2); }

/* Legal pages (terms.html, privacy.html) — long prose in the marketing header/footer frame. */
.legal__inner { max-width: 760px; }
.legal__meta { margin-top: var(--s-3); }
.legal__toc { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-4); margin: var(--s-5) 0 var(--s-6); padding: var(--s-4); border: 1px solid var(--c-line); border-radius: var(--radius-m); font-size: var(--fs--1); }
.legal__toc a { color: var(--c-ink-2); text-decoration: none; }
.legal__toc a:hover { color: var(--c-brand); text-decoration: underline; }
.legal section { margin-top: var(--s-6); scroll-margin-top: calc(var(--header-h) + var(--s-4)); }
.legal section h2 { font-size: var(--fs-2); margin-bottom: var(--s-3); }
.legal section p, .legal section li { line-height: 1.65; color: var(--c-ink-2); }
.legal section p + p, .legal section ul { margin-top: var(--s-3); }
.legal section ul { padding-left: 1.25rem; list-style: disc; }
.legal section li + li { margin-top: var(--s-2); }
.legal section a { color: var(--c-brand); }

/* Powered-by badge (audit 0925 S1.4d) */
.footer__badge { display: inline-flex; align-items: center; gap: 0.35em; padding: 0.3em 0.75em; border: 1px solid var(--c-line); border-radius: 999px; font-size: var(--fs--1); color: var(--c-muted); text-decoration: none; white-space: nowrap; }
.footer__badge strong { color: var(--c-ink-2); font-weight: 600; }
.footer__badge:hover { color: var(--c-brand); border-color: var(--c-brand); text-decoration: none; }
.footer__badge:hover strong { color: var(--c-brand); }

/* Billing page (billing.html): totals, payments table and the inline refund-request form. */
.billing-totals__num { font-size: var(--fs-2); font-weight: 700; margin-top: var(--s-2); font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }
.billing-table th[scope="row"] .badge { margin-top: var(--s-2); }
.billing-refund { min-width: 200px; }
.billing-refund .badge { margin-bottom: var(--s-2); }
.billing-refund .btn { margin-top: var(--s-2); }
.billing-refund__meta { font-size: var(--fs--1); margin: var(--s-1) 0; }
.billing-refund-form { display: grid; gap: var(--s-3); margin-top: var(--s-3); padding: var(--s-3); border: 1px solid var(--c-line); border-radius: var(--radius-s); background: var(--c-surface); min-width: 260px; }
.billing-refund-form textarea.input { min-height: 84px; resize: vertical; }
.billing-receipt a, .billing-receipt .billing-invoice-link { display: block; }
.billing-receipt > * + * { margin-top: var(--s-1); }
/* Accessibility pass on billing.html (P8). The Invoice opener is a <button>
   styled as a link; badges carry billing-only colours, each >= 4.5:1 on its
   own fill (ok 7.8, wait 7.1, bad 5.7, info 8.2, neutral 7.4); every billing
   control gets the same 3px focus ring as app.html, and the refund textarea
   gets it back over .input's faint halo. */
.billing-invoice-link { padding: 0; border: 0; background: none; font: inherit; color: var(--c-brand); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; text-align: left; }
.billing-invoice-link:hover { color: var(--c-brand-strong); }
.billing-invoice-link[aria-busy="true"] { cursor: progress; color: var(--c-ink-2); }
.badge--bill { text-transform: none; }
.badge--bill-ok { background: #dff2e6; color: #14532f; }
.badge--bill-wait { background: #fff4d6; color: #6b4d00; }
.badge--bill-bad { background: #fdecec; color: var(--c-danger); }
.badge--bill-info { background: #e4eefc; color: #17457f; }
.badge--bill-neutral { background: var(--c-surface-2); color: var(--c-ink-2); }
.billing-table .btn:focus-visible,
.billing-invoice-link:focus-visible,
.billing-refund-form .btn:focus-visible,
.billing-refund-form textarea.input:focus-visible,
.invoice-card__actions .btn:focus-visible,
#membership-manage:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 2px; border-radius: var(--radius-s); }
.invoice-card:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 4px; }
.invoice-card:focus { outline: none; }
.invoice-card__head { margin-bottom: var(--s-4); }
.invoice-parties { margin-bottom: var(--s-4); }
.invoice-parties p { margin-top: var(--s-1); }
.invoice-meta { margin-bottom: var(--s-4); }
.invoice-lines tfoot th, .invoice-lines tfoot td { font-weight: 500; }
.invoice-lines__total th, .invoice-lines__total td { font-weight: 700; border-top: 2px solid var(--c-ink); }
.invoice-card__note { margin-top: var(--s-4); font-size: var(--fs--1); }
@media print {
  html.print-invoice body { padding-left: 0 !important; background: #fff; }
  html.print-invoice .header, html.print-invoice .footer, html.print-invoice .dash-side,
  html.print-invoice .skip-link, html.print-invoice #main .container > :not(#invoice-card),
  html.print-invoice .invoice-card__actions { display: none !important; }
  html.print-invoice #main { padding: 0; }
  html.print-invoice .invoice-card { margin: 0 !important; border: 0; box-shadow: none; padding: 0; }
  html.print-invoice .invoice-parties { display: grid; grid-template-columns: 1fr 1fr; }
}

/* Landing-page lead form (index.html) */
.lead-form { display: grid; gap: var(--s-4); max-width: 720px; margin: 0 auto; }
.lead-form .field__error { font-size: var(--fs--1); color: var(--c-danger); }
.lead-form .field.is-invalid .input { border-color: var(--c-danger); }
.lead-form .field.is-invalid .input:focus { box-shadow: 0 0 0 3px #f2b8bc; }
.lead-done { max-width: 720px; margin: 0 auto; text-align: center; }

/* Client-side search + category/entity filter above long ledgers and lists (return.html). */
.list-filter { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; margin: var(--s-3) 0; }
.list-filter .input { width: auto; flex: 1 1 10rem; max-width: 16rem; }
.list-filter[hidden], .list-filter .input[hidden] { display: none; }
.list-filter__count { margin: 0; font-size: var(--fs--1, 0.875rem); }

/* "Help with this step" (return.html step panels): collapsed plain-English Q&As
   plus a pre-filled contact link. Native <details>, so it works without JS. */
.step-help { margin-top: var(--s-4); border: 1px solid var(--c-line); border-radius: var(--radius-m); background: var(--c-surface); }
.step-help__summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); padding: var(--s-3) var(--s-4); font-weight: 600; font-size: var(--fs--1); color: var(--c-brand); }
.step-help__summary::-webkit-details-marker { display: none; }
.step-help__summary::after { content: "+"; font-size: var(--fs-1); line-height: 1; transition: transform var(--ease); }
.step-help[open] > .step-help__summary::after { transform: rotate(45deg); }
.step-help__summary:focus-visible { outline: 2px solid var(--c-brand); outline-offset: 2px; border-radius: var(--radius-m); }
.step-help__body { padding: 0 var(--s-4) var(--s-4); display: grid; gap: var(--s-3); }
.step-help__q { font-size: var(--fs--1); font-weight: 600; margin: 0 0 var(--s-1); }
.step-help__qa p, .step-help__stuck { margin: 0; font-size: var(--fs--1); color: var(--c-ink-2); }
.step-help__stuck { padding-top: var(--s-3); border-top: 1px solid var(--c-line); }

/* --- Signed-in dashboard shell (html.dash, see initDashNav in app.js) ---- */
:root { --dash-side-w: 248px; }
.dash-side { display: none; }
@media (min-width: 861px) {
  html.dash .header { display: none; }
  html.dash body { padding-left: var(--dash-side-w); }
  html.dash .dash-side {
    display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; z-index: 60;
    width: var(--dash-side-w); background: var(--c-surface); border-right: 1px solid var(--c-line);
    padding: var(--s-4) var(--s-3); overflow-y: auto;
  }
}
.dash-side__brand { display: block; padding: var(--s-1) var(--s-3) var(--s-4); }
.dash-side__brand img { height: 44px; width: auto; display: block; }
.dash-nav { display: flex; flex-direction: column; gap: var(--s-4); flex: 1 1 auto; }
.dash-nav__group { display: flex; flex-direction: column; gap: 2px; }
.dash-nav__title { margin: 0 0 var(--s-1); padding: 0 var(--s-3); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--c-muted); }
.dash-nav__link {
  display: flex; align-items: center; gap: var(--s-3); padding: 9px var(--s-3); border-radius: var(--radius-s);
  color: var(--c-ink-2); text-decoration: none; font-weight: 500; font-size: 0.95rem;
  transition: background var(--ease), color var(--ease);
}
.dash-nav__link:hover { background: var(--c-surface-2); color: var(--c-ink); }
.dash-nav__link[aria-current="page"] { background: var(--c-brand-soft); color: var(--c-brand-strong); font-weight: 600; }
.dash-nav__icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dash-side__user { display: flex; flex-direction: column; gap: 2px; margin-top: var(--s-5); padding: var(--s-4) var(--s-3) 0; border-top: 1px solid var(--c-line); font-size: var(--fs--1); min-width: 0; }
.dash-side__user strong { color: var(--c-ink); font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-side__user span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Account menu (accountMenu in app.js). The list opens in the sidebar's flow,
   under the button, so it never clips off the bottom of the viewport. */
.acct-menu { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.acct-menu__button { display: flex; align-items: center; gap: var(--s-2); width: 100%; min-height: 44px; padding: var(--s-2); border: 1px solid transparent; border-radius: var(--radius-s); background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.acct-menu__button:hover, .acct-menu__button[aria-expanded="true"] { background: var(--c-surface-2); border-color: var(--c-line); }
.acct-menu__who { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-width: 0; }
.acct-menu__button .dash-nav__icon { width: 16px; height: 16px; transition: transform var(--ease); }
.acct-menu__button[aria-expanded="true"] .dash-nav__icon { transform: rotate(180deg); }
.acct-menu__list { display: flex; flex-direction: column; gap: 2px; padding: var(--s-1) 0; }
.acct-menu__list[hidden] { display: none; }
.acct-menu__item { display: block; width: 100%; padding: 8px var(--s-3); border: 0; border-radius: var(--radius-s); background: none; color: var(--c-ink-2); font: inherit; font-size: 0.9rem; text-align: left; text-decoration: none; cursor: pointer; }
.acct-menu__item:hover, .acct-menu__item:focus { background: var(--c-surface-2); color: var(--c-ink); }
.acct-menu__item--out { color: var(--c-danger); }
/* Keyboard focus on app.html (P8b): the account menu, the tax-year select and
   the CPA queue decisions always show the same 3px ring. .input swaps the
   outline for a faint halo, so the select gets the ring back explicitly. */
.acct-menu__button:focus-visible,
.acct-menu__item:focus-visible,
#tax-year:focus-visible,
#cpa-queue .btn:focus-visible,
#cpa-queue-refresh:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 2px; }
.acct-menu__item:focus-visible { outline-offset: -3px; }
/* Keyboard focus on app.html (P8c): every text field, select and choice in the
   account panel, household and companies forms, and the sidebar and header
   toggles carry the same ring on keyboard focus (on top of the input halo). */
.page-app .input:focus-visible,
.page-app .choice input:focus-visible,
.page-app .check input:focus-visible,
.page-app input[type="checkbox"]:focus-visible,
.page-app .dash-nav__link:focus-visible,
.page-app .dash-nav__sublink:focus-visible,
.page-app .dash-nav__more:focus-visible,
.page-app .nav-toggle:focus-visible,
.page-app .btn:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 2px; }
.page-app .dash-nav__sublink:focus-visible { outline-offset: -3px; }
.dash-nav__row { display: flex; align-items: center; gap: 2px; }
.dash-nav__row .dash-nav__link { flex: 1 1 auto; min-width: 0; }
.dash-nav__more { flex: none; width: 30px; height: 30px; padding: 0; border: 0; border-radius: var(--radius-s); background: none; color: var(--c-muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.dash-nav__more:hover { background: var(--c-surface-2); color: var(--c-ink); }
.dash-nav__more svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform var(--ease); }
.dash-nav__more[aria-expanded="true"] svg { transform: rotate(90deg); }
.dash-nav__sub { display: flex; flex-direction: column; gap: 1px; margin: 2px 0 var(--s-1) 21px; padding-left: var(--s-3); border-left: 1px solid var(--c-line); }
.dash-nav__sub[hidden] { display: none; }
.dash-nav__sublink { display: block; padding: 5px var(--s-3); border-radius: var(--radius-s); color: var(--c-muted); text-decoration: none; font-size: 0.86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-nav__sublink:hover { background: var(--c-surface-2); color: var(--c-ink); }
.dash-nav__sublink[aria-current="location"] { color: var(--c-brand-strong); font-weight: 600; }
.list-more { display: flex; justify-content: center; margin-top: var(--s-3); }
.list-more[hidden] { display: none; }

/* Sign-in form on auth.html (P8 1a): inline field errors, and every input,
   button and link carries the same 3px keyboard focus ring as app.html —
   .input:focus swaps the outline for a faint halo, so it is put back here. */
#login-form .field__error { font-size: var(--fs--1); color: var(--c-danger); }
#login-form .field.is-invalid .input { border-color: var(--c-danger); }
#login-form .field.is-invalid .input:focus { box-shadow: 0 0 0 3px #f2b8bc; }
#login-form .input:focus-visible,
#login-form .btn:focus-visible,
#login-form a:focus-visible,
.auth .tab:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 2px; }

/* Sign-up form on auth.html, standard and CPA variants (P8 1b): the same inline
   errors and 3px focus ring as the sign-in form above, including the role
   choices and the CPA profile's checkboxes and buttons. */
#signup-form .field__error { font-size: var(--fs--1); color: var(--c-danger); }
#signup-form .field.is-invalid .input { border-color: var(--c-danger); }
#signup-form .field.is-invalid .input:focus { box-shadow: 0 0 0 3px #f2b8bc; }
#signup-form .input:focus-visible,
#signup-form input[type="radio"]:focus-visible,
#signup-form input[type="checkbox"]:focus-visible,
#signup-form .btn:focus-visible,
#signup-form a:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 2px; }

/* Forgot-password form on auth.html (P8 1c): the same inline error and 3px
   focus ring as the sign-in and sign-up forms above. */
#forgot-form .field__error { font-size: var(--fs--1); color: var(--c-danger); }
#forgot-form .field.is-invalid .input { border-color: var(--c-danger); }
#forgot-form .field.is-invalid .input:focus { box-shadow: 0 0 0 3px #f2b8bc; }
#forgot-form .input:focus-visible,
#forgot-form .btn:focus-visible,
#forgot-form a:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 2px; }

/* Contact form on contact.html (P8a): inline field errors and the same 3px focus
   ring as auth.html. .input:focus drops the outline, so it is restored here for
   keyboard focus. Text tokens on this page already clear 4.5:1 (muted 5.61:1 on
   bg, 6.00:1 on surface; danger 5.71:1 on the error alert). */
#contact-form .field__error { font-size: var(--fs--1); color: var(--c-danger); }
#contact-form .field.is-invalid .input { border-color: var(--c-danger); }
#contact-form .field.is-invalid .input:focus { box-shadow: 0 0 0 3px #f2b8bc; }
#contact-form .input:focus-visible,
#contact-form .btn:focus-visible,
#contact-done .btn:focus-visible,
#contact-done:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 2px; }

/* Lead form on index.html (P8b): same 3px keyboard focus ring as contact.html and
   auth.html (.input:focus drops the outline, so it is restored for keyboard focus).
   Text on this section already clears 4.5:1 (muted 5.61:1 and danger 6.11:1 on bg,
   danger 5.71:1 on the error alert, brand link 6.10:1); the ring is 3.79:1 (>= 3:1). */
#lead-form .input:focus-visible,
#lead-form .btn:focus-visible,
#lead-done a:focus-visible,
#lead-done:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 2px; }

/* structure.html (P8a): every control on the interview, findings, uploads, cost and
   tasks sections carries the same 3px keyboard ring as the rest of the site, including
   the tab bar, the org-chart boxes and the "What this means" / "Handled" summaries.
   The ring is 4.05:1 on white and 3.60:1 on surface-2 (>= 3:1). */
.struct .btn:focus-visible,
.struct .tab:focus-visible,
.struct .orgnode:focus-visible,
.struct .tier__summary:focus-visible,
.struct .finding__line:focus-visible,
.struct .answer__text:focus-visible,
.struct .answer__pick:focus-visible,
.struct .cost__sel:focus-visible,
.struct .chat__form textarea:focus-visible,
.struct .chat__log:focus-visible,
.struct .chat-fab:focus-visible,
.struct a:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 2px; }
/* A section only takes focus when a re-render removed the control that had it. */
.struct .pane[tabindex="-1"]:focus { outline: none; }
/* Done findings, requests and tasks were dimmed with opacity, which took muted text to
   2.2-3.3:1. They recede on a surface-2 background instead, where muted text is 5.33:1,
   ink-2 7.42:1 and the "Done" task tag 5.09:1. Placeholders use muted (6.00:1 on white)
   rather than the browser grey. */
.struct .finding--done,
.struct .finding--done.finding--compact,
.struct .docreq--done,
.struct .task--done { opacity: 1; background: var(--c-surface-2); }
.struct .answer__text::placeholder,
.struct .chat__form textarea::placeholder { color: var(--c-muted); opacity: 1; }

/* costseg.html (P8b): the study form, the component-cost rows and the two scrollable
   tables take the same 3px keyboard ring as structure.html (buttons and links are already
   covered by the .struct rules above). The ring is 4.05:1 on white (>= 3:1). Text on this
   page already clears 4.5:1: muted 6.00:1 on white and 4.97:1 on brand-soft, ink-2 6.93:1
   on the headline, brand 6.52:1 and danger 6.53:1 on white. */
#cs-app .input:focus-visible,
#cs-app .cs-scroll:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 2px; }
/* The section headings only take focus when the control that had it was redrawn away. */
#cs-app .struct__h[tabindex="-1"]:focus { outline: none; }

/* help.html — searchable help articles, one section per return.html step. */
.help-search { margin-top: var(--s-5); }
.help-search .input { min-height: 44px; }
.help-step__hint { font-size: var(--fs--1); font-weight: 500; color: var(--c-muted); margin-left: var(--s-2); }
.legal .help-list { list-style: none; padding-left: 0; display: grid; gap: var(--s-3); }
.legal .help-list li + li { margin-top: 0; }
.help-article { padding: var(--s-4); }
.help-article__q { font-size: var(--fs-0); font-weight: 600; margin: 0 0 var(--s-2); }
.legal section .help-article p + p, .legal section .help-article ul + p { margin-top: var(--s-2); }
.help-article__links { font-size: var(--fs--1); }
.help-empty { margin-top: var(--s-6); }

/* "Plan next year" card on structure.html (#phase10 P10): POST /api/structure/plan. */
.plan-next { display: grid; gap: var(--s-4); margin-top: var(--s-6); }
.plan-next[hidden] { display: none; }
.plan-next__form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--s-4); }
.plan-next__form .field { min-width: 180px; }
.plan-next__stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--s-3); }
.plan-next__stats > div { display: grid; gap: var(--s-1); padding: var(--s-3) var(--s-4); border: 1px solid var(--c-line); border-radius: var(--radius-s); }
.plan-next__stats span { font-size: var(--fs--1); }
.plan-next__stats strong { font-size: var(--fs-2); font-weight: 700; font-variant-numeric: tabular-nums; }
.plan-next__stats .is-good { border-color: #b9dcc9; background: var(--c-brand-soft); }
.plan-next__stats .is-good strong { color: var(--c-brand-strong); }
.plan-next__stats .is-bad { border-color: #f2b8bc; background: #fdecec; }
.plan-next__stats .is-bad strong { color: var(--c-danger); }
.plan-next__table tr.is-total th, .plan-next__table tr.is-total td { font-weight: 700; }
.plan-next__h { font-size: var(--fs-0); margin: 0; }
.plan-next__why { display: grid; gap: var(--s-2); padding-left: 1.2em; list-style: disc; color: var(--c-ink-2); font-size: var(--fs--1); }
.plan-next__note { font-size: var(--fs--1); }
.plan-next .alert a { margin-left: var(--s-1); }

/* #audit 1130 S2.6: forms-ready email ask inside the Forms step's not-fileable note. */
.forms-ready { margin-top: 0.6rem; display: flex; flex-direction: column; align-items: flex-start; gap: 0.5rem; }
.forms-ready__btn { max-width: 100%; white-space: normal; text-align: left; }
.forms-ready__done { margin: 0; }
