/* Palette, taken from the street: zoning-map paper, newsprint ink, and the tomato red of a restaurant awning as
   the one accent. Red marks Qloo and the main action and nothing else; steel blue marks city records and every
   baseline. Solid surfaces, no gradients, glass or glows; text pairs are 4.5:1 or better.
   Day (paper) is the default; the switch in the nav sets data-theme="night". Print uses white paper. */
:root {
  --bg: #F2EDE3;
  --surface: #FBF8F2;
  --solid: #FBF8F2;
  --chart: #FBF8F2;
  --field: #EDE6D9;
  --well: #E6DECF;
  --ink: #1A1814;
  --ink-2: #2E2A24;
  --muted: #5C554A;
  --faint: #6E665A;
  --rule: #DDD4C4;
  --rule-2: #C5BAA6;
  --city: #2B5C8A;
  --qloo: #B8361A;
  --qloo-hover: #9C2C13;
  --on-qloo: #FFFFFF;
  --base: #6A89A8;
  --city-tint: #E3EAF1;
  --qloo-tint: #F6DDD3;
  --board: #16140F;
  --board-ink: #FFB547;
  --ok: #1F7A4A;
  --warn: #8A5A00;
  --err: #A3261B;
  --shadow: none;
  --map-filter: grayscale(1) sepia(.18) contrast(.95) brightness(1.03);
  --h-bg: transparent; --h-ink: var(--ink); --h-muted: var(--muted); --h-rule: var(--rule);
  --display: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --body: "Geist", "Helvetica Neue", Arial, sans-serif;
  --ui: "Geist", "Helvetica Neue", Arial, sans-serif;
  --mono: "Geist", "Helvetica Neue", Arial, sans-serif;   /* no monospace costume: figures use tabular nums */
  --code: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --pad: clamp(16px, 4vw, 56px);
  --max: 1320px;
  --nav: 60px;
  color-scheme: light;
  scrollbar-color: var(--rule-2) var(--bg);
}
:root[data-theme="night"] {
  --bg: #15130F; --surface: #1F1C17; --solid: #1F1C17; --chart: #1F1C17; --field: #2A261F; --well: #2A261F;
  --ink: #F2EDE3; --ink-2: #E2DBCD; --muted: #B5AC9C; --faint: #9C9384; --rule: #34302A; --rule-2: #4A443B;
  --city: #8DB4DA; --qloo: #F0704E; --qloo-hover: #F58C6F; --on-qloo: #15130F; --base: #7F9DBA;
  --city-tint: #1E2A36; --qloo-tint: #3A2219; --board: #0B0A08;
  --ok: #6FD39B; --warn: #E6B552; --err: #FF8A78;
  --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 12px 30px -16px rgba(0, 0, 0, .7);
  --map-filter: grayscale(1) invert(1) brightness(.9) contrast(.9);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--nav) + 16px); background: var(--bg); }
body {
  margin: 0; color: var(--ink); min-height: 100vh; background: var(--bg);
  font: 400 16px/1.55 var(--body); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; font-kerning: normal;
}
.scroll-bar { position: fixed; left: 0; top: 0; height: 2px; width: 100%; transform-origin: left; transform: scaleX(0); z-index: 1300; background: var(--qloo); pointer-events: none; }

h1, h2, h3, h4 { margin: 0; line-height: 1.15; font-weight: 600; letter-spacing: -.01em; }
p { margin: 0; }
a { color: inherit; text-decoration-color: var(--rule-2); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
button { font: inherit; cursor: pointer; color: inherit; }
::selection { background: var(--ink); color: var(--bg); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 4px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 2000; background: var(--ink); color: var(--bg); padding: .5rem .9rem; border-radius: 8px; }
.skip:focus { left: 8px; }

/* ---------- navigation ---------- */
.nav {
  position: sticky; top: 0; z-index: 1200; height: var(--nav);
  display: flex; align-items: center; gap: 1.2rem;
  padding: 0 max(var(--pad), calc((100% - var(--max)) / 2));
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--rule);
}
.logo { display: inline-flex; align-items: center; gap: .55rem; font-weight: 600; letter-spacing: -.01em; text-decoration: none; }
.logo-mark { width: 16px; height: 16px; border: 2.5px solid currentColor; display: inline-block; flex: none; }
.nav-links { display: flex; gap: .15rem; margin-left: auto; }
.nav-links a { text-decoration: none; color: var(--muted); font-size: .9rem; font-weight: 500; padding: .4rem .7rem; border-radius: 999px; white-space: nowrap; }
.nav-links a:hover, .nav-links a[aria-current="true"] { color: var(--ink); background: color-mix(in srgb, var(--ink) 7%, transparent); }
.nav-tools { display: flex; align-items: center; gap: .6rem; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: none; border: 1px solid var(--rule-2); color: var(--ink); flex: none; }
.icon-btn:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ---------- header: headline on the left, the tool on the right ---------- */
.top {
  position: relative; overflow: hidden; isolation: isolate;
  background: var(--h-bg); color: var(--h-ink);
  padding: clamp(1.8rem, 3.6vw, 3.2rem) var(--pad) 0;
  border-bottom: 1px solid var(--h-rule);
}
.grid-art {
  position: absolute; inset: 0; z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .06) 1px, transparent 1px);
  background-size: 56px 56px; background-position: -1px -1px;
  -webkit-mask-image: radial-gradient(90% 80% at 20% 0%, #000 0%, transparent 75%);
  mask-image: radial-gradient(90% 80% at 20% 0%, #000 0%, transparent 75%);
}
.hero {
  max-width: var(--max); margin-inline: auto;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(400px, 500px); gap: clamp(2rem, 5vw, 4.5rem); align-items: center;
}
.eyebrow { font: 500 .72rem var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--h-muted); }
.eyebrow span { color: var(--h-ink); margin-left: .8rem; padding-left: .8rem; border-left: 1px solid var(--h-rule); white-space: nowrap; }
.wordmark { font: 400 clamp(2.7rem, 6.2vw, 5.6rem)/.98 var(--display); letter-spacing: -.025em; margin: 1.1rem 0 0; text-wrap: balance; }
.wordmark em { font-style: italic; color: var(--h-muted); }
.lede { max-width: 54ch; margin: 1.4rem 0 0; color: var(--h-muted); font-size: 1.06rem; }
.src { font-weight: 600; color: var(--ink); padding: 0 .1em; border-bottom: 2px solid; }
.src.city { border-color: var(--city); }
.src.qloo { border-color: var(--qloo); }
.top .lede .src { color: var(--h-ink); }
.top .lede .src.city { border-color: #8AA0FF; }
.top .lede .src.qloo { border-color: #FF7FB0; }
.points { list-style: none; margin: 1.6rem 0 0; padding: 0; display: grid; gap: .5rem; color: var(--h-muted); font-size: .92rem; }
.points li { display: grid; grid-template-columns: 1.4rem 1fr; align-items: baseline; }
.points b { color: var(--h-ink); font-weight: 600; }
.points li::before { content: ""; width: 8px; height: 8px; border: 1.5px solid var(--h-ink); align-self: center; }
.stats {
  max-width: var(--max); margin: clamp(1.8rem, 3.6vw, 3rem) auto 0;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--h-rule);
}
.stats > div { padding: 1.1rem 1rem 1.3rem 0; }
.stats > div + div { padding-left: 1.2rem; border-left: 1px solid var(--h-rule); }
.stats dt { font: 500 .68rem var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--h-muted); }
.stats dd { margin: .3rem 0 0; font: 400 clamp(1.7rem, 3.2vw, 2.6rem)/1 var(--display); font-variant-numeric: tabular-nums; }

/* ---------- shared pieces ---------- */
.panel { background: var(--surface); color: var(--ink); border: 1px solid var(--rule); border-radius: 16px; padding: 22px; box-shadow: var(--shadow); }
.ph { font-size: 1.08rem; font-weight: 600; }
.band { padding: clamp(2.5rem, 6vw, 4.5rem) var(--pad); }
.band > * { max-width: var(--max); margin-inline: auto; }
.band + .band { border-top: 1px solid var(--rule); }
/* the audit is the heaviest band and the last: skip its layout and paint until it nears the viewport */

.band-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem 2.5rem; flex-wrap: wrap; margin-bottom: 1.6rem; }
.band-head.second { margin-top: clamp(2.5rem, 5vw, 4rem); }
.band-head h2, .evidence > h2 { font: 400 clamp(2rem, 4.2vw, 3.2rem)/1.02 var(--display); letter-spacing: -.02em; }
.band-head .hint { max-width: 46ch; margin: 0; }
.hint { font-size: .86rem; color: var(--muted); margin: .4rem 0 .5rem; }
label { display: block; font-size: .84rem; font-weight: 600; margin: .9rem 0 .3rem; }
.count { float: right; font: 400 .72rem var(--mono); color: var(--faint); margin-top: .15rem; }
input, select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--field);
  border: 1px solid var(--rule); border-radius: 10px; padding: .6rem .7rem;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
textarea { resize: vertical; min-height: 4.6rem; line-height: 1.45; display: block; }
input:hover, select:hover, textarea:hover { border-color: var(--rule-2); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); background: var(--surface); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 12%, transparent); }
input::placeholder { color: var(--faint); }
.primary {
  width: 100%; padding: .8rem 1rem; border: 1px solid var(--ink); border-radius: 12px;
  background: var(--ink); color: var(--bg); font-weight: 600; transition: transform .12s ease, opacity .15s ease;
}
.primary:hover:not(:disabled) { opacity: .88; }
.primary:active:not(:disabled) { transform: scale(.985); }
.primary:disabled { opacity: .45; cursor: not-allowed; }
.primary.busy { cursor: progress; }
.quiet { background: none; border: 1px solid var(--rule-2); border-radius: 10px; padding: .45rem .75rem; color: var(--ink); font-weight: 500; }
.quiet:hover:not(:disabled) { border-color: var(--ink); }
.quiet:disabled { opacity: .5; cursor: not-allowed; }
.quiet.small { font-size: .82rem; padding: .3rem .7rem; border-radius: 999px; white-space: nowrap; }
.form-error { color: var(--err); font-size: .9rem; margin: .7rem 0 0; padding: .55rem .7rem; border: 1px solid color-mix(in srgb, var(--err) 35%, transparent); border-radius: 10px; background: color-mix(in srgb, var(--err) 7%, transparent); }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chips button { background: none; border: 1px solid var(--rule-2); border-radius: 999px; padding: .26rem .7rem; font-size: .8rem; color: var(--ink-2); transition: background .15s ease, color .15s ease, border-color .15s ease; }
.chips button:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.toggle { display: inline-flex; border: 1px solid var(--rule); border-radius: 999px; padding: 3px; background: var(--field); }
.toggle button { border: 0; background: none; padding: .35rem .9rem; border-radius: 999px; color: var(--muted); font-weight: 500; font-size: .86rem; white-space: nowrap; transition: background .15s ease, color .15s ease; }
.toggle button:hover { color: var(--ink); }
.toggle button[aria-checked="true"] { background: var(--ink); color: var(--bg); }
.toggle button[aria-checked="true"][data-mode="city"] { background: var(--city); color: var(--surface); }
.toggle button[aria-checked="true"][data-mode="qloo"] { background: var(--qloo); color: var(--surface); }
.rank-head { display: flex; justify-content: space-between; align-items: center; gap: .6rem 1rem; flex-wrap: wrap; }
summary { cursor: pointer; font-weight: 600; }

