/* Linked Global Inc — 501(c)(3) setup intake
   A midnight filing desk: calm contrast, generous touch targets,
   and the "No to all" stamp as the one memorable move. */

@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("fonts/atkinson-hyperlegible-next-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("fonts/bricolage-grotesque-latin.woff2") format("woff2");
  font-weight: 600 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --ink: #F4F7FB;
  --harbor: #84AEFF;
  --harbor-deep: #B8CEFF;
  --tide: #172A46;
  --tide-line: #3D6396;
  --paper: #080D14;
  --surface: #111A27;
  --line: #263548;
  --line-strong: #4B5D73;
  --slate: #A9B6C7;
  --verified: #70D5A2;
  --verified-bg: #102B24;
  --brass: #F2CA78;
  --brass-bg: #2B2415;
  --brass-line: #6F5A2B;
  --alarm: #FF8A91;
  --alarm-bg: #321A20;

  --font-body: "Atkinson Hyperlegible Next", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-display: "Bricolage Grotesque", "Atkinson Hyperlegible Next", system-ui, -apple-system, "Segoe UI", sans-serif;

  --r-card: 16px;
  --r-ctl: 12px;
  --s1: 0.25rem; --s2: 0.5rem; --s3: 0.75rem; --s4: 1rem; --s5: 1.5rem; --s6: 2rem; --s7: 3rem;
  --bar-h: calc(52px + 1.5rem + env(safe-area-inset-bottom));
}

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

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--paper); }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

h1, h2, h3 { margin: 0; color: var(--ink); }
p { margin: 0; }
a { color: var(--harbor); text-underline-offset: 0.15em; }
a:hover { color: var(--harbor-deep); }
.num { font-variant-numeric: tabular-nums; }
.nw { white-space: nowrap; }
[hidden] { display: none !important; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Focus: bright blue ring with a dark gap */
:focus-visible { outline: 3px solid var(--harbor); outline-offset: 2px; box-shadow: 0 0 0 2px var(--paper); }
h1:focus, main:focus, .err-summary:focus:not(:focus-visible) { outline: none; box-shadow: none; }
.err-summary:focus-visible { outline: 3px solid var(--harbor); outline-offset: 2px; }

.skip {
  position: absolute; left: var(--s2); top: -5rem; z-index: 50;
  background: var(--surface); color: var(--harbor); font-weight: 700;
  padding: var(--s3) var(--s4); border-radius: var(--r-ctl); border: 2px solid var(--harbor);
}
.skip:focus { top: var(--s2); }

/* ---------- Header ---------- */

.top {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
  padding: calc(var(--s3) + env(safe-area-inset-top)) max(var(--s4), env(safe-area-inset-right)) var(--s3) max(var(--s4), env(safe-area-inset-left));
  background: rgba(17, 26, 39, 0.94); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 30; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.brand { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.brand-ew { font-family: var(--font-display); font-weight: 700; font-size: 1.0625rem; color: var(--harbor); letter-spacing: -0.005em; }
.brand-client { font-size: 0.8125rem; color: var(--slate); }
.save-status { font-size: 0.8125rem; color: var(--slate); text-align: right; max-width: 12.5rem; line-height: 1.3; }
.top .save-status { flex: none; white-space: nowrap; font-variant-numeric: tabular-nums; }
.section-toggle {
  display: flex; flex-direction: column; align-items: flex-end; gap: 0.125rem;
  min-height: 44px; padding: 0.375rem 0.625rem; margin-left: auto;
  border: 1px solid var(--line); border-radius: 10px; background: #0C131E; color: var(--ink);
  font: inherit; text-align: right; cursor: pointer;
}
.section-toggle span { color: var(--slate); font-size: 0.75rem; line-height: 1.15; }
.section-toggle strong { color: var(--harbor); font-size: 0.875rem; line-height: 1.15; }
.top > .save-status { display: none; }

/* ---------- Step rail: segments on mobile, list on desktop ---------- */

.rail {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  max-height: min(78vh, 42rem); padding: var(--s4) var(--s4) calc(var(--s5) + env(safe-area-inset-bottom));
  background: var(--surface); border: 1px solid var(--line); border-bottom: 0;
  border-radius: 22px 22px 0 0; transform: translateY(105%); visibility: hidden;
  transition: transform 180ms ease-out, visibility 180ms; overflow-y: auto;
}
body.nav-open .rail { transform: translateY(0); visibility: visible; }
.rail-backdrop {
  position: fixed; inset: 0; z-index: 55; display: none; border: 0; padding: 0;
  background: rgba(0, 0, 0, 0.68); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
}
body.nav-open .rail-backdrop { display: block; }
.rail-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); margin-bottom: var(--s4); }
.rail-head div { display: flex; flex-direction: column; }
.rail-head strong { font-family: var(--font-display); font-size: 1.25rem; }
.rail-head span { color: var(--slate); font-size: 0.875rem; }
.rail-head button {
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-strong);
  background: #0C131E; color: var(--ink); font: inherit; font-size: 1.5rem; cursor: pointer;
}
.rail ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.375rem; }
.seg {
  display: flex; align-items: center; gap: var(--s3); min-height: 54px; padding: 0.5rem 0.75rem;
  color: var(--ink); text-decoration: none; border-radius: var(--r-ctl); border: 1px solid transparent;
}
.seg:hover { background: var(--tide); }
.seg-num {
  display: grid; place-items: center; flex: none; width: 1.875rem; height: 1.875rem;
  border-radius: 50%; border: 2px solid var(--line-strong); color: var(--slate); font-weight: 700; font-size: 0.875rem;
}
.seg-num svg { width: 0.875rem; height: 0.875rem; }
.seg-label { display: block; }
.seg.is-done .seg-num { background: var(--verified); border-color: var(--verified); color: #07140E; }
.seg.is-current { background: var(--tide); border-color: var(--tide-line); font-weight: 700; }
.seg.is-current .seg-num { border-color: var(--harbor); color: var(--harbor); }
.rail-save { display: none; }

/* ---------- Main column ---------- */

.layout { width: 100%; }
main {
  display: block; max-width: 40rem; margin: 0 auto;
  padding: var(--s5) max(var(--s4), env(safe-area-inset-right)) calc(var(--bar-h) + var(--s5)) max(var(--s4), env(safe-area-inset-left));
}

.eyebrow {
  font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--harbor); margin-bottom: var(--s2);
}
h1 {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1.75rem, 6vw, 2.25rem); line-height: 1.15; letter-spacing: -0.015em;
  margin-bottom: var(--s2);
}
.sub { color: var(--slate); margin-bottom: var(--s5); max-width: 36rem; }
.section-h {
  font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; line-height: 1.25;
  margin: var(--s6) 0 var(--s4);
}

