/* The house style, for a page.
 *
 * The same role table as House.swift in every Mac and iOS product and
 * Theme::dopecode() in gust-ui, spelled as custom properties. See
 * dopecode_house_style.html for what each role is for; this file is only
 * the table, and the table is the same everywhere.
 *
 * A role resolves against the appearance: the system's by default, or the
 * one a page pins with data-theme="light" or data-theme="dark" on <html>.
 * Nothing on a page names a hex; it names a role.
 *
 * Copy this file into a product rather than linking it across origins. It
 * changes when the guide changes, and only then.
 */

:root {
  color-scheme: light dark;

  /* Amber, the only accent. The fill does not flip. */
  --house-amber-100: #FFE3B0; /* tint fills, documents and pages only */
  --house-amber-hi: #FFC65C;  /* Amber 300: focused hairline, text selection */
  --house-amber: #FFB224;     /* Amber 500: the mark, the primary button, the rail, a bar in flight */
  --house-amber-dn: #E89A12;  /* Amber 600: the primary button, pressed */
  --house-amber-ring: #8F5806; /* Amber 800: the 2px ring outside a focused control, in both */
  --house-on-amber: #17130F;  /* Ink 800 on an amber fill, in both */

  /* Objects, never chrome: one colour in either appearance. A page someone
     would print, with the ink on paper on it, and an instrument's
     faceplate. gust-ui draws them as materials; a page draws the fill. */
  --house-page: #FFFDFA;
  --house-page-line: #E0D8CB;
  --house-page-text: #17130F;
  --house-page-dim: #6B6055;
  --house-anodised: #241E18;

  /* Radii: r12 panels, r10 detail rows, r8 buttons and fields, r6 chips.
     List rows are flush and square. */
  --house-r-panel: 12px;
  --house-r-row: 10px;
  --house-r-button: 8px;
  --house-r-chip: 6px;
  --house-rail: 3px;

  /* Type: JetBrains Mono for what a machine said, the system face for what a
     person reads. */
  --house-mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  --house-sans: -apple-system, BlinkMacSystemFont, system-ui, 'Helvetica Neue', Helvetica, Arial, sans-serif;

  /* Light: the default, and what a page without a preference gets. */
  --house-canvas: #F7F4EF;     /* Paper */
  --house-card: #FFFDFA;       /* Surface */
  --house-hover: #F7F3EC;
  --house-raised: #F0EBE2;
  --house-line: #E0D8CB;       /* Hairline */
  --house-text: #17130F;       /* Ink 800 */
  --house-dim: #6B6055;
  --house-amber-text: #8F5806; /* Amber 800 */
  --house-ok: #23714E;
  --house-warn: #B23B00;
  --house-bad: #C70F34;

  /* Data: never amber and never a status colour. A scale with a direction
     runs cool-2 → warm-2 through neutral; series take 1–6 in order and
     never cycle; one series with no judgement is plain. */
  --house-cool-2: #2456BD;
  --house-cool-1: #5E93E8;
  --house-neutral: #9A8F82;
  --house-warm-1: #E5735F;
  --house-warm-2: #BF2F3B;
  --house-series-1: #2456BD;
  --house-series-2: #BF696A;
  --house-series-3: #1195B4;
  --house-series-4: #96872D;
  --house-series-5: #773F9B;
  --house-series-6: #2E9E52;
  --house-series-plain: #BDB2A3;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --house-canvas: #17130F;     /* Ink 800 */
    --house-card: #1B1712;       /* Ink 700 */
    --house-hover: #211C16;      /* Ink 650 */
    --house-raised: #241E18;     /* Ink 600 */
    --house-line: #3A322A;       /* Ink 500 */
    --house-text: #F4EFE8;       /* Bone */
    --house-dim: #9A8F82;        /* Ink 300 */
    --house-amber-text: #FFB224; /* Amber 500 */
    --house-ok: #48C78E;
    --house-warn: #FF8A3D;
    --house-bad: #F2555A;
    --house-cool-2: #6793E3;
    --house-cool-1: #3A63B8;
    --house-neutral: #7D7266;
    --house-warm-1: #A93F37;
    --house-warm-2: #EC5B63;
    --house-series-1: #6793E3;
    --house-series-2: #A74449;
    --house-series-3: #1F9BBA;
    --house-series-4: #8A7B1D;
    --house-series-5: #834BA8;
    --house-series-6: #1D7D3E;
    --house-series-plain: #54493E;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --house-canvas: #17130F;
  --house-card: #1B1712;
  --house-hover: #211C16;
  --house-raised: #241E18;
  --house-line: #3A322A;
  --house-text: #F4EFE8;
  --house-dim: #9A8F82;
  --house-amber-text: #FFB224;
  --house-ok: #48C78E;
  --house-warn: #FF8A3D;
  --house-bad: #F2555A;
  --house-cool-2: #6793E3;
  --house-cool-1: #3A63B8;
  --house-neutral: #7D7266;
  --house-warm-1: #A93F37;
  --house-warm-2: #EC5B63;
  --house-series-1: #6793E3;
  --house-series-2: #A74449;
  --house-series-3: #1F9BBA;
  --house-series-4: #8A7B1D;
  --house-series-5: #834BA8;
  --house-series-6: #1D7D3E;
  --house-series-plain: #54493E;
}