/* ---------- the form ---------- */
/* compact enough to sit above the fold on a 768 px tall laptop */
.inputs label { margin-top: .7rem; }
.inputs { padding: 22px 24px; box-shadow: 0 24px 60px -24px rgba(0, 0, 0, .6); }
.inputs h2 { font: 400 1.9rem/1 var(--display); letter-spacing: -.01em; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 .8rem; }
.examples { margin-top: .6rem; }
.mode-toggle { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; border-radius: 12px; }
.mode-toggle button { padding: .5rem .3rem; font-size: .84rem; border-radius: 9px; }
.leases { list-style: none; padding: 0; margin: 0 0 .6rem; display: grid; gap: .45rem; }
.leases li { display: flex; gap: .4rem; }
.leases .num { font: 500 .78rem var(--mono); width: 1.3rem; flex: none; align-self: center; color: var(--faint); }
.leases button { flex: none; width: 2.5rem; padding: 0; font-size: 1.1rem; line-height: 1; }
.run-row { display: flex; gap: .5rem; margin-top: 1.1rem; }
#stop { flex: none; padding: .8rem 1rem; border-radius: 12px; }
.run-hint { margin: .6rem 0 0; }

/* ---------- saved runs ---------- */
.golden { list-style: none; padding: 0; margin-block: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.golden li { display: grid; }
.golden li.hint { margin: 0; }
.golden button {
  text-align: left; background: var(--surface); border: 1px solid var(--rule); border-radius: 14px; padding: 1rem 1.1rem; color: var(--ink);
  display: grid; grid-template-columns: 1fr auto; gap: .5rem .8rem; align-content: space-between; min-height: 112px;
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.golden button:hover { border-color: var(--ink); transform: translateY(-2px); box-shadow: var(--shadow); }
.golden button strong { font-weight: 600; font-size: .98rem; line-height: 1.3; }
.golden button span { font: 400 .72rem var(--mono); color: var(--muted); grid-column: 1 / -1; }
.golden button::after { content: "\25B6"; grid-column: 2; grid-row: 1; font-size: .6rem; width: 26px; height: 26px; display: grid; place-items: center; border: 1px solid var(--rule-2); border-radius: 50%; color: var(--muted); padding-left: 2px; }
.golden button:hover::after, .golden li.active button::after { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.golden li.active button { border-color: var(--ink); box-shadow: inset 0 3px 0 var(--ink); }

/* ---------- a run: results on the left, map and agent on the right ---------- */
.app { background: color-mix(in srgb, var(--ink) 3%, var(--bg)); }
.credits { font: 400 .76rem var(--mono); color: var(--muted); }
.credits.bad { color: var(--err); font-family: var(--body); font-size: .9rem; max-width: 60ch; }
.verdict { font-size: 1rem; padding: 1.4rem 1.5rem; background: var(--ink); color: var(--bg); border-radius: 16px; box-shadow: var(--shadow); margin-bottom: 20px; }
.verdict > b { display: block; font: 400 clamp(1.6rem, 2.8vw, 2.3rem)/1.1 var(--display); letter-spacing: -.01em; margin-bottom: .5rem; }
.scout-summary { margin: .8rem 0 0; font-size: .95rem; opacity: .85; max-width: 90ch; }
.measured, .not-measured { margin: .9rem 0 0; padding: 0; list-style: none; font-size: .8rem; display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.measured li, .not-measured li { border: 1px solid color-mix(in srgb, var(--bg) 28%, transparent); border-radius: 999px; padding: .12rem .6rem; }
.measured .nm-head, .not-measured .nm-head { border: 0; padding: 0; font: 500 .68rem var(--mono); letter-spacing: .1em; text-transform: uppercase; opacity: .7; flex-basis: 100%; }
.not-measured li:not(.nm-head) { border-style: dashed; opacity: .8; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 440px); gap: 20px; align-items: start; }
.main { display: grid; gap: 20px; min-width: 0; }
.main > * { animation: rise .4s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.rail { position: sticky; top: calc(var(--nav) + 16px); display: grid; gap: 12px; min-width: 0; }
.map-wrap { position: relative; }
.map { height: 330px; border-radius: 16px; border: 1px solid var(--rule); background: var(--surface); box-shadow: var(--shadow); z-index: 0; }
.map-fit { position: absolute; right: 12px; top: 12px; z-index: 500; background: var(--surface); border: 1px solid var(--rule-2); border-radius: 999px; padding: .3rem .75rem; font-size: .8rem; font-weight: 500; box-shadow: var(--shadow); }
.map-fit:hover { border-color: var(--ink); }
.leaflet-container { font: inherit; background: var(--field); }
.leaflet-tile-pane { filter: var(--map-filter); }
.leaflet-control-attribution { background: color-mix(in srgb, var(--surface) 85%, transparent) !important; color: var(--muted) !important; font-size: 10px; }
.leaflet-control-attribution a { color: var(--muted) !important; }
.leaflet-bar a { background: var(--surface) !important; color: var(--ink) !important; border-color: var(--rule) !important; }
.leaflet-tooltip { background: var(--ink); color: var(--bg); border: 0; border-radius: 8px; font-size: .8rem; padding: .3rem .55rem; box-shadow: var(--shadow); }
.leaflet-tooltip::before { display: none; }
.map-key { font-size: .78rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: .3rem 1.1rem; align-items: center; padding: 0 .2rem; }
.map-key > span { display: inline-flex; align-items: center; gap: .35rem; }
.key-lease { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--ink); color: var(--bg); font: 600 .66rem var(--mono); }
.key-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--city); }
.key-ring { display: inline-block; width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--city); }
.lease-pin { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: var(--bg); font: 600 .82rem var(--mono); border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--ink), 0 4px 10px rgba(0, 0, 0, .3); }

.trace { padding: 18px 20px; max-height: max(240px, calc(100vh - var(--nav) - 330px - 96px)); overflow: auto; }
.elapsed { font: 500 .76rem var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.bar { height: 2px; background: var(--rule); border-radius: 2px; overflow: hidden; margin: .8rem 0 0; }
.bar i { display: block; height: 100%; width: 35%; background: var(--ink); border-radius: inherit; animation: slide 1.3s ease-in-out infinite; }
@keyframes slide { from { transform: translateX(-110%); } to { transform: translateX(300%); } }
.steps { list-style: none; margin: .9rem 0 0; padding: 0; display: grid; gap: .55rem; font-size: .88rem; }
.steps li { display: grid; grid-template-columns: 1.2rem 1fr; gap: .55rem; }
.steps .idle { display: block; color: var(--muted); }
.steps .ico { font-weight: 700; text-align: center; font-size: .8rem; line-height: 1.5rem; }
.steps .running .ico::before { content: ""; display: inline-block; width: .7rem; height: .7rem; border-radius: 50%; border: 2px solid var(--ink); border-top-color: transparent; animation: spin .8s linear infinite; }
.steps .done .ico { color: var(--ok); }
.steps .error .ico { color: var(--err); }
.steps .stopped .ico { color: var(--faint); }
.steps .lab { font-weight: 500; }
.steps .detail { display: block; color: var(--muted); font-size: .8rem; overflow-wrap: anywhere; }
.steps .sub { display: block; margin-left: .55rem; padding: .05rem 0 .05rem 1.1rem; border-left: 1px solid var(--rule-2); font: 400 .74rem/1.5 var(--mono); color: var(--muted); overflow-wrap: anywhere; }
.steps .sub.thinking { font-style: italic; }
.steps .sub.thinking::after { content: "\2026"; animation: pulse 1.4s ease-in-out infinite; }
.steps .sub.error { color: var(--warn); }
.steps .slow { display: block; font-size: .78rem; color: var(--muted); font-style: italic; }
@keyframes pulse { 50% { opacity: .2; } }
@keyframes spin { to { transform: rotate(360deg); } }
.calls { margin-top: 1rem; font-size: .82rem; border-top: 1px solid var(--rule); padding-top: .8rem; }
.calls ol { padding-left: 1.4rem; margin: .5rem 0 0; color: var(--muted); max-height: 220px; overflow: auto; font: 400 .72rem/1.6 var(--mono); }

.wait { color: var(--muted); font-size: .92rem; padding: 2.2rem 0 1.6rem; text-align: center; }
.rank-note { font-size: .88rem; color: var(--muted); margin: .9rem 0 .2rem; padding-left: .8rem; border-left: 2px solid var(--city); max-width: 84ch; }
.rank-note.qloo { border-color: var(--qloo); }
.rank-note strong { color: var(--ink); }
.rank-list { list-style: none; margin: 0; padding: 0; position: relative; }
.rank-list > li {
  display: grid; grid-template-columns: 3.4rem minmax(0, 1fr); gap: .25rem .9rem;
  padding: 1.2rem .7rem; margin: 0 -.7rem; border-top: 1px solid var(--rule); cursor: pointer; transition: background .15s ease;
}
.rank-list > li:first-child { border-top-color: transparent; margin-top: .5rem; }
.rank-list > li:hover, .rank-list > li.on { background: var(--field); }
.rank-list > li > * { grid-column: 2; }
.rank-list .pos { grid-column: 1; grid-row: 1 / span 3; font: 400 3rem/.9 var(--display); color: var(--faint); font-variant-numeric: tabular-nums; }
.rank-list > li:first-child .pos { color: var(--ink); }
.rank-list .addr { font-weight: 600; font-size: 1.06rem; letter-spacing: -.01em; }
.rank-list .hood { color: var(--muted); font-weight: 400; font-size: .86rem; margin-left: .5rem; white-space: nowrap; }
.facts { display: flex; flex-wrap: wrap; gap: .3rem 1.3rem; font-size: .86rem; color: var(--muted); margin: .25rem 0 0; padding: 0; list-style: none; }
.facts b { color: var(--ink); font: 600 .9rem var(--mono); font-variant-numeric: tabular-nums; }
.facts .lead b { color: var(--city); }
.qmode .facts .lead b { color: var(--ink); }
.facts .taste { display: none; }
.qmode .facts .taste { display: inline; }
.qmode .facts .taste b { color: var(--qloo); }
.score { display: grid; grid-template-columns: minmax(80px, 200px) minmax(0, 1fr); gap: .7rem; align-items: center; margin: .5rem 0 .1rem; font-size: .8rem; color: var(--muted); }
.meter { height: 6px; border-radius: 999px; background: var(--rule); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: inherit; background: var(--city); transform-origin: left; animation: grow .7s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes grow { from { transform: scaleX(0); } }
.flag { font-size: .85rem; color: var(--warn); margin: .3rem 0 0; }
.nearby { font-size: .84rem; color: var(--muted); margin: .15rem 0 0; }
.store { font-size: .84rem; margin: .2rem 0 0; color: var(--ink-2); }
.tag, .store .tag { display: inline-block; font: 500 .68rem var(--mono); letter-spacing: .04em; padding: .1rem .5rem; border-radius: 999px; background: var(--city-tint); color: var(--city); margin-left: .4rem; vertical-align: 1px; }
.reason { font-size: .9rem; margin: .5rem 0 0; padding: .6rem .8rem; background: var(--field); border-radius: 10px; color: var(--ink-2); max-width: 84ch; }
.rank-list > li:hover .reason, .rank-list > li.on .reason { background: var(--surface); }

.partners-body { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); margin-top: .8rem; }
.partner { border: 1px solid var(--rule); border-radius: 12px; padding: .8rem .9rem; font-size: .88rem; }
.partner h3 { font-size: .95rem; margin: .15rem 0 .25rem; }
.partner .m { font: 500 .68rem var(--mono); letter-spacing: .04em; color: var(--muted); }
.partner p { color: var(--muted); margin-top: .25rem; overflow-wrap: anywhere; }
.partner ul { list-style: none; margin: .4rem 0 0; padding: 0; display: grid; gap: .3rem; }
.partner li { display: flex; justify-content: space-between; gap: .8rem; border-top: 1px solid var(--rule); padding-top: .3rem; }
.partner li:first-child { border-top: 0; padding-top: 0; }
.partner li span { color: var(--muted); white-space: nowrap; font-size: .8rem; }

.brief-legend { font-size: .82rem; color: var(--muted); margin: .7rem 0 1rem; line-height: 1.9; }
.brief #brief-body h3 { font: 500 .7rem var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 1.4rem 0 .35rem; }
.brief p.sec { max-width: 72ch; font-size: 1.02rem; line-height: 1.65; }
.brief .draft { white-space: pre-line; color: var(--muted); }
.q { background: var(--qloo-tint); border-bottom: 2px solid var(--qloo); padding: 0 .15em; border-radius: 3px 3px 0 0; }
.c { border-bottom: 2px solid var(--city); }
.u { border-bottom: 2px dotted var(--warn); }
.sources-line { margin: .7rem 0 0; font-weight: 500; font-size: .92rem; }
.sources-line .n-q { color: var(--qloo); }
.sources-line .n-c { color: var(--city); }
.sources-line .n-u { color: var(--warn); }
.repair-note { font-size: .86rem; color: var(--muted); margin: 1rem 0 0; padding-left: .8rem; border-left: 2px solid var(--warn); }
.redacted { border: 1px dashed var(--rule-2); border-radius: 12px; padding: 1rem 1.1rem; margin-top: 1rem; color: var(--muted); font-size: .92rem; }
.redacted dl { display: grid; grid-template-columns: auto 1fr; gap: .35rem 1.2rem; margin: .8rem 0 0; }
.redacted dt { font: 500 .7rem var(--mono); letter-spacing: .08em; text-transform: uppercase; align-self: center; }
.redacted dd { margin: 0; color: var(--ink); }
.evidence-used { margin-top: 1.3rem; font-size: .9rem; border-top: 1px solid var(--rule); padding-top: .9rem; }
.evidence-used dl { margin: .6rem 0 0; }
.evidence-used dt { font-weight: 600; margin-top: .5rem; }
.evidence-used dd { margin: .1rem 0 0; color: var(--muted); }
.evidence-used .used { color: var(--qloo); font-weight: 600; }

.next-list { margin: .6rem 0 0; padding: 0; list-style: none; counter-reset: n; display: grid; }
.next-list li { counter-increment: n; display: grid; grid-template-columns: 2rem 1fr; padding: .7rem 0; border-top: 1px solid var(--rule); font-size: .94rem; color: var(--ink-2); }
.next-list li::before { content: counter(n, decimal-leading-zero); font: 500 .72rem var(--mono); color: var(--faint); padding-top: .2rem; }
.next-list li.specific { color: var(--ink); font-weight: 500; }
.next-list li > span { max-width: 84ch; }
.next-list a { font: 500 .7rem var(--mono); letter-spacing: .06em; text-transform: uppercase; margin-left: .5rem; color: var(--muted); white-space: nowrap; }

.ask .chips { margin: .5rem 0 .9rem; }
.ask-form { display: flex; gap: .5rem; }
.ask-form input { flex: 1; min-width: 0; }
.ask-btn { width: auto; flex: none; margin: 0; padding: .6rem 1.1rem; white-space: nowrap; }
.thread { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: .9rem; }
.thread:empty { margin: 0; }
.thread > li { border: 1px solid var(--rule); border-radius: 12px; padding: .9rem 1rem; }
.thread .q { background: none; border: 0; font-weight: 600; padding: 0; }
.thread .tools { list-style: none; padding: 0; margin: .5rem 0; font: 400 .76rem var(--mono); color: var(--muted); display: grid; gap: .2rem; }
.thread .tools:empty { margin: 0; }
.thread .tools .done::before { content: "\2713  "; color: var(--ok); font-weight: 700; }
.thread .tools .error::before { content: "\2715  "; color: var(--err); font-weight: 700; }
.thread .tools .running::before { content: "\2026  "; }
.thread .a { white-space: pre-line; max-width: 78ch; margin: .3rem 0 0; color: var(--ink-2); }
.thread .loose { font-size: .82rem; color: var(--warn); margin: .4rem 0 0; }

/* ---------- how it works, sources ---------- */
.flow { list-style: none; counter-reset: f; margin-block: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--ink); }
.flow li { counter-increment: f; padding: 1.4rem 1.6rem 1.6rem 0; border-bottom: 1px solid var(--rule); }
.flow li:not(:nth-child(3n + 1)) { padding-left: 1.6rem; border-left: 1px solid var(--rule); }
.flow li::before { content: "0" counter(f); display: block; font: 400 2.4rem/1 var(--display); color: var(--faint); margin-bottom: .9rem; }
.flow h3 { font-size: 1.05rem; margin-bottom: .4rem; }
.flow p { font-size: .92rem; color: var(--muted); }
.sources { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
.sources article { background: var(--surface); border: 1px solid var(--rule); border-radius: 16px; padding: 1.2rem 1.2rem 1.3rem; box-shadow: var(--shadow); border-top: 3px solid var(--ink); }
.sources .s-city { border-top-color: var(--city); }
.sources .s-qloo { border-top-color: var(--qloo); }
.tagline { font: 500 .66rem var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.sources h3 { font-size: 1.02rem; margin: .5rem 0 .4rem; }
.sources p { font-size: .88rem; color: var(--muted); }

/* ---------- scene, evidence ---------- */
.evidence .lede { color: var(--muted); margin-top: 1rem; max-width: none; font-size: 1rem; }
.scene-form { margin-top: 1.4rem; }
.scene-form input { max-width: 520px; }
.scene-body:not(:empty) { margin-top: 1.2rem; }
.around h3:not(.ph), .scene-body h3 { font-size: 1rem; margin: 1.1rem 0 .3rem; }
.scene-body .panel h3 { margin-top: 0; }
.around-list, .scene-list { margin: .4rem 0 0; padding-left: 1.2rem; display: grid; gap: .3rem; font-size: .9rem; }
.around-list .m, .scene-list .m { color: var(--muted); font-size: .8rem; }
.around-list .qf { color: var(--qloo); font-weight: 600; font-variant-numeric: tabular-nums; }
.around-list .men { color: var(--muted); }
.around-list .nodetail { color: var(--faint); font-style: italic; font-size: .82rem; }
.among { margin: .7rem 0 0; padding-left: .8rem; border-left: 2px solid var(--qloo); max-width: 80ch; }
.notes { margin: 1rem 0 0; padding-left: 1.2rem; font-size: .82rem; color: var(--muted); display: grid; gap: .2rem; max-width: 84ch; }
.scene-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); margin-top: .8rem; }
.scene-list { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); column-gap: 1.6rem; }
.scene-list .unc { color: var(--faint); }
.scene-list .unc b { font-weight: 400; }
.matched { margin: .6rem 0 0; }
.taste-cols { display: grid; gap: .9rem; }
.taste-cols h4 { font: 500 .68rem var(--mono); text-transform: uppercase; letter-spacing: .12em; color: var(--qloo); }
.taste-cols p { margin: .2rem 0 0; }

