/* app.css — the one stylesheet of every owner page and page() message (ADR 0037): ds-core dark values
   (ourfairground packages/ds-core/src/tokens/dark.json, apps/fairground/src/styles/index.css, whose --space-* scale
   this copies), Inter served from /assets, no build step, no script. Every colour, size and spacing is a token in
   :root. Buttons: <button> is primary; a link that looks like one is a.btn; modifiers .btn-ghost (secondary,
   reversible), .btn-danger (destructive: remove, archive, void, revoke, decline), .btn-sm (tables). Layout: .actions
   (a row of buttons), .form-row (fields side by side), .stack (vertical rhythm), .field (label + control + hint),
   .back. Status: .badge .badge-<tone> (badges.go). What bites: pageCSP has no 'unsafe-inline', so no style= or <style>
   anywhere in a page; css_classes_test.go fails on a class a template uses that no rule here defines, and on a rule's
   class nothing uses. The last section is fg719's site layer
   (ADR 0062, site.go): the ourfairground lander's hero type (apps/lander/src/landing.css), a 1120px measure, cards
   and buttons as above; it adds sizes, never a colour. Breakpoints (custom properties cannot sit in a media query, so
   the numbers repeat): 640px (phones: one gutter), 900/901px (drawers below; the rail and a static pane from 901),
   1199/1200px (the decision's pane beside it from 1200). Spacing: --gutter is main's inline padding, --card-pad a
   card's, --bleed how far a full-width band inside a card reaches (to the card's edge; on phones to the screen's). */
@font-face {
  font-family: "Inter";
  src: url("/assets/InterVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  --bg: #000000;
  --bg-canvas: #050507;
  --surface: #0c0c10;
  --surface-hover: rgba(255, 255, 255, 0.03);
  --header-bg: rgba(5, 5, 7, 0.85);
  --scrim: rgba(0, 0, 0, 0.5);
  --border: rgba(255, 255, 255, 0.06);
  --border-strong: rgba(255, 255, 255, 0.12);
  --border-hover: rgba(255, 255, 255, 0.24);
  --border-focus: rgba(255, 255, 255, 0.28);
  --text: #f0f0f4;
  --text-secondary: #7a7a8a;
  --text-muted: #4a4a5a;
  --text-on-brand: #050507;
  --color-error: #f87171;
  --color-success-subtle: #34d399;
  --color-warning-amber: #fbbf24;
  --color-info: #60a5fa;
  --color-error-bg: rgba(248, 113, 113, 0.1);
  --color-error-bg-hover: rgba(248, 113, 113, 0.16);
  --color-error-border: rgba(248, 113, 113, 0.3);
  --color-warning-bg: rgba(245, 158, 11, 0.1);
  --color-warning-border: rgba(245, 158, 11, 0.3);
  --pill-urgent-bg: rgba(248, 113, 113, 0.12);
  --pill-watch-bg: rgba(251, 191, 36, 0.12);
  --pill-clear-bg: rgba(52, 211, 153, 0.12);
  --pill-info-bg: rgba(96, 165, 250, 0.12);
  --pill-subtle-bg: rgba(255, 255, 255, 0.06);
  --radius: 6px;
  --radius-pill: 999px;
  --font-sans: "Inter", -apple-system, "Segoe UI", sans-serif;
  --font-mono: "SF Mono", "Fira Code", ui-monospace, monospace;
  --text-2xs: 0.6875rem;
  --text-xs: 0.75rem;
  --text-sm: 0.8125rem;
  --text-base: 0.875rem;
  --text-xl: 1.375rem;
  --text-2xl: 1.75rem;
  --text-lede: 0.9375rem;
  --text-hero: clamp(1.5rem, 4vw, 2.5rem);
  --tracking-heading: -0.02em;
  --tracking-hero: -0.035em;
  --tracking-pill: 0.02em;
  --tracking-th: 0.05em;
  --tracking-label: 0.06em;
  --tracking-label-lg: 0.08em;
  --duration: 150ms;
  --blur: 16px;
  --header-height: 56px;
  --logo-height: 24px;
  --control-height: 36px;
  --control-height-sm: 28px;
  --touch-target: 44px;
  --decision-bar-reserve: 18rem; /* about the collapsed decision bar's height on a phone: focus scrolls above it */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --gutter: var(--space-6);
  --card-pad: var(--space-6);
  --bleed: var(--card-pad);
  --measure-site: 70rem;
  font-family: var(--font-sans);
  line-height: 1.5;
  font-weight: 400;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; background: var(--bg-canvas); color: var(--text); font-size: var(--text-base); }
main { width: 100%; min-width: 0; max-width: 64rem; margin: 0 auto; overflow-wrap: anywhere;
  padding: var(--space-8) max(var(--gutter), env(safe-area-inset-right)) var(--space-16) max(var(--gutter), env(safe-area-inset-left)); }
body.wide main { max-width: 72rem; }
body.narrow main { max-width: 44rem; }
a { color: var(--text); text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--text); }
h1 { font-size: var(--text-2xl); font-weight: 600; letter-spacing: var(--tracking-heading); line-height: 1.2; margin: 0 0 var(--space-5); }
h2 { font-size: var(--text-xs); font-weight: 600; text-transform: uppercase; letter-spacing: var(--tracking-label);
  color: var(--text-secondary); margin: var(--space-10) 0 var(--space-3); }
