/* ============================================================
   instrument.css — the design layer. LOADED LAST, wins the cascade.
   ============================================================

   WHY THIS FILE EXISTS
   app.css and redesign.css grew as ~14 dated "eras", each appending a
   block rather than editing the last: `.card` ends up declared 15 times,
   `table.data th` 13 times, `.btn` 31 times. Rather than add a 15th
   patch, this file is the single authored design layer — one
   authoritative answer per component, built on the tokens in tokens.css.
   The older sheets stay for structure and for the long tail of
   view-specific rules; this one owns how it all LOOKS.

   THE RULES
   - Never rename or delete a class. JS writes class names into HTML
     strings, so a rename produces an unstyled element and no error.
   - Every colour comes from a token. No literal hex below this line
     except intentional alpha overlays on a known ground.
   - Structural behaviour from redesign.css must survive: the .wh-col
     height cap, .wh-col-scroll's min-height:0, .wh-card.tight's small
     padding, and .wh-hub / .wh-kanban's minmax(0,·) overflow guards.
   ============================================================ */

/* ============================================================
   1 · BASE + TYPOGRAPHY
   ============================================================ */
body {
  font-family: var(--font);
  font-size: var(--fs-md);
  line-height: var(--lh-normal);
  color: var(--ink);
  background: var(--bg);
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
}

h2 {
  font-size: var(--fs-2xl); font-weight: 700;
  letter-spacing: var(--tr-tight); line-height: var(--lh-tight);
}
h3 {
  font-size: var(--fs-lg); font-weight: 650;
  letter-spacing: -.008em; line-height: var(--lh-snug);
  margin: 0 0 var(--s-5);
}
h4 { font-size: var(--fs-sm); font-weight: 650; letter-spacing: var(--tr-normal); }

.note { font-size: var(--fs-xs); color: var(--ink-3); line-height: var(--lh-normal); margin: var(--s-5) 0 0; }
.muted { color: var(--ink-3); font-weight: 500; }
.mono, .num, td.num, th.num, .statbar-v, .hero-v, .kcard-v {
  font-family: var(--font-data);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1, "zero" 1;
}

/* micro-labels: the eyebrow voice used across the whole tool */
.sh-eyebrow, .side-group, .statbar-k, .hero-k, .kcard-l, .view-head .area-eyebrow {
  font-size: var(--fs-2xs); font-weight: 650;
  letter-spacing: var(--tr-wide); text-transform: uppercase;
}

::selection { background: var(--orange); color: #fff; }

/* inline SVG icons from js/icons.js — inherit colour, sit on the baseline */
.ic {
  display: inline-block; vertical-align: -.18em;
  flex: none; color: currentColor;
}
button .ic, a .ic, .wh-tab .ic, .seg-btn .ic { pointer-events: none; }
.wh-tab .ic, .wh-side-h .ic { vertical-align: -.2em; margin-right: var(--s-2); opacity: .85; }
.wh-tab.on .ic { opacity: 1; color: var(--orange); }
.wh-jump-i { display: inline-flex; align-items: center; color: var(--ink-3); }
.wh-jump:hover .wh-jump-i { color: var(--orange); }

/* one focus treatment for everything that can take focus */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

/* ============================================================
   2 · SHELL
   ============================================================ */
.shell { background: var(--bg); }

.sidebar {
  width: 236px;
  /* --sb-* is its own plane so the sidebar never depends on --navy,
     which deliberately inverts to a light tint in dark mode. */
  background: var(--sb-bg);
  border-right: 1px solid var(--sb-line);
  box-shadow: none;
}
.sidebar::after { display: none; }

.sidebar .brand { padding: var(--s-7) var(--s-7) var(--s-5); gap: var(--s-5); }
.brand-mark {
  width: 30px; height: 30px; border-radius: var(--r-sm);
  background: var(--orange);
  box-shadow: none;
  font-size: var(--fs-xl); font-weight: 700; color: #fff;
}
.brand-txt b { font-size: var(--fs-lg); font-weight: 700; letter-spacing: -.02em; color: var(--sb-ink); }
.brand-txt .tool-tag {
  font-size: var(--fs-3xs); letter-spacing: var(--tr-wider);
  color: var(--sb-ink-3); font-weight: 650; margin-top: var(--s-2);
}

/* version badge — was --ink-3 on navy (≈2.1:1, below AA) and clipped */
.app-ver {
  font-family: var(--font-data);
  font-size: var(--fs-3xs); letter-spacing: var(--tr-normal);
  color: var(--sb-ink-3); opacity: 1;
  padding: 0 var(--s-7) var(--s-5);
}

.side-search {
  margin: 0 var(--s-5) var(--s-5);
  background: var(--sb-bg-2);
  border: 1px solid var(--sb-line);
  border-radius: var(--r-sm);
  color: var(--sb-ink-2);
  font-size: var(--fs-sm);
  padding: var(--s-4) var(--s-5);
  transition: border-color var(--fast), background var(--fast);
}
.side-search:hover { border-color: var(--orange); color: var(--sb-ink); }
.side-search kbd {
  font-family: var(--font-data); font-size: var(--fs-3xs);
  background: transparent; border: 1px solid var(--sb-line);
  color: var(--sb-ink-3); border-radius: var(--r-xs); padding: 1px var(--s-3);
}

.side-nav { padding: 0 var(--s-5) var(--s-4); gap: 1px; }
.side-group {
  color: var(--sb-ink-3);
  padding: var(--s-6) var(--s-4) var(--s-3);
  font-size: var(--fs-3xs); letter-spacing: var(--tr-wider);
}
/* the coloured group dot was visual noise on a 5-group list */
.side-group::before { display: none !important; }

.side-nav .nav-btn {
  font-size: var(--fs-sm); font-weight: 500;
  color: var(--sb-ink-2);
  padding: var(--s-4) var(--s-4);
  border-radius: var(--r-sm);
  gap: var(--s-5);
  transition: color var(--fast), background var(--fast);
}
.side-nav .nav-btn .ni { width: 17px; height: 17px; opacity: .8; }
.side-nav .nav-btn .ni svg { width: 17px; height: 17px; stroke-width: 1.75; }
.side-nav .nav-btn:hover { background: var(--sb-bg-2); color: var(--sb-ink); }
.side-nav .nav-btn.on {
  background: var(--sb-bg-2); color: var(--sb-ink); font-weight: 600;
}
.side-nav .nav-btn.on .ni { opacity: 1; color: var(--orange); }
/* the one orange marker in the nav: the current page */
.side-nav .nav-btn.on::before {
  content: ""; position: absolute; left: 0; top: 6px; bottom: 6px;
  width: 2px; background: var(--orange); border-radius: 0 2px 2px 0;
}

.side-foot { border-top: 1px solid var(--sb-line); padding: var(--s-5) var(--s-5) var(--s-6); }
.side-actions { gap: var(--s-3); margin-top: var(--s-3); }
.side-foot .asof {
  font-family: var(--font-data); font-size: var(--fs-3xs);
  color: var(--sb-ink-3); margin-top: var(--s-5);
}
/* sidebar ghost buttons live on the sidebar plane, not the content plane */
.side-foot .btn.ghost {
  background: transparent; border-color: var(--sb-line); color: var(--sb-ink-2);
}
.side-foot .btn.ghost:hover { background: var(--sb-bg-2); border-color: var(--sb-ink-3); color: var(--sb-ink); }

.main { background: var(--bg); }
.main .wrap { max-width: 1320px; padding: var(--s-8) var(--s-9) var(--s-12); }

/* ============================================================
   3 · PAGE HEADER — .view-head becomes the sticky page header
   ============================================================ */
.view-head {
  position: sticky; top: 0; z-index: var(--z-header);
  display: flex; align-items: flex-start; gap: var(--s-6);
  margin: calc(var(--s-8) * -1) calc(var(--s-9) * -1) var(--s-8);
  padding: var(--s-6) var(--s-9) var(--s-5);
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
/* the area eyebrow ::before that redesign.css renders from data-arealabel */
.view .view-head h2 { font-size: var(--fs-2xl); }
.view-head .sub {
  color: var(--ink-3); font-size: var(--fs-sm);
  margin: var(--s-3) 0 0; max-width: 76ch; line-height: var(--lh-normal);
}
.view-head .grow { flex: 1; }

/* The files bar and the filter bar together used to eat ~190px above the
   fold before any content appeared. Full-bleed hairline strips instead of
   floating rounded cards, on the sunken plane so they read as chrome. */
.filesbar, .globalfilter {
  background: var(--bg-2);
  border: 0; border-bottom: 1px solid var(--line);
  border-radius: 0;
  margin: 0; box-shadow: none;
  padding: var(--s-4) var(--s-9);
  font-size: var(--fs-xs);
}
.gf-bar { gap: var(--s-4); }
.gf-pill {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: var(--s-2) var(--s-4);
}
.gf-pill.active { border-color: var(--orange); }
.gf-pill-l { font-size: var(--fs-3xs); letter-spacing: var(--tr-wide); color: var(--ink-3); text-transform: uppercase; font-weight: 650; }
.gf-pill-sel, .gf-pill-date {
  font-family: var(--font); font-size: var(--fs-xs); color: var(--ink);
  background: transparent; border: 0;
}
.fb-chip {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-sm); font-size: var(--fs-xs);
}

/* "About this page" was a large empty box between the title and the
   content; make the closed state a quiet inline affordance. */
.view-head + .disclosure, .disclosure {
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface-2);
}
.disclosure > summary {
  font-size: var(--fs-xs); font-weight: 600; color: var(--ink-3);
  padding: var(--s-3) var(--s-5); cursor: pointer; list-style: none;
}
.disclosure > summary:hover { color: var(--ink); }
.disclosure[open] > summary { border-bottom: 1px solid var(--line); color: var(--ink); }

