/* CasaVault — a statute-aware record of a tenancy.
   Design intent: this is an evidentiary instrument, not a SaaS dashboard.
   Warm paper ground, ink text, one restrained accent, and citations set in
   monospace so the thing the product is actually about — that every claim
   shows its source — is visible at a glance rather than buried in a cell. */

:root {
  color-scheme: light dark;

  --paper: #f6f4ef;
  --surface: #ffffff;
  --surface-sunk: #faf9f6;
  --ink: #1b1a17;
  --ink-soft: #55514a;
  --ink-faint: #8a857c;
  --line: #e2ded4;
  --line-strong: #cfc9bc;

  --accent: #1d5c4d;
  --accent-ink: #ffffff;
  --accent-soft: #e8f1ee;
  --accent-line: #b9d4cb;

  --violation: #9f2f24;
  --violation-bg: #fdf0ee;
  --violation-line: #f0cfc9;
  --caution: #7d5507;
  --caution-bg: #fdf7e7;
  --caution-line: #eedfb5;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(27, 26, 23, 0.05), 0 8px 24px -12px rgba(27, 26, 23, 0.18);
  --shadow-lift: 0 2px 4px rgba(27, 26, 23, 0.06), 0 16px 40px -16px rgba(27, 26, 23, 0.25);

  --serif: ui-serif, Georgia, "Iowan Old Style", "Times New Roman", serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #14141a;
    --surface: #1c1c23;
    --surface-sunk: #17171d;
    --ink: #ecebe6;
    --ink-soft: #b3aea4;
    --ink-faint: #837e75;
    --line: #2d2d36;
    --line-strong: #3c3c47;

    --accent: #6fbfa8;
    --accent-ink: #0d1f1a;
    --accent-soft: #1a2e29;
    --accent-line: #2f5449;

    --violation: #f2a49a;
    --violation-bg: #2b1a18;
    --violation-line: #4b2723;
    --caution: #e8c06a;
    --caution-bg: #2a2317;
    --caution-line: #4a3c1d;

    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px -12px rgba(0, 0, 0, 0.6);
    --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.45), 0 16px 40px -16px rgba(0, 0, 0, 0.7);
  }
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
/* The header is sticky, so anchor targets need room or they land under it. */
#how, #start { scroll-margin-top: 4.5rem; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; }
h1 { font-size: 1.9rem; margin: 0 0 0.4rem; }
h2 { font-size: 1.15rem; margin: 0; }
h3 { font-size: 0.98rem; margin: 0; }
p { margin: 0 0 0.85rem; }
p:last-child { margin-bottom: 0; }
a { color: var(--accent); text-underline-offset: 2px; }

[hidden] { display: none !important; }

/* --- layout ------------------------------------------------------------ */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.85rem clamp(1rem, 4vw, 2.5rem);
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  backdrop-filter: saturate(150%) blur(8px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand { display: flex; align-items: baseline; gap: 0.7rem; flex-wrap: wrap; }
.brand-mark {
  font-family: var(--serif);
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: -0.015em;
}
.brand-mark::before {
  content: "";
  display: inline-block;
  width: 9px; height: 9px;
  margin-right: 0.5rem;
  border-radius: 2px;
  background: var(--accent);
  transform: translateY(-1px);
}
.disclaimer { color: var(--ink-faint); font-size: 0.78rem; }

.auth-area { display: flex; align-items: center; gap: 0.6rem; }

/* The vault view stays a constrained column of cards; the landing page
   needs full-bleed bands, so the width constraint lives on each rather than
   on <main>. */
main { display: block; }

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
}

#vault-view {
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(1.25rem, 4vw, 2.5rem) clamp(1rem, 4vw, 2rem) 5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

#auth-error { max-width: 1080px; margin-inline: auto; }

/* --- cards -------------------------------------------------------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(1.1rem, 3vw, 1.75rem);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.9rem;
}
.section-head .hint { color: var(--ink-faint); font-size: 0.8rem; margin: 0; }

/* NOTE: every minmax() floor below is wrapped in min(..., 100%). A bare
   minmax(300px, 1fr) never shrinks past 300px, which pushed the page wider
   than a 320px phone screen and produced horizontal scrolling on the whole
   document — caught by measuring, not by eye. */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 1.25rem;
  align-items: start;
}

/* Findings carry the most text and are the point of the page; deadlines are
   a short table. An even split left the right column half empty. */
@media (min-width: 900px) {
  .grid-findings { grid-template-columns: 1.4fr 1fr; }
}

