/* GGR billing's one stylesheet: the Torpedo One look (navy/lavender, League
   Spartan + Jost, flat left menu), copied from the Torpedo One portal's
   src/styles/brand.css and portal.css. Flat: hairlines, type and whitespace;
   no boxes, shadows, gradients or pills. Lavender marks the current page,
   links, focus and typed figures, never a fill. Status colours are for status
   only, as text or a 2px edge. Dark by default; Auto (no data-theme) follows
   the OS; data-theme="dark|light" on <html> (the t1-mode cookie) overrides
   it. Every text pair >= 4.5:1 (WCAG AA). Variable names are the ones
   static/app.js and the templates already read. */
@font-face { font-family: "League Spartan"; src: url("fonts/league-spartan-latin.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Jost"; src: url("fonts/jost-latin.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --display: "League Spartan", "Arial Narrow", system-ui, sans-serif;
  --sans: "Jost", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}
/* Dark (brand default). --muted is a touch stronger than the portal's
   tertiary text (.46 alpha = 4.07:1, under AA): .52 = 4.89:1 on --bg. */
:root, html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #060D1A; --bg-menu: #050A14; --surface: #060D1A; --surface-2: #050A14;
  --ink: #eaf1ff; --ink-2: rgba(224,234,255,.68); --muted: rgba(224,234,255,.52);
  --grid: rgba(150,180,255,.16); --border: rgba(150,180,255,.16); --border-2: rgba(150,180,255,.52); --axis: rgba(150,180,255,.4);
  --wash: rgba(150,180,255,.05);
  --accent: #B56CFF; --accent-ink: #C79BFF; --accent-wash: rgba(181,108,255,.22);
  --shadow-lg: 0 12px 32px rgba(0,0,0,.55);
  --ok: #3fb96a; --warn: #f0a91b; --bad: #e5534b;
  --ok-ink: #66d38c; --warn-ink: #f2c25a; --bad-ink: #ff8f86;
  /* Chart series (static/app.js reads these at draw time), in this order,
     never cycled; slot 0 is the lavender's chart step. Validated with the
     dataviz validator against #060D1A: all checks pass. */
  --series-0: #a865f5; --series-1: #d95926; --series-2: #199e70; --series-3: #c98500;
  --series-4: #d55181; --series-5: #008300; --series-6: #3987e5; --series-7: #e66767;
  --series-other: #4b535b;
}
/* Light. --muted #616d82 = 4.90:1 on --bg (the portal's #727E93 is 3.84:1).
   Series validated against #F4F8FC: all pass; slots 1-4 sit under 3:1, so
   every chart carries direct labels and a table of the same figures. */
html[data-theme="light"] {
  color-scheme: light;
  --bg: #F4F8FC; --bg-menu: #EBF1F8; --surface: #F4F8FC; --surface-2: #EBF1F8;
  --ink: #0b1426; --ink-2: #3a4558; --muted: #616d82;
  --grid: #d5dce6; --border: #d5dce6; --border-2: #7b879a; --axis: #8995a8;
  --wash: rgba(11,20,38,.035);
  --accent: #9750E6; --accent-ink: #7a3fd1; --accent-wash: rgba(151,80,230,.16);
  --shadow-lg: 0 12px 32px rgba(11,20,38,.16);
  --ok: #128a3d; --warn: #b87800; --bad: #d03b3b;
  --ok-ink: #0d6630; --warn-ink: #84510a; --bad-ink: #a8261f;
  --series-0: #9750E6; --series-1: #eb6834; --series-2: #1baf7a; --series-3: #eda100;
  --series-4: #e87ba4; --series-5: #008300; --series-6: #2a78d6; --series-7: #e34948;
  --series-other: #b4bbc3;
}
/* Auto: the light values above, when the OS prefers light. */
@media (prefers-color-scheme: light) {
  html:not([data-theme]) {
    color-scheme: light;
    --bg: #F4F8FC; --bg-menu: #EBF1F8; --surface: #F4F8FC; --surface-2: #EBF1F8;
    --ink: #0b1426; --ink-2: #3a4558; --muted: #616d82;
    --grid: #d5dce6; --border: #d5dce6; --border-2: #7b879a; --axis: #8995a8;
    --wash: rgba(11,20,38,.035);
    --accent: #9750E6; --accent-ink: #7a3fd1; --accent-wash: rgba(151,80,230,.16);
    --shadow-lg: 0 12px 32px rgba(11,20,38,.16);
    --ok: #128a3d; --warn: #b87800; --bad: #d03b3b;
    --ok-ink: #0d6630; --warn-ink: #84510a; --bad-ink: #a8261f;
    --series-0: #9750E6; --series-1: #eb6834; --series-2: #1baf7a; --series-3: #eda100;
    --series-4: #e87ba4; --series-5: #008300; --series-6: #2a78d6; --series-7: #e34948;
    --series-other: #b4bbc3;
  }
}

/* spacing: 4 8 12 16 24 32 48 · radius: 6 (controls) 3 (tags) · --border-2 (control edges) >= 3:1 on --bg and --bg-menu */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--ink); font: 400 15px/1.6 var(--sans); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
a { color: var(--accent-ink); text-decoration: none; text-underline-offset: 4px; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent-wash); color: var(--ink); }
b, strong { font-weight: 600; }
code, .mono { font-family: var(--mono); font-size: .88em; }
h1, h2, h3, h4 { text-wrap: balance; }
p { max-width: 72ch; margin: 0 0 12px; text-wrap: pretty; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 12px; z-index: 30; background: var(--bg); padding: 8px 12px; }