h3 { font-size: var(--text-sm); font-weight: 600; color: var(--text); margin: var(--space-6) 0 var(--space-2); }
p { margin: 0 0 var(--space-3); }
strong { font-weight: 600; }

/* The shell: below 901px a sticky top bar (Menu, brand, page actions) whose Menu opens #site-menu as a left drawer;
   from 901px the same element is the rail. */
.app-shell { min-height: 100dvh; }
.page-content { min-width: 0; }
header.site { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: var(--space-3);
  min-height: var(--header-height);
  padding: env(safe-area-inset-top) max(var(--gutter), env(safe-area-inset-right)) 0 max(var(--gutter), env(safe-area-inset-left));
  border-bottom: 1px solid var(--border); background: var(--header-bg); backdrop-filter: blur(var(--blur)); }
header.site .brand { display: inline-flex; align-items: center; text-decoration: none; }
header.site .brand img, .site-brand img { display: block; height: var(--logo-height); width: auto; opacity: 0.92; }
.header-actions { margin-left: auto; display: flex; gap: var(--space-2); }
html { scroll-padding-top: calc(var(--header-height) + var(--space-2)); } /* anchors land below the sticky bar */
/* A drawer (ADR 0072): a popover (light dismiss, Esc, focus return, no script) on one side, below 901px only.
   Closed, the UA's [popover]:not(:popover-open) { display: none } hides it: never set display outside :popover-open.
   Its geometry sits on the closed state too, so the exit slides the drawer itself, not the UA's default popover box.
   Consumers: .site-menu (drawer-start; the rail from 901px) and .pane (drawer-end; static from 901px), whose 901px
   rules reset all of it. */
.drawer { flex-direction: column; gap: var(--space-4); position: fixed; inset: 0; margin: 0; width: min(22rem, 88vw);
  height: 100dvh; max-height: none; border: 0; background: var(--surface); color: var(--text); overflow-y: auto;
  overscroll-behavior: contain;
  padding: max(var(--space-4), env(safe-area-inset-top)) max(var(--space-4), env(safe-area-inset-right))
    max(var(--space-4), env(safe-area-inset-bottom)) max(var(--space-4), env(safe-area-inset-left));
  transition: translate var(--duration), display var(--duration) allow-discrete, overlay var(--duration) allow-discrete; }
.drawer:popover-open { display: flex; translate: 0; }
.drawer-start { inset: 0 auto 0 0; border-right: 1px solid var(--border); translate: -100% 0; }
@starting-style { .drawer-start:popover-open { translate: -100% 0; } }
.drawer::backdrop { background: var(--scrim); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.drawer-title { margin: 0; font-size: var(--text-base); font-weight: 600; color: var(--text); text-transform: none;
  letter-spacing: normal; }
@media (prefers-reduced-motion: reduce) { .drawer { transition: none; } }
.task-nav, .settings-nav { display: grid; gap: var(--space-3); }
.nav-section { min-width: 0; }
.section-label { margin: 0 0 var(--space-1); padding: 0 var(--space-3); font-size: var(--text-2xs); font-weight: 600;
  text-transform: uppercase; letter-spacing: var(--tracking-label-lg); color: var(--text-secondary); }
.section-children { list-style: none; margin: 0; padding: 0; }
.section-children a { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-2);
  padding: 5px var(--space-3); border-radius: var(--radius); color: var(--text-secondary); text-decoration: none;
  font-size: var(--text-sm); font-weight: 500; }