.status-path { display: grid; gap: var(--s3); margin-bottom: var(--s4); }
.status-block {
  padding: var(--s5) var(--s4); border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface);
}
.status-block h2 { font-family: var(--font-display); font-size: 1.25rem; line-height: 1.2; margin: 0.25rem 0 var(--s2); }
.status-block p { color: var(--slate); }
.status-kicker { color: var(--brass); font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.status-goal { border-color: var(--tide-line); background: var(--tide); }
.status-goal .status-kicker { color: var(--verified); }
.status-divider { display: none; color: var(--harbor); font-size: 1.75rem; font-weight: 700; text-align: center; }

/* ---------- Cards ---------- */

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card);
  padding: var(--s5) var(--s4); margin-bottom: var(--s4);
}
.card h2 { font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; line-height: 1.25; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; margin-bottom: var(--s3); }

/* Verified facts */
.facts { margin-bottom: var(--s5); }
.badge {
  display: inline-flex; align-items: center; gap: 0.375rem;
  background: var(--verified-bg); color: var(--verified); font-weight: 700; font-size: 0.875rem;
  padding: 0.25rem 0.75rem 0.25rem 0.5rem; border-radius: 999px;
}
.badge .ico { width: 1rem; height: 1rem; }
.facts-list { margin: 0; display: grid; gap: 0; }
.facts-list div { padding: var(--s3) 0; border-top: 1px solid var(--line); }
.facts-list dt { font-size: 0.875rem; color: var(--slate); }
.facts-list dd { margin: 0; font-weight: 600; }

/* ---------- Fields ---------- */

.field { margin: 0 0 var(--s5); padding: 0; border: 0; min-width: 0; }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
legend { padding: 0; }
.label { display: block; font-weight: 600; margin-bottom: 0.375rem; line-height: 1.4; }
.help, .help-block { color: var(--slate); font-size: 0.9375rem; line-height: 1.45; margin-bottom: var(--s2); }
.help-block { margin-bottom: var(--s4); max-width: 36rem; }

.input {
  display: block; width: 100%; min-height: 52px;
  padding: 0.75rem 0.875rem;
  font: inherit; font-size: 1.0625rem; color: var(--ink);
  background: #0C131E; border: 1px solid var(--line-strong); border-radius: var(--r-ctl);
  -webkit-appearance: none; appearance: none;
}
.input:hover { border-color: var(--slate); }
textarea.input { min-height: 6.75rem; resize: vertical; line-height: 1.45; }
select.input {
  padding-right: 2.75rem; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 7.5l5 5 5-5' fill='none' stroke='%2384AEFF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.875rem center; background-size: 1.25rem;
}
.count { text-align: right; font-size: 0.8125rem; color: var(--slate); margin-top: 0.25rem; }

.money { position: relative; }
.money-sign { position: absolute; left: 0.875rem; top: 50%; transform: translateY(-50%); color: var(--slate); pointer-events: none; }
.money .input { padding-left: 1.75rem; }

.row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 var(--s4); }

.reveal {
  border-left: 3px solid var(--tide-line); padding-left: var(--s4); margin-left: 0.125rem;
  animation: reveal 160ms ease-out;
}

