/* Open Places, one stylesheet, no build step.

   A quiet workspace: warm off-white ground, white cards, one deep olive for actions, and a
   pale-green frame around whatever is *the live data* (the builder's count, the tile map, the
   stats hero). The same look as the Armadealo workspace, without the chat.
     brand  = olive. Every action and every "selected" state.
     frame  = pale green border + tint. Only around live data; never a plain container.
     sun    = the live count only (and the "newer data out" badge, which is about the count's data).
     mint / sage / ash / clay = pills: picked, neutral, absent, ruled out.
   Text pairs are checked at WCAG AA (4.5:1, 3:1 for large text). If you change a color, re-check
   every page in light and dark; --muted was darkened from Armadealo's #6E7266 so it passes on --frame-bg.
   The CSP blocks inline styles: every visual rule lives here, never in a style attribute. */

:root {
  --paper: #F7F5EF;
  --surface: #FFFFFF;
  --ink: #23261F;
  --muted: #676B5F;
  --line: #E7E3D8;
  --hover: #EFECE3;
  --brand: #3F5A2C;
  --brand-ink: #FFFFFF;
  --brand-hover: #32481F;
  --frame: #D6E8C2;
  --frame-bg: #EEF6E3;
  --sun: #F7E7A1;  --sun-ink: #5C480A;
  --sage: #E1E5D6; --sage-ink: #4C5443;
  --mint: #D7EDCB; --mint-ink: #2E5A1F;
  --ash: #ECEBE6;  --ash-ink: #5B5E56;
  --clay: #F5D0C3; --clay-ink: #8B3418;
  --danger: #A8321A;
  --code-bg: #20261B; --code-ink: #E9EDE1;

  --sans: "Figtree", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --code: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --r: 18px;
  --r-lg: 22px;
  --r-sm: 12px;
  --pill: 999px;
  --shadow: 0 1px 2px rgba(35, 38, 31, .04), 0 10px 28px -20px rgba(35, 38, 31, .25);
  --gutter: clamp(16px, 3.6vw, 40px);
  --max: 1180px;
  --nav-w: 232px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #161914; --surface: #1F231C; --ink: #ECEEE6; --muted: #A3A898; --line: #30362B; --hover: #272C23;
    --brand: #A9CC86; --brand-ink: #15210D; --brand-hover: #BBD99C; --frame: #3E5432; --frame-bg: #1E2719;
    --sun: #4A4120; --sun-ink: #F3DE8A; --sage: #33392C; --sage-ink: #CBD3BD; --mint: #2C4423; --mint-ink: #BFE3A8;
    --ash: #2E302B; --ash-ink: #C4C7BE; --clay: #4D2A1F; --clay-ink: #F2B8A3; --danger: #F2A08A;
    --code-bg: #10130E;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 12px 30px -18px rgba(0,0,0,.7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #161914; --surface: #1F231C; --ink: #ECEEE6; --muted: #A3A898; --line: #30362B; --hover: #272C23;
  --brand: #A9CC86; --brand-ink: #15210D; --brand-hover: #BBD99C; --frame: #3E5432; --frame-bg: #1E2719;
  --sun: #4A4120; --sun-ink: #F3DE8A; --sage: #33392C; --sage-ink: #CBD3BD; --mint: #2C4423; --mint-ink: #BFE3A8;
  --ash: #2E302B; --ash-ink: #C4C7BE; --clay: #4D2A1F; --clay-ink: #F2B8A3; --danger: #F2A08A;
  --code-bg: #10130E;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 12px 30px -18px rgba(0,0,0,.7);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 15px/1.55 var(--sans); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--sans); font-weight: 800; letter-spacing: -0.025em; line-height: 1.08; margin: 0; }
h2 { font-size: clamp(26px, 3.4vw, 36px); }
p { margin: 0; }
.mono { font-variant-numeric: tabular-nums; }       /* numbers line up; Figtree throughout, no second face */
.sr, .hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.skip { position: absolute; left: -999px; top: 8px; }
.skip:focus { left: 8px; background: var(--surface); padding: 8px 12px; border-radius: var(--r-sm); z-index: 30; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 8px; }
svg.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; }
.lede { color: var(--muted); font-size: 17px; max-width: 60ch; }
.help { color: var(--muted); font-size: 13.5px; margin-top: 6px; display: block; }
.error { color: var(--danger); font-weight: 600; margin-top: 10px; }
.fine { color: var(--muted); font-size: 14px; margin-top: 24px; }
.eyebrow { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 14px; }

/* --- buttons ------------------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  font: 600 15px/1 var(--sans); padding: 12px 20px; border-radius: var(--pill);
  background: var(--brand); color: var(--brand-ink); border: 0; cursor: pointer;
  text-decoration: none; transition: background .12s;
}
.btn:hover { background: var(--brand-hover); }
.btn-sm { padding: 9px 15px; font-size: 14px; }
.btn-lg { padding: 15px 24px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-ghost { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn-ghost:hover { background: var(--hover); }
.link { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; }
.link:hover { text-decoration: underline; }
form.inline { display: inline; }

/* --- the shell: a sidebar on wide screens, a top bar on narrow ones ---------------------- */
.shell { display: grid; grid-template-columns: var(--nav-w) minmax(0, 1fr); min-height: 100vh; }
.sidenav {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px;
  padding: 18px 12px; border-right: 1px solid var(--line); overflow-y: auto; background: var(--surface);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 6px; text-decoration: none; font-weight: 800; font-size: 19px; letter-spacing: -0.02em; }