/* ---------------------------------------------------------------- shell: flat left menu + content */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100dvh; }
.menu { background: var(--bg-menu); border-right: 1px solid var(--border); }
.menu .menu-toggle { display: none; }
.menu-in { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; padding: 28px 0 22px; overflow-y: auto; }
.menu-brand { margin: 0 28px 26px; align-self: flex-start; display: flex; flex-direction: column; gap: 4px; color: var(--ink); }
.menu-brand:hover { text-decoration: none; }
.wordmark { display: block; height: 20px; width: auto; }
.wordmark-app { color: var(--accent-ink); font-weight: 600; font-size: 14px; line-height: 1.2; }
.menu a:focus-visible, .menu button:focus-visible, .menu summary:focus-visible { outline-offset: -2px; } /* the menu scrolls: an outside outline would be clipped */
/* plan 5: app switcher, the same markup and rules in billing, scrapers and the portal's /admin */
.apps { display: flex; gap: 16px; margin: -12px 28px 8px; padding-bottom: 10px; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.apps a { padding: 6px 0; color: var(--muted); }
.apps a:hover { color: var(--ink); text-decoration: none; }
.apps a[aria-current="true"] { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 4px; }
.menu nav { display: flex; flex-direction: column; }
.menu-group { padding: 18px 28px 4px; color: var(--muted); font-size: 13px; }
.menu nav a { display: block; padding: 6px 28px 6px 26px; border-left: 2px solid transparent; color: var(--ink-2); font-size: 14.5px; }
.menu nav a:hover { color: var(--ink); text-decoration: none; }
.menu nav a[aria-current="page"] { color: var(--ink); border-left-color: var(--accent); font-weight: 500; }
.menu-foot { margin-top: auto; padding: 28px 28px 0; display: flex; flex-direction: column; gap: 2px; font-size: 13.5px; color: var(--muted); }
.menu-foot b { color: var(--ink-2); font-weight: 500; overflow-wrap: anywhere; }
.menu-foot a { color: var(--muted); align-self: flex-start; }
.menu-foot a:hover { color: var(--ink); }
.modes { display: flex; gap: 12px; margin: 6px 0 2px; }
.modes button { font: inherit; padding: 6px 2px; border: 0; background: none; color: var(--muted); cursor: pointer; }
.modes button:hover { color: var(--ink); }
.modes button[aria-pressed="true"] { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 4px; }
/* the month: step back, pick, step forward. The picker opens over the menu, inside its width. */
.period { position: relative; display: flex; align-items: center; gap: 2px; margin: 0 28px 10px; }
.period-step { display: grid; width: 30px; height: 32px; place-items: center; border-radius: 6px; color: var(--ink-2); }
.period-step:hover { color: var(--ink); background: var(--wash); text-decoration: none; }
.period-step.off { color: var(--border-2); }
.period-step.off:hover { background: none; }
.period-step svg, .period-pick summary svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.period-pick { flex: 1; min-width: 0; }
.period-pick summary { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 32px; padding: 0 10px; border: 1px solid var(--border-2); border-radius: 6px;
  color: var(--ink); font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; cursor: pointer; list-style: none; white-space: nowrap; }
.period-pick summary:hover { border-color: var(--border-2); }
.period-pick summary::-webkit-details-marker { display: none; }
.period-pick summary svg { color: var(--muted); transition: transform .2s; }
.period-pick[open] summary svg { transform: rotate(180deg); }
.period-grid { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; right: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; padding: 10px;
  background: var(--bg-menu); border: 1px solid var(--border-2); border-radius: 6px; box-shadow: var(--shadow-lg); }
.period-year { grid-column: 1 / -1; margin: 6px 2px 2px; color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.period-year:first-child { margin-top: 0; }
.period-grid a, .period-grid span { display: grid; height: 30px; place-items: center; border-radius: 6px; font-size: 13px; }
.period-grid a { color: var(--ink-2); }
.period-grid a:hover { color: var(--ink); background: var(--wash); text-decoration: none; }
.period-grid a.now { box-shadow: inset 0 0 0 1px var(--border-2); }
.period-grid a.on { background: var(--ink); color: var(--bg); box-shadow: none; font-weight: 600; }
.period-grid span { color: var(--border-2); }

/* ---------------------------------------------------------------- layout */
main.content { max-width: 1320px; padding: 40px 48px 72px; min-width: 0; }
h1 { font-family: var(--display); font-weight: 800; font-size: 40px; letter-spacing: -.035em; line-height: 1.05; margin: 0 0 10px; color: var(--ink); }
h2 { font-family: var(--display); font-weight: 700; font-size: 22px; letter-spacing: -.02em; line-height: 1.2; margin: 44px 0 12px; color: var(--ink); }
h3 { font-size: 15.5px; font-weight: 600; margin: 28px 0 8px; color: var(--ink); }
h4 { font-size: 14px; font-weight: 600; margin: 20px 0 8px; color: var(--ink-2); }
.sub { color: var(--ink-2); font-size: 14px; }
p.sub { max-width: 72ch; }
.label { color: var(--ink-2); font-size: 13.5px; font-weight: 500; }
.num { font-variant-numeric: tabular-nums; }
/* The head of a screen: title and caption on the left, its own controls on the right. */
.head, .jobs-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 28px; }
.head > div:first-child, .jobs-head > div:first-child { min-width: min(100%, 360px); flex: 1 1 360px; }
.head .sub, .jobs-head .sub { margin-bottom: 0; }
.head > div:first-child > p.sub:first-child { margin-bottom: 8px; }
.toolbar, .jobs-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.head .toolbar, .head .jobs-toolbar, .jobs-head .jobs-toolbar { margin-bottom: 0; }
.toolbar label, .jobs-toolbar label, .actions label, .upload label, .completion-form label { font-size: 13.5px; color: var(--ink-2); }
.section { margin-top: 48px; }
.section > h2:first-child { margin-top: 0; }
.actions, .files, .upload { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; margin-top: 16px; }
.actions .sub, .upload .sub { font-size: 13.5px; max-width: 72ch; }
.month-state-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 16px; }
.month-state-line .sub:empty { display: none; }
ul.plain { margin: 8px 0 0; padding-left: 18px; font-size: 14px; }
ul.plain li { margin: 2px 0; }
form.inline { display: inline; }