/* Errors */
.err {
  display: flex; align-items: flex-start; gap: var(--s2);
  color: var(--alarm); font-weight: 600; font-size: 0.9375rem; line-height: 1.45;
  margin: 0.125rem 0 var(--s2);
}
.err a { color: var(--alarm); }
.ico { width: 1.125rem; height: 1.125rem; flex: none; margin-top: 0.125rem; }
.has-err > .input, .has-err .money .input, .has-err > textarea.input { border: 2px solid var(--alarm); }
.has-err.choice > .opts .opt, .xg-items.has-err .opt, .has-err > .xg-modes .opt { border-color: var(--alarm); }
.has-err.reveal { border-left-color: var(--alarm); }

.err-summary {
  border: 2px solid var(--alarm); background: var(--alarm-bg); border-radius: var(--r-ctl);
  padding: var(--s4); margin-bottom: var(--s5);
}
.err-summary h2 { font-family: var(--font-display); font-size: 1.1875rem; color: var(--alarm); margin-bottom: var(--s2); }
.err-summary ul { margin: 0; padding-left: 1.25rem; }
.err-summary li { margin: 0.375rem 0; }
.err-summary a { color: var(--alarm); font-weight: 600; }

/* ---------- Choice rows ---------- */

.opts { display: grid; gap: 0.625rem; }
.opt {
  position: relative; display: flex; align-items: center; gap: 0.875rem;
  min-height: 56px; padding: 0.75rem var(--s4);
  background: #0C131E; border: 1px solid var(--line-strong); border-radius: var(--r-ctl);
  cursor: pointer; line-height: 1.4;
  -webkit-tap-highlight-color: transparent;
}
.opt:hover { border-color: var(--harbor); }
.opt input { position: absolute; left: 1rem; top: 50%; width: 1px; height: 1px; margin: 0; opacity: 0; }
.opt:has(input:checked) { border-color: var(--harbor); box-shadow: inset 0 0 0 1px var(--harbor); background: var(--tide); }
.opt:has(input:focus-visible) { outline: 3px solid var(--harbor); outline-offset: 2px; }
.opt input:focus-visible { outline: none; box-shadow: none; }

.opt-mark {
  flex: none; display: grid; place-items: center; width: 24px; height: 24px;
  border: 2px solid var(--slate); border-radius: 50%; background: #0C131E; color: #fff;
}
.opt-mark.box { border-radius: 6px; }
.opt-mark svg { width: 14px; height: 14px; opacity: 0; }
.opt input:checked + .opt-mark { border-color: var(--harbor); background: var(--harbor); }
.opt input:checked + .opt-mark:not(.box) { background: #0C131E; color: var(--harbor); }
.opt input:checked + .opt-mark svg { opacity: 1; }
.opt-text { display: flex; flex-direction: column; gap: 0.125rem; min-width: 0; }
.opt-sub { color: var(--slate); font-size: 0.9375rem; line-height: 1.4; }
.opt.check .opt-label { font-weight: 400; }

/* The stamp: "No to all" */
.xcard { padding-top: var(--s5); }
.xg-legend {
  font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; line-height: 1.25;
  margin-bottom: var(--s3);
}
.xgroup > .help { margin-top: calc(var(--s2) * -1); margin-bottom: var(--s3); }
.opt.stamp {
  min-height: 72px; padding: var(--s4);
  background: var(--tide); border-color: var(--tide-line);
}
.opt.stamp .opt-label {
  font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; line-height: 1.2;
  color: var(--harbor-deep); letter-spacing: -0.005em;
}
.opt.stamp:has(input:checked) { background: var(--verified-bg); border-color: var(--verified); box-shadow: inset 0 0 0 1px var(--verified); }
.seal { flex: none; width: 40px; height: 40px; }
.seal svg { display: block; width: 100%; height: 100%; overflow: visible; }
.seal-ring { fill: none; stroke: var(--harbor); stroke-width: 2; stroke-dasharray: 3 2.5; transition: stroke 160ms ease-out; }
.seal-inner { fill: transparent; transition: fill 160ms ease-out; }
.seal-check {
  fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 21; stroke-dashoffset: 21; transition: stroke-dashoffset 160ms ease-out 60ms;
}
.opt input:checked + .seal .seal-ring { stroke: var(--verified); stroke-dasharray: none; }
.opt input:checked + .seal .seal-inner { fill: var(--verified); }
.opt input:checked + .seal .seal-check { stroke-dashoffset: 0; }

.peek { margin-top: var(--s3); }
.peek summary, .fallback summary {
  display: flex; align-items: center; gap: var(--s2); min-height: 48px;
  cursor: pointer; list-style: none; color: var(--harbor); font-weight: 700;
}
.peek summary::-webkit-details-marker, .fallback summary::-webkit-details-marker { display: none; }
.peek summary::before, .summary-hint::before {
  content: "+"; display: inline-grid; place-items: center; width: 1.5rem; height: 1.5rem; flex: none;
  border: 2px solid currentColor; border-radius: 50%; font-weight: 700; line-height: 1;
}
.peek[open] summary::before, .fallback[open] .summary-hint::before { content: "\2212"; }
.peek-list { margin: var(--s2) 0 0; padding-left: 1.25rem; color: var(--ink); font-size: 0.9375rem; }
.peek-list li { margin: 0.375rem 0; }

.xg-list { margin-top: var(--s4); animation: reveal 160ms ease-out; }
.xg-items { margin-bottom: var(--s5); }
.xg-items > .label { margin-bottom: var(--s3); }
.note-brass {
  display: flex; gap: var(--s2); align-items: flex-start;
  background: var(--brass-bg); color: var(--brass); border: 1px solid var(--brass-line);
  border-radius: var(--r-ctl); padding: var(--s3) var(--s4); font-size: 0.9375rem; font-weight: 600;
}
.closing-note { color: var(--slate); font-size: 0.9375rem; margin: var(--s5) 0 0; max-width: 36rem; }

@keyframes reveal { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: 0.625rem; }
.chip {
  min-height: 48px; padding: 0 var(--s4); border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--harbor);
  font: inherit; font-size: 0.9375rem; font-weight: 700; cursor: pointer;
}
.chip:hover { border-color: var(--harbor); }
.chip[aria-pressed="true"] { background: var(--tide); border-color: var(--harbor); box-shadow: inset 0 0 0 1px var(--harbor); }