.section-children a:hover { color: var(--text); background: var(--surface-hover); }
.section-children a[aria-current="page"] { color: var(--text); background: var(--pill-subtle-bg); }
.nav-count { font-variant-numeric: tabular-nums; font-size: var(--text-xs); }
.sidebar-bottom { margin-top: var(--space-6); }
.account { padding: var(--space-3) var(--space-3) 0; margin-top: var(--space-3); border-top: 1px solid var(--border); }
.account-label { margin: 0 0 var(--space-1); color: var(--text-secondary); font-size: var(--text-xs); }
.account-name { font-weight: 500; margin: 0; }
.account-email { color: var(--text-secondary); font-size: var(--text-xs); overflow-wrap: anywhere; margin: 0 0 var(--space-2); }
.account-actions { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); white-space: nowrap; }
.account-actions a { font-size: var(--text-sm); color: var(--text-secondary); }
.account-actions a[aria-current="page"] { color: var(--text); text-decoration-color: var(--text); }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-6);
  color: var(--text-secondary); font-size: var(--text-sm); }
.breadcrumbs > * + *::before { content: "/"; display: inline-block; margin-right: var(--space-2); color: var(--text-muted); }
.breadcrumbs a { color: var(--text-secondary); }
.skip-link { position: fixed; top: var(--space-2); left: var(--space-2); z-index: 200;
  transform: translateY(-200%); padding: var(--space-3); background: var(--text); color: var(--bg-canvas); }
.skip-link:focus { transform: none; }
nav.filters a { font-size: var(--text-sm); color: var(--text-secondary); text-decoration: none;
  padding: 6px 0; border-bottom: 1px solid transparent; }
nav.filters a:hover { color: var(--text); }
nav.filters a[aria-current="page"] { color: var(--text); border-bottom-color: var(--text); }
@media (min-width: 901px) {
  .menu-button, .header-actions, .drawer:not(:popover-open) > .drawer-head { display: none; }
  .has-navigation { display: grid; grid-template-columns: 224px minmax(0, 1fr); }
  .has-navigation header.site { align-self: start; height: 100dvh; overflow-y: auto; flex-direction: column;
    align-items: stretch; gap: var(--space-4); border-bottom: 0;
    padding: var(--space-4) var(--space-4) var(--space-4) max(var(--space-4), env(safe-area-inset-left));
    border-right: 1px solid var(--border); background: var(--surface); backdrop-filter: none; }
  .site-menu { display: flex; flex-direction: column; flex: 1; position: static; inset: auto; width: auto; height: auto;
    margin: 0; padding: 0; border: 0; background: none; color: inherit; overflow: visible; translate: none;
    transition: none; }
  .sidebar-bottom { margin-top: auto; padding-top: var(--space-4); }
  html { scroll-padding-top: 0; }
}
nav.filters { display: flex; flex-wrap: wrap; gap: var(--space-4); margin: 0 0 var(--space-4); border-bottom: 1px solid var(--border); }

/* Buttons: <button> and a.btn are primary (white, near-black text). */
button, .btn { display: inline-flex; align-items: center; justify-content: center;
  height: var(--control-height); padding: 0 var(--space-4); font: inherit; font-size: var(--text-sm); font-weight: 500;
  color: var(--text-on-brand); background: var(--text); border: 1px solid transparent; border-radius: var(--radius);
  cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: opacity var(--duration), color var(--duration), border-color var(--duration); }
button:hover, .btn:hover { opacity: 0.85; }
button:focus-visible, .btn:focus-visible, a:focus-visible {
  outline: 2px solid var(--border-focus); outline-offset: 2px; }
summary:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; }
.btn-ghost { color: var(--text-secondary); background: transparent; border-color: var(--border-strong); }
.btn-ghost:hover { opacity: 1; color: var(--text); border-color: var(--border-hover); }
.btn-danger { color: var(--color-error); background: var(--color-error-bg); border-color: var(--color-error-border); }
.btn-danger:hover { opacity: 1; background: var(--color-error-bg-hover); }
.btn-sm, td :is(button, .btn) { height: var(--control-height-sm); padding: 0 var(--space-3);
  font-size: var(--text-xs); }
form.inline { display: inline; }
td form.inline { margin-right: var(--space-2); }

/* Layout: a row of actions, fields side by side, vertical rhythm, one field, the back link. Rows align on their
   bottom edge, so a button sits level with a labelled field beside it. */
.actions { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-2); margin: var(--space-4) 0; }
.actions :is(button, .btn) { margin: 0; }
.form-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-3); margin: var(--space-4) 0; }
.form-row > .field { margin-bottom: 0; }
td .form-row, .actions > .form-row { margin: 0; }
.stack > * + * { margin-top: var(--space-4); }
.field { display: flex; flex-direction: column; gap: var(--space-1); margin: 0 0 var(--space-4); }
.field label { margin: 0; }
.back { margin: 0 0 var(--space-4); font-size: var(--text-sm); }

