/* SureCite landing page — draft styles, round 4 (redesign, 28 Sep 2026).

   Direction: "the register". A calm, institutional page set like a well-made
   annual report or statute book: a text serif for headings (Source Serif 4, with
   optical sizing), a sober public-sector sans for everything else (Public Sans),
   cool neutral paper, ink-black primary actions, and one blue used only for
   what is cited or linked. No mono labels, no uppercase, no card grid: structure
   comes from a 12-column grid and hairline rules.

   Tokens are three layers (design-system skill): primitives -> semantic roles ->
   component values. Components use semantic roles only.

   Alignment rules used everywhere:
   - one control height (--control-h, 44px) for every button, field and choice;
   - repeated items (routes, steps, rows) share one structure, so their titles,
     bodies and outcomes sit on the same lines; the three routes use subgrid;
   - nothing is sticky except the site header, and every anchor target clears it
     (scroll-margin-top), so focus is never hidden behind it (WCAG 2.4.11). */

/* ---------- Primitives ---------- */
:root {
  --n-0: #ffffff;
  --n-25: #f5f6f7;
  --n-50: #eceef0;
  --n-100: #dadde1;
  --n-200: #b9bec4;
  --n-500: #5b626b;
  --n-700: #3a4048;
  --n-900: #111418;
  --n-950: #0e1012;
  --n-d0: #131518;
  --n-d1: #1a1d21;
  --n-d2: #202328;
  --n-d3: #2a2e33;
  --n-d4: #3c4249;
  --n-d5: #969da6;
  --n-d6: #c4c8ce;
  --n-d7: #eceef0;

  --blue-700: #2e46a4;
  --blue-100: #e6eafa;
  --blue-300: #a9b8f2;
  --blue-900: #1d2749;

  --f-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --f-sans: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-arabic: "Noto Sans Arabic", "Geeza Pro", "Segoe UI", Tahoma, sans-serif;
}

/* ---------- Semantic roles: light ---------- */
:root {
  --bg: var(--n-25);
  --bg-sunk: var(--n-50);
  --surface: var(--n-0);
  --field: var(--n-0);
  --text: var(--n-900);
  --text-2: var(--n-700);
  --muted: var(--n-500);
  --rule: var(--n-100);
  --rule-strong: var(--n-200);
  --rule-ink: var(--n-900);
  --ink: var(--n-900);
  --ink-hover: #2b3038;
  --on-ink: var(--n-0);
  --accent: var(--blue-700);
  --accent-tint: var(--blue-100);
  --focus: var(--blue-700);
  --law-bg: #e3efe6;   --law-text: #1d5c31;   /* matches the app's law badge */
  --guide-bg: #f4ecd8; --guide-text: #6b4f00;  /* matches the app's guidance badge */
  --danger: #a3261a;
  --danger-tint: #fbeae7;
  /* No soft shadows (28 Sep 2026 polish): panels are held by a firmer hairline. */
  --shadow: none;
  --header-bg: rgba(245, 246, 247, .88);

  /* Video poster is dark in both themes: it stands for a video frame. */
  --video-bg: #16191d;
  --video-text: #eceef0;
  --video-muted: #a2a9b1;

  /* Layout and rhythm */
  --wrap: 1200px;
  --gutter: 16px;
  --col-gap: 24px;
  --sy: clamp(72px, 10vw, 128px);
  --radius-s: 4px;
  --radius: 6px;
  --radius-l: 8px;
  --control-h: 44px;
  --header-h: 64px;
  /* One strong ease-out for every UI transition (Emil Kowalski's rule: never
     ease-in; under 300 ms; exits no slower than entrances). */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --t: 160ms;

  color-scheme: light;
}