/* ---------- Step 6 ---------- */

.ticks { list-style: none; counter-reset: scope; margin: var(--s3) 0 0; padding: 0; display: grid; gap: var(--s3); }
.ticks li { display: flex; gap: var(--s3); align-items: flex-start; }
.ticks li { counter-increment: scope; }
.ticks li::before {
  content: counter(scope, upper-alpha); display: grid; place-items: center; flex: none; width: 2rem; height: 2rem;
  border-radius: 9px; background: var(--tide); color: var(--harbor); font-family: var(--font-display); font-weight: 700;
}
.ticks svg { display: none; }

.price h2 { margin-bottom: var(--s3); }
.price-row {
  display: flex; justify-content: space-between; align-items: baseline; gap: var(--s4);
  padding: var(--s3) 0; border-top: 1px solid var(--line);
}
.price-row strong { font-size: 1.125rem; white-space: nowrap; }
.pr-label { display: flex; flex-direction: column; gap: 0.125rem; }
.pr-label small { color: var(--slate); font-size: 0.875rem; line-height: 1.4; }
.price-head {
  background: var(--tide); border: 0; border-radius: var(--r-ctl);
  padding: var(--s4); margin-bottom: var(--s2); align-items: center;
}
.price-head .pr-label { font-weight: 700; }
.money-big { font-family: var(--font-display); font-weight: 700; font-size: 2.25rem; line-height: 1; color: var(--harbor-deep); }
.price-total { border-top: 2px solid var(--ink); font-weight: 700; }
.price-total strong { font-family: var(--font-display); font-size: 1.5rem; }
.cap {
  margin: var(--s3) 0 var(--s4); padding: var(--s3) var(--s4);
  border: 1px solid var(--tide-line); border-radius: var(--r-ctl); background: var(--surface);
}
.price h3, .tile h3 { font-size: 1rem; font-weight: 700; }
.later { margin: var(--s2) 0 0; padding-left: 1.25rem; color: var(--slate); font-size: 0.9375rem; }
.later li { margin: 0.25rem 0; }

.fallback summary { justify-content: space-between; color: var(--ink); }
.summary-title { font-family: var(--font-display); font-size: 1.25rem; font-weight: 700; line-height: 1.25; }
.summary-hint { color: var(--harbor); }
.fallback-body { margin-top: var(--s3); display: grid; gap: var(--s3); }
.fallback.is-promoted { background: var(--brass-bg); border-color: var(--brass-line); }
.fallback .lead { display: flex; gap: var(--s2); color: var(--brass); font-weight: 700; }
.tiles { display: grid; gap: var(--s3); }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-ctl); padding: var(--s4); }
.tile-alt { border-color: var(--line-strong); }
.tile h3 { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; margin-bottom: var(--s2); }
.tag { font-size: 0.8125rem; font-weight: 700; color: var(--verified); background: var(--verified-bg); padding: 0.125rem 0.5rem; border-radius: 999px; }
.tile dl { margin: 0; }
.tile dl div { display: flex; justify-content: space-between; gap: var(--s3); padding: 0.375rem 0; border-top: 1px solid var(--line); }
.tile dt { flex: none; color: var(--slate); font-size: 0.9375rem; }
.tile dd { flex: 1 1 auto; margin: 0; text-align: right; font-weight: 600; font-size: 0.9375rem; text-wrap: balance; }
.tile-total dt, .tile-total dd { color: var(--ink); font-weight: 700; font-size: 1rem; }
.fine { color: var(--slate); font-size: 0.875rem; }

.opt.approve { align-items: flex-start; padding: var(--s4); }
.opt.approve .opt-mark { margin-top: 0.125rem; }
.opt.approve .opt-label { font-weight: 700; font-size: 1.125rem; }

.confirm { margin: 0 0 var(--s5); }
.confirm ul { margin: var(--s2) 0 0; padding-left: 1.25rem; }
.confirm li { margin: 0.25rem 0; }
.sign-note {
  margin: calc(var(--s3) * -1) 0 var(--s5); padding: var(--s3) var(--s4);
  background: var(--tide); border-radius: var(--r-ctl); font-size: 0.9375rem;
}