/* ============================================================
   4 · SURFACES — three planes, hairlines, no card soup
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: var(--s-7) var(--s-8);
  box-shadow: none;
  margin-bottom: var(--s-6);
  transition: border-color var(--fast);
}
.card > h3:first-child { margin-bottom: var(--s-5); }
.card h3 .h-sub {
  display: inline; font-size: var(--fs-xs); font-weight: 500;
  color: var(--ink-3); margin-left: var(--s-4); letter-spacing: 0; text-transform: none;
}

.section-head { margin: var(--s-9) 0 var(--s-5); }
/* The stacked small-caps kicker above a heading is a refused pattern, and
   it repeated on nearly every view. The heading and its sub-line carry the
   same information without it. The class stays defined — JS writes it into
   HTML strings, so removing it from CSS would be a silent contract break. */
.section-head .sh-eyebrow { display: none; }
.section-head .sh-titles h3 { font-size: var(--fs-xl); font-weight: 650; }
.section-head .sh-sub { color: var(--ink-3); font-size: var(--fs-xs); }
/* The chapter marker is a neutral rule, not a second accent family — it was
   an orange gradient bar repeated above every section, which is decoration
   competing with the one signal colour. Same for the 64px accent tab under
   .view-head, which was the per-area hue. */
.section-head .sh-titles::before {
  background: var(--ink-4); background-image: none; width: 2px; opacity: .55;
}
.view-head::after { background: var(--ink-4); opacity: .35; }

/* ============================================================
   5 · BUTTONS — one authoritative set
   ============================================================ */
