/* Edgeboard shared styles. Light = concrete and paper. Dark = arena at night.
   One typeface (Archivo) used at two widths: normal for reading, condensed heavy for numbers and headings. */

:root {
  color-scheme: light;
  --bg: #e3e7ec;
  --bg-2: #d6dce4;
  --paper: #fbfaf7;
  --panel: #f1f4f7;
  --ink: #0e1621;
  --mute: #556274;
  --faint: #8794a5;
  --line: #c6ced8;
  --line-2: #d9dfe6;
  --good: #0b875a;
  --good-soft: #d3ede2;
  --bad: #c23a2c;
  --bad-soft: #f6dad5;
  --mk: #46556a;
  --nfl: #17794a;
  --nfl-soft: #d5eadd;
  --nba: #c85f17;
  --nba-soft: #f6dfcc;
  --accent: var(--nfl);
  --accent-soft: var(--nfl-soft);
  --on-accent: #ffffff;
  --notch: var(--bg);
  --shadow: 0 1px 0 rgba(14, 22, 33, .04), 0 14px 28px -18px rgba(14, 22, 33, .35);
  --focus: #1d6ff2;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0a0f15;
    --bg-2: #0f1620;
    --paper: #141d28;
    --panel: #101821;
    --ink: #e7ecf2;
    --mute: #93a1b3;
    --faint: #667589;
    --line: #26333f;
    --line-2: #1b2631;
    --good: #3ecb94;
    --good-soft: #12362a;
    --bad: #f27d6c;
    --bad-soft: #3a1b17;
    --mk: #a3b1c3;
    --nfl: #45b574;
    --nfl-soft: #10301f;
    --nba: #f28b3e;
    --nba-soft: #3a2210;
    --on-accent: #07120b;
    --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 14px 28px -18px rgba(0, 0, 0, .8);
    --focus: #6aa2ff;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0f15;
  --bg-2: #0f1620;
  --paper: #141d28;
  --panel: #101821;
  --ink: #e7ecf2;
  --mute: #93a1b3;
  --faint: #667589;
  --line: #26333f;
  --line-2: #1b2631;
  --good: #3ecb94;
  --good-soft: #12362a;
  --bad: #f27d6c;
  --bad-soft: #3a1b17;
  --mk: #a3b1c3;
  --nfl: #45b574;
  --nfl-soft: #10301f;
  --nba: #f28b3e;
  --nba-soft: #3a2210;
  --on-accent: #07120b;
  --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 14px 28px -18px rgba(0, 0, 0, .8);
  --focus: #6aa2ff;
}

body[data-sport="nba"] {
  --accent: var(--nba);
  --accent-soft: var(--nba-soft);
}

body[data-sport="nba"] { --on-accent: #ffffff; }
:root[data-theme="dark"] body[data-sport="nba"] { --on-accent: #1a0d03; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) body[data-sport="nba"] { --on-accent: #1a0d03; } }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.5 "Archivo", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: 1340px; margin: 0 auto; padding: 0 22px; }
[hidden] { display: none !important; }

/* Numbers and headings: condensed and heavy, like a scoreboard */
.num, h1, h2, h3, .brand {
  font-stretch: 72%;
  font-weight: 800;
  letter-spacing: -0.005em;
}
h1, h2, h3 { margin: 0; line-height: 1.05; }
h2 { font-size: 1.7rem; }
h3 { font-size: 1.3rem; }
.sub { color: var(--mute); margin: 4px 0 0; max-width: 62ch; }
.mute { color: var(--mute); }
.faint { color: var(--faint); }
.good { color: var(--good); }
.bad { color: var(--bad); }

/* Icons */
.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  min-height: 36px; padding: 6px 14px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--paper); color: var(--ink);
  font-weight: 600; font-size: .92rem; line-height: 1.2;
  cursor: pointer; text-decoration: none;
  transition: background .12s, border-color .12s, transform .06s;
}
.btn:hover { border-color: var(--faint); }
.btn:active { transform: translateY(1px); }
.btn.solid { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.solid:hover { filter: brightness(1.06); }
.btn.quiet { background: transparent; }
.btn.small { min-height: 30px; padding: 3px 10px; font-size: .85rem; border-radius: 7px; }
.btn[disabled] { opacity: .6; cursor: default; }
.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px;
  border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--mute);
  cursor: pointer; text-decoration: none; transition: background .12s, color .12s;
}
.icon-btn:hover { background: var(--bg-2); color: var(--ink); }
.icon-btn.on { background: var(--accent-soft); color: var(--accent); }
.icon-btn.sm { width: 28px; height: 28px; }
.icon-btn.sm .ic { width: 16px; height: 16px; }
.icon-btn.done { color: var(--good); }

