/* ─────────────────────────────────────────────────────────────
   midas.css — the atom sheet
   Single source of truth for the repeated patterns in MIDAS.
   Edit the class here, never the page.

   COLOUR RULE — hue belongs to the metals.
     · The eight metal plates carry rank, and they are the only place
       hue lives freely. They are surfaces, not paint.
     · Outside them: one blue ramp in four steps (scale, and what is in
       play), acid green for good, acid red for issues. Nothing else.
     · Six neutrals do the rest: two grounds, three inks, one rule weight.
       --hairline is both the rule AND all type on an ink ground.
     · A place is not a claim — the query surface takes no accent.
     · Row tints follow an accent that already exists; never invented alone.
   ───────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

/* ── Tokens ─────────────────────────────────────────────────── */
[data-theme="void-os"] {
  --font-display: Archivo, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-body: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* accents — hue belongs to the metals. Outside them: blue in four steps
     for scale and what is in play, acid green for good, acid red for issues.
     Nothing else carries colour. */
  --blue-deep: #0A0850;
  --blue-dark: #2318C8;
  --blue: #3D2BFF;
  --blue-light: #8175FF;
  --acid-green: #C9F03D;
  --acid-red: #FF2B3D;

  /* neutrals — six: two grounds, three inks, one rule.
     ink/body-grey/muted are the three inks on paper;
     hairline is both the rule weight AND all type on ink. */
  --ink: #0A0A0A;
  --paper: #FFFFFF;
  --bone: #EFEEE9;
  --hairline: #C2C0B8;
  --body-grey: #4A4A50;
  --muted: #66666C;

  /* row tints — each follows its accent, never invented alone */
  --wash-blue: #F0EEFF;
  --wash-gold: #FDF6E0;
}

a { color: #3D2BFF; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 2px; }
a:hover { color: #0A0A0A; text-decoration-color: #3D2BFF; }

/* ── Type atoms ─────────────────────────────────────────────── */
.mono-xs {
  font-family: var(--font-mono);
  font-weight: 500;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}

.masthead-name {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.6rem, 6.4vw, 5.4rem);
  line-height: 0.9;
  letter-spacing: -0.035em;
  text-transform: uppercase;
  text-wrap: balance;
}

/* ── State marks: absent ≠ unknown ≠ zero ───────────────────── */
.pip {
  width: 9px;
  height: 9px;
  flex: none;
  display: inline-block;
  background: #3D2BFF;
  animation: pp 2s ease-in-out infinite;
}

.hatch {
  background-color: #EFEEE9;
  background-image: repeating-linear-gradient(45deg, rgba(10, 10, 10, 0.30) 0 2px, transparent 2px 5px);
}

/* ── Page states: the five a page must draw ─────────────────── */
/* empty/not-seeded · stale · partial · error · refused.
   Same mono chip; the ground carries the meaning. Colour stays
   inside §3 — error is the one acid-red strip, refused is neutral
   (a refusal is not a failure), staleness reads as the system's
   own hatch texture. */
.state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 2px solid #0A0A0A;
  padding: 4px 9px;
  white-space: nowrap;
}
.state-empty   { background: #EFEEE9; color: #66666C; border-style: dashed; border-color: rgba(10, 10, 10, 0.45); }
.state-stale   { background-color: #EFEEE9; background-image: repeating-linear-gradient(45deg, rgba(10, 10, 10, 0.12) 0 2px, transparent 2px 6px); color: #0A0A0A; }
.state-partial { background: #FFFFFF; color: #0A0A0A; }
.state-partial::before { content: ''; width: 8px; height: 8px; flex: none; border: 1px solid #0A0A0A; background: linear-gradient(90deg, #0A0A0A 50%, transparent 50%); }
.state-error   { background: #FF2B3D; color: #0A0A0A; }
.state-refused { background: #0A0A0A; color: #C2C0B8; }
.state-good    { background: #C9F03D; color: #0A0A0A; }

/* ── Provenance: any AI-derived fact carries its run ─────────── */
/* which run · which model · which prompt version. The blue tick
   marks it derived; never sits on a figure without one. */
.prov {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.58rem;
  letter-spacing: 0.04em;
  color: #4A4A50;
  border: 1px dashed rgba(10, 10, 10, 0.45);
  padding: 3px 8px;
}
.prov::before { content: ''; width: 7px; height: 7px; flex: none; background: #3D2BFF; }

/* ── As-of watermark: every figure states when it was true ───── */
.asof {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #66666C;
}

/* ── Role variant marker: owner-only · rep-only · both ───────── */
/* Tints follow accents that already exist (wash-gold, wash-blue). */
.role {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 2px solid #0A0A0A;
  background: #FFFFFF;
  color: #0A0A0A;
  padding: 3px 9px;
}
.role.is-owner { background: #FDF6E0; }
.role.is-rep   { background: #F0EEFF; }
.role.is-both  { background: #FFFFFF; }

/* ── The metal ladder ───────────────────────────────────────── */
/* Every plate is exactly three stacked layers:
     1. cylindrical shading — bright top, shadowed base, bounce light
     2. brushed grain — fine anisotropic striation, horizontally brushed
     3. the sweep — banded, twin specular highlights, deep shadows
   Only layer 3 ever moves. */
.fill-gold, .fill-gold-plus,
.fill-platinum, .fill-platinum-plus,
.fill-silver, .fill-bronze, .fill-blue, .fill-obsidian {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background-repeat: no-repeat;
  background-size: 100% 100%, 100% 100%, 165% 100%;
  background-position: 0 0, 0 0, 50% 50%;
}

.fill-gold > *, .fill-gold-plus > *,
.fill-platinum > *, .fill-platinum-plus > *,
.fill-silver > *, .fill-bronze > *, .fill-blue > *, .fill-obsidian > * {
  position: relative;
  z-index: 2;
}

.fill-gold, .fill-gold-plus, .fill-platinum, .fill-platinum-plus, .fill-silver {
  color: #241900;
}
.fill-bronze, .fill-blue, .fill-obsidian { color: #FFFFFF; }

.fill-gold {
  background-color: #C9A227;
  background-image:
    linear-gradient(180deg, rgba(255,255,255,0.24) 0%, rgba(255,255,255,0.08) 22%, rgba(255,255,255,0) 50%, rgba(0,0,0,0.03) 82%, rgba(0,0,0,0.06) 100%),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.13) 0 1px, rgba(0,0,0,0.035) 1px 2px),
    linear-gradient(101deg, #C9A227 0%, #E8CF72 7%, #FBF3D0 13%, #E8CF72 19%, #8A6A18 26%, #C9A227 33%, #E8CF72 40%, #FBF3D0 45%, #E8CF72 50%, #8A6A18 57%, #C9A227 64%, #E8CF72 71%, #FBF3D0 76%, #E8CF72 82%, #8A6A18 88%, #C9A227 94%, #C9A227 100%);
}

.fill-gold-plus {
  background-color: #D9B63C;
  background-image:
    linear-gradient(180deg, rgba(255,255,255,0.24) 0%, rgba(255,255,255,0.08) 22%, rgba(255,255,255,0) 50%, rgba(0,0,0,0.03) 82%, rgba(0,0,0,0.06) 100%),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.13) 0 1px, rgba(0,0,0,0.035) 1px 2px),
    linear-gradient(101deg, #D9B63C 0%, #F2E094 7%, #FFFEF0 13%, #F2E094 19%, #A8831F 26%, #D9B63C 33%, #F2E094 40%, #FFFEF0 45%, #F2E094 50%, #A8831F 57%, #D9B63C 64%, #F2E094 71%, #FFFEF0 76%, #F2E094 82%, #A8831F 88%, #D9B63C 94%, #D9B63C 100%);
  animation: gd 18s ease-in-out infinite alternate;
}

.fill-platinum {
  background-color: #B3C2D6;
  background-image:
    linear-gradient(180deg, rgba(255,255,255,0.24) 0%, rgba(255,255,255,0.08) 22%, rgba(255,255,255,0) 50%, rgba(0,0,0,0.03) 82%, rgba(0,0,0,0.06) 100%),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.13) 0 1px, rgba(0,0,0,0.035) 1px 2px),
    linear-gradient(101deg, #B3C2D6 0%, #E4ECF8 7%, #FFFFFF 13%, #E4ECF8 19%, #8496AE 26%, #B3C2D6 33%, #E4ECF8 40%, #FFFFFF 45%, #E4ECF8 50%, #8496AE 57%, #B3C2D6 64%, #E4ECF8 71%, #FFFFFF 76%, #E4ECF8 82%, #8496AE 88%, #B3C2D6 94%, #B3C2D6 100%);
  animation: pd 14s ease-in-out infinite alternate;
}

.fill-platinum-plus {
  background-color: #CEDBEC;
  background-image:
    linear-gradient(180deg, rgba(255,255,255,0.24) 0%, rgba(255,255,255,0.08) 22%, rgba(255,255,255,0) 50%, rgba(0,0,0,0.03) 82%, rgba(0,0,0,0.06) 100%),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.13) 0 1px, rgba(0,0,0,0.035) 1px 2px),
    linear-gradient(101deg, #CEDBEC 0%, #F2F7FE 7%, #FFFFFF 13%, #F2F7FE 19%, #A3B4CB 26%, #CEDBEC 33%, #F2F7FE 40%, #FFFFFF 45%, #F2F7FE 50%, #A3B4CB 57%, #CEDBEC 64%, #F2F7FE 71%, #FFFFFF 76%, #F2F7FE 82%, #A3B4CB 88%, #CEDBEC 94%, #CEDBEC 100%);
  animation: pd 12s ease-in-out infinite alternate;
}

.fill-silver {
  background-color: #C0C2C5;
  background-image:
    linear-gradient(180deg, rgba(255,255,255,0.24) 0%, rgba(255,255,255,0.08) 22%, rgba(255,255,255,0) 50%, rgba(0,0,0,0.03) 82%, rgba(0,0,0,0.06) 100%),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.13) 0 1px, rgba(0,0,0,0.035) 1px 2px),
    linear-gradient(101deg, #C0C2C5 0%, #DCDDDF 7%, #EFEFF0 13%, #DCDDDF 19%, #A2A4A8 26%, #C0C2C5 33%, #DCDDDF 40%, #EFEFF0 45%, #DCDDDF 50%, #A2A4A8 57%, #C0C2C5 64%, #DCDDDF 71%, #EFEFF0 76%, #DCDDDF 82%, #A2A4A8 88%, #C0C2C5 94%, #C0C2C5 100%);
}

.fill-bronze {
  background-color: #A9722F;
  background-image:
    linear-gradient(180deg, rgba(255,255,255,0.24) 0%, rgba(255,255,255,0.08) 22%, rgba(255,255,255,0) 50%, rgba(0,0,0,0.03) 82%, rgba(0,0,0,0.06) 100%),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.13) 0 1px, rgba(0,0,0,0.035) 1px 2px),
    linear-gradient(101deg, #A9722F 0%, #D9A362 7%, #F0CFA0 13%, #D9A362 19%, #6E4A1E 26%, #A9722F 33%, #D9A362 40%, #F0CFA0 45%, #D9A362 50%, #6E4A1E 57%, #A9722F 64%, #D9A362 71%, #F0CFA0 76%, #D9A362 82%, #6E4A1E 88%, #A9722F 94%, #A9722F 100%);
}

.fill-blue {
  background-color: #3D2BFF;
  background-image:
    linear-gradient(180deg, rgba(255,255,255,0.24) 0%, rgba(255,255,255,0.08) 22%, rgba(255,255,255,0) 50%, rgba(0,0,0,0.03) 82%, rgba(0,0,0,0.06) 100%),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.13) 0 1px, rgba(0,0,0,0.035) 1px 2px),
    linear-gradient(101deg, #3D2BFF 0%, #6A5AFF 7%, #9B92FF 13%, #6A5AFF 19%, #1E12A8 26%, #3D2BFF 33%, #6A5AFF 40%, #9B92FF 45%, #6A5AFF 50%, #1E12A8 57%, #3D2BFF 64%, #6A5AFF 71%, #9B92FF 76%, #6A5AFF 82%, #1E12A8 88%, #3D2BFF 94%, #3D2BFF 100%);
  animation: bd 13s ease-in-out infinite alternate;
}

.fill-obsidian {
  background-color: #2C2C34;
  background-image:
    linear-gradient(180deg, rgba(255,255,255,0.24) 0%, rgba(255,255,255,0.08) 22%, rgba(255,255,255,0) 50%, rgba(0,0,0,0.03) 82%, rgba(0,0,0,0.06) 100%),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.13) 0 1px, rgba(0,0,0,0.035) 1px 2px),
    linear-gradient(101deg, #2C2C34 0%, #4A4A54 7%, #6E6E78 13%, #4A4A54 19%, #14141A 26%, #2C2C34 33%, #4A4A54 40%, #6E6E78 45%, #4A4A54 50%, #14141A 57%, #2C2C34 64%, #4A4A54 71%, #6E6E78 76%, #4A4A54 82%, #14141A 88%, #2C2C34 94%, #2C2C34 100%);
  animation: od 12s ease-in-out infinite alternate;
}

/* Every metal moves now: the sweep drifts on the three base metals too. */
.fill-bronze { animation: gd 24s ease-in-out infinite alternate; }
.fill-silver { animation: pd 22s ease-in-out infinite alternate; }
.fill-gold   { animation: gd 20s ease-in-out infinite alternate; }

/* The travelling glint — a skewed band crossing the plate */
.fill-bronze::after, .fill-silver::after, .fill-gold::after,
.fill-gold-plus::after,
.fill-platinum::after, .fill-platinum-plus::after,
.fill-blue::after, .fill-obsidian::after {
  content: "";
  position: absolute;
  top: -30%;
  bottom: -30%;
  left: -60%;
  width: 30%;
  z-index: 1;
  transform: skewX(-16deg);
  pointer-events: none;
  background: linear-gradient(90deg,
    rgba(255,255,255,0) 0%,
    rgba(255,255,255,0.10) 28%,
    rgba(255,255,255,0.34) 44%,
    rgba(255,255,255,0.64) 50%,
    rgba(255,255,255,0.34) 56%,
    rgba(255,255,255,0.10) 72%,
    rgba(255,255,255,0) 100%);
}
/* Shine ladder — the higher the tier, the harder and faster the glint.
   Bronze faintest and slowest → Silver → Gold → Gold+ → Platinum brighter
   and wider → Platinum+ fastest, full strength, with a second trailing glint. */
.fill-bronze::after        { animation: pg 6s   cubic-bezier(.4,0,.5,1) infinite; opacity: 0.4; }
.fill-silver::after        { animation: pg 5.4s cubic-bezier(.4,0,.5,1) infinite; opacity: 0.5; }
.fill-gold::after          { animation: pg 4.8s cubic-bezier(.4,0,.5,1) infinite; opacity: 0.6; }
.fill-gold-plus::after     { animation: pg 4.2s cubic-bezier(.4,0,.5,1) infinite; opacity: 0.75; }
.fill-platinum::after      { animation: pg 3.4s cubic-bezier(.4,0,.5,1) infinite; opacity: 0.9; width: 36%; }
.fill-platinum-plus::after { animation: pg 2.6s cubic-bezier(.4,0,.5,1) infinite; opacity: 1; width: 42%; }
.fill-platinum-plus::before {
  content: ""; position: absolute; top: -30%; bottom: -30%; left: -60%; width: 12%; z-index: 1;
  transform: skewX(-16deg); pointer-events: none;
  background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 50%, rgba(255,255,255,0) 100%);
  animation: pg 2.6s cubic-bezier(.4,0,.5,1) 0.3s infinite;
}
.fill-blue::after          { animation: bgl 5s  cubic-bezier(.4,0,.5,1) infinite; }
.fill-obsidian::after      { animation: og 4.6s cubic-bezier(.4,0,.5,1) infinite; }

/* Shine lives in one place only: inside a .shine-live wrapper (the metals
   specimen). Everywhere else the plates are still — sweep and glint off. */
.fill-gold:not(.shine-live *),
.fill-gold-plus:not(.shine-live *),
.fill-platinum:not(.shine-live *),
.fill-platinum-plus:not(.shine-live *),
.fill-silver:not(.shine-live *),
.fill-bronze:not(.shine-live *),
.fill-blue:not(.shine-live *),
.fill-obsidian:not(.shine-live *),
.fill-gold:not(.shine-live *)::after,
.fill-gold-plus:not(.shine-live *)::after,
.fill-platinum:not(.shine-live *)::after,
.fill-platinum-plus:not(.shine-live *)::after,
.fill-silver:not(.shine-live *)::after,
.fill-bronze:not(.shine-live *)::after,
.fill-blue:not(.shine-live *)::after,
.fill-obsidian:not(.shine-live *)::after,
.fill-platinum-plus:not(.shine-live *)::before { animation: none !important; }

/* Sheen modifiers — how hard the plate catches the light */
.sheen-soft { text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45); }
.sheen-full {
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.50);
}
.sheen-max {
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.70);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.75), inset 0 -1px 0 rgba(255,255,255,0.35);
}
/* Light type needs a dark drop, whatever sheen it is paired with. */
.fill-bronze, .fill-blue, .fill-obsidian,
.fill-bronze.sheen-soft, .fill-bronze.sheen-full, .fill-bronze.sheen-max,
.fill-blue.sheen-soft, .fill-blue.sheen-full, .fill-blue.sheen-max,
.fill-obsidian.sheen-soft, .fill-obsidian.sheen-full, .fill-obsidian.sheen-max {
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.45);
}