.btn {
  font-family: var(--font); font-size: var(--fs-sm); font-weight: 600;
  color: #fff; background: var(--orange); background-image: none;
  border: 1px solid transparent;
  padding: var(--s-4) var(--s-6);
  border-radius: var(--r-sm);
  box-shadow: none;
  gap: var(--s-3);
  transition: background var(--fast), border-color var(--fast), color var(--fast), transform var(--fast);
}
.btn:not(.ghost):not(.navy) { background-image: none; background: var(--orange); }
.btn:hover, .btn:not(.ghost):not(.navy):hover { background: var(--orange-600); box-shadow: none; transform: none; }
.btn:active { transform: scale(.985); }
.btn.ghost {
  background: var(--surface); color: var(--ink-2);
  border: 1px solid var(--line);
}
.btn.ghost:hover { background: var(--surface-2); border-color: var(--ink-4); color: var(--ink); }
.btn.ghost.on, .btn.sm.on, .btn.ghost.sm.on {
  border-color: var(--orange); color: var(--orange); background: var(--orange-50); box-shadow: none;
}
.btn.navy { background: var(--navy-600); color: #fff; }
.btn.navy:hover { background: var(--navy-500); }
.btn.sm { padding: var(--s-3) var(--s-5); font-size: var(--fs-xs); }
.btn.danger { background: var(--bad); color: #fff; }
.btn.danger:hover { background: var(--bad-600); }
.btn:disabled, .btn.disabled { opacity: .45; cursor: not-allowed; transform: none; }

/* ============================================================
   6 · SEGMENTED CONTROLS
   A selected segment is a raised plate with an orange underline — a
   physical toggle, not a filled block. This also sidesteps
   `background: var(--navy)`, which inverts to a light tint in dark.
   ============================================================ */
.seg {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 2px; gap: 2px;
}
.seg-btn {
  font-family: var(--font); font-size: var(--fs-sm); font-weight: 550;
  color: var(--ink-3); background: transparent; border: 0;
  border-radius: var(--r-xs); padding: var(--s-3) var(--s-5);
  position: relative; transition: color var(--fast), background var(--fast);
}
.seg-btn:hover { color: var(--ink); }
/* :root prefix beats `:root[data-theme="dark"] .seg-btn.on` at
   redesign.css:944, which filled the segment with a light lavender in
   dark mode (--navy inverts) and white text on it. */
:root .seg-btn.on,
:root[data-theme="dark"] .seg-btn.on {
  background: var(--surface); color: var(--ink); font-weight: 650;
  box-shadow: var(--sh-1);
}
:root .seg-btn.on:hover,
:root[data-theme="dark"] .seg-btn.on:hover { background: var(--surface); color: var(--ink); }
.seg-btn.on::after {
  content: ""; position: absolute; left: var(--s-5); right: var(--s-5); bottom: 2px;
  height: 2px; border-radius: 2px; background: var(--orange);
}
.seg.lg .seg-btn { font-size: var(--fs-md); padding: var(--s-4) var(--s-6); }

/* The pair strip for consolidated views. It lives in #pairbar, outside the
   view sections, so a view repainting itself can never wipe it. */
.pairbar {
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  padding: var(--s-4) var(--s-9);
}
.pairbar .view-siblings { display: inline-flex; }
.view-siblings { flex: none; align-self: center; }

/* the same treatment for the other three segmented-control dialects */
.lane-tabs .lane-tab.on, .wh-tab.on, .wh-seg-b.on, .tf-chip.on {
  background: var(--surface); color: var(--ink); border-color: var(--line);
}
.wh-seg-b.on, .tf-chip.on, .wh-who-chip.on {
  background: var(--orange-50); color: var(--orange-700); border-color: var(--orange);
}
.wh-tab.on { border-bottom-color: var(--orange); color: var(--ink); }

/* ============================================================
   7 · CHIPS / PILLS — eleven near-duplicate families, one look
   ============================================================ */
.chip, .need-chip, .req-chip, .fchip, .conf-tag, .ev-chip, .prov-chip,
.it-chip, .ib-tag, .sop-cat, .sop-lane, .wh-chip, .wh-mchip, .wh-fchip,
.wh-subchip, .rm-pill, .spine-tag, .soon-badge, .dd-status-chip,
.lane-badge, .task-pri, .rc-sev, .pal-sub, .sop-recent-chip {
  font-family: var(--font);
  font-size: var(--fs-2xs); font-weight: 600;
  letter-spacing: .01em;
  border-radius: var(--r-xs);
  padding: 2px var(--s-4);
  line-height: 1.6;
  border: 1px solid transparent;
}
.chip, .need-chip, .fchip, .prov-chip, .it-chip, .wh-subchip {
  background: var(--surface-2); color: var(--ink-2); border-color: var(--line);
}
.chip.good, .fchip.ok, .conf-tag.ok, .dd-status-chip.active {
  background: var(--good-bg); color: var(--good-600); border-color: var(--good-line);
}
.chip.warn, .dd-status-chip.hold {
  background: var(--warn-bg); color: var(--warn-600); border-color: var(--warn-line);
}
.chip.bad, .fchip.off, .dd-status-chip.lost {
  background: var(--bad-bg); color: var(--bad-600); border-color: var(--bad-line);
}
.dd-status-chip.progress {
  background: var(--info-bg); color: var(--info-600); border-color: var(--info-line);
}
.lane-badge.direct-badge { background: var(--navy-50); color: var(--navy-600); border-color: var(--navy-200); }
.lane-badge.agg-badge    { background: var(--orange-50); color: var(--orange-700); border-color: var(--orange-100); }

.pri-high { background: var(--bad-bg); color: var(--bad-600); border-color: var(--bad-line); }
.pri-med  { background: var(--warn-bg); color: var(--warn-600); border-color: var(--warn-line); }
.pri-low  { background: var(--surface-2); color: var(--ink-3); border-color: var(--line); }

/* ============================================================
   8 · TABLES — hairlines, mono numerals, micro headers
   ============================================================ */
.table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow-x: auto; overflow-y: auto; max-width: 100%;
  background: var(--surface);
}
table.data { font-size: var(--fs-sm); border-collapse: collapse; width: 100%; }
table.data th,
table.data.sticky th,
table.data.tight th,
.table-wrap table.data th {
  background: var(--surface-2);
  color: var(--ink-3);
  font-family: var(--font);
  font-size: var(--fs-3xs); font-weight: 700;
  letter-spacing: var(--tr-wide); text-transform: uppercase;
  padding: var(--s-4) var(--s-5);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  /* sticky survives only from app.css's base rule — keep it deliberately */
  position: sticky; top: 0; z-index: var(--z-sticky);
}
table.data td {
  padding: var(--s-4) var(--s-5);
  border-bottom: 1px solid var(--line-2);
  color: var(--ink-2);
}
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr { transition: background var(--fast); }
table.data tbody tr:hover td { background: var(--surface-2); }
table.data td.num, table.data th.num {
  text-align: right; font-family: var(--font-data);
  font-variant-numeric: tabular-nums; font-size: var(--fs-xs); color: var(--ink);
}
table.data.tight th, table.data.tight td { padding: var(--s-3) var(--s-5); }
th.sortable:hover { color: var(--orange); }
th.sort-asc::after, th.sort-desc::after { color: var(--orange); font-size: var(--fs-3xs); }

/* inline percentage bars */
.rate-track { background: var(--surface-3); border-radius: var(--r-pill); height: 5px; overflow: hidden; }
.rate-fill { background: var(--orange); border-radius: var(--r-pill); height: 100%; }

/* ============================================================
   9 · METRICS — statbar, hero cards, kcards
   ============================================================ */
.statbar {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}
.statbar-item { padding: var(--s-5) var(--s-6); border-color: var(--line); }
.statbar-k { color: var(--ink-3); }
.statbar-v {
  font-size: var(--fs-3xl); font-weight: 500;
  letter-spacing: var(--tr-tight); color: var(--ink);
  line-height: var(--lh-tight); margin: var(--s-3) 0 var(--s-2);
}
.statbar-s { font-size: var(--fs-xs); color: var(--ink-3); }
/* The accent stat used to be a slate-violet gradient plate with white
   text — a second, competing accent next to the orange one. It is now a
   quiet plate whose NUMBER carries the signal. The :root prefix is needed
   to out-specify redesign.css:879. */
:root .statbar-item.accent,
:root[data-theme="dark"] .statbar-item.accent {
  background: var(--surface-2); background-image: none;
}
:root .statbar-item.accent .statbar-v,
:root[data-theme="dark"] .statbar-item.accent .statbar-v { color: var(--orange); }
:root .statbar-item.accent .statbar-k,
:root[data-theme="dark"] .statbar-item.accent .statbar-k { color: var(--ink-3); }
:root .statbar-item.accent .statbar-s,
:root[data-theme="dark"] .statbar-item.accent .statbar-s { color: var(--ink-3); }
:root .statbar-item.accent.clickable:hover,
:root[data-theme="dark"] .statbar-item.accent.clickable:hover { filter: none; background: var(--surface-3); }
.statbar-item.clickable { cursor: pointer; transition: background var(--fast); }
.statbar-item.clickable:hover { background: var(--surface-2); }

/* The hero row is a single segmented register with hairline dividers — the
   same instrument treatment the Roadmap and Work Hub metric rows already
   use — rather than six separately bordered boxes with gaps. Six boxes made
   the three tiles without a sparkline read as having a dead gutter; in one
   register there are no card edges for that gap to sit against. */
.kpi-hero {
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  margin-bottom: var(--s-8);
}
.hero-card {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: var(--s-6);
  /* dividers as shadows so the trailing edge is clipped by the container
     instead of doubling up against its border */
  box-shadow: 1px 0 0 var(--line), 0 1px 0 var(--line);
  transition: background var(--fast);
}
.hero-card .spark { margin-top: auto; margin-bottom: 2px; }

/* labels in the chrome strips wrap to two lines at some widths, which makes
   the whole bar 19px taller than it needs to be */
.filesbar > *, .filesbar .btn, .filesbar .fb-chip, .filesbar .fb-label { white-space: nowrap; }
.hero-k { color: var(--ink-3); }
.hero-v {
  font-size: var(--fs-4xl); font-weight: 500;
  letter-spacing: var(--tr-tight); line-height: var(--lh-tight);
  color: var(--ink); margin: var(--s-4) 0 var(--s-3);
}
.hero-s { font-size: var(--fs-xs); color: var(--ink-3); line-height: var(--lh-snug); }
/* the decorative top strip on every tile was noise on a six-tile row */
.hero-card::before { display: none; }

/* The one dominant number on the page. These need the :root prefix to
   out-specify `:root[data-theme="dark"] .hero-card.accent` in
   redesign.css:912, which paints a slate-violet gradient. */
:root .hero-card.accent,
:root[data-theme="dark"] .hero-card.accent {
  background: var(--orange-50);
  background-image: none;
  border: 0;
  color: var(--ink);
}
:root .hero-card.accent .hero-v,
:root[data-theme="dark"] .hero-card.accent .hero-v { color: var(--orange); }
:root .hero-card.accent .hero-k,
:root[data-theme="dark"] .hero-card.accent .hero-k { color: var(--ink-3); }
:root .hero-card.accent .hero-s,
:root[data-theme="dark"] .hero-card.accent .hero-s { color: var(--ink-3); }

.hero-card.clickable { cursor: pointer; }
.hero-card.clickable:hover {
  background: var(--surface-2); transform: none;
  box-shadow: 1px 0 0 var(--line), 0 1px 0 var(--line);
}
.statbar-item.clickable:hover { box-shadow: none; transform: none; }
.hero-card.accent.clickable:hover { background: var(--orange-100); }
.hero-explore { color: var(--ink-4); font-size: var(--fs-2xs); font-weight: 600; }
.hero-card.clickable:hover .hero-explore { color: var(--orange); }
.hero-delta { font-size: var(--fs-2xs); font-family: var(--font-data); }

.kgroup-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: none; }
.kcard { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); }
.kcard-v { font-size: var(--fs-2xl); font-weight: 500; color: var(--ink); letter-spacing: var(--tr-tight); }
.kcard-l { color: var(--ink-3); }
.kcard.clickable:hover { border-color: var(--orange); }
.kcard.gated { opacity: .6; }

/* ============================================================
   10 · CHARTS
   ============================================================ */
.chart-box { background: transparent; }
.charts-grid { gap: var(--s-6); }

/* ============================================================
   11 · MESSAGES — callouts, banners, verdicts, integrity
   ============================================================ */
/* The tint and the icon chip carry the severity. An accent border on the
   left edge as well would make one signal into three, and a left-edge
   accent bar repeated across every component family is a recognisable
   generated-UI tell — so it is reserved for the one place it encodes
   real per-record state (.wh-card, whose colour is set from task status). */