.medians { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 2rem; margin-bottom: 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--rule); }
.medians > div { padding: 1.2rem 1.2rem 1.3rem 0; }
.medians > div + div { padding-left: 1.4rem; border-left: 1px solid var(--rule); }
.medians dt { font: 500 .7rem var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: .5rem; }
.medians .m-city dt::before, .medians .m-qloo dt::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--city); flex: none; }
.medians .m-qloo dt::before { background: var(--qloo); }
.medians dd { margin: .3rem 0 0; font: 400 clamp(2.4rem, 5vw, 3.8rem)/1 var(--display); font-variant-numeric: tabular-nums; }
.medians p { font-size: .82rem; color: var(--muted); margin-top: .3rem; }
.chart-fig { margin-top: 1.6rem; margin-bottom: 0; background: var(--surface); border: 1px solid var(--rule); border-radius: 16px; padding: 22px; position: relative; box-shadow: var(--shadow); }
.chart-fig figcaption strong { display: block; font-weight: 600; font-size: 1.05rem; }
.chart-fig figcaption span { font-size: .86rem; color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: .5rem 1.3rem; align-items: center; font-size: .86rem; margin: 1rem 0; }
.legend button { margin-left: auto; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: .4rem; vertical-align: -1px; }
.sw.city { background: var(--city); }
.sw.qloo { background: var(--qloo); }
.chart { max-width: 940px; margin-inline: auto; }
.chart svg { width: 100%; height: auto; display: block; }
.chart text { fill: var(--muted); font: 11.5px var(--mono); }
.chart .lab { fill: var(--ink); font: 13px var(--body); }
.chart .grid { stroke: var(--rule); stroke-width: 1; }
.chart .mid { stroke: var(--faint); stroke-dasharray: 3 3; }
.chart .gap { stroke: var(--rule-2); stroke-width: 2; }
.chart .d-city { fill: var(--city); stroke: var(--surface); stroke-width: 2; }
.chart .d-qloo { fill: var(--qloo); stroke: var(--surface); stroke-width: 2; }
.chart .hit { fill: transparent; cursor: default; }
.chart .row:hover .hit { fill: color-mix(in srgb, var(--ink) 4%, transparent); }
.chart .row:hover .lab { font-weight: 600; }
.tip { position: absolute; pointer-events: none; background: var(--ink); color: var(--bg); font-size: .8rem; padding: .5rem .7rem; border-radius: 10px; max-width: 260px; box-shadow: var(--shadow); z-index: 5; }
#chart-table, .tests-wrap { overflow-x: auto; }
table.data { border-collapse: collapse; font-size: .86rem; width: 100%; }
table.data th { font: 500 .68rem var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
table.data th, table.data td { text-align: left; padding: .5rem .7rem; border-bottom: 1px solid var(--rule); font-variant-numeric: tabular-nums; vertical-align: top; }
#chart-table td:not(:first-child) { font-family: var(--mono); font-size: .82rem; }
.entries { columns: 3 340px; column-gap: 16px; margin-top: 1.2rem; }
.entry { break-inside: avoid; margin: 0 0 16px; background: var(--surface); border: 1px solid var(--rule); border-radius: 16px; padding: 20px; box-shadow: var(--shadow); display: grid; gap: .55rem; }
.entry h3 { font-size: 1.02rem; margin-bottom: .2rem; }
.entry p { font-size: .9rem; color: var(--ink-2); }
.entry .k { display: block; font: 500 .66rem var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.entry .src-files { font: 400 .72rem var(--mono); color: var(--faint); border-top: 1px solid var(--rule); padding-top: .6rem; margin-top: .2rem; overflow-wrap: anywhere; }
.tests-wrap { margin-top: 1.2rem; background: var(--surface); border: 1px solid var(--rule); border-radius: 16px; box-shadow: var(--shadow); }
.tests { min-width: 640px; }
.tests th, .tests td { padding: .75rem 1rem; }
.tests tr:last-child td { border-bottom: 0; }
.tests td:first-child { font: 400 1.5rem/1 var(--display); color: var(--faint); width: 4.2rem; white-space: nowrap; }
.tests td:nth-child(2) { width: 40%; font-weight: 500; }
.tests td:nth-child(3) { color: var(--ink-2); }
.tests tbody tr:hover td { background: var(--field); }

.foot { padding: 2.5rem var(--pad) 3rem; border-top: 1px solid var(--rule); font-size: .8rem; color: var(--muted); display: grid; gap: .7rem; }
.foot > * { max-width: var(--max); margin-inline: auto; width: 100%; }
.foot .logo { color: var(--ink); font-size: 1rem; }
.to-top { position: fixed; right: 20px; bottom: 20px; z-index: 1100; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--ink); color: var(--bg); border: 0; box-shadow: var(--shadow); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 1300; background: var(--ink); color: var(--bg); font-size: .88rem; font-weight: 500; padding: .6rem 1rem; border-radius: 999px; box-shadow: var(--shadow); }

/* ---------- why Qloo ---------- */
.why { background: color-mix(in srgb, var(--qloo) 4%, var(--bg)); }
.bars { display: grid; gap: .7rem; }   /* lets the wide answers table scroll inside the card */
.answers { border-top: 1px solid var(--rule); padding-top: .8rem; }
.answers summary { font-size: .9rem; color: var(--qloo); }
.answers .t20-wrap { overflow-x: auto; margin-top: .8rem; max-height: 420px; overflow-y: auto; }
.answers table { min-width: 620px; font-size: .8rem; }
.answers th { position: sticky; top: 0; background: var(--surface); }
.answers td.ok { color: var(--ok); }
.answers td.no { color: var(--muted); }
.answers td.ok::before { content: "\2713  "; font-weight: 700; }
.answers td.no::before { content: "\2715  "; }
.answers tfoot td { font-weight: 600; border-bottom: 0; }

/* ---------- live duel: the model alone against the model with Qloo ---------- */
.duel-btn { margin-left: .5rem; font: 500 .7rem var(--mono); letter-spacing: .03em; padding: .1rem .55rem; border-radius: 999px;
  background: none; border: 1px solid var(--qloo); color: var(--qloo); vertical-align: 1px; }
.duel-btn:hover:not(:disabled) { background: var(--qloo); color: var(--surface); }
.duel { margin: .5rem 0 .7rem; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; list-style: none; }
.duel > div { border: 1px solid var(--rule); border-radius: 12px; padding: .65rem .8rem; background: var(--field); }
.duel .k { display: block; font: 500 .62rem var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.duel b { display: block; font: 400 1.6rem/1.15 var(--display); margin-top: .2rem; }
.duel .wq { border-color: var(--qloo); }
.duel .wq b, .duel .rec b { color: var(--qloo); }
.duel-note { grid-column: 1 / -1; font-size: .78rem; color: var(--muted); }

/* ---------- Friday closing times around the top pick ---------- */
.hours { margin: .9rem 0 .3rem; }
.hours-axis, .hours-row { display: grid; grid-template-columns: minmax(7rem, 12rem) minmax(0, 1fr) 3.4rem; gap: .7rem; align-items: center; }
.hours-axis { font: 500 .66rem var(--mono); color: var(--muted); letter-spacing: .04em; }
.hours-axis .ticks { display: flex; justify-content: space-between; }
.hours-row { font-size: .84rem; padding: .28rem 0; border-top: 1px solid var(--rule); }
.hours-row .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hours-row .lane { position: relative; height: 10px; background: var(--field); border-radius: 999px; }
.hours-row .lane i { position: absolute; left: 0; top: 0; bottom: 0; width: var(--w); border-radius: 999px; background: color-mix(in srgb, var(--qloo) 55%, var(--field)); }
.hours-row .lane i::after { content: ""; position: absolute; right: -4px; top: -3px; width: 8px; height: 16px; border-radius: 3px; background: var(--qloo); }
.hours-row b { font: 600 .8rem var(--mono); text-align: right; color: var(--qloo); font-variant-numeric: tabular-nums; }
.hours-row.late .nm::after { content: "late"; font: 500 .62rem var(--mono); text-transform: uppercase; letter-spacing: .06em; margin-left: .45rem; padding: .05rem .4rem; border-radius: 999px; background: var(--qloo-tint); color: var(--qloo); }

/* ======================================================================
   Paper theme: overrides of the base rules above, then the new parts
   ====================================================================== */
::selection { background: var(--qloo); color: var(--on-qloo); }
:focus-visible { outline: 2px solid var(--qloo); outline-offset: 2px; }
input, textarea { caret-color: var(--qloo); }
a { text-decoration-color: var(--rule-2); }
a:hover { text-decoration-color: var(--qloo); }
.nav { background: var(--bg); border-bottom: 1px solid var(--rule); backdrop-filter: none; -webkit-backdrop-filter: none; }
.logo-mark { border: 0; background: var(--qloo); border-radius: 2px; }
.nav-links a { color: var(--muted); }
.nav-links a:hover, .nav-links a[aria-current="true"] { color: var(--ink); background: var(--field); }
.icon-btn { border-color: var(--rule-2); }
.icon-btn:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* Headings carry their own weight: no eyebrow labels above them. */
 .eyebrow, .grid-art { display: none; }
.top { border-bottom: 1px solid var(--rule); }
.wordmark em { font-style: italic; color: var(--qloo); }
.points li::before { border: 0; background: var(--qloo); width: 7px; height: 7px; }
.points b { color: var(--ink); }
.top .lede .src, .src { color: var(--ink); }
.top .lede .src.qloo, .src.qloo { border-color: var(--qloo); }
.top .lede .src.city, .src.city { border-color: var(--city); }
.stats { border-top: 1px solid var(--ink); }
.stats > div + div { border-left-color: var(--rule); }

.panel, .golden button, .sources article, .entry, .chart-fig, .tests-wrap { background: var(--surface); border: 1px solid var(--rule); box-shadow: var(--shadow); }
.partner, .thread > li { background: none; border-color: var(--rule); }
input, select, textarea { background: var(--surface); border-color: var(--rule-2); color: var(--ink); }
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
input:focus, select:focus, textarea:focus { border-color: var(--ink); background: var(--surface); box-shadow: 0 0 0 3px var(--qloo-tint); }
.primary { background: var(--qloo); border: 0; color: var(--on-qloo); box-shadow: none; }
.primary:hover:not(:disabled) { opacity: 1; background: var(--qloo-hover); }
.primary:disabled { opacity: 1; background: var(--field); color: var(--faint); }
.quiet { border-color: var(--rule-2); }
.quiet:hover:not(:disabled) { border-color: var(--ink); background: none; }
.chips button { border-color: var(--rule-2); color: var(--ink-2); background: var(--surface); }
.chips button:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.toggle { background: var(--field); border-color: var(--rule); }
.toggle button { color: var(--muted); }
.toggle button[aria-checked="true"] { background: var(--ink); color: var(--bg); }
.toggle button[aria-checked="true"][data-mode="city"] { background: var(--city); color: var(--surface); }
.toggle button[aria-checked="true"][data-mode="qloo"] { background: var(--qloo); color: var(--on-qloo); }
.form-error { color: var(--err); background: var(--qloo-tint); border-color: var(--err); }

/* Labels in the body face; monospace is kept for numbers and code. */
.tagline, .entry .k, .stats dt, .medians dt, table.data th, .partner .m, .hours-axis {
  font-family: var(--body); letter-spacing: 0; text-transform: none; font-size: .8rem; font-weight: 600; color: var(--muted); }

.golden button:hover { border-color: var(--ink); transform: translateY(-2px); }
.golden button::after { border-color: var(--rule-2); color: var(--ink); }
.golden button:hover::after, .golden li.active button::after { background: var(--qloo); color: var(--on-qloo); border-color: var(--qloo); }
.golden li.active button { border-color: var(--qloo); box-shadow: inset 0 3px 0 var(--qloo), var(--shadow); }
.golden button span { font-family: var(--body); font-size: .8rem; color: var(--muted); }

.app { background: var(--bg); }
.verdict { background: var(--ink); color: var(--bg); box-shadow: var(--shadow); }
.verdict .measured li, .verdict .not-measured li { border-color: var(--faint); }
.rank-list .pos { color: var(--faint); }
.rank-list > li:first-child .pos { color: var(--qloo); }
.rank-list > li:hover, .rank-list > li.on { background: var(--field); }
.reason { background: var(--field); }
.rank-list > li:hover .reason, .rank-list > li.on .reason { background: var(--surface); }
.meter { background: var(--field); }
.meter i { background: var(--city); }
.tag, .store .tag { background: var(--city-tint); color: var(--city); }
.key-lease, .lease-pin { background: var(--qloo); color: var(--on-qloo); }
.lease-pin { border-color: var(--surface); box-shadow: 0 0 0 1px var(--qloo), 0 4px 10px rgba(0, 0, 0, .25); }
.leaflet-tooltip, .tip { background: var(--ink); color: var(--bg); border: 0; }
.leaflet-container { background: var(--field); }
.map { border: 1px solid var(--rule); }
.map-fit { background: var(--surface); }
.toast, .to-top { background: var(--ink); color: var(--bg); }
.answers th { background: var(--surface); }
.answers summary { color: var(--qloo); }
.duel-btn { border-color: var(--qloo); color: var(--qloo); }
.duel-btn:hover:not(:disabled) { background: var(--qloo); color: var(--on-qloo); }
.duel .wq { border-color: var(--qloo); }
.why { background: var(--bg); }
.flow { border-top-color: var(--ink); }
.flow li::before { color: var(--qloo); }
.sources article { border-top: 3px solid var(--ink); }
.sources .s-city { border-top-color: var(--city); }
.sources .s-qloo { border-top-color: var(--qloo); }
.medians { border-top-color: var(--ink); }
.band + .band { border-top: 1px solid var(--rule); }
.tests td:first-child { color: var(--qloo); }
.tests tbody tr:hover td { background: var(--field); }
.q { background: var(--qloo-tint); border-bottom-color: var(--qloo); }
.evidence-used .used, .taste-cols h4, .sources-line .n-q, .around-list .qf, .hours-row b { color: var(--qloo); }
.hours-row .lane i { background: var(--city-tint); }
.hours-row .lane i::after { background: var(--qloo); }
.hours-row.late .nm::after { background: var(--qloo); color: var(--on-qloo); }
.among, .rank-note.qloo { border-color: var(--qloo); }
.rank-note, .repair-note { border-left-width: 1px; }
.panel::before { display: none; }
.sw.qloo { background: var(--qloo); }
.sw.city { background: var(--city); }

@keyframes tick { to { transform: translateX(-50%); } }

/* ---------- agent radar ---------- */
.agent-viz { margin-top: 1.8rem; border-radius: 14px; padding: 14px 16px 12px; background: var(--surface); border: 1px solid var(--rule); box-shadow: var(--shadow); }
.agent-viz.in-rail { margin-top: 0; }
.av-head { display: flex; justify-content: space-between; align-items: center; gap: .6rem; }
.av-head strong { font-size: .95rem; font-weight: 600; }
.av-state { font: 500 .74rem var(--body); padding: .16rem .55rem; border-radius: 999px; border: 1px solid var(--rule-2); color: var(--muted);
  display: inline-flex; gap: .4rem; align-items: center; }
.av-state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.av-state.live { color: var(--on-qloo); background: var(--qloo); border-color: var(--qloo); }
.av-state.live::before { background: var(--on-qloo); animation: pulse 1s infinite; }
.agent-viz svg { display: block; width: 100%; height: auto; margin-top: .2rem; overflow: visible; }
.av-edge { stroke: var(--rule-2); stroke-width: 1; }
.av-edge.hot { stroke: var(--qloo); stroke-width: 2; }
.av-node circle.ring { fill: var(--surface); stroke: var(--muted); stroke-width: 1.5; transition: fill .2s, stroke .2s; }
.av-node.qloo circle.ring { stroke: var(--qloo); stroke-width: 2; }
.av-node.flash circle.ring { fill: var(--qloo); stroke: var(--qloo); }
.av-node.flash text.n { fill: var(--on-qloo); }
.av-node.core circle.ring { fill: var(--ink); stroke: var(--ink); }
.av-node.core text { fill: var(--bg); }
.av-node.core text.n { fill: var(--faint); }
.av-node text { fill: var(--ink); font: 600 11px var(--body); text-anchor: middle; pointer-events: none; }
.av-node text.n { font: 500 10px var(--mono); fill: var(--muted); }
.av-node .halo { display: none; }
.av-packet { fill: var(--qloo); }
.av-packet.back { fill: var(--city); }
.av-log { list-style: none; margin: .4rem 0 0; padding: .5rem .65rem; height: 5rem; overflow: hidden; border-radius: 8px;
  background: var(--board); font: 400 .72rem/1.6 var(--mono); color: #CFC6B6; display: flex; flex-direction: column; justify-content: flex-end; }
.av-log li { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.av-log li b { color: var(--board-ink); font-weight: 600; }
.av-log li i { color: #9EC3E6; font-style: normal; }
.reveal { opacity: 1; transform: none; }

/* ---------- scoreboard ---------- */
.scoreboard { background: var(--bg); }
.sb-hero { display: grid; grid-template-columns: minmax(250px, 320px) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center; }
.sb-ring { display: grid; place-items: center; text-align: center; padding: 8px 0; background: none; box-shadow: none; border: 0; }
.sb-ring svg { width: min(100%, 240px); height: auto; }
.sb-ring .lbl { font-size: .9rem; color: var(--muted); margin-top: .6rem; max-width: 30ch; }
.ring-bg { stroke: var(--field); }
.ring-fg { stroke: var(--qloo); transition: stroke-dashoffset 1.4s cubic-bezier(.16, 1, .3, 1); }
.ring-num { fill: var(--ink); font: 400 58px var(--display); text-anchor: middle; }
.ring-sub { fill: var(--muted); font: 600 13px var(--body); text-anchor: middle; }
.sb-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--ink); }
.kpi { padding: 1.1rem 1.2rem 1.3rem 0; display: grid; gap: .25rem; align-content: start; background: none; box-shadow: none; border: 0; border-radius: 0; border-bottom: 1px solid var(--rule); }
.kpi:not(:nth-child(3n + 1)) { padding-left: 1.2rem; border-left: 1px solid var(--rule); }
.kpi .v { font: 400 clamp(2.1rem, 3.6vw, 3rem)/1 var(--display); color: var(--ink); font-variant-numeric: tabular-nums; }
.kpi .v small { font: 500 .8rem var(--body); color: var(--muted); margin-left: .35rem; }
.kpi .t { font-size: .84rem; font-weight: 600; color: var(--ink); }
.kpi p { font-size: .84rem; color: var(--muted); }
.sb-filters { display: flex; flex-wrap: wrap; gap: .45rem; margin: 2.4rem 0 1rem; align-items: center; }
.sb-filters .chips button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.sb-filters .sb-count { margin-left: auto; font-size: .84rem; color: var(--muted); }
.sb-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); }
.card { padding: 18px 18px 16px; display: grid; gap: .6rem; align-content: start; }
.card .id { display: flex; justify-content: space-between; gap: .5rem; font-size: .78rem; color: var(--muted); }
.card h3 { font-size: 1.02rem; line-height: 1.3; }
.card .note { font-size: .84rem; color: var(--muted); }
.card .badge { justify-self: start; font-size: .74rem; font-weight: 600; padding: .14rem .55rem; border-radius: 4px; background: var(--qloo); color: var(--on-qloo); }
.card .badge.fact { background: var(--city); color: var(--surface); }
.card .badge.mix { background: var(--field); color: var(--ink); }
.mini { background: var(--bg); border-radius: 10px; padding: 12px; }
.pair { display: grid; gap: .5rem; }
.pair-row { display: grid; grid-template-columns: 7.2rem minmax(0, 1fr) 3.4rem; gap: .6rem; align-items: center; font-size: .8rem; }
.pair-row .who { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pair-row .trk { height: 12px; background: var(--well); border-radius: 0 4px 4px 0; overflow: hidden; }
.pair-row .trk i { display: block; height: 100%; width: 0; border-radius: 0 4px 4px 0; background: var(--base); transition: width 1s cubic-bezier(.16, 1, .3, 1); }
.pair-row.is-q .trk i { background: var(--qloo); }
.pair-row b { font: 600 .8rem var(--mono); text-align: right; font-variant-numeric: tabular-nums; color: var(--ink); }
.donut-wrap { display: flex; align-items: center; gap: 14px; }
.donut { width: 92px; height: 92px; flex: none; }
.donut .bg { stroke: var(--well); }
.donut .fg { stroke: var(--qloo); stroke-linecap: butt; transition: stroke-dashoffset 1.2s cubic-bezier(.16, 1, .3, 1); }
.donut.fact .fg { stroke: var(--city); }
.donut text { fill: var(--ink); font: 600 14px var(--mono); text-anchor: middle; }
.donut-wrap p { font-size: .82rem; color: var(--muted); }
.donut-wrap p b { color: var(--ink); font: 400 1.6rem/1 var(--display); display: block; margin-bottom: .2rem; }
.gain { display: grid; gap: .4rem; }
.gain .g { font: 400 2.3rem/1 var(--display); color: var(--ink); }
.gain .g small { font: 500 .78rem var(--body); color: var(--muted); margin-left: .35rem; }
.gain .trk { height: 10px; border-radius: 0 4px 4px 0; background: var(--well); overflow: hidden; }
.gain .trk i { display: block; height: 100%; width: 0; background: var(--qloo); transition: width 1s cubic-bezier(.16, 1, .3, 1); }
.dumb-fig { margin: 2.4rem 0 0; padding: 22px; background: var(--surface); border: 1px solid var(--rule); border-radius: 14px; position: relative; box-shadow: var(--shadow); }
.dumb-fig figcaption strong { display: block; font: 400 clamp(1.5rem, 2.6vw, 2rem)/1.15 var(--display); }
.dumb-fig figcaption span { font-size: .88rem; color: var(--muted); }
.dumb { margin-top: 1rem; }
.dumb svg { width: 100%; height: auto; display: block; }
.dumb text { fill: var(--muted); font: 11px var(--mono); }
.dumb .lab { fill: var(--ink); font: 12.5px var(--body); }
.dumb .grid { stroke: var(--rule); }
.dumb .link { stroke: var(--rule-2); stroke-width: 2; }
.dumb .d-b { fill: var(--base); stroke: var(--surface); stroke-width: 2; }
.dumb .d-q { fill: var(--qloo); stroke: var(--surface); stroke-width: 2; }
.dumb .val { fill: var(--ink); font: 600 11px var(--mono); }
.dumb .row .hit { fill: transparent; }
.dumb .row:hover .hit { fill: var(--field); }
.dumb .row { opacity: 0; transition: opacity .4s ease; }
.dumb.in .row { opacity: 1; }
.dumb-legend { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; align-items: center; font-size: .86rem; margin-top: .9rem; }
.dumb-legend .sw.base { background: var(--base); }
.dumb-legend button { margin-left: auto; }
#dumb-table { overflow-x: auto; margin-top: 1rem; }
.record { margin-top: 1.6rem; padding: 18px 20px; }
.record summary { font-size: .95rem; }
.record ul { margin: .8rem 0 0; padding-left: 1.2rem; display: grid; gap: .35rem; font-size: .9rem; color: var(--ink-2); }

/* ---------- duel replay ---------- */
.duel-replay { margin-top: 20px; padding: 22px; }
.dr-head { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; justify-content: space-between; }
.dr-head h3 { font: 400 clamp(1.5rem, 2.6vw, 2rem)/1.15 var(--display); }
.dr-controls { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.dr-controls select { width: auto; max-width: 260px; padding: .4rem .6rem; border-radius: 8px; font-size: .88rem; }
.dr-q { margin: 1rem 0 .8rem; font-size: 1.08rem; }
.dr-q b { color: var(--qloo); }
.dr-lanes { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
.lane { border-radius: 10px; padding: 12px 14px; background: var(--bg); border: 1px solid var(--rule); display: grid; gap: .45rem; min-height: 132px; align-content: start; transition: border-color .3s; }
.lane .who { font-size: .8rem; font-weight: 600; color: var(--muted); }
.lane.wq .who { color: var(--ink); }
.lane .call { font: 400 .74rem var(--mono); color: var(--city); }
.lane .bubble { font-size: 1rem; color: var(--ink); min-height: 1.5em; }
.lane .bubble .dots::after { content: "\2026"; animation: pulse 1s infinite; }
.lane .res { font-size: .82rem; font-weight: 600; }
.lane .res.ok { color: var(--ok); }
.lane .res.no { color: var(--err); }
.lane.won { border-color: var(--qloo); box-shadow: inset 0 3px 0 var(--qloo); }
.dr-truth { margin-top: .8rem; font-size: .92rem; color: var(--muted); }
.dr-truth b { color: var(--ink); }
.dr-score { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .7rem; }
.dr-score span { font-size: .8rem; padding: .18rem .55rem; border-radius: 4px; background: var(--field); }
.dr-score span.q { background: var(--qloo); color: var(--on-qloo); border: 0; padding: .18rem .55rem; }

/* ---------- drop a pin ---------- */
.play-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, 1fr); gap: 20px; align-items: start; }
.play-map { padding: 14px; }
.play-bar { display: flex; flex-wrap: wrap; gap: .5rem .8rem; align-items: center; margin-bottom: 12px; }
.play-bar label { margin: 0; display: flex; align-items: center; gap: .5rem; font-size: .88rem; }
.play-bar select { width: auto; padding: .4rem .6rem; border-radius: 8px; }
.play-bar .spacer { flex: 1; }
.pin-map { height: 520px; border-radius: 10px; border: 1px solid var(--rule); z-index: 0; cursor: crosshair; }
.pin-map .leaflet-container, .pin-map.leaflet-container { cursor: crosshair; }
.drop-pin { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50% 50% 50% 4px; transform: rotate(-45deg);
  background: var(--qloo); border: 2px solid var(--surface); box-shadow: 0 6px 14px rgba(0, 0, 0, .3); }
.drop-pin b { transform: rotate(45deg); color: var(--on-qloo); font: 700 .9rem var(--body); }
.drop-pin.land { animation: land .5s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes land { from { transform: translateY(-40px) rotate(-45deg); opacity: 0; } }
.pin-side { display: grid; gap: 14px; }
.pin-empty { padding: 22px; color: var(--muted); }
.pin-empty strong { display: block; color: var(--ink); font: 400 1.6rem/1.15 var(--display); margin-bottom: .4rem; }
.pin-cards { display: grid; gap: 12px; }
.pin-card { padding: 16px 18px; display: grid; gap: .5rem; cursor: pointer; border: 1px solid var(--rule); transition: border-color .2s, transform .2s; }
.pin-card:hover { border-color: var(--ink); }
.pin-card.win { border-color: var(--qloo); box-shadow: inset 4px 0 0 var(--qloo), var(--shadow); }
.pin-card .ph-row { display: flex; justify-content: space-between; align-items: baseline; gap: .6rem; }
.pin-card .tagpin { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--qloo); color: var(--on-qloo); font: 700 .78rem var(--body); margin-right: .5rem; }
.pin-card h3 { font-size: 1rem; display: flex; align-items: center; }
.pin-card .crown { font-size: .74rem; font-weight: 600; padding: .12rem .5rem; border-radius: 4px; background: var(--qloo); color: var(--on-qloo); }
.pin-card .pct { font: 400 2.6rem/1 var(--display); font-variant-numeric: tabular-nums; }
.pin-card .pct small { font: 500 .82rem var(--body); color: var(--muted); margin-left: .4rem; }
.pin-card .gauge { height: 10px; border-radius: 0 4px 4px 0; background: var(--well); overflow: hidden; }
.pin-card .gauge i { display: block; height: 100%; width: 0; background: var(--city); transition: width .9s cubic-bezier(.16, 1, .3, 1); }
.pin-card.win .gauge i { background: var(--qloo); }
.pin-card .facts { margin: 0; }
.pin-card .near { font-size: .82rem; color: var(--muted); }
.pin-card .x { border: 0; background: none; color: var(--muted); font-size: 1.2rem; line-height: 1; padding: 0 .2rem; }
.pin-card .x:hover { color: var(--ink); }
.whatif { padding: 18px 20px; display: grid; gap: .7rem; }
.whatif h3 { font: 400 1.5rem/1.15 var(--display); }
.whatif .sl { display: grid; grid-template-columns: minmax(0, 1fr) 3rem; gap: .2rem .8rem; align-items: center; }
.whatif .sl label { grid-column: 1 / -1; margin: 0; font-size: .86rem; }
.whatif output { font: 600 .95rem var(--mono); text-align: right; }
.whatif .res { display: flex; align-items: baseline; gap: .6rem; border-top: 1px solid var(--rule); padding-top: .7rem; }
.whatif .res b { font: 400 2.6rem/1 var(--display); color: var(--qloo); font-variant-numeric: tabular-nums; }
input[type="range"] { -webkit-appearance: none; appearance: none; padding: 0; height: 22px; background: none; border: 0; box-shadow: none; accent-color: var(--qloo); }
input[type="range"]:focus { box-shadow: none; background: none; }
input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 999px; background: var(--well); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; background: var(--qloo); border: 3px solid var(--surface); margin-top: -7px; box-shadow: 0 1px 4px rgba(0, 0, 0, .3); }
input[type="range"]::-moz-range-track { height: 6px; border-radius: 999px; background: var(--well); }
input[type="range"]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--qloo); border: 3px solid var(--surface); }