/* Top bar */
.top { position: sticky; top: 0; z-index: 30; background: var(--paper); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 14px; min-height: 62px; }
.brand { display: flex; align-items: center; gap: 9px; font-size: 1.75rem; text-decoration: none; margin-right: 4px; }
.brand svg { width: 30px; height: 18px; }
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--bg-2); border-radius: 10px; }
.seg button {
  border: 0; background: transparent; padding: 5px 16px; border-radius: 8px; cursor: pointer;
  font-weight: 800; font-stretch: 78%; font-size: 1.05rem; letter-spacing: .01em; color: var(--mute);
}
.seg button[aria-selected="true"] { background: var(--accent); color: var(--on-accent); }
.nav { display: flex; gap: 2px; margin-left: 8px; }
.nav a { padding: 6px 12px; border-radius: 8px; text-decoration: none; font-weight: 600; color: var(--mute); }
.nav a:hover { color: var(--ink); background: var(--bg-2); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--bg-2); }
.grow { flex: 1; }
.tools { display: flex; align-items: center; gap: 4px; }

/* Ledger strip: the numbers that matter, separated by hairlines rather than boxed */
.ledger { display: grid; grid-template-columns: repeat(4, 1fr); margin: 20px 0 0; border-top: 2px solid var(--ink); position: relative; }
.ledger .cell { padding: 12px 18px 12px 0; text-align: left; background: transparent; border: 0; border-left: 1px solid var(--line); padding-left: 18px; }
.ledger .cell:first-child { border-left: 0; padding-left: 0; }
.ledger .k { color: var(--mute); font-size: .86rem; }
.ledger .v { font-size: 2rem; line-height: 1.05; margin: 2px 0 1px; }
.ledger .d { color: var(--mute); font-size: .85rem; }
button.cell { cursor: pointer; font: inherit; color: inherit; }
button.cell:hover .v { color: var(--accent); }
.ledger.run::before {
  content: ""; position: absolute; left: 0; top: -2px; height: 2px; width: var(--p, 8%); background: var(--accent);
  transition: width .6s ease;
}
.ledger.run .pulse { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: var(--accent); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }

.notice { margin: 14px 0 0; padding: 10px 14px; border-radius: 8px; background: var(--bad-soft); color: var(--ink); border-left: 4px solid var(--bad); }
.notice b { font-weight: 700; }
.notice.info { background: var(--accent-soft); border-left-color: var(--accent); }

/* Rail: the signature. Hollow circle = market price, diamond = AI estimate, bar between = the gap */
.rail { --m: 50; --a: 50; position: relative; height: 22px; min-width: 90px; }
.rail::before { content: ""; position: absolute; left: 0; right: 0; top: 9px; height: 4px; border-radius: 2px; background: var(--line-2); box-shadow: inset 0 0 0 1px var(--line-2); }
.rail .gapbar {
  position: absolute; top: 8px; height: 6px; border-radius: 3px; background: var(--good);
  left: calc(min(var(--m), var(--a)) * 1%); width: calc((max(var(--m), var(--a)) - min(var(--m), var(--a))) * 1%);
}
.rail.neg .gapbar { background: var(--bad); }
.rail .mk, .rail .ai { position: absolute; top: 50%; transform: translate(-50%, -50%); }
.rail .mk { left: calc(var(--m) * 1%); width: 14px; height: 14px; border-radius: 50%; background: var(--paper); border: 2.5px solid var(--mk); }
.rail .ai { left: calc(var(--a) * 1%); width: 12px; height: 12px; background: var(--accent); transform: translate(-50%, -50%) rotate(45deg); border: 2px solid var(--paper); box-shadow: 0 0 0 1px var(--accent); }
.rail.noai .gapbar, .rail.noai .ai { display: none; }
.rail.big { height: 54px; min-width: 0; margin-top: 4px; }
.rail.big::before { top: 25px; height: 6px; border-radius: 3px; }
.rail.big .gapbar { top: 23px; height: 10px; border-radius: 5px; }
.rail.big .mk { width: 22px; height: 22px; border-width: 4px; top: 28px; }
.rail.big .ai { width: 20px; height: 20px; top: 28px; border-width: 3px; }
.rail.big .lab { position: absolute; top: 0; transform: translateX(-50%); font-size: .82rem; font-weight: 700; white-space: nowrap; }
.rail.big .lab.mkl { left: calc(var(--m) * 1%); color: var(--mk); top: 46px; }
.rail.big .lab.ail { left: calc(var(--a) * 1%); color: var(--accent); }
.rail.big { margin-bottom: 18px; }
.rail.big.anim .ai { animation: aislide 1s cubic-bezier(.2, .75, .2, 1) .25s both; }
.rail.big.anim .gapbar { animation: gapgrow 1s cubic-bezier(.2, .75, .2, 1) .25s both; }
@keyframes aislide { from { left: calc(var(--m) * 1%); } }
@keyframes gapgrow { from { left: calc(var(--m) * 1%); width: 0; } }
.scale { display: flex; justify-content: space-between; color: var(--faint); font-size: .75rem; margin-top: 0; }

