/* House tokens and layout for the starter dashboard.
   This is the ONE file that carries literal values: the house (studio) defaults every client starts from. A client's
   own colours and fonts arrive at runtime from clients/<id>.json and override the custom properties below; no client
   value is ever written here. Look: design lab 2026-11-27 "D" (warm paper, white cards, version-coloured cards and
   tinted header bands, soft green only on the best value). System sans only, nothing under 12px, no serif.
   Patterns borrowed (not code): see NOTICE. */

:root {
  color-scheme: light;
  --bg: #F7F5F2; --card: #ffffff; --box: #FBFAF8; --ink: #22211E; --body: #4F4E49; --muted: #5F5E58; --faint: #8D8980;
  --line: #E4DFD9; --track: #EFEBE5; --seg: #ECE8E2;
  --accent: #22211E; --on-accent: #ffffff;
  --good: #2E7D57; --good-soft: #DCEEE4; --good-tint: #EEF7F1; --good-ink: #1B5238;
  --bad: #8A2E12; --bad-soft: #FBE1D8; --warn-soft: #F8EDD8; --warn-ink: #6B4A0E; --focus: #3B6BC9;
  /* version identity, fixed order (control first): navy, amber, then the rest; clients override with colors.arms */
  --a0: #1E3A5F; --a1: #C7862A; --a2: #6B4FA3; --a3: #2C8A7E; --a4: #B4505E; --a5: #4A7FB5; --a6: #6E8B3D; --a7: #8C6A4F;
  --f-display: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --f-body: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --f-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  --r: 16px; --pad: 40px;
}

* { box-sizing: border-box; margin: 0; padding: 0 }
html { overflow-y: scroll; scrollbar-gutter: stable; -webkit-text-size-adjust: 100% }
body { background: var(--bg); color: var(--ink); font: 15px/1.45 var(--f-body); -webkit-font-smoothing: antialiased; overflow-x: clip }
button, input, select { font: inherit; color: inherit }
button { cursor: pointer }
a { color: inherit }
[hidden] { display: none !important }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px }
.num, td, .big, .mv, .mid { font-variant-numeric: tabular-nums }
.muted { color: var(--muted) }
small { font-size: 12.5px }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0 }