/* Labels: uppercase, tracked, small. Inputs: 13px, dark field, strong border. */
label { display: block; margin: var(--space-4) 0 0.375rem; font-size: var(--text-2xs); font-weight: 600; text-transform: uppercase;
  letter-spacing: var(--tracking-label-lg); color: var(--text-secondary); }
.inline-check, .inline-check label { display: inline-flex; align-items: center; gap: 0.375rem; margin: 0 var(--space-3) 0 0;
  font-size: var(--text-sm); font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--text); }
input, select, textarea { font: inherit; font-size: var(--text-sm); color: var(--text); background: var(--bg);
  border: 1px solid var(--border-strong); border-radius: var(--radius); padding: var(--space-2) var(--space-3); outline: none;
  transition: border-color var(--duration); }
input:focus, select:focus, textarea:focus { border-color: var(--border-focus); }
form > input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]), form > select, form > textarea {
  width: 100%; max-width: 32rem; }
textarea { width: 100%; resize: vertical; line-height: 1.5; }
form > textarea { max-width: none; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--text); width: 1rem; height: 1rem; padding: 0; margin: 0; }
input[type="file"] { padding: 0.375rem; }
td input, td select { padding: var(--space-1) var(--space-2); }
::placeholder { color: var(--text-muted); }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: var(--space-3) var(--space-4); margin: var(--space-4) 0; }
legend { padding: 0 var(--space-1); font-size: var(--text-2xs); font-weight: 600; text-transform: uppercase;
  letter-spacing: var(--tracking-label-lg); color: var(--text-secondary); }

/* Tables: the admin-table look; .table-wrap is its card. */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow-x: auto; margin: 0 0 var(--space-4); }
table { width: 100%; border-collapse: collapse; font-size: var(--text-base); }
th { padding: 0.625rem var(--space-4); text-align: left; vertical-align: bottom; font-size: var(--text-xs); font-weight: 600;
  text-transform: uppercase; letter-spacing: var(--tracking-th); color: var(--text-secondary); border-bottom: 1px solid var(--border); }
td { padding: var(--space-3) var(--space-4); text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); color: var(--text); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--surface-hover); }
tfoot th, tfoot td { border-top: 1px solid var(--border); border-bottom: none; }

/* Cards, definition lists, code. */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: var(--space-5) var(--card-pad); margin: 0 0 var(--space-4); }
.card > h2:first-child { margin-top: 0; }
dl { display: grid; grid-template-columns: minmax(8rem, max-content) 1fr; gap: var(--space-2) var(--space-6); margin: 0 0 var(--space-4); }
dt { font-size: var(--text-2xs); font-weight: 600; text-transform: uppercase; letter-spacing: var(--tracking-label-lg);
  color: var(--text-secondary); padding-top: 0.15rem; }
dd { margin: 0; }
pre, code { font-family: var(--font-mono); font-size: var(--text-xs); }
pre { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--space-3) var(--space-4);
  overflow: auto; white-space: pre-wrap; }
code { display: block; word-break: break-all; background: var(--bg); border: 1px solid var(--border-strong);
  border-radius: var(--radius); padding: var(--space-3) var(--space-4); margin: var(--space-3) 0; }
ul { padding-left: var(--space-5); }

/* Reading text: a proposal's title (a p, or a round item's h2, so it resets the h2 label look) and its plain text laid
   out as prose (prose.go). Details fold what most readers skip. */
.title { font-size: 1.125rem; font-weight: 600; line-height: 1.35; margin: 0 0 var(--space-4); color: var(--text);
  text-transform: none; letter-spacing: normal; }
.prose { font-size: var(--text-base); line-height: 1.6; margin: 0 0 var(--space-5); }
.prose h3:first-child { margin-top: 0; }
.prose ul, .prose ol { margin: 0 0 var(--space-3); padding-left: var(--space-5); }
.prose li { margin: 0 0 var(--space-1); }
/* Full document reader and approval evidence: no script, no embedded images. */
.document-header { margin-bottom: var(--space-8); padding-bottom: var(--space-4); border-bottom: 1px solid var(--border); }
.document-filename { font-size: var(--text-xs); overflow-wrap: anywhere; margin: var(--space-1) 0 0; }
.document-prose { max-width: 72ch; font-size: var(--text-lede); line-height: 1.75; overflow-wrap: anywhere; }
.document-prose > :first-child { margin-top: 0; }
.document-prose h1, .document-prose h2, .document-prose h3, .document-prose h4, .document-prose h5, .document-prose h6 {
  color: var(--text); text-transform: none; letter-spacing: var(--tracking-heading); line-height: 1.35;
  margin: var(--space-8) 0 var(--space-3); }