.callout {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: var(--s-5) var(--s-6);
  gap: var(--s-5);
}
.callout .callout-ic {
  background: var(--ink-4); color: var(--surface);
  border-radius: var(--r-pill); width: 18px; height: 18px;
  font-size: var(--fs-2xs); font-weight: 700;
}
.callout.warn { background: var(--warn-bg); border-color: var(--warn-line); border-left-color: var(--warn); }
.callout.warn .callout-ic { background: var(--warn); color: #fff; }
.callout.bad  { background: var(--bad-bg);  border-color: var(--bad-line);  border-left-color: var(--bad); }
.callout.bad .callout-ic { background: var(--bad); color: #fff; }
.callout.soon { background: var(--info-bg); border-color: var(--info-line); border-left-color: var(--info); }
.callout.soon .callout-ic { background: var(--info); color: #fff; }

.banner {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: none; padding: var(--s-6) var(--s-7);
}
.banner.ok  { background: var(--good-bg); border-color: var(--good-line); color: var(--good-600); }
.banner.bad { background: var(--bad-bg);  border-color: var(--bad-line);  color: var(--bad-600); }

.integrity {
  font-size: var(--fs-2xs); font-weight: 600;
  border-radius: var(--r-pill); padding: var(--s-2) var(--s-5);
  border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2);
}
.integrity.ok  { background: var(--good-bg); border-color: var(--good-line); color: var(--good-600); }
.integrity.bad { background: var(--bad-bg);  border-color: var(--bad-line);  color: var(--bad-600); }

.verdict.good      { background: var(--good-bg); border-color: var(--good-line); }
.verdict.minor     { background: var(--warn-bg); border-color: var(--warn-line); }
.verdict.attention { background: var(--bad-bg);  border-color: var(--bad-line); }

/* severity reads from the icon colour and the chip, not a coloured edge */
.insight { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.insight.sev-high   { border-color: var(--bad-line); }
.insight.sev-high .insight-ic   { color: var(--bad); }
.insight.sev-medium { border-color: var(--warn-line); }
.insight.sev-medium .insight-ic { color: var(--warn); }
.insight.sev-low .insight-ic    { color: var(--info); }
.insight.sev-info .insight-ic   { color: var(--ink-4); }

/* ============================================================
   12 · EMPTY / LOADING / ERROR — one shared voice
   ============================================================ */
.empty, .wh-empty, .dd-empty, .rm-empty, .cat-detail-empty {
  color: var(--ink-3); font-size: var(--fs-sm);
  text-align: center; padding: var(--s-10) var(--s-6);
}
.empty-hero { color: var(--ink-4); }
.empty h3 { color: var(--ink); font-size: var(--fs-xl); }
.empty-step, .es-n { font-family: var(--font-data); }

/* skeletons instead of spinners */
@keyframes inst-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%);
  background-size: 200% 100%;
  animation: inst-shimmer 1.4s ease-in-out infinite;
  border-radius: var(--r-xs);
}

/* ============================================================
   13 · COMMAND PALETTE (Ctrl+K)
   The six .pal-<kind> modifiers were emitted by palette.js but styled
   nowhere; they now carry a per-kind marker.
   ============================================================ */
.pal-backdrop { background: rgba(0,0,0,.5); backdrop-filter: blur(2px); z-index: var(--z-palette); }
:root[data-theme="dark"] .pal-backdrop { background: rgba(0,0,0,.68); }
#pal .pal {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--sh-3);
}
.pal-head { border-bottom: 1px solid var(--line); padding: var(--s-5) var(--s-6); }
#pal-input { font-family: var(--font); font-size: var(--fs-lg); color: var(--ink); }
#pal-input::placeholder { color: var(--ink-4); }
.pal-head kbd {
  font-family: var(--font-data); font-size: var(--fs-3xs);
  background: var(--surface-2); border: 1px solid var(--line);
  color: var(--ink-3); border-radius: var(--r-xs); padding: 2px var(--s-3);
}
.pal-item { border-radius: var(--r-sm); padding: var(--s-4) var(--s-5); }
.pal-item.on { background: var(--surface-2); }
.pal-item.on .pal-label { color: var(--ink); }
.pal-item.on .pal-ic { color: var(--orange); }
.pal-label { font-size: var(--fs-sm); font-weight: 550; }
.pal-sub { font-size: var(--fs-2xs); color: var(--ink-4); background: none; border: 0; padding: 0; }
.pal-foot { background: var(--surface-2); border-top: 1px solid var(--line); font-size: var(--fs-2xs); color: var(--ink-4); }

/* ============================================================
   14 · DRILLDOWN PANEL
   ============================================================ */
.dd-backdrop { background: rgba(0,0,0,.42); z-index: var(--z-overlay); }
:root[data-theme="dark"] .dd-backdrop { background: rgba(0,0,0,.62); }
.dd-panel {
  background: var(--surface); border-left: 1px solid var(--line);
  box-shadow: var(--sh-3); z-index: var(--z-overlay);
}
.dd-head { border-bottom: 1px solid var(--line); }
.dd-title { font-size: var(--fs-xl); font-weight: 650; letter-spacing: var(--tr-tight); }
.dd-sub { font-size: var(--fs-xs); color: var(--ink-3); }
.dd-row { cursor: pointer; }
.dd-pivot {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--r-sm); color: var(--ink-2); font-size: var(--fs-sm);
}
.dd-pivot:hover { border-color: var(--orange); color: var(--orange); }

/* ============================================================
   15 · WORK HUB
   Structure is owned by redesign.css's v18 block and must not change:
   the .wh-col height cap, .wh-col-scroll's flex:1 + min-height:0, the
   small .wh-card.tight padding, and the minmax(0,·) grid guards. Only
   the look is set here.
   ============================================================ */
/* The left edge is coloured from task status by taskhub, so it encodes real
   per-record state and is kept — but at a hairline, not the 2-3px stripe
   that reads as the refused side-tab motif. */
.wh-card {
  background: var(--surface); border: 1px solid var(--line);
  border-left-width: 1px;
  border-radius: var(--r-sm);
  transition: border-color var(--fast), background var(--fast);
}
.wh-card:hover { border-color: var(--ink-4); background: var(--surface-2); }
.wh-card-title { font-size: var(--fs-sm); font-weight: 550; color: var(--ink); }
.wh-col {
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--r);
}
.wh-col h3 {
  font-size: var(--fs-2xs); font-weight: 700; letter-spacing: var(--tr-wide);
  text-transform: uppercase; color: var(--ink-3);
}
.wh-hub-side { gap: var(--s-5); }
.wh-warn { background: var(--warn-bg); border-color: var(--warn-line); }
/* was `background: var(--med)` — a DURATION token used as a colour, so
   the dot rendered transparent. */