.brand img { width: 36px; height: 36px; image-rendering: pixelated; }
.sidenav-links { display: grid; gap: 2px; }
.sidenav-links a, .me-login {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--r-sm);
  color: var(--muted); font-weight: 500; text-decoration: none;
}
.sidenav-links a:hover, .me-login:hover { background: var(--hover); color: var(--ink); }
.sidenav-links a[aria-current="page"] { background: var(--hover); color: var(--ink); font-weight: 600; position: relative; }
.sidenav-links a[aria-current="page"]::before {     /* the reference's left marker: where you are */
  content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand);
}
.sidenav-links a[aria-current="page"] svg { color: var(--brand); }
.sidenav-foot { margin-top: auto; display: grid; gap: 10px; }
.sidenav-data { display: flex; align-items: center; gap: 8px; padding: 0 10px; font-size: 13px; color: var(--muted); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); flex: none; }
.me { display: grid; grid-template-columns: 32px minmax(0, 1fr); column-gap: 10px; align-items: center; padding: 10px; border-top: 1px solid var(--line); }
.me-av { grid-row: 1 / 3; width: 32px; height: 32px; border-radius: 50%; background: var(--sage); color: var(--sage-ink); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.me-email { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me .inline { justify-self: start; }
.me .link { font-size: 13px; color: var(--muted); }
.me-login { border-top: 1px solid var(--line); border-radius: 0 0 var(--r-sm) var(--r-sm); padding-top: 12px; }
.page { min-width: 0; display: flex; flex-direction: column; }
.page main { flex: 1; }
.foot {
  max-width: calc(var(--max) + 2 * var(--gutter)); width: 100%; margin: 80px auto 0; padding: 22px var(--gutter) 32px;
  display: flex; flex-wrap: wrap; gap: 8px 40px; justify-content: space-between; color: var(--muted); font-size: 13.5px;
}
.foot p { max-width: 70ch; }
.foot a { color: var(--ink); }

/* --- the home page hero ----------------------------------------------------------------- */
.hero { max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto; padding: clamp(24px, 4.5vw, 56px) var(--gutter) 8px; }
.hero-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-bottom: 18px; }
.hero-top .eyebrow { margin-bottom: 0; }
.sentence h1 {
  font-size: clamp(40px, 6.6vw, 88px); font-weight: 800; line-height: 1.02; letter-spacing: -0.04em;
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .04em .24em;
}
.slot { position: relative; display: inline-flex; }
.where { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 0 .24em; max-width: 100%; }
.slot select, .slot input {
  font: inherit; letter-spacing: inherit; color: var(--brand); background: transparent;
  border: 0; border-bottom: .06em solid var(--frame); padding: 0 .08em; margin: 0;
  appearance: none; -webkit-appearance: none; border-radius: 0; cursor: pointer;
  max-width: 100%;
}
.slot select { padding-right: .55em; }
.slot::after {                           /* the little caret on the category slot */
  content: ""; position: absolute; right: .12em; top: 50%; width: .2em; height: .2em;
  border-right: .055em solid var(--brand); border-bottom: .055em solid var(--brand);
  transform: translateY(-70%) rotate(45deg); pointer-events: none;
}
.slot-city::after { display: none; }
.slot select, .slot input { field-sizing: content; }
.slot-city input { min-width: 3em; cursor: text; }
.slot select:hover, .slot input:hover, .slot-btn:hover { border-bottom-color: var(--brand); }
.slot select:focus-visible, .slot input:focus-visible { outline: none; background: var(--frame-bg); border-bottom-color: var(--brand); border-radius: .1em .1em 0 0; }
.slot select option { font: 400 16px var(--sans); color: var(--ink); }

.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 28px clamp(24px, 4vw, 56px); align-items: center; margin-top: clamp(24px, 3.5vw, 44px); }
.hero-left { display: grid; gap: 16px; align-content: center; }
.count-line { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: center; }
.count-line p { font-size: clamp(17px, 1.8vw, 20px); line-height: 1.4; }
.sticker { width: 64px; height: 64px; image-rendering: pixelated; flex: none; }
.sticker-lg { width: 80px; height: 80px; margin-bottom: 16px; }
mark.count {
  display: inline-block; background: var(--sun); color: var(--sun-ink); padding: .02em .22em; border-radius: .2em;
  font-weight: 800; letter-spacing: -0.03em; font-size: clamp(32px, 4.2vw, 52px); line-height: 1.1; margin-right: .12em;
  box-decoration-break: clone; -webkit-box-decoration-break: clone;
  animation: pop .35s cubic-bezier(.2, 1.4, .4, 1);
}
@keyframes pop { from { transform: scale(.88); } to { transform: scale(1); } }   /* never fade text in */
.count-sub { color: var(--muted); font-size: 14px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.empty-note { color: var(--muted); margin-top: 28px; }

/* the tile map: live data, so it sits in the frame */
.mapcard { margin: 0; border: 2px solid var(--frame); background: var(--frame-bg); border-radius: var(--r-lg); padding: clamp(16px, 2.2vw, 24px); }
.mapcard figcaption { display: grid; gap: 2px; margin-bottom: 14px; }
.mapcard-title { font-weight: 700; font-size: clamp(17px, 1.8vw, 20px); letter-spacing: -0.01em; }
.mapcard-sub { font-size: 13px; color: var(--muted); }
.tilemap { display: block; width: 100%; height: auto; overflow: visible; }
/* olive ramp, light to dark = fewer to more; label colors chosen so each pair passes AA at 11.5px */
.b0 { --t: #E3E8D8; --tt: #4C5443; }
.b1 { --t: #D0E3BA; --tt: #23261F; }
.b2 { --t: #B4D395; --tt: #23261F; }
.b3 { --t: #8FBA6C; --tt: #1A2412; }
.b4 { --t: #557D39; --tt: #FFFFFF; }
.b5 { --t: #3F5A2C; --tt: #FFFFFF; }
.b6 { --t: #273A19; --tt: #F7E7A1; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .b0 { --t: #262D20; --tt: #A3A898; }
  :root:not([data-theme="light"]) .b1 { --t: #31422A; --tt: #ECEEE6; }
  :root:not([data-theme="light"]) .b2 { --t: #46602F; --tt: #ECEEE6; }
  :root:not([data-theme="light"]) .b3 { --t: #648A45; --tt: #10170B; }
  :root:not([data-theme="light"]) .b4 { --t: #86AE62; --tt: #10170B; }
  :root:not([data-theme="light"]) .b5 { --t: #A9CC86; --tt: #10170B; }
  :root:not([data-theme="light"]) .b6 { --t: #D3EBB4; --tt: #10170B; }
}
:root[data-theme="dark"] .b0 { --t: #262D20; --tt: #A3A898; }
:root[data-theme="dark"] .b1 { --t: #31422A; --tt: #ECEEE6; }
:root[data-theme="dark"] .b2 { --t: #46602F; --tt: #ECEEE6; }
:root[data-theme="dark"] .b3 { --t: #648A45; --tt: #10170B; }
:root[data-theme="dark"] .b4 { --t: #86AE62; --tt: #10170B; }
:root[data-theme="dark"] .b5 { --t: #A9CC86; --tt: #10170B; }
:root[data-theme="dark"] .b6 { --t: #D3EBB4; --tt: #10170B; }
.tile rect { fill: var(--t); }
.tile text { fill: var(--tt); font: 700 11.5px var(--sans); text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.tile { transform-box: fill-box; transform-origin: center; animation: tile-in .5s cubic-bezier(.2, 1.3, .4, 1) both; }
.tile:hover rect { stroke: var(--ink); stroke-width: 1.5; }
.tile.here rect { stroke: var(--ink); stroke-width: 2.5; }
.b4.here rect, .b5.here rect, .b6.here rect { stroke: var(--sun); stroke-width: 3; }   /* ink vanishes on the dark end of the ramp */
.tile.here text { font-weight: 800; }
@keyframes tile-in { from { transform: scale(.55); } to { transform: none; } }
.c1 { animation-delay: 30ms; } .c2 { animation-delay: 60ms; } .c3 { animation-delay: 90ms; } .c4 { animation-delay: 120ms; }
.c5 { animation-delay: 150ms; } .c6 { animation-delay: 180ms; } .c7 { animation-delay: 210ms; } .c8 { animation-delay: 240ms; }
.c9 { animation-delay: 270ms; } .c10 { animation-delay: 300ms; }
.mapcard-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; margin-top: 14px; font-size: 13px; color: var(--muted); }
.mapcard-top b { color: var(--ink); font-weight: 600; }
.legend { display: inline-flex; align-items: center; gap: 4px; font: 500 12px/1 var(--sans); }
.legend span { margin: 0 4px; }
.legend i { display: block; width: 20px; height: 10px; border-radius: 3px; background: var(--t); }

/* the sample rows: what you actually get */
.preview-wrap { position: relative; margin-top: clamp(24px, 3.5vw, 40px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.preview-cap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; padding: 12px 18px; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--line); }
.preview-cap span:first-child { color: var(--ink); font-weight: 600; }
table.preview { width: 100%; min-width: 0; border-collapse: collapse; font-size: 15px; }
table.preview th { position: static; background: transparent; padding: 12px 18px; font: 700 12px/1 var(--sans); color: var(--muted); letter-spacing: .06em; text-transform: uppercase; border-bottom: 1px solid var(--line); }
table.preview td { padding: 12px 18px; border-bottom: 1px solid var(--line); max-width: 260px; white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
table.preview td.mono { font-size: 14px; color: var(--muted); }
table.preview tbody tr:last-child td { border-bottom: 0; }
table.preview tbody tr:hover { background: var(--hover); }
.pv-name { font-weight: 600; }
.only-sm { display: none; }
.pv-mark { text-align: center; width: 84px; }
.pv-mark span[aria-hidden] { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font: 700 13px/1 var(--sans); }
.pv-mark.yes span[aria-hidden] { background: var(--mint); color: var(--mint-ink); }
.pv-mark.no span[aria-hidden] { background: var(--ash); color: var(--ash-ink); font-weight: 500; }

/* --- landing bands ------------------------------------------------------------------ */
.band { max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto; padding: clamp(52px, 7vw, 88px) var(--gutter) 0; }
.band > h2 { margin-bottom: 18px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 28px 48px; align-items: start; }
.split .lede { margin-top: 12px; }
.facts { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.facts > div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px 22px; }
.facts .feature { grid-row: span 3; border: 2px solid var(--frame); background: var(--frame-bg); display: flex; flex-direction: column; justify-content: flex-end; min-height: 240px; }
.facts .feature dt { font-size: clamp(24px, 2.6vw, 30px); font-weight: 800; letter-spacing: -0.025em; color: var(--brand); }
.facts dt { font-weight: 700; font-size: 17px; letter-spacing: -0.01em; margin-bottom: 6px; }
.facts dd { margin: 0; color: var(--muted); font-size: 15px; }
.ticket { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.field { padding: 7px 13px; border-radius: var(--pill); font: 600 13.5px/1.2 var(--sans); background: var(--mint); color: var(--mint-ink); white-space: nowrap; }
.field-opt { background: var(--ash); color: var(--ash-ink); font-weight: 500; }
.band-tips { padding-bottom: 8px; }

/* --- chips, inputs, panels (app) ----------------------------------------------------- */
.chips-wrap { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 13px; border-radius: var(--pill);
  background: var(--surface); border: 1px solid var(--line); font-size: 14px; font-weight: 500; line-height: 1.2; color: var(--ink);
}
.chip .mono { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.chip-link { text-decoration: none; transition: background .12s; }
.chip-link:hover { background: var(--hover); }
.chip-on { background: var(--mint); color: var(--mint-ink); border-color: transparent; font-weight: 600; padding-right: 5px; }
.chip-x { background: transparent; color: inherit; border: 0; border-radius: 50%; width: 22px; height: 22px; font-size: 16px; line-height: 1; cursor: pointer; }
.chip-x:hover { background: color-mix(in srgb, var(--mint-ink) 14%, transparent); }
.chip-check { cursor: pointer; user-select: none; }
.chip-check input { position: absolute; opacity: 0; pointer-events: none; }
.chip-check:hover { background: var(--hover); }
.chip-check:has(input:checked) { background: var(--mint); color: var(--mint-ink); border-color: transparent; font-weight: 600; }
.chip-check:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }

.app-head { max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto; padding: 28px var(--gutter) 22px; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 24px; }
.app-head h1 { font-size: clamp(30px, 4vw, 40px); margin-bottom: 6px; }
.app-head .lede { font-size: 15.5px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px 22px 22px; margin: 0; min-width: 0; }
.panel legend { font-weight: 700; font-size: 18px; letter-spacing: -0.01em; padding: 0; float: left; width: 100%; margin-bottom: 14px; }
.panel legend + * { clear: both; }
.field-label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.input {
  width: 100%; font: 400 15.5px/1.3 var(--sans); color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-sm); padding: 11px 13px;
  transition: border-color .12s, box-shadow .12s;
}
.input::placeholder { color: var(--muted); }
.input:hover { border-color: color-mix(in srgb, var(--muted) 45%, var(--line)); }
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--frame); }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.input-code { font-size: 24px; letter-spacing: .3em; font-weight: 600; }
.row { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.row > * { min-width: 0; }
.grow { flex: 1 1 220px; }
.suffix { display: flex; align-items: center; gap: 10px; }
.suffix .input { width: 150px; flex: none; }
.suffix span { color: var(--muted); font-size: 14px; }
.options { display: grid; gap: 2px; margin: 8px 0; }
.options:empty { display: none; }
.option { display: flex; justify-content: space-between; gap: 12px; text-align: left; font: inherit; font-weight: 500; padding: 9px 12px; border-radius: var(--r-sm); border: 0; background: transparent; color: var(--ink); cursor: pointer; }
.option:hover, .option:focus-visible { background: var(--hover); }
.option-meta { color: var(--muted); font-size: 13px; font-weight: 400; white-space: nowrap; }
#cat-results { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 4px; }
#chips { margin-top: 12px; }
#chips:empty { display: none; }
.more { margin-top: 14px; }
.more summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--muted); padding: 4px 0; }
.more summary:hover { color: var(--ink); }
.more[open] summary { margin-bottom: 12px; }
.more-panel summary { font-weight: 700; font-size: 18px; color: var(--ink); letter-spacing: -0.01em; }
.more-panel[open] > * + * { margin-top: 16px; }
.hint { font-weight: 400; }
.states { display: grid; grid-template-columns: repeat(auto-fill, minmax(50px, 1fr)); gap: 5px; }
.states.nations { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.state input { position: absolute; opacity: 0; }
.state span { display: block; text-align: center; font: 600 13px/1 var(--sans); padding: 9px 0; border-radius: var(--r-sm); background: var(--paper); color: var(--muted); cursor: pointer; }
.state span:hover { background: var(--hover); color: var(--ink); }
.state input:checked + span { background: var(--mint); color: var(--mint-ink); }
.state input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }

.toggle { display: flex; gap: 12px; align-items: flex-start; padding: 11px 0; cursor: pointer; border-top: 1px solid var(--line); }
.toggle:first-of-type { border-top: 0; padding-top: 0; }
.toggle input[type=checkbox] { position: absolute; opacity: 0; }
.toggle-ui { flex: none; width: 40px; height: 24px; border-radius: var(--pill); background: var(--sage); position: relative; transition: background .15s; margin-top: 1px; }
.toggle-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .15s; }
.toggle input:checked + .toggle-ui { background: var(--brand); }
.toggle input:checked + .toggle-ui::after { transform: translateX(16px); background: var(--brand-ink); }
.toggle input:focus-visible + .toggle-ui { outline: 2px solid var(--brand); outline-offset: 2px; }
.toggle-title { font-weight: 600; }
.panel .row { margin-top: 14px; }
.seg { display: inline-flex; background: var(--hover); border-radius: var(--pill); padding: 3px; gap: 2px; }
.seg input { position: absolute; opacity: 0; }
.seg span { display: block; padding: 8px 16px; border-radius: var(--pill); font: 600 13px/1 var(--sans); color: var(--muted); cursor: pointer; }
.seg input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(35,38,31,.12); }
.seg input:focus-visible + span { outline: 2px solid var(--brand); }

/* --- the frame: a pale-green border around live data, with a white sheet inside ---------- */
.frame { border: 2px solid var(--frame); background: var(--frame-bg); border-radius: var(--r-lg); padding: 0 6px 6px; min-width: 0; }
.frame-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 8px 10px 10px; }
.frame-name { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.frame-name svg { width: 18px; height: 18px; color: var(--brand); }
.sheet { background: var(--surface); border-radius: 16px; padding: 22px; }
.live { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: var(--pill); background: var(--surface); color: var(--muted); font-size: 12.5px; font-weight: 600; }
.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--brand); }
.live-busy { display: none; }
.dash:has(#spec.htmx-request) .live-idle { display: none; }
.dash:has(#spec.htmx-request) .live-busy { display: inline; }
.dash:has(#spec.htmx-request) .live::before { animation: blink .8s ease-in-out infinite alternate; }
@keyframes blink { to { opacity: .25; } }

/* --- the live-count card ------------------------------------------------------------- */
.summary { position: relative; }
.summary-what { font-size: 14px; color: var(--muted); margin-bottom: 10px; }
.summary-count { line-height: 1.1; }
.summary-count mark.count { font-size: clamp(36px, 4vw, 50px); margin: 0; animation: none; }   /* the builder count rolls (main.js) instead of popping */
.summary-label { color: var(--muted); font-size: 14px; margin: 10px 0 18px; }
.summary-empty { color: var(--muted); }
.summary .help.center { margin-top: 10px; }

/* --- build results -------------------------------------------------------------------- */
.result { max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.result:empty { display: none; }
.result:not(:empty) { margin-bottom: 20px; }
.build { background: var(--surface); border-radius: var(--r); border: 1px solid var(--line); padding: 24px; }
.build-done { border: 2px solid var(--frame); }
.build + .build { margin-top: 14px; }
.build h2 { font-size: 30px; }
.build-what { color: var(--muted); font-size: 14px; margin-bottom: 6px; }
.build-stage { font-weight: 700; font-size: 20px; margin-bottom: 14px; }
.build-error { border-color: var(--clay); background: color-mix(in srgb, var(--clay) 25%, var(--surface)); }
.build-login .login-form { margin-top: 18px; max-width: 520px; }
.build-login h2 { margin-bottom: 8px; }
progress { width: 100%; height: 10px; appearance: none; border: 0; border-radius: var(--pill); background: var(--hover); overflow: hidden; }
progress::-webkit-progress-bar { background: var(--hover); }
progress::-webkit-progress-value { background: var(--brand); border-radius: var(--pill); transition: width .4s; }
progress::-moz-progress-bar { background: var(--brand); border-radius: var(--pill); }
.build-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.funnel { list-style: none; padding: 0; margin: 20px 0; display: flex; flex-wrap: wrap; gap: 8px; }
.funnel li { display: flex; align-items: baseline; background: var(--paper); border-radius: var(--r-sm); padding: 12px 16px; font-size: 14px; color: var(--muted); }
.funnel li .mono { font-size: 22px; color: var(--ink); font-weight: 800; letter-spacing: -0.02em; margin-right: 6px; }
.funnel li + li::before { content: "→"; margin-right: 8px; color: var(--muted); }
.funnel li.funnel-final .mono { background: var(--sun); color: var(--sun-ink); padding: 0 .22em; border-radius: .2em; }
.table-wrap { overflow: auto; max-height: 420px; border: 1px solid var(--line); border-radius: var(--r-sm); }
table { border-collapse: collapse; font-size: 13.5px; width: max-content; min-width: 100%; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
th { position: sticky; top: 0; background: var(--surface); font: 700 11.5px/1 var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.ask { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
.thanks { margin-top: 22px; color: var(--mint-ink); font-weight: 600; }

/* --- tips ----------------------------------------------------------------------------- */
.tips { margin-top: 24px; }
.tips-lede { font-weight: 600; margin-bottom: 12px; }
.band-tips .tips-lede { font-weight: 800; font-size: clamp(22px, 2.6vw, 28px); line-height: 1.2; letter-spacing: -0.02em; max-width: 30ch; margin-bottom: 18px; }
.tips-row { display: flex; flex-wrap: wrap; gap: 10px; }
.tip {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px;
  align-items: center; padding: 12px 20px 12px 14px; border-radius: var(--r); text-decoration: none;
  background: var(--surface); border: 1px solid var(--line); transition: background .15s;
}
.tip:hover { background: var(--hover); }
.tip-emoji { grid-row: 1 / 3; font-size: 28px; line-height: 1; }
.tip-label { font-weight: 600; font-size: 15px; }
.tip-price { color: var(--muted); font-size: 13px; }

/* --- login, lists ------------------------------------------------------------------- */
.narrow { max-width: 520px; margin: 0 auto; padding: clamp(40px, 8vw, 96px) var(--gutter) 0; }
.narrow h1 { font-size: clamp(36px, 5vw, 48px); margin-bottom: 10px; }
.narrow .lede { margin-bottom: 24px; }
.login-form .row { margin-bottom: 4px; align-items: stretch; }
.me-login[aria-current="page"] { color: var(--ink); font-weight: 600; }
.lists { list-style: none; margin: 0 auto; max-width: calc(var(--max) + 2 * var(--gutter)); padding: 0 var(--gutter); display: grid; gap: 10px; }
.list-row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; }
.list-what { font-weight: 600; }
.list-meta { color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.list-actions { display: flex; gap: 8px; }
.badge { display: inline-block; margin-left: 6px; background: var(--sun); color: var(--sun-ink); padding: 3px 9px; border-radius: var(--pill); font-size: 12px; font-weight: 600; }
.empty { max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); display: grid; gap: 16px; justify-items: start; }

/* --- htmx states ----------------------------------------------------------------------- */
.htmx-request .summary-count, .summary.htmx-request .summary-count { opacity: .45; transition: opacity .2s; }
#hero-result.htmx-swapping, form.htmx-request + #hero-result { opacity: .5; transition: opacity .2s; }

/* --- responsive ------------------------------------------------------------------------ */
@media (max-width: 1100px) {
}
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .mapcard { order: 2; }
}
/* below 900px the sidebar becomes a top bar: brand left, links right, no footer block */
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidenav { position: static; height: auto; flex-direction: row; align-items: center; gap: 8px; padding: 10px var(--gutter); border-right: 0; border-bottom: 1px solid var(--line); overflow: visible; }
  .brand { padding: 0; margin-right: auto; }
  .sidenav-links { display: flex; gap: 2px; }
  .sidenav-links a { padding: 8px 10px; }
  .sidenav-links svg, .sidenav-links a[href="/"] { display: none; }
  .sidenav-links a[aria-current="page"]::before { display: none; }   /* the side marker has no side to sit on in the top bar */
  .sidenav-foot { margin: 0; display: flex; align-items: center; }
  .sidenav-data, .me-email, .me .inline { display: none; }
  .me { display: block; padding: 0; border: 0; }
  .me-login { border: 0; padding: 8px 10px; }
  .me-login svg { display: none; }
  .split { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .hide-sm { display: none; }
  table.preview th, table.preview td { padding: 11px 14px; max-width: none; }
  .pv-mark { width: 64px; }
  .only-sm { display: block; }
  .pv-sub { font-size: 12.5px; font-weight: 400; color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }
  .facts .feature { min-height: 0; }
}
@media (max-width: 600px) {
  .facts { grid-template-columns: minmax(0, 1fr); }
  .facts .feature { grid-row: auto; }
  .sticker { width: 48px; height: 48px; }
  .funnel li + li::before { content: none; }
  .tile text { font-size: 12.5px; }
  .sheet { padding: 18px; }
}
@media (max-width: 440px) {
  .brand span { display: none; }        /* the mascot is the logo; the words don't fit next to the links */
  .sidenav-links a, .me-login { padding: 8px 8px; font-size: 14.5px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* off-screen measuring span for the hero field autosize fallback in main.js */
.sizer { position: absolute; left: -9999px; top: 0; visibility: hidden; white-space: pre; }
.slot-city input::-webkit-calendar-picker-indicator { display: none !important; }
.login-inline h2 { font-size: 24px; margin-bottom: 6px; }
.login-inline .login-form { margin-top: 16px; }
.login-inline .row { flex-direction: column; align-items: stretch; }
.login-inline .grow { flex: none; }

/* --- API page ---------------------------------------------------------------------- */
.api-hero { max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto; padding: clamp(28px, 5vw, 60px) var(--gutter) 26px; }
.api-hero h1 { font-size: clamp(40px, 6.4vw, 76px); letter-spacing: -0.04em; margin-bottom: 12px; }
.api-grid { max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.picker { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 24px; display: grid; gap: 14px; min-width: 0; }
.picker h2, .panel-h { font-size: 22px; letter-spacing: -0.015em; }
.support-cards { display: grid; gap: 8px; }
.support-card { border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; background: var(--surface); transition: border-color .15s, background .15s; }
.support-card:hover { background: var(--hover); }
.support-card:has([data-group]:checked) { border: 2px solid var(--frame); background: var(--frame-bg); padding: 13px 15px; }
.support-head { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; cursor: pointer; align-items: center; }
.support-head input { position: absolute; opacity: 0; }
.support-head:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 4px; border-radius: var(--r-sm); }
.support-emoji { grid-row: 1 / 3; font-size: 30px; line-height: 1; }
.support-title { font-weight: 700; font-size: 17px; }
.support-blurb { color: var(--muted); font-size: 14px; }
.support-detail { display: none; margin-top: 12px; }
.support-card:has([data-group]:checked) .support-detail { display: block; }
.slider { width: 100%; accent-color: var(--brand); }
.slider-labels { display: flex; justify-content: space-between; font: 600 13px/1 var(--sans); color: var(--muted); margin-top: 6px; }
.slider-labels .on { color: var(--ink); font-weight: 800; }
.support-summary { border-top: 1px solid var(--line); padding-top: 14px; }
.support-summary p:first-child { font-size: 17px; font-weight: 600; }
.support-summary mark.count { font-size: 28px; }
.api-side { display: grid; gap: 14px; min-width: 0; }
.api-side > * { min-width: 0; }
.api-side .panel h2 { margin-bottom: 10px; }
.api-side .mono, .picker .mono { font-family: var(--code); font-size: .92em; }
/* Code stays dark in both themes. */
.code { background: var(--code-bg); color: var(--code-ink); border-radius: var(--r-sm); padding: 14px 16px; overflow-x: auto; font: 13px/1.6 var(--code); margin: 8px 0 12px; white-space: pre; scrollbar-color: #3E5432 transparent; }
.key-raw { font-size: 14px; white-space: pre-wrap; word-break: break-all; padding-right: 96px; }
.copy-wrap { position: relative; }
.copy-btn { display: none; position: absolute; top: 8px; right: 8px; font: 600 12px/1 var(--sans); padding: 7px 11px;
  border: 0; border-radius: var(--pill); background: #A9CC86; color: #15210D; cursor: pointer; }
.js .copy-btn { display: inline-block; }
.js .copy-wrap .code { padding-top: 42px; }     /* the Copy button gets its own strip instead of covering the command */
.js .copy-wrap .key-raw { padding-top: 14px; }  /* the key wraps, so its right padding already clears the button */
#key-result:empty { display: none; }
.copy-btn:focus-visible { outline: 2px solid #F7E7A1; outline-offset: 2px; }
.key-new { border: 2px solid var(--frame); background: var(--frame-bg); }
.keys { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.keys li { display: flex; flex-wrap: wrap; gap: 4px 12px; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); padding-top: 10px; }
.keys li:first-child { border-top: 0; padding-top: 0; }
@media (max-width: 900px) { .api-grid { grid-template-columns: minmax(0, 1fr); } }
.picks-label { margin-top: 14px; }

/* landing category menu (replaces the native popup) */
.slot-cat { position: relative; }
.slot-btn {
  font: inherit; letter-spacing: inherit; color: var(--brand); background: transparent; cursor: pointer;
  border: 0; border-bottom: .06em solid var(--frame); padding: 0 .55em 0 .08em; margin: 0; text-align: left;
}
.slot-btn:focus-visible { outline: none; background: var(--frame-bg); border-bottom-color: var(--brand); border-radius: .1em .1em 0 0; }
.slot-cat::after { display: block; }
.slot-menu {
  position: absolute; z-index: 20; top: calc(100% + 10px); left: 0; width: min(360px, 86vw);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 24px 60px -24px rgba(35,38,31,.4);
  padding: 8px; font: 400 15.5px/1.4 var(--sans); letter-spacing: normal; color: var(--ink);
}
.slot-menu-list { display: grid; gap: 1px; max-height: 320px; overflow: auto; margin-top: 6px; }
.slot-menu .option { font-size: 15px; }
/* the menu's search box sits inside .slot, so undo the headline-input styling */
.slot .slot-menu .input {
  field-sizing: fixed; width: 100%; font: 400 15.5px/1.3 var(--sans); letter-spacing: normal; color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; background: var(--surface); cursor: text;
}
.slot .slot-menu .input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--frame); }

/* list feedback */
.feedback { margin-top: 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.feedback form:not(.inline) { display: grid; gap: 10px; width: 100%; }
.feedback-q { font-weight: 600; }
.feedback-thanks { color: var(--mint-ink); font-weight: 600; }
.thumb { font-size: 20px; line-height: 1; background: var(--surface); border: 1px solid var(--line); border-radius: var(--pill); padding: 7px 13px; cursor: pointer; transition: background .12s; }
.thumb:hover { background: var(--hover); }
.list-row .feedback { margin-top: 8px; }
.feedback form .btn { justify-self: start; }

/* --- US / UK switch ------------------------------------------------------------------- */
.country-switch { display: inline-flex; background: var(--hover); border-radius: var(--pill); padding: 3px; gap: 2px; }
.country-switch a { font: 600 13px/1 var(--sans); padding: 8px 15px; border-radius: var(--pill); color: var(--muted); text-decoration: none; }
.country-switch a:hover { color: var(--ink); }
.country-switch a.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(35,38,31,.12); }

/* --- industry browser (builder) --------------------------------------------------------- */
.chip-industry { cursor: pointer; font: inherit; font-size: 14px; font-weight: 500; }
.chip-industry:hover { background: var(--hover); }
.chip-industry[aria-expanded="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip-industry[aria-expanded="true"] .mono { color: inherit; opacity: .75; }
.industry-panel:empty { display: none; }
.industry-panel { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 14px; display: grid; gap: 10px; }
.industry-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.industry-list { max-height: 320px; overflow-y: auto; overscroll-behavior: contain; }
.option.is-added { background: var(--mint); color: var(--mint-ink); }   /* not dimmed: faded text fails contrast */
.option.is-added .option-meta { color: inherit; }
.option.is-added span:first-child::after { content: " ✓"; }
@media (prefers-reduced-motion: reduce) { mark.count { animation: none; } }

/* --- backstage stats (/backstage/stats/) ----------------------------------------------
   Built to be screenshotted: a framed hero with the signup number on a sun block, then four
   chart cards. Charts are server-drawn SVG; colors come from the tokens, so dark mode applies
   without rules of its own. */
.stats-page main { max-width: calc(var(--max) + 2 * var(--gutter)); width: 100%; margin: 0 auto; padding: 24px var(--gutter) 56px; }
.st-hero { border: 2px solid var(--frame); background: var(--frame-bg); border-radius: 26px; padding: clamp(22px, 3.6vw, 44px); margin: 0 0 18px; }
.st-hero .eyebrow { margin-bottom: 12px; }
.st-hero h1 { font-weight: 800; font-size: clamp(28px, 4.2vw, 52px); line-height: 1.08; letter-spacing: -0.035em; max-width: 18ch; }
.st-big { display: inline-block; background: var(--sun); color: var(--sun-ink); padding: 0 .16em; border-radius: .16em; font-size: 1.45em; line-height: 1.05; margin-right: .08em; }
.st-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: clamp(20px, 3vw, 30px) 0 0; }
.st-row div { background: var(--surface); border-radius: var(--r-sm); padding: 14px 16px; }
.st-row dt { font: 600 13px/1.2 var(--sans); color: var(--muted); }
.st-row dd { margin: 6px 0 0; font: 800 clamp(24px, 2.8vw, 34px)/1 var(--sans); letter-spacing: -0.02em; }
.st-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.st-card { position: relative; margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: clamp(18px, 2.2vw, 24px); min-width: 0; }
.st-card.st-panel { border: 2px solid var(--frame); background: var(--frame-bg); }
.st-wide { grid-column: 1 / -1; }
.st-card figcaption { display: grid; gap: 2px; margin-bottom: 14px; }
.st-title { font-weight: 700; font-size: clamp(17px, 1.8vw, 20px); letter-spacing: -0.01em; }
.st-sub { font-size: 13px; color: var(--muted); }
.st-svg { display: block; width: 100%; height: auto; overflow: visible; }
.st-grid-line { stroke: var(--line); stroke-width: 1; }
.st-axis { fill: var(--muted); font: 500 11px var(--sans); dominant-baseline: middle; }
.st-line { fill: none; stroke: var(--brand); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.st-area { fill: var(--brand); opacity: .1; }
.st-end { fill: var(--brand); stroke: var(--surface); stroke-width: 2; }
.st-cross { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; pointer-events: none; }
.st-bar { fill: var(--brand); }
.st-hit { fill: transparent; }
.st-col:hover .st-bar, .st-col:focus .st-bar, .st-hrow:hover .st-bar, .st-hrow:focus .st-bar { opacity: .75; }
.st-col:hover .st-hit, .st-col:focus .st-hit { fill: var(--hover); }
.st-label { fill: var(--ink); font: 500 13px var(--sans); dominant-baseline: middle; }
.st-value { fill: var(--ink); font: 700 13px var(--sans); dominant-baseline: middle; }
.st-map { max-width: 520px; margin: 0 auto; }
.st-foot { margin-top: 12px; font-size: 13px; color: var(--muted); }
.st-tip { position: absolute; z-index: 5; pointer-events: none; background: var(--ink); color: var(--paper); font: 600 12.5px/1.3 var(--sans); padding: 6px 9px; border-radius: 8px; white-space: nowrap; transform: translate(-50%, calc(-100% - 10px)); }
.st-card [tabindex]:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.st-table { margin-top: 20px; }
.st-table summary { cursor: pointer; font-weight: 600; }
.st-table table { margin-top: 10px; border-collapse: collapse; font-size: 14px; }
.st-table th, .st-table td { text-align: right; padding: 4px 14px 4px 0; border-bottom: 1px solid var(--line); }
.st-table th[scope="row"], .st-table thead th:first-child { text-align: left; }
.st-note { margin-top: 14px; }
@media (max-width: 760px) {
  .st-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .st-grid { grid-template-columns: 1fr; }
}

/* --- dashboard pages (builder, lists): a header bar, then dense cards in one grid ---------- */
.page-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px;
  padding: 16px var(--gutter); background: var(--surface); border-bottom: 1px solid var(--line); margin-bottom: 20px;
}
.page-bar h1 { font-size: 21px; font-weight: 700; letter-spacing: -0.015em; }
.page-bar p { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; margin: 0; min-width: 0; }
.card-title { font-size: 15.5px; font-weight: 700; letter-spacing: -0.01em; padding: 0; margin-bottom: 12px; }
fieldset.card > legend.card-title { float: left; width: 100%; }
fieldset.card > legend + * { clear: both; }
.card-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; margin-bottom: 12px; }
.card-head .card-title { margin: 0; }
.card-note { color: var(--muted); font-size: 13px; }
.card-empty { color: var(--muted); font-size: 14px; padding: 18px 0 6px; }

.dash {
  max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter);
  display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 14px; align-items: start;
  grid-template-areas: "what count" "where count" "quality count" "cols count" "sample sample";
}
.dash-form { display: contents; }
.dash-what { grid-area: what; }
.dash-where { grid-area: where; }
.dash-quality { grid-area: quality; }
.dash-cols { grid-area: cols; }
.dash-sample { grid-area: sample; padding-bottom: 6px; }
.dash-count { grid-area: count; position: sticky; top: 16px; }
.dash .input { padding: 10px 12px; font-size: 15px; }
.dash .chip { padding: 6px 12px; font-size: 13.5px; }
.dash .more { margin-top: 12px; }

/* the settings row: city, radius, confidence, chains side by side */
.fields { display: grid; grid-template-columns: minmax(170px, 1.6fr) minmax(100px, .7fr) minmax(120px, .8fr) minmax(170px, 1fr); gap: 12px; align-items: end; }
.fields .field-label { font-size: 13px; }
.fields .suffix .input { width: 100%; min-width: 0; flex: 1; }
.fields .suffix span { font-size: 13px; }
.dash-where > .help { margin-top: 8px; }

/* quality switches in a grid instead of a long list */
.toggles { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 4px 20px; }
.toggles .toggle, .toggles .toggle:first-of-type { border-top: 0; padding: 8px 0; }
.dash-cols[open] > .toggles { margin-top: 12px; }
.dash-cols > summary.card-title { margin: 0; cursor: pointer; font-size: 15.5px; font-weight: 700; letter-spacing: -0.01em; }
.dash-cols[open] > summary.card-title { margin-bottom: 14px; }

/* the gauge: complete rows out of rows with a website (a real ratio, never decoration) */
.gauge { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 16px; align-items: center; margin: 4px 0 18px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-sm); }
.donut { width: 92px; height: 92px; transform: rotate(-90deg); }
.donut circle { fill: none; stroke-width: 4.2; }
.donut-track { stroke: var(--frame); }
.donut-fill { stroke: var(--brand); stroke-linecap: round; transition: stroke-dasharray .5s ease; }
.donut-pct { transform: rotate(90deg); transform-origin: 18px 18px; fill: var(--ink); font: 800 8.5px var(--sans); text-anchor: middle; dominant-baseline: central; }
.legend-list { margin: 0; display: grid; gap: 6px; }
.legend-list > div { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; }
.legend-list dt { color: var(--muted); display: flex; align-items: center; gap: 7px; }
.legend-list dd { margin: 0; font-weight: 700; }
.key { width: 9px; height: 9px; border-radius: 3px; background: var(--sage); flex: none; }
.key-fill { background: var(--brand); }
.key-track { background: var(--frame); }

/* small pills inside tables */
.pill { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: var(--pill); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.pill-sage { background: var(--sage); color: var(--sage-ink); }
.pill-mint { background: var(--mint); color: var(--mint-ink); }
.dash-sample table.preview { font-size: 14px; }
.dash-sample table.preview th { padding: 10px 14px; }
.dash-sample table.preview td { padding: 10px 14px; }
.dash-sample table.preview th:first-child, .dash-sample table.preview td:first-child { padding-left: 0; }
.dash-sample .pv-sub { display: block; font-weight: 400; color: var(--muted); font-size: 12.5px; margin-top: 1px; }
.dash-sample .pv-sub.only-sm { display: none; }
#sample.htmx-request table { opacity: .55; transition: opacity .2s; }

@media (max-width: 1100px) {
  .dash { grid-template-columns: minmax(0, 1fr) 320px; }
  .fields { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .dash { grid-template-columns: minmax(0, 1fr); grid-template-areas: "count" "what" "where" "quality" "cols" "sample"; }
  .dash-count { position: static; }
  .page-bar { margin-bottom: 14px; }
}
@media (max-width: 720px) {
  .dash-sample .pv-sub.only-sm { display: block; }
}
@media (max-width: 480px) {
  .fields { grid-template-columns: minmax(0, 1fr); }
  .gauge { grid-template-columns: 72px minmax(0, 1fr); gap: 12px; }
  .donut { width: 72px; height: 72px; }
}