.document-prose h1 { font-size: var(--text-2xl); }
.document-prose h2 { font-size: 1.25rem; }
.document-prose h3, .document-prose h4, .document-prose h5, .document-prose h6 { font-size: 1rem; }
.document-prose p, .document-prose ul, .document-prose ol, .document-prose blockquote { margin-bottom: var(--space-5); }
.document-prose li { margin-bottom: var(--space-2); }
.document-prose li > p { margin-bottom: var(--space-2); }
.document-prose blockquote { border-left: 3px solid var(--border-hover); padding-left: var(--space-5); margin-left: 0; color: var(--text-secondary); }
.document-prose code { display: inline; word-break: normal; padding: 0 var(--space-1); margin: 0; font-size: var(--text-sm); }
.document-prose pre { white-space: pre; overflow-x: auto; line-height: 1.6; margin: var(--space-5) 0; }
.document-prose pre code { display: block; border: 0; padding: 0; background: none; }
.document-prose pre.document-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: var(--text-sm); }
.document-prose table { display: block; overflow-x: auto; margin: var(--space-5) 0; }
.document-prose th { text-transform: none; letter-spacing: normal; }
.document-prose hr { border: 0; border-top: 1px solid var(--border-strong); margin: var(--space-8) 0; }
.document-image { color: var(--text-secondary); font-size: var(--text-sm); }
.document-list { list-style: none; padding: 0; margin: var(--space-4) 0 0; }
.document-list li { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-4);
  border-top: 1px solid var(--border); padding: var(--space-4) 0; }
.document-list li > div { min-width: 0; }
.document-name { font-weight: 600; }
.document-actions { display: flex; flex: none; gap: var(--space-4); font-size: var(--text-sm); }
details { margin: 0 0 var(--space-4); border-top: 1px solid var(--border); padding-top: var(--space-3); }
summary { cursor: pointer; font-size: var(--text-sm); font-weight: 500; color: var(--text-secondary); }
details[open] > summary { margin-bottom: var(--space-3); }
/* A proposal's images (ADR 0044): one column, full card width, each opening the original. */
.figures { display: grid; gap: var(--space-5); margin: 0 0 var(--space-5); }
.figures figure { margin: 0; }
.figures img { display: block; width: 100%; height: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.figures figcaption { margin-top: var(--space-2); font-size: var(--text-sm); color: var(--text-secondary); }
/* A decision (ADR 0059): the declared sections as panels — the source quoted, our reading, the proposal — then the
   decision bar (ADR 0072) and the supporting pane. */
.panel { border: 1px solid var(--border); border-radius: var(--radius); padding: var(--space-4) var(--space-5);
  margin: 0 0 var(--space-4); }
.panel > h2 { margin: 0 0 var(--space-3); }
.panel .prose { margin-bottom: var(--space-2); }
.panel-quote { border-left: 3px solid var(--border-hover); }
.panel-quote blockquote { margin: 0; color: var(--text); font-style: italic; }
.panel-evidence { background: var(--bg); }
.panel-proposal { border-color: var(--color-info); background: var(--pill-info-bg); }
.panel .table-wrap { margin-top: var(--space-2); }
.cite { font-size: var(--text-sm); color: var(--text-secondary); margin: 0; }
.choice .option { display: flex; align-items: flex-start; gap: var(--space-2); margin: 0 0 var(--space-3);
  font-size: var(--text-sm); font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--text); }
.choice .option input { margin-top: 0.2rem; flex: none; }
/* The decision bar: the last child of its form, sticky at the screen's bottom while the form is on screen; the note
   folds under "Add a note" (it posts while folded) and the options' details, the hint and an owner's actions show only
   while it is open. */
.decision-bar { position: sticky; bottom: 0; z-index: 1; margin: var(--space-4) calc(-1 * var(--bleed)) 0;
  padding: var(--space-3) var(--bleed) max(var(--space-3), env(safe-area-inset-bottom));
  background: var(--surface); border-top: 1px solid var(--border-strong); max-height: 60svh; overflow-y: auto;
  overscroll-behavior: contain; }