/* ---------------------------------------------------------------- controls */
button, select, input, textarea { font: inherit; }
.btn, .in { font-size: 14px; color: var(--ink); background: transparent; border: 1px solid var(--border-2); border-radius: 6px; padding: 6px 12px; min-height: 36px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 6px 16px; cursor: pointer; white-space: nowrap; font-weight: 500; line-height: 1.4; text-decoration: none;
  transition: background-color .2s, border-color .2s, color .2s; }
.btn:hover:not(:disabled) { border-color: var(--ink-2); text-decoration: none; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); } /* lavender is never a fill */
.btn.primary:hover:not(:disabled) { background: var(--ink-2); border-color: transparent; }
.btn.quiet { border-color: transparent; color: var(--accent-ink); padding-left: 8px; padding-right: 8px; }
.btn.quiet:hover:not(:disabled) { border-color: transparent; text-decoration: underline; }
.btn.danger { color: var(--bad-ink); }
.in { transition: border-color .2s; }
.in:hover:not(:disabled) { border-color: var(--ink-2); }
.in:focus-visible, .in:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.in::placeholder { color: var(--muted); }
.in:disabled { background: var(--surface-2); color: var(--ink-2); cursor: default; }
.in.num { text-align: right; font-variant-numeric: tabular-nums; }
.in.mono { font-family: var(--mono); font-size: 13px; }
select.in { padding-right: 30px; appearance: none; -webkit-appearance: none; cursor: pointer;
  background: linear-gradient(45deg, transparent 50%, var(--muted) 50%) right 15px center / 5px 5px no-repeat, linear-gradient(-45deg, transparent 50%, var(--muted) 50%) right 10px center / 5px 5px no-repeat; }
input[type="file"].in { padding: 4px 6px; max-width: 100%; }
input[type="file"].in::file-selector-button { font: inherit; font-size: 13.5px; font-weight: 500; color: var(--ink); background: transparent; border: 1px solid var(--border-2); border-radius: 6px; padding: 3px 10px; margin-right: 10px; cursor: pointer; }
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; vertical-align: -3px; }
/* A typed figure: a cell someone entered, set apart from the computed ones by a lavender edge. */
.in.fill { box-shadow: inset 2px 0 0 var(--accent); }
.in.auto { background-color: var(--surface-2); }
.in.err, select.in.err { border-color: var(--bad); box-shadow: inset 2px 0 0 var(--bad); }
.err-msg { font-size: 13.5px; color: var(--bad-ink); margin-top: 4px; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--ink-2); }
/* filters: a checkbox per flag (pills) or a link per preset, as plain text; the chosen one underlined */
.pills, .presets { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.pills label, .presets a { display: inline-flex; align-items: center; min-height: 32px; color: var(--ink-2); font-size: 14px; cursor: pointer; text-underline-offset: 4px; }
.pills label:hover, .presets a:hover { color: var(--ink); text-decoration: none; }
.pills label:has(input:checked), .presets a.current { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); }
.pills label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.pills input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.presets { margin: 0 0 24px; }

