/* Customer Factory dashboard — layout only. Visual tokens live in tokens.css (the design handoff, verbatim).
   The aliases below let the v1 components keep rendering on the new tokens while the redesign lands piece by piece. */
:root {
  --font: var(--font-sans); --mono: var(--font-mono);
  --s-1: var(--sp-1); --s-2: var(--sp-2); --s-3: var(--sp-3); --s-4: var(--sp-4); --s-5: var(--sp-5); --s-6: var(--sp-6); --s-8: var(--sp-8); --s-10: 40px; --s-12: var(--sp-12);
  --radius: var(--r-card); --radius-sm: var(--r-btn); --radius-pill: var(--r-pill);
  --shadow: none; --shadow-lg: var(--shadow-panel);
  --surface: var(--s1); --surface-2: var(--s2); --border: var(--line);
  --fg: var(--tx); --fg-2: var(--tx2); --fg-3: var(--tx3);
  --accent: var(--ac); --accent-fg: var(--ac-ink); --accent-soft: var(--ac-soft);
  --green: var(--ok); --green-soft: var(--ok-soft); --amber: var(--warn); --amber-soft: var(--warn-soft); --red: var(--bad); --red-soft: var(--bad-soft); --unknown: var(--na); --unknown-soft: var(--s3);
  --fs-xs: var(--fs-eyebrow); --fs-sm: var(--fs-meta); --fs-md: var(--fs-body); --fs-lg: var(--fs-h2); --fs-xl: var(--fs-h1); --fs-2xl: 32px;
}
html { -webkit-text-size-adjust: 100%; }
button { font: inherit; }
.skip { position: absolute; left: -999px; top: 0; background: var(--s1); padding: var(--sp-2) var(--sp-3); border-radius: var(--r-btn); }
.skip:focus { left: var(--sp-4); z-index: 100; }