.decision-bar fieldset { border: 0; padding: 0; margin: 0 0 var(--space-3); }
.decision-bar .choice .option { margin-bottom: var(--space-2); }
.option-detail { display: block; }
.decision-bar:not(:has(.decision-more[open])) :is(.option-detail, .choice-hint, .decision-actions) { display: none; }
.decision-more { margin: 0 0 var(--space-3); padding-top: var(--space-2); }
.decision-actions { margin-top: var(--space-3); }
.verdicts { display: grid; grid-template-columns: repeat(2, minmax(0, 12rem)); margin: 0; }
.decision-bar .verdicts { position: sticky; bottom: 0; padding-top: var(--space-2); background: var(--surface); } /* opened, the bar scrolls; Approve and Decline stay in view */
html:has(.decision-bar) { scroll-padding-bottom: var(--decision-bar-reserve); } /* WCAG 2.4.11: focus is not hidden under the bar */
.decision-readonly { display: block; } /* an owner_only proposal read by someone else: the proposal, then the bar, no form */
.decision-locked p { margin: 0; color: var(--text-secondary); } /* no field, no button: the server refuses anyway */
/* A record (recordset.html): each field with its source quotes and page; a critical one ruled in the watch colour; its
   correction folded under "Correct this value"; issues after the fields. Stacks on a phone: no table to scroll. */
.record { margin: 0 0 var(--space-4); }
.record-group { margin: 0 0 var(--space-5); }
.record-issues { border-top: 1px solid var(--border); padding-top: var(--space-4); }
.record-group > h3 { margin: 0 0 var(--space-3); }
.record-field, .record-issue { border: 1px solid var(--border); border-radius: var(--radius);
  padding: var(--space-3) var(--space-4); margin: 0 0 var(--space-3); }
.record-critical { border-left: 3px solid var(--color-warning-amber); }
.record-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.record-label { font-weight: 600; }
.record-value { margin: var(--space-2) 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.record-quote { margin: 0 0 var(--space-1); padding-left: var(--space-3); border-left: 2px solid var(--border-hover);
  color: var(--text); font-style: italic; overflow-wrap: anywhere; }
.record-quote + .cite { margin-bottom: var(--space-2); }
.record-correction { margin: var(--space-2) 0 0; font-size: var(--text-sm); color: var(--color-success-subtle); }
.record-blocking { margin: 0 0 var(--space-4); padding: var(--space-3) var(--space-4); border-radius: var(--radius);
  background: var(--color-warning-bg); border: 1px solid var(--color-warning-border); }
.record-edit { margin-top: var(--space-2); }
/* The supporting pane (ADR 0072): a right-hand drawer below 901px (.drawer, opened by the top bar's Details), static
   under the decision to 1199px, a column beside it from 1200px (.decision-layout). One surface, its sections ruled
   apart; at most 20rem wide beside the decision, so its facts and a document's links stack. */
.decision-main, .pane { min-width: 0; }
.drawer-end { inset: 0 0 0 auto; border-left: 1px solid var(--border); translate: 100% 0; }
@starting-style { .drawer-end:popover-open { translate: 100% 0; } }
.pane-section { padding: var(--space-4) 0; border-top: 1px solid var(--border); }
.pane-section:first-of-type { padding-top: 0; border-top: 0; }
.pane-section > h2 { margin: var(--space-4) 0 var(--space-2); }
.pane-section > h2:first-child { margin-top: 0; }
.pane dl { grid-template-columns: 1fr; gap: 0.125rem; }
.pane dd { margin-bottom: var(--space-2); }
.context-list { list-style: none; padding: 0; margin: 0 0 var(--space-3); font-size: var(--text-sm); }
.context-list li { padding: var(--space-1) 0; border-bottom: 1px solid var(--border); }
.context-list li:last-child { border-bottom: none; }
.context-list .current { font-weight: 600; }
.pane .document-list li { flex-direction: column; gap: var(--space-2); padding: var(--space-3) 0; }
@media (min-width: 901px) {
  .pane { display: block; position: static; inset: auto; width: auto; height: auto; margin: 0; padding: var(--space-4);
    border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: inherit;
    overflow: visible; translate: none; transition: none; }
}
@media (min-width: 1200px) {
  .decision-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(14rem, 20rem); gap: var(--space-5);
    align-items: start; }
}

/* Messages. */
.error { color: var(--color-error); }
.muted { color: var(--text-secondary); }
p.error { background: var(--color-error-bg); border: 1px solid var(--color-error-border); border-radius: var(--radius);
  padding: 0.625rem 0.875rem; }
.notice { background: var(--color-warning-bg); border: 1px solid var(--color-warning-border); color: var(--color-warning-amber);
  border-radius: var(--radius); padding: 0.625rem 0.875rem; }
.notice a { color: inherit; }