/* status: the word in its status colour, nothing around it */
.chip { font-size: 13.5px; font-weight: 500; white-space: nowrap; color: var(--ink-2); }
.chip.ok { color: var(--ink-2); } /* done is the normal state: no colour, so what needs action stands out */
.chip.todo { color: var(--warn-ink); }
.chip.bad { color: var(--bad-ink); }
.chip.wait { color: var(--muted); }
/* a kind or a flag: a quiet outlined tag, not a status */
.badge { display: inline-block; padding: 0 6px; border: 1px solid var(--border); border-radius: 3px; font-size: 12.5px; font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.badge.ok { color: var(--ok-ink); }
.badge.warn { color: var(--warn-ink); }
.badge.bad { color: var(--bad-ink); }
h2 .badge { vertical-align: 3px; margin-left: 6px; font-family: var(--sans); letter-spacing: 0; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- messages */
/* a 2px edge in the status colour, the text in ink: no tint, no icon */
.banner, .notice, .attention { padding: 2px 0 2px 14px; border-left: 2px solid var(--warn); margin: 0 0 16px; font-size: 14px; color: var(--ink); }
.banner { border-left-color: var(--bad); }
.banner b { color: var(--bad-ink); }
.notice b { color: var(--warn-ink); }
.notice.ok { border-left-color: var(--accent); }
.notice.ok b { color: var(--ink); }
.notice ul.plain, .banner ul.plain { margin-top: 6px; }
details.notice > summary { cursor: pointer; list-style: none; }
details.notice > summary::-webkit-details-marker { display: none; }
details.notice > summary::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 8px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(45deg) translateY(-3px); transition: transform .2s; }
details.notice[open] > summary::after { transform: rotate(-135deg) translateY(-1px); }
details.missing .missing-list { columns: 3 14em; margin: 10px 0 0; padding-left: 18px; }
details.missing .missing-list li { break-inside: avoid; margin: 2px 0; }
/* what is wrong with the month (not what is still to do) */
.attention { border-left-color: var(--bad); padding-top: 4px; padding-bottom: 4px; }
.attention h2 { font-family: var(--sans); font-size: 15.5px; font-weight: 600; letter-spacing: 0; margin: 0 0 6px; color: var(--bad-ink); display: flex; gap: 8px; align-items: center; }
.attention ul { margin: 0; padding-left: 18px; color: var(--ink-2); }
.attention li { margin: 3px 0; }
/* empty states: one plain sentence */
.empty { padding: 24px 0; color: var(--ink-2); font-size: 14px; }
.empty b { display: block; margin-bottom: 2px; color: var(--ink); font-weight: 600; font-size: 15px; }
td.empty { white-space: normal; }
/* a job's log: the CLI's own lines, nothing paraphrased */
.log { margin: 0; padding: 14px 18px; min-height: 64px; max-height: 70vh; overflow: auto; background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px;
  font: 12.5px/1.6 var(--mono); color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.log .ok { color: var(--ok-ink); } .log .warn { color: var(--warn-ink); } .log .bad { color: var(--bad-ink); }

/* ---------------------------------------------------------------- headline figures */
/* .kpi-row (Performance) and .figures/.kpis/.summary (every other screen): a rule above, the figure, its label. */
.kpi-row, .figures, .kpis, .summary { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 16px 32px; margin: 0 0 20px; max-width: none; }
.summary { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.kpi, .figures > div, .kpis > div, .summary > span { min-width: 0; display: flex; flex-direction: column; gap: 4px; padding: 12px 0 0; border-top: 1px solid var(--border); color: var(--ink-2); font-size: 13.5px; }
.kpi-label, .figures dt, .kpis .label { color: var(--ink-2); font-size: 13.5px; font-weight: 400; margin: 0; }
.kpi-value, .figures dd, .kpis .figure, .summary .figure { margin: 0; color: var(--ink); font-family: var(--display); font-size: 28px; font-weight: 700; letter-spacing: -.025em; line-height: 1.1;
  font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpis > div { flex-direction: column-reverse; justify-content: flex-end; }
.kpis .label a { color: inherit; text-decoration: underline; text-decoration-color: var(--border-2); }
.summary .figure { display: block; margin-bottom: 2px; }
.kpi-value.neg, .figures dd.neg { color: var(--bad-ink); }
.perf-note { margin: 0 0 24px; }

/* ---------------------------------------------------------------- tables: hairlines, no frame */
.tablewrap { overflow-x: auto; margin: 0 0 8px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 10px 16px 10px 0; border-bottom: 1px solid var(--grid); vertical-align: middle; }
th:last-child, td:last-child { padding-right: 0; }
th { font-weight: 500; color: var(--muted); font-size: 13px; white-space: nowrap; }
td { white-space: nowrap; color: var(--ink-2); }
td:first-child { color: var(--ink); font-weight: 500; }
td.num, th.num { text-align: right; white-space: nowrap; }
.tablewrap tbody tr:not(.total):not(.how):not(.refused-why):hover > td { background: var(--wash); }
td.wrap, td.why { white-space: normal; min-width: 200px; max-width: 320px; font-size: 13.5px; color: var(--ink-2); }
td.wrap.sched { min-width: 200px; max-width: 320px; }
td.why { max-width: 380px; }
td.neg, .num.neg, .neg { color: var(--bad-ink); }
td.ok { color: var(--ok-ink); }
td .sub { font-size: 13px; }
td .chip + .sub { display: block; margin-top: 2px; }
tr.total td { color: var(--ink); font-weight: 600; border-top: 1px solid var(--border-2); border-bottom: 0; }
tr.sub td { color: var(--muted); font-size: 13.5px; }
tr.sub td:first-child { font-weight: 400; padding-left: 16px; color: var(--ink-2); }
tr.current td:first-child, tr.dev td:first-child { box-shadow: inset 2px 0 0 var(--accent); padding-left: 12px; }
tr.dev td { background: var(--wash); }
/* a toggle inside a table (Why this figure, Engine trace): an arrow and link colour, so it reads as one */
td details > summary, td details > summary.sub { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; margin-top: 4px; padding: 2px 0; list-style: none; font-size: 13.5px; font-weight: 500; color: var(--accent-ink); }
td details > summary::-webkit-details-marker { display: none; }
td details > summary::before { content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform .2s; margin-right: 2px; }
td details[open] > summary::before { transform: rotate(45deg); }
td details > summary:hover { text-decoration: underline; }
td details .mono { display: block; margin-top: 4px; font-size: 12px; color: var(--muted); }
/* an editable table: the cells are inputs, so their padding sets the row */
table.edit td { padding: 6px 8px 6px 0; }
table.edit .in { width: 100%; min-width: 72px; min-height: 32px; padding: 4px 8px; font-size: 13.5px; }
table.edit input.in.num { min-width: 116px; }
table.edit select.in { min-width: 190px; padding-right: 28px; }
table.edit th:first-child, table.edit td:first-child { position: sticky; left: 0; z-index: 1; background: var(--bg); }
table.edit tbody { border-bottom: 1px solid var(--grid); }
table.edit tbody:last-child { border-bottom: 0; }
table.edit tbody tr td { border-bottom: 0; }
tr.refused td:first-child { box-shadow: inset 2px 0 0 var(--bad); padding-left: 12px; }
tr.refused-why td { padding: 0 0 10px 12px; white-space: normal; box-shadow: inset 2px 0 0 var(--bad); }
tr.refused-why .err-msg { margin-top: 0; }
/* provider invoices: the working under a row, kept in view while the table scrolls */
#provider-table td:nth-child(2) { white-space: normal; min-width: 120px; }
#provider-table td:first-child { white-space: normal; min-width: 200px; }
tr.how > td { padding-top: 0; white-space: normal; }
tr.how > td > details { position: sticky; left: 0; max-width: calc(min(100vw, 1320px) - 340px); }
tr.how p.why { margin: 6px 0; max-width: 80ch; font-size: 13.5px; color: var(--ink-2); }
table.how { margin: 8px 0 6px; font-size: 13px; width: auto; min-width: 60%; border-top: 1px solid var(--grid); }
table.how th, table.how td { padding: 5px 16px 5px 0; }
table.how td:first-child { font-weight: 400; }
.tablewrap > p.sub { position: sticky; left: 0; margin: 0; padding: 10px 0; font-size: 13.5px; }

/* ---------------------------------------------------------------- sections (a rule above, not a box) */
.card { border-top: 1px solid var(--border); padding: 20px 0 8px; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 8px 48px; margin: 0 0 16px; }
.card .deal { font-family: var(--display); font-size: 20px; font-weight: 700; letter-spacing: -.02em; line-height: 1.3; color: var(--ink); margin: 0 0 4px; }
.card .deal .mono { display: inline-block; font-family: var(--mono); font-size: 14px; font-weight: 500; letter-spacing: 0; color: var(--ink-2); }
.card .meta { color: var(--muted); font-size: 13.5px; margin: 4px 0 0; }
.termrow { display: grid; grid-template-columns: minmax(160px, 220px) 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--grid); font-size: 14px; }
.termrow:last-of-type { border-bottom: 0; }
.termrow .note { color: var(--muted); font-size: 13.5px; }
.why { color: var(--ink-2); font-size: 13.5px; white-space: normal; }
/* an inline editor that opens in place */
details.editor { margin-top: 12px; }
details.editor > summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; color: var(--accent-ink); font-size: 14px; font-weight: 500; list-style: none; }
details.editor > summary::-webkit-details-marker { display: none; }
details.editor > summary::before { content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform .2s; margin-right: 2px; }
details.editor[open] > summary::before { transform: rotate(45deg); }
details.editor > summary:hover { text-decoration: underline; }
details.editor > form { margin-top: 10px; padding: 4px 0 4px 16px; border-left: 2px solid var(--border); }
details.editor + p.sub, p.sub + details.editor { margin-top: 12px; }
details.editor > form .btn + .sub { display: inline-block; margin: 8px 0 0 8px; vertical-align: middle; font-size: 13.5px; }
form.editor { display: block; }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 10px 16px; margin-bottom: 12px; }
.fields label { display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; color: var(--ink-2); }
.fields label .in { width: 100%; }
.fields label.wide, .fields fieldset.wide { grid-column: 1 / -1; }
.fields fieldset { margin: 0; padding: 10px 12px 12px; border: 1px solid var(--border); border-radius: 6px; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.fields legend { padding: 0 4px; font-size: 13.5px; color: var(--ink-2); }
.fields .check { flex-direction: row; }
/* test a rate */
.price { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.price label { display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; color: var(--ink-2); }
.price br { display: none; }
#price-result { margin-top: 16px; }
#price-result:empty { display: none; }
.result { font-family: var(--display); font-size: 32px; font-weight: 700; letter-spacing: -.03em; color: var(--ink); font-variant-numeric: tabular-nums; margin: 0 0 4px; }
/* disclosure: detail that stays out of the way until asked for */
.disclosure { border-top: 1px solid var(--border); margin: 16px 0; }
.disclosure:last-child { border-bottom: 1px solid var(--border); }
.disclosure > summary { display: flex; align-items: center; gap: 10px; cursor: pointer; list-style: none; padding: 14px 0; color: var(--ink); font-weight: 600; font-size: 15.5px; }
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary::before { content: ""; flex: none; width: 7px; height: 7px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(-45deg); transition: transform .2s; }
.disclosure[open] > summary::before { transform: rotate(45deg); }
.disclosure > summary:hover { color: var(--accent-ink); }
.disclosure > summary ~ *:last-child { margin-bottom: 20px; }
.disclosure h3:first-of-type { margin-top: 8px; }

/* ---------------------------------------------------------------- steps */
/* The heading row above a section's body: title on the left, one summary action or status on the right. */
.section-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; margin-bottom: 16px; }
.section-heading h2 { margin: 0; }
.section-heading .sub { margin: 4px 0 0; }
/* the month's numbered stages: one list under a rule */
.workflow-panel { border-top: 1px solid var(--border); padding: 20px 0 0; }
.workflow-list, .completion-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--grid); }
.workflow-step, .completion-item { display: flex; align-items: center; gap: 14px; padding: 12px 0 12px 14px; border-bottom: 1px solid var(--grid); }
.workflow-step.current { box-shadow: inset 2px 0 0 var(--accent); }
.workflow-step .step-body, .completion-item > div { flex: 1 1 0; min-width: 0; }
.workflow-step .step-body a { color: var(--ink); }
.workflow-step .step-body b, .completion-item b { font-weight: 600; font-size: 15px; color: var(--ink); }
.workflow-step .step-body .sub, .completion-item .sub { display: block; margin-top: 1px; font-size: 13.5px; }
.workflow-list + .notice, .workflow-list + p.sub { margin-top: 12px; }
.completion-item > a { flex: none; font-size: 13.5px; font-weight: 500; }
.completion-item > .chip { min-width: 68px; }
.completion-panel .notice { margin-top: 12px; }
/* the step number: a plain tabular figure */
.step-number { flex: none; width: 22px; color: var(--muted); font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; }
.workflow-step.complete .step-number, .process-step.complete .step-number { color: var(--ok-ink); }
.workflow-step.current .step-number, .process-step.current .step-number { color: var(--ink); font-weight: 700; }
.completion-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 16px; }
.completion-form .in { min-width: 240px; flex: 1 1 320px; }
.completion-form + .sub { margin-top: 8px; }
/* jobs: start one, the one running, the month's list */
.jobs-start { display: grid; gap: 16px; margin-bottom: 8px; }
.jobs-operator { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.jobs-operator label, .jobs-operator .sub { font-size: 13.5px; }
.jobs-operator label { color: var(--ink-2); }
.process-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--grid); }
.process-step { display: flex; align-items: center; gap: 14px; padding: 12px 0 12px 14px; border-bottom: 1px solid var(--grid); }
.process-step.current { box-shadow: inset 2px 0 0 var(--accent); }
.process-step.complete { box-shadow: inset 2px 0 0 var(--ok); }
.process-step.blocked .step-heading b { color: var(--ink-2); }
.process-step .step-body { flex: 1 1 auto; min-width: 0; }
.process-step .btn { flex: none; min-width: 168px; }
.step-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.step-heading b { font-size: 15px; font-weight: 600; color: var(--ink); }
.step-body .sub { margin: 2px 0 0; font-size: 13.5px; }
.jobs-status { align-self: center; }
.jobs-files { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.jobs-files a { display: inline-flex; align-items: center; min-height: 36px; padding: 6px 14px; border: 1px solid var(--border-2); border-radius: 6px; color: var(--ink); font: 500 12.5px var(--mono); }
.jobs-files a:hover { border-color: var(--ink-2); text-decoration: none; }
.jobs-back { margin-top: 24px; font-size: 14px; }
.promos-notes { max-width: 72ch; padding-left: 20px; font-size: 14px; }
.promos-notes li { margin: 4px 0; }
#promotions-result:not(:empty) { margin-top: 16px; }
#promotions-result h2 { margin-top: 0; }

/* ---------------------------------------------------------------- operator page */
.file { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-top: 16px; }
.file + .sub { margin-top: 8px; }
.group { margin: 12px 0 20px; }
.group .key { font-family: var(--mono); font-size: 13px; font-weight: 500; color: var(--ink); }
.group .bands { font-size: 13.5px; color: var(--muted); margin: 2px 0 8px; }
.grid { display: grid; grid-template-columns: minmax(180px, max-content) 200px max-content; gap: 8px 16px; align-items: center; }
.grid .brand { font-family: var(--mono); font-size: 13px; color: var(--ink-2); }
.grid .tick { display: flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--ink-2); }
.grid .err-msg { grid-column: 2 / -1; margin-top: -4px; }