.wh-pdot { background: var(--ink-4); }
.wh-prof-ava, .wh-mchip .wh-dot { color: #fff; font-weight: 650; }

/* ============================================================
   16 · TOAST
   ============================================================ */
/* was a wide slab across the bottom centre, covering the chart it was
   reporting on */
.toast {
  background: var(--ink); color: var(--bg);
  border-radius: var(--r-sm); box-shadow: var(--sh-3);
  font-size: var(--fs-sm); font-weight: 500; text-align: left;
  padding: var(--s-5) var(--s-6);
  z-index: var(--z-toast);
  left: auto; right: var(--s-7); transform: none;
  max-width: min(400px, calc(100vw - 48px));
}
:root[data-theme="dark"] .toast { background: var(--surface-3); color: var(--ink); border: 1px solid var(--line); }
.toast.ok  { box-shadow: var(--sh-3), inset 0 0 0 1px var(--good); }
.toast.bad { box-shadow: var(--sh-3), inset 0 0 0 1px var(--bad); }

/* ============================================================
   17 · AREA ACCENT — tokenized; was 10 hardcoded hexes in redesign.css
   ============================================================ */
/* redesign.css:720-730 declares these as ten literal hexes, the dark set
   behind `:root[data-theme="dark"]`, so the prefix is needed to win. */
:root body[data-area="reporting"], :root[data-theme="dark"] body[data-area="reporting"] { --area: var(--area-reporting); }
:root body[data-area="data"],      :root[data-theme="dark"] body[data-area="data"]      { --area: var(--area-data); }
:root body[data-area="work"],      :root[data-theme="dark"] body[data-area="work"]      { --area: var(--area-work); }
:root body[data-area="reference"], :root[data-theme="dark"] body[data-area="reference"] { --area: var(--area-reference); }
:root body[data-area="guide"],     :root[data-theme="dark"] body[data-area="guide"]     { --area: var(--area-guide); }

/* ============================================================
   17b · DARK-THEME CORRECTIONS
   redesign.css carries 64 `:root[data-theme="dark"]` rules that
   out-specify anything written at normal specificity. These are the ones
   that fight the Instrument world — mostly slate-violet gradients and
   `var(--navy)` fills, which invert to a light tint in dark mode.
   ============================================================ */
:root[data-theme="dark"] .sidebar {
  background: var(--sb-bg); box-shadow: none; border-right: 1px solid var(--sb-line);
}
:root[data-theme="dark"] .side-search { background: var(--sb-bg-2); }

/* flat planes, not gradients — a gradient on every status block is what
   made the old build read as decorated rather than instrumented */
:root[data-theme="dark"] .verdict.good      { background: var(--good-bg); background-image: none; }
:root[data-theme="dark"] .verdict.minor     { background: var(--warn-bg); background-image: none; }
:root[data-theme="dark"] .verdict.attention { background: var(--bad-bg);  background-image: none; }
:root[data-theme="dark"] .banner.ok  { background: var(--good-bg); background-image: none; }
:root[data-theme="dark"] .banner.bad { background: var(--bad-bg);  background-image: none; }
:root[data-theme="dark"] .insight,
:root[data-theme="dark"] .insight.sev-high,
:root[data-theme="dark"] .insight.sev-medium { background: var(--surface); background-image: none; }
:root[data-theme="dark"] .spine-node { background: var(--surface-2); background-image: none; border-color: var(--line); }

/* selected states: an orange marker, never a filled indigo block */
:root[data-theme="dark"] .tf-chip.on,
:root[data-theme="dark"] .wh-seg-b.on {
  background: var(--orange-50); border-color: var(--orange); color: var(--orange-700);
}
:root[data-theme="dark"] .tf-chip { background: var(--surface-2); }

/* ============================================================
   18 · RESPONSIVE
   A real ladder replacing 17 unrelated breakpoint values. The hard gate
   is tools/v18-drive.js: no board column taller than the viewport and
   at most 2px of horizontal overflow across the whole page.
   ============================================================ */

/* nothing may push the page sideways */
html, body { max-width: 100%; overflow-x: clip; }
.main, .main .wrap, .view { min-width: 0; max-width: 100%; }
table.data { max-width: 100%; }

@media (max-width: 1240px) {
  .main .wrap { padding-left: var(--s-8); padding-right: var(--s-8); }
  .view-head { margin-left: calc(var(--s-8) * -1); margin-right: calc(var(--s-8) * -1); padding-left: var(--s-8); padding-right: var(--s-8); }
  .filesbar, .globalfilter, .pairbar { padding-left: var(--s-8); padding-right: var(--s-8); }
}
@media (max-width: 1024px) {
  .sidebar { width: 200px; }
  .kpi-hero { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
}
@media (max-width: 900px) {
  .main .wrap { padding: var(--s-6) var(--s-6) var(--s-10); }
  .view-head {
    position: static;
    margin: 0 calc(var(--s-6) * -1) var(--s-6);
    padding: var(--s-5) var(--s-6);
  }
  .filesbar, .globalfilter, .pairbar { padding-left: var(--s-6); padding-right: var(--s-6); }
  .statbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* At phone width the sidebar used to stack its whole self — brand, version,
   search, 17 nav items in 4 groups, and the five footer actions — above the
   content, so the first viewport was 100% navigation and the actual page
   started roughly two screens down. It now collapses to three compact rows:
   brand + search, a single horizontally scrolling nav strip, and the
   actions. The promised first viewport survives on a phone. */
@media (max-width: 720px) {
  .sidebar {
    width: 100%; height: auto; border-right: 0;
    border-bottom: 1px solid var(--sb-line);
    position: sticky; top: 0; z-index: var(--z-sidebar);
  }
  .sidebar .brand { padding: var(--s-4) var(--s-5) var(--s-3); }
  .app-ver { display: none; }
  .side-search { margin: 0 var(--s-5) var(--s-3); padding: var(--s-3) var(--s-4); }
  .side-nav {
    flex-direction: row; flex-wrap: nowrap;
    overflow-x: auto; overflow-y: hidden;
    gap: var(--s-2); padding: 0 var(--s-5) var(--s-3);
    scrollbar-width: none; -ms-overflow-style: none;
  }
  .side-nav::-webkit-scrollbar { display: none; }
  .side-nav .nav-btn { flex: none; width: auto; white-space: nowrap; padding: var(--s-3) var(--s-4); }
  .side-nav .nav-btn.on::before { top: auto; bottom: 0; left: var(--s-4); right: var(--s-4); width: auto; height: 2px; border-radius: 2px 2px 0 0; }
  .side-foot {
    display: flex; align-items: center; gap: var(--s-3);
    margin: 0; padding: 0 var(--s-5) var(--s-4); border-top: 0;
  }
  .side-foot .btn.block { width: auto; flex: none; }
  .side-actions { margin-top: 0; }
  .side-foot .asof { display: none; }
  h2 { font-size: var(--fs-xl); }
  .hero-v { font-size: var(--fs-3xl); }
  .statbar-v { font-size: var(--fs-2xl); }

  /* the files bar and the filter bar together ate ~340px before any content;
     scroll them sideways instead of stacking five rows deep */
  .filesbar {
    flex-wrap: nowrap; overflow-x: auto; gap: var(--s-3);
    padding: var(--s-3) var(--s-6); scrollbar-width: none;
  }
  .filesbar::-webkit-scrollbar { display: none; }
  .filesbar > * { flex: none; }
  /* a horizontally scrolling strip with no edge treatment reads as a
     complete list that happens to be clipped — say there is more */
  .side-nav, .filesbar {
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
    mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
  }
  .globalfilter { padding: var(--s-3) var(--s-6); }
  .gf-bar { gap: var(--s-3); }
  .gf-pill { padding: 1px var(--s-3); }
  .view-head { padding: var(--s-4) var(--s-6); }
  .view-head .sub { display: none; }
  .view-head .disclosure { display: none; }
}

/* the files bar wrapped `+ Add file` onto a third row at 1440, pushing the
   content ~70px further down than at 1512 — scroll it instead of wrapping */
@media (min-width: 1000px) {
  .filesbar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; }
  .filesbar::-webkit-scrollbar { height: 6px; }
  .filesbar::-webkit-scrollbar-thumb { background: var(--line); border-radius: var(--r-pill); }
}
@media (max-width: 560px) {
  /* the old ladder bottomed out at 2 columns and never reached 1 */
  .statbar { grid-template-columns: 1fr; }
  .kpi-hero { grid-template-columns: 1fr; }
  .main .wrap { padding: var(--s-5) var(--s-5) var(--s-9); }
  .view-head { margin: 0 calc(var(--s-5) * -1) var(--s-5); padding: var(--s-5); }
}

/* ============================================================
   19 · PRINT
   Reports is the leadership deliverable, so this has to be real.
   Dark mode used to print near-white text on white paper: it forced
   body/html/.main white but left --ink at its dark-theme value.
   ============================================================ */
@media print {
  /* force the light palette regardless of the on-screen theme */
  :root, :root[data-theme="dark"] {
    --ink: #0D0D22; --ink-2: #3A3E58; --ink-3: #52586E; --ink-4: #6E7488;
    --line: #C9CEDA; --line-2: #DFE3EC;
    --bg: #FFFFFF; --bg-2: #FFFFFF; --surface: #FFFFFF; --surface-2: #F4F6FA; --surface-3: #E9EDF5;
    --orange: #C6410B; --orange-700: #9C3308;
    --good: #0E7050; --warn: #855409; --bad: #B62F29; --info: #2A54AE;
    --c-navy: #3B3AA0; --c-orange: #C6410B; --c-teal: #0E8FA8; --c-violet: #6B5BC4;
    --c-amber: #B8830C; --c-green: #0E7050; --c-rose: #B62F29; --c-slate: #767D96;
    --grid: #DFE3EC;
  }
  body, .main, .shell, .wrap { background: #fff !important; color: #0D0D22 !important; }
  .side-search, .app-ver, .pal-backdrop, .dd-backdrop, .dd-panel,
  .wh-detail-backdrop, .empty-actions, .view-siblings, .pairbar,
  .view-head > .disclosure, .disclosure:not([open]) { display: none !important; }
  .view-head {
    position: static !important; border-bottom: 1px solid #C9CEDA !important;
    margin: 0 0 16px !important; padding: 0 0 10px !important; background: #fff !important;
  }
  .card, .statbar, .table-wrap, .banner, .kgroup-card, .hero-card {
    box-shadow: none !important; border: 1px solid #C9CEDA !important;
    break-inside: avoid; background: #fff !important;
  }
  table.data th { background: #F4F6FA !important; color: #3A3E58 !important; }
  table.data { break-inside: auto; }
  table.data tr { break-inside: avoid; }
  thead { display: table-header-group; }
  .chart-box { break-inside: avoid; }
  a[href]:after { content: ""; }
  @page { margin: 14mm; }
}

/* ============================================================
   20 · MOTION — 150–250ms, state only, never decoration
   ============================================================ */
.view { animation: fadeUp .18s var(--ease); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ============================================================
   21 · RELEASE ANNOUNCEMENT (v19)
   Fires on boot from any view when the person has an unacknowledged
   release. Rendered into document.body, so it needs its own dialog
   styling rather than the Work Hub's in-view panel classes.
   ============================================================ */
#wh-relpop .wh-detail-backdrop {
  position: fixed; inset: 0; z-index: var(--z-overlay);
  background: rgba(0, 0, 0, .5);
}
:root[data-theme="dark"] #wh-relpop .wh-detail-backdrop { background: rgba(0, 0, 0, .68); }

.wh-relpop-box {
  position: fixed; z-index: calc(var(--z-overlay) + 1);
  left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(540px, calc(100vw - 32px));
  max-height: min(78vh, 720px); overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-3);
  padding: var(--s-7) var(--s-8) var(--s-7);
  animation: relpop-in .18s var(--ease);
}
@keyframes relpop-in {
  from { opacity: 0; transform: translate(-50%, calc(-50% + 6px)); }
  to   { opacity: 1; transform: translate(-50%, -50%); }
}
.wh-relpop-head { display: flex; align-items: flex-start; gap: var(--s-5); margin-bottom: var(--s-6); }
.wh-relpop-head b { font-size: var(--fs-xl); font-weight: 650; letter-spacing: var(--tr-tight); }
.wh-relpop-head .dd-close { margin-left: auto; flex: none; }
.wh-relpop-ic {
  flex: none; width: 32px; height: 32px; border-radius: var(--r-sm);
  display: grid; place-items: center;
  background: var(--orange-50); color: var(--orange);
}
.wh-relpop-list { list-style: none; margin: 0 0 var(--s-7); padding: 0; }
.wh-relpop-list li {
  border-top: 1px solid var(--line-2);
  padding: var(--s-5) 0;
  font-size: var(--fs-sm);
}
.wh-relpop-list li b { color: var(--orange); font-family: var(--font-data); font-size: var(--fs-xs); margin-right: var(--s-3); }
.wh-relpop-list li .note { display: block; margin-top: var(--s-3); }
.wh-relpop-foot { display: flex; gap: var(--s-4); }

@media (max-width: 560px) {
  .wh-relpop-box { padding: var(--s-6); }
  .wh-relpop-foot { flex-direction: column; }
  .wh-relpop-foot .btn { justify-content: center; }
}
@media print { #wh-relpop { display: none !important; } }

/* v21.1: ✓ Solve is GREEN — its own thing, never confusable with the orange
   ✓ Update. (instrument's .btn paints orange; this must out-cascade it.) */
.wh-solvebar .btn.solve { background: var(--good); border-color: var(--good); color: #fff; }
.wh-solvebar .btn.solve:hover { background: var(--good-600, var(--good)); border-color: var(--good-600, var(--good)); }

/* ============================================================
   22 · v22 THE CONNECTED DASHBOARD — Today page, nav badges,
   keyboard help, motion discipline. Tokens only.
   ============================================================ */
/* nav badges: the sidebar doubles as a status board */
.side-nav .nav-btn { position: relative; }
.nav-badge { display: none; margin-left: auto; min-width: 20px; height: 18px; padding: 0 6px;
  border-radius: 999px; font-family: var(--font-data); font-size: var(--fs-3xs); font-weight: 700;
  line-height: 18px; text-align: center; color: var(--sb-ink); background: var(--sb-bg-2);
  border: 1px solid var(--sb-line); }
.nav-badge.show { display: inline-block; }
.nav-badge.hot { background: var(--orange); border-color: var(--orange); color: #fff; }
.side-nav .nav-btn.on .nav-badge { background: var(--orange); border-color: var(--orange); color: #fff; }
.nav-home { margin-top: var(--s-3); margin-bottom: var(--s-3); }

/* Today */
.hm-head { align-items: center; }
.hm-actions { display: flex; gap: var(--s-3); flex-wrap: wrap; justify-content: flex-end; }
.hm-actions .btn kbd { font-family: var(--font-data); font-size: var(--fs-3xs); border: 1px solid var(--line); border-radius: var(--r-xs); padding: 0 4px; margin-left: 2px; }
.hm-tiles { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: var(--s-3); margin-bottom: var(--s-6); }
@media (max-width: 1280px) { .hm-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.hm-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left;
  padding: var(--s-5) var(--s-5); border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface); cursor: pointer; font: inherit; color: var(--ink);
  transition: border-color var(--fast), transform var(--fast), box-shadow var(--fast); min-height: 74px; }
.hm-tile:hover { border-color: var(--orange); box-shadow: var(--sh-1); }
.hm-tile:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.hm-tile-n { font-family: var(--font-data); font-size: 26px; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; }
.hm-tile-k { font-size: var(--fs-xs); color: var(--ink-3); font-weight: 600; letter-spacing: .01em; }
.hm-tile.zero .hm-tile-n { color: var(--ink-4); }
.hm-tile.hot .hm-tile-n { color: var(--orange); }
.hm-tile.sk .sk-bar { display: block; height: 26px; width: 40%; border-radius: var(--r-xs); background: var(--surface-3); }
.hm-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-5); align-items: start; margin-bottom: var(--s-5); }
@media (max-width: 1180px) { .hm-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 860px) { .hm-grid { grid-template-columns: 1fr; } }
.hm-col { display: flex; flex-direction: column; gap: var(--s-5); min-width: 0; }
.hm-card { padding: var(--s-5) var(--s-5) var(--s-4); }
.hm-card.sk { min-height: 220px; background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: hm-shimmer 1.4s linear infinite; }
@keyframes hm-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.hm-card-h { display: flex; align-items: baseline; gap: var(--s-4); margin-bottom: var(--s-3); }
.hm-card-h h3 { margin: 0; font-size: var(--fs-md); display: flex; align-items: center; gap: var(--s-3); }
.hm-ic { font-size: 14px; }
.hm-card-f { margin-left: auto; font-size: var(--fs-xs); color: var(--ink-3); }
.hm-sec { font-size: var(--fs-3xs); letter-spacing: var(--tr-wider); text-transform: uppercase; color: var(--ink-3); font-weight: 700; margin: var(--s-4) 0 var(--s-2); }
.hm-sec:first-child { margin-top: 0; }
.hm-row { display: flex; align-items: center; gap: var(--s-3); width: 100%; text-align: left;
  padding: 7px var(--s-3); border: 0; border-radius: var(--r-sm); background: transparent; color: var(--ink);
  font: inherit; font-size: var(--fs-sm); cursor: pointer; transition: background var(--fast); }
.hm-row:hover { background: var(--surface-2); }
.hm-row:focus-visible { outline: 2px solid var(--orange); outline-offset: -2px; }
.hm-row + .hm-row { border-top: 1px solid var(--line-2); border-radius: 0; }
.hm-tk { font-family: var(--font-data); font-size: var(--fs-3xs); color: var(--ink-3); min-width: 46px; flex: 0 0 auto; }
.hm-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.hm-sub { color: var(--ink-3); font-weight: 400; font-size: var(--fs-xs); }
.hm-mini { font-size: var(--fs-xs); color: var(--ink-3); flex: 0 0 auto; }
.hm-due { font-family: var(--font-data); font-size: var(--fs-3xs); color: var(--ink-3); flex: 0 0 auto; }
.hm-due.today { color: var(--orange-700); font-weight: 700; }
.hm-due.over { color: var(--bad); font-weight: 700; }
:root[data-theme="dark"] .hm-due.today { color: var(--orange-400); }
.hm-st { font-size: var(--fs-3xs); font-weight: 700; padding: 2px 7px; border-radius: 999px; background: var(--surface-3); color: var(--ink-2); flex: 0 0 auto; text-transform: capitalize; }
.hm-st.st-review, .hm-st.st-fixed { background: var(--orange-100); color: var(--orange-700); }
.hm-st.st-issues, .hm-st.st-escalated { background: var(--bad-100, rgba(220,60,60,.15)); color: var(--bad); }
:root[data-theme="dark"] .hm-st.st-review, :root[data-theme="dark"] .hm-st.st-fixed { background: rgba(241,90,34,.18); color: var(--orange-400); }
.hm-empty { padding: var(--s-6) var(--s-4); text-align: center; color: var(--ink-3); font-size: var(--fs-sm);
  border: 1px dashed var(--line); border-radius: var(--r-sm); }
.hm-live { color: var(--good); font-weight: 700; }
.hm-data .hm-actions-row { display: flex; gap: var(--s-3); flex-wrap: wrap; margin-top: var(--s-3); }
.hm-data-body .note { max-width: 70ch; }

/* keyboard help */
.kbd-help { position: fixed; inset: 0; z-index: var(--z-palette); background: rgba(10,10,30,.45); display: flex; align-items: center; justify-content: center; }
.kbd-help[hidden] { display: none !important; }
.kbd-card { background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r-md);
  box-shadow: var(--sh-3); padding: var(--s-6) var(--s-7); width: min(520px, calc(100vw - 32px)); }
.kbd-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--s-4); font-size: var(--fs-md); }
.kbd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-2) var(--s-6); }
.kbd-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); padding: 5px 0; border-bottom: 1px solid var(--line-2); font-size: var(--fs-sm); }
.kbd-row kbd { font-family: var(--font-data); font-size: var(--fs-3xs); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: var(--r-xs); padding: 1px 6px; background: var(--surface-2); }