/* --- landing ------------------------------------------------------------ */

.hero { text-align: left; }
.hero h1 { font-size: clamp(1.75rem, 4.5vw, 2.5rem); max-width: 22ch; }
.lede { color: var(--ink-soft); max-width: 62ch; font-size: 1rem; }

.pipeline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr));
  gap: 0.6rem;
  margin: 1.4rem 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.pipeline li {
  counter-increment: step;
  padding: 0.7rem 0.85rem;
  background: var(--surface-sunk);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  color: var(--ink-soft);
}
.pipeline li strong { display: block; color: var(--ink); font-size: 0.88rem; }
.pipeline li strong::before {
  content: counter(step);
  display: inline-grid;
  place-items: center;
  width: 17px; height: 17px;
  margin-right: 0.45rem;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 0.66rem;
  font-weight: 700;
  font-family: var(--sans);
  vertical-align: 1px;
}

.divider {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin: 1.5rem 0;
  color: var(--ink-faint);
  font-size: 0.78rem;
}
.divider::before, .divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* --- forms -------------------------------------------------------------- */

.field { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; }
.field > span, .field-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.field-grow { flex: 1 1 200px; }

input[type="text"], input[type="number"], input[type="date"], input[type="search"],
select, textarea {
  font: inherit;
  font-size: 0.92rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.65rem;
  width: 100%;
  min-width: 0;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
textarea { resize: vertical; line-height: 1.5; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  outline: none;
}
input[type="file"] {
  font-size: 0.85rem;
  padding: 0.45rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  width: 100%;
  background: var(--surface-sunk);
}
::placeholder { color: var(--ink-faint); opacity: 1; }

.field-row-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-bottom: 0.9rem;
}
.field-row-group > .field { flex: 1 1 150px; }

.facts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr));
  gap: 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-sunk);
  padding: 1rem;
  margin: 0 0 0.9rem;
}
.facts-grid legend {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding: 0 0.4rem;
}
.hint-inline { text-transform: none; letter-spacing: 0; font-weight: 400; }

details > summary {
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--ink-soft);
  padding: 0.3rem 0;
}
details[open] > summary { margin-bottom: 0.5rem; }

