/* ===========================================================================
   Capital Analytics — Sales Intelligence
   Vanilla CSS. No framework, no build step (see CLAUDE.md hard rules).

   Colour: the categorical series hexes are the dataviz skill's validated
   palette, used verbatim so the CVD gates still hold. They were re-validated
   against THESE surfaces (#ffffff light / #131722 dark) — both modes pass.
   Light mode WARNs sub-3:1 contrast on aqua/yellow/magenta, so every chart
   using those ships visible direct labels (the "relief rule").
   =========================================================================== */

:root {
  color-scheme: dark;

  /* surfaces — validated against the palette */
  --plane:      #0b0e16;
  --surface:    #131722;
  --surface-2:  #191f2d;
  --surface-3:  #212939;
  --hairline:   rgba(255,255,255,.09);
  --hairline-2: rgba(255,255,255,.05);

  /* ink */
  --ink:      #ffffff;
  --ink-2:    #b8c0d0;
  --ink-3:    #7d8798;
  --grid:     rgba(255,255,255,.06);
  --axis:     rgba(255,255,255,.14);

  /* categorical series — dark steps */
  --s1: #3987e5;  --s2: #d95926;  --s3: #199e70;  --s4: #c98500;
  --s5: #d55181;  --s6: #008300;  --s7: #9085e9;  --s8: #e66767;

  /* status — fixed, never themed */
  --good: #0ca30c;  --warn: #fab219;  --serious: #ec835a;  --critical: #d03b3b;

  /* SEMANTIC OUTCOME COLOUR — the house rule for this app.
     won = green, lost = red, open/neutral = blue. This is a diverging encoding
     (polarity), which is exactly what status colours are for, so outcome NEVER
     borrows a categorical series slot and a series colour never impersonates an
     outcome. Every surface that shows an outcome uses these three, and pairs
     them with a word ("Won"/"Lost") so meaning is never colour-alone. */
  --won: #16a34a;  --lost: #e05260;  --neutral: #3987e5;
  --won-soft:  color-mix(in srgb, var(--won) 18%, transparent);
  --lost-soft: color-mix(in srgb, var(--lost) 18%, transparent);
  --neutral-soft: color-mix(in srgb, var(--neutral) 18%, transparent);

  /* CAA brand — chrome only, never used to encode data. */
  --brand-red: #d8232a;  --brand-slate: #6b8291;  --brand-ink: #1e1e1e;

  --accent: #3987e5;
  --accent-2: #9085e9;
  --glow: 0 0 0 1px rgba(57,135,229,.35), 0 8px 32px -8px rgba(57,135,229,.45);

  --r-sm: 8px; --r: 14px; --r-lg: 20px;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -12px rgba(0,0,0,.7);
  --ease: cubic-bezier(.22,.61,.36,1);
  --ease-out: cubic-bezier(.16,1,.3,1);
  --font: system-ui, -apple-system, "Segoe UI", sans-serif;
}

:root[data-theme="light"] {
  color-scheme: light;
  --plane:      #f4f6fb;
  --surface:    #ffffff;
  --surface-2:  #f7f9fd;
  --surface-3:  #eef2f9;
  --hairline:   rgba(11,11,11,.10);
  --hairline-2: rgba(11,11,11,.05);
  --ink:   #0b1020;
  --ink-2: #4a5468;
  --ink-3: #7d8798;
  --grid:  rgba(11,11,11,.06);
  --axis:  rgba(11,11,11,.14);
  --s1: #2a78d6;  --s2: #eb6834;  --s3: #1baf7a;  --s4: #eda100;
  --s5: #e87ba4;  --s6: #008300;  --s7: #4a3aa7;  --s8: #e34948;
  --accent: #2a78d6; --accent-2: #4a3aa7;
  /* Light-surface steps: the dark greens/reds go muddy on white. */
  --won: #0f8a3d;  --lost: #d03b3b;  --neutral: #2a78d6;
  --shadow: 0 1px 2px rgba(11,16,32,.06), 0 10px 30px -14px rgba(11,16,32,.25);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; font-family: var(--font); background: var(--plane); color: var(--ink);
  -webkit-font-smoothing: antialiased; overflow: hidden;
}
/* Ambient wash — the only decorative gradient; sits behind everything. */
body::before {
  content: ""; position: fixed; inset: -30%; z-index: 0; pointer-events: none;
  background:
    radial-gradient(46% 38% at 14% 4%,  color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%),
    radial-gradient(42% 34% at 92% 8%,  color-mix(in srgb, var(--accent-2) 18%, transparent), transparent 68%),
    radial-gradient(48% 40% at 60% 100%,color-mix(in srgb, var(--s3) 12%, transparent), transparent 72%);
  filter: blur(30px); opacity: .75;
  animation: drift 34s var(--ease) infinite alternate;
}
@keyframes drift {
  0%   { transform: translate3d(0,0,0) scale(1); }
  100% { transform: translate3d(2%,-2%,0) scale(1.06); }
}