/* ---------- beat the model ---------- */
.game-box { padding: 24px; display: grid; gap: 1.1rem; }
.game-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .6rem 1rem; align-items: center; }
.game-round { font: 500 .86rem var(--mono); color: var(--muted); }
.game-score { display: flex; flex-wrap: wrap; gap: .4rem; }
.game-score span { font-size: .84rem; padding: .2rem .6rem; border-radius: 4px; background: var(--field); }
.game-score span b { font-family: var(--mono); }
.game-score .you { background: var(--ink); color: var(--bg); }
.game-score .wq { background: var(--qloo); color: var(--on-qloo); }
.game-q { font: 400 clamp(1.7rem, 3.4vw, 2.6rem)/1.1 var(--display); }
.game-q span { display: block; font: 400 .92rem var(--body); color: var(--muted); margin-top: .5rem; }
.dial { display: grid; gap: .4rem; }
.dial-read { font: 400 clamp(3rem, 7vw, 5rem)/1 var(--display); font-variant-numeric: tabular-nums; }
.dial-read small { font: 500 1rem var(--body); color: var(--muted); margin-left: .5rem; }
.dial-ticks { display: flex; justify-content: space-between; font: 500 .74rem var(--mono); color: var(--muted); }
.game-actions { display: flex; gap: .6rem; flex-wrap: wrap; }
.game-actions .primary { width: auto; padding: .75rem 1.4rem; }
.timeline { position: relative; height: 150px; margin-top: .4rem; border-top: 1px solid var(--rule); }
.timeline .axis { position: absolute; left: 0; right: 0; bottom: 18px; height: 1px; background: var(--rule-2); }
.timeline .tick { position: absolute; bottom: 0; font: 500 .7rem var(--mono); color: var(--muted); transform: translateX(-50%); }
.timeline .mk { position: absolute; transform: translateX(-50%); display: grid; justify-items: center; gap: 2px; transition: left .7s cubic-bezier(.16, 1, .3, 1), opacity .4s; }
.timeline .mk i { width: 2px; background: currentColor; }
.timeline .mk span { font-size: .74rem; font-weight: 600; white-space: nowrap; padding: .1rem .45rem; border-radius: 4px; background: var(--surface); border: 1px solid currentColor; }
.timeline .truth { color: var(--ink); }
.timeline .you { color: var(--city); }
.timeline .wq { color: var(--qloo); }
.timeline .alone { color: var(--muted); }
.verdicts { display: grid; gap: .4rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); }
.verdicts div { border: 1px solid var(--rule); border-radius: 8px; padding: .6rem .8rem; font-size: .88rem; }
.verdicts div b { display: block; font-size: .78rem; color: var(--muted); font-weight: 600; }
.verdicts .ok { border-color: var(--ok); }
.verdicts .ok::after { content: "Right, within 30 minutes"; display: block; color: var(--ok); font-size: .78rem; font-weight: 600; }
.verdicts .no::after { content: "Wrong"; display: block; color: var(--err); font-size: .78rem; font-weight: 600; }
.verdicts .dk::after { content: "Declined"; display: block; color: var(--err); font-size: .78rem; font-weight: 600; }
.game-end { border-top: 1px solid var(--rule); padding-top: 1rem; }
.game-end strong { display: block; font: 400 clamp(1.6rem, 3vw, 2.2rem)/1.15 var(--display); }