:root[data-theme="light"] {
  color-scheme: light;
}

/* The ground and the two faces. */

body {
  background: var(--house-canvas);
  color: var(--house-text);
  font-family: var(--house-sans);
}

code, kbd, samp, pre {
  font-family: var(--house-mono);
}

a {
  color: var(--house-amber-text);
}

/* Selected text is Amber 300 behind Ink 800 at full opacity, in both
   appearances: the one place amber is a background. */
::selection {
  background: var(--house-amber-hi);
  color: var(--house-on-amber);
}

/* Focus is a 2px Amber 800 ring outside the control's own edge, so the edge
   never moves and nothing below it shifts. */
:focus-visible {
  outline: 2px solid var(--house-amber-ring);
  outline-offset: 0;
}

/* ───────────────────────────────────────────────────────────────────────
 * qrcode. Everything below names roles, never hexes (docs/house-style.md).
 * Amber goes to the mark, the one primary action, and the selected rail.
 * The code itself sits on the page object, the same in both appearances.
 * ─────────────────────────────────────────────────────────────────────── */

@font-face {
  font-family: 'JetBrains Mono';
  src: url('/assets/fonts/JetBrainsMono-Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('/assets/fonts/JetBrainsMono-Bold.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 16px; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { display: block; }

.mono { font-family: var(--house-mono); }
.dim { color: var(--house-dim); }
.small { font-size: 13px; line-height: 1.45; }
.sr {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
html:not(.js) .js-only { display: none !important; }
[hidden] { display: none !important; }

.skip {
  position: absolute; left: 16px; top: -48px; z-index: 10;
  background: var(--house-card); color: var(--house-text);
  padding: 8px 12px; border-radius: var(--house-r-button); border: 1px solid var(--house-line);
}
.skip:focus { top: 12px; }

/* ── the frame ─────────────────────────────────────────────────────── */

.top { border-bottom: 1px solid var(--house-line); background: var(--house-canvas); }
.top-in {
  max-width: 1240px; margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.lockup { display: flex; align-items: center; gap: 10px; color: var(--house-text); text-decoration: none; min-width: 0; }
.lockup .mark { width: 28px; height: 28px; color: var(--house-amber); flex: none; }
.lockup-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.wordmark { font-family: var(--house-mono); font-weight: 700; font-size: 18px; letter-spacing: -0.04em; }
.subtitle { font-size: 12px; color: var(--house-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav a {
  color: var(--house-text); text-decoration: none; padding: 6px 10px; border-radius: var(--house-r-button);
  font-size: 14px;
}
.nav a:hover { background: var(--house-hover); }
.nav a[aria-current="page"] { background: var(--house-raised); font-weight: 600; }
.nav .lang { color: var(--house-dim); }

.foot { border-top: 1px solid var(--house-line); margin-top: 64px; }
.foot-in {
  max-width: 1240px; margin: 0 auto; padding: 20px 16px 28px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap; font-size: 13px;
}
.maker { color: var(--house-dim); display: inline-flex; }
.maker:hover { color: var(--house-text); }

/* ── controls ──────────────────────────────────────────────────────── */

.button, button.primary, button.secondary, a.fix {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: var(--house-r-button); padding: 9px 16px; font-size: 14px; line-height: 1.2;
  border: 1px solid transparent; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.primary {
  background: var(--house-amber); color: var(--house-on-amber); font-weight: 600; border-color: var(--house-amber);
}
.primary:hover { background: var(--house-amber-hi); }
.primary:active { background: var(--house-amber-dn); }
.secondary, a.fix {
  background: var(--house-raised); color: var(--house-text); border-color: var(--house-line);
}
.secondary:hover, a.fix:hover { background: var(--house-hover); }
button.link {
  background: none; border: 0; padding: 0; color: var(--house-amber-text); cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px; font-size: 14px;
}
button:disabled { background: var(--house-card); color: var(--house-dim); border-color: var(--house-line); cursor: default; }

input[type="text"], input[type="url"], input[type="email"], input[type="tel"], input[type="number"],
input[type="search"], input[type="datetime-local"], select, textarea {
  width: 100%; background: var(--house-card); border: 1px solid var(--house-line);
  border-radius: var(--house-r-button); padding: 9px 11px; font-size: 15px; min-height: 40px;
}
textarea { resize: vertical; min-height: 72px; line-height: 1.45; }
input:focus, select:focus, textarea:focus { background: var(--house-raised); border-color: var(--house-amber-hi); }
input[aria-invalid="true"] { border-color: var(--house-warn); }
select {
  appearance: none; -webkit-appearance: none; padding-right: 32px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--house-dim) 50%), linear-gradient(135deg, var(--house-dim) 50%, transparent 50%);
  background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%;
  background-size: 5px 5px; background-repeat: no-repeat;
}
input[type="checkbox"], input[type="radio"], input[type="range"] { accent-color: var(--house-text); }
::placeholder { color: var(--house-dim); opacity: 1; }

.eyebrow {
  font-family: var(--house-mono); font-weight: 400; font-size: 11px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--house-amber-text);
}

/* ── the page ──────────────────────────────────────────────────────── */

.intro { padding: 28px 0 20px; max-width: 760px; }
.intro h1 { font-size: clamp(26px, 4.2vw, 38px); line-height: 1.12; letter-spacing: -0.02em; font-weight: 650; }
.lede { margin-top: 10px; font-size: 17px; color: var(--house-dim); max-width: 620px; }

.designer { display: flex; flex-direction: column; gap: 16px; }
.output { display: contents; }
.out-top { order: 0; }
.controls { order: 1; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.out-bottom { order: 2; }

.block {
  background: var(--house-card); border: 1px solid var(--house-line); border-radius: var(--house-r-panel);
  padding: 16px;
}
.block > .eyebrow, .block > summary { margin-bottom: 12px; }
.eyebrow.sub { margin: 18px 0 10px; }
details.block > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between;
  margin: -16px; padding: 16px; border-radius: var(--house-r-panel);
}
details.block > summary::-webkit-details-marker { display: none; }
details.block > summary::after {
  content: ""; width: 7px; height: 7px; border-right: 1.5px solid var(--house-dim); border-bottom: 1.5px solid var(--house-dim);
  transform: rotate(45deg) translate(-2px, -2px); transition: transform .15s ease;
}
details.block[open] > summary { margin-bottom: 0; }
details.block[open] > summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
details.block > summary:hover { background: var(--house-hover); }
details.block[open] > :nth-child(2) { margin-top: 12px; }

.fields { border: 0; padding: 0; margin: 12px 0 0; min-width: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; grid-column: span 1; }
.field.wide, .fields > .wide { grid-column: 1 / -1; }
.field > label { font-size: 13px; color: var(--house-dim); }
.field.type { flex-direction: row; gap: 8px; }
.field.type select { font-weight: 600; }
.problem { font-size: 13px; color: var(--house-warn); min-height: 0; }
.problem:empty { display: none; }
.hint { background: var(--house-canvas); border-radius: var(--house-r-row); padding: 10px 12px; gap: 4px; }
label.check { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
label.check input { width: 16px; height: 16px; margin: 0; flex: none; }
.checks { display: flex; flex-direction: column; gap: 8px; margin: 14px 0; }

/* Presets and palettes: a picker is a setting, so the selected one is a
   raised fill with an amber hairline, never an amber fill. */
.presets { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.preset {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 6px 7px;
  background: var(--house-card); border: 1px solid var(--house-line); border-radius: var(--house-r-row);
  cursor: pointer; font-size: 12px; color: var(--house-text); min-width: 0;
}
.preset:hover { background: var(--house-hover); }
.preset[aria-pressed="true"] { background: var(--house-raised); border-color: var(--house-amber); font-weight: 600; }
.thumb {
  width: 100%; aspect-ratio: 1; background: var(--house-page); border-radius: 6px; overflow: hidden;
  display: block; box-shadow: inset 0 0 0 1px var(--house-page-line);
}
.thumb svg { width: 100%; height: 100%; }
.preset-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.palettes { display: grid; grid-template-columns: repeat(8, minmax(0, 36px)); gap: 6px; }
/* Inks are shown on paper, in either appearance: they are the user's. */
.palette {
  width: 100%; aspect-ratio: 1; max-width: 36px; border-radius: 50%; padding: 4px; border: 1px solid var(--house-page-line);
  background: var(--house-page); cursor: pointer;
}
.palette:hover { border-color: var(--house-dim); }
.palette[aria-pressed="true"] { border-color: var(--house-amber); box-shadow: 0 0 0 1px var(--house-amber); }
.swatch { display: block; width: 100%; height: 100%; border-radius: 50%; overflow: hidden; position: relative; }
.swatch svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.swatch.two svg:last-child { clip-path: polygon(100% 0, 100% 100%, 0 100%); }

.tiles { border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }
.tiles legend { font-size: 13px; color: var(--house-dim); margin-bottom: 8px; padding: 0; }
.tiles.solo legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.tile-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px; }
.tile {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 8px 4px 6px; border: 1px solid var(--house-line); border-radius: var(--house-r-row);
  background: var(--house-card); cursor: pointer; font-size: 11.5px; color: var(--house-text); text-align: center;
}
.tile:hover { background: var(--house-hover); }
.tile input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.tile:has(input:checked) { background: var(--house-raised); border-color: var(--house-amber); font-weight: 600; }
.tile:has(input:focus-visible) { outline: 2px solid var(--house-amber-ring); }
.tile-art { width: 30px; height: 30px; color: var(--house-text); }
.tile-art svg { width: 100%; height: 100%; }
.tile-name { line-height: 1.2; }

.ranges { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; margin: 4px 0 14px; }
.range { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; align-items: center; }
.range label { font-size: 13px; color: var(--house-dim); }
.range output { grid-row: 1; grid-column: 2; font-family: var(--house-mono); font-size: 12px; color: var(--house-dim); }
.range input { grid-column: 1 / -1; width: 100%; margin: 0; }

/* A slider: a hairline track and a thumb in ink, never amber. */
input[type="range"] { -webkit-appearance: none; appearance: none; background: transparent; height: 24px; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: var(--house-line); }
input[type="range"]::-moz-range-track { height: 4px; border-radius: 2px; background: var(--house-line); }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px; margin-top: -7px; border-radius: 50%;
  background: var(--house-card); border: 2px solid var(--house-text); box-shadow: 0 1px 2px rgb(0 0 0 / 20%);
}
input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%; background: var(--house-card); border: 2px solid var(--house-text);
}
input[type="range"]:focus-visible { outline: none; }
input[type="range"]:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--house-amber-ring); outline-offset: 1px; }
.block > .range { margin: 14px 0; }

.colours { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.colour { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.colour > label { font-size: 13px; color: var(--house-dim); }
.colour-pair { display: flex; gap: 6px; }
.colour-pair input[type="color"] {
  width: 40px; height: 40px; flex: none; padding: 3px; border: 1px solid var(--house-line);
  border-radius: var(--house-r-button); background: var(--house-card); cursor: pointer;
}
.colour-pair input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.colour-pair input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 5px; }
.colour-pair input[type="color"]::-moz-color-swatch { border: 0; border-radius: 5px; }
.colour-pair .hex { font-size: 13px; }
.eye-colours { margin-bottom: 12px; }

.logo-pick { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.logo-pick label.button { cursor: pointer; }
#logo-thumb { width: 40px; height: 40px; object-fit: contain; background: var(--house-page); border-radius: 6px; border: 1px solid var(--house-page-line); }
#logo-safe:empty { display: none; }

/* ── the output ────────────────────────────────────────────────────── */

.object {
  background: var(--house-page); border: 1px solid var(--house-page-line); border-radius: var(--house-r-panel);
  padding: clamp(16px, 4vw, 28px); position: relative; color: var(--house-page-text);
}
.preview { max-width: 360px; margin: 0 auto; aspect-ratio: 1; }
.preview svg { width: 100%; height: 100%; }
.preview.stale { opacity: .35; transition: opacity .2s; }
.example {
  position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%);
  font-size: 12px; color: var(--house-page-dim); background: var(--house-page); padding: 2px 8px; border-radius: 6px;
  white-space: nowrap;
}
.too-long { margin-top: 12px; color: var(--house-bad); font-size: 14px; }

.verdict { margin-top: 14px; }
.verdict-line { font-size: 14px; }
.state { display: inline-flex; align-items: center; gap: 6px; font-family: var(--house-mono); font-size: 13px; font-weight: 700; }
.state .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.state.ok { color: var(--house-ok); }
.state.warn { color: var(--house-warn); }
.state.bad { color: var(--house-bad); }
.state.neutral { color: var(--house-dim); }
.verdict[data-state="checking"] .state .dot { animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }
.why { color: var(--house-text); }
#margin { margin-top: 2px; }
#margin:empty { display: none; }

.findings { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-direction: column; gap: 8px; }
.findings:empty { display: none; }
.findings li {
  background: var(--house-canvas); border-radius: var(--house-r-row); padding: 10px 12px; font-size: 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
}
a.fix { padding: 5px 10px; font-size: 13px; }

.facts { font-size: 12px; margin-top: 12px; }
.download { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.download .primary { flex: 1 1 auto; }
.png-width { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 13px; color: var(--house-dim); }
.png-width input { width: 96px; min-height: 34px; padding: 5px 8px; font-size: 13px; }
#print-hint { margin-top: 10px; }
.share { margin-top: 12px; }

.explain { display: grid; gap: 24px; margin-top: 56px; }
.explain h2 { font-size: 17px; margin-bottom: 8px; }
.explain p { color: var(--house-dim); max-width: 60ch; }
.explain p + p { margin-top: 8px; }

.lost { padding: 72px 0; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.lost-mark { width: 72px; height: 72px; color: var(--house-raised); }
.lost h1 { font-size: 28px; }
.lost p { color: var(--house-dim); max-width: 46ch; }

/* ── the other pages ───────────────────────────────────────────────── */

.narrow { max-width: 640px; padding: 32px 0 0; }
.narrow h1, .account h1, .anbi h1, .admin h1 { font-size: clamp(24px, 3.6vw, 32px); line-height: 1.15; letter-spacing: -0.02em; }
.narrow .lede, .anbi .lede { margin-top: 10px; }
.card {
  background: var(--house-card); border: 1px solid var(--house-line); border-radius: var(--house-r-panel);
  padding: 18px; margin-top: 16px;
}
.card h2 { font-size: 17px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.card h2 + p { margin-top: 6px; }
.form .field { margin-bottom: 14px; }
.form .field > label, .form legend { font-size: 13px; color: var(--house-dim); }
.form button.primary { width: 100%; }
.actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; align-items: center; }
form.inline { display: inline; }
form.confirm { margin-top: 22px; }
.note { background: var(--house-raised); border-radius: var(--house-r-row); padding: 10px 12px; margin-top: 14px; }
.sent-mark { width: 44px; height: 44px; color: var(--house-amber); margin-bottom: 18px; }
.row { display: flex; gap: 8px; }
.row input { flex: 1; }

.choices { border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }
.choices legend { padding: 0; margin-bottom: 4px; color: var(--house-text); font-size: 15px; }
.choice {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px; margin-top: 8px; cursor: pointer;
  border: 1px solid var(--house-line); border-radius: var(--house-r-row); background: var(--house-card);
}
.choice:hover { background: var(--house-hover); }
.choice input { margin: 3px 0 0; flex: none; width: 16px; height: 16px; }
.choice:has(input:checked) { background: var(--house-raised); border-color: var(--house-amber); }
.choice.one { cursor: default; margin: 8px 0 16px; }
.choice-filter { margin: 10px 0 2px; }
.org { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.org-name { font-weight: 600; overflow-wrap: anywhere; }
.org-facts { overflow-wrap: anywhere; }

.rows { list-style: none; padding: 0; margin: 8px 0 0; }
.rows li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; flex-wrap: wrap; }
.rows li + li { border-top: 1px solid var(--house-line); }
.rows.card { padding: 6px 18px; }

.anbi { display: grid; gap: 28px; padding-top: 28px; }
.anbi .lede { font-size: 17px; color: var(--house-dim); max-width: 60ch; }
.gets { margin: 18px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.anbi-check .card { margin-top: 0; }
.anbi-check > p { margin-top: 10px; }
.anbi-how h2 { font-size: 17px; margin-bottom: 10px; }
.steps { margin: 0 0 14px; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; }
.anbi-how p + p { margin-top: 8px; }

.account { max-width: 720px; padding-top: 32px; }
.plan h2 { font-size: 19px; }
.admin { padding-top: 32px; max-width: 860px; }
.request blockquote { margin: 10px 0 0; padding: 8px 12px; border-left: 3px solid var(--house-line); color: var(--house-dim); }
.decide { margin-top: 12px; }

/* ── dynamic codes ─────────────────────────────────────────────────── */

.codes, .code { padding-top: 32px; }
.codes-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.codes .lede, .code .lede { color: var(--house-dim); max-width: 60ch; margin-top: 8px; }
.empty { margin-top: 24px; }
.code-list { list-style: none; padding: 0; margin: 24px 0 0; border: 1px solid var(--house-line); border-radius: var(--house-r-panel); background: var(--house-card); overflow: hidden; }
.code-list li + li { border-top: 1px solid var(--house-line); }
.code-list a {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 16px; padding: 12px 16px;
  color: var(--house-text); text-decoration: none;
}
.code-list a:hover { background: var(--house-hover); }
.code-name { font-weight: 600; }
.code-short { color: var(--house-dim); grid-column: 1; }
.code-target { grid-column: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.code-count { grid-column: 2; grid-row: 1; text-align: right; }
.code-state { grid-column: 2; grid-row: 2; text-align: right; }
.crumbs a { color: var(--house-dim); }
.code h1 { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 4px; }
.code-grid { display: grid; gap: 20px; margin-top: 18px; }
.code-side .object { max-width: 340px; }
.short { margin-top: 10px; font-size: 14px; }
.code-side .download { margin-top: 10px; }
.code-side p + p { margin-top: 8px; }
.code-main .card:first-child { margin-top: 0; }
.code-main fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.state-form { margin-top: 12px; }
.small-object { max-width: 220px; margin: 18px 0 0; }
.small-object svg { width: 100%; height: auto; }

.tiles-stat { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 12px 0 8px; }
.stat { display: flex; flex-direction: column; }
.stat-value { font-size: 24px; font-weight: 600; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 13px; }

/* The chart: one series in the first slot, never amber; hairline axes. */
.chart { margin: 8px 0 4px; position: relative; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart .bar { fill: var(--house-series-1); }
.chart .col:hover .bar, .chart .col:focus .bar { fill: var(--house-cool-1); }
.chart .col { outline: none; }
.chart .hit { fill: transparent; }
.chart .grid, .chart .axis { stroke: var(--house-line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart text { font-family: var(--house-mono); font-size: 10px; fill: var(--house-dim); }
.chart text.value { fill: var(--house-text); font-weight: 700; }
.tip {
  position: absolute; pointer-events: none; z-index: 5; background: var(--house-card); color: var(--house-text);
  border: 1px solid var(--house-line); border-radius: var(--house-r-chip); padding: 4px 8px; font-size: 12px;
  white-space: nowrap; box-shadow: 0 2px 8px rgb(0 0 0 / 12%); transform: translate(-50%, -100%);
}
.hbars { list-style: none; padding: 0; margin: 4px 0 8px; display: flex; flex-direction: column; gap: 6px; }
.hbars li { display: grid; grid-template-columns: 9em minmax(0, 1fr) 3.5em; align-items: center; gap: 8px; font-size: 13px; }
.hbar-track { height: 10px; display: block; }
.hbar { display: block; height: 10px; background: var(--house-series-1); border-radius: 0 4px 4px 0; min-width: 2px; }
.hbar-value { text-align: right; }
.hbar.w0 { width: 0%; }
.hbar.w2 { width: 2%; }
.hbar.w4 { width: 4%; }
.hbar.w6 { width: 6%; }
.hbar.w8 { width: 8%; }
.hbar.w10 { width: 10%; }
.hbar.w12 { width: 12%; }
.hbar.w14 { width: 14%; }
.hbar.w16 { width: 16%; }
.hbar.w18 { width: 18%; }
.hbar.w20 { width: 20%; }
.hbar.w22 { width: 22%; }
.hbar.w24 { width: 24%; }
.hbar.w26 { width: 26%; }
.hbar.w28 { width: 28%; }
.hbar.w30 { width: 30%; }
.hbar.w32 { width: 32%; }
.hbar.w34 { width: 34%; }
.hbar.w36 { width: 36%; }
.hbar.w38 { width: 38%; }
.hbar.w40 { width: 40%; }
.hbar.w42 { width: 42%; }
.hbar.w44 { width: 44%; }
.hbar.w46 { width: 46%; }
.hbar.w48 { width: 48%; }
.hbar.w50 { width: 50%; }
.hbar.w52 { width: 52%; }
.hbar.w54 { width: 54%; }
.hbar.w56 { width: 56%; }
.hbar.w58 { width: 58%; }
.hbar.w60 { width: 60%; }
.hbar.w62 { width: 62%; }
.hbar.w64 { width: 64%; }
.hbar.w66 { width: 66%; }
.hbar.w68 { width: 68%; }
.hbar.w70 { width: 70%; }
.hbar.w72 { width: 72%; }
.hbar.w74 { width: 74%; }
.hbar.w76 { width: 76%; }
.hbar.w78 { width: 78%; }
.hbar.w80 { width: 80%; }
.hbar.w82 { width: 82%; }
.hbar.w84 { width: 84%; }
.hbar.w86 { width: 86%; }
.hbar.w88 { width: 88%; }
.hbar.w90 { width: 90%; }
.hbar.w92 { width: 92%; }
.hbar.w94 { width: 94%; }
.hbar.w96 { width: 96%; }
.hbar.w98 { width: 98%; }
.hbar.w100 { width: 100%; }
.table-view { margin: 10px 0; }
.table-view summary { cursor: pointer; color: var(--house-amber-text); }
.table-view table { border-collapse: collapse; width: 100%; margin-top: 8px; font-size: 13px; }
.table-view th { text-align: left; font-family: var(--house-mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--house-dim); font-weight: 400; padding: 4px 0; }
.table-view td { padding: 3px 0; border-top: 1px solid var(--house-line); }
.field.dynamic { margin-top: 2px; flex-direction: row; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; }
a.preset.saved { text-decoration: none; }

.pricing { padding-top: 32px; }
.pricing .lede { color: var(--house-dim); font-size: 17px; max-width: 60ch; margin-top: 8px; }
.plans { display: grid; gap: 16px; margin: 20px 0 16px; }
.plan-card { margin-top: 0; display: flex; flex-direction: column; }
.plan-card .actions { margin-top: auto; padding-top: 16px; }
.price { font-size: 20px; font-weight: 600; margin: 6px 0 10px; letter-spacing: -0.01em; }
.docs { max-width: 860px; padding-top: 32px; }
.docs h2 { font-size: 17px; margin: 28px 0 8px; }
.docs p { margin-top: 8px; max-width: 70ch; }
.docs .lede { color: var(--house-dim); font-size: 17px; }
pre.code, pre.key {
  background: var(--house-anodised); color: var(--house-page); border-radius: var(--house-r-row); padding: 12px 14px;
  overflow-x: auto; font-size: 12.5px; line-height: 1.6; margin: 10px 0;
}
pre.key { font-size: 15px; user-select: all; }
.params { border-collapse: collapse; width: 100%; font-size: 13px; margin-top: 8px; }
.params th { text-align: left; font-family: var(--house-mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--house-dim); font-weight: 400; padding: 6px 8px 6px 0; }
.params td { padding: 7px 8px 7px 0; border-top: 1px solid var(--house-line); vertical-align: top; }
.key-make { margin-top: 12px; }

@media (min-width: 640px) {
  main, .top-in, .foot-in { padding-left: 24px; padding-right: 24px; }
  .block { padding: 20px; }
  details.block > summary { margin: -20px; padding: 20px; }
  .presets { grid-template-columns: repeat(8, minmax(0, 1fr)); }
  .explain { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 960px) {
  .plans { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .code-grid { grid-template-columns: 340px minmax(0, 1fr); align-items: start; }
  .anbi { grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr); align-items: start; }
  .anbi-how { grid-column: 1 / -1; max-width: 760px; }
  .designer {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 440px); gap: 24px; align-items: start;
  }
  .output { display: block; position: sticky; top: 16px; order: 2; }
  .controls { order: 1; }
  .presets { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .preview { max-width: none; }
  .out-bottom { margin-top: 0; }
}

@media (min-width: 1180px) {
  .presets { grid-template-columns: repeat(8, minmax(0, 1fr)); }
}

@media (max-width: 400px) {
  .subtitle { display: none; }
  .fields, .colours, .ranges { grid-template-columns: 1fr; }
  .fields > .field { grid-column: 1 / -1; }
}

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