/* Slips: the recommended bets, drawn like the thing they are */
.slips { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.slip { position: relative; display: flex; flex-direction: column; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.slip .head { padding: 14px 16px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.slip .where { display: flex; justify-content: space-between; gap: 8px; color: var(--mute); font-size: .85rem; }
.slip .what { font-weight: 700; font-size: 1.08rem; line-height: 1.25; }
.slip .buy { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.slip .gap { font-size: 2.5rem; line-height: 1; color: var(--good); }
.slip .gap small { font-size: 1rem; font-weight: 700; color: var(--mute); margin-left: 3px; font-stretch: 85%; }
.slip .stub { position: relative; border-top: 2px dashed var(--line); padding: 12px 16px 14px; display: flex; flex-direction: column; gap: 10px; }
.slip .stub::before, .slip .stub::after {
  content: ""; position: absolute; top: -9px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--notch); border: 1px solid var(--line);
}
.slip .stub::before { left: -9px; clip-path: inset(0 0 0 50%); }
.slip .stub::after { right: -9px; clip-path: inset(0 50% 0 0); }
.slip .nums { color: var(--mute); font-size: .88rem; }
.slip .acts { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 99px; font-size: .82rem; font-weight: 700; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.chip.no { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.chip.plain { background: var(--bg-2); color: var(--mute); }
.legs { display: flex; flex-direction: column; gap: 7px; }
.legs .leg { display: flex; gap: 8px; align-items: baseline; font-weight: 600; line-height: 1.3; }
.legs .leg .chip { flex: none; }

/* Hero slip: the best gap right now */
.hero { margin-top: 26px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 36px; padding: 22px 26px 20px; border-radius: 14px; background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow); border-top: 5px solid var(--accent); }
.hero .big-gap { font-size: clamp(4rem, 9vw, 7rem); line-height: .9; color: var(--good); text-align: right; }
.hero .big-gap small { font-size: 1.4rem; margin-left: 4px; color: var(--mute); font-stretch: 85%; }
.hero .what { font-size: clamp(1.4rem, 2.6vw, 2.1rem); font-stretch: 78%; font-weight: 800; line-height: 1.08; margin: 2px 0 6px; }
.hero .where { color: var(--mute); }
.hero .rail { grid-column: 1 / -1; margin-top: 20px; }
.hero .scale { grid-column: 1 / -1; }
.hero .foot { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; margin-top: 8px; padding-top: 14px; border-top: 1px dashed var(--line); }
.hero .foot .nums { color: var(--mute); }
.hero.empty { display: block; border-top-color: var(--line); }
.hero.empty p { margin: 6px 0 0; color: var(--mute); max-width: 64ch; }

/* Stamp: shows when you paper-bet something */
.stamp { position: absolute; right: 14px; top: 46px; transform: rotate(-9deg); border: 3px solid var(--good); color: var(--good); border-radius: 8px; padding: 2px 12px; font-weight: 800; font-stretch: 72%; font-size: 1.6rem; letter-spacing: .06em; background: transparent; pointer-events: none; animation: stamp .35s cubic-bezier(.2, 1.4, .4, 1) both; opacity: .92; }
@keyframes stamp { from { transform: rotate(-9deg) scale(1.9); opacity: 0; } }

/* Section scaffolding */
.sec { margin-top: 34px; }
.sec-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 28px; align-items: start; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--mute); font-size: .85rem; align-items: center; }
.legend i { display: inline-block; vertical-align: -3px; margin-right: 6px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend span i { margin-right: 0; vertical-align: 0; }
.legend .k-mk { width: 12px; height: 12px; border-radius: 50%; border: 2.5px solid var(--mk); background: var(--paper); }
.legend .k-ai { width: 10px; height: 10px; background: var(--accent); transform: rotate(45deg); margin-right: 8px; }

/* Tabs */
.toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.tabs { display: flex; gap: 2px; overflow-x: auto; }
.tabs button { position: relative; border: 0; background: transparent; padding: 10px 14px 11px; cursor: pointer; font-weight: 600; color: var(--mute); white-space: nowrap; }
.tabs button span { margin-left: 6px; color: var(--faint); font-weight: 500; font-size: .85rem; }
.tabs button[aria-selected="true"] { color: var(--ink); }
.tabs button[aria-selected="true"]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 3px; border-radius: 2px 2px 0 0; background: var(--accent); }
.search { position: relative; margin-bottom: 8px; }
.search input { font: inherit; width: 230px; max-width: 100%; padding: 7px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink); }
.search input::placeholder { color: var(--faint); }

/* The board: games and their bets */
.game { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 14px; overflow: hidden; }
.game-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 12px 16px 10px; background: var(--panel); border-bottom: 1px solid var(--line); }
.game-h .meta { color: var(--mute); font-size: .85rem; }
.cols, .r { display: grid; grid-template-columns: minmax(0, 1fr) 58px 58px minmax(100px, 150px) 48px 124px; gap: 6px 14px; align-items: center; padding: 8px 14px 8px 16px; }
.cols { color: var(--faint); font-size: .78rem; padding-top: 8px; padding-bottom: 2px; }
.cols .r-t { text-align: right; }
.r { border-top: 1px solid var(--line-2); position: relative; }
.cols + .r { border-top: 0; }
.r:hover { background: var(--panel); }
.r.cover::before { content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.r .bet { min-width: 0; font-weight: 600; line-height: 1.3; }
.r .bet small { display: block; color: var(--mute); font-weight: 500; font-size: .78rem; }
.r .px, .r .aiv, .r .gp { text-align: right; font-size: 1.15rem; line-height: 1; }
.r .aiv.dim, .r .gp.dim { color: var(--faint); }
.r .gp.pos { color: var(--good); }
.r .gp.neg { color: var(--bad); }
.r .px .u { font-size: .8rem; color: var(--mute); margin-left: 1px; font-weight: 700; }
.r .acts { display: flex; justify-content: flex-end; gap: 0; }
.why-b { border: 0; background: transparent; padding: 0; margin-top: 3px; color: var(--accent); font-weight: 600; font-size: .8rem; cursor: pointer; text-align: left; display: block; }
.why { grid-column: 1 / -1; background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 6px; padding: 9px 12px; font-size: .92rem; line-height: 1.5; margin: 2px 0 4px; max-width: 78ch; }
.why small { display: block; color: var(--mute); margin-top: 5px; font-size: .78rem; }
.more { display: block; width: 100%; border: 0; border-top: 1px solid var(--line-2); background: transparent; padding: 9px; color: var(--accent); font-weight: 700; cursor: pointer; }
.more:hover { background: var(--panel); }
.none { padding: 34px 18px; text-align: center; color: var(--mute); background: var(--paper); border: 1px dashed var(--line); border-radius: 12px; }
.none b { color: var(--ink); }

/* Size box next to paper-bet buttons */
.amtl { display: inline-flex; align-items: center; gap: 4px; color: var(--mute); font-size: .8rem; }
.amtl.c .amt { width: 52px; }
.amt { width: 62px; font: inherit; font-size: .88rem; padding: 4px 7px; border: 1px solid var(--line); border-radius: 7px; background: var(--paper); color: var(--ink); }

/* Side panel: combo builder */
.aside { position: sticky; top: 78px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 16px; box-shadow: var(--shadow); }
.aside h3 { font-size: 1.35rem; }
.aside .fine { color: var(--mute); font-size: .88rem; }
.leg-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line-2); }
.leg-row .t { line-height: 1.3; font-weight: 600; }
.leg-row .t .chip { margin-right: 6px; }
.sumbox:empty { display: none; }
.sumbox { margin-top: 10px; padding-top: 10px; border-top: 2px solid var(--ink); display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; }
.sumbox dt { color: var(--mute); }
.sumbox dd { margin: 0; text-align: right; font-size: 1.25rem; }
.fab { display: none; }