/* ---------- view tabs (routes) ---------- */
.viewtabs { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); display: flex; gap: var(--sp-1); align-items: center; border-bottom: 1px solid var(--line); overflow-x: auto; }
.viewtabs a { display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 var(--sp-3); color: var(--tx2); text-decoration: none; font-weight: 600; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.viewtabs a:hover { color: var(--tx); }
.viewtabs a[aria-current="page"] { color: var(--tx); border-bottom-color: var(--ac); }
.viewtabs a.push-right { margin-left: auto; color: var(--tx3); }
.viewtabs:empty { display: none; }
.theme-seg { display: flex; gap: var(--sp-1); padding: var(--sp-1) var(--sp-2); }
.theme-seg button { flex: 1; min-height: 32px; border-radius: var(--r-tag); border: 1px solid var(--line); background: var(--s2); color: var(--tx2); cursor: pointer; font-size: 12px; font-weight: 600; }
.theme-seg button[aria-pressed="true"] { background: var(--tx); color: var(--bg); border-color: var(--tx); }

/* ---------- mission strip (HANDOFF §3) ---------- */
.mission { position: sticky; top: 0; z-index: 20; background: var(--s1); border-bottom: 1px solid var(--line); }
.mission-inner { max-width: var(--maxw); margin: 0 auto; padding: var(--sp-3) var(--gutter); display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3) var(--sp-5); }
.brand { display: flex; align-items: center; gap: var(--sp-3); text-decoration: none; color: var(--tx); }
.brand:hover { color: var(--tx); }
.brand-mark { width: 36px; height: 36px; border-radius: 10px; background: var(--ac); color: var(--ac-ink); display: grid; place-items: center; font-weight: 700; font-size: 16px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text b { font-size: 16px; }
.brand-text small { color: var(--tx3); font-size: 12px; }
.mission-stage { display: flex; align-items: center; gap: var(--sp-3); }
.mission-day { display: flex; align-items: center; gap: var(--sp-2); font-size: 13px; color: var(--tx2); }
.progress { width: 120px; height: 6px; border-radius: 999px; background: var(--s3); overflow: hidden; display: inline-block; }
.progress-fill { display: block; height: 100%; background: var(--ac); border-radius: inherit; }
.mission-divider { width: 1px; height: 36px; background: var(--line); }
.northstar-row { display: flex; align-items: center; gap: var(--sp-3); }
.northstar-text { display: flex; flex-direction: column; line-height: 1.2; }
.northstar-value { font-size: 26px; font-weight: 600; }
.northstar-caption { font-size: 13px; color: var(--tx2); }
.northstar-trend { font-size: 12px; }
.trend-good { color: var(--ok); } .trend-bad { color: var(--bad); }
.spark { display: block; overflow: visible; }
.spark-line { fill: none; stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.spark-good { stroke: var(--ok); } .spark-bad { stroke: var(--bad); }
.spark-target { stroke: var(--tx3); stroke-width: 1; stroke-dasharray: 3 3; }
.mission-right { margin-left: auto; display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }
.asof { font-size: 13px; color: var(--tx3); white-space: nowrap; }
.seg { display: inline-flex; gap: var(--sp-1); }
.seg .btn { min-height: 36px; padding: 0 12px; font-size: 13px; }
.menu { position: relative; }
.menu summary { list-style: none; min-height: 36px; font-size: 13px; }
.menu summary::-webkit-details-marker { display: none; }
.menu-panel { position: absolute; right: 0; top: calc(100% + 6px); background: var(--s1); border: 1px solid var(--line); border-radius: var(--r-opt); box-shadow: var(--shadow-panel); min-width: 240px; padding: var(--sp-2); display: grid; gap: var(--sp-1); z-index: 30; }
.menu-panel a, .menu-panel span { display: block; padding: var(--sp-2) var(--sp-2); border-radius: var(--r-tag); color: var(--tx); text-decoration: none; font-size: 13px; }
.menu-panel a:hover { background: var(--s2); color: var(--tx); }
.menu-panel .hint { color: var(--tx3); font-size: 12px; }
.ribbon { background: var(--ac); color: var(--ac-ink); font-weight: 700; font-size: 12px; text-align: center; min-height: 32px; display: flex; align-items: center; justify-content: center; letter-spacing: .08em; }
@media (max-width: 640px) {
  .mission-divider, .brand-text small { display: none; }
  .mission-right { margin-left: 0; width: 100%; justify-content: space-between; }
  .asof { display: none; }
}

/* ---------- page ---------- */
.page { max-width: var(--maxw); margin: 0 auto; padding: var(--sp-6) var(--gutter) var(--sp-16); display: grid; gap: var(--sp-12); }
.section:empty { display: none; }
.section-title { margin: 0 0 var(--s-3); font-size: var(--fs-lg); font-weight: 700; }
.hint { color: var(--fg-3); font-size: var(--fs-sm); margin: 0; }

/* ---------- hero (HANDOFF §3 FR7) ---------- */
.hero-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(560px, 100%), 1fr)); gap: var(--sp-6); align-items: start; }
.hero-grid > * { min-width: 0; } /* grid items may shrink below their content width — the banner's button must not push into the next column */
.hero-right { display: grid; gap: var(--sp-6); align-content: start; }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--sp-2) var(--sp-4); margin-bottom: var(--sp-4); }
.section-head .section-title { margin: 0; }
.section-sub { margin: 0; color: var(--tx3); font-size: 13px; }

/* ---------- narrative strip ---------- */
.narrative { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--sp-5); padding: var(--sp-5); }
.narrative-col h3 { margin: 2px 0 var(--sp-3); font-size: var(--fs-h2); font-weight: 600; }
.narrative-col ul { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--sp-2); }
.narrative-col li { display: grid; grid-template-columns: auto 1fr; gap: var(--sp-2); align-items: baseline; color: var(--tx2); font-size: 14px; line-height: 1.4; }
.narrative-col li .dot { position: relative; top: 3px; align-self: start; }
.narrative-at { font-size: 12px; color: var(--tx3); min-width: 38px; }
.narrative-at--none { color: var(--line2); }

/* ---------- new-site state (HANDOFF NewSite) ---------- */
.getting-started { gap: var(--sp-3); }
.getting-started h3 { font-size: var(--fs-h2); color: var(--tx); }
.getting-started__intro { margin: 0; color: var(--tx2); font-size: 14px; line-height: 1.5; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-2); }
.timeline li { display: grid; grid-template-columns: 64px 1fr; gap: var(--sp-3); align-items: baseline; font-size: 14px; color: var(--tx2); }
.timeline__at { font-size: 12px; color: var(--ac); font-weight: 600; }
.getting-started__note { margin: 0; color: var(--tx3); font-size: 12px; }
.cards--three { grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); }
.card--next h3 { color: var(--tx); font-size: var(--fs-h2); }
.card--next__body { margin: 0; color: var(--tx2); font-size: 14px; line-height: 1.5; }
.card--next__status { margin: 0; display: flex; align-items: center; gap: var(--sp-2); color: var(--tx3); font-size: 13px; }
.empty-tab { display: grid; gap: var(--sp-3); max-width: 560px; }
.empty-tab h3 { margin: 0; font-size: var(--fs-h2); }