/* a version wears its colour: --vc is set per element (style="--vc:var(--aN)"), the soft band, tint and ink follow */
.v { --vsoft: color-mix(in srgb, var(--vc) 15%, #fff); --vtint: color-mix(in srgb, var(--vc) 5%, #fff); --vink: color-mix(in srgb, var(--vc) 64%, #000) }

/* sign-in (served before the password, so it names no client) */
/* Sign-in (design option 4, Dom 2026-11-28): dark panel with the client's name large, form on the right. CSS only. */
body.gate { min-height: 100vh; display: flex; margin: 0; background: #fff; color: #1d1c1a }
.gate-side { flex: 1; display: flex; flex-direction: column; justify-content: space-between; padding: 48px; color: #fff;
  background: radial-gradient(1.5px 1.5px at 12% 18%, rgba(255,255,255,0.9) 50%, transparent 51%),radial-gradient(1px 1px at 27% 72%, rgba(255,255,255,0.7) 50%, transparent 51%),radial-gradient(1.5px 1.5px at 41% 9%, rgba(255,255,255,0.6) 50%, transparent 51%),radial-gradient(1px 1px at 63% 83%, rgba(255,255,255,0.8) 50%, transparent 51%),radial-gradient(1.5px 1.5px at 78% 22%, rgba(255,255,255,0.9) 50%, transparent 51%),radial-gradient(1px 1px at 88% 61%, rgba(255,255,255,0.6) 50%, transparent 51%),radial-gradient(1px 1px at 6% 52%, rgba(255,255,255,0.5) 50%, transparent 51%),radial-gradient(1px 1px at 54% 38%, rgba(255,255,255,0.35) 50%, transparent 51%),radial-gradient(1px 1px at 33% 44%, rgba(255,255,255,0.4) 50%, transparent 51%),radial-gradient(1.5px 1.5px at 92% 88%, rgba(255,255,255,0.7) 50%, transparent 51%), radial-gradient(rgba(255,255,255,.05) 1px, transparent 1px) 0 0 / 22px 22px, #0b0b0e }
.gate-side b { margin-top: auto; margin-bottom: auto; font-family: var(--f-display); font-size: clamp(40px, 5vw, 64px); font-weight: 700; letter-spacing: -.03em; line-height: 1 }
.gate-side small { font-size: 13px; opacity: .55 }
.gate-main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 32px }
.gate-card { width: min(380px, 100%) }
.gate-client { display: none; font-size: 15px; font-weight: 600; color: #6a6760; margin-bottom: 6px }
.gate-card h1 { font-family: var(--f-display); font-weight: 700; font-size: 32px; letter-spacing: -.02em; line-height: 1.1; margin: 0 0 22px }
.gate-card input { width: 100%; font-size: 16px; padding: 13px 15px; border-radius: 10px; margin-bottom: 12px; background: #fff; border: 1px solid #dcd7cf; color: #1d1c1a; outline: none }
.gate-card input:focus { border-color: #1d1c1a; box-shadow: 0 0 0 3px rgba(0,0,0,.06) }
.gate-card button { width: 100%; display: flex; align-items: center; justify-content: space-between; font-weight: 600; font-size: 15px;
  padding: 13px 16px; border: 0; border-radius: 9px; background: #0b0b0e; color: #fff; cursor: pointer }
.gate-card button::after { content: "\2192"; font-size: 17px }
.gate-err { color: #b3261e; font-size: 14px; margin: -8px 0 14px }

/* moving stars: two layers drifting at different speeds, the nearer one twinkles. Off for people who ask for less motion. */
.gate-side { position: relative; overflow: hidden }
.gate-side > * { position: relative; z-index: 1 }
.gate-side::before, .gate-side::after { content: ""; position: absolute; inset: -60%; pointer-events: none }
.gate-side::before { background-image: radial-gradient(1px 1px at 20px 30px, rgba(255,255,255,0.9) 50%, transparent 51%),radial-gradient(1px 1px at 140px 80px, rgba(255,255,255,0.7) 50%, transparent 51%),radial-gradient(1.5px 1.5px at 90px 190px, rgba(255,255,255,0.9) 50%, transparent 51%),radial-gradient(1px 1px at 210px 150px, rgba(255,255,255,0.6) 50%, transparent 51%),radial-gradient(1px 1px at 60px 120px, rgba(255,255,255,0.5) 50%, transparent 51%),radial-gradient(1.5px 1.5px at 180px 20px, rgba(255,255,255,0.8) 50%, transparent 51%),radial-gradient(1px 1px at 30px 220px, rgba(255,255,255,0.6) 50%, transparent 51%),radial-gradient(1px 1px at 120px 240px, rgba(255,255,255,0.7) 50%, transparent 51%); background-size: 260px 260px; opacity: .55; animation: gate-drift 160s linear infinite }
.gate-side::after { background-image: radial-gradient(1.5px 1.5px at 40px 60px, rgba(255,255,255,0.9) 50%, transparent 51%),radial-gradient(1px 1px at 300px 40px, rgba(255,255,255,0.8) 50%, transparent 51%),radial-gradient(2px 2px at 200px 260px, rgba(255,255,255,0.9) 50%, transparent 51%),radial-gradient(1px 1px at 330px 300px, rgba(255,255,255,0.6) 50%, transparent 51%),radial-gradient(1.5px 1.5px at 120px 340px, rgba(255,255,255,0.7) 50%, transparent 51%),radial-gradient(1px 1px at 250px 140px, rgba(255,255,255,0.5) 50%, transparent 51%); background-size: 380px 380px; animation: gate-drift-far 90s linear infinite, gate-twinkle 5s ease-in-out infinite }
@keyframes gate-drift { to { transform: translate(-260px, -130px) } }
@keyframes gate-drift-far { to { transform: translate(-380px, 190px) } }
@keyframes gate-twinkle { 0%, 100% { opacity: .35 } 50% { opacity: .9 } }
@media (prefers-reduced-motion: reduce) { .gate-side::before, .gate-side::after { animation: none } }
/* v2 centred (Dom 2026-11-28 20:15): name and line centred together, line bigger and white */
.gate-side { align-items: center; justify-content: center; text-align: center }
.gate-side b { margin: 0 }
.gate-side small { margin-top: 18px; font-size: 20px; font-weight: 500; opacity: 1; color: #fff; letter-spacing: -.01em }
@media (max-width: 760px) { .gate-side { display: none } .gate-client { display: block } }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted) }

/* ---------------------------------------------------------------- header: two rows, sticky, fixed height */
.hdr { position: sticky; top: 0; z-index: 20; background: var(--card); border-bottom: 1px solid var(--line) }
.hrow { max-width: 1280px; margin: 0 auto; padding: 0 var(--pad); display: flex; align-items: center; gap: 10px; height: 84px; white-space: nowrap }
.hrow2w { background: var(--bg); border-top: 1px solid var(--line) }
.hrow2w .hrow { height: 68px }
.title { margin-right: 12px; flex: 0 100 auto; min-width: 150px; max-width: 34%; overflow: hidden }
.title b { display: block; font-family: var(--f-display); font-size: 22px; font-weight: 700; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis }
.title small { display: block; color: var(--muted); font-size: 13px; margin-top: 3px; overflow: hidden; text-overflow: ellipsis }
.sp { flex: 1 }
.seg { display: inline-flex; background: var(--seg); border-radius: 999px; padding: 4px; gap: 2px; flex: none }
.seg button { border: 0; background: transparent; border-radius: 999px; padding: 8px 16px; font-weight: 600; font-size: 14px; white-space: nowrap; color: var(--ink) }
.seg button:hover { background: rgba(255, 255, 255, .7) }
.seg button.on, .seg button.on:hover { background: var(--accent); color: var(--on-accent) }
.seg button:disabled { opacity: .45; cursor: default }
.seg.sm button { padding: 6px 13px; font-size: 13.5px }
select.drop { appearance: none; -webkit-appearance: none; border: 0; background: var(--seg) no-repeat; border-radius: 999px; padding: 10px 34px 10px 16px; font-size: 14px; font-weight: 600; max-width: 150px; flex: 0 1 auto; min-width: 0; text-overflow: ellipsis; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 19px) 52%, calc(100% - 14px) 52%; background-size: 5px 5px }
.pages { display: flex; gap: 8px; align-items: center; min-width: 0; overflow: hidden; flex: 0 1 auto; padding: 2px 0 }
.seg, .asof, select.drop { flex-shrink: 0 }
.open { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; text-decoration: none; white-space: nowrap; color: #fff; background: var(--vc); border-radius: 999px; padding: 9px 16px; box-shadow: 0 1px 2px rgba(0, 0, 0, .12); max-width: 240px; min-width: 0; flex: 0 0 auto }
.pages.many .open { padding: 9px 13px }
.open span { overflow: hidden; text-overflow: ellipsis }
.open:hover { filter: brightness(1.08) }
body:not(.testview) .pages, body:not(.testview) #pick { visibility: hidden }
.asof { display: inline-flex; align-items: center; gap: 8px; background: var(--good-soft); color: var(--good-ink); border-radius: 999px; padding: 8px 14px; font-size: 12.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; flex: none }
.asof::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor }
.asof.wait { background: var(--seg); color: var(--muted) }
.lbl { margin-right: 2px; font-size: 12px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); white-space: nowrap }
.lbl + .seg { margin-left: 0 }
.lbl.gap { margin-left: 18px }
.dpbtn { display: inline-flex; align-items: center; gap: 8px; border: 1.5px solid var(--line); background: var(--card); border-radius: 999px; padding: 8px 16px 8px 14px; font-size: 14px; font-weight: 600; white-space: nowrap; flex: none; min-width: 150px }
.dpbtn svg { flex: none; color: var(--muted) }
.dpbtn:hover { border-color: var(--faint) }
.dpbtn.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent) }
.dpbtn.on svg { color: var(--on-accent) }
.csv { border: 1.5px solid var(--line); background: var(--card); border-radius: 999px; padding: 7px 16px; font-size: 14px; font-weight: 600; color: var(--ink); text-decoration: none; flex: none }
.csv:hover { border-color: var(--faint) }
.pill { display: inline-block; font: 600 12px/1 var(--f-mono); background: var(--seg); color: var(--muted); border-radius: 6px; padding: 4px 6px; vertical-align: 2px; margin-left: 6px; letter-spacing: 0; text-transform: none }

/* date picker: the popover hangs from the header (not from the row, which may scroll sideways on a phone) */
.dppop { position: absolute; top: 100%; left: 0; margin-top: -8px; z-index: 30; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 14px 36px rgba(0, 0, 0, .14); padding: 16px; width: 300px }
.calhead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px }
.calhead b { font-size: 15px; font-weight: 700; color: var(--ink) }
.calhead .nav { width: 32px; height: 32px; border: 1.5px solid var(--line); background: var(--card); border-radius: 999px; font-size: 18px; line-height: 1; color: var(--ink); display: inline-flex; align-items: center; justify-content: center; padding: 0 0 2px }
.calhead .nav:hover:not(:disabled) { border-color: var(--faint) }
.calhead .nav:disabled { opacity: .35; cursor: default }
.caldow, .calgrid { display: grid; grid-template-columns: repeat(7, 1fr); row-gap: 2px }
.caldow span { text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); padding: 4px 0 6px }
.calgrid { min-height: 228px; grid-auto-rows: 36px; align-content: start }   /* 6 week rows reserved: the popup never changes height */
.calgrid button { border: 0; background: none; font-size: 14px; color: var(--ink); height: 36px; border-radius: 0; position: relative; font-weight: 500 }
.calgrid button:hover:not(:disabled) { background: var(--seg) }
.calgrid button:disabled { color: #B9B4AC; cursor: default }
.calgrid button.mid, .calgrid button.pv { background: var(--seg) }
.calgrid button.st, .calgrid button.en, .calgrid button.st:hover:not(:disabled), .calgrid button.en:hover:not(:disabled) { background: var(--accent); color: var(--on-accent) }
.calgrid button.st { border-radius: 999px 0 0 999px } .calgrid button.en { border-radius: 0 999px 999px 0 }
.calgrid button.st.en { border-radius: 999px }
.calgrid button.pv { border-radius: 0 999px 999px 0 }
.calsel { font-size: 13px; color: var(--muted); margin: 8px 0 12px; min-height: 18px }
.dppop .row { display: flex; gap: 8px; justify-content: flex-end }
.dppop button.go { border: 0; background: var(--accent); color: var(--on-accent); border-radius: 999px; padding: 8px 18px; font-weight: 600; font-size: 14px }
.dppop button.go:disabled { opacity: .4; cursor: default }
.dppop button.ghost { border: 1.5px solid var(--line); background: var(--card); border-radius: 999px; padding: 7px 16px; font-weight: 600; font-size: 14px }

/* the floating hint under the header: takes no room */
.hint { position: absolute; left: 50%; top: 100%; margin-top: 8px; z-index: 25; font-size: 13px; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 5px 14px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .08); opacity: 0; transform: translate(-50%, -3px); transition: opacity .15s, transform .15s; pointer-events: none; white-space: nowrap }
.hint.on { opacity: 1; transform: translate(-50%, 0) }
.hint:empty { display: none }

/* ---------------------------------------------------------------- page and cards */
.wrap { max-width: 1280px; margin: 0 auto; padding: 36px var(--pad) 80px }
section.view { transition: opacity .15s ease }
body.busy section.view { opacity: .55; transition-delay: .12s }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 36px 40px; margin-top: 28px }
.view > .card:first-child { margin-top: 0 }
.sh { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px 20px; flex-wrap: wrap; margin-bottom: 22px }
h2 { font-family: var(--f-display); font-size: 24px; font-weight: 700; letter-spacing: -.015em; line-height: 1.2 }
.lead { color: var(--muted); font-size: 15px; margin-top: 6px; max-width: 760px }
.note { color: var(--muted); font-size: 13.5px; line-height: 1.5 }
.note b { color: var(--ink) }
.state { padding: 18px 0; color: var(--muted); font-size: 15px }
.state.err { color: var(--bad) }
.info { display: inline-flex; width: 20px; height: 20px; border: 1.5px solid var(--faint); border-radius: 50%; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: var(--muted); vertical-align: 3px; margin-left: 8px; cursor: help; font-family: var(--f-body); letter-spacing: 0 }
button.info { background: none; padding: 0; line-height: 1; text-transform: none; flex: none }
.tscroll { overflow-x: auto; -webkit-overflow-scrolling: touch }
.foot { margin-top: 24px }