/* motion discipline: one crossfade per page change, none for people who asked for none */
.view.show { animation: hm-fade .18s ease-out; }
@keyframes hm-fade { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .view.show, .wh-updatebar.show, .hm-card.sk { animation: none !important; }
  * { transition-duration: 0.01ms !important; }
}

/* ---- v22 Merchant Lens: the drawer + the affordance on every merchant name ---- */
.lens { cursor: pointer; text-decoration: underline dotted transparent; text-underline-offset: 3px; transition: text-decoration-color var(--fast), color var(--fast); }
.lens:hover { text-decoration-color: var(--orange); color: var(--orange-700); }
:root[data-theme="dark"] .lens:hover { color: var(--orange-400); }
.ln-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.42); opacity: 0; pointer-events: none; transition: opacity .18s ease-out; z-index: var(--z-overlay); }
.ln-backdrop.open { opacity: 1; pointer-events: auto; }
.ln-panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: var(--surface); color: var(--ink);
  border-left: 1px solid var(--line); box-shadow: var(--sh-3); transform: translateX(100%); transition: transform .22s ease-out;
  z-index: calc(var(--z-overlay) + 1); display: flex; flex-direction: column; overflow: hidden; }
.ln-panel.open { transform: none; }
.ln-head { display: flex; align-items: flex-start; gap: var(--s-4); padding: var(--s-6) var(--s-7) var(--s-4); border-bottom: 1px solid var(--line); }
.ln-title { display: flex; align-items: center; gap: var(--s-4); flex: 1; min-width: 0; }
.ln-ic { font-size: 20px; }
.ln-name { font-size: var(--fs-xl); font-weight: 650; letter-spacing: var(--tr-tight); overflow-wrap: anywhere; }
.ln-meta { font-size: var(--fs-xs); color: var(--ink-3); margin-top: 2px; }
.ln-actions { display: flex; gap: var(--s-3); flex-wrap: wrap; padding: var(--s-4) var(--s-7); border-bottom: 1px solid var(--line-2); }
.ln-body { flex: 1; overflow-y: auto; padding: var(--s-4) var(--s-7) var(--s-7); }
.ln-sec { margin-top: var(--s-5); }
.ln-sec-h { display: flex; align-items: center; gap: var(--s-3); margin-bottom: var(--s-2); font-size: var(--fs-sm); }
.ln-n { font-family: var(--font-data); font-size: var(--fs-3xs); font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--surface-3); color: var(--ink-2); }
.ln-row { display: flex; align-items: center; gap: var(--s-3); width: 100%; text-align: left; padding: 7px var(--s-3);
  border: 0; border-radius: var(--r-sm); background: transparent; color: var(--ink); font: inherit; font-size: var(--fs-sm); cursor: pointer; }