/* Manage checks panel */
.sched { margin-top: 18px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; box-shadow: var(--shadow); }
.sched .it { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 8px 0; border-top: 1px solid var(--line-2); }
.sched .it.off .lbl { text-decoration: line-through; color: var(--mute); }
.sched .frm { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.sched select, .sched input { font: inherit; padding: 6px 9px; border-radius: 8px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); }

/* ---------- phone alerts and backups (bottom of the Board) ---------- */
.utils { margin: 40px 0 0; max-width: 980px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.utils .t { display: flex; gap: 14px 24px; justify-content: space-between; align-items: center; flex-wrap: wrap; padding: 14px 18px; }
.utils .t + .t { border-top: 1px solid var(--line-2); }
.utils .tl { display: grid; gap: 3px; min-width: 0; flex: 1 1 380px; }
.utils .tl > b { font-size: 1rem; }
.utils .tl .mute { font-size: .9rem; line-height: 1.45; max-width: 66ch; }
.utils .ta { display: flex; gap: 8px; flex-wrap: wrap; }
.utils .topic { display: block; margin-top: 4px; padding: 7px 10px; width: fit-content; max-width: 100%; overflow-wrap: anywhere; font: 600 .9rem ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; user-select: all; }
.utils .tmsg { margin: 0; padding: 10px 18px 14px; color: var(--mute); font-size: .9rem; border-top: 1px solid var(--line-2); }
.icon-btn:disabled { opacity: .5; cursor: not-allowed; }

.foot-note { margin: 44px 0 34px; color: var(--faint); font-size: .82rem; max-width: 80ch; }

/* ---------- Results page ---------- */
.verdict { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 40px; align-items: end; margin-top: 26px; }
.verdict .big { font-size: clamp(4rem, 10vw, 7.5rem); line-height: .85; }
.verdict .big small { font-size: 1.3rem; color: var(--mute); margin-left: 6px; font-stretch: 85%; }
.verdict p { margin: 0; font-size: 1.15rem; line-height: 1.45; max-width: 60ch; }
.verdict .cap { color: var(--mute); margin-bottom: 8px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 28px; align-items: stretch; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px 18px; box-shadow: var(--shadow); }
.panel h3 { margin-bottom: 2px; }
.panel .sub { margin-bottom: 12px; font-size: .9rem; }
.chart { width: 100%; position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { font-family: inherit; fill: var(--mute); font-size: 11px; }
.chart .gl { stroke: var(--line-2); stroke-width: 1; }
.chart .z { stroke: var(--ink); stroke-width: 1.5; }
.tip { position: absolute; z-index: 5; pointer-events: none; background: var(--ink); color: var(--paper); padding: 6px 9px; border-radius: 7px; font-size: .82rem; line-height: 1.35; max-width: 240px; box-shadow: var(--shadow); }
.empty-chart { padding: 40px 10px; text-align: center; color: var(--mute); }
.types .t-row { display: grid; grid-template-columns: 168px minmax(0, 1fr) 76px; gap: 6px 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line-2); }
.types .t-row:first-child { border-top: 0; }
.types .nm { font-weight: 600; }
.types .nm small { display: block; color: var(--mute); font-weight: 500; font-size: .78rem; }
.types .bar { position: relative; height: 18px; }
.types .bar::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 1.5px; background: var(--ink); opacity: .5; }
.types .bar i { position: absolute; top: 3px; bottom: 3px; border-radius: 3px; }
.types .val { text-align: right; font-size: 1.15rem; }
.filters { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin-bottom: 10px; }
.chips { display: inline-flex; gap: 2px; padding: 3px; background: var(--bg-2); border-radius: 9px; }
.chips button { border: 0; background: transparent; padding: 4px 11px; border-radius: 7px; cursor: pointer; font-weight: 600; font-size: .85rem; color: var(--mute); }
.chips button[aria-pressed="true"] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .15); }
.table-wrap { overflow-x: auto; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th { text-align: left; font-weight: 600; color: var(--mute); font-size: .82rem; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--panel); white-space: nowrap; }
td { padding: 9px 12px; border-top: 1px solid var(--line-2); vertical-align: top; }
tbody tr:first-child td { border-top: 0; }
td.r-t, th.r-t { text-align: right; }
td .sm { color: var(--mute); font-size: .78rem; display: block; }
.st { font-weight: 700; }
.st.win { color: var(--good); }
.st.loss { color: var(--bad); }
.st.open { color: var(--mute); }
.cost-bars { display: flex; align-items: flex-end; gap: 4px; height: 70px; margin-top: 8px; }
.cost-bars i { flex: 1; background: var(--accent); border-radius: 3px 3px 0 0; min-height: 2px; opacity: .85; }
.cost-bars i.today { opacity: 1; }
.cost-lab { display: flex; justify-content: space-between; color: var(--faint); font-size: .75rem; margin-top: 4px; }
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 2px solid var(--ink); margin-top: 26px; }
.stats-row .cell { padding: 12px 18px; border-left: 1px solid var(--line); }
.stats-row .cell:first-child { border-left: 0; padding-left: 0; }
.stats-row .k { color: var(--mute); font-size: .86rem; }
.stats-row .v { font-size: 2rem; line-height: 1.05; margin: 2px 0; }
.stats-row .d { color: var(--mute); font-size: .85rem; }