@media (max-width: 1080px) {
  .sb-hero, .play-grid { grid-template-columns: minmax(0, 1fr); }
  .pin-map { height: 400px; }
}
@media (max-width: 700px) {
  .sb-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi:not(:nth-child(3n + 1)) { padding-left: 0; border-left: 0; }
  .kpi:nth-child(even) { padding-left: 1rem; border-left: 1px solid var(--rule); }
  .pair-row { grid-template-columns: 5.6rem minmax(0, 1fr) 3rem; }
  .dumb-legend button { margin-left: 0; }
  .pin-map { height: 340px; }
  .timeline .mk span { font-size: .66rem; padding: .05rem .3rem; }
}

/* ======================================================================
   House rules (taste-skill, impeccable): tone steps instead of outlines and resting shadows, Geist for
   controls and Instrument Serif for display, no tracked caps, no index numbers, no styled accent words, generous section gaps
   ====================================================================== */
h3, h4 { font-family: var(--ui); font-weight: 600; letter-spacing: -.01em; }
button, input, select, textarea, label, .nav, .chips, .toggle, .hint, .facts, .tagline, table.data, .credits,
.hint { font-size: .9rem; }

/* the big type: Instrument Serif, one weight, set close */
.wordmark { font: 400 clamp(3rem, 1rem + 5.8vw, 6.6rem)/.95 var(--display); letter-spacing: -.025em; max-width: 13ch; margin-left: -.03em; }
.wordmark em { font-style: normal; color: inherit; }
.band-head h2, .evidence > h2 { font: 400 clamp(2.3rem, 1.4rem + 3.4vw, 4.4rem)/1 var(--display); letter-spacing: -.02em; text-shadow: none; max-width: 22ch; }
.inputs h2, .dr-head h3, .whatif h3, .dumb-fig figcaption strong, .game-end strong, .pin-empty strong {
  font-family: var(--display); font-weight: 400; letter-spacing: -.01em; }