/* verdict */
.verdict { font-size: 21px; font-weight: 600; line-height: 1.4; max-width: 920px; margin: -4px 0 26px; letter-spacing: -.01em }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: -10px 0 26px }
.chips:empty { display: none }
.fc { display: inline-flex; align-items: center; gap: 6px; background: var(--seg); border-radius: 999px; padding: 6px 12px; font-size: 13.5px; font-weight: 500; color: var(--ink) }
.fc b { font-weight: 700 }
.fc.ok { background: var(--good-soft); color: var(--good-ink) }
.fc.bad { background: var(--bad-soft); color: var(--bad) }
.vgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 18px }
.vcard { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--card); min-width: 0 }
.vhead { background: var(--vsoft); padding: 14px 22px; display: flex; justify-content: space-between; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); min-height: 66px }   /* room for a two-line name: every card's rows start at the same height */
.vhead .nm { font-size: 13.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--vink); min-width: 0; line-height: 1.35; display: flex; align-items: center }
.vhead .nmt { min-width: 0; overflow: hidden; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical }
.vhead .nm .pill { flex: none }
.vhead .nm .pill { background: rgba(255, 255, 255, .7); color: var(--vink) }
.tag { font-size: 12.5px; font-weight: 600; color: var(--vink); background: rgba(255, 255, 255, .65); border: 1px solid rgba(0, 0, 0, .08); border-radius: 999px; padding: 4px 10px; white-space: nowrap; flex: none }
.vbody { padding: 22px 22px 24px }
.mi { display: grid; grid-template-columns: minmax(0, 1fr) auto 72px; align-items: center; gap: 12px; padding: 13px 0; border-top: 1px solid var(--line) }
.mi:first-child { border-top: 0; padding-top: 2px; padding-bottom: 16px }
.ml { font-size: 14.5px; font-weight: 600; color: var(--ink) }
.ml small { display: block; font-size: 12.5px; font-weight: 500; color: var(--muted); margin-top: 1px }
.mv { font-size: 20px; font-weight: 700; letter-spacing: -.015em; text-align: right; white-space: nowrap }
.mi:first-child .mv { font-size: 40px; letter-spacing: -.03em; line-height: 1 }
.mi:first-child .ml { font-size: 15px }
.mp { text-align: right }
.mp em, .pillg { display: inline-block; font-style: normal; background: var(--good-soft); color: var(--good-ink); font-weight: 700; font-size: 13px; border-radius: 999px; padding: 4px 10px; white-space: nowrap; font-variant-numeric: tabular-nums }
.vfoot { margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px }