/* ---------------------------------------------------------------- performance */
.chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 40px; margin: 0 0 8px; }
.chart { margin: 0; padding: 18px 0 12px; border-top: 1px solid var(--border); min-width: 0; }
.chart.wide { grid-column: 1 / -1; }
.chart figcaption { font-weight: 600; font-size: 15.5px; color: var(--ink); margin: 0 0 8px; }
.chart figcaption .sub { display: block; font-weight: 400; font-size: 13.5px; margin-top: 1px; }
.chart-box { height: 260px; width: 100%; }
.chart-box.tall { height: 320px; }
html:not(.js) .chart-grid { display: none; }

/* ---------------------------------------------------------------- signed-out pages */
.wall { max-width: 440px; margin: 16vh auto 48px; padding: 0 24px; }
.wall .wordmark-link { display: inline-flex; flex-direction: column; gap: 4px; margin-bottom: 36px; color: var(--ink); }
.wall .wordmark { height: 24px; }
.wall h1 { font-size: 36px; }
.wall p { color: var(--ink-2); margin-bottom: 20px; }
.wall p:last-child { margin-bottom: 0; }

/* ---------------------------------------------------------------- htmx */
/* A cell being saved dims until the server answers; a button that starts
   work shows its spinner and swaps its words. A swapped-in row fades in. */