/* Status badges: one per tone (badges.go); the label is the human word. */
.badge { display: inline-block; font-size: var(--text-2xs); font-weight: 500;
  letter-spacing: var(--tracking-pill); padding: 0.2rem 0.55rem; border-radius: var(--radius-pill); white-space: nowrap;
  background: var(--pill-subtle-bg); color: var(--text-secondary); }
.badge-clear { background: var(--pill-clear-bg); color: var(--color-success-subtle); }
.badge-info { background: var(--pill-info-bg); color: var(--color-info); }
.badge-watch { background: var(--pill-watch-bg); color: var(--color-warning-amber); }
.badge-urgent { background: var(--pill-urgent-bg); color: var(--color-error); }
.badge-subtle { background: var(--pill-subtle-bg); color: var(--text-secondary); }

/* Project boards (ADR 0073, projects_page.go): the decisions board (Waiting | Decided) and the tasks board
   (todo/doing/blocked/done) — columns that wrap and then stack on a narrow screen; each task is a plain .card.
   Flat, no gradients; sizes only, the colour is the badges'. */
.board { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: var(--space-4);
  align-items: start; margin: 0 0 var(--space-4); }
.board-col { min-width: 0; }
.board-col > h3 { margin: 0 0 var(--space-3); font-size: var(--text-sm); }
.board-col .card { padding: var(--space-4); }
.task-title { font-weight: 600; margin: 0 0 var(--space-2); }

/* Touch: 44px targets (buttons, the menu's rows) and 16px fields (iOS zooms a field under 16px on focus). */
@media (pointer: coarse) {
  :root { --control-height: var(--touch-target); }
  .section-children a { padding-block: var(--space-3); }
  input, select, textarea { font-size: 1rem; }
}
/* Phones: one inset. main's gutter is the only horizontal padding; cards lose their box; panels and tables bleed to
   the screen's edge with their text on the gutter line (ADR 0072). Scoped to .page-content: fg719 keeps its cards. */
@media (max-width: 640px) {
  :root { --gutter: var(--space-4); }
  .page-content { --card-pad: 0px; --bleed: var(--gutter); }
  main { padding-top: var(--space-4); padding-bottom: var(--space-12); }
  .page-content h1 { font-size: var(--text-xl); margin-bottom: var(--space-3); }
  .breadcrumbs { margin-bottom: var(--space-3); }
  .page-content .card { background: none; border: 0; border-top: 1px solid var(--border); border-radius: 0;
    padding: var(--space-4) 0; margin: 0; }
  .page-content :is(.panel, .table-wrap) { margin-inline: calc(-1 * var(--bleed)); border-inline: 0; border-radius: 0; }
  .page-content .panel { padding-inline: var(--bleed); }
  .page-content .panel-quote { border-left: 3px solid var(--border-hover); padding-left: calc(var(--bleed) - 3px); }
  .page-content .table-wrap :is(th, td):first-child { padding-left: var(--bleed); }
  .page-content .table-wrap :is(th, td):last-child { padding-right: var(--bleed); }
  .page-content .table-wrap { overflow-wrap: break-word; } /* columns no narrower than their longest word; the band scrolls */
  dl { grid-template-columns: 1fr; gap: 0.125rem; }
  dd { margin-bottom: var(--space-2); }
  .document-list li { flex-direction: column; gap: var(--space-2); }
  .verdicts { grid-template-columns: 1fr 1fr; }
}

/* fg719 (ADR 0062, site.go): the public site. Full-width bands, each holding a .site-measure column; the lander's
   hero type; cards (.card) in a grid; the primary button is button/.btn as everywhere. Sizes only, no colour. */
.site-body { min-height: 100dvh; display: flex; flex-direction: column; }
main.site-main { flex: 1; max-width: none; padding: 0; }
.site-measure { max-width: var(--measure-site); margin: 0 auto; padding: 0 var(--space-6); }
.site-header { border-bottom: 1px solid var(--border); }
.site-header-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
  min-height: var(--header-height); }
.site-brand { display: inline-flex; align-items: center; gap: var(--space-2); font-weight: 600;
  letter-spacing: var(--tracking-heading); text-decoration: none; }
.site-nav { display: flex; flex-wrap: wrap; gap: var(--space-5); font-size: var(--text-sm); }
.site-nav a { color: var(--text-secondary); text-decoration: none; transition: color var(--duration); }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); }
.site-main h1 { font-size: var(--text-hero); letter-spacing: var(--tracking-hero); line-height: 1.15; max-width: 40rem; }
.site-hero { padding: calc(var(--space-16) * 2) 0 var(--space-16); }
.site-page { padding: var(--space-16) 0; }
.site-lede { font-size: var(--text-lede); line-height: 1.6; color: var(--text-secondary); max-width: 38rem;
  margin: 0 0 var(--space-6); }