/* ---------- Review ---------- */

.rv-card .card-head { margin-bottom: var(--s2); }
.rv-step { display: block; font-family: var(--font-body); font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--harbor); }
.edit-link {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--s4);
  border: 1px solid var(--harbor); border-radius: var(--r-ctl); font-weight: 700; text-decoration: none;
}
.rv-list-wrap { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr); }
.rv-row { padding: var(--s3) 0; border-top: 1px solid var(--line); min-width: 0; }
.rv-row dt { font-size: 0.875rem; color: var(--slate); }
.rv-row dd { margin: 0; }
.rv-missing { color: var(--alarm); font-weight: 600; }
.rv-blank { color: var(--slate); }
.rv-none { font-weight: 700; color: var(--verified); }
.rv-list { margin: var(--s1) 0 0; padding-left: 1.25rem; }
.rv-note { margin-top: var(--s1); }
.rv-note span:first-child { color: var(--slate); }
.ready {
  display: flex; gap: var(--s3); align-items: flex-start;
  background: var(--verified-bg); color: var(--verified); border: 1px solid #9CCBB0;
  border-radius: var(--r-ctl); padding: var(--s4); margin-bottom: var(--s5); font-weight: 600;
}
.ready .ico { width: 1.25rem; height: 1.25rem; }
.print-steps { margin: var(--s3) 0 0; padding-left: 1.25rem; }
.print-steps li { margin: 0.25rem 0; }
.print-card .btn { margin-top: var(--s5); }
.btn-block { width: 100%; }

.payment-card {
  border-color: var(--tide-line);
  background: linear-gradient(145deg, #14233A 0%, var(--surface) 72%);
}
.payment-card h2 { font-size: 1.5rem; margin-bottom: var(--s2); }
.payment-copy { color: var(--slate); max-width: 34rem; }
.payment-total {
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--s4);
  margin-top: var(--s5); padding-top: var(--s4); border-top: 1px solid var(--line);
}
.payment-total span { color: var(--slate); }
.payment-total strong { font-family: var(--font-display); font-size: 1.75rem; color: var(--ink); }

/* ---------- Buttons and action bar ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 52px; padding: 0 1.25rem; border-radius: var(--r-ctl);
  font: inherit; font-size: 1.0625rem; font-weight: 700; line-height: 1.2; text-align: center;
  text-decoration: none; cursor: pointer; border: 1px solid var(--harbor);
  -webkit-tap-highlight-color: transparent;
}
.btn-primary { background: var(--harbor); border-color: var(--harbor); color: #09111D; }
.btn-primary:hover, .btn-primary:active { background: #A8C4FF; border-color: #A8C4FF; color: #09111D; }
.btn-secondary { background: var(--surface); color: var(--harbor); }
.btn-secondary:hover { background: var(--tide); color: var(--harbor-deep); }
.btn-danger { background: var(--alarm); border-color: var(--alarm); color: #fff; }
.btn[aria-disabled="true"] { background: #344154; border-color: #344154; color: #A7B2C2; cursor: not-allowed; }
.btn-sm { min-height: 48px; padding: 0 var(--s4); font-size: 1rem; }

.actions {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: 35fr 65fr; gap: var(--s3);
  padding: var(--s3) max(var(--s4), env(safe-area-inset-right)) calc(var(--s3) + env(safe-area-inset-bottom)) max(var(--s4), env(safe-area-inset-left));
  background: rgba(17, 26, 39, 0.96); border-top: 1px solid var(--line);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.actions.single { grid-template-columns: 1fr; }

/* Inline so it reads as part of the sentence; vertical padding on an inline element widens the
   tap area without stretching the line height. */
.linklike {
  display: inline; background: none; border: 0; padding: 0.75rem 0; margin: 0; font: inherit; color: var(--harbor);
  text-decoration: underline; text-underline-offset: 0.15em; cursor: pointer; font-weight: 600;
}

/* ---------- Banners, footer, dialog ---------- */

.banner {
  display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center;
  background: var(--tide); border: 1px solid var(--tide-line); border-radius: var(--r-ctl);
  padding: var(--s4); margin-bottom: var(--s5);
}
.banner p { flex: 1 1 14rem; }
.banner-actions { display: flex; gap: var(--s2); flex-wrap: wrap; }
.banner-brass { background: var(--brass-bg); border-color: var(--brass-line); color: var(--brass); font-weight: 600; align-items: flex-start; }