/* ---------- cards grid ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(600px, 100%), 1fr)); gap: var(--sp-6); }
.card { padding: var(--sp-5); display: grid; gap: var(--sp-3); align-content: start; }
.card h3 { margin: 0; font-size: var(--fs-body); color: var(--tx2); font-weight: 600; }
.card .headline { font-size: var(--fs-h1); font-weight: 600; line-height: 1.25; letter-spacing: -.01em; margin: 0; }
.empty { color: var(--tx3); font-style: italic; }

/* ---------- states ---------- */
.status:empty { display: none; }
.status { background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); padding: var(--s-6); text-align: center; color: var(--fg-2); display: grid; gap: var(--s-3); justify-items: center; }
.status .btn { margin-top: var(--s-2); }
.btn { border: 1px solid var(--border); background: var(--surface); color: var(--fg); border-radius: var(--radius-pill); padding: var(--s-2) var(--s-4); cursor: pointer; font-weight: 600; font-size: var(--fs-sm); }
.btn.primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.btn:disabled { opacity: .6; cursor: default; }
.loading { color: var(--fg-3); padding: var(--s-6); text-align: center; }

/* ---------- auth pages ---------- */
/* ---------- auth pages (HANDOFF SignIn) ---------- */
body.auth { display: grid; place-items: center; min-height: 100vh; padding: var(--gutter); position: relative; overflow: hidden; }
.auth-ring { position: absolute; left: 50%; top: 50%; width: min(520px, 120vw); height: auto; transform: translate(-50%, -50%); opacity: .5; pointer-events: none; }
.auth-card { position: relative; padding: var(--sp-8); max-width: 420px; width: 100%; box-shadow: var(--shadow-panel); display: grid; gap: var(--sp-5); justify-items: start; border-radius: 20px; }
.auth-brand { display: flex; align-items: center; gap: var(--sp-3); }
.auth-mark { width: 36px; height: 36px; display: block; }
.auth-card h1 { margin: 0; font-size: 26px; font-weight: 600; letter-spacing: -.01em; }
.auth-sub { margin: 0; color: var(--tx2); font-size: 15px; line-height: 1.5; }
.auth-note { margin: 0; color: var(--tx3); font-size: 13px; }
.auth-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); }

@media (max-width: 640px) {
  .brand { font-size: var(--fs-md); }
  .page { padding: var(--sp-4) var(--gutter) var(--sp-12); gap: var(--sp-8); }
  .card .headline { font-size: var(--fs-lg); }
}