.ln-row:hover { background: var(--surface-2); }
.ln-row:focus-visible { outline: 2px solid var(--orange); outline-offset: -2px; }
.ln-row + .ln-row { border-top: 1px solid var(--line-2); border-radius: 0; }
.ln-k { font-family: var(--font-data); font-size: var(--fs-3xs); color: var(--ink-3); min-width: 64px; flex: 0 0 auto; }
.ln-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.ln-sub { color: var(--ink-3); font-weight: 400; font-size: var(--fs-xs); white-space: nowrap; }
.ln-chip { font-size: var(--fs-3xs); font-weight: 700; padding: 2px 7px; border-radius: 999px; background: var(--surface-3); color: var(--ink-2); flex: 0 0 auto; white-space: nowrap; }
.ln-chip.st-passed, .ln-chip.st-done { background: var(--good-100, rgba(40,160,90,.15)); color: var(--good); }
.ln-chip.st-pending, .ln-chip.st-review, .ln-chip.st-fixed { background: var(--orange-100); color: var(--orange-700); }
.ln-chip.st-issues, .ln-chip.st-escalated { background: rgba(220,60,60,.15); color: var(--bad); }
:root[data-theme="dark"] .ln-chip.st-pending, :root[data-theme="dark"] .ln-chip.st-review, :root[data-theme="dark"] .ln-chip.st-fixed { background: rgba(241,90,34,.18); color: var(--orange-400); }
.ln-empty { padding: var(--s-4); color: var(--ink-3); font-size: var(--fs-xs); border: 1px dashed var(--line); border-radius: var(--r-sm); text-align: center; }
.pal-lens .pal-ic { color: var(--orange); }
@media (prefers-reduced-motion: reduce) { .ln-panel, .ln-backdrop { transition: none; } }

/* ---- v22 meeting steps read the dashboard: live context blocks ---- */
.su-ctx { margin: 0 0 var(--s-4); padding: var(--s-3) var(--s-4); border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface-2); font-size: var(--fs-sm); }
.su-ctx-h { display: flex; align-items: center; gap: var(--s-3); font-size: var(--fs-xs); color: var(--ink-2); margin-bottom: var(--s-2); }
.su-ctx-h + .su-ctx-h { margin-top: var(--s-4); }
.su-ctx-row { display: flex; align-items: center; gap: var(--s-3); padding: 4px 0; border-top: 1px solid var(--line-2); }
.su-ctx-row .note { font-size: var(--fs-xs); }
.su-ctx-warn { color: var(--orange-700); font-weight: 700; }
.su-ctx-ok { color: var(--good); font-weight: 700; }
:root[data-theme="dark"] .su-ctx-warn { color: var(--orange-400); }

/* ---- v22 sidebar density: 18 destinations + Today must fit a 900px laptop without clipping ---- */
.sidebar .brand { padding: var(--s-6) var(--s-7) var(--s-3); }
.app-ver { padding: 0 var(--s-7) var(--s-4); }
.side-search { margin-bottom: var(--s-3); padding: var(--s-3) var(--s-5); }
.side-nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding-bottom: var(--s-3); }
.side-nav .nav-btn { padding: 6px var(--s-4); min-height: 30px; }
.side-group { padding: var(--s-4) var(--s-4) var(--s-2); }
.side-foot { padding: var(--s-4) var(--s-5) var(--s-5); }
.side-foot .btn.block { min-height: 34px; }
.side-actions { margin-top: var(--s-3); }
.side-utils .btn { padding-left: 4px; padding-right: 4px; font-size: var(--fs-xs); }
.side-foot .asof { margin-top: var(--s-3); }

/* ============================================================
   23 · v22.1 THE CLEAR LIST — tickets as calm rows, steps the
   team works together, a wider detail panel. Tokens only.
   ============================================================ */