.game-q { font: 400 clamp(1.9rem, 1.2rem + 2.6vw, 3.3rem)/1.05 var(--display); letter-spacing: -.015em; }
.dial-read, .pin-card .pct, .whatif .res b, .kpi .v, .stats dd, .medians dd, .gain .g, .donut-wrap p b, .rank-list .pos, .ring-num, .duel b {
  font-family: var(--display); font-weight: 400; letter-spacing: -.01em; }
.lede { font-size: clamp(1.1rem, 1rem + .45vw, 1.3rem); line-height: 1.5; max-width: 46ch; color: var(--ink-2); }
.evidence .lede { font-size: clamp(1.15rem, 1.05rem + .4vw, 1.35rem); color: var(--ink); max-width: 60ch; }
.points { color: var(--ink); font-family: var(--ui); font-size: .98rem; }

/* sections breathe: the gap between sections is far larger than any gap inside one */
.band { padding: clamp(4.5rem, 9vw, 9rem) var(--pad); }
.top { padding-top: clamp(2rem, 4vw, 4rem); border-bottom: 0; }
.band + .band { border-top: 0; }
.band:nth-of-type(even) { background: var(--bg); }
.scoreboard, .play, .game { background: var(--surface) !important; }
.scoreboard .panel, .play .panel, .game .panel, .scoreboard .dumb-fig { background: var(--bg); }

/* surfaces: steps in tone, no outlines, nothing at rest casts a shadow */
.panel, .golden button, .sources article, .entry, .chart-fig, .tests-wrap, .agent-viz, .dumb-fig, .map, .pin-map, .lane, .partner, .thread > li {
  border: 0 !important; box-shadow: none !important; }
.golden button { background: var(--surface); }
.golden button:hover { transform: none; background: var(--well); }
.golden li.active button { background: var(--well); box-shadow: inset 0 -3px 0 var(--qloo) !important; }
.sources article { border-top: 0 !important; padding-top: 1.4rem; }
.sources article h3::before { content: ""; display: block; width: 28px; height: 4px; background: var(--ink); margin-bottom: .8rem; }
.sources .s-city h3::before { background: var(--city); }
.sources .s-qloo h3::before { background: var(--qloo); }
.entry { background: var(--surface); }
.lane { background: var(--surface); }
.lane.won { box-shadow: inset 0 -3px 0 var(--qloo) !important; }
.pin-card { background: var(--bg); }
.pin-card.win { box-shadow: inset 0 -4px 0 var(--qloo) !important; }
.inputs { box-shadow: none; background: var(--surface); }
input, select, textarea { border: 0; background: var(--field); box-shadow: inset 0 -1px 0 var(--rule-2); border-radius: 6px; }
input:hover, select:hover, textarea:hover { box-shadow: inset 0 -2px 0 var(--muted); }
input:focus, select:focus, textarea:focus { box-shadow: inset 0 -2px 0 var(--qloo); background: var(--field); }
input[type="range"], input[type="range"]:hover, input[type="range"]:focus { box-shadow: none; background: none; }
.primary { border-radius: 6px; font-family: var(--ui); font-weight: 600; letter-spacing: 0; }
.quiet { border: 0; background: var(--field); border-radius: 6px; font-family: var(--ui); font-weight: 600; }
.quiet:hover:not(:disabled) { background: var(--ink); color: var(--bg); }
.quiet.small { border-radius: 6px; }
.chips button { border: 0; background: var(--field); color: var(--ink); border-radius: 6px; font-weight: 500; }
.toggle { border: 0; border-radius: 8px; background: var(--field); }
.toggle button { border-radius: 6px; }
.icon-btn { border: 0; background: var(--field); }
.nav { border-bottom: 0; background: var(--bg); }
.nav-links a { font-family: var(--ui); font-weight: 500; border-radius: 6px; }
.logo { font-family: var(--ui); font-weight: 600; letter-spacing: -.01em; }
.stats { border-top: 0; margin-top: clamp(3rem, 6vw, 5rem); }
.stats > div { background: var(--surface); padding: 1.1rem 1.2rem 1.3rem; }
.stats > div + div { border-left: 2px solid var(--bg); }
.stats dd { font-size: clamp(2rem, 3.4vw, 3rem); }
.medians { border: 0; gap: 2px; background: none; }
.medians > div, .medians > div + div { background: var(--surface); border: 0; padding: 1.2rem 1.4rem; }
.flow { border-top: 0; gap: 2px; counter-reset: none; }
.flow li, .flow li:not(:nth-child(3n + 1)), .flow li:nth-child(even) { border: 0 !important; background: var(--surface); padding: 1.4rem 1.6rem 1.6rem; }
.flow li::before { display: none; }
.next-list li::before { content: counter(n) "."; font: 600 .9rem var(--ui); color: var(--muted); }
.next-list li { border-top: 0; padding: .55rem 0; }
.tests td:first-child { font-family: var(--display); font-weight: 400; color: var(--qloo); }
table.data th { font-family: var(--ui); }
.verdict { background: var(--ink); color: var(--bg); border-radius: 8px; }
.verdict > b { font-family: var(--display); font-weight: 400; letter-spacing: -.01em; }
.av-log { font-family: var(--code); }
.calls ol { font-family: var(--code); }
.steps .sub { font-family: var(--ui); font-size: .8rem; }

/* the scoreboard: ring and numbers, then one ledger of every result instead of a grid of identical cards */
.sb-kpis { border-top: 0; gap: 2px; }
.kpi, .kpi:not(:nth-child(3n + 1)) { background: var(--bg); border: 0 !important; padding: 1.1rem 1.3rem 1.3rem; }
.sb-ring { background: none !important; }
.ring-bg { stroke: var(--bg); }
.sb-grid { grid-template-columns: minmax(0, 1fr); gap: 2px; }
.card { grid-template-columns: 7rem minmax(0, 1fr) minmax(260px, 340px); align-items: center; gap: .3rem 1.6rem; padding: 1.1rem 1.4rem; background: var(--bg); border-radius: 0; }
.card:first-child { border-radius: 8px 8px 0 0; }
.card:last-child { border-radius: 0 0 8px 8px; }
.card:hover { transform: none; box-shadow: none !important; background: var(--solid); }
.card .id { grid-column: 1; grid-row: 1 / span 3; flex-direction: column; justify-content: flex-start; font-weight: 600; color: var(--ink); align-self: start; }
.card .id .dom { color: var(--muted); font-weight: 400; }
.card h3 { grid-column: 2; font-size: 1.15rem; }
.card .note { grid-column: 2; font-size: .95rem; }
.card .badge { grid-column: 2; grid-row: 3; }
.card .mini { grid-column: 3; grid-row: 1 / span 3; background: none; padding: 0; }
.card .donut { width: 72px; height: 72px; }
.mini .donut-wrap p b { font-size: 1.4rem; }
.badge, .card .badge { border-radius: 4px; }
.pair-row .trk, .gain .trk, .pin-card .gauge, .meter { background: var(--well); }
.donut .bg { stroke: var(--well); }
.dumb .d-b, .dumb .d-q { stroke: var(--bg); }
.dumb .grid { stroke: var(--surface); }
.dumb text, .dumb .val { font-family: var(--ui); }
.donut text { font-family: var(--ui); font-weight: 700; }
.record { background: var(--bg) !important; }