/* ---------- Semantic roles: dark (designed, not inverted) ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: var(--n-950);
    --bg-sunk: var(--n-d0);
    --surface: var(--n-d1);
    --field: var(--n-d2);
    --text: var(--n-d7);
    --text-2: var(--n-d6);
    --muted: var(--n-d5);
    --rule: var(--n-d3);
    --rule-strong: var(--n-d4);
    --rule-ink: var(--n-d6);
    --ink: var(--n-d7);
    --ink-hover: #ffffff;
    --on-ink: var(--n-950);
    --accent: var(--blue-300);
    --accent-tint: var(--blue-900);
    --focus: var(--blue-300);
    --law-bg: #16301f;   --law-text: #9ed8ae;
    --guide-bg: #33290f; --guide-text: #ebcb7a;
    --danger: #f2a497;
    --danger-tint: #3a1a16;
    --shadow: none;
    --header-bg: rgba(14, 16, 18, .86);
    --video-bg: #1a1d21;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: var(--n-950);
  --bg-sunk: var(--n-d0);
  --surface: var(--n-d1);
  --field: var(--n-d2);
  --text: var(--n-d7);
  --text-2: var(--n-d6);
  --muted: var(--n-d5);
  --rule: var(--n-d3);
  --rule-strong: var(--n-d4);
  --rule-ink: var(--n-d6);
  --ink: var(--n-d7);
  --ink-hover: #ffffff;
  --on-ink: var(--n-950);
  --accent: var(--blue-300);
  --accent-tint: var(--blue-900);
  --focus: var(--blue-300);
  --law-bg: #16301f;   --law-text: #9ed8ae;
  --guide-bg: #33290f; --guide-text: #ebcb7a;
  --danger: #f2a497;
  --danger-tint: #3a1a16;
  --shadow: none;
  --header-bg: rgba(14, 16, 18, .86);
  --video-bg: #1a1d21;
  color-scheme: dark;
}

@media (min-width: 768px) { :root { --gutter: 32px; --col-gap: 32px; } }
@media (min-width: 1280px) { :root { --gutter: 40px; } }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  /* Colour and opacity changes stay (they aid reading); movement goes: see
     the press rule at the end of this file. */
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--f-sans);
  font-size: 1rem;
  line-height: 1.6;
  font-feature-settings: "kern";
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img, svg { display: block; }
p, h1, h2, h3, h4, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
strong { font-weight: 600; color: var(--text); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--radius-s); }
section[id], [id="limits"] { scroll-margin-top: calc(var(--header-h) + 16px); }

h1, h2, .h3-lg, .route-title, .spec dt, .faq dt, .flow h4, .around-item h4, .numbered h4, .thanks h3, .declined-title {
  font-family: var(--f-serif);
  font-weight: 400;
  color: var(--text);
  font-optical-sizing: auto;
  text-wrap: balance;
}
h1 {
  font-size: clamp(2.5rem, 1.55rem + 3.9vw, 4.5rem);
  line-height: 1.04;
  letter-spacing: -0.024em;
}
h2 {
  font-size: clamp(2rem, 1.55rem + 1.7vw, 2.875rem);
  line-height: 1.1;
  letter-spacing: -0.018em;
}
.h3-lg { font-size: clamp(1.5rem, 1.3rem + .8vw, 1.875rem); line-height: 1.2; letter-spacing: -0.012em; }
p { text-wrap: pretty; }