/* ---------- loop ring + stuck banner (HANDOFF §3; .loop/.stage/.edge live in tokens.css) ---------- */
.hero-left { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-5); align-content: start; }
.loop-wrap { position: relative; min-width: 0; }
/* tokens.css sizes the ring at a fixed 680px; inside a grid column that would widen the column (and push the banner under the next card). Let the column decide. */
.loop { width: 100%; max-width: 680px; }
.stage { left: 0; top: 0; }
.stage__head { display: flex; align-items: center; gap: 8px; }
.stage__name { flex: 1; }
.stage__num { font-size: 18px; font-weight: 600; }
.stage__sub { font-size: 12px; color: var(--tx3); }
.stage__headline { font-size: 13px; font-weight: 500; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.loop-core { position: absolute; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 2px; z-index: 1; }
.loop-core__value { font-size: var(--fs-hero); font-weight: 600; line-height: 1; }
.loop-core__sub { font-size: 13px; color: var(--tx2); }
.loop-rail { display: none; list-style: none; margin: 0; padding: 0; gap: var(--sp-2); }
.stage--rail { position: static; width: 100%; height: auto; }
.stuck { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); border-radius: var(--r-card); border: 1px solid var(--bad); background: var(--bad-soft); max-width: 100%; box-sizing: border-box; }
.stuck__icon { width: 28px; height: 28px; border-radius: 50%; background: var(--bad); color: var(--bad-ink); display: grid; place-items: center; font-weight: 700; flex: none; }
.stuck__text { display: flex; flex-direction: column; gap: 2px; flex: 1 1 260px; min-width: 0; font-size: 14px; color: var(--tx2); }
.stuck__text b { color: var(--tx); font-size: 15px; }
.stuck .btn--danger { flex: none; margin-left: auto; }
.stuck--ok { border-color: var(--ok); background: var(--ok-soft); color: var(--tx); font-weight: 500; }
.stuck--quiet { border-color: var(--line2); background: var(--s2); color: var(--tx2); }
.stuck--quiet .dot { background: var(--na); }
.flash { animation: flash 1.6s ease-out; }
@keyframes flash { 0% { box-shadow: 0 0 0 4px var(--ac-soft); } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (max-width: 640px) {
  .loop { display: none; }
  .loop-rail { display: grid; }
  .stuck { flex-wrap: wrap; }
  .hero-grid, .cards, .cards--three { grid-template-columns: 1fr; gap: var(--sp-4); }
}
@media (max-width: 640px) {
  /* every control is a thumb target on phones */
  .btn, .seg .btn, .menu summary, .theme-seg button, .showwork, .more-toggle, .viewtabs a { min-height: var(--tap); }
  .option__when { white-space: normal; height: auto; padding: 3px 8px; line-height: 1.3; }
}
/* accordion cards on phones (HANDOFF Mobile) */
.card--accordion { padding: 0; display: block; }
.card__summary { list-style: none; cursor: pointer; padding: var(--sp-4) var(--sp-5); display: grid; gap: var(--sp-2); min-height: var(--tap); position: relative; }
.card__summary::-webkit-details-marker { display: none; }
.card__summary::after { content: "⌄"; position: absolute; right: var(--sp-5); top: var(--sp-4); color: var(--tx3); font-size: 18px; transition: transform .2s ease; }
.card--accordion[open] > .card__summary::after { transform: rotate(180deg); }
.card--accordion .card__body { padding: 0 var(--sp-5) var(--sp-5); display: grid; gap: var(--sp-3); }
.card--accordion .card__head { padding-right: var(--sp-6); }
@media (prefers-reduced-motion: reduce) { .flash { animation: none; } }

/* ---------- shared sheet (HANDOFF §4; .sheet/.sheet-scrim/.option in tokens.css) ---------- */
body.sheet-open { overflow: hidden; }
.sheet__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-5) var(--sp-5) var(--sp-4); border-bottom: 1px solid var(--line); }
.sheet__titles { display: grid; gap: 4px; }
.sheet__titles h2 { margin: 0; font-size: var(--fs-h1); font-weight: 600; outline: none; }
.sheet__titles h2:focus-visible { outline: 2px solid var(--ac); outline-offset: 4px; border-radius: 4px; }
.sheet__sub { margin: 0; color: var(--tx2); font-size: 14px; }
.sheet__close { min-width: var(--tap); padding: 0; }
.sheet__body { padding: var(--sp-5); overflow: auto; flex: 1; display: grid; gap: var(--sp-4); align-content: start; }
.sheet__hint { margin: 0; color: var(--tx2); font-size: 14px; }
.options { display: grid; gap: var(--sp-2); }
.option__label { font-weight: 600; font-size: 15px; }
.option__what { color: var(--tx2); font-size: 14px; line-height: 1.4; }
.option__when { margin-top: 4px; }
.sheet__foot { padding: var(--sp-4) var(--sp-5) var(--sp-5); border-top: 1px solid var(--line); display: grid; gap: var(--sp-2); }
.sheet__next { margin: 0; font-size: 14px; color: var(--tx); }
.sheet__buttons { display: flex; gap: var(--sp-2); margin-top: var(--sp-2); }
.sheet-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: var(--sp-3); margin: 0; }
.sheet-meta dt { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--tx3); }
.sheet-meta dd { margin: 4px 0 0; display: flex; flex-wrap: wrap; gap: 4px; font-size: 14px; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--r-btn); }
.evidence-table th, .evidence-table td { white-space: nowrap; max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
.evidence-table thead th { position: sticky; top: 0; background: var(--s2); text-transform: capitalize; }
.sql summary { cursor: pointer; color: var(--tx3); font-size: 13px; }
.sql pre { background: var(--s2); border-radius: var(--r-btn); padding: var(--sp-3); overflow: auto; font-family: var(--font-mono); font-size: 12px; }
.showwork { background: none; border: 0; color: var(--ac); cursor: pointer; padding: 0; font-weight: 600; font-size: 13px; justify-self: start; min-height: var(--tap); }
.tables { display: grid; gap: var(--sp-3); }
.loading { color: var(--tx3); padding: var(--sp-6); text-align: center; }
@media (max-width: 640px) { .sheet { width: 100%; } }

/* ---------- card head + proposal rows (HANDOFF §4) ---------- */
.card__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3); }
.card__head h3 { display: flex; align-items: center; gap: var(--sp-2); }
.card__head .showwork { min-height: 0; flex: none; }
.proposal { display: grid; gap: 6px; }
.proposal__head { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.proposal__title { font-size: 15px; font-weight: 600; }
.proposal__why { margin: 0; font-size: 14px; color: var(--tx2); }
.proposal__evidence { margin: 0; font-size: 12px; color: var(--tx3); }
.proposal__on { margin: 0; font-size: 13px; color: var(--tx2); }
.proposal__on b { color: var(--tx); font-weight: 600; }
.more-toggle { justify-self: start; }

/* ---------- question cards (HANDOFF §5) ---------- */
.items { list-style: none; margin: 0; padding: 0; display: grid; }
.item { display: grid; gap: 4px; padding: var(--sp-3) 0; border-top: 1px solid var(--line); }
.items > .item:first-child { border-top: 0; padding-top: 0; }
.items.more > .item:first-child { border-top: 1px solid var(--line); padding-top: var(--sp-3); }
.item-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px var(--sp-2); }
.item-label { font-weight: 600; font-size: 15px; }
.item-value { color: var(--tx2); font-size: 14px; }
.item-delta { font-size: 13px; }
.delta-good { color: var(--ok); } .delta-bad { color: var(--bad); }
.item-sub { margin: 0; color: var(--tx3); font-size: 13px; }
.item-link { font-size: 13px; }
.item-quote { display: block; font-style: italic; color: var(--tx2); font-size: 14px; }
.item-quote::before, .item-quote::after { color: var(--tx3); }
.ghost { display: grid; gap: var(--sp-2); padding: var(--sp-2) 0; }
.ghost__bar { display: block; height: 10px; border-radius: 999px; background: var(--s3); }
.more[hidden] { display: none; }
.item.flash { border-radius: var(--r-btn); }