.inline-form { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.inline-form input { flex: 1 1 220px; }

/* --- buttons ------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 550;
  line-height: 1.2;
  padding: 0.58rem 1.05rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.12s ease, border-color 0.12s ease, transform 0.06s ease;
}
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover:not([disabled]) { background: color-mix(in srgb, var(--accent) 88%, black); }
.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn-secondary:hover:not([disabled]) { background: var(--surface-sunk); border-color: var(--ink-faint); }
.btn-small { font-size: 0.82rem; padding: 0.4rem 0.75rem; }
.btn-danger { background: #c0392b; color: #fff; border-color: #c0392b; }
.btn-danger:hover:not([disabled]) { background: #a93226; }
.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--ink-soft);
  padding: 0.35rem 0.5rem;
  font-size: 0.82rem;
}
.btn-ghost:hover { background: var(--surface-sunk); color: var(--ink); }

.actions { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; }

/* --- vault header ------------------------------------------------------- */

.vault-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.vault-title { min-width: 0; }
.vault-title h1 { margin: 0; font-size: clamp(1.4rem, 3.5vw, 1.9rem); overflow-wrap: anywhere; }
.vault-meta { color: var(--ink-faint); font-size: 0.82rem; display: flex; gap: 0.5rem; flex-wrap: wrap; }
.vault-meta .dot { opacity: 0.5; }

.segmented {
  display: inline-flex;
  background: var(--surface-sunk);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; width: 0; height: 0; }
.segmented span {
  display: block;
  padding: 0.34rem 0.85rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 550;
  color: var(--ink-soft);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s ease, color 0.12s ease;
}
.segmented input:checked + span { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.segmented input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* --- banners ------------------------------------------------------------ */

.banner {
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.95rem;
  font-size: 0.88rem;
  margin-bottom: 1rem;
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  color: var(--ink);
}
.banner strong { font-weight: 650; }
.banner-caution { border-color: var(--caution-line); background: var(--caution-bg); }

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  flex-wrap: wrap;
  padding: 0.8rem 0.95rem;
  background: var(--surface-sunk);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin-bottom: 1.25rem;
}
.share-link {
  font-family: var(--mono);
  font-size: 0.78rem;
  overflow-wrap: anywhere;
  color: var(--ink-soft);
}

.error {
  color: var(--violation);
  background: var(--violation-bg);
  border: 1px solid var(--violation-line);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.75rem;
  font-size: 0.86rem;
  margin: 0.75rem 0 0;
}

/* --- tables ------------------------------------------------------------- */

.table-wrap { overflow-x: auto; margin: 0 -0.25rem; padding: 0 0.25rem; }
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
thead th {
  text-align: left;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 600;
  padding: 0 0.7rem 0.5rem;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
tbody td {
  padding: 0.7rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
tbody tr:last-child td { border-bottom: none; }
td.num, th.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.empty { color: var(--ink-faint); font-style: italic; }

/* --- findings (flags) --------------------------------------------------- */

.finding-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.7rem; }
.finding {
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  background: var(--surface-sunk);
}
.finding-violation, .finding.flagged { border-left-color: var(--violation); background: var(--violation-bg); border-color: var(--violation-line); }
.finding-caution, .finding.unknown { border-left-color: var(--caution); background: var(--caution-bg); border-color: var(--caution-line); }
.finding.passed { border-left-color: var(--accent); background: var(--accent-soft); border-color: var(--accent-line); }
.finding-head { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.35rem; flex-wrap: wrap; }
.badge {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 0.16rem 0.45rem;
  border-radius: 4px;
  background: var(--line);
  color: var(--ink-soft);
}
.finding-violation .badge { background: var(--violation); color: var(--surface); }
.finding-caution .badge { background: var(--caution); color: var(--surface); }
.finding-body { margin: 0; font-size: 0.92rem; }

.finding-icon {
  flex: none;
  width: 1.6rem; height: 1.6rem;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  font-weight: 700; font-size: 0.85rem;
  background: var(--violation); color: var(--surface);
}
.finding-icon.finding-ok { background: var(--accent); }
.finding-icon.finding-unknown { background: var(--caution); }

#findings-list .finding { display: flex; gap: 0.75rem; align-items: flex-start; }
#findings-list .finding p { margin: 0.2rem 0; }

/* --- multi-document uploads --------------------------------------------- */

.upload-progress {
  margin: 0.5rem 0 0;
  font-size: 0.84rem;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}
.upload-detail { margin-top: 0.5rem; font-size: 0.84rem; }
.upload-detail ul { margin: 0.4rem 0 0; padding-left: 1.1rem; }
.upload-detail li { margin-bottom: 0.2rem; }
.upload-problem { margin: 0.5rem 0 0; font-size: 0.86rem; }

.doc-list { display: flex; flex-direction: column; gap: 0.2rem; }
.doc-row { display: flex; align-items: baseline; gap: 0.4rem; }
.doc-row a {
  font-size: 0.83rem;
  /* One line per file. A 25-document lease in a narrow table column is
     unreadable if every name wraps to four lines; the full name is on the
     link's title attribute and in the downloaded file. */
  display: inline-block;
  max-width: 13rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}
.doc-unread {
  flex: none;
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-faint);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0 0.25rem;
}
.doc-more > summary { font-size: 0.8rem; color: var(--ink-faint); }

/* --- adjudication tally + the passed/unknown groups --------------------- */

.tally {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.9rem;
  align-items: baseline;
  padding-bottom: 0.85rem;
  margin-bottom: 0.15rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.85rem;
  color: var(--ink-soft);
}
.tally strong { color: var(--ink); font-size: 1.05rem; font-family: var(--serif); }
.tally span + span::before {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  margin-right: 0.4rem;
  transform: translateY(-1px);
  background: currentColor;
}
.tally-flag { color: var(--violation); }
.tally-ok { color: var(--accent); }
.tally-unknown { color: var(--caution); }

.finding-clear {
  border-left-color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--accent-line);
}
.finding-clear .badge { background: var(--accent); color: var(--accent-ink); }

.rule-group { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-sunk); }
.rule-group > summary {
  padding: 0.6rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-soft);
  list-style-position: inside;
}
.rule-group[open] > summary { border-bottom: 1px solid var(--line); margin-bottom: 0; }
.group-unknown { border-color: var(--caution-line); }
.group-unknown > summary { color: var(--caution); }