.payment-toast {
  position: fixed; z-index: 90; right: max(1rem, env(safe-area-inset-right)); bottom: max(1rem, env(safe-area-inset-bottom));
  width: min(28rem, calc(100vw - 2rem)); display: grid; grid-template-columns: auto 1fr auto; gap: var(--s3); align-items: start;
  padding: var(--s4); color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.42); opacity: 0; transform: translateY(0.75rem); transition: opacity 180ms ease, transform 180ms ease;
}
.payment-toast.is-visible { opacity: 1; transform: translateY(0); }
.payment-toast-success { border-color: var(--tide-line); background: var(--tide); }
.payment-toast .ico { width: 1.35rem; height: 1.35rem; color: var(--harbor); margin-top: 0.1rem; }
.payment-toast strong { display: block; font: 700 1.05rem/1.25 var(--font-display); }
.payment-toast p { margin-top: 0.25rem; color: var(--slate); font-size: 0.92rem; }
.payment-toast button { width: 2.75rem; height: 2.75rem; margin: -0.65rem -0.65rem 0 0; border: 0; border-radius: 50%; color: var(--ink); background: transparent; font: 1.5rem/1 sans-serif; cursor: pointer; }
.payment-toast button:hover { background: var(--surface-2); }

.foot { margin-top: var(--s7); padding-top: var(--s4); border-top: 1px solid var(--line); color: var(--slate); font-size: 0.875rem; }

dialog {
  border: 0; border-radius: var(--r-card); padding: 0; max-width: min(28rem, calc(100vw - 2rem));
  color: var(--ink); background: var(--surface); box-shadow: 0 12px 40px rgba(20, 32, 43, 0.25);
}
dialog::backdrop { background: rgba(0, 0, 0, 0.72); }
.dialog-body { padding: var(--s5); }
.dialog-body h2 { font-family: var(--font-display); font-size: 1.375rem; margin-bottom: var(--s2); }
.dialog-actions { display: flex; flex-wrap: wrap; gap: var(--s2); justify-content: flex-end; margin-top: var(--s5); }

#packet { display: none; }

/* ---------- Tablet ---------- */

@media (min-width: 640px) {
  :root { --bar-h: 0px; }
  main { padding-top: var(--s6); padding-bottom: var(--s6); }
  .card { padding: var(--s5); }
  .row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts-list { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--s5); }
  .actions {
    position: static; display: flex; justify-content: space-between; gap: var(--s3);
    margin-top: var(--s6); padding: var(--s5) 0 0; background: none; border-top: 1px solid var(--line);
  }
  .actions.single { justify-content: flex-end; }
  .actions .btn { min-width: 10.5rem; }
  .status-path { grid-template-columns: 1fr auto 1fr; align-items: stretch; }
  .status-divider { display: grid; place-items: center; }
}

/* ---------- Desktop: left rail ---------- */

@media (min-width: 960px) {
  .top { padding-left: max(var(--s5), calc((100vw - 64rem) / 2 + var(--s5))); padding-right: max(var(--s5), calc((100vw - 64rem) / 2 + var(--s5))); border-bottom: 1px solid var(--line); }
  .top .save-status { display: none; }
  .section-toggle { display: none; }
  .layout {
    display: grid; grid-template-columns: 17rem minmax(0, 40rem); gap: var(--s7);
    max-width: 64rem; margin: 0 auto; padding: 0 var(--s5);
  }
  main { margin: 0; padding-left: 0; padding-right: 0; }
  .rail {
    position: sticky; left: auto; right: auto; bottom: auto; top: 0; z-index: auto; align-self: start;
    max-height: none; transform: none; visibility: visible; overflow: visible;
    background: none; border: 0; border-radius: 0; padding: var(--s6) 0 0;
  }
  .rail-head, .rail-backdrop { display: none !important; }
  .rail ol { display: flex; flex-direction: column; gap: 0.25rem; max-width: none; }
  .rail li[data-route="review"] { display: block; margin-top: var(--s2); padding-top: var(--s2); border-top: 1px solid var(--line); }
  .seg { display: flex; align-items: center; gap: var(--s3); height: auto; min-height: 48px; padding: 0.5rem 0.75rem; border-radius: var(--r-ctl); }
  .seg::after { display: none; }
  a.seg:hover { background: var(--tide); color: var(--ink); }
  .seg-num {
    display: grid; place-items: center; flex: none; width: 1.75rem; height: 1.75rem; border-radius: 50%;
    border: 2px solid var(--line-strong); font-size: 0.875rem; font-weight: 700; color: var(--slate);
  }
  .seg-num svg { width: 0.875rem; height: 0.875rem; }
  .seg-label { display: block; font-size: 1rem; }
  .seg.is-done .seg-num { background: var(--harbor); border-color: var(--harbor); color: #fff; }
  .seg.is-current { background: var(--tide); font-weight: 700; }
  .seg.is-current .seg-num { border-color: var(--harbor); color: var(--harbor); background: var(--surface); }
  span.seg[aria-disabled="true"] { color: var(--slate); }
  .rail-save { display: block; text-align: left; max-width: none; margin-top: var(--s5); padding: 0 0.75rem; }
  .card { box-shadow: none; }
  .rv-list-wrap { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--s5); }
  .rv-row.wide { grid-column: 1 / -1; }
}

/* ---------- Linear delivery ---------- */

/* The page is one continuous document. Rules and spacing carry hierarchy;
   filled surfaces are reserved for controls, warnings, and confirmed state. */
.step > h1 { max-width: 31rem; }
.step > .sub { margin-bottom: var(--s7); }