/* ---------- Narrow screens ---------- */
@media (max-width: 1100px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .aside { position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 40; border-radius: 16px 16px 0 0; max-height: 78vh; overflow: auto; transform: translateY(105%); visibility: hidden; transition: transform .25s ease, visibility 0s .25s; box-shadow: 0 -20px 40px rgba(0, 0, 0, .35); }
  .aside.open { transform: none; visibility: visible; }
  .fab { display: inline-flex; position: fixed; right: 16px; bottom: 16px; z-index: 35; box-shadow: var(--shadow); min-height: 46px; padding: 8px 18px; border-radius: 99px; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .wrap { padding: 0 14px; }
  .top .wrap { gap: 8px; min-height: 56px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
  .brand { font-size: 1.5rem; }
  .nav { order: 5; width: 100%; margin: 0; }
  .ledger, .stats-row { grid-template-columns: 1fr 1fr; }
  .ledger .cell:nth-child(3), .stats-row .cell:nth-child(3) { border-left: 0; padding-left: 0; }
  .ledger .cell:nth-child(n+3), .stats-row .cell:nth-child(n+3) { border-top: 1px solid var(--line); }
  .ledger .v, .stats-row .v { font-size: 1.6rem; }
  .hero { grid-template-columns: minmax(0, 1fr); padding: 18px 16px; }
  .hero .big-gap { text-align: left; order: -1; }
  .verdict { grid-template-columns: minmax(0, 1fr); }
  .cols { display: none; }
  .r { grid-template-columns: 54px 54px minmax(0, 1fr) 42px; grid-template-areas: "bet bet bet bet" "px ai trk gp" "acts acts acts acts"; gap: 6px 10px; padding: 10px 14px; }
  .r .bet { grid-area: bet; }
  .r .px { grid-area: px; text-align: left; }
  .r .aiv { grid-area: ai; text-align: left; }
  .r .rail { grid-area: trk; }
  .r .gp { grid-area: gp; }
  .r .acts { grid-area: acts; justify-content: flex-start; }
  .types .t-row { grid-template-columns: 118px minmax(0, 1fr) 62px; }
  .search input { width: 100%; }
  .toolbar { align-items: stretch; }
  .search { width: 100%; margin-bottom: 10px; }
  /* bet table turns into stacked rows on a phone */
  table.bets thead { display: none; }
  table.bets, table.bets tbody { display: block; }
  table.bets tr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 12px; padding: 12px 14px; border-top: 1px solid var(--line-2); }
  table.bets tbody tr:first-child { border-top: 0; }
  table.bets td { display: block; border: 0; padding: 0; text-align: left; }
  table.bets .c-bet { order: 1; flex: 1 1 calc(100% - 96px); min-width: 0; font-weight: 600; line-height: 1.3; }
  table.bets .c-pr { order: 2; flex: 0 0 auto; font-size: 1.1rem; font-weight: 800; font-variant-numeric: tabular-nums; }
  table.bets .c-paper { order: 3; flex: 1 1 calc(100% - 150px); color: var(--mute); }
  table.bets .c-paper .sm { display: inline; margin-left: 6px; }
  table.bets .c-st { order: 4; flex: 0 0 auto; font-weight: 700; }
  table.bets .c-del { order: 5; flex: 0 0 auto; align-self: center; }
  table.bets .c-time, table.bets .c-ai, table.bets .c-gap, table.bets .c-move { order: 6; font-size: .78rem; color: var(--mute); }
  table.bets .c-time { flex: 1 1 100%; }
  table.bets .c-time .sm { display: inline; margin-left: 6px; }
  table.bets .c-ai::before { content: "AI "; }
  table.bets .c-gap::before { content: "Gap "; }
  table.bets .c-move::before { content: "Moved "; }
  table.bets td[colspan] { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