.app { position: relative; z-index: 1; display: grid; grid-template-columns: auto 1fr; height: 100vh; }

/* ── Rail ─────────────────────────────────────────────────────────────── */
.rail {
  width: 82px; display: flex; flex-direction: column; gap: 6px; padding: 18px 12px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: blur(18px) saturate(140%);
  border-right: 1px solid var(--hairline);
  transition: width .34s var(--ease-out); overflow: hidden; z-index: 20;
}
.rail:hover, .rail:focus-within { width: 224px; }
.rail-brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 20px; }
/* CAA mark. The supplied logo is a webp on a white plate, so it gets its own
   white chip rather than being dropped onto a tinted surface. */
.rail-logo {
  flex: 0 0 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  background: #fff; overflow: hidden; box-shadow: 0 0 0 1px var(--hairline), var(--shadow);
}
.rail-logo img { width: 30px; height: auto; display: block; }
.rail-logo svg { width: 21px; height: 21px; }
.rail-brand-text { display: flex; flex-direction: column; line-height: 1.15; white-space: nowrap;
  opacity: 0; transform: translateX(-6px); transition: all .3s var(--ease-out) .04s; }
.rail:hover .rail-brand-text, .rail:focus-within .rail-brand-text { opacity: 1; transform: none; }
.rail-brand-text strong { font-size: 14px; letter-spacing: -.01em; }
.rail-brand-text span { font-size: 11px; color: var(--ink-3); }

.rail-nav { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.rail-link {
  display: flex; align-items: center; gap: 14px; padding: 11px 14px; border-radius: var(--r-sm);
  color: var(--ink-3); text-decoration: none; white-space: nowrap; position: relative;
  transition: color .2s, background .2s;
}
.rail-link svg { flex: 0 0 21px; width: 21px; height: 21px; fill: none; stroke: currentColor;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.rail-link span { font-size: 13.5px; font-weight: 550; opacity: 0; transform: translateX(-6px);
  transition: all .3s var(--ease-out); }
.rail:hover .rail-link span, .rail:focus-within .rail-link span { opacity: 1; transform: none; }
.rail-link:hover { color: var(--ink); background: var(--surface-3); }
.rail-link.on { color: var(--ink); background: color-mix(in srgb, var(--accent) 16%, transparent); }
.rail-link.on::before {
  content: ""; position: absolute; left: -12px; top: 50%; translate: 0 -50%;
  width: 3px; height: 22px; border-radius: 0 3px 3px 0; background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}
.rail-foot { padding-top: 10px; border-top: 1px solid var(--hairline-2); }

.icon-btn {
  width: 40px; height: 40px; display: grid; place-items: center; border-radius: var(--r-sm);
  background: transparent; border: 1px solid transparent; color: var(--ink-3); cursor: pointer;
  transition: all .2s;
}
.icon-btn:hover { color: var(--ink); background: var(--surface-3); border-color: var(--hairline); }
.icon-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; }
.ico-moon { display: none; }
:root[data-theme="light"] .ico-sun { display: none; }
:root[data-theme="light"] .ico-moon { display: block; }

/* ── Main / topbar ────────────────────────────────────────────────────── */
.main { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 20px 28px 16px; border-bottom: 1px solid var(--hairline); flex: 0 0 auto;
}
.page-title { margin: 0; font-size: 21px; font-weight: 680; letter-spacing: -.02em; }
.page-sub { margin: 3px 0 0; font-size: 12.5px; color: var(--ink-3); }
.topbar-right { display: flex; align-items: center; gap: 12px; }

.seg { display: flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--surface-2);
  border: 1px solid var(--hairline); }