.prob { margin: 40px auto 4px; padding-top: 36px; border-top: 1px solid var(--line); text-align: center; max-width: 820px }
.prob h3 { font-size: 18px; font-weight: 700; margin-bottom: 22px }
.pbar { position: relative; height: 14px; border-radius: 7px; max-width: 760px; margin: 0 auto;
  background: linear-gradient(90deg, var(--c0) 0%, color-mix(in srgb, var(--c0) 42%, #fff) 40%, #ECE6DB 50%, color-mix(in srgb, var(--c1) 50%, #fff) 62%, var(--c1) 100%) }
.pbar .mk { position: absolute; top: -6px; width: 4px; height: 26px; background: var(--ink); border-radius: 2px; margin-left: -2px; box-shadow: 0 0 0 2px #fff }
.pbar .mid0 { position: absolute; left: 50%; top: 0; bottom: 0; width: 1.5px; background: rgba(0, 0, 0, .25) }
.plab { display: flex; justify-content: space-between; gap: 12px; max-width: 760px; margin: 12px auto 0; font-size: 13px; font-weight: 600 }
.plab .l { color: color-mix(in srgb, var(--c0) 64%, #000); text-align: left } .plab .r { color: color-mix(in srgb, var(--c1) 64%, #000); text-align: right } .plab .c { color: var(--muted); font-weight: 500 }
td.faded .meterbar, td.faded > b { opacity: .45 }
.cc { min-width: 220px }
.ctone { --cc: #C2371F; --cs: #FBE1D8; --ci: #8A2E12 }
.cbar { display: flex; align-items: center; gap: 12px }
.ctone.yellow { --cc: #E0A21B; --cs: #F8EDD8; --ci: #6B4A0E }
.ctone.green { --cc: var(--good); --cs: var(--good-soft); --ci: var(--good-ink) }
.cbar .cnum { font-size: 22px; font-weight: 800; line-height: 1; color: var(--ci); font-variant-numeric: tabular-nums; min-width: 2.2ch; text-align: right }
.ctrack { flex: 1; height: 12px; border-radius: 6px; background: var(--track); overflow: hidden } .ctrack i { display: block; height: 100%; border-radius: 6px; background: var(--cc) }
.clab { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; margin-top: 8px }
.clab b { border-radius: 999px; padding: 3px 10px; font-size: 13px; font-weight: 700; background: var(--cs, var(--track)); color: var(--ci, var(--ink)) }
.clab small { display: block; color: var(--muted); font-size: 12.5px }
.prob p { margin-top: 22px; color: var(--muted); font-size: 15px }

/* tables */
table { width: 100%; border-collapse: collapse }
th { text-align: left; font-size: 13.5px; font-weight: 700; color: var(--ink); padding: 0 12px 12px; border-bottom: 1.5px solid var(--ink); vertical-align: bottom; white-space: nowrap }
th small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; white-space: normal }
td { padding: 14px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: 15px }
tbody tr:last-child td { border-bottom: 0 }
th:first-child, td:first-child { padding-left: 0 } th:last-child, td:last-child { padding-right: 0 }
td.n, th.n { text-align: right; white-space: nowrap }
td small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px }
td.best { background: var(--good-tint); color: var(--good-ink); font-weight: 700 }
td.best small { color: var(--good-ink); font-weight: 500 }
th:first-child.best, td:first-child.best { padding-left: 12px }
th.sort { cursor: pointer; user-select: none }
th.sort .sortbtn { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; font: inherit; color: inherit }
th.sort .sortbtn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 3px }
th.sort .ar { color: var(--faint); font-weight: 500 }
th.sort.on .ar { color: var(--ink) }
.st { display: inline-block; border-radius: 999px; padding: 3px 10px; font-size: 12.5px; font-weight: 700; white-space: nowrap }
.st.live { background: color-mix(in srgb, var(--a0) 15%, #fff); color: color-mix(in srgb, var(--a0) 64%, #000) }
.st.won { background: var(--good-soft); color: var(--good-ink) }
.st.early { background: var(--seg); color: var(--muted) }
.vdot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--vc); margin-right: 8px; vertical-align: 0; flex: none }
#tt td { white-space: nowrap } #tt td:first-child { white-space: normal; min-width: 280px }
tr.click { cursor: pointer } tr.click:hover td { background: var(--box) } tr.click:hover td.best { background: var(--good-tint) }
.tlink { text-decoration: none } .tlink:hover b { text-decoration: underline }

/* what people bought */
.ctl { display: flex; gap: 10px; flex-wrap: wrap }
.mixgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 18px; margin-bottom: 26px }
.mixgrid .vbody { display: flex; gap: 12px 40px; flex-wrap: wrap; align-items: flex-start }
.mixgrid .brk { flex-basis: 100%; height: 0 }
.mid { font-size: 28px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15 }
.mid.sm { font-size: 22px; margin-top: 12px }
.cap { color: var(--muted); font-size: 14px; margin-top: 6px }
.legend { display: flex; gap: 8px 18px; flex-wrap: wrap; margin-bottom: 10px; font-size: 13.5px; font-weight: 600; color: var(--muted) }
.legend span { display: inline-flex; align-items: center }
.mrow { display: grid; grid-template-columns: 240px minmax(0, 1fr) 80px; gap: 14px; align-items: center; padding: 9px 0; border-top: 1px solid var(--track) }
.legend + .mrow { border-top: 0 }
.mrow .nm { font-weight: 600; font-size: 15px; line-height: 1.3; min-width: 0; overflow-wrap: anywhere }
.mrow .nm small { display: block; font-weight: 500; color: var(--muted); font-size: 13px }
.mbars { display: flex; flex-direction: column; gap: 5px }
.mbars .t { height: 12px; background: var(--track); border-radius: 6px; overflow: hidden }
.mbars .t i { display: block; height: 100%; border-radius: 6px; background: var(--vc); min-width: 2px }
.mvals { text-align: right; font-size: 14px; line-height: 17px; font-variant-numeric: tabular-nums }
.mvals span { display: block; font-weight: 700; color: var(--vink) }
.heat { display: inline-block; min-width: 84px; text-align: right; border-radius: 8px; padding: 5px 10px; font-weight: 600; color: var(--ink) }
.sh2 { display: inline-block; min-width: 56px; margin-left: 8px; color: var(--muted); font-size: 13px }

/* new vs returning */
.nrtop { padding-bottom: 18px; border-bottom: 1px solid var(--line) }
.bigrow { display: flex; align-items: center; gap: 14px; flex-wrap: wrap }
.big { font-size: 46px; font-weight: 700; letter-spacing: -.03em; line-height: 1; color: var(--ink) }
.nrgrid { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line) }
.nrgrid > div { padding: 16px 0; min-width: 0 }
.nrgrid > div + div { border-left: 1px solid var(--line); padding-left: 20px }
.nrl { font-size: 12.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--vink); margin-bottom: 8px }
.nrgrid > div + div .nrl { color: var(--muted) }
.nrbar { display: flex; margin-top: 16px; height: 36px; border-radius: 9px; overflow: hidden; background: var(--vsoft); font-size: 13px }
.nrbar span { display: flex; align-items: center; gap: 5px; padding: 0 12px; white-space: nowrap; flex: none }
.nrbar .n { background: var(--vc); color: #fff; overflow: hidden; min-width: 0 }
.nrbar .r { color: var(--vink) }
.nrbar b { font-size: 15px; font-weight: 700 }

/* folds */
details.card { padding: 0 }
details.card > summary { list-style: none; cursor: pointer; padding: 24px 40px; display: flex; justify-content: space-between; align-items: center; gap: 12px }
details.card > summary::-webkit-details-marker { display: none }
details.card > summary::after { content: 'Show'; font-size: 13.5px; font-weight: 600; color: var(--muted); border: 1.5px solid var(--line); border-radius: 999px; padding: 5px 14px; flex: none }
details.card[open] > summary::after { content: 'Hide' }
details.card > summary h2 { font-size: 20px }
details.card > summary h2 .upd { font-size: 13px; font-weight: 600; color: var(--muted); margin-left: 8px; white-space: nowrap }
details.card .in { padding: 0 40px 32px }
.fctl { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px }
.ftab td small { white-space: nowrap }
.ftab td b { font-size: 17px }
.flowhead { display: grid; border-bottom: 1px solid var(--line); padding-bottom: 10px }
.flowhead span { font-size: 12.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding-left: 14px; white-space: normal }
.frow { padding: 18px 0 22px; border-bottom: 1px solid var(--line) }
.frow:last-child { border-bottom: 0 }
.fcells { display: grid }
.fcell { padding: 0 14px; border-left: 1px solid var(--line); min-width: 0 }
.fcell:first-child { border-left: 0 }
.fcell b { display: block; font-size: 24px; font-weight: 700; letter-spacing: -.02em; color: var(--vink); font-variant-numeric: tabular-nums }
.fcell > span { display: block; color: var(--muted); font-size: 13px }
.fcell em { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-style: normal; font-size: 12.5px; font-weight: 600; border-radius: 8px; padding: 3px 9px; background: var(--seg); color: var(--ink); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis }
.fcell em.bad { background: var(--bad-soft); color: var(--bad) }
.fcell em.nm2 { background: transparent; padding: 0; color: var(--ink); font-size: 13px }
.band { display: block; width: 100%; height: 90px; margin-top: 14px }
.kv { display: grid; grid-template-columns: 1fr auto }
.kv div { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14.5px }
.kv div:nth-last-child(-n+2) { border-bottom: 0 }
.kv div:nth-child(even) { text-align: right; font-weight: 600; padding-left: 12px }
.kv .ok { color: var(--good) } .kv .bad { color: var(--bad) }
.kv small { font-weight: 500 }
.meterbar { height: 8px; background: var(--track); border-radius: 4px; position: relative; overflow: hidden; margin-top: 6px; min-width: 140px; max-width: 260px }
.meterbar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--faint); border-radius: 4px }
.meterbar i.ok { background: var(--good) }
.meterbar u { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--ink) }
.up { color: var(--good); font-weight: 700 }