.rule-list { list-style: none; margin: 0; padding: 0.6rem 0.85rem; display: flex; flex-direction: column; gap: 0.7rem; }
.rule-row { display: flex; gap: 0.6rem; align-items: flex-start; font-size: 0.88rem; }
.rule-body { min-width: 0; }
.rule-mark {
  flex: none;
  display: grid;
  place-items: center;
  width: 18px; height: 18px;
  margin-top: 1px;
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 700;
}
.mark-ok { background: var(--accent); color: var(--accent-ink); }
.mark-unknown { background: var(--caution); color: var(--surface); }
.next-step {
  margin: 0.3rem 0 0;
  font-size: 0.83rem;
  color: var(--ink-soft);
  border-left: 2px solid var(--caution-line);
  padding-left: 0.6rem;
}

.cite {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--ink-soft);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
  margin-top: 0.45rem;
  overflow-wrap: anywhere;
}

/* --- agent -------------------------------------------------------------- */

.ask-card { border-color: var(--accent-line); }
.ask-form { display: flex; flex-direction: column; gap: 0.7rem; }
.ask-row { display: flex; gap: 0.6rem; align-items: flex-start; flex-wrap: wrap; }
.ask-row textarea { flex: 1 1 260px; }

.chips { display: flex; gap: 0.45rem; flex-wrap: wrap; }
.chip {
  font: inherit;
  font-size: 0.79rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.12s ease, color 0.12s ease;
}
.chip:hover { border-color: var(--accent); color: var(--ink); }

.answer {
  margin-top: 1rem;
  border-radius: var(--radius-sm);
  padding: 1rem;
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
}
.answer-refusal { border-color: var(--caution-line); background: var(--caution-bg); }
.answer-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.4rem;
}
.answer-text { margin: 0; font-size: 0.95rem; }
.handoff {
  margin-top: 0.7rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--line);
  font-size: 0.88rem;
}
.handoff strong { font-weight: 650; }

/* --- statute table ------------------------------------------------------ */

.statute-list { list-style: none; margin: 0.5rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.55rem; }
/* Capped so the full table informs without dominating the landing page. */
.statute-scroll {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
  max-height: 420px;
  overflow-y: auto;
  padding-right: 0.3rem;
}
.statute {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.9rem;
  background: var(--surface-sunk);
  font-size: 0.87rem;
}
.statute-head { display: flex; justify-content: space-between; gap: 0.6rem; flex-wrap: wrap; align-items: baseline; }
.statute-id { font-family: var(--mono); font-size: 0.74rem; color: var(--ink-faint); }
.statute p { margin: 0.3rem 0 0; color: var(--ink-soft); }

/* --- misc --------------------------------------------------------------- */

.vault-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.vault-list a { display: block; padding: 0.5rem 0.7rem; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface-sunk); text-decoration: none; color: var(--ink); font-size: 0.9rem; }
.vault-list a:hover { border-color: var(--accent); }

.draft-preview {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1rem;
  background: var(--surface-sunk);
}
.draft-body {
  margin: 0.3rem 0 0;
  white-space: pre-wrap;
  font-size: 0.84rem;
  line-height: 1.55;
  color: var(--ink-soft);
  font-family: var(--sans);
  max-height: 20rem;
  overflow-y: auto;
}

.is-busy { opacity: 0.55; pointer-events: none; }

.spinner {
  width: 14px; height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  display: inline-block;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.footnote {
  color: var(--ink-faint);
  font-size: 0.78rem;
  text-align: center;
  max-width: 62ch;
  margin: 0 auto;
}

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

@media (max-width: 560px) {
  .site-header { padding: 0.7rem 1rem; }
  .disclaimer { width: 100%; }
  .vault-header { flex-direction: column; align-items: stretch; }
  .segmented { width: 100%; }
  .segmented label { flex: 1; }
  .segmented span { text-align: center; }
  .btn { width: 100%; }
  .actions .btn, .inline-form .btn { width: auto; flex: 1 1 auto; }
}


/* =======================================================================
   SITE NAVIGATION
   The detail lives on its own pages now, so every page carries the same
   header. Written as plain HTML in each file rather than injected by JS:
   four pages is less cost than a rendering step, and the nav is then there
   with JavaScript off.
   ======================================================================= */

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem;
  align-items: center;
}
.site-nav a {
  padding: 0.4rem 0.7rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
  white-space: nowrap;
}
.site-nav a:hover { background: var(--surface-sunk); color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--ink); font-weight: 650; background: var(--surface-sunk); }

a.brand { text-decoration: none; color: inherit; }

.header-actions { display: flex; align-items: center; gap: 0.6rem; }