.card {
  margin: 0; padding: var(--s6) 0; border: 0; border-top: 1px solid var(--line);
  border-radius: 0; background: transparent;
}
.card + .card { margin-top: 0; }
.card-head { margin-bottom: var(--s4); }

.status-path {
  display: grid; gap: 0; margin: 0 0 var(--s6); border-top: 1px solid var(--line);
}
.status-block { padding: var(--s5) 0; border: 0; border-radius: 0; background: transparent; }
.status-block + .status-block { border-top: 1px solid var(--line); }
.status-goal { background: transparent; }
.status-block h2 { font-size: 1.2rem; max-width: 28rem; }
.status-divider { display: none !important; }

.facts { margin-bottom: var(--s6); }
.facts-list div { padding: var(--s3) 0; }
.services { padding-bottom: var(--s7); }
.ticks { gap: 0; }
.ticks li { padding: var(--s3) 0; border-top: 1px solid var(--line); }
.ticks li:first-child { border-top: 0; }
.ticks li::before { width: 1.6rem; height: 1.6rem; border-radius: 0; background: transparent; color: var(--harbor); }

.price-head { padding: var(--s4) 0; margin: 0; border-radius: 0; background: transparent; }
.money-big { font-size: 2rem; }
.cap { padding: var(--s3) 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: transparent; }

.fallback { border-bottom: 1px solid var(--line); }
.fallback.is-promoted { background: transparent; border-color: var(--brass-line); }
.tiles { gap: 0; border-top: 1px solid var(--line); }
.tile { padding: var(--s4) 0; border: 0; border-radius: 0; background: transparent; }
.tile + .tile { border-top: 1px solid var(--line); }

.xcard { padding: var(--s6) 0; }
.xcard + .xcard { margin-top: 0; }
.xg-legend { font-size: 1.2rem; }

.rv-card { padding: var(--s5) 0; }
.edit-link { min-height: 44px; padding: 0; border: 0; border-radius: 0; }
.print-card .btn { width: auto; }
.payment-card { background: transparent; border-color: var(--line); }
.payment-total { margin-top: var(--s4); }
.payment-options { margin-top: var(--s5); border-top: 1px solid var(--line); }
.payment-option { display: grid; grid-template-columns: 1fr auto; gap: var(--s3) var(--s4); align-items: baseline; padding: var(--s5) 0; }
.payment-option + .payment-option { border-top: 1px solid var(--line); }
.payment-option > div { display: flex; flex-direction: column; }
.payment-option > div > strong { font-size: 1.08rem; }
.payment-option > div > span { color: var(--slate); font-size: 0.92rem; }
.payment-option > .num { font: 700 1.35rem/1 var(--font-display); }
.payment-option .btn { grid-column: 1 / -1; width: 100%; }