/* ── Rank badge — the one way rank is shown ─────────────────── */
.tier-badge {
  flex: none;
  min-width: 30px;
  height: 30px;
  padding: 0 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #0A0A0A;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  line-height: 1;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}
.tier-badge.hatch { color: #4A4A50; border-style: dashed; border-color: rgba(10, 10, 10, 0.45); }

/* On a 30px badge a 30% band is a sliver — widen it and keep the ladder. */
.tier-badge::after { width: 75% !important; }
.tier-badge.fill-bronze::after { opacity: 0.6; }
.tier-badge.fill-silver::after { opacity: 0.7; }
.tier-badge.fill-gold::after { opacity: 0.8; }
.tier-badge.fill-gold-plus::after { opacity: 0.9; }
.tier-badge.fill-platinum-plus::before { width: 30%; }

/* ── Row states ─────────────────────────────────────────────── */
tr.is-lit { background: #FDF6E0; }

/* ── Hover reveal ───────────────────────────────────────────── */
.hov-host { cursor: default; }
.hov-pop {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 0.12s ease, transform 0.12s ease, visibility 0.12s;
}
.hov-host:hover > .hov-pop,
.hov-host:focus > .hov-pop,
.hov-host:focus-within > .hov-pop,
.hov-host:hover .hov-pop,
.hov-host:focus .hov-pop,
.hov-host:focus-within .hov-pop {
  opacity: 1;
  visibility: visible;
  transform: none;
}
.hov-host:focus-visible { box-shadow: inset 0 0 0 2px #3D2BFF; }

/* ── Filter tokens + expanding panel ────────────────────── */
.filter-token {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 12px;
  border: 2px solid #0A0A0A;
  background: #FFFFFF;
  font: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s ease, box-shadow 0.12s ease;
}
.tok-label { font-family: var(--font-mono); font-weight: 500; font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: #0A0A0A; }
.tok-val { font-family: var(--font-mono); font-weight: 700; font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: #3D2BFF; }
/* the value is data-driven and unbounded — cap it so a token can never
   grow wide enough to push its neighbours out of the bar */
.tok-val { display: inline-block; max-width: 15ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.filter-token:hover { background: #EFEEE9; }
.filter-token.is-open { background: #0A0A0A; border-color: #0A0A0A; }
.filter-token.is-open .tok-label { color: #FFFFFF; }
.filter-token.is-open .tok-val { color: #FFFFFF; }
.filter-token.is-open .tok-x { color: #FFFFFF; }
.filter-token.has-value .tok-val { color: #3D2BFF; }
.filter-token.is-open.has-value .tok-val { color: #FFFFFF; }
.tok-x { font-family: var(--font-mono); font-size: 0.72rem; line-height: 1; color: inherit; padding: 0 1px; cursor: pointer; }

/* The bar is one line. Two primaries are pinned, the rest ride a rail that
   the arrows drive — so the hidden scrollbar has a visible control. */
.filter-rail {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.filter-rail::-webkit-scrollbar { width: 0; height: 0; display: none; }
.rail-btn {
  flex: none;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #0A0A0A;
  background: #FFFFFF;
  color: #0A0A0A;
  cursor: pointer;
  padding: 0;
  transition: background 0.1s ease, opacity 0.12s ease;
}
.rail-btn:hover { background: #EFEEE9; }
.rail-btn.is-off { opacity: 0.28; cursor: default; }
.rail-btn.is-off:hover { background: #FFFFFF; }

.active-count {
  flex: none;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 12px;
  background: #0A0A0A;
  color: #FFFFFF;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* ── Link card — a whole panel that is one link ──────────────── */
.link-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  border: 3px solid #0A0A0A;
  background: #FFFFFF;
  color: #0A0A0A;
  text-decoration: none;
  box-shadow: 5px 5px 0 #0A0A0A;
  transition: background 0.12s linear, box-shadow 0.06s linear, transform 0.06s linear;
}
.link-card:hover { background: #EFEEE9; }
.link-card:active { transform: translate(5px, 5px); box-shadow: 0 0 0 #0A0A0A; }
.link-card:focus-visible { outline: none; box-shadow: 5px 5px 0 #0A0A0A, inset 0 0 0 3px #3D2BFF; }
.link-card:focus { outline: none; box-shadow: 5px 5px 0 #0A0A0A, inset 0 0 0 3px #3D2BFF; }

/* ── Carousel chrome ────────────────────────────────────────── */
/* Arrows are chrome, not furniture: present only while the rail they
   drive is hovered or holds focus. Keyboard reach is preserved —
   :focus-within on the parent brings them back before they can be
   tabbed to, and reduced motion drops the fade, never the reveal. */
.rail-nav-group {
  opacity: 0;
  transition: opacity 0.18s ease;
}
*:hover > .rail-nav-group,
*:focus-within > .rail-nav-group,
.rail-nav-group:focus-within { opacity: 1; }
/* a card carousel: the arrow floats over the rail it drives */
.arrow-host .arrow-btn {
  opacity: 0;
  transition: opacity 0.18s ease;
  border: 2px solid #0A0A0A;
  background: #FFFFFF;
  color: #0A0A0A;
  cursor: pointer;
  padding: 0;
}
.arrow-host:hover .arrow-btn,
.arrow-host:focus-within .arrow-btn { opacity: 1; }
.arrow-host .arrow-btn:hover { background: #EFEEE9; }
.arrow-host .arrow-btn:focus-visible { outline: none; box-shadow: inset 0 0 0 2px #3D2BFF; }

[data-tier-wrap] [data-tier-nav] { opacity: 0; transition: opacity 0.18s ease; }
[data-tier-wrap]:hover [data-tier-nav],
[data-tier-wrap]:focus-within [data-tier-nav] { opacity: 1; }
[data-tier-wrap] [data-tier-nav]:hover { background: #EFEEE9; }
@media (prefers-reduced-motion: reduce) {
  .rail-nav-group, [data-tier-wrap] [data-tier-nav], .arrow-host .arrow-btn { transition: none; }
}

/* ── Option grids — dense bordered chips, code + count ──────── */
.chip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(98px, 1fr)); gap: 8px; }
/* facets whose options are words, not codes, need wider tracks */
.chip-grid.is-wide { grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); }
.place-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(162px, 1fr)); gap: 8px; }

.grid-chip {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 9px 11px;
  border: 2px solid #0A0A0A;
  background: #FFFFFF;
  font: inherit;
  cursor: pointer;
  transition: background 0.1s ease, box-shadow 0.12s ease;
}
.chip-code { font-family: var(--font-mono); font-weight: 700; font-size: 0.78rem; letter-spacing: 0.04em; color: #0A0A0A; white-space: nowrap; }
.chip-count { font-family: var(--font-mono); font-size: 0.62rem; color: #66666C; white-space: nowrap; }
.grid-chip:hover { background: #EFEEE9; }
.grid-chip:focus-visible { outline: none; box-shadow: inset 0 0 0 2px #3D2BFF; }
.grid-chip.is-picked { background: #0A0A0A; box-shadow: inset 0 -4px 0 #3D2BFF; }
.grid-chip.is-picked .chip-code { color: #FFFFFF; }
.grid-chip.is-picked .chip-count { color: #C2C0B8; }

.place-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-height: 44px;
  padding: 11px 12px;
  border: 2px solid #0A0A0A;
  background: #FFFFFF;
  font: inherit;
  cursor: pointer;
  transition: background 0.1s ease, box-shadow 0.12s ease;
}
.place-count { font-family: var(--font-mono); font-weight: 700; font-size: 0.66rem; letter-spacing: 0.02em; color: #0A0A0A; }
.place-name { font-family: var(--font-mono); font-weight: 700; font-size: 0.76rem; letter-spacing: 0.04em; color: #0A0A0A; text-align: center; }
.place-meta { font-family: var(--font-mono); font-size: 0.6rem; color: #4A4A50; }
.place-chip:hover { background: #EFEEE9; }
.place-chip:focus-visible { outline: none; box-shadow: inset 0 0 0 2px #3D2BFF; }
.place-chip.is-picked { background: #0A0A0A; box-shadow: inset 0 -4px 0 #3D2BFF; }
.place-chip.is-picked .place-name { color: #FFFFFF; }
.place-chip.is-picked .place-count { color: #FFFFFF; }
.place-chip.is-picked .place-meta { color: #C2C0B8; }

.drill-head { font-family: var(--font-mono); font-weight: 500; font-size: 0.58rem; letter-spacing: 0.16em; text-transform: uppercase; color: #3D2BFF; }

/* panel commit — blue because it is an action, not good news */
.panel-foot { display: flex; align-items: center; justify-content: space-between; gap: 22px; flex-wrap: wrap; }
.panel-done {
  flex: none; display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-mono); font-weight: 700; font-size: 0.68rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: #FFFFFF; background: #3D2BFF; border: 3px solid #0A0A0A; box-shadow: 3px 3px 0 #0A0A0A;
  padding: 11px 18px; min-height: 44px; cursor: pointer;
  transition: background 0.12s linear, box-shadow 0.12s linear, transform 0.12s linear;
}
.panel-done:hover { background: #2318C8; }
.panel-done:active { transform: translate(3px, 3px); box-shadow: 0 0 0 #0A0A0A; }
.panel-done:focus-visible { outline: none; box-shadow: 3px 3px 0 #0A0A0A, 0 0 0 3px #8175FF; }
.panel-done .done-n { font-weight: 500; color: #FFFFFF; letter-spacing: 0.1em; }

.filter-panel { animation: panelIn 0.26s cubic-bezier(.2,.7,.3,1) both; }
@keyframes panelIn { from { opacity: 0; clip-path: inset(0 0 100% 0); } to { opacity: 1; clip-path: inset(0 0 0 0); } }
.filter-panel .grid-chip, .filter-panel .place-chip { animation: mi 0.26s cubic-bezier(.2,.7,.3,1) both; }
.opt-row > *:nth-child(1) { animation-delay: 0.01s; }
.opt-row > *:nth-child(2) { animation-delay: 0.02s; }
.opt-row > *:nth-child(3) { animation-delay: 0.03s; }
.opt-row > *:nth-child(4) { animation-delay: 0.04s; }
.opt-row > *:nth-child(5) { animation-delay: 0.05s; }
.opt-row > *:nth-child(6) { animation-delay: 0.06s; }
.opt-row > *:nth-child(7) { animation-delay: 0.07s; }
.opt-row > *:nth-child(8) { animation-delay: 0.08s; }
.opt-row > *:nth-child(9) { animation-delay: 0.09s; }
.opt-row > *:nth-child(10) { animation-delay: 0.10s; }
.opt-row > *:nth-child(11) { animation-delay: 0.11s; }
.opt-row > *:nth-child(12) { animation-delay: 0.12s; }

/* ── Form controls ──────────────────────────────────────────── */
.field, .num {
  min-height: 40px;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: #0A0A0A;
  background: #FFFFFF;
  border: 2px solid #0A0A0A;
  border-radius: 0;
  padding: 10px 12px;
  outline: none;
  transition: box-shadow 0.1s ease;
}
.field:focus { box-shadow: inset 0 -4px 0 #3D2BFF; }
.num {
  width: 64px;
  flex: none;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.num:focus { box-shadow: inset 0 -4px 0 #C9F03D; }

.btn-save {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: #0A0A0A;
  background: #FFFFFF;
  border: 2px solid #0A0A0A;
  border-radius: 0;
  box-shadow: 3px 3px 0 #0A0A0A;
  padding: 12px 18px;
  cursor: pointer;
  transition: transform 0.06s ease, box-shadow 0.06s ease;
}
.btn-save:hover { background: #3D2BFF; }
.btn-save:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 #0A0A0A; }
/* An unavailable control is stated in the six neutrals, never in alpha —
   opacity cannot hold the 4.5:1 floor. --muted on bone is 4.9:1. */
.btn-save[disabled], .btn-save.is-off {
  background: #EFEEE9;
  color: #66666C;
  border-color: rgba(10, 10, 10, 0.45);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}
.btn-save[disabled]:hover, .btn-save.is-off:hover { background: #EFEEE9; }

/* A text link that is really a button ("Reveal", "Start over"). Blue because
   it acts; 44px because it is reachable. */
.lnk {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border: none;
  background: none;
  padding: 0;
  color: #3D2BFF;
  cursor: pointer;
}
.lnk:hover { color: #0A0A0A; }
.lnk:focus-visible { outline: none; box-shadow: inset 0 -4px 0 #3D2BFF; }

.ref {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  color: #4A4A50;
  background: #EFEEE9;
  border: 2px dashed rgba(10, 10, 10, 0.45);
  padding: 0 11px;
}

/* ── Printable documents ────────────────────────────────────── */
/* A sheet has one true width. On screen it is scaled to fit the pane; in
   print nothing is touched — doc-page owns the page box. These cannot be
   inline: page-break behaviour, ::first-letter and @media print have no
   inline equivalent. */
doc-page:not(:defined) { visibility: hidden; }
.keep { break-inside: avoid; page-break-inside: avoid; }
.fitbox { position: relative; width: 100%; overflow-x: auto; overflow-y: hidden; }
.fitscale { width: 1056px; transform-origin: top left; }
.fitscale .bleed { box-sizing: border-box; }
.bleed { margin-left: -0.5in; margin-right: -0.5in; }
.rule { height: 3px; background: #0A0A0A; }
.drop::first-letter {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 3.4em;
  line-height: 0.78;
  float: left;
  padding: 4px 10px 0 0;
}
@media print {
  .fitbox { overflow: visible; height: auto !important; }
  .fitscale { width: auto; transform: none !important; }
  .deskbar, [data-fitsensor] { display: none !important; }
}

/* ── Sheet — a modal layer over the page ────────────────────── */
/* The scrim is ink at 72%. It is a ground for nothing, so alpha is legal
   here and nowhere else. The sheet itself is a paper plate with a hard
   ink drop, like .link-card; its head is an ink band with hairline type.
   Escape closes it, and the page behind it does not scroll. */
.sheet-back {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(10, 10, 10, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 36px 24px;
}
.sheet {
  width: 100%;
  max-height: 88vh;
  overflow: auto;
  border: 3px solid #0A0A0A;
  background: #FFFFFF;
  color: #0A0A0A;
  box-shadow: 12px 12px 0 #0A0A0A;
  animation: sheetIn 0.22s cubic-bezier(.2,.7,.3,1) both;
}
.sheet-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 20px 24px;
  background: #0A0A0A;
  color: #C2C0B8;
}
.sheet-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.7rem;
  line-height: 1;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  color: #FFFFFF;
}
.sheet-sub {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  line-height: 1.6;
  color: #C2C0B8;
}
/* the dismiss — hairline on ink, the one control that lives in the head */
.sheet-x {
  flex: none;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 2px solid #C2C0B8;
  background: transparent;
  color: #C2C0B8;
  padding: 9px 13px;
  cursor: pointer;
}
.sheet-x:hover { background: #C2C0B8; color: #0A0A0A; }
/* focus inside a sheet is a blue-light ring — legible on paper, ink and blue */
.sheet button:focus-visible, .sheet a:focus-visible, .sheet-x:focus-visible { outline: none; box-shadow: 0 0 0 3px #8175FF; }

/* ── Settings additions (Grading, 2026-10-12) ───────────────── */
/* Promoted from the inline specimens so a page can switch them by class:
   the ink tab strip and the choice segment. */
.tab-strip { display: flex; flex-wrap: wrap; border: 3px solid #0A0A0A; }
.tab {
  flex: 1 1 auto; min-height: 60px; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 5px;
  padding: 12px 20px; border: none; border-right: 1px solid #C2C0B8; background: #EFEEE9; color: #0A0A0A;
  font-family: var(--font-mono); font-weight: 700; font-size: 0.76rem; letter-spacing: 0.12em; text-transform: uppercase;
  text-align: left; cursor: pointer; transition: background 0.1s ease;
}
.tab:last-child { border-right: none; }
.tab:hover { background: #FFFFFF; }
.tab.is-on { background: #0A0A0A; color: #FFFFFF; box-shadow: inset 0 -4px 0 #3D2BFF; }
.tab-sub { font-weight: 500; font-size: 0.62rem; letter-spacing: 0.06em; text-transform: none; color: #66666C; white-space: nowrap; }
.tab.is-on .tab-sub { color: #C2C0B8; }
.tab:focus-visible { outline: none; box-shadow: inset 0 0 0 2px #3D2BFF; }
.tab.is-on:focus-visible { box-shadow: inset 0 -4px 0 #3D2BFF, inset 0 0 0 2px #8175FF; }

.seg { display: inline-flex; flex-wrap: nowrap; }
.seg-opt {
  min-height: 40px; min-width: 52px; padding: 9px 12px; font-family: var(--font-mono); font-weight: 700; font-size: 0.62rem;
  letter-spacing: 0.06em; text-transform: uppercase; border: 2px solid #0A0A0A; border-left-width: 0; background: #FFFFFF;
  color: #4A4A50; cursor: pointer; white-space: nowrap;
}
.seg-opt:first-child { border-left-width: 2px; }
.seg-opt:hover { background: #EFEEE9; }
.seg-opt.is-on { background: #0A0A0A; color: #FFFFFF; box-shadow: inset 0 -4px 0 #3D2BFF; }
.seg-opt:focus-visible { outline: none; box-shadow: inset 0 0 0 2px #3D2BFF; }
.seg-opt:disabled { cursor: not-allowed; background: #EFEEE9; color: #66666C; }
.seg-opt.is-on:disabled { background: #0A0A0A; color: #FFFFFF; }
/* a segment that switches the page's data navigates — 44px */
.seg.is-nav .seg-opt { min-height: 44px; }

/* Drafts pending and loading join the page states. Draft follows blue
   (in play, not yet live); loading is a paper chip with a blue pulse. */
.state-draft { background: #F0EEFF; color: #2318C8; border-color: #2318C8; }
.state-loading { background: #FFFFFF; color: #0A0A0A; }
.state-loading::before { content: ''; width: 8px; height: 8px; flex: none; background: #3D2BFF; animation: pp 1.2s ease-in-out infinite; }
/* the loading block — bone with a travelling paper sweep. Not hatch:
   hatch means "not looked for", loading means "on its way". */
.skel {
  display: block; background-color: #EFEEE9;
  background-image: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.75) 50%, rgba(255,255,255,0) 100%);
  background-size: 40% 100%; background-repeat: no-repeat; animation: sk 1.3s linear infinite;
}

/* An example figure, not a measured one. Carries its own paper ground,
   so it reads on paper, bone, ink and metal alike. */
.tag-sample {
  display: inline-flex; align-items: center; flex: none; font-family: var(--font-mono); font-weight: 700; font-size: 0.58rem;
  letter-spacing: 0.12em; text-transform: uppercase; color: #4A4A50; background: #FFFFFF; border: 1px solid #0A0A0A;
  padding: 2px 6px; white-space: nowrap; line-height: 1.3;
}

/* Field states: drafted (differs from published), bad (outside its
   range), and read-only — stated in the neutrals, never in alpha. */
.num.is-draft, .field.is-draft { background: #F0EEFF; border-color: #3D2BFF; }
.num.is-bad, .field.is-bad { border-color: #FF2B3D; box-shadow: inset 0 -4px 0 #FF2B3D; }
.num:disabled, .field:disabled {
  background: #EFEEE9; color: #0A0A0A; -webkit-text-fill-color: #0A0A0A; opacity: 1;
  border-style: dashed; border-color: rgba(10, 10, 10, 0.45); cursor: not-allowed;
}
.num::placeholder, .field::placeholder { color: #66666C; opacity: 1; }
.num.is-wide { width: 112px; }
.grid-chip:disabled { cursor: not-allowed; }
.grid-chip:disabled:not(.is-picked) { background: #EFEEE9; }
.grid-chip:disabled:not(.is-picked) .chip-code { color: #4A4A50; }

/* A row in draft — tint follows the draft chip's blue. */
.row-draft { background: #F0EEFF; }

/* Niche level: high / mid / low on the blue ramp (scale, not rank). */
.lvl {
  display: inline-flex; align-items: center; justify-content: center; min-width: 54px; font-family: var(--font-mono); font-weight: 700;
  font-size: 0.62rem; letter-spacing: 0.1em; text-transform: uppercase; border: 2px solid #0A0A0A; padding: 4px 8px; white-space: nowrap;
}
.lvl-high { background: #3D2BFF; color: #FFFFFF; }
.lvl-mid { background: #F0EEFF; color: #2318C8; }
.lvl-low { background: #FFFFFF; color: #4A4A50; }
.lvl-unknown { background: #EFEEE9; color: #4A4A50; border-style: dashed; border-color: rgba(10, 10, 10, 0.45); }

/* A measured share — blue because it is scale. Also the publish progress. */
.meter { display: block; position: relative; height: 14px; border: 2px solid #0A0A0A; background: #EFEEE9; overflow: hidden; }
.meter.is-tall { height: 24px; }
.meter-fill { display: block; height: 100%; background: #3D2BFF; transition: width 0.2s ease; }

/* A whole row that opens and shuts what is under it. 44px: it navigates. */
.disclose {
  width: 100%; min-height: 52px; display: flex; align-items: center; gap: 12px; padding: 8px 18px; border: none; background: transparent;
  color: #0A0A0A; font: inherit; text-align: left; cursor: pointer; transition: background 0.1s ease;
}
.disclose:hover { background: #EFEEE9; }
.disclose:focus-visible { outline: none; box-shadow: inset 0 0 0 2px #3D2BFF; }
.disclose-mark { flex: none; width: 14px; font-family: var(--font-mono); font-weight: 700; font-size: 0.8rem; color: #3D2BFF; }

/* Master list: the picked row inverts to ink with the blue underline. */
.disclose.is-on { background: #0A0A0A; color: #FFFFFF; box-shadow: inset 0 -4px 0 #3D2BFF; }
.disclose.is-on .disclose-mark { color: #8175FF; }
.disclose-meta { font-family: var(--font-mono); font-weight: 500; font-size: 0.6rem; letter-spacing: 0.06em; color: #66666C; white-space: nowrap; }
.disclose.is-on .disclose-meta { color: #C2C0B8; }
/* a lit row outside a table — same gold wash as tr.is-lit */
.row-lit { background: #FDF6E0; }

/* Group icon — a mark, not a picture: geometry only, blue or ink. */
.mark-tile { flex: none; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border: 2px solid #0A0A0A; background: #FFFFFF; color: #3D2BFF; }
.mark-tile.is-ink { color: #0A0A0A; }
.mark-tile > i { display: block; width: 16px; height: 16px; background: currentColor; }
.mark-tile > .m-ci { border-radius: 50%; }
.mark-tile > .m-di { width: 13px; height: 13px; transform: rotate(45deg); }
.mark-tile > .m-tri { width: 18px; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.mark-tile > .m-trd { width: 18px; clip-path: polygon(0 0, 100% 0, 50% 100%); }
.mark-tile > .m-half { background: linear-gradient(90deg, currentColor 50%, transparent 50%); border: 2px solid currentColor; }
.mark-tile > .m-bar { width: 22px; height: 6px; }
.mark-tile > .m-ring { background: transparent; border: 3px solid currentColor; border-radius: 50%; }
.mark-tile > .m-frame { background: transparent; border: 3px solid currentColor; }
.mark-tile > .m-stack { width: 20px; height: 18px; background: repeating-linear-gradient(180deg, currentColor 0 4px, transparent 4px 7px); }
.mark-tile > .m-dots { width: 18px; height: 18px; background: radial-gradient(circle, currentColor 3px, transparent 3.5px) 0 0 / 9px 9px; }

/* Icons — Material Symbols Sharp (square ends, to match the plates). Load the
   font in the page helmet; write the icon's name as the element's text.
   Inside a .mark-tile it takes the tile's colour: blue, or ink with .is-ink. */
.ms {
  font-family: 'Material Symbols Sharp'; font-weight: normal; font-style: normal; font-size: 22px; line-height: 1;
  letter-spacing: normal; text-transform: none; display: inline-block; white-space: nowrap; word-wrap: normal; direction: ltr;
  overflow: hidden; width: 1em; height: 1em; -webkit-font-smoothing: antialiased; font-feature-settings: 'liga';
  font-variation-settings: 'FILL' 0, 'wght' 500, 'GRAD' 0, 'opsz' 24;
}
.mark-tile.is-sm { width: 36px; height: 36px; }
.mark-tile.is-sm > .ms { font-size: 19px; }

/* A grid cell that opens a group. Picked = ink, blue inset underline. */
.tile-card {
  display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: center; gap: 8px 12px; min-height: 72px;
  padding: 12px 14px; border: 2px solid #0A0A0A; background: #FFFFFF; color: #0A0A0A; font: inherit; text-align: left;
  cursor: pointer; transition: background 0.1s ease, box-shadow 0.12s ease;
}
.tile-card:hover { background: #EFEEE9; }
.tile-card:focus-visible { outline: none; box-shadow: inset 0 0 0 2px #3D2BFF; }
.tile-card.is-picked { background: #0A0A0A; color: #FFFFFF; box-shadow: inset 0 -4px 0 #3D2BFF; }
.tile-name { font-family: var(--font-display); font-weight: 700; font-size: 1rem; letter-spacing: -0.02em; line-height: 1.1; }
.tile-meta { font-family: var(--font-mono); font-weight: 500; font-size: 0.6rem; letter-spacing: 0.06em; color: #66666C; }
.tile-card.is-picked .tile-meta { color: #C2C0B8; }

/* ── Business additions (2026-10-13) ─────────────────────────── */
/* Every button that changes something names its workflow. .is-write adds
   the square that says "this writes data". Own ground: reads on any plate. */
.wf {
  display: inline-flex; align-items: center; gap: 5px; flex: none; font-family: var(--font-mono); font-weight: 700; font-size: 0.58rem;
  letter-spacing: 0.1em; text-transform: uppercase; color: #2318C8; background: #F0EEFF; border: 1px solid #2318C8; padding: 2px 6px;
  white-space: nowrap; line-height: 1.3;
}
.wf.is-write::before { content: ''; width: 6px; height: 6px; flex: none; background: #2318C8; }

/* A detector is present, absent or not checked — three states, never two. */
.det { display: inline-flex; align-items: center; flex: none; font-family: var(--font-mono); font-weight: 700; font-size: 0.58rem; letter-spacing: 0.1em; text-transform: uppercase; padding: 3px 7px; border: 2px solid #0A0A0A; white-space: nowrap; }
.det-present { background: #3D2BFF; color: #FFFFFF; }
.det-absent { background: #FFFFFF; color: #4A4A50; }
.det-unchecked { background: #EFEEE9; color: #4A4A50; border-style: dashed; border-color: rgba(10, 10, 10, 0.45); }

/* A way to reach a business: found · none (looked, nothing) · unknown. */
.reach { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; flex: none; border: 2px solid #0A0A0A; background: #FFFFFF; color: #0A0A0A; }
.reach > .ms { font-size: 16px; }
.reach.is-none { background: #EFEEE9; color: #66666C; border-color: rgba(10, 10, 10, 0.45); }
.reach.is-none > .ms { opacity: 1; text-decoration: line-through; }
.reach.is-unknown { color: #4A4A50; border-style: dashed; border-color: rgba(10, 10, 10, 0.45); background-color: #EFEEE9; background-image: repeating-linear-gradient(45deg, rgba(10,10,10,0.18) 0 2px, transparent 2px 5px); }

/* Row selection — a 40px hit target around a 20px box. */
.pick-box { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; flex: none; cursor: pointer; }
.pick-box input { -webkit-appearance: none; appearance: none; width: 16px; height: 16px; margin: 0; border: 2px solid #0A0A0A; border-radius: 0; background: #FFFFFF; cursor: pointer; flex: none; }
.pick-box input:hover { background: #EFEEE9; }
.pick-box input:checked { background: #0A0A0A; box-shadow: inset 0 0 0 2px #FFFFFF; }
.pick-box input:focus-visible { outline: 2px solid #3D2BFF; outline-offset: 2px; }

/* Sort control inside an ink table head. The sorted column goes blue-light. */
.th-sort { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; padding: 0; border: none; background: none; color: inherit; font: inherit; text-transform: inherit; letter-spacing: inherit; cursor: pointer; }
.th-sort:hover { color: #FFFFFF; text-decoration: underline; text-underline-offset: 3px; }
.th-sort.is-on { color: #8175FF; }
.th-sort:focus-visible { outline: none; box-shadow: inset 0 -3px 0 #8175FF; }

/* The bulk bar — an ink plate that stays in view while rows are picked. */
.bulk-bar.is-flow { position: static; }
.bulk-bar { position: sticky; bottom: 16px; z-index: 20; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 10px 16px; background: #0A0A0A; color: #C2C0B8; border: 3px solid #0A0A0A; box-shadow: 6px 6px 0 #3D2BFF; }

/* File drop — dashed ink, bone ground; blue wash while a file is over it. */
.drop-zone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 140px; padding: 22px; border: 3px dashed #0A0A0A; background: #EFEEE9; text-align: center; cursor: pointer; }
.drop-zone:hover, .drop-zone.is-over { background: #F0EEFF; border-color: #3D2BFF; }

/* Website square before a business name — blue when it links to the site,
   dashed bone when there is none. 16px, inside a 44px row. */
.site-dot { flex: none; width: 16px; height: 16px; margin-top: 3px; background: #3D2BFF; border: 2px solid #0A0A0A; }
a.site-dot:hover { background: #2318C8; }
a.site-dot:focus-visible { outline: 2px solid #3D2BFF; outline-offset: 2px; }
.site-dot.is-none { background: #EFEEE9; border: 2px dashed rgba(10, 10, 10, 0.45); }
/* The hover card that .hov-pop opens on a row cell, and its key/value line. */
.pop-card { position: absolute; z-index: 40; width: 300px; max-width: 70vw; border: 2px solid #0A0A0A; background: #FFFFFF; box-shadow: 5px 5px 0 rgba(10,10,10,0.9); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; white-space: normal; text-align: left; }
.pop-row { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; font-family: var(--font-mono); font-size: 0.64rem; line-height: 1.45; letter-spacing: 0.04em; color: #4A4A50; }
.pop-row > span { flex: none; white-space: nowrap; }
.pop-row > b { flex: 1 1 auto; min-width: 0; font-weight: 700; color: #0A0A0A; text-align: right; overflow-wrap: anywhere; }

/* The headline search — display type, no box, an ink rule underneath. */
.search-xl { flex: 1 1 auto; min-width: 0; min-height: 72px; border: none; background: transparent; outline: none; padding: 8px 0; font-family: var(--font-display); font-weight: 800; font-size: clamp(1.6rem, 3.4vw, 2.8rem); letter-spacing: -0.045em; color: #0A0A0A; text-transform: uppercase; }
.search-xl::placeholder { color: #66666C; opacity: 1; }
.search-xl:focus { box-shadow: inset 0 -4px 0 #3D2BFF; }

/* A business name in a list: plain, or struck through when it is closed. */
.name-plain { color: #0A0A0A; text-decoration: none; }
.name-struck { color: #4A4A50; text-decoration: line-through; text-decoration-thickness: 3px; text-decoration-color: #0A0A0A; }
.name-plain:hover, .name-struck:hover { color: #3D2BFF; }
/* The scan count that rides a status chip, in small caps: full s3. */
.sub-n { margin-left: 1px; font-size: 0.6rem; font-weight: 700; letter-spacing: 0.06em; text-transform: none; font-variant: small-caps; }
/* A person on a blue plate — the sales person's initials. */
.rep-tile { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; flex: none; border: 2px solid #0A0A0A; background-color: #3D2BFF; color: #FFFFFF; font-family: var(--font-mono); font-weight: 700; font-size: 0.62rem; letter-spacing: 0.04em; }

/* Inside a .shine-live wrapper only the top tiers move: Gold+, Platinum,
   Platinum+ (and blue / obsidian). Bronze, Silver and Gold stay still. */
.shine-live .fill-bronze, .shine-live .fill-silver, .shine-live .fill-gold { animation: none; }
.shine-live .fill-bronze::after, .shine-live .fill-silver::after, .shine-live .fill-gold::after { animation: none; opacity: 0; }

/* Coverage cell — one detector group on a 3px ink rule: name, "2 of 18", a thin meter.
   A button: it opens the group. Picked = ink ground, blue inset underline. */
.cov-cell { display: flex; flex-direction: column; gap: 6px; min-height: 84px; padding: 10px 2px 12px; border: none; border-top: 3px solid #0A0A0A; background: #FFFFFF; color: #0A0A0A; font: inherit; text-align: left; cursor: pointer; transition: background 0.1s ease; }
.cov-cell:hover { background: #EFEEE9; }
.cov-cell:focus-visible { outline: none; box-shadow: inset 0 0 0 2px #3D2BFF; }
.cov-cell.is-on { background: #0A0A0A; color: #FFFFFF; box-shadow: inset 0 -4px 0 #3D2BFF; padding-left: 10px; padding-right: 10px; }
.cov-n { font-family: var(--font-mono); font-weight: 700; font-size: 1.2rem; letter-spacing: -0.03em; }

/* A field we don't hold. Two forms, both keep text on bone so it holds 4.5:1:
   .hatch-field — a container: a 14px hatched band down the left, dashed edge.
   .hatch-chip  — a small chip: hatched frame, the words on a bone label inside. */
.hatch-field { background: repeating-linear-gradient(45deg, rgba(10,10,10,0.30) 0 2px, transparent 2px 5px) left top / 14px 100% no-repeat, #EFEEE9; outline: 2px dashed rgba(10,10,10,0.45); outline-offset: -2px; padding-left: 14px; }
.hatch-chip { display: inline-flex; padding: 3px; border: 1px dashed rgba(10,10,10,0.45); background-color: #EFEEE9; background-image: repeating-linear-gradient(45deg, rgba(10,10,10,0.30) 0 2px, transparent 2px 5px); }
.hatch-chip > span { background: #EFEEE9; color: #0A0A0A; padding: 1px 6px; }


/* ── Qualify additions (2026-10-13) ─────────────────────────── */
/* A button that spends money: its workflow tag carries a $ in place of the
   square. Always paired with .is-write (spending writes a ledger row). */
.wf.is-spend::before { content: ' from { background-position: -40% 0; } to { background-position: 140% 0; } }

/* ── Utilities ──────────────────────────────────────────────── */
.noscroll { scrollbar-width: none; -ms-overflow-style: none; }
.noscroll::-webkit-scrollbar { width: 0; height: 0; display: none; }

/* ── Motion ─────────────────────────────────────────────────── */
@keyframes gd  { from { background-position: 0 0, 0 0, 22% 50%; } to { background-position: 0 0, 0 0, 78% 50%; } }
@keyframes pd  { from { background-position: 0 0, 0 0, 18% 50%; } to { background-position: 0 0, 0 0, 82% 50%; } }
@keyframes bd  { from { background-position: 0 0, 0 0, 20% 50%; } to { background-position: 0 0, 0 0, 80% 50%; } }
@keyframes od  { from { background-position: 0 0, 0 0, 20% 50%; } to { background-position: 0 0, 0 0, 80% 50%; } }
@keyframes pg  { 0% { left: -60%; } 42%, 100% { left: 140%; } }
@keyframes bgl { 0% { left: -60%; } 44%, 100% { left: 150%; } }
@keyframes og  { 0% { left: -60%; } 46%, 100% { left: 150%; } }
@keyframes pp  { 0%, 100% { opacity: 1; } 50% { opacity: 0.2; } }
@keyframes mi  { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes sheetIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  /* 0s, not 0.01ms — a sub-millisecond duration still latches every property
     at its from-value, so class-driven state (picked chips, open tokens,
     focus underlines) would never paint at all. */
  *, *::before, *::after { animation-play-state: paused !important; transition-duration: 0s !important; }
  /* a paused entry animation would leave these stuck invisible */
  .filter-panel, .filter-panel .grid-chip, .filter-panel .place-chip, .sheet { animation: none !important; }
  /* The metal glint is the one ambient motion kept: it moves nothing on the
     page and carries rank. It keeps its pace; only the sweep stops. */
  .fill-gold, .fill-gold-plus, .fill-platinum, .fill-platinum-plus,
  .fill-silver, .fill-bronze, .fill-blue, .fill-obsidian { animation: none !important; }
  .fill-bronze::after, .fill-silver::after, .fill-gold::after, .fill-gold-plus::after,
  .fill-platinum::after, .fill-platinum-plus::after, .fill-platinum-plus::before,
  .fill-blue::after, .fill-obsidian::after { animation-play-state: running !important; }
}
; width: auto; height: auto; background: none; font-size: 0.66rem; line-height: 1; color: #2318C8; }

/* A primary that is off (tester, nothing picked): stated in the neutrals. */
.panel-done[disabled], .panel-done.is-off { background: #EFEEE9; color: #66666C; border-color: rgba(10, 10, 10, 0.45); box-shadow: none; cursor: not-allowed; transform: none; }
.panel-done[disabled]:hover, .panel-done.is-off:hover { background: #EFEEE9; }

/* A run step: its number in a 44px square, its state is the ground.
   done ink · running blue · blocked red underline · failed red · waiting dashed · skipped struck. */
.step-n { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 3px solid #0A0A0A; background: #FFFFFF; color: #0A0A0A; font-family: var(--font-mono); font-weight: 700; font-size: 0.9rem; letter-spacing: -0.02em; }
.step-n.is-done { background: #0A0A0A; color: #FFFFFF; }
.step-n.is-running { background: #3D2BFF; color: #FFFFFF; box-shadow: inset 0 -5px 0 #0A0A0A; }
.step-n.is-blocked { background: #FFFFFF; color: #0A0A0A; box-shadow: inset 0 -6px 0 #FF2B3D; }
.step-n.is-failed { background: #FF2B3D; color: #0A0A0A; }
.step-n.is-waiting { background: #EFEEE9; color: #4A4A50; border-style: dashed; border-color: rgba(10, 10, 10, 0.45); }
.step-n.is-skipped { background: #EFEEE9; color: #4A4A50; text-decoration: line-through; text-decoration-thickness: 2px; }

/* A share of a limit that is estimated, not spent: striped blue. Over the limit: red. */
.meter-fill.is-est { background: repeating-linear-gradient(45deg, #3D2BFF 0 3px, #8175FF 3px 6px); }
.meter-fill.is-over { background: #FF2B3D; }

/* Where a finding came from: one quiet mono line, no box.
   The leading <b> names the kind of evidence (scan, maps, own data, social);
   the cells after it (scan · page · source · time) are joined by middots. */
.ev-ref { display: flex; flex-wrap: wrap; align-items: baseline; row-gap: 2px; max-width: 100%; font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.04em; line-height: 1.5; color: #4A4A50; }
.ev-ref > b { display: inline-flex; align-items: center; gap: 6px; margin-right: 10px; white-space: nowrap; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: #0A0A0A; }
.ev-ref > b::before { content: ''; width: 6px; height: 6px; flex: none; background: #3D2BFF; }
.ev-ref > span { white-space: nowrap; }
.ev-ref > span:not(:last-child)::after { content: '·'; margin: 0 7px; color: #66666C; }

/* Chips never wrap; a hover card always wraps, even inside a nowrap column. */
.state, .role, .asof, .tag-sample, .tag-internal, .hatch-chip, .wf { white-space: nowrap; }
.hov-pop { white-space: normal; }

/* Stays inside MIDAS; never handed to the display app. */
.tag-internal { display: inline-flex; align-items: center; gap: 6px; flex: none; font-family: var(--font-mono); font-weight: 700; font-size: 0.58rem; letter-spacing: 0.12em; text-transform: uppercase; color: #FFFFFF; background: #0A0A0A; border: 1px solid #0A0A0A; padding: 2px 7px; white-space: nowrap; line-height: 1.3; }
.tag-internal::before { content: ''; width: 6px; height: 6px; flex: none; background: #C2C0B8; }

@keyframes sk { from { background-position: -40% 0; } to { background-position: 140% 0; } }

/* ── Utilities ──────────────────────────────────────────────── */
.noscroll { scrollbar-width: none; -ms-overflow-style: none; }
.noscroll::-webkit-scrollbar { width: 0; height: 0; display: none; }

/* ── Motion ─────────────────────────────────────────────────── */
@keyframes gd  { from { background-position: 0 0, 0 0, 22% 50%; } to { background-position: 0 0, 0 0, 78% 50%; } }
@keyframes pd  { from { background-position: 0 0, 0 0, 18% 50%; } to { background-position: 0 0, 0 0, 82% 50%; } }
@keyframes bd  { from { background-position: 0 0, 0 0, 20% 50%; } to { background-position: 0 0, 0 0, 80% 50%; } }
@keyframes od  { from { background-position: 0 0, 0 0, 20% 50%; } to { background-position: 0 0, 0 0, 80% 50%; } }
@keyframes pg  { 0% { left: -60%; } 42%, 100% { left: 140%; } }
@keyframes bgl { 0% { left: -60%; } 44%, 100% { left: 150%; } }
@keyframes og  { 0% { left: -60%; } 46%, 100% { left: 150%; } }
@keyframes pp  { 0%, 100% { opacity: 1; } 50% { opacity: 0.2; } }
@keyframes mi  { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes sheetIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  /* 0s, not 0.01ms — a sub-millisecond duration still latches every property
     at its from-value, so class-driven state (picked chips, open tokens,
     focus underlines) would never paint at all. */
  *, *::before, *::after { animation-play-state: paused !important; transition-duration: 0s !important; }
  /* a paused entry animation would leave these stuck invisible */
  .filter-panel, .filter-panel .grid-chip, .filter-panel .place-chip, .sheet { animation: none !important; }
  /* The metal glint is the one ambient motion kept: it moves nothing on the
     page and carries rank. It keeps its pace; only the sweep stops. */
  .fill-gold, .fill-gold-plus, .fill-platinum, .fill-platinum-plus,
  .fill-silver, .fill-bronze, .fill-blue, .fill-obsidian { animation: none !important; }
  .fill-bronze::after, .fill-silver::after, .fill-gold::after, .fill-gold-plus::after,
  .fill-platinum::after, .fill-platinum-plus::after, .fill-platinum-plus::before,
  .fill-blue::after, .fill-obsidian::after { animation-play-state: running !important; }
}

/* A watched listing: the eye blinks now and then. */
.eye-live { display: inline-block; transform-origin: 50% 55%; animation: eyeLook 4.2s ease-in-out infinite; }
@keyframes eyeLook { 0%, 88%, 100% { transform: scaleY(1) translateX(0); } 91% { transform: scaleY(0.08); } 94% { transform: scaleY(1) translateX(0); } 97% { transform: translateX(2px); } }
@media (prefers-reduced-motion: reduce) { .eye-live { animation: none; } }
/* A good result that should not compete with "good" green: ink outline on white. */
.state-outline { background: #FFFFFF; color: #0A0A0A; box-shadow: inset 0 0 0 2px #0A0A0A; }


/* ══ Phase 2 page kit ═══════════════════════════════════════════
   Shared by the v5 pages. Colours come from the tokens only. The one
   inline style a page may carry is a data width (flex-grow on a mix
   segment); everything else is a class here. */
.shell { display: flex; min-height: 100vh; background: var(--paper); color: var(--ink); font-family: var(--font-body); }
.shell-main { flex: 1 1 auto; min-width: 0; max-width: 1240px; box-sizing: border-box; padding: 26px 40px 96px; display: flex; flex-direction: column; gap: 22px; }
.ph { display: flex; flex-direction: column; gap: 10px; }
.ph-top { display: flex; align-items: center; justify-content: space-between; gap: 10px 20px; flex-wrap: wrap; }
.crumb { display: flex; align-items: center; gap: 8px; min-height: 32px; white-space: nowrap; font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
.crumb b { color: var(--ink); font-weight: 700; }
.ph-title { margin: 0; font-family: var(--font-display); font-weight: 900; font-size: 2.6rem; line-height: 0.95; letter-spacing: -0.05em; text-transform: uppercase; }
.ph-sub { margin: 0; font-size: 1rem; line-height: 1.55; color: var(--body-grey); max-width: 82ch; }
.ph-row { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; }
.ph-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* totals strip */
.totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); border: 3px solid var(--ink); }
.totals > .total { border-bottom: 1px solid var(--ink); margin-bottom: -1px; }
.total { display: flex; flex-direction: column; gap: 6px; padding: 14px 18px; border-right: 1px solid var(--ink); min-width: 0; }
.total:last-child { border-right: none; }
.total-k { font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.14em; text-transform: uppercase; }
.total-v { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-family: var(--font-mono); font-weight: 700; font-size: 1.45rem; letter-spacing: -0.05em; line-height: 1; }
.total-b { font-size: 0.8rem; line-height: 1.45; color: var(--body-grey); }

/* sections + list tables */
.sec { display: flex; flex-direction: column; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px 18px; flex-wrap: wrap; padding-bottom: 10px; border-bottom: 3px solid var(--ink); }
.sec-title { margin: 0; font-family: var(--font-display); font-weight: 900; font-size: 1.3rem; letter-spacing: -0.035em; text-transform: uppercase; }
.sec-note { font-family: var(--font-mono); font-size: 0.64rem; letter-spacing: 0.04em; color: var(--body-grey); white-space: nowrap; }
.lst-head, .lst-row { display: grid; gap: 14px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--ink); }
.lst-head { padding: 8px 12px; font-family: var(--font-mono); font-size: 0.58rem; letter-spacing: 0.16em; text-transform: uppercase; }
.lst-row { min-height: 54px; box-sizing: border-box; background: var(--paper); }
.lst-row:hover { box-shadow: inset 5px 0 0 var(--blue); }
.lst-row.is-open { background: var(--bone); box-shadow: inset 5px 0 0 var(--blue); }
.lst-row.is-quiet { background: var(--bone); }
.lst-row.is-quiet:hover { box-shadow: none; }
.lst-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px 22px; padding: 14px 16px 16px 24px; background: var(--bone); border-bottom: 1px solid var(--ink); }
.lst-foot { padding-top: 10px; font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.03em; color: var(--body-grey); line-height: 1.6; }
.cell { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cell-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.nm { font-family: var(--font-display); font-weight: 800; font-size: 1rem; letter-spacing: -0.02em; text-transform: uppercase; line-height: 1.15; }
.meta { font-size: 0.82rem; line-height: 1.4; color: var(--body-grey); }
.mono { font-family: var(--font-mono); font-weight: 700; font-size: 0.86rem; }
.at-end { text-align: right; justify-self: end; }
.label { font-family: var(--font-mono); font-size: 0.58rem; letter-spacing: 0.14em; text-transform: uppercase; }
.cols-ov   { grid-template-columns: 20px minmax(0, 2fr) 76px 164px 150px 120px; }
.cell-row.is-tight { flex-wrap: nowrap; gap: 4px; }
.cols-tri  { grid-template-columns: 40px minmax(0, 1.8fr) 80px minmax(0, 1.3fr) 70px minmax(0, 1.2fr) 150px; }
.cols-q    { grid-template-columns: minmax(0, 1.6fr) 110px 110px 110px 110px; }
.cols-fail { grid-template-columns: minmax(0, 1.2fr) 120px minmax(0, 1.6fr); }
.cols-cap  { grid-template-columns: 170px 150px 110px minmax(0, 1fr) 90px; }
.cols-hist { grid-template-columns: 170px 150px minmax(0, 1fr); }
.cols-sig  { grid-template-columns: minmax(0, 1.5fr) 90px 80px 120px; }
.cols-det  { grid-template-columns: minmax(0, 1.5fr) 110px 80px 130px; }
.cols-run  { grid-template-columns: 150px 90px minmax(0, 1fr) minmax(0, 1fr); }
.cols-nic  { grid-template-columns: minmax(0, 1.6fr) 110px 100px 130px; }
.cols-rule { grid-template-columns: minmax(0, 1.5fr) 150px 180px; }
.cols-act  { grid-template-columns: 170px 150px minmax(0, 1fr) minmax(0, 1fr); }
.cols-late { grid-template-columns: minmax(0, 1.4fr) 150px 150px minmax(0, 1.2fr); }

/* key / value */
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 7px 18px; margin: 0; font-size: 0.92rem; }
.kv dt { font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.12em; text-transform: uppercase; padding-top: 3px; }
.kv dd { margin: 0; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; min-width: 0; }

/* blank, none and 0 — three different things */
.v-unchecked, .v-none { display: inline-flex; align-items: center; padding: 1px 6px; font-family: var(--font-mono); font-weight: 700; font-size: 0.6rem; letter-spacing: 0.06em; white-space: nowrap; }
.v-unchecked { color: var(--body-grey); border: 1px dashed var(--muted); background-color: var(--bone); background-image: repeating-linear-gradient(45deg, rgba(10, 10, 10, 0.14) 0 2px, transparent 2px 5px); }
.v-none { color: var(--ink); border: 1px solid var(--ink); background: var(--paper); }
.v-zero { font-family: var(--font-mono); font-weight: 700; }

/* the badge plate: metal + score, marks on top */
.plate { position: relative; display: inline-flex; align-items: stretch; height: 30px; flex: none; border: 2px solid var(--ink); background: var(--paper); box-sizing: border-box; }
.plate-metal { display: inline-flex; align-items: center; padding: 0 8px; font-family: var(--font-mono); font-weight: 700; font-size: 0.6rem; letter-spacing: 0.1em; text-transform: uppercase; border-right: 2px solid var(--ink); }
.plate-score { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; padding: 0 8px; font-family: var(--font-mono); font-weight: 700; font-size: 0.9rem; }
.plate-empty { display: inline-flex; align-items: center; white-space: nowrap; padding: 0 9px; font-family: var(--font-mono); font-weight: 700; font-size: 0.58rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--body-grey); }
.plate.is-unscored { border-style: dashed; border-color: var(--muted); background-color: var(--bone); background-image: repeating-linear-gradient(45deg, rgba(10, 10, 10, 0.12) 0 2px, transparent 2px 6px); }
.plate.is-unmeasured { background: var(--bone); }
.plate.is-lg { height: 46px; }
.plate.is-lg .plate-metal { font-size: 0.74rem; padding: 0 14px; }
.plate.is-lg .plate-score { font-size: 1.35rem; padding: 0 14px; }
.plate.is-lg .plate-empty { font-size: 0.68rem; padding: 0 14px; }
.plate-marks { position: absolute; top: -9px; right: -6px; display: flex; gap: 3px; }
.plate-mark { display: inline-flex; align-items: center; height: 15px; padding: 0 4px; border: 1px solid var(--ink); font-family: var(--font-mono); font-weight: 700; font-size: 0.5rem; letter-spacing: 0.06em; }
.plate-mark.is-pp { background: var(--ink); color: var(--paper); }
.fill-none { background: var(--paper); color: var(--ink); }

/* badge mix bar */
.mix { display: flex; height: 38px; border: 3px solid var(--ink); }
.mix-seg { position: relative; display: flex; align-items: center; min-width: 0; padding: 0 8px; overflow: hidden; white-space: nowrap; border-right: 2px solid var(--ink); font-family: var(--font-mono); font-weight: 700; font-size: 0.62rem; }
.mix-seg:last-child { border-right: none; }
.mix-plat { position: absolute; top: 0; right: 0; bottom: 0; width: 18%; border-left: 2px solid var(--ink); }
.mix-key { display: flex; align-items: center; gap: 6px 18px; flex-wrap: wrap; padding-top: 8px; font-family: var(--font-mono); font-size: 0.64rem; }
.mix-key > span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.mix-sw { display: inline-block; flex: none; width: 12px; height: 12px; border: 1px solid var(--ink); }

/* filter bar + panel */
.fbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid var(--ink); }
.fpanel { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px 24px; padding: 16px 18px; border: 3px solid var(--ink); background: var(--paper); }
.fgroup { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.fopts { display: flex; flex-wrap: wrap; gap: 6px; }
.fopt { min-height: 32px; padding: 0 10px; border: 2px solid var(--ink); background: var(--paper); color: var(--ink); font-family: var(--font-mono); font-weight: 700; font-size: 0.6rem; letter-spacing: 0.06em; text-transform: uppercase; cursor: pointer; }
.fopt:hover { background: var(--bone); }
.fopt.is-on { background: var(--ink); color: var(--paper); box-shadow: inset 0 -3px 0 var(--blue); }
.fopt:disabled { background: var(--bone); color: var(--muted); cursor: not-allowed; }
.fpanel-foot { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 12px; border-top: 1px solid var(--ink); }

/* pager */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 0; }
.pager-n { font-family: var(--font-mono); font-weight: 700; font-size: 0.78rem; white-space: nowrap; }

/* page states, notices */
.pstate { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 28px 0; border-top: 3px solid var(--ink); }
.pstate-title { margin: 0; font-family: var(--font-display); font-weight: 900; font-size: 2rem; line-height: 0.95; letter-spacing: -0.05em; text-transform: uppercase; }
.pstate-text { margin: 0; font-size: 1rem; line-height: 1.6; max-width: 72ch; }
.notice { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; padding: 10px 16px; border: 2px solid var(--ink); background: var(--bone); font-size: 0.95rem; line-height: 1.5; }
.notice.is-alert { background: var(--paper); box-shadow: inset 6px 0 0 var(--acid-red); }
.notice.is-info { background: var(--paper); box-shadow: inset 6px 0 0 var(--blue); }
.later { font-family: var(--font-mono); font-size: 0.64rem; letter-spacing: 0.03em; color: var(--body-grey); padding: 10px 0 0; }

/* two columns: content + side panel */
.two { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; }
.side { display: flex; flex-direction: column; border: 3px solid var(--ink); background: var(--paper); position: sticky; top: 16px; }
.side-head { padding: 12px 16px; background: var(--ink); color: var(--paper); font-family: var(--font-display); font-weight: 900; font-size: 1.05rem; letter-spacing: -0.02em; text-transform: uppercase; }
.side-sec { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--ink); }
.side-sec:last-child { border-bottom: none; }
.side-sec.is-owner { background: var(--wash-gold); }
.field.is-full { width: 100%; box-sizing: border-box; }
.field.is-text { font-family: var(--font-body); text-transform: none; letter-spacing: 0; font-size: 0.92rem; }
.field.is-area { min-height: 76px; width: 100%; box-sizing: border-box; font-family: var(--font-body); text-transform: none; letter-spacing: 0; font-size: 0.92rem; resize: vertical; }

/* checklist */
.ticks { display: flex; flex-direction: column; }
.tick { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--ink); }
.tick-box { width: 20px; height: 20px; box-sizing: border-box; border: 2px solid var(--ink); display: inline-flex; align-items: center; justify-content: center; font-weight: 900; font-size: 0.8rem; }
.tick-box.is-yes { background: var(--ink); color: var(--paper); }
.tick-box.is-no { background: var(--paper); box-shadow: inset 0 0 0 3px var(--acid-red); }

/* the confirm panel */
.scrim { position: fixed; inset: 0; z-index: 80; background: rgba(10, 10, 10, 0.4); }
.confirm { position: fixed; top: 0; right: 0; bottom: 0; z-index: 81; width: 460px; max-width: 100%; display: flex; flex-direction: column; background: var(--paper); border-left: 3px solid var(--ink); }
.confirm-head { display: flex; flex-direction: column; gap: 4px; padding: 18px 20px; background: var(--ink); color: var(--paper); }
.confirm-head .label { color: var(--acid-green); }
.confirm-title { margin: 0; font-family: var(--font-display); font-weight: 900; font-size: 1.35rem; letter-spacing: -0.03em; text-transform: uppercase; line-height: 1.05; }
.confirm-body { flex: 1 1 auto; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; padding: 16px 20px; }
.confirm-change { display: flex; flex-direction: column; gap: 4px; padding: 10px 0; border-bottom: 1px solid var(--ink); }
.old { font-family: var(--font-mono); font-weight: 700; color: var(--body-grey); text-decoration: line-through; }
.new { font-family: var(--font-mono); font-weight: 700; color: var(--blue-dark); }
.confirm-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 3px solid var(--ink); }

/* pause switch */
.switch { display: inline-flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 12px 0 6px; border: 2px solid var(--ink); background: var(--paper); color: var(--ink); font-family: var(--font-mono); font-weight: 700; font-size: 0.62rem; letter-spacing: 0.1em; text-transform: uppercase; cursor: pointer; }
.switch-track { position: relative; width: 44px; height: 22px; border: 2px solid var(--ink); box-sizing: border-box; background: var(--bone); }
.switch-knob { position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; background: var(--ink); transition: left 0.15s ease; }
.switch.is-on .switch-track { background: var(--acid-green); }
.switch.is-on .switch-knob { left: 24px; }
.switch:disabled { cursor: not-allowed; background: var(--bone); color: var(--muted); }

/* job card */
.job { display: flex; flex-direction: column; border: 3px solid var(--ink); }
.job-head { display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--ink); }
.job-name { flex: 1 1 260px; min-width: 0; margin: 0; font-family: var(--font-display); font-weight: 900; font-size: 1.15rem; letter-spacing: -0.03em; text-transform: uppercase; }
.job.is-paused .job-head { background: var(--bone); }
.progress { width: 100%; height: 8px; appearance: none; -webkit-appearance: none; border: 1px solid var(--ink); background: var(--paper); }
.progress::-webkit-progress-bar { background: var(--paper); }
.progress::-webkit-progress-value { background: var(--blue); }
.progress::-moz-progress-bar { background: var(--blue); }

/* scoring grid */
.grid12 { display: grid; grid-template-columns: 120px repeat(4, minmax(0, 1fr)); border: 3px solid var(--ink); }
.grid12 > * { border-right: 1px solid var(--ink); border-bottom: 1px solid var(--ink); padding: 10px 12px; min-height: 56px; box-sizing: border-box; display: flex; flex-direction: column; justify-content: center; gap: 6px; }
.grid12-h { background: var(--bone); font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.14em; text-transform: uppercase; }
.example { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border: 2px solid var(--ink); background: var(--wash-blue); font-family: var(--font-mono); font-size: 0.78rem; line-height: 1.5; }
.order { display: flex; flex-direction: column; border: 3px solid var(--ink); }
.order-item { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--ink); }
.order-item:last-child { border-bottom: none; }
.order-n { font-family: var(--font-mono); font-weight: 700; font-size: 1rem; }

/* Scoring: the picker box, the ink read-out, the detector group tiles */
.two.is-panel { grid-template-columns: minmax(0, 1fr) 360px; margin-top: 14px; }
.box { display: flex; flex-direction: column; gap: 14px; padding: 18px 20px; border: 3px solid var(--ink); background: var(--paper); }
.box-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-top: 14px; border-top: 2px solid var(--ink); }
.box-note { margin: 0; font-size: 0.92rem; line-height: 1.6; color: var(--body-grey); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.ink-card { display: flex; flex-direction: column; gap: 10px; padding: 20px 22px; border: 3px solid var(--ink); background: var(--ink); color: var(--hairline); }
.ink-card .label { color: var(--acid-green); }
.ink-big { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; font-family: var(--font-display); font-weight: 900; font-size: 2.4rem; line-height: 1; letter-spacing: -0.05em; color: var(--paper); }
.ink-note { font-family: var(--font-mono); font-size: 0.66rem; line-height: 1.7; color: var(--hairline); }
.ink-row { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; padding-bottom: 9px; border-bottom: 1px solid var(--body-grey); }
.ink-row:last-child { border-bottom: none; padding-bottom: 0; }
.ink-row .label { color: var(--hairline); }
.ink-row b { font-family: var(--font-display); font-weight: 900; font-size: 1.5rem; letter-spacing: -0.04em; color: var(--paper); }
.ink-row b.is-boost { color: var(--acid-green); }
.ink-row b.is-total { font-size: 2.2rem; }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 14px; border: 3px solid var(--ink); background: var(--paper); }
.tile { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 14px 16px; border: none; border-right: 1px solid var(--ink); border-bottom: 1px solid var(--ink); background: var(--paper); color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.tile:nth-child(4n) { border-right: none; }
.tile:hover { background: var(--bone); }
.tile.is-on { background: var(--blue); color: var(--paper); }
.tile-name { display: flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-weight: 700; font-size: 0.64rem; letter-spacing: 0.12em; text-transform: uppercase; }
.tile-name .ms { font-size: 17px; }
.tile-v { font-family: var(--font-display); font-weight: 900; font-size: 1.3rem; letter-spacing: -0.04em; }
.tile-n { font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.04em; }
.gpanel { display: flex; flex-direction: column; border: 3px solid var(--blue); border-top: none; background: var(--paper); }
.gpanel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 14px 18px; background: var(--blue); color: var(--paper); font-family: var(--font-display); font-weight: 900; font-size: 1.3rem; letter-spacing: -0.035em; text-transform: uppercase; }
.gpanel-head .label { color: var(--paper); }
.gpanel .box-note { padding: 14px 18px; background: var(--bone); }
.ink-row .label { white-space: nowrap; flex: none; }
.tile-name { white-space: nowrap; max-width: 100%; min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* Settings · Panel v5: signals, weights, the run */
.cols-crit { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) 120px; }
.cols-fun  { grid-template-columns: 40px minmax(0, 1.2fr) minmax(0, 1.4fr) 110px; }
.cols-ind  { grid-template-columns: minmax(0, 1.8fr) 70px 100px 80px 130px; }
.cols-nw   { grid-template-columns: minmax(0, 1.6fr) 90px 90px 100px 120px; }
.cols-st   { grid-template-columns: 48px minmax(0, 1fr) minmax(0, 1.4fr) 60px; }
.cols-city { grid-template-columns: minmax(140px, 1.6fr) 80px 120px 120px 110px 110px; }
.cols-sub  { grid-template-columns: minmax(0, 1.6fr) 110px 110px 120px; }
.cols-step { grid-template-columns: 44px minmax(0, 1fr) 140px minmax(0, 1.6fr); }
.cols-pair { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.6fr) 80px; }
.meter { display: block; height: 8px; border: 1px solid var(--ink); background: var(--paper); }
.meter-fill { display: block; height: 100%; background: var(--blue); }
.arms { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 3px solid var(--ink); }
.arm { display: flex; flex-direction: column; gap: 8px; padding: 16px 18px; border-right: 1px solid var(--ink); min-width: 0; }
.arm:last-child { border-right: none; }
.arm.is-drop { box-shadow: inset 0 6px 0 var(--acid-red); }
.arm.is-keep { box-shadow: inset 0 6px 0 var(--acid-green); }
.arm-n { font-family: var(--font-display); font-weight: 900; font-size: 1.9rem; letter-spacing: -0.05em; line-height: 1; }
.lst-row.is-warn { box-shadow: inset 5px 0 0 var(--acid-red); background: var(--bone); }
.lst-row.is-high { background: var(--wash-gold); }
.lst-row.is-out { box-shadow: inset 5px 0 0 var(--acid-red); background: var(--bone); }
.lst-row.is-logged { background: var(--wash-gold); }
.lst-row.is-sel { background: var(--ink); color: var(--paper); box-shadow: inset 0 -4px 0 var(--blue); }
.lst-row.is-sel .meta { color: var(--hairline); }
button.lst-row { width: 100%; border-left: none; border-right: none; border-top: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.grid9 { display: grid; grid-template-columns: 160px repeat(3, minmax(0, 1fr)); border: 3px solid var(--ink); }
.grid9 > span { display: flex; align-items: center; min-height: 56px; padding: 10px 14px; border-right: 1px solid var(--ink); border-bottom: 1px solid var(--ink); font-family: var(--font-mono); font-weight: 700; font-size: 0.8rem; }
.grid9 > .grid12-h { font-size: 0.6rem; letter-spacing: 0.12em; text-transform: uppercase; }
.timings { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border: 3px solid var(--ink); }
.timing { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border-right: 1px solid var(--ink); min-width: 0; }
.timing:last-child { border-right: none; }
.timing-t { font-family: var(--font-display); font-weight: 900; font-size: 1.5rem; letter-spacing: -0.045em; }
.timing.is-fail .timing-t { text-decoration: underline; text-decoration-color: var(--acid-red); text-decoration-thickness: 3px; text-underline-offset: 4px; }
.errline { display: block; padding: 10px 14px; border: 2px solid var(--ink); background: var(--ink); color: var(--paper); font-family: var(--font-mono); font-size: 0.8rem; }
.lst-head > * { white-space: nowrap; min-width: 0; }