/* ---------- detail routes (HANDOFF Acquisition) ---------- */
.route { display: grid; gap: var(--sp-6); }
.route__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--sp-2) var(--sp-4); }
.route__head .section-title { margin: 0; }
.tabs { display: grid; gap: var(--sp-3); }
.tabstrip { display: flex; gap: var(--sp-1); flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.tab { border: 0; background: transparent; padding: var(--sp-2) var(--sp-3); border-bottom: 2px solid transparent; margin-bottom: -1px; color: var(--tx2); cursor: pointer; font-weight: 600; font-size: 13px; display: inline-flex; gap: var(--sp-2); align-items: center; min-height: var(--tap); }
.tab[aria-selected="true"] { color: var(--tx); border-bottom-color: var(--ac); }
.tab-empty { color: var(--tx3); }
.tabpanel { display: grid; gap: var(--sp-8); }
.block { display: grid; gap: var(--sp-3); }
.block h3 { margin: 0; font-size: var(--fs-h2); font-weight: 600; }
.block__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-2) var(--sp-4); }
.block__head .hint { margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.chips .btn { min-height: 36px; font-size: 13px; }
.chart { position: relative; height: 240px; background: var(--s1); border: 1px solid var(--line); border-radius: var(--r-card); padding: var(--sp-3); }
.chart canvas { width: 100% !important; height: 100% !important; }
.tbl caption { text-align: left; caption-side: top; padding: 0 0 var(--sp-2); color: var(--tx3); font-size: 13px; }
.tbl th[scope="row"] { font-weight: 500; color: var(--tx); }
.muted { color: var(--tx3); font-style: italic; }
.sr { position: absolute; left: -9999px; }

/* ---------- scoreboard: expandable rows ---------- */
.scoreboard tbody tr[data-ad] { cursor: pointer; }
.scoreboard tbody tr[data-ad]:hover, .scoreboard tbody tr[data-ad]:focus-visible { background: var(--s2); outline: none; }
.scoreboard tbody tr.is-open td { background: var(--s2); border-bottom-color: transparent; }
.scoreboard .row-killed td { color: var(--tx3); }
.scoreboard tr.row-detail td { background: var(--s2); padding: 0 12px 14px; }
.detail { display: grid; gap: var(--sp-3); padding: var(--sp-3); border: 1px solid var(--line); border-radius: var(--r-opt); background: var(--s1); white-space: normal; }
.detail__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: var(--sp-3); }
.detail__field { display: grid; gap: 2px; }
.detail__k { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--tx3); }
.detail__v { font-size: 14px; }
.detail__mark { margin: 0; font-size: 14px; color: var(--tx2); }
.detail__costs { display: flex; flex-wrap: wrap; gap: var(--sp-4); }
.detail__cost { display: grid; gap: 2px; }
.detail__cost b { font-size: 16px; font-weight: 600; }
.sortbtn { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; font-weight: 600; min-height: 24px; }
.winners-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--sp-4); }
.winner h4 { margin: 0 0 var(--sp-2); font-size: 12px; color: var(--tx3); text-transform: uppercase; letter-spacing: .08em; }
.winners tr.best th .tag { margin-left: var(--sp-2); }
.winners tr.thin td, .winners tr.thin th { color: var(--tx3); }