.wrap { max-width: calc(var(--wrap) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.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;
}
.skip {
  position: absolute; inset-inline-start: 16px; top: -100px; z-index: 100;
  background: var(--ink); color: var(--on-ink); padding: 10px 16px; border-radius: var(--radius);
  text-decoration: none; font-weight: 500;
}
.skip:focus { top: 12px; }

/* ---------- Shared text styles ---------- */
.label { font-size: .875rem; font-weight: 500; color: var(--muted); margin-bottom: 16px; }
.section-lede { font-size: 1.125rem; line-height: 1.6; color: var(--text-2); margin-top: 20px; max-width: 58ch; }
.fine { font-size: .8125rem; line-height: 1.5; color: var(--muted); }
.fine a { color: var(--accent); text-underline-offset: 3px; }
.col-title {
  font-size: 1rem; font-weight: 600; letter-spacing: -0.005em;
  padding-bottom: 12px; border-bottom: 1px solid var(--rule-ink);
}

/* ---------- Buttons and links ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--control-h); padding: 0 20px;
  border: 1px solid transparent; border-radius: var(--radius);
  font: 500 .9375rem/1 var(--f-sans); letter-spacing: 0;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color var(--t) var(--ease-out), border-color var(--t) var(--ease-out), transform 160ms var(--ease-out);
  touch-action: manipulation;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--ink); color: var(--on-ink); }
@media (hover: hover) and (pointer: fine) { .btn-primary:hover { background: var(--ink-hover); } }
.btn-sm { height: 36px; padding: 0 14px; font-size: .875rem; }
.btn-block { width: 100%; }
.text-link {
  display: inline-flex; align-items: center; height: var(--control-h);
  font-weight: 500; font-size: .9375rem; color: var(--text);
  text-decoration: underline; text-decoration-color: var(--rule-strong);
  text-decoration-thickness: 1px; text-underline-offset: 5px;
  transition: text-decoration-color var(--t) var(--ease-out);
}
@media (hover: hover) and (pointer: fine) { .text-link:hover { text-decoration-color: var(--text); } }

.tag {
  display: inline-block; margin-inline-start: 10px; padding: 2px 8px;
  border: 1px solid var(--rule-strong); border-radius: var(--radius-s);
  font-size: .75rem; font-weight: 500; line-height: 1.5; color: var(--text-2);
  vertical-align: 1px;
}
.badge {
  display: inline-block; padding: 3px 7px; border-radius: 3px;
  font-size: .75rem; font-weight: 500; line-height: 1.3; white-space: nowrap;
}
.badge-law { background: var(--law-bg); color: var(--law-text); }
.badge-guide { background: var(--guide-bg); color: var(--guide-text); }
.badge-general { background: var(--bg-sunk); color: var(--text-2); border: 1px solid var(--rule); }

.segmented {
  display: inline-flex; padding: 3px; gap: 2px;
  background: var(--bg-sunk); border: 1px solid var(--rule); border-radius: var(--radius);
}
.segmented button {
  height: 30px; min-width: 24px; padding: 0 12px; border: 0; border-radius: var(--radius-s);
  background: transparent; color: var(--muted); cursor: pointer;
  font: 500 .8125rem/1 var(--f-sans);
  transition: background-color var(--t) var(--ease-out), color var(--t) var(--ease-out);
}
@media (hover: hover) and (pointer: fine) { .segmented button:hover { color: var(--text); } }
.segmented button[aria-selected="true"],
.segmented button[aria-pressed="true"] {
  background: var(--surface); color: var(--text);
  box-shadow: 0 0 0 1px var(--rule-strong);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--rule);
}
@media (prefers-reduced-transparency: reduce) {
  .site-header { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
.header-row { display: flex; align-items: center; gap: 24px; height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: var(--control-h); text-decoration: none; color: var(--text); }
.brand-mark { width: 22px; height: 22px; }
.brand-word { font-family: var(--f-serif); font-size: 1.25rem; font-weight: 500; letter-spacing: -0.01em; }
.nav { margin-inline-start: auto; position: static; }
.nav-list { display: flex; gap: 28px; }
.nav-list a {
  font-size: .875rem; font-weight: 500; color: var(--text-2); text-decoration: none;
  padding: 8px 0; white-space: nowrap; transition: color var(--t) var(--ease-out);
}
/* Six links since round 5: a tighter gap until there is room for the full one. */
@media (min-width: 1024px) and (max-width: 1279px) { .nav-list { gap: 20px; } .header-row { gap: 20px; } }
@media (hover: hover) and (pointer: fine) { .nav-list a:hover { color: var(--text); } }
.nav-toggle {
  display: none; align-items: center; gap: 8px; height: 36px; padding: 0 12px;
  background: transparent; color: var(--text); cursor: pointer;
  border: 1px solid var(--rule-strong); border-radius: var(--radius);
  font: 500 .875rem/1 var(--f-sans);
}
.nav-toggle svg { width: 18px; height: 18px; }
.cta-short { display: none; }

@media (max-width: 1023px) {
  .nav-toggle { display: inline-flex; }
  .nav-list {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--rule);
    padding: 4px var(--gutter) 16px;
  }
  .nav-list.open { display: flex; }
  .nav-list a { display: flex; align-items: center; min-height: 48px; border-bottom: 1px solid var(--rule); font-size: 1rem; }
  .site-header { position: sticky; }
  .header-row { position: static; }
}
@media (max-width: 559px) {
  .header-row { gap: 12px; }
  .cta-long { display: none; }
  .cta-short { display: inline; }
}

/* ---------- Hero ---------- */
.hero { padding-block: clamp(40px, 5vw, 72px) clamp(56px, 7vw, 88px); }
.kicker { font-size: .875rem; font-weight: 500; color: var(--muted); margin-bottom: 28px; }
.hero-grid { display: grid; gap: 32px; }
/* One sentence to a line, so the headline never breaks mid-thought. */
.h1-line { display: block; }
.lede { font-size: 1.125rem; line-height: 1.6; color: var(--text-2); max-width: 52ch; }
/* The companion line (law answers) sits under a hairline: second, not hidden. */
.lede-2 { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--rule); font-size: 1rem; color: var(--text-2); max-width: 52ch; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; margin-top: 28px; }
.hero-side .fine { margin-top: 16px; }
@media (min-width: 1024px) {
  .hero-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--col-gap); align-items: start; }
  .hero-title { grid-column: 1 / span 7; }
  .hero-side { grid-column: 9 / -1; padding-bottom: 6px; }
}

