/* A calm intake form: cool paper, one deep teal accent, one question group at a time.
   The result uses four fixed status colours. One column, so it reads the same on a phone. */
/* Fonts are served from this site, not a third party. Latin subsets; SIL Open Font License 1.1 (fonts/OFL-*.txt). */
@font-face { font-family: "Newsreader"; font-style: normal; font-weight: 500 600; font-display: swap;
  src: url("../fonts/newsreader-latin.woff2") format("woff2"); }
@font-face { font-family: "Public Sans"; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url("../fonts/public-sans-latin.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../fonts/ibm-plex-mono-400-latin.woff2") format("woff2"); }

:root {
  --paper: #f5f7f8; --surface: #ffffff; --ink: #18222c; --muted: #5b6875; --line: #d8dee4;
  --accent: #1d5f74; --accent-soft: #e3eff3; --on-accent: #ffffff;
  --must: #9c2f24; --must-bg: #fbe9e6;
  --may: #8a5a00; --may-bg: #fbf1dd;
  --ok: #1f6b45; --ok-bg: #e4f3ea;
  --ask: #4b3f8f; --ask-bg: #ecebf8;
  --font-display: "Newsreader", Georgia, "Times New Roman", serif;
  --font-body: "Public Sans", "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono: "IBM Plex Mono", Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #10161b; --surface: #172028; --ink: #e5eaee; --muted: #9eabb7; --line: #2b3741;
    --accent: #7cc3d8; --accent-soft: #1b3440; --on-accent: #0c1418;
    --must: #f0a297; --must-bg: #3a1c18; --may: #f0be6a; --may-bg: #2f2512;
    --ok: #8fd3ab; --ok-bg: #16301f; --ask: #b9b0f2; --ask-bg: #25213f;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #10161b; --surface: #172028; --ink: #e5eaee; --muted: #9eabb7; --line: #2b3741;
  --accent: #7cc3d8; --accent-soft: #1b3440; --on-accent: #0c1418;
  --must: #f0a297; --must-bg: #3a1c18; --may: #f0be6a; --may-bg: #2f2512;
  --ok: #8fd3ab; --ok-bg: #16301f; --ask: #b9b0f2; --ask-bg: #25213f;
  color-scheme: dark;
}
* { box-sizing: border-box; }
/* A hidden tab panel stays hidden even when a display rule applies to it. */
[hidden] { display: none !important; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.55 var(--font-body); }
.wrap { max-width: 780px; margin: 0 auto; padding: 24px 16px 64px; display: grid; gap: 22px; }
h1, h2, h3 { font-family: var(--font-display); margin: 0; text-wrap: balance; font-weight: 600; }
h1 { font-size: clamp(30px, 6vw, 42px); line-height: 1.08; }
h2 { font-size: 24px; line-height: 1.2; }
h3 { font-size: 18px; }
p { margin: 0; }
a { color: var(--accent); }
.top { display: grid; gap: 10px; }
.top-row { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.lede { font-size: 18px; }
.note, .hint { color: var(--muted); font-size: 14px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

button { font: inherit; cursor: pointer; }
.btn { border-radius: 8px; border: 1px solid var(--accent); background: var(--accent); color: var(--on-accent); padding: 10px 18px; font-weight: 600; }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.small { padding: 5px 12px; font-size: 14px; font-weight: 500; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.theme { border: 1px solid var(--line); background: var(--surface); color: var(--muted); border-radius: 999px; padding: 4px 12px; font-size: 13px; white-space: nowrap; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { border: 0; background: none; color: var(--muted); padding: 8px 12px; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px; display: grid; gap: 14px; }
.progress { display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: 13px; }
.progress .bar { flex: 1; height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; }
.progress .bar i { display: block; height: 100%; background: var(--accent); }

.q { display: grid; gap: 8px; border: 0; padding: 0; margin: 0; min-width: 0; }
.q + .q { padding-top: 14px; border-top: 1px solid var(--line); }
.q legend, .q > label.lab { font-weight: 600; padding: 0; }
.q .hint { margin-top: -4px; }
.opts { display: grid; gap: 6px; }
.opts.two { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.opt { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; cursor: pointer; background: var(--paper); }
.opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.opt input { margin: 4px 0 0; accent-color: var(--accent); flex: none; }
.opt small { display: block; color: var(--muted); font-size: 13px; line-height: 1.4; }
select, input[type="number"], input[type="text"] { font: inherit; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; width: 100%; max-width: 340px; }
.money { display: flex; align-items: center; gap: 8px; }
.money span { color: var(--muted); white-space: nowrap; }
.nav { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { font-size: 13px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); padding: 4px 11px; text-align: left; }
.chips button:hover { border-color: var(--accent); color: var(--accent); }

/* Result */
#panel-check.result { display: grid; gap: 16px; }
.verdict { border-radius: 12px; padding: 18px; display: grid; gap: 8px; border: 1px solid; }
.verdict .tag { font: 600 12px var(--font-body); letter-spacing: .08em; text-transform: uppercase; }
.verdict h2 { font-size: clamp(24px, 5vw, 30px); }
.verdict.mandatory { background: var(--must-bg); border-color: var(--must); } .verdict.mandatory .tag { color: var(--must); }
.verdict.voluntary { background: var(--may-bg); border-color: var(--may); } .verdict.voluntary .tag { color: var(--may); }
.verdict.not_required { background: var(--ok-bg); border-color: var(--ok); } .verdict.not_required .tag { color: var(--ok); }
.verdict.lawyer { background: var(--ask-bg); border-color: var(--ask); } .verdict.lawyer .tag { color: var(--ask); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.fact { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: grid; gap: 2px; align-content: start; }
.fact b { font: 600 12px var(--font-body); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.fact span { font-size: 15px; }
.fact small { color: var(--muted); font-size: 12.5px; }
.trace { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; counter-reset: step; }
.trace li { display: grid; grid-template-columns: 26px 1fr; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); counter-increment: step; }
.trace li:first-child { border-top: 0; }
.trace li::before { content: counter(step); font: 12px var(--font-mono); color: var(--muted); border: 1px solid var(--line); border-radius: 50%; width: 24px; height: 24px; display: grid; place-items: center; }
.trace .cite { display: inline-block; font: 12.5px var(--font-mono); color: var(--accent); margin-top: 2px; overflow-wrap: anywhere; }
.trace .detail { color: var(--muted); font-size: 13.5px; margin-top: 3px; }
.trace li.lawyer-only, .lawyer-only { display: none; }
.show-lawyer .trace li.lawyer-only { display: grid; }
.show-lawyer div.lawyer-only, .show-lawyer p.lawyer-only { display: block; }
.badge { font: 11px var(--font-mono); border: 1px solid var(--may); color: var(--may); border-radius: 4px; padding: 0 5px; white-space: nowrap; }
.switch { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--muted); cursor: pointer; }
.switch input { accent-color: var(--accent); width: 16px; height: 16px; }
.list { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.caveat { border-left: 3px solid var(--may); padding: 2px 0 2px 12px; font-size: 14.5px; }
.contact { border: 1px dashed var(--line); border-radius: 10px; padding: 14px; display: grid; gap: 8px; }
table.kv { border-collapse: collapse; width: 100%; font-size: 14px; }
table.kv th, table.kv td { text-align: left; padding: 6px 8px; border-top: 1px solid var(--line); vertical-align: top; }
table.kv th { color: var(--muted); font-weight: 500; }
.scroll-x { overflow-x: auto; }

/* Worked examples */
.case { border-top: 1px solid var(--line); padding: 12px 0; display: grid; gap: 4px; }
.case:first-of-type { border-top: 0; }
.case-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.case-head .id { font: 12.5px var(--font-mono); color: var(--muted); }
.pill { font: 600 11.5px var(--font-body); border-radius: 999px; padding: 1px 9px; border: 1px solid; white-space: nowrap; }
.pill.mandatory { color: var(--must); border-color: var(--must); } .pill.voluntary { color: var(--may); border-color: var(--may); }
.pill.not_required { color: var(--ok); border-color: var(--ok); } .pill.lawyer { color: var(--ask); border-color: var(--ask); }
.pill.fail { color: var(--must); border-color: var(--must); background: var(--must-bg); }
.summary { font-weight: 600; }
footer { color: var(--muted); font-size: 13.5px; display: grid; gap: 6px; border-top: 1px solid var(--line); padding-top: 16px; }
@media (max-width: 520px) { .panel { padding: 14px; } .btn { padding: 10px 14px; } }
@media print { .tabs, .nav, .theme, .contact button { display: none; } .trace li.lawyer-only { display: grid; } }