.in.htmx-request, tbody.htmx-request .in { opacity: .6; }
.btn .spin { display: none; width: 12px; height: 12px; border-radius: 50%; background: conic-gradient(currentColor 0 270deg, transparent 270deg 360deg);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px)); mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px)); animation: turn 700ms linear infinite; }
.btn.htmx-request .spin { display: inline-block; }
.btn .busy { display: none; }
.btn.htmx-request .busy { display: inline; }
.btn.htmx-request .idle { display: none; }
@keyframes turn { to { transform: rotate(360deg); } }
@keyframes settle { from { opacity: 0; } to { opacity: 1; } }
tr.htmx-settling, tbody.htmx-settling > tr, .swap.htmx-settling { animation: settle 150ms ease-out; }

/* ---------------------------------------------------------------- narrow */
@media (max-width: 1100px) {
  main.content { padding: 32px 32px 64px; }
  tr.how > td > details { max-width: calc(100vw - 330px); }
}
@media (max-width: 900px) {
  .chart-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .grid { grid-template-columns: 1fr; gap: 4px; }
  .grid .brand { margin-top: 8px; }
  .grid .err-msg { grid-column: 1; }
  .termrow { grid-template-columns: 1fr; gap: 4px; }
  .termrow .btn.quiet { padding-left: 0; min-height: 36px; justify-content: flex-start; }
}
/* phones: the menu collapses behind a button (only when JS can open it again) */
@media (max-width: 760px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .menu { position: relative; border-right: 0; border-bottom: 1px solid var(--border); }
  .menu .menu-toggle { display: inline-flex; position: absolute; top: 14px; right: 16px; }
  html:not(.js) .menu .menu-toggle { display: none; }
  .menu-in { position: static; height: auto; padding: 22px 0 18px; }
  html.js .menu:not(.open) .menu-in > :not(.menu-brand) { display: none; }
  html.js .menu:not(.open) .menu-brand { margin-bottom: 0; }
  .menu-brand { margin: 0 20px 18px; }
  .period { margin: 0 20px 10px; }
  .menu-group { padding-left: 20px; padding-right: 20px; }
  .apps { margin: 0 20px 8px; }
  .menu nav a { padding-left: 18px; }
  .menu-foot { padding: 20px 20px 0; }
  main.content { padding: 28px 16px 48px; }
  h1 { font-size: 32px; }
  tr.how > td > details { max-width: calc(100vw - 48px); }
}
@media (max-width: 640px) {
  h2 { margin-top: 36px; }
  .section { margin-top: 40px; }
  .kpi-row, .figures, .kpis, .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
  .kpis > div:last-child:nth-child(odd), .figures > div:last-child:nth-child(odd), .summary > span:last-child:nth-child(odd), .kpi-row > .kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .kpi-value, .figures dd, .kpis .figure, .summary .figure { font-size: 24px; }
  th, td { padding: 9px 12px 9px 0; }
  .toolbar .in, .jobs-toolbar .in { flex: 1 1 140px; min-width: 0; }
  .workflow-step, .completion-item { gap: 10px; }
  .completion-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; }
  .completion-item > .chip { min-width: 0; }
  .workflow-step .chip { flex: none; }
  .process-step { display: grid; grid-template-columns: 22px minmax(0, 1fr); }
  .process-step .btn { grid-column: 1 / -1; width: 100%; }
  .completion-form .in { min-width: 0; }
  .chart-box.tall { height: 360px; }
  .wall { margin-top: 10vh; }
  /* every tappable control reaches the 44px touch target on a phone */
  .btn, .in, .period-step, .period-pick summary, .menu-toggle, .modes button { min-height: 44px; }
  .period-step { width: 40px; }
  .menu nav a { padding-top: 10px; padding-bottom: 10px; }
  .apps a { display: inline-flex; align-items: center; min-height: 44px; padding: 0; }
  .pills label, .presets a { min-height: 40px; }
  table.edit .in { min-height: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* --- Management dashboard (/management), from out/mockups/management.html --- */
.mgmt { max-width: 880px; }
.mgmt .head .modes { margin: 0; }
.stamp { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: baseline; }
.stamp b { color: var(--ink); font-weight: 500; }
.delta { font-size: 13.5px; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.delta.bad { color: var(--bad-ink); }
.delta .up::before { content: "▲ "; font-size: .8em; }
.delta .down::before { content: "▼ "; font-size: .8em; }
.stage-p { color: var(--muted); font-size: 12.5px; font-weight: 400; margin-left: 6px; }
/* We sell / We buy: a section with .dirs shows .sell or .buy, never both */
.dir-pick { margin: 0 0 8px; }
.dirs:not(:has(.pick-buy:checked)) .buy, .dirs:has(.pick-buy:checked) .sell { display: none; }
/* legal cards and movement: a list, one deal per item, readable at 380px */
.deals { list-style: none; margin: 0; padding: 0; }
.deals li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 16px; padding: 14px 0; border-bottom: 1px solid var(--grid); }
.deals li:first-child { border-top: 1px solid var(--grid); }
.deals .name { color: var(--ink); font-weight: 500; overflow-wrap: anywhere; }
.deals .meta { color: var(--ink-2); font-size: 13.5px; grid-column: 1; }
.deals .why { grid-column: 1 / -1; font-size: 14px; color: var(--ink-2); margin: 4px 0 0; }
.deals .why.flag { color: var(--bad-ink); }
.deals .why b { color: var(--warn-ink); font-weight: 500; }
.deals .days { grid-row: 1 / span 2; grid-column: 2; text-align: right; font-family: var(--display); font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; }
.deals .days small { display: block; font-family: var(--sans); font-size: 12.5px; font-weight: 400; letter-spacing: 0; color: var(--muted); margin-top: 4px; }
.deals .move { grid-column: 1 / -1; font-size: 14px; color: var(--ink-2); }
.deals .move .to { color: var(--ink); font-weight: 500; }
.deals .move .to.lost { color: var(--bad-ink); }
.deals .when { grid-row: 1; grid-column: 2; color: var(--muted); font-size: 13px; white-space: nowrap; }
.glance { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 24px; margin-bottom: 8px; }
.glance .kpi-value { font-size: 26px; }
@media (max-width: 640px) { .glance { grid-template-columns: repeat(2, minmax(0, 1fr)); } .glance .kpi-value { font-size: 22px; } }
.glance-foot { margin: 4px 0 0; }
.ceo-headline { font-size: 20px; line-height: 1.4; max-width: 62ch; margin: 0 0 18px; color: var(--ink); }
.ceo-row { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 900px) { .ceo-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ceo-h3 { margin: 22px 0 6px; }
.ceo-risks { list-style: none; margin: 0 0 12px; padding: 0; }
.ceo-risks li { display: grid; grid-template-columns: 110px 1fr; gap: 16px; align-items: baseline; padding: 12px 0; border-top: 1px solid var(--grid); color: var(--ink-2); font-size: 15px; line-height: 1.45; }
.ceo-risks li:last-child { border-bottom: 1px solid var(--grid); }
.ceo-risks b { color: var(--ink); }
.ceo-big { font-family: "League Spartan", sans-serif; font-size: 26px; font-weight: 600; color: var(--bad-ink); font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { .ceo-risks li { grid-template-columns: 1fr; gap: 2px; } }
.splits { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px 40px; }
.splits h3 { margin-top: 0; }
.splits table { table-layout: fixed; }
.splits td { padding-right: 12px; }
tr.unset td:first-child { color: var(--ink-2); font-weight: 400; }
.mom-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 8px 32px; margin: 0 0 16px; }
.mom-grid figure { margin: 0; min-width: 0; }
.mom-grid figcaption { font-size: 14px; font-weight: 600; color: var(--ink); }
.mom-grid figcaption span { font-weight: 400; color: var(--muted); font-size: 13px; margin-left: 4px; }
.mom-chart { height: 170px; }
.mom-table .delta { display: block; font-size: 12.5px; }
/* horizontal bars: name and value on one line, the bar under them; potential light, weighted solid */
.hbars { list-style: none; margin: 0; padding: 0; }
.hb { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 10px 0; border-bottom: 1px solid var(--grid); }
.hb-name { color: var(--ink); font-weight: 500; font-size: 14px; }
.hb-val { color: var(--ink-2); font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hb-track { grid-column: 1 / -1; height: 8px; }
.hb-pot { display: block; height: 8px; border-radius: 0 3px 3px 0; background: color-mix(in srgb, var(--accent) 30%, transparent); }
.hb-pot.solid { background: var(--accent); opacity: .85; }
.hb.idle .hb-name, .hb.unset .hb-name { color: var(--ink-2); font-weight: 400; }
.hb.unset .hb-pot.solid { background: var(--axis); }
.split2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px 40px; }
.split2 h3 { margin: 0; }
.split2 .sub { margin: 2px 0 10px; }
.more-rows { margin: 0 0 8px; }
.more-rows > summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; min-height: 40px; color: var(--accent-ink); font-size: 14px; }
.more-rows > summary::-webkit-details-marker { display: none; }
.more-rows > summary::after { content: ""; width: 6px; height: 6px; margin-left: 8px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translateY(-2px); transition: transform .2s; }
.more-rows[open] > summary::after { transform: rotate(-135deg) translateY(-1px); }
.more-rows .open-label, .more-rows[open] .closed-label { display: none; }
.more-rows[open] .open-label { display: inline; }
.more-rows > .drills { border-top: 0; }
.tablewrap.fit table { table-layout: fixed; }
.tablewrap.fit th:first-child, .tablewrap.fit td:first-child { width: 46%; white-space: normal; }
/* drill-down rows: a row that opens its brands and studios */
.drills { border-top: 1px solid var(--grid); }
.drill-head, .drill > summary { display: grid; grid-template-columns: minmax(0, 1fr) 7.5em 4.5em; gap: 12px; align-items: center; }
.drill-head { padding: 8px 0; color: var(--muted); font-size: 13px; font-weight: 500; border-bottom: 1px solid var(--grid); }
.drill-head .num, .drill > summary .num { text-align: right; }
.drill { border-bottom: 1px solid var(--grid); }
.drill > summary { list-style: none; cursor: pointer; padding: 11px 0; min-height: 44px; font-size: 14px; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.drill > summary::-webkit-details-marker { display: none; }
.drill > summary:hover { background: var(--wash); }
.d-name { color: var(--ink); font-weight: 500; display: flex; align-items: center; gap: 8px; min-width: 0; overflow-wrap: anywhere; }
.d-name::before { content: ""; flex: none; width: 6px; height: 6px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(-45deg); transition: transform .2s; }
.drill[open] .d-name::before { transform: rotate(45deg); }
.d-name:has(.d-flag) { flex-wrap: wrap; row-gap: 2px; }
.d-flag { flex-basis: 100%; padding-left: 14px; font-size: 12.5px; font-weight: 400; color: var(--bad-ink); }
.drill-body { padding: 0 0 14px 14px; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 4px 32px; }
.drill-body > p { grid-column: 1 / -1; margin: 0 0 4px; }
.drill-part h4 { margin: 4px 0 2px; font-size: 13px; color: var(--muted); font-weight: 500; }
.drill-part table { font-size: 13.5px; table-layout: fixed; }
.drill-part td { padding: 6px 12px 6px 0; }
.drill-part td:first-child { font-weight: 400; color: var(--ink-2); width: 46%; overflow-wrap: anywhere; }
/* share of GGR: top 5 as separate segments, everyone else grey */
.share { margin: 4px 0 12px; }
.share-bar { display: flex; gap: 2px; height: 10px; }
.share-bar .seg { background: var(--accent); border-radius: 2px; }
.share-bar .seg + .seg { opacity: .7; }
.share-bar .seg.rest { flex: 1; background: var(--axis); opacity: .5; }
.share .sub { margin: 6px 0 0; }
.share .sub b { color: var(--ink); font-weight: 600; }
.spark { height: 34px; margin-top: 6px; }
.source { margin-top: 56px; font-size: 13px; color: var(--muted); }