.seg button {
  padding: 6px 13px; border: 0; background: transparent; color: var(--ink-3);
  font: 600 12px var(--font); border-radius: 7px; cursor: pointer; transition: all .2s;
}
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

.sync-pill {
  display: flex; align-items: center; gap: 8px; padding: 7px 13px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--hairline);
  font-size: 12px; color: var(--ink-2); white-space: nowrap;
}
.sync-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); }
.sync-pill.ok  .dot { background: var(--good); box-shadow: 0 0 0 0 color-mix(in srgb,var(--good) 70%,transparent);
  animation: pulse 2.4s infinite; }
.sync-pill.bad .dot { background: var(--critical); }
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb,var(--good) 60%,transparent); }
  70%  { box-shadow: 0 0 0 7px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.view { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 22px 28px 60px; scroll-behavior: smooth; }

/* ── Cards & grid ─────────────────────────────────────────────────────── */
.grid { display: grid; gap: 16px; }
.g-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.g-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.g-32 { grid-template-columns: 2fr 1fr; }
.g-23 { grid-template-columns: 1fr 2fr; }
@media (max-width: 1180px) { .g-4 { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .g-3, .g-32, .g-23 { grid-template-columns: 1fr; } }
@media (max-width: 720px) { .g-4, .g-2 { grid-template-columns: 1fr; } }

.card {
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border: 1px solid var(--hairline); border-radius: var(--r); padding: 18px;
  box-shadow: var(--shadow); position: relative; overflow: hidden;
  backdrop-filter: blur(10px);
  opacity: 0; transform: translateY(14px);
  animation: rise .58s var(--ease-out) forwards;
}
@keyframes rise { to { opacity: 1; transform: none; } }
.card.pad0 { padding: 0; }
.card-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-t { margin: 0; font-size: 13px; font-weight: 640; letter-spacing: -.01em; }
.card-s { margin: 2px 0 0; font-size: 11.5px; color: var(--ink-3); }

/* Stat tile — hero numbers.
   padding-bottom reserves a lane for the sparkline so it never sits under the
   label text (it did, and the two were unreadable together). */
.stat { position: relative; padding-bottom: 50px; }
.stat .label { font-size: 11.5px; font-weight: 600; color: var(--ink-3); text-transform: uppercase;
  letter-spacing: .06em; }
.stat .value { font-size: 31px; font-weight: 700; letter-spacing: -.03em; margin: 8px 0 0; line-height: 1.05; }
.stat .value small { font-size: 15px; font-weight: 600; color: var(--ink-3); margin-left: 2px; }
.stat .meta { display: flex; align-items: center; gap: 7px; margin-top: 9px; font-size: 12px; color: var(--ink-3); }
.delta { display: inline-flex; align-items: center; gap: 3px; font-weight: 650; font-size: 12px; }
.delta.up { color: var(--good); } .delta.down { color: var(--critical); }
.delta svg { width: 12px; height: 12px; fill: currentColor; }
.stat-spark { position: absolute; right: 0; bottom: 0; left: 0; height: 44px; opacity: .55;
  pointer-events: none; -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }

/* ── Charts ───────────────────────────────────────────────────────────── */
.chart { width: 100%; display: block; overflow: visible; }
.chart .grid-l { stroke: var(--grid); stroke-width: 1; }
.chart .axis-l { stroke: var(--axis); stroke-width: 1; }
.chart text { fill: var(--ink-3); font: 500 10.5px var(--font); }
.chart .lbl-strong { fill: var(--ink-2); font-weight: 600; }
.chart .val-lbl { fill: var(--ink-2); font: 650 10.5px var(--font); }
.draw { stroke-dasharray: var(--len); stroke-dashoffset: var(--len);
  animation: draw 1.15s var(--ease-out) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.grow { transform-origin: bottom; animation: grow .7s var(--ease-out) backwards; }
@keyframes grow { from { transform: scaleY(0); opacity: 0; } }
.fade-in { animation: fadeIn .8s var(--ease-out) backwards; }
@keyframes fadeIn { from { opacity: 0; } }

.legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; }
.legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; margin-right: 6px; }
.legend span { font-size: 11.5px; color: var(--ink-2); display: inline-flex; align-items: center; }

.tip {
  position: fixed; z-index: 90; pointer-events: none; padding: 9px 12px; border-radius: 10px;
  background: var(--surface-3); border: 1px solid var(--hairline); box-shadow: var(--shadow);
  font-size: 12px; color: var(--ink); min-width: 120px;
  transition: opacity .12s; backdrop-filter: blur(12px);
}
.tip b { display: block; font-size: 11.5px; color: var(--ink-3); font-weight: 600; margin-bottom: 5px; }
.tip .row { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 3px; }
.tip .row i { width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; display: inline-block; }
.tip .row em { font-style: normal; color: var(--ink-2); }
.tip .row strong { font-variant-numeric: tabular-nums; }

/* ── Pipeline board ───────────────────────────────────────────────────── */
.board { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 14px; align-items: flex-start; }
.col {
  flex: 0 0 292px; background: color-mix(in srgb, var(--surface) 86%, transparent);
  border: 1px solid var(--hairline); border-radius: var(--r); display: flex; flex-direction: column;
  max-height: calc(100vh - 250px); opacity: 0; transform: translateY(14px);
  animation: rise .5s var(--ease-out) forwards;
}
.col-h { padding: 14px 15px 12px; border-bottom: 1px solid var(--hairline-2); }
.col-h .top { display: flex; align-items: center; gap: 8px; }
.col-h .name { font-size: 12.5px; font-weight: 650; flex: 1; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.col-h .n { font-size: 11px; font-weight: 650; color: var(--ink-3); background: var(--surface-3);
  padding: 2px 7px; border-radius: 999px; }
.col-h .v { font-size: 17px; font-weight: 700; letter-spacing: -.02em; margin-top: 7px; }
.col-bar { height: 3px; border-radius: 3px; background: var(--surface-3); margin-top: 9px; overflow: hidden; }
.col-bar i { display: block; height: 100%; border-radius: 3px; background: var(--accent);
  transform-origin: left; animation: grow-x .8s var(--ease-out) backwards; }
@keyframes grow-x { from { transform: scaleX(0); } }
.col-body { padding: 10px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.col.drop { outline: 2px dashed color-mix(in srgb,var(--accent) 60%, transparent); outline-offset: -5px; }

.deal {
  background: var(--surface-2); border: 1px solid var(--hairline); border-radius: 11px;
  padding: 11px 12px; cursor: grab; transition: transform .18s var(--ease), box-shadow .18s, border-color .18s;
}
.deal:hover { transform: translateY(-2px); border-color: color-mix(in srgb,var(--accent) 55%, transparent);
  box-shadow: 0 8px 20px -10px rgba(0,0,0,.6); }
.deal.dragging { opacity: .45; cursor: grabbing; transform: rotate(1.4deg) scale(.98); }
.deal .nm { font-size: 12.5px; font-weight: 600; line-height: 1.35; margin-bottom: 6px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.deal .meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.deal .amt { font-size: 13px; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.chip { font-size: 10px; font-weight: 650; padding: 2px 7px; border-radius: 999px;
  background: var(--surface-3); color: var(--ink-3); white-space: nowrap; }
.who { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 11px; color: var(--ink-3); }
.av { width: 19px; height: 19px; border-radius: 50%; display: grid; place-items: center;
  font-size: 9px; font-weight: 700; color: #fff; flex: 0 0 auto; }

/* ── Tables / leaderboard ─────────────────────────────────────────────── */
.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tbl th { text-align: left; font-size: 11px; font-weight: 600; color: var(--ink-3);
  text-transform: uppercase; letter-spacing: .05em; padding: 0 12px 10px; white-space: nowrap; }
.tbl td { padding: 11px 12px; border-top: 1px solid var(--hairline-2); vertical-align: middle; }
.tbl tbody tr { transition: background .15s; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.rank { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center;
  font-size: 11px; font-weight: 700; background: var(--surface-3); color: var(--ink-2); }
.rank.top { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; }
.bar-cell { min-width: 92px; height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.bar-cell i { display: block; height: 100%; border-radius: 6px; transform-origin: left;
  animation: grow-x .9s var(--ease-out) backwards; }

.badge { font-size: 10.5px; font-weight: 650; padding: 3px 8px; border-radius: 999px; }
.badge.sales { background: color-mix(in srgb,var(--s1) 20%,transparent); color: var(--s1); }
.badge.editorial { background: color-mix(in srgb,var(--s7) 20%,transparent); color: var(--s7); }
.badge.off { background: var(--surface-3); color: var(--ink-3); }
.badge.good { background: color-mix(in srgb,var(--good) 20%,transparent); color: var(--good); }
.badge.crit { background: color-mix(in srgb,var(--critical) 20%,transparent); color: var(--critical); }

/* ── Flow diagram ─────────────────────────────────────────────────────── */
.flow-wrap { position: relative; }
.flow-node rect { transition: filter .2s; }
.flow-node:hover rect { filter: brightness(1.18); }
.flow-node text { font: 600 11px var(--font); fill: var(--ink); }
.flow-link { fill: none; stroke-linecap: round; opacity: .32; transition: opacity .2s; }
.flow-link:hover { opacity: .7; }
.spark-dot { r: 3; opacity: .95; }

/* ── Misc ─────────────────────────────────────────────────────────────── */
.boot { display: grid; place-items: center; gap: 18px; padding: 90px 0; color: var(--ink-3); }
.splash-logo { width: 190px; height: auto; margin-bottom: 6px;
  animation: logoIn .8s var(--ease-out) both; }
:root[data-theme="dark"] .splash-logo { background: #fff; padding: 14px 18px; border-radius: 14px; }
@keyframes logoIn { from { opacity: 0; transform: translateY(10px) scale(.97); } }
.boot-ring { width: 34px; height: 34px; border-radius: 50%; border: 2.5px solid var(--hairline);
  border-top-color: var(--accent); animation: spin .85s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.toast-wrap { position: fixed; bottom: 22px; right: 22px; z-index: 100; display: flex;
  flex-direction: column; gap: 9px; }
.toast {
  padding: 12px 16px; border-radius: 11px; background: var(--surface-3);
  border: 1px solid var(--hairline); box-shadow: var(--shadow); font-size: 12.5px; max-width: 340px;
  animation: toastIn .34s var(--ease-out); backdrop-filter: blur(12px);
}
.toast b { display: block; margin-bottom: 3px; font-size: 12px; }
.toast.warn { border-left: 3px solid var(--warn); }
@keyframes toastIn { from { opacity: 0; transform: translateX(24px); } }

/* ── Outcome colour utilities ─────────────────────────────────────────── */
.o-won     { color: var(--won); }
.o-lost    { color: var(--lost); }
.o-open    { color: var(--neutral); }
.badge.won  { background: var(--won-soft);  color: var(--won); }
.badge.lost { background: var(--lost-soft); color: var(--lost); }
.badge.open { background: var(--neutral-soft); color: var(--neutral); }
.dot-o { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: 0 0 auto; }

/* ── Record modal ─────────────────────────────────────────────────────── */
.scrim {
  position: fixed; inset: 0; z-index: 80; background: rgba(6,9,16,.62);
  backdrop-filter: blur(5px); display: grid; place-items: center; padding: 3vh 2vw;
  animation: fadeIn .22s var(--ease-out);
}
.modal {
  width: 80vw; height: 84vh; max-width: 1500px; background: var(--surface);
  border: 1px solid var(--hairline); border-radius: var(--r-lg); box-shadow: 0 30px 90px -24px rgba(0,0,0,.7);
  display: flex; flex-direction: column; overflow: hidden;
  animation: modalIn .34s var(--ease-out);
}
@keyframes modalIn { from { opacity: 0; transform: translateY(20px) scale(.985); } }
.modal-h {
  padding: 20px 24px; border-bottom: 1px solid var(--hairline); display: flex;
  align-items: flex-start; gap: 16px; position: relative;
}
.modal-h::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--accent-bar, var(--neutral));
}
.modal-h h2 { margin: 0; font-size: 19px; font-weight: 680; letter-spacing: -.02em; line-height: 1.25; }
.modal-h .sub { margin: 5px 0 0; font-size: 12.5px; color: var(--ink-3); }
.modal-close {
  margin-left: auto; width: 34px; height: 34px; border-radius: 9px; flex: 0 0 auto;
  background: var(--surface-2); border: 1px solid var(--hairline); color: var(--ink-2);
  cursor: pointer; display: grid; place-items: center; transition: all .18s;
}
.modal-close:hover { background: var(--surface-3); color: var(--ink); }
.modal-close svg { width: 15px; height: 15px; stroke: currentColor; stroke-width: 2; fill: none; }
.modal-tabs { display: flex; gap: 3px; padding: 0 24px; border-bottom: 1px solid var(--hairline);
  background: var(--surface-2); overflow-x: auto; }
.modal-tabs button {
  padding: 12px 15px; border: 0; background: transparent; color: var(--ink-3); cursor: pointer;
  font: 620 12.5px var(--font); border-bottom: 2px solid transparent; white-space: nowrap;
  transition: color .18s, border-color .18s;
}
.modal-tabs button:hover { color: var(--ink); }
.modal-tabs button.on { color: var(--ink); border-bottom-color: var(--accent); }
.modal-tabs .cnt { font-size: 10.5px; color: var(--ink-3); margin-left: 5px;
  background: var(--surface-3); padding: 1px 6px; border-radius: 999px; }
.modal-body { flex: 1; overflow-y: auto; padding: 22px 24px 30px; }

.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.kv > div { padding: 12px 14px; border-radius: 11px; background: var(--surface-2);
  border: 1px solid var(--hairline-2); }
.kv .k { font-size: 10.5px; font-weight: 640; color: var(--ink-3); text-transform: uppercase;
  letter-spacing: .05em; }
.kv .v { font-size: 14px; font-weight: 620; margin-top: 5px; word-break: break-word; }
.hero-amt { font-size: 34px; font-weight: 720; letter-spacing: -.03em; }

.tl { position: relative; padding-left: 22px; }
.tl::before { content: ""; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 2px;
  background: var(--hairline); border-radius: 2px; }
.tl-item { position: relative; padding: 11px 0; border-bottom: 1px solid var(--hairline-2); }
.tl-item::before { content: ""; position: absolute; left: -21px; top: 17px; width: 9px; height: 9px;
  border-radius: 50%; background: var(--neutral); box-shadow: 0 0 0 3px var(--surface); }
.tl-item.done::before { background: var(--won); }
.tl-item.late::before { background: var(--lost); }
.tl-item .t { font-size: 13px; font-weight: 600; }
.tl-item .m { font-size: 11.5px; color: var(--ink-3); margin-top: 3px; }

.raw-json {
  font: 500 11.5px ui-monospace, "Cascadia Code", Consolas, monospace; white-space: pre-wrap;
  word-break: break-word; background: var(--surface-2); border: 1px solid var(--hairline-2);
  border-radius: 11px; padding: 14px; color: var(--ink-2); max-height: 60vh; overflow: auto;
}
/* ── Dev log ──────────────────────────────────────────────────────────── */
.cat { font-size: 10.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px;
  text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.cat-feature        { background: var(--neutral-soft); color: var(--neutral); }
.cat-enhancement    { background: color-mix(in srgb,var(--s7) 18%,transparent); color: var(--s7); }
.cat-bugfix         { background: var(--lost-soft); color: var(--lost); }
.cat-performance    { background: color-mix(in srgb,var(--s4) 22%,transparent); color: var(--s4); }
.cat-data-integrity { background: color-mix(in srgb,var(--s3) 18%,transparent); color: var(--s3); }
.cat-infrastructure { background: color-mix(in srgb,var(--s5) 18%,transparent); color: var(--s5); }

.day-h { display: flex; align-items: center; gap: 14px; margin: 30px 0 14px; flex-wrap: wrap; }
.day-h:first-child { margin-top: 0; }
.day-h .d { font-size: 15px; font-weight: 680; letter-spacing: -.015em; }
.day-h .n {
  font-size: 11.5px; font-weight: 700; padding: 4px 11px; border-radius: 999px; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.day-h .cats { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }

.log { border-left: 3px solid var(--hairline); padding-left: 18px; position: relative; }
.log-item { margin-bottom: 12px; }
.log-item::before {
  content: ""; position: absolute; left: -7.5px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--surface); border: 3px solid var(--accent); margin-top: 20px;
}
.log-card { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r);
  padding: 16px 18px; box-shadow: var(--shadow); }
.log-card .top { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; flex-wrap: wrap; }
.log-card h4 { margin: 0; font-size: 14px; font-weight: 660; letter-spacing: -.015em; flex: 1; min-width: 200px; }
.log-card .area { font-size: 10.5px; font-weight: 640; color: var(--ink-3);
  background: var(--surface-3); padding: 3px 9px; border-radius: 999px; }
.log-card .sum { font-size: 12.8px; color: var(--ink-2); line-height: 1.55; }

.ba { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 13px; }
@media (max-width: 780px) { .ba { grid-template-columns: 1fr; } }
.ba > div { padding: 12px 14px; border-radius: 11px; font-size: 12.3px; line-height: 1.5; }
.ba .before { background: var(--lost-soft); border: 1px solid color-mix(in srgb,var(--lost) 26%,transparent); }
.ba .after  { background: var(--won-soft);  border: 1px solid color-mix(in srgb,var(--won) 26%,transparent); }
.ba .lab { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em;
  margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.ba .before .lab { color: var(--lost); }
.ba .after .lab  { color: var(--won); }
.ba .body { color: var(--ink-2); }
.impact { margin-top: 11px; padding-top: 11px; border-top: 1px solid var(--hairline-2);
  font-size: 12.3px; color: var(--ink-2); display: flex; gap: 8px; }
.impact b { color: var(--ink); font-weight: 640; flex: 0 0 auto; }

.clickable { cursor: pointer; }
.clickable:hover { background: var(--surface-2); }

.empty { padding: 44px 20px; text-align: center; color: var(--ink-3); font-size: 13px; }
.note { display: flex; gap: 10px; padding: 11px 14px; border-radius: 10px; font-size: 12.5px;
  background: color-mix(in srgb, var(--s4) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--s4) 30%, transparent); color: var(--ink-2); margin-bottom: 16px; }
.note svg { flex: 0 0 16px; width: 16px; height: 16px; stroke: var(--s4); fill: none; stroke-width: 1.8; }
.sel { padding: 7px 11px; border-radius: 9px; background: var(--surface-2); color: var(--ink);
  border: 1px solid var(--hairline); font: 600 12px var(--font); cursor: pointer; }
.mono { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
h2.sec { font-size: 13px; font-weight: 650; margin: 26px 0 13px; letter-spacing: -.01em; }
h2.sec:first-child { margin-top: 0; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--ink-3); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; }
  /* Anything whose RESTING state is opacity:0 must be forced visible here, not
     left to a .01ms animation. If that animation never gets a frame the content
     is simply invisible — which is exactly what happened to the board columns. */
  .card, .col, .deal, .fade-in, .grow, .draw {
    opacity: 1 !important; transform: none !important;
    stroke-dashoffset: 0 !important; animation: none !important;
  }
}