@media (max-width: 720px) {
  .site-header { gap: 0.5rem; }
  .site-nav { order: 3; width: 100%; justify-content: flex-start; gap: 0; margin-top: 0.15rem; }
  .site-nav a { padding: 0.35rem 0.55rem; font-size: 0.84rem; }
  .brand .disclaimer { display: none; }
}

/* =======================================================================
   PAGES — the landing, and the three content pages behind the nav.
   Plain language, short lines, one idea per block.
   ======================================================================= */

.page { max-width: 760px; margin: 0 auto; padding: clamp(2rem, 6vw, 3.5rem) clamp(1rem, 4vw, 2rem) 4rem; }
.page-wide { max-width: 1040px; }

.page h1 {
  font-size: clamp(1.8rem, 4.5vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 0.75rem;
  max-width: 20ch;
}
.page h2 {
  font-size: clamp(1.15rem, 2.6vw, 1.45rem);
  margin: 2.4rem 0 0.7rem;
}
.page h2:first-of-type { margin-top: 1.8rem; }
.page h3 { font-size: 1rem; margin: 0 0 0.35rem; }
.page p { font-size: 1rem; color: var(--ink-soft); max-width: 65ch; }
.page p.intro { font-size: clamp(1.02rem, 2vw, 1.15rem); color: var(--ink); }
.page ul, .page ol { max-width: 65ch; color: var(--ink-soft); padding-left: 1.25rem; }
.page li { margin-bottom: 0.5rem; }
.page strong { color: var(--ink); }

.eyebrow {
  font-size: 0.74rem;
  font-weight: 650;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.8rem;
}

/* --- landing ------------------------------------------------------------ */

.home-hero { padding-block: clamp(2.25rem, 7vw, 4rem) clamp(1.5rem, 4vw, 2.5rem); }
.home-hero h1 { max-width: 16ch; font-size: clamp(2rem, 5.5vw, 3rem); }
.home-hero .intro { max-width: 52ch; }

.home-cta { display: flex; flex-wrap: wrap; gap: 0.7rem; margin: 1.5rem 0 0.9rem; }
.btn-lg { font-size: 0.97rem; padding: 0.78rem 1.4rem; }
.home-note { font-size: 0.86rem; color: var(--ink-faint); margin: 0; }

/* .page ul caps body lists at 65ch for readability, which is right for
   prose and wrong for a card grid — it squeezed three cards into two
   columns with dead space beside them. Card lists opt out of both the
   measure cap and the list indent. */
/* Scoped with .page so these beat `.page ul` (class + element), which
   otherwise wins on specificity and re-applies the 65ch prose cap. */
.page .home-points, .page .steps, .page .statute-list {
  max-width: none;
  padding-left: 0;
  list-style: none;
}

.home-points {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  margin: 0;
}
.home-points li {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin: 0;
}
.home-points h2 { font-size: 1.02rem; margin: 0 0 0.4rem; font-family: var(--serif); }
.home-points p { font-size: 0.9rem; margin: 0; }

.home-band { background: var(--surface-sunk); border-block: 1px solid var(--line); }
.home-section { padding-block: clamp(2rem, 5vw, 3rem); }

.home-start { max-width: 620px; }

/* --- content pages ------------------------------------------------------ */

.steps { margin: 1.5rem 0 0; display: grid; gap: 1rem; }
.steps li {
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: 0.9rem;
  align-items: start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  margin: 0;
}
.step-n {
  display: grid;
  place-items: center;
  width: 2rem; height: 2rem;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  font-size: 0.85rem;
}
.steps p { margin: 0; font-size: 0.93rem; }

.callout {
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  margin: 1.6rem 0;
}
.callout p { margin: 0; color: var(--ink); font-size: 0.93rem; }
.callout-plain { border-color: var(--line); background: var(--surface-sunk); }

.faq { margin-top: 1.5rem; }
.faq > div {
  border-top: 1px solid var(--line);
  padding: 1.15rem 0;
}
.faq > div:last-child { border-bottom: 1px solid var(--line); }
.faq h3 { margin-bottom: 0.4rem; }
.faq p { margin: 0; font-size: 0.93rem; }

.next-page {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface-sunk);
  padding-block: 2rem 2.5rem;
}
.site-footer .wrap { display: grid; gap: 0.8rem; }
.site-footer p { margin: 0; font-size: 0.83rem; color: var(--ink-faint); max-width: 68ch; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0.15rem; margin-left: -0.7rem; }

@media (max-width: 560px) {
  .home-cta .btn { width: 100%; }
}