.site-section { padding: var(--space-12) 0; border-top: 1px solid var(--border); }
.site-section .site-measure > h2:first-child { margin-top: 0; }
.site-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: var(--space-4);
  margin: 0 0 var(--space-4); }
.site-cards > .card { margin: 0; }
.site-cards h3 { margin-top: 0; font-size: var(--text-base); }
.site-cards p, .site-steps p, .site-steps li { color: var(--text-secondary); }
.site-cards p:last-child { margin-bottom: 0; }
.site-steps { list-style: none; counter-reset: step; padding: 0; margin: 0 0 var(--space-6); display: grid;
  gap: var(--space-6); }
.site-steps > li { counter-increment: step; display: grid; grid-template-columns: var(--space-10) minmax(0, 1fr); }
.site-steps > li::before { content: counter(step, decimal-leading-zero); color: var(--text-muted);
  font-size: var(--text-sm); font-variant-numeric: tabular-nums; padding-top: 0.1rem; }
.site-steps > li h3 { margin: 0 0 var(--space-1); font-size: var(--text-base); }
.site-steps p, .site-steps ul { max-width: 44rem; }
.site-steps ul { margin: 0 0 var(--space-3); }
.site-steps .site-cards { grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); margin-top: var(--space-3); }
.site-steps .site-cards h3 { color: var(--text); }
.site-prose { line-height: 1.65; }
.site-prose > :not(h1) { max-width: 44rem; }
.site-prose p, .site-prose li { color: var(--text-secondary); }
.site-prose strong { color: var(--text); }
.site-prose li { margin: 0 0 var(--space-2); }
.site-price { font-size: var(--text-2xl); font-weight: 600; letter-spacing: var(--tracking-heading); margin: 0 0 var(--space-8); }
.site-price span { font-size: var(--text-base); font-weight: 400; letter-spacing: 0; color: var(--text-secondary); }
.site-empty { max-width: 38rem; }
.site-empty h3 { margin-top: 0; }
.site-empty p { color: var(--text-secondary); }
.site-empty .actions { margin-bottom: 0; }
.site-form { max-width: 28rem; }
.site-form-wide { max-width: 40rem; }
.site-form :is(input[type="email"], input[type="text"], textarea) { width: 100%; }
.site-form .inline-check label { display: inline; }
.site-trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
/* A listing (site_listing.go): the hero holds the price; agents' excerpts keep their line breaks; the board's lanes
   sit side by side; the catalog's cards end on their price. */
.site-listing-hero { padding-bottom: var(--space-12); }
.site-listing-hero .site-price { margin-bottom: 0; }
.site-preview-note { font-size: var(--text-sm); color: var(--text-secondary); max-width: 44rem; margin: 0 0 var(--space-6); }
.site-listing-image { display: block; width: 100%; height: auto; border: 1px solid var(--border); border-radius: var(--radius);
  margin: 0 0 var(--space-3); }
.site-excerpt { margin: 0; padding-left: var(--space-3); border-left: 2px solid var(--border); white-space: pre-line;
  font-size: var(--text-sm); color: var(--text-secondary); }
.site-board { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: var(--space-4);
  margin: 0 0 var(--space-4); }
.site-lane { border: 1px solid var(--border); border-radius: var(--radius); padding: var(--space-4); }
.site-lane h3 { margin: 0 0 var(--space-3); font-size: var(--text-sm); color: var(--text-secondary); }
.site-lane ul { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-2); }
.site-lane li { border: 1px solid var(--border); border-radius: var(--radius); padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm); }
.site-checked-on, .site-price-terms { font-size: var(--text-sm); color: var(--text-secondary); max-width: 44rem; }
.site-cards p.site-catalog-price { color: var(--text); font-weight: 600; }
.site-footer { border-top: 1px solid var(--border); padding: var(--space-8) 0; font-size: var(--text-xs);
  color: var(--text-secondary); }
.site-footer-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2) var(--space-5); }
.site-footer p, .site-footer address { margin: 0; font-style: normal; }
.site-footer a { color: var(--text-secondary); }
.site-footer a:hover { color: var(--text); }
@media (max-width: 640px) {
  .site-measure { padding: 0 var(--space-4); }
  .site-nav { gap: var(--space-4); }
  .site-hero { padding: var(--space-16) 0 var(--space-12); }
  .site-page { padding: var(--space-10) 0 var(--space-12); }
  .site-steps > li { grid-template-columns: var(--space-8) minmax(0, 1fr); }
}