/* Workspace figure: the input bar and the three routes */
.workspace {
  margin-top: clamp(56px, 7vw, 88px);
  background: var(--surface); border: 1px solid var(--rule-strong); border-radius: var(--radius-l);
  box-shadow: var(--shadow);
}
.ws-bar { display: grid; gap: 10px; padding: 16px; border-bottom: 1px solid var(--rule); }
.ws-ask {
  display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 16px;
  background: var(--bg); border: 1px solid var(--rule-strong); border-radius: var(--radius);
  min-height: 52px;
}
.ws-field { flex: 1; min-width: 0; color: var(--muted); font-size: .9375rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-buttons { display: flex; gap: 6px; flex-shrink: 0; }
.ws-btn {
  display: inline-flex; align-items: center; height: 38px; padding: 0 14px;
  border: 1px solid var(--rule-strong); border-radius: var(--radius-s);
  font-size: .875rem; font-weight: 500; color: var(--text); background: var(--surface); white-space: nowrap;
}
.ws-btn-primary { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.ws-upload {
  display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 16px;
  border: 1px dashed var(--rule-strong); border-radius: var(--radius);
  font-size: .875rem; color: var(--muted);
}
.ws-upload-label { font-weight: 500; color: var(--text); }

.routes { display: grid; grid-template-columns: 1fr; }
.route { padding: 24px 20px; display: grid; gap: 10px; align-content: start; }
.route + .route { border-top: 1px solid var(--rule); }
.route-trigger { line-height: 1; }
.key {
  display: inline-block; padding: 5px 9px; border: 1px solid var(--rule-strong); border-bottom-width: 2px;
  border-radius: var(--radius-s); font-size: .8125rem; font-weight: 500; color: var(--text-2);
  background: var(--bg);
}
.route-title { font-size: 1.5rem; line-height: 1.2; letter-spacing: -0.01em; margin-top: 6px; }
.route-body { color: var(--text-2); font-size: .9375rem; }
.route-out { font-weight: 500; font-size: .9375rem; padding-top: 12px; margin-top: 4px; border-top: 1px solid var(--rule); }
.workspace figcaption { padding: 14px 20px; border-top: 1px solid var(--rule); font-size: .8125rem; color: var(--muted); }

@media (min-width: 768px) {
  .ws-bar { padding: 20px; }
  .routes { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: auto auto 1fr auto; }
  .route { grid-row: span 4; grid-template-rows: subgrid; gap: 10px; padding: 28px 24px; }
  .route + .route { border-top: 0; border-inline-start: 1px solid var(--rule); }
  .route-out { align-self: end; }
  .workspace figcaption { padding-inline: 24px; }
}

/* ---------- Sections ---------- */
.section { padding-block: var(--sy) calc(var(--sy) + 8px); }
.section-tight { padding-block: 0 var(--sy); }
.section-sunk { background: var(--bg-sunk); }
.section-head { max-width: 760px; margin-bottom: clamp(40px, 6vw, 64px); }

.split { display: grid; gap: 48px; }
@media (min-width: 1024px) {
  .split { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--col-gap); align-items: start; }
  .split-5-7 > :first-child { grid-column: 1 / span 5; }
  .split-5-7 > :last-child { grid-column: 7 / -1; }
  .split-7-5 > :first-child { grid-column: 1 / span 6; }
  .split-7-5 > :last-child { grid-column: 8 / -1; }
  .split-4-8 > :first-child { grid-column: 1 / span 4; }
  .split-4-8 > :last-child { grid-column: 6 / -1; }
}
/* In "General task" the figure comes first in the source (it is on the left on
   wide screens); on narrow screens the text should lead. */
@media (max-width: 1023px) {
  .split-7-5 > .split-text { order: -1; }
}

.points { margin-top: 40px; border-bottom: 1px solid var(--rule); }
.points li { padding-block: 20px; border-top: 1px solid var(--rule); }
.points h3 { font-size: 1.0625rem; font-weight: 600; line-height: 1.4; letter-spacing: -0.005em; margin-bottom: 6px; }
.points p { color: var(--text-2); font-size: .9375rem; }

/* ---------- Document specimen (law answer, general task) ---------- */
.doc { background: var(--surface); border: 1px solid var(--rule-strong); border-radius: var(--radius-l); box-shadow: var(--shadow); }
.doc-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 56px; padding: 10px 12px 10px 20px; border-bottom: 1px solid var(--rule);
}
.doc-title { font-size: .8125rem; font-weight: 500; color: var(--muted); }
.doc-body { padding: 24px 20px 28px; }
@media (min-width: 768px) { .doc-body { padding: 28px 28px 32px; } }
.doc-q { font-family: var(--f-serif); font-size: 1.1875rem; line-height: 1.45; padding-bottom: 20px; border-bottom: 1px solid var(--rule); }
.doc-q-label { display: block; font-family: var(--f-sans); font-size: .8125rem; font-weight: 500; color: var(--muted); margin-bottom: 6px; }
.panel { padding-top: 20px; }
.doc-a { font-family: var(--f-serif); font-size: 1.125rem; line-height: 1.7; }
.cite {
  font-family: var(--f-sans); font-size: .6875rem; font-weight: 600; color: var(--accent);
  font-variant-numeric: tabular-nums; padding-inline: 1px 2px;
}
.cite-block {
  display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px;
  border: 1px solid currentColor; border-radius: var(--radius-s); font-size: .75rem; padding: 0;
}
.sources { width: 100%; border-collapse: collapse; margin-top: 24px; }
.sources td { padding: 14px 0; border-top: 1px solid var(--rule); vertical-align: top; }
.src-no { width: 36px; }
.src-title { display: block; font-size: .9375rem; font-weight: 500; line-height: 1.4; }
.src-meta { display: block; font-size: .8125rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.src-kind { text-align: end; padding-inline-start: 12px !important; }
.declined { border-top: 2px solid var(--rule-ink); padding-top: 16px; }
.declined-title { font-size: 1.3125rem; line-height: 1.3; margin-bottom: 8px; }
.declined p:last-child { color: var(--text-2); font-size: .9375rem; }
.doc figcaption { padding: 12px 20px; border-top: 1px solid var(--rule); font-size: .8125rem; color: var(--muted); }
@media (min-width: 768px) { .doc figcaption { padding-inline: 28px; } .doc-head { padding-inline-start: 28px; } }

.gt-request { font-family: var(--f-serif); font-size: 1.125rem; line-height: 1.55; }
.gt-preview { margin-block: 20px; padding: 16px; background: var(--bg); border: 1px solid var(--rule); border-radius: var(--radius); }
.gt-preview-text { font-size: .9375rem; line-height: 1.65; }
mark.ph { background: var(--accent-tint); color: var(--accent); border-radius: 3px; padding: 1px 4px; font-weight: 500; }
.gt-reply { display: grid; gap: 10px; justify-items: start; padding-top: 20px; border-top: 1px solid var(--rule); }
.gt-reply p { color: var(--text-2); font-size: .9375rem; }

/* ---------- Spec rows (definition list) ---------- */
.spec { margin-top: clamp(64px, 8vw, 96px); border-bottom: 1px solid var(--rule); }
.spec-row { display: grid; gap: 8px; padding-block: 24px; border-top: 1px solid var(--rule); }
.spec dt { font-size: 1.25rem; line-height: 1.35; }
.spec dd { color: var(--text-2); max-width: 64ch; }
@media (min-width: 768px) {
  .spec-row { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--col-gap); padding-block: 28px; }
  .spec dt { grid-column: 1 / span 4; }
  .spec dd { grid-column: 6 / -1; }
}