@media (prefers-reduced-motion: reduce) { section.view, .hint { transition: none } }

/* the header: a fixed title width on a wide screen, so the controls sit at the same x on every view; below 1240px the
   rows scroll sideways instead of clipping (every control stays reachable, no version pill is cut) */
@media (min-width: 1241px) {
  .title { flex: 0 0 276px; max-width: 276px }
  #presets button:first-child { min-width: 168px }
  .pages { flex: none; overflow: visible }
  .hdr > .hrow { gap: 8px } .asof { letter-spacing: .05em }
  .hrow { overflow-x: auto; scrollbar-width: none }   /* only a safety net: the widest rows (three pills and the test picker, or two long "Open" pills) fit */
}
@media (max-width: 1240px) {
  .hrow, .hrow2w .hrow { overflow-x: auto; scrollbar-width: none }
  .hrow::-webkit-scrollbar { display: none }
  .title { max-width: none; flex: none }
  .pages { flex: none; overflow: visible }
  .seg button { padding: 6px 12px }
  .lbl { display: none }
}
@media (max-width: 900px) {
  :root { --pad: 16px }
  .hrow, .hrow2w .hrow { height: 64px }
  /* the flow view keeps its width and scrolls sideways */
  #flow { overflow-x: auto; -webkit-overflow-scrolling: touch }
  #flow .flowhead, #flow .fcells, #flow .band { min-width: 640px }
  #flow .fcell em { white-space: normal; overflow: visible }   /* full version names and "biggest drop" wrap instead of cutting */
  .wrap { padding: 20px var(--pad) 60px }
  .card { padding: 20px }
  details.card > summary { padding: 18px 20px }
  details.card .in { padding: 0 20px 22px }
  .vgrid, .mixgrid { grid-template-columns: minmax(0, 1fr) }
  .mrow { grid-template-columns: 110px minmax(0, 1fr) 64px }
  .big { font-size: 38px }
  .verdict { font-size: 18px }
  h2 { font-size: 21px }
  .vbody { padding: 18px 16px 20px }
  .vhead { padding: 12px 16px }
  .mi { grid-template-columns: minmax(0, 1fr) auto 64px; gap: 8px }
  .mi:first-child .mv { font-size: 32px }
  .flowhead span { padding-left: 6px; font-size: 12px; letter-spacing: .04em }
  .fcell { padding: 0 6px } .fcell b { font-size: 17px } .fcell em { font-size: 12px; padding: 2px 6px }
  .hint { position: fixed; top: 10px; white-space: normal; max-width: calc(100vw - 32px) }
}
.mixgrid .pillg { white-space: normal; line-height: 1.35 }
th.wr { white-space: normal; min-width: 120px; max-width: 220px }
.vcard { container-type: inline-size }
.nrbar i { font-style: normal }
.nrbar .r { flex: 1 1 auto; min-width: 0; overflow: hidden }
@container (max-width: 430px) { .nrbar i { display: none } }
/* order size (clients with order_size): paired bars per bucket, above the products */
.sizes { margin-bottom: 30px }
.sizes h3 { font-size: 16px; font-weight: 700 }
.sizes .note { margin: 4px 0 12px }
.sizes h3.next { margin-top: 30px }
/* what they bought (clients with bought): pill-headed blocks of paired bars; a cross block groups rows by bucket */
.mnote { margin: -6px 0 6px; color: var(--muted); font-size: 12.5px }
.bblk { padding: 14px 0 6px; border-top: 1px solid var(--line) }
.legend + .bblk { border-top: 0; padding-top: 2px }
.bhd { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-bottom: 6px }
.bpill { display: inline-block; background: var(--track); color: var(--ink); font-weight: 700; font-size: 13px; border-radius: 999px; padding: 4px 11px }
.bsub { color: var(--muted); font-size: 13px }
.bgrp { font-size: 12.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 10px 0 2px }
.bgrp + .mrow { border-top: 0 }