/* drop a pin: the map is the hero of its section */
.play-grid { grid-template-columns: minmax(0, 1.5fr) minmax(320px, 1fr); }
.play-map { padding: 0; background: none !important; }
.play-bar { padding: 0 0 12px; }
.pin-map { height: clamp(420px, 62vh, 640px); border-radius: 8px; }
.drop-pin { border-color: var(--bg); box-shadow: 0 6px 14px rgba(38, 37, 30, .35); }
.whatif .res { border-top: 0; padding-top: .4rem; }

/* the agent radar sits beside the map during a run */
.agent-viz { background: var(--surface); }
.av-node circle.ring { fill: var(--bg); }

@media (max-width: 1080px) {
  .card { grid-template-columns: 5.5rem minmax(0, 1fr); }
  .card .mini { grid-column: 1 / -1; grid-row: auto; }
  .play-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 700px) {
  .card { grid-template-columns: minmax(0, 1fr); }
  .card .id { grid-row: auto; flex-direction: row; }
  .card h3, .card .note, .card .badge, .card .mini { grid-column: 1; grid-row: auto; }
  .stats > div + div { border-left: 0; }
  .stats > div:nth-child(even) { border-left: 2px solid var(--bg); }
}

/* ---------- Test 20 pies ---------- */
.pies { margin: clamp(2rem, 4vw, 3rem) 0 0; padding: clamp(18px, 3vw, 28px); background: var(--surface); border-radius: 12px; }
.pies figcaption strong { display: block; font: 400 clamp(1.5rem, 2.6vw, 2.1rem)/1.15 var(--display); }
.pies figcaption span { font-size: .9rem; color: var(--muted); }
.pie-legend { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; font: 500 .86rem var(--ui); margin: 1rem 0 1.2rem; }
.sw.ink { background: var(--ink); }
.sw.gray { background: var(--rule-2); }
.pie-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(12px, 2.5vw, 32px); }
.pie { display: grid; justify-items: center; text-align: center; gap: .15rem; }
.pie svg { width: min(100%, 170px); height: auto; margin-bottom: .6rem; }
.pie path, .pie circle { stroke: var(--surface); stroke-width: 2; stroke-linejoin: round; transition: transform .25s ease; transform-origin: 60px 60px; }
.pie svg:hover path, .pie svg:hover circle { transform: scale(1.03); }
.w-right { fill: var(--qloo); }
.w-wrong { fill: var(--ink); }
.w-declined { fill: var(--rule-2); }
.pie p { font: 400 1.9rem/1 var(--display); }
.pie p b { font-weight: 400; }
.pie span { font: 600 .9rem var(--ui); }
.pie small { font: 400 .8rem var(--ui); color: var(--muted); }
.pie.wq p { color: var(--qloo); }
@media (max-width: 700px) { .pie-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- nav and map at every width ---------- */
.nav-links { min-width: 0; overflow-x: auto; scrollbar-width: none; }
.nav-links::-webkit-scrollbar { display: none; }
.play-map { position: sticky; top: calc(var(--nav) + 16px); }
@media (max-width: 1180px) {
  .nav-links a[href="#how"], .nav-links a[href="#scene"], .nav-links a[href="#results"] { display: none; }
}
@media (max-width: 1080px) {
  .play-map { position: static; }
}

@media (max-width: 700px) {
  .stats > div, .stats > div:nth-child(3) { padding: 1rem 1rem 1.1rem; }
  .dumb-fig { padding: 16px; }
}

/* ---------- hero: the headline beside a dot map of the whole city ---------- */
.hero { grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); gap: clamp(2rem, 5vw, 5rem); align-items: center; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 2rem; }
.hero-actions a { width: auto; display: inline-flex; align-items: center; text-decoration: none; padding: .8rem 1.2rem; font: 600 .95rem var(--ui); border-radius: 6px; }
.citymap { margin: 0; display: grid; gap: .7rem; justify-items: center; }
.citymap .cm-bar, .citymap .cm-hint { width: min(100%, max(260px, calc((100vh - var(--nav) - 190px) * .687))); }
.cm-frame { position: relative; aspect-ratio: 26 / 37.5; width: min(100%, calc((100vh - var(--nav) - 190px) * .687)); min-width: 260px; justify-self: center; background: none; overflow: visible; cursor: crosshair; }
.cm-frame canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.cm-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1.4rem; font: 500 .88rem var(--ui); color: var(--muted); }
.cm-bar b { color: var(--ink); font-weight: 600; }
.cm-key { display: inline-flex; align-items: center; gap: .45rem; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; }
.dot.ink { background: var(--ink); }
.dot.red { background: var(--qloo); }
.dot.blue { background: var(--city); }
.cm-pick { margin: 0 0 0 auto; display: inline-flex; align-items: center; gap: .5rem; font: 500 .88rem var(--ui); }
.cm-pick select { width: auto; padding: .35rem .55rem; font-size: .88rem; }
.cm-hint { font: 400 .86rem var(--ui); color: var(--muted); }
.cm-card { position: absolute; width: min(260px, 70%); background: var(--ink); color: var(--bg); border-radius: 8px; padding: .8rem .95rem;
  box-shadow: var(--float); font: 400 .86rem/1.4 var(--ui); pointer-events: auto; z-index: 2; }
.cm-card b.big { display: block; font: 400 2.2rem/1 var(--display); margin: .15rem 0 .25rem; }
.cm-card .sub { color: var(--rule-2); }
.cm-card a { color: var(--bg); font-weight: 600; }

/* ---------- scout: the tool gets its own section ---------- */
.scout { background: var(--surface) !important; }
.scout-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(380px, 560px); gap: clamp(2rem, 5vw, 5rem); align-items: start; }
.scout-copy h2 { font: 400 clamp(2.3rem, 1.4rem + 3.4vw, 4.4rem)/1 var(--display); letter-spacing: -.02em; margin-bottom: 1.2rem; }
.scout-steps { list-style: none; margin: 1.6rem 0 0; padding: 0; display: grid; gap: .7rem; font: 400 1rem var(--ui); }
.scout-steps li { padding-left: 1.2rem; position: relative; }
.scout-steps li::before { content: ""; position: absolute; left: 0; top: .55em; width: 7px; height: 7px; background: var(--qloo); }
.scout .inputs { background: var(--bg); }

/* ---------- alignment: every section head is one column on one left edge ---------- */
.band-head { display: grid; justify-items: start; align-items: start; gap: 1rem; margin-bottom: clamp(1.8rem, 3vw, 2.6rem); }
.band-head .hint { max-width: 64ch; font-size: 1rem; line-height: 1.55; margin: 0; }
.pin-card .ph-row > span { display: inline-flex; align-items: center; gap: .4rem; }
.pin-card h3 { min-width: 0; }

@media (max-width: 700px) { .cm-frame, .citymap .cm-bar, .citymap .cm-hint { width: 100%; } }
@media (max-width: 1080px) {
  .hero, .scout-grid { grid-template-columns: minmax(0, 1fr); }
  .cm-pick { margin-left: 0; }
}

/* ---------- how it works: the heading holds the left column while the steps and sources fill the right ---------- */
.how-it { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 2fr); column-gap: clamp(2rem, 5vw, 5rem); row-gap: clamp(3rem, 6vw, 5rem);
  padding-inline: max(var(--pad), calc((100% - var(--max)) / 2)); align-items: start; }
.how-it > * { max-width: none; margin-inline: 0; }
.how-it > .band-head { grid-column: 1; position: sticky; top: calc(var(--nav) + 24px); margin: 0; }
.how-it > .band-head.second { margin-top: 0; }
.how-it > .flow, .how-it > .sources { grid-column: 2; }
.how-it .flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.how-it .sources { grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.sb-more { margin-top: 14px; }
.timeline { height: 170px; }
@media (max-width: 1080px) {
  .how-it { grid-template-columns: minmax(0, 1fr); }
  .how-it > .band-head, .how-it > .flow, .how-it > .sources { grid-column: 1; position: static; }
}
@media (max-width: 700px) { .how-it .flow { grid-template-columns: minmax(0, 1fr); } }

/* the audit and scene sections share the page's left edge; only the line length is capped */
.evidence > h2, .evidence > .lede { max-width: var(--max); }
.evidence > .lede { padding-right: max(0px, calc(100% - 64ch)); }

/* ---------- one edge: every block in a section starts and ends on the same lines ---------- */
.band > * { margin-left: auto !important; margin-right: auto !important; }
.how-it > * { margin-left: 0 !important; margin-right: 0 !important; }
.sb-more { display: block; width: fit-content; margin-left: max(0px, calc((100% - var(--max)) / 2)) !important; }

/* ---------- why Qloo: the claim on the left, the four answers on the right, then the duel ---------- */
.why-lead { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 5rem); align-items: center; }
.why-copy h2 { font: 400 clamp(2.3rem, 1.4rem + 3.4vw, 4.4rem)/1 var(--display); letter-spacing: -.02em; margin-bottom: 1.3rem; max-width: 16ch; }
.why-copy .lede { margin-bottom: 1.6rem; }
.why-big { display: grid; gap: .3rem; font: 400 1.05rem var(--ui); margin-bottom: 1rem; }
.why-big b { font: 400 clamp(2.2rem, 3.4vw, 3rem)/1 var(--display); margin-right: .5rem; }
.why-big .wq b { color: var(--qloo); }
.why-copy .answers { margin-top: 1.2rem; border-top: 0; padding-top: 0; }
.why .pies { margin: 0; }
.why .pie-row { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 1.6rem; }
.why .pie svg { width: min(100%, 150px); }
.why .duel-replay { margin-top: clamp(3rem, 6vw, 5rem); }

/* ---------- how we know: one column of rows that open ---------- */
.medians { margin-top: 0; }
.audit { margin-top: clamp(2rem, 4vw, 3rem); display: grid; gap: 2px; }
.entries { columns: auto; display: grid; gap: 2px; margin: 0; }
details.entry { display: block; background: var(--surface); border-radius: 0; padding: 0; margin: 0; }
details.entry:first-child { border-radius: 10px 10px 0 0; }
details.entry summary { list-style: none; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr) 1.2rem; gap: .4rem 2rem; align-items: baseline;
  padding: 1rem 1.3rem; cursor: pointer; font-weight: 400; }
details.entry summary::-webkit-details-marker { display: none; }
details.entry summary::after { content: "+"; font: 400 1.3rem/1 var(--ui); color: var(--muted); justify-self: end; }
details.entry[open] summary::after { content: "\2212"; }
details.entry summary:hover { background: var(--field); }
.entry .et { font: 600 1rem/1.35 var(--ui); }
.entry .er { font: 400 .92rem/1.45 var(--ui); color: var(--muted); }
.entry .eb { display: grid; grid-template-columns: 6rem minmax(0, 1fr); gap: .45rem 1.4rem; margin: 0; padding: .2rem 1.3rem 1.3rem; max-width: 90ch; }
.entry .eb dt { font: 600 .82rem var(--ui); color: var(--muted); padding-top: .15rem; }
.entry .eb dd { margin: 0; font-size: .95rem; line-height: 1.55; }
.entry .src-files { border: 0; padding: 0; margin: 0; font: 400 .8rem var(--ui); color: var(--muted); }
.tests-acc { background: var(--surface); border-radius: 0 0 10px 10px; }
.tests-acc > summary { padding: 1rem 1.3rem; font: 600 1rem var(--ui); cursor: pointer; }
.tests-acc .tests-wrap { margin: 0; background: none; border-radius: 0; }
.tests-acc .tests { min-width: 640px; }