/* ---------- Supplier bills (round 5) ---------- */
/* Review-queue specimen: groups under an ink rule, rows under hairlines, the
   amount on the right in tabular figures, the reason on its own line. */
.q-keys { display: inline-flex; align-items: center; gap: 6px; font-size: .8125rem; color: var(--muted); white-space: nowrap; }
.q-keys .key { padding: 2px 7px; font-size: .75rem; }
.q-keys .key:not(:first-child) { margin-inline-start: 6px; }
@media (max-width: 479px) { .q-keys { display: none; } }
.q-body { padding: 4px 20px 20px; }
@media (min-width: 768px) { .q-body { padding: 8px 28px 24px; } }
.q-group {
  padding: 18px 0 10px; border-bottom: 1px solid var(--rule-ink);
  font-size: .8125rem; font-weight: 600; color: var(--text);
}
.q-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 16px;
  padding-block: 14px; border-bottom: 1px solid var(--rule);
}
.q-list:last-child .q-row:last-child { border-bottom: 0; padding-bottom: 0; }
.q-main { display: grid; gap: 2px; min-width: 0; }
.q-supplier { font-size: .9375rem; font-weight: 500; line-height: 1.4; color: var(--text); }
.q-meta { font-size: .8125rem; color: var(--muted); }
.q-amt { font-size: .9375rem; font-weight: 500; line-height: 1.4; text-align: end; font-variant-numeric: tabular-nums lining-nums; white-space: nowrap; }
.q-why { grid-column: 1 / -1; font-size: .875rem; line-height: 1.5; color: var(--text-2); }
.q-acct { display: block; font-weight: 500; color: var(--text); }