/* ---------- experiments (HANDOFF Experiments) ---------- */
.exp-grid { display: grid; gap: var(--sp-4); }
.exp { gap: var(--sp-4); }
.exp-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--sp-2) var(--sp-4); }
.exp-titles { display: grid; gap: 4px; }
.exp h4 { margin: 0; font-size: var(--fs-h2); font-weight: 600; }
.exp-sub { margin: 0; color: var(--tx2); font-size: 14px; }
.exp-verdict { display: grid; grid-template-columns: auto 1fr; gap: 2px var(--sp-3); align-items: baseline; }
.exp-verdict__pct { font-size: var(--fs-hero); font-weight: 600; line-height: 1; grid-row: span 2; color: var(--ok); }
.exp-verdict__text { font-size: 15px; font-weight: 500; }
.exp-verdict__note { font-size: 13px; color: var(--tx3); }
.exp-result { margin: 0; color: var(--tx2); font-size: 14px; }
.arms tr.control th { color: var(--tx2); }
.arms .tag { margin-left: var(--sp-2); }
.learnings { margin: 0; padding-left: var(--sp-5); display: grid; gap: var(--sp-2); color: var(--tx); font-size: 15px; }
.finished th[scope="row"] { white-space: normal; }

/* ---------- factory health (HANDOFF Health) ---------- */
.health { display: grid; gap: var(--sp-6); }
.jobgrid th.c, .jobgrid td.c { text-align: center; width: 44px; }
.jobgrid th.today { color: var(--ac); }
.jobgrid .stage-row th { background: var(--s2); color: var(--tx3); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; padding: 6px 12px; }
.jobgrid td.cell { cursor: pointer; }
.jobgrid td.cell[tabindex="-1"] { cursor: default; }
.jobgrid td.cell:focus-visible { outline: 2px solid var(--ac); outline-offset: -2px; }
.glyph { font-weight: 600; font-size: 13px; }
.cell-ok .glyph { color: var(--ok); } .cell-error .glyph { color: var(--bad); } .cell-skipped .glyph { color: var(--tx3); } .cell-missing .glyph { color: var(--warn); } .cell-na .glyph { color: var(--line2); }
.cell-last, .cell-note { color: var(--tx3); font-size: 12px; white-space: nowrap; }
.legend { display: flex; gap: var(--sp-3); flex-wrap: wrap; margin: 0; }
.legend-item { display: inline-flex; align-items: center; gap: 4px; }
.two-up { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr)); gap: var(--sp-4); }
.held { color: var(--warn); font-weight: 600; margin: 0; font-family: var(--font-mono); font-size: 13px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--sp-3); margin: 0; }
.stats dt { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--tx3); font-weight: 600; }
.stats dd { margin: 2px 0 0; font-size: 28px; font-weight: 600; }
.stats .hint { font-size: 12px; }
.operator-details { border-top: 1px dashed var(--line); padding-top: var(--sp-3); display: grid; gap: var(--sp-3); }
.operator-details summary { cursor: pointer; color: var(--tx3); font-weight: 600; min-height: var(--tap); display: flex; align-items: center; }
.operator-details h4 { margin: 0; font-size: 13px; color: var(--tx2); }
.kits { margin: 0; padding-left: var(--sp-5); color: var(--tx2); font-size: 13px; }
.code { font-family: var(--font-mono); font-size: 12px; background: var(--s2); border-radius: 6px; padding: 2px 8px; }
tr.stale td, tr.stale th { color: var(--fg-3); }
.item-quote { display: block; font-style: italic; color: var(--fg-2); }