/* rows: hairlines, not boxes */
.wh-rows { display: flex; flex-direction: column; }
.wh-row { border: 0; border-left: 2px solid transparent; border-radius: 0; margin: 0; padding: 9px 10px 9px 8px;
  background: transparent; gap: var(--s-4); align-items: flex-start; }
.wh-row + .wh-row { border-top: 1px solid var(--line-2); }
.wh-row:hover { background: var(--surface-2); border-left-color: var(--orange); }
.wh-row.attn { border-left-color: var(--bad); }
.wh-row.over { border-left-color: var(--warn); }
.wh-row.stale { opacity: .7; border-style: solid; }
.wh-row .wh-check { margin-top: 1px; }
.wh-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.wh-row-title { font-size: var(--fs-md); font-weight: 600; line-height: 1.3; white-space: normal; }
.wh-row-line { display: flex; align-items: center; gap: var(--s-4); flex-wrap: wrap; font-size: var(--fs-xs); color: var(--ink-3); }
.wh-row-tk { font-family: var(--font-data); font-size: var(--fs-3xs); color: var(--ink-3); letter-spacing: .02em; }
.wh-row-sub { margin: 0; font-size: var(--fs-xs); }
.wh-row-steps { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 52ch; }
.wh-row-prog { display: inline-block; width: 44px; height: 4px; border-radius: 2px; background: var(--surface-3); overflow: hidden; vertical-align: middle; }
.wh-row-prog b { display: block; height: 100%; background: var(--good); border-radius: 2px; }
.wh-row-wait { color: var(--warn-600, var(--ink-2)); font-weight: 600; }
.wh-row-meta { gap: var(--s-4); align-self: center; }
.wh-row-st { font-size: var(--fs-3xs); font-weight: 600; color: var(--ink-3); white-space: nowrap; min-width: 84px; text-align: right; }
.wh-row-st.st-doing { color: var(--navy-500); } .wh-row-st.st-review { color: var(--orange-700); } .wh-row-st.st-waiting { color: var(--warn-600, var(--ink-2)); }
:root[data-theme="dark"] .wh-row-st.st-doing { color: #9DA3FF; } :root[data-theme="dark"] .wh-row-st.st-review { color: var(--orange-400); }
.wh-row-acts { align-self: center; opacity: 0; transition: opacity var(--fast); }
.wh-row:hover .wh-row-acts, .wh-row:focus-within .wh-row-acts { opacity: 1; }
.wh-row .wh-mini-due { font-family: var(--font-data); background: transparent; border: 0; padding: 0; font-weight: 600; }
.wh-row .wh-mini-due.soon { color: var(--orange-700); } .wh-row .wh-mini-due.over { color: var(--bad); }
:root[data-theme="dark"] .wh-row .wh-mini-due.soon { color: var(--orange-400); }
/* groups inside the list */
.wh-group + .wh-group { margin-top: var(--s-5); }
.wh-group-h { display: flex; align-items: center; gap: var(--s-3); font-size: var(--fs-3xs); letter-spacing: var(--tr-wider); text-transform: uppercase;
  color: var(--ink-3); font-weight: 700; padding: 0 0 var(--s-2) 8px; border-bottom: 1px solid var(--line); margin-bottom: 2px; }
.wh-group-n { font-family: var(--font-data); font-weight: 600; color: var(--ink-4); letter-spacing: 0; }
/* the work tabs: text tabs on a rule, not pills */
.wh-worktabs { gap: 0; border-bottom: 1px solid var(--line); margin: 0 0 var(--s-4); }
.wh-wtab { border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; padding: 7px 10px; margin-bottom: -1px;
  font-size: var(--fs-sm); font-weight: 600; color: var(--ink-3); }
.wh-wtab:hover { border-color: transparent; color: var(--ink); background: transparent; }
.wh-wtab.on { background: transparent; border-bottom-color: var(--orange); color: var(--ink); }
.wh-wtab.on .wh-tc { background: var(--orange); color: #fff; }
.wh-wtab.warn:not(.on) { border-color: transparent; color: var(--bad); }
/* the list header + one-line summary that replaces the tile card */
.wh-list-h { display: flex; align-items: baseline; gap: var(--s-4); margin: 0 0 var(--s-3); }
.wh-list-h h3 { margin: 0; font-size: var(--fs-lg); }
.wh-sumline { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-3); margin: 0 0 var(--s-5); }
.wh-sum { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 3px 10px; font: inherit; font-size: var(--fs-xs);
  color: var(--ink-2); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; transition: border-color var(--fast); }
.wh-sum b { font-family: var(--font-data); font-weight: 600; color: var(--ink); }
.wh-sum:hover { border-color: var(--orange); }
.wh-sum.hot b { color: var(--orange-700); } .wh-sum.bad b { color: var(--bad); }
:root[data-theme="dark"] .wh-sum.hot b { color: var(--orange-400); }
.wh-zone { padding: var(--s-5) var(--s-5) var(--s-3); }
/* the board's list mode + calmer cards */
.wh-board-list .wh-group { margin-bottom: var(--s-5); }
.wh-card { border-left-width: 2px; }
.wh-card-meta { gap: 6px; align-items: center; }
/* steps in the detail panel */
.wh-detail { width: 580px; max-width: 94vw; }
.wh-steps { margin: 4px 0 14px; padding: var(--s-4) var(--s-4) var(--s-3); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.wh-steps-h { display: flex; align-items: center; gap: var(--s-3); font-size: var(--fs-sm); font-weight: 700; margin-bottom: var(--s-3); }
.wh-steps-h .wh-row-prog { width: 80px; }
.wh-steps-n { font-family: var(--font-data); font-weight: 600; color: var(--ink-2); }
.wh-steps-h .note { font-weight: 400; }
.wh-step-book { max-width: 190px; font-size: var(--fs-xs); }
.wh-step { display: grid; grid-template-columns: 24px minmax(0, 1fr) 110px 118px auto; align-items: center; gap: var(--s-3);
  padding: 4px 0; border-top: 1px solid var(--line-2); }
.wh-step:first-of-type { border-top: 0; }
.wh-step .wh-check.on { color: var(--good); border-color: var(--good); }
.wh-step-text { border: 1px solid transparent; background: transparent; font: inherit; font-size: var(--fs-sm); color: var(--ink); padding: 5px 6px; border-radius: var(--r-xs); min-width: 0; }
.wh-step-text:hover { border-color: var(--line); } .wh-step-text:focus { outline: none; border-color: var(--orange); background: var(--surface-2); }
.wh-step.done .wh-step-text { text-decoration: line-through; color: var(--ink-3); }
.wh-step.mine .wh-step-text { font-weight: 600; }
.wh-step-who, .wh-step-due { font: inherit; font-size: var(--fs-xs); border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); border-radius: var(--r-xs); padding: 4px 6px; min-width: 0; }
.wh-step-who:focus, .wh-step-due:focus { outline: none; border-color: var(--orange); }
.wh-step-who.set { color: var(--ink); font-weight: 600; }
.wh-step-meta { grid-column: 3 / span 2; font-size: var(--fs-3xs); color: var(--good); font-family: var(--font-data); }
.wh-step.done .wh-step-who, .wh-step.done .wh-step-due { display: none; }
.wh-step-tools { display: inline-flex; gap: 2px; opacity: 0; transition: opacity var(--fast); }
.wh-step:hover .wh-step-tools, .wh-step:focus-within .wh-step-tools { opacity: 1; }
.wh-step-add { display: flex; gap: var(--s-3); margin-top: var(--s-3); }
.wh-step-add .search { flex: 1; }
.wh-steprow .wh-row-title { font-weight: 500; }
@media (max-width: 720px) { .wh-step { grid-template-columns: 24px 1fr; } .wh-step-who, .wh-step-due, .wh-step-tools { grid-column: 2; } }
/* done steps: the text keeps its width, the who/when sits at the right */
.wh-step.done { grid-template-columns: 24px minmax(0, 1fr) auto auto; }
.wh-step-meta { grid-column: auto; white-space: nowrap; }
.wh-step-text[disabled] { opacity: 1; }
.wh-resp-more { display: block; margin-top: var(--s-3); font-size: var(--fs-xs); }