/* How a bill moves: a ruled register, number and title beside the body. */
.flow-block, .around { margin-top: clamp(64px, 8vw, 96px); }
.flow { margin-top: 24px; border-top: 1px solid var(--rule-ink); }
.flow-row {
  display: grid; grid-template-columns: 36px minmax(0, 1fr); column-gap: 8px;
  padding-block: 20px; border-bottom: 1px solid var(--rule);
}
.flow-no {
  grid-row: 1 / span 2; font-family: var(--f-serif); font-size: 1.1875rem; line-height: 1.35;
  color: var(--muted); font-variant-numeric: tabular-nums lining-nums;
}
.flow h4 { font-size: 1.1875rem; line-height: 1.35; letter-spacing: -0.005em; margin-bottom: 6px; }
.flow p { color: var(--text-2); font-size: .9375rem; max-width: 64ch; }
.flow-row-next h4, .flow-row-next p { color: var(--muted); }
@media (min-width: 768px) {
  .flow-row { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--col-gap); padding-block: 24px; }
  .flow-no { grid-column: 1; grid-row: auto; }
  .flow h4 { grid-column: 2 / span 4; margin-bottom: 0; }
  .flow p { grid-column: 6 / -1; }
}

/* Around the queue: three ruled columns on wide screens. */
.around-grid { display: grid; gap: 0 var(--col-gap); margin-top: 24px; }
.around-item { padding-block: 20px 28px; border-top: 1px solid var(--rule-ink); }
.around-item h4 { font-size: 1.375rem; line-height: 1.25; letter-spacing: -0.01em; margin-bottom: 10px; }
.around-item p { color: var(--text-2); font-size: .9375rem; }
@media (min-width: 1024px) { .around-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ---------- E-invoicing ---------- */
.einv-grid { display: grid; gap: 48px; }
@media (min-width: 1024px) {
  .einv-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--col-gap); }
  .einv-dates { grid-column: 1 / span 7; }
  .einv-notes { grid-column: 9 / -1; }
}
.dates { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.dates caption { text-align: start; font-size: .875rem; font-weight: 500; color: var(--muted); padding-bottom: 12px; }
.dates th { text-align: start; font-size: .8125rem; font-weight: 500; color: var(--muted); padding: 0 16px 10px 0; border-bottom: 1px solid var(--rule-ink); }
.dates td { padding: 16px 16px 16px 0; border-bottom: 1px solid var(--rule); vertical-align: top; color: var(--text-2); }
.dates td:first-child { white-space: nowrap; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums lining-nums; }
.dates td:nth-child(2) { font-weight: 500; color: var(--text); width: 30%; }
.dates th:last-child, .dates td:last-child { padding-inline-end: 0; }
.einv-dates .fine { margin-top: 16px; }
@media (max-width: 639px) {
  .dates thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .dates tbody { display: block; border-top: 1px solid var(--rule-ink); }
  .dates tr { display: grid; gap: 4px; padding-block: 16px; border-bottom: 1px solid var(--rule); }
  .dates td { display: block; padding: 0; border: 0; width: auto !important; }
}
.note { padding-top: 16px; border-top: 1px solid var(--rule); }
.note + .note { margin-top: 32px; }
.note-strong { border-top: 2px solid var(--rule-ink); }
.note h4 { font-size: 1rem; font-weight: 600; margin-bottom: 8px; }
.note p { color: var(--text-2); font-size: .9375rem; }

/* ---------- Testing and limits ---------- */
.two-col { display: grid; gap: 56px; }
@media (min-width: 1024px) {
  .two-col { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--col-gap); }
  .two-col > :first-child { grid-column: 1 / span 6; }
  .two-col > :last-child { grid-column: 8 / -1; }
}
.numbered { counter-reset: n; }
.numbered li {
  counter-increment: n; display: grid; grid-template-columns: 36px 1fr; column-gap: 8px;
  padding-block: 20px; border-bottom: 1px solid var(--rule);
}
.numbered li::before {
  content: counter(n); grid-row: 1 / span 2; font-family: var(--f-serif); font-size: 1.1875rem;
  line-height: 1.35; color: var(--muted); font-variant-numeric: tabular-nums lining-nums;
}
.numbered h4 { font-size: 1.1875rem; line-height: 1.35; letter-spacing: -0.005em; margin-bottom: 6px; }
.numbered p { color: var(--text-2); font-size: .9375rem; }
.limits li { padding-block: 14px; border-bottom: 1px solid var(--rule); color: var(--text-2); font-size: .9375rem; }

/* ---------- FAQ ---------- */
.faq { border-bottom: 1px solid var(--rule); }
.faq-item { padding-block: 24px; border-top: 1px solid var(--rule); }
.faq dt { font-size: 1.25rem; line-height: 1.35; letter-spacing: -0.005em; margin-bottom: 8px; }
.faq dd { color: var(--text-2); max-width: 62ch; }

/* ---------- Early access ---------- */
.status { display: grid; gap: 32px; margin-top: 40px; }
@media (min-width: 640px) and (max-width: 1023px) { .status { grid-template-columns: 1fr 1fr; gap: var(--col-gap); } }
.status-col > p { font-size: .9375rem; color: var(--text-2); margin-top: 12px; }
.plain-list { margin-top: 4px; }
.plain-list li { padding-block: 10px; border-bottom: 1px solid var(--rule); font-size: .9375rem; color: var(--text-2); }
.status-col > p + .plain-list { margin-top: 0; }