@media (max-width: 1080px) {
  .why-lead { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 700px) {
  details.entry summary { grid-template-columns: minmax(0, 1fr) 1.2rem; }
  .entry .er { grid-column: 1; grid-row: 2; }
  .entry .eb { grid-template-columns: minmax(0, 1fr); gap: .15rem; }
  .entry .eb dd { margin-bottom: .5rem; }
}

/* ---------- the business ---------- */
.biz-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 520px); gap: clamp(2rem, 5vw, 5rem); align-items: start; }
.biz-copy h2 { font: 400 clamp(2.3rem, 1.4rem + 3.4vw, 4.4rem)/1 var(--display); letter-spacing: -.02em; margin-bottom: 1.3rem; max-width: 16ch; }
.biz-facts { list-style: none; margin: 2rem 0 0; padding: 0; display: grid; gap: 1.1rem; }
.biz-facts li { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: 1rem; align-items: baseline; }
.biz-facts b { font: 400 clamp(2rem, 3vw, 2.6rem)/1 var(--display); font-weight: 400; }
.biz-facts span { font: 400 1rem/1.45 var(--ui); color: var(--muted); }
.biz-facts span span { color: inherit; }
.biz-calc { padding: clamp(18px, 3vw, 28px); display: grid; gap: 1rem; background: var(--surface); }
.biz-calc h3 { font: 400 1.7rem/1.15 var(--display); }
.biz-calc .sl { display: grid; grid-template-columns: minmax(0, 1fr) 4rem; gap: .2rem .8rem; align-items: center; }
.biz-calc .sl label { grid-column: 1 / -1; margin: 0; font-size: .9rem; }
.biz-calc output { font: 600 1rem var(--ui); text-align: right; }
.biz-total { display: flex; align-items: baseline; gap: .6rem; margin-top: .4rem; }
.biz-total b { font: 400 clamp(2.8rem, 5vw, 4rem)/1 var(--display); color: var(--qloo); font-weight: 400; }
.biz-total span { font: 500 1rem var(--ui); color: var(--muted); }
.biz-split { display: grid; gap: .2rem; font: 400 .9rem var(--ui); color: var(--muted); }
.biz-split b { color: var(--ink); font-weight: 600; }
.biz-why { margin-top: clamp(3rem, 6vw, 5rem) !important; }
.biz-why h3 { font: 400 clamp(1.6rem, 2.6vw, 2.2rem)/1.15 var(--display); margin-bottom: 1.4rem; }
.biz-why ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px; }
.biz-why li { background: var(--surface); padding: 1.2rem 1.3rem 1.4rem; display: grid; gap: .4rem; align-content: start; }
.biz-why li b { font: 400 clamp(2.2rem, 3.4vw, 3rem)/1 var(--display); color: var(--qloo); font-weight: 400; }
.biz-why li span { font: 400 .95rem/1.45 var(--ui); color: var(--ink-2); }
.audit-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; margin-bottom: 2px; }
.audit-cols > div { background: var(--surface); padding: 1.4rem 1.5rem 1.6rem; }
.audit-cols h3 { font: 400 1.6rem/1.15 var(--display); margin-bottom: .7rem; }
.audit-cols p { font: 400 .98rem/1.6 var(--ui); color: var(--ink-2); }
.audit-cols > div:first-child { border-radius: 10px 0 0 0; }
.audit-cols > div:last-child { border-radius: 0 10px 0 0; }
@media (max-width: 1080px) {
  .biz-grid { grid-template-columns: minmax(0, 1fr); }
  .biz-why ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .audit-cols { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 700px) {
  .biz-facts li { grid-template-columns: minmax(0, 1fr); gap: .2rem; }
  .biz-why ul { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- spacing fixes found by the overlap check ---------- */
.how-it > .band-head { position: static !important; }
.why-big { gap: .8rem; }
.why-big > span { display: flex; align-items: baseline; flex-wrap: wrap; gap: .2rem .5rem; line-height: 1.1; }
.kpi { gap: .55rem !important; }
.kpi .v { line-height: 1.05; }
.dr-q .hint { display: block; margin: .35rem 0 0; }

.foot-links { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; }

/* the run's rail stays pinned but never taller than the screen: its own scroll keeps every part reachable */
.rail { max-height: calc(100vh - var(--nav) - 32px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; padding-right: 2px; }
.agent-viz.in-rail svg { max-height: 240px; }
.agent-viz svg { overflow: hidden; }
@media (max-width: 1080px) { .rail { max-height: none; overflow: visible; padding-right: 0; } }

/* never a sideways scroll: sizes use the page width (100%), not the window width with its scrollbar (100vw) */
html, body { overflow-x: clip; max-width: 100%; }
@media (max-width: 700px) {
  .tests, .tests-acc .tests, .answers table { min-width: 0 !important; table-layout: auto; }
  .tests th, .tests td { padding: .55rem .5rem; font-size: .82rem; overflow-wrap: anywhere; }
  .tests td:nth-child(2) { width: auto; }
  .answers table { font-size: .7rem; }
  .answers th, .answers td { padding: .35rem .3rem; overflow-wrap: anywhere; }
}

.answers table { min-width: 0 !important; font-size: .76rem; }
.answers th, .answers td { padding: .4rem .45rem; overflow-wrap: anywhere; }
.answers .t20-wrap { overflow-x: visible; }

/* ---------- the two games and the pin challenge ---------- */
.game-title { font: 400 clamp(1.5rem, 2.4vw, 2rem)/1.1 var(--display); }
.quiz-box { margin-top: 20px !important; }
.qz-opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.qz-opt { padding: 1.1rem 1rem; border: 0; border-radius: 8px; background: var(--field); font: 600 1.05rem var(--ui); color: var(--ink); text-align: left; transition: background .2s, color .2s; }
.qz-opt:hover:not(:disabled) { background: var(--ink); color: var(--bg); }
.qz-opt:disabled { cursor: default; }
.qz-opt.win { background: var(--qloo); color: var(--on-qloo); }
.qz-opt.picked:not(.win) { background: var(--well); color: var(--muted); }
.qz-reveal { display: grid; gap: .8rem; }
.qz-reveal .pair-row { grid-template-columns: 9rem minmax(0, 1fr) 3.6rem; font-size: .9rem; }
.qz-reveal .pair-row .trk { height: 14px; }
.qz-verdict { font: 600 1rem var(--ui); }
.qz-verdict.ok { color: var(--ok); }
.qz-verdict.no { color: var(--err); }
.pin-goal { font: 500 .95rem/1.45 var(--ui); padding: .8rem 1rem; border-radius: 8px; background: var(--bg); margin: 0; }
.pin-goal.done { background: var(--qloo); color: var(--on-qloo); }
@media (max-width: 700px) { .qz-opts { grid-template-columns: minmax(0, 1fr); } .qz-reveal .pair-row { grid-template-columns: 6rem minmax(0, 1fr) 3.2rem; } }

.pin-addr { display: flex; gap: .4rem; flex: 1 1 260px; max-width: 360px; }
.pin-addr input { padding: .4rem .6rem; font-size: .9rem; }
@media (max-width: 700px) { .pin-addr { max-width: none; } }

/* the founder report: printing shows only the run, never the rest of the page */
@media print {
  .top, .biz, .scout, .saved, .play, .why, .game, .scoreboard, .how-it, .scene, #evidence, .agent-viz, .scroll-bar, .foot { display: none !important; }
  .app { padding-top: 0 !important; }
  .rail { max-height: none !important; overflow: visible !important; }
}

/* the agent radar: long log lines must never widen the card (a grid item's minimum width is its content) */
.rail { grid-template-columns: minmax(0, 1fr); }
.agent-viz, .av-log, .av-log li { min-width: 0; }
.agent-viz { max-width: 100%; overflow: hidden; }
.agent-viz.in-rail svg { width: auto; max-width: 100%; margin-inline: auto; }
.av-node text.cl { font-size: 9px; }

/* ---------- smaller screens ---------- */
@media (max-width: 1080px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .inputs { width: 100%; }
  .cols { grid-template-columns: minmax(0, 1fr); }
  .rail { position: static; order: -1; }
  .trace { max-height: 320px; }
  .flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flow li:not(:nth-child(3n + 1)) { padding-left: 0; border-left: 0; }
  .flow li:nth-child(even) { padding-left: 1.6rem; border-left: 1px solid var(--rule); }
}
@media (max-width: 700px) {
  .nav { gap: .5rem; }
  .nav-links a { padding: .4rem .45rem; font-size: .84rem; }
  .nav-links a:not([href="#play"]):not([href="#why"]):not([href="#game"]) { display: none; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats > div:nth-child(3) { padding-left: 0; border-left: 0; }
  .stats > div:nth-child(n + 3) { border-top: 1px solid var(--h-rule); }
  .field-row { grid-template-columns: minmax(0, 1fr); }
  .points li:not(:first-child) { display: none; }
  .eyebrow span { display: block; margin: .35rem 0 0; padding: 0; border: 0; }
  .duel { grid-template-columns: minmax(0, 1fr); }
  .hours-axis, .hours-row { grid-template-columns: minmax(0, 7rem) minmax(0, 1fr) 3rem; }
  .inputs { padding: 18px; }
  .mode-toggle button { font-size: .78rem; white-space: normal; line-height: 1.2; }
  .panel { padding: 18px; }
  .medians { grid-template-columns: minmax(0, 1fr); }
  .medians > div + div { padding-left: 0; border-left: 0; border-top: 1px solid var(--rule); }
  .map { height: 280px; }
  .flow { grid-template-columns: minmax(0, 1fr); }
  .flow li, .flow li:nth-child(even) { padding-left: 0; border-left: 0; }
  .rank-list > li { grid-template-columns: 2.3rem minmax(0, 1fr); }
  .rank-list .pos { font-size: 2.1rem; }
  .rank-list .hood { display: block; margin-left: 0; }
  .score { grid-template-columns: minmax(0, 1fr); gap: .3rem; }
  .facts { flex-direction: column; gap: .15rem; }
  .ask-form { flex-wrap: wrap; }
  .ask-form input { flex-basis: 100%; }
  .ask-btn { width: 100%; }
  .legend button { margin-left: 0; }
  .redacted dl { grid-template-columns: minmax(0, 1fr); gap: .1rem; }
  .redacted dd { margin-bottom: .5rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  .scroll-bar, .agent-viz, .scoreboard, .duel-replay, .play, .game,
  .nav, .inputs, .saved, .how-it, .trace, .toggle, .ask, .evidence, .foot, .stats, .points, .grid-art, #print-report, #copy-brief, .map-key, .map-fit,
  .to-top, .toast, .skip, .around, .band-head, .leaflet-control-container { display: none !important; }
  .top { background: #fff; color: #000; padding: 0 0 8px; border: 0; --h-ink: #000; --h-muted: #444; }
  .hero { display: block; }
  .wordmark { font-size: 2rem; }
  .band { padding: 0; }
  .cols { display: block; }
  .rail { position: static; margin-top: 12px; }
  body, .app { background: #fff; color: #000; }
  .panel { border: 0; padding: 0 0 12px; box-shadow: none; break-inside: avoid; }
  .verdict { background: #fff; color: #000; border: 1px solid #000; box-shadow: none; }
  .map { height: 300px; break-inside: avoid; box-shadow: none; }
  .main > * { animation: none; }
}
@media print {
  /* paper is white: print uses a light palette */
  :root, :root[data-theme="night"] {
    --solid: #fff; --chart: #fff; --base: #5B7FA6; --well: #E8E8E4; --on-qloo: #fff;
    --bg: #FFFFFF; --surface: #FFFFFF; --field: #F6F6F4; --ink: #0A0A0B; --ink-2: #2B2B2F; --muted: #55555B;
    --faint: #7A7A80; --rule: #E2E2DE; --rule-2: #CFCFCA; --city: #2B5C8A; --qloo: #B8361A;
    --city-tint: #E3EAF1; --qloo-tint: #F6DDD3; --ok: #1B8A4B; --warn: #8F5E00; --err: #B3261E;
    --map-filter: grayscale(1); color-scheme: light;
  }
  html { background: #fff; }
}