@media (min-width: 640px) {
  .status-path { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .status-block { padding: var(--s5) var(--s5) var(--s5) 0; }
  .status-block + .status-block { border-top: 0; border-left: 1px solid var(--line); padding-left: var(--s5); padding-right: 0; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile { padding-right: var(--s5); }
  .tile + .tile { border-top: 0; border-left: 1px solid var(--line); padding-left: var(--s5); padding-right: 0; }
}

/* ---------- Preferences ---------- */

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

@media (forced-colors: active) {
  .opt, .input, .card, .chip, .btn, .tile, .banner, .err-summary { border: 1px solid CanvasText; }
  .opt:has(input:checked) { outline: 2px solid Highlight; }
  .opt-mark { border-color: CanvasText; }
  .opt input:checked + .opt-mark svg { opacity: 1; color: CanvasText; }
  .seal-ring { stroke: CanvasText; }
  .opt input:checked + .seal .seal-inner { fill: Highlight; }
  .opt input:checked + .seal .seal-check { stroke: HighlightText; }
  .seg::after { background: CanvasText; }
  .seg.is-current::after { background: Highlight; }
  select.input { appearance: auto; -webkit-appearance: auto; background-image: none; }
  :focus-visible, .opt:has(input:focus-visible) { outline: 3px solid Highlight; }
}

/* =================================================================== */
/* Print packet: 6 fixed Letter sheets                                  */
/* =================================================================== */

@page { size: Letter; margin: 0.6in; }

@media print {
  :root { color-scheme: light; }
  html, body { background: #fff !important; }
  body { font-size: 10pt; line-height: 1.3; color: #000; }
  body > *:not(#packet) { display: none !important; }

  #packet {
    display: block !important;
    font-family: var(--font-body); font-size: 10pt; line-height: 1.3; color: #000;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  .sheet {
    position: relative; display: flex; flex-direction: column;
    height: 9.7in; overflow: hidden;
    break-after: page; page-break-after: always; break-inside: avoid;
  }
  .sheet:last-child { break-after: auto; page-break-after: auto; }

  .sh-head {
    display: flex; justify-content: space-between; align-items: baseline;
    padding-bottom: 5pt; border-bottom: 1.5pt solid #000; font-size: 9pt;
  }
  .sh-brand { font-family: var(--font-display); font-weight: 700; font-size: 11pt; }
  .sh-title { font-family: var(--font-display); font-weight: 700; font-size: 14pt; margin: 9pt 0 6pt; color: #000; }
  .p-doc-title { font-family: var(--font-display); font-weight: 700; font-size: 20pt; line-height: 1.1; margin: 0 0 3pt; color: #000; }
  .sh-body { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
  .sh-foot { flex: none; margin-top: 6pt; padding-top: 5pt; border-top: 0.75pt solid #000; font-size: 9pt; }

  .sh-body h3 { font-size: 10.5pt; font-weight: 700; margin: 9pt 0 4pt; color: #000; text-transform: uppercase; letter-spacing: 0.04em; }
  .p-meta { font-size: 9pt; margin-bottom: 4pt; }
  .p-strong { font-weight: 700; }
  .num { font-variant-numeric: tabular-nums; }

  .pkv { margin: 0 0 5pt; display: flex; flex-direction: column; gap: 1.5pt; min-width: 0; }
  .pk { font-size: 9pt; font-weight: 700; }
  .pv {
    display: block; min-height: 15pt; padding: 1.5pt 4pt;
    border: 0.75pt solid #000; overflow-wrap: anywhere;
  }
  .pv-long { min-height: calc(var(--lines, 2) * 1.3em + 4pt); }
  .pgrid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 12pt; }
  .pgrid .span2 { grid-column: 1 / -1; }

  .pchoice { display: flex; flex-wrap: wrap; gap: 2pt 14pt; }
  .pc { display: inline-flex; align-items: flex-start; gap: 4pt; }
  .pbox { width: 9pt; height: 9pt; flex: none; margin-top: 1.5pt; }

  .p-facts, .p-table { width: 100%; border-collapse: collapse; margin-bottom: 6pt; }
  .p-facts th, .p-facts td, .p-table th, .p-table td { border: 0.75pt solid #000; padding: 2.5pt 5pt; text-align: left; vertical-align: top; }
  .p-facts th { width: 1.6in; font-weight: 700; font-size: 9pt; }
  .p-table th small { display: block; font-weight: 400; font-size: 9pt; }
  .p-table td.num { text-align: right; white-space: nowrap; }
  .p-compare td.num { text-align: left; }
  .p-total th, .p-total td { font-weight: 700; border-top-width: 1.5pt; }
  .p-cap, .p-later, .p-fine { margin: 3pt 0; }
  .p-fine { font-size: 9pt; }
  .p-list { margin: 0 0 4pt; padding-left: 14pt; }
  .p-list li { margin: 1pt 0; }

  .pgroup { margin-bottom: 6pt; }
  .pg-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8pt; border-bottom: 0.75pt solid #000; padding-bottom: 2pt; margin-bottom: 3pt; }
  .pg-head h3 { margin: 0; }
  .pg-items { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; column-gap: 12pt; row-gap: 1.5pt; font-size: 9pt; line-height: 1.25; }
  .pg-items.one-col { grid-template-columns: 1fr; }
  .pg-items li { display: flex; gap: 5pt; align-items: flex-start; }
  .yn { flex: none; width: 22pt; text-align: center; font-weight: 700; border: 0.75pt solid #000; padding: 0 1pt; min-height: 11pt; line-height: 1.25; }
  .yn-yes { border-width: 1.5pt; }
  .pg-note { margin-top: 3pt; }
  .pg-note .pv-long { font-size: 9pt; line-height: 1.25; min-height: calc(3 * 1.25em + 4pt); }
  .p-result { margin-top: auto; padding: 4pt 6pt; border: 1.5pt solid #000; font-weight: 700; }
  .p-na { padding: 4pt 6pt; border: 0.75pt dashed #000; margin-bottom: 6pt; }

  .p-checks { list-style: none; margin: 0 0 4pt; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 2pt 12pt; }
  .p-checks li { display: flex; gap: 5pt; align-items: flex-start; }

  .p-approve { display: flex; gap: 6pt; align-items: flex-start; border: 1.5pt solid #000; padding: 5pt 6pt; }
  .p-approve .pbox { width: 11pt; height: 11pt; margin-top: 0.5pt; }

  .p-instr { margin: 6pt 0; padding: 4pt 6pt; border: 0.75pt solid #000; }

  /* Signature area: fixed height, pinned to the bottom of sheet 6 so boxes land in the same place every time */
  .sig-area { margin-top: auto; height: 4.6in; display: flex; flex-direction: column; justify-content: flex-end; gap: 14pt; }
  .sig-block { border-top: 1.5pt solid #000; padding-top: 4pt; }
  .sig-area .pv { height: calc(3 * 1.25em + 4pt); font-size: 9pt; line-height: 1.25; overflow: hidden; }
  .sig-block h3 { margin-top: 0; }
  .sig-block .pchoice { flex-direction: column; margin-bottom: 5pt; }
  .sig-row { display: flex; gap: 0.3in; margin-top: 6pt; }
  .sig-cell { display: flex; flex-direction: column; gap: 2pt; }
  .sig-box { width: 3.2in; height: 0.6in; border: 1pt solid #000; }
  .sig-box.date { width: 1.6in; }
  .sig-label { font-size: 9pt; font-weight: 700; }
}