.form-panel { background: var(--surface); border: 1px solid var(--rule-strong); border-radius: var(--radius-l); padding: 24px 20px; box-shadow: var(--shadow); }
@media (min-width: 768px) { .form-panel { padding: 36px 36px 32px; } }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.form-group + .form-group { margin-top: 36px; }
.group-title {
  display: block; width: 100%; padding: 0 0 12px; margin-bottom: 20px;
  font-size: 1rem; font-weight: 600; border-bottom: 1px solid var(--rule-ink);
}
.field { margin-bottom: 20px; }
.field-row { display: grid; gap: 0 16px; }
@media (min-width: 560px) { .field-row { grid-template-columns: 1fr 1fr; } }
.field label, .field > legend { display: block; font-size: .875rem; font-weight: 500; margin-bottom: 6px; color: var(--text); }
.req { color: var(--danger); }
.opt { color: var(--muted); font-weight: 400; }
input[type="text"], input[type="email"], select, textarea {
  width: 100%; min-height: var(--control-h); padding: 0 12px;
  font: 400 1rem/1.4 var(--f-sans); color: var(--text);
  background: var(--field); border: 1px solid var(--rule-strong); border-radius: var(--radius);
  transition: border-color var(--t) var(--ease-out), box-shadow var(--t) var(--ease-out);
}
textarea { padding: 10px 12px; resize: vertical; min-height: 96px; }
select {
  appearance: none; -webkit-appearance: none; padding-inline-end: 36px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}
@media (hover: hover) and (pointer: fine) { input:hover, select:hover, textarea:hover { border-color: var(--muted); } }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 0; border-color: var(--focus); }
[aria-invalid="true"] { border-color: var(--danger) !important; }
.field-err { color: var(--danger); font-size: .8125rem; margin-top: 6px; }
.choices { display: grid; gap: 8px; }
.choice {
  display: flex !important; align-items: center; gap: 12px; min-height: var(--control-h); padding: 8px 14px;
  margin: 0 !important; font-weight: 400 !important; font-size: .9375rem !important;
  border: 1px solid var(--rule-strong); border-radius: var(--radius); background: var(--field); cursor: pointer;
  transition: border-color var(--t) var(--ease-out);
}
@media (hover: hover) and (pointer: fine) { .choice:hover { border-color: var(--muted); } }
.choice:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.choice input { width: 18px; height: 18px; margin: 0; flex-shrink: 0; accent-color: var(--ink); }
.error-summary {
  margin-bottom: 28px; padding: 16px; border: 1px solid var(--danger); border-radius: var(--radius);
  background: var(--danger-tint); color: var(--text);
}
.error-summary p { font-weight: 600; margin-bottom: 6px; }
.error-summary li { font-size: .9375rem; }
.error-summary a { color: var(--danger); text-underline-offset: 3px; }
.form-fine { margin-top: 14px; }

.thanks h3 { font-size: 1.875rem; line-height: 1.2; letter-spacing: -0.015em; margin-bottom: 10px; }
.thanks [role="status"] p { color: var(--text-2); }
.thanks .video-slot { margin-top: 28px; }
.draft-note { margin-top: 20px; font-size: .8125rem; color: var(--muted); padding-top: 14px; border-top: 1px solid var(--rule); }