/* product list fold (clients with a bought block, Dom 11/30): closed by default, same Show/Hide pill as the folds */
.mixfold:not(.fold) > summary { display: none }
.mixfold > summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 22px 0 10px; border-top: 1px solid var(--line); margin-top: 18px }
.mixfold > summary::-webkit-details-marker { display: none }
.mixfold > summary h3 { margin: 0 }
.mixfold > summary::after { content: 'Show'; font-size: 13.5px; font-weight: 600; color: var(--muted); border: 1.5px solid var(--line); border-radius: 9px; padding: 6px 14px }
.mixfold[open] > summary::after { content: 'Hide' }
/* what they bought, look of the first Drift page (Dom 11/30): dark pill title, small caption under it, roomier blocks */
.bblk { padding: 28px 0 14px }
.bhd { flex-direction: column; align-items: flex-start; gap: 6px; margin-bottom: 14px }
.bpill { background: var(--ink); color: var(--card); font-size: 12.5px; letter-spacing: .14em; text-transform: uppercase; padding: 8px 16px }
.bsub { font-size: 12.5px }
.bblk .mrow { border-top: 0; padding: 12px 0 }
.bblk .mrow .nm { font-weight: 700; font-size: 16px }
.bgrp { padding: 16px 0 4px }

/* 12/2: the title block gives way first when the header row is full (long subtitle), so the right-hand chips never clip */
.hdr > .hrow .title { flex: 0 1 auto; min-width: 0; overflow: hidden }
.hdr > .hrow .title small, .hdr > .hrow .title b { display: block; overflow: hidden; text-overflow: ellipsis }
#vlogNote { margin-top: 6px }
/* Header (Dom 12/2): one line each from 1300px (labels hidden, smaller date button), wraps between 700 and 1299px, swipes sideways on phones */
@media (min-width: 700px) and (max-width: 1299px) { .hdr > .hrow, .hrow2w > .hrow { flex-wrap: wrap; overflow: visible; height: auto; row-gap: 8px } }
@media (min-width: 1300px) { .hrow2w > .hrow { column-gap: 8px } .hrow2w #dpBtn { min-width: 120px; width: 120px } .hrow2w #datesLbl, .hrow2w #custLbl { display: none } }

/* Dom 12/3: confidence bar under the direction bar (0-100, red -> yellow -> green) */
.cgh { margin-top: 26px }
.cgbar { position: relative; height: 12px; border-radius: 6px; margin: 14px auto 8px; max-width: 760px;
  background: linear-gradient(90deg, #C2371F 0%, #E07A3A 35%, #E0A21B 50%, #E0A21B 85%, var(--good) 100%) }
.cgbar .mk { position: absolute; top: -5px; width: 4px; height: 22px; margin-left: -2px; border-radius: 2px; background: var(--ink, #1a1a1a) }
.cglab { display: flex; justify-content: space-between; max-width: 760px; margin: 0 auto; font-size: 13px; font-weight: 600 }
.cglab span:nth-child(1) { color: #8A2E12 } .cglab span:nth-child(2) { color: #6B4A0E } .cglab span:nth-child(3) { color: var(--good-ink) }
.cgline { margin-top: 6px }