/* ---------- Video slot ---------- */
.video-poster {
  position: relative; aspect-ratio: 16 / 9; width: 100%;
  background: var(--video-bg); border-radius: var(--radius-l); overflow: hidden;
  border: 1px solid var(--rule);
}
.poster-art { position: absolute; inset-inline-start: clamp(20px, 4vw, 48px); bottom: clamp(20px, 4vw, 44px); display: grid; gap: 6px; max-width: 80%; }
.poster-title { font-family: var(--f-serif); font-size: clamp(1.375rem, 1rem + 2vw, 2.5rem); line-height: 1.1; letter-spacing: -0.015em; color: var(--video-text); }
.poster-sub { font-size: clamp(.8125rem, .75rem + .3vw, .9375rem); color: var(--video-muted); }
.play {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: clamp(56px, 7vw, 76px); height: clamp(56px, 7vw, 76px); border-radius: 50%;
  display: grid; place-items: center; padding: 0;
  background: rgba(255, 255, 255, .08); color: var(--video-text);
  border: 1px solid rgba(255, 255, 255, .28); cursor: not-allowed;
}
.play svg { width: 40%; height: 40%; margin-inline-start: 6%; opacity: .7; }
.video-slot figcaption { margin-top: 12px; font-size: .8125rem; color: var(--muted); }
.video-slot-sm .poster-title { font-size: 1.25rem; }
.video-slot-sm .play { width: 52px; height: 52px; top: 42%; }
.video-el { width: 100%; height: auto; border-radius: var(--radius-l); background: var(--video-bg); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--rule); padding-block: 48px 40px; font-size: .875rem; color: var(--text-2); }
.footer-grid { display: grid; gap: 28px; }
.footer-brand p { margin-top: 12px; max-width: 40ch; }
.footer-legal p + p { margin-top: 12px; }
.footer-legal a { color: var(--accent); text-underline-offset: 3px; }
.ar { font-family: var(--f-arabic); font-size: .9375rem; }
.footer-meta { display: grid; gap: 16px; align-content: start; color: var(--muted); }
.theme-switch { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.theme-switch-label { font-weight: 500; color: var(--text-2); }
@media (min-width: 1024px) {
  .footer-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--col-gap); }
  .footer-brand { grid-column: 1 / span 4; }
  .footer-legal { grid-column: 6 / span 4; }
  .footer-meta { grid-column: 10 / -1; }
}

@media (prefers-contrast: more) {
  :root { --rule: var(--n-200); --muted: var(--n-700); }
}
@media print {
  .site-header, .nav-toggle, .form-panel, .video-slot { display: none; }
}

/* Walkthrough on wide screens: the frame on nine columns, its caption beside it. */
@media (min-width: 1024px) {
  #walkthrough .video-slot { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--col-gap); align-items: start; }
  #walkthrough .video-poster { grid-column: 1 / span 9; }
  #walkthrough figcaption { grid-column: 10 / -1; margin: 0; font-size: .875rem; color: var(--text-2); }
}
/* The first note starts on the same line as the table caption beside it. */
.einv-notes .note:first-child { border-top: 0; padding-top: 0; }

/* Narrow screens: the input bar wraps, buttons under the field. */
.ws-bar > * { min-width: 0; }
@media (max-width: 479px) {
  .ws-ask { flex-wrap: wrap; padding: 10px; }
  .ws-field { flex-basis: 100%; padding: 4px 4px 2px; }
  .ws-buttons { width: 100%; }
  .ws-btn { flex: 1; justify-content: center; }
  .ws-upload { flex-wrap: wrap; gap: 4px 12px; padding-block: 10px; }
}
legend { padding: 0; }
@media (min-width: 1024px) { .ws-bar { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); } }

/* ---------- Polish, 28 Sep 2026 ----------
   Touch targets (WCAG 2.5.8; 44 px is the house floor): the small header
   buttons and the segmented controls keep their drawn size but get an
   invisible hit area 44 px tall, so nothing on the page moves. */
.btn-sm, .nav-toggle, .segmented button { position: relative; }
.btn-sm::after, .nav-toggle::after { content: ""; position: absolute; inset: -4px 0; }
.segmented button::after { content: ""; position: absolute; inset: -7px 0; }

/* Reduced motion: a pressed button no longer shrinks (colour still changes). */
@media (prefers-reduced-motion: reduce) {
  .btn:active { transform: none; }
}

/* ---------- Privacy policy page (site/privacy.html) ----------
   Plain prose sections in the same rhythm as the landing page (.section /
   .section-sunk, .label + h2 + .section-lede), capped to a readable
   measure. No new colour or type tokens -- everything below is the same
   primitives, so light/dark and phone width come for free. */
.policy-hero { padding-block: clamp(56px, 9vw, 96px) clamp(32px, 5vw, 48px); }
.policy-updated { margin-top: 20px; }
.policy-prose { max-width: 68ch; margin-top: 28px; }
.policy-prose > * + * { margin-top: 16px; }
.policy-prose p { color: var(--text-2); }
.policy-prose ul, .policy-prose ol { padding-inline-start: 1.25em; }
.policy-prose ul { list-style: disc; }
.policy-prose ol { list-style: decimal; }
.policy-prose li + li { margin-top: 8px; }
.policy-prose li { color: var(--text-2); }
.policy-prose a { color: var(--accent); text-underline-offset: 3px; }
.policy-prose h3 {
  font-family: var(--f-sans); font-weight: 600; color: var(--text);
  font-size: 1rem; letter-spacing: -0.005em; margin-top: 28px;
}
.policy-flag {
  margin-top: 28px; padding: 16px 18px; border: 1px solid var(--rule-strong);
  border-radius: var(--radius); background: var(--bg-sunk); font-size: .9375rem;
}
.policy-flag p { color: var(--text-2); }
.policy-flag strong { color: var(--text); }
