/* ---------- tokens (dark first) ---------- */
:root {
  color-scheme: dark;
  --bg: #0a0b0d; --bg-2: #0e1013; --surface: #13161a; --surface-2: #1a1e24; --surface-3: #232831;
  --line: #22262e; --line-2: #2f3540;
  --text: #f2f4f7; --text-2: #a7aebb; --muted: #6f7684;
  --accent: #c4f04d; --accent-ink: #0b0d06; --accent-text: #c4f04d; --accent-soft: rgb(196 240 77 / 0.12);
  --hot: #ff8a3d; --hot-soft: rgb(255 138 61 / 0.12);
  --good: #3ddc84; --good-text: #5be39a; --good-soft: rgb(61 220 132 / 0.12);
  --warn: #ffb547; --warn-text: #ffc66e; --warn-soft: rgb(255 181 71 / 0.12);
  --bad: #ff5c5c; --bad-text: #ff7b7b; --bad-soft: rgb(255 92 92 / 0.12);
  --s1: #3987e5; --s2: #d95926; --s3: #199e70;
  --radius: 16px; --radius-s: 10px;
  --shadow: 0 10px 40px rgb(0 0 0 / 0.45);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --bar-bg: rgb(10 11 13 / 0.85);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #f4f5f7; --bg-2: #eceef2; --surface: #ffffff; --surface-2: #f3f4f6; --surface-3: #e8eaee;
    --line: #e4e6eb; --line-2: #d4d8de;
    --text: #0b0d12; --text-2: #4a5160; --muted: #7b8291;
    --accent-text: #3d6b00; --accent-soft: rgb(120 170 20 / 0.14);
    --hot: #d9620f; --hot-soft: rgb(217 98 15 / 0.1);
    --good: #12a150; --good-text: #0b7a3b; --good-soft: rgb(18 161 80 / 0.1);
    --warn: #f0a020; --warn-text: #8a5600; --warn-soft: rgb(240 160 32 / 0.14);
    --bad: #e03e3e; --bad-text: #b42323; --bad-soft: rgb(224 62 62 / 0.1);
    --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a;
    --shadow: 0 10px 40px rgb(15 20 30 / 0.12);
    --bar-bg: rgb(244 245 247 / 0.88);
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f5f7; --bg-2: #eceef2; --surface: #ffffff; --surface-2: #f3f4f6; --surface-3: #e8eaee;
  --line: #e4e6eb; --line-2: #d4d8de; --text: #0b0d12; --text-2: #4a5160; --muted: #7b8291;
  --accent-text: #3d6b00; --accent-soft: rgb(120 170 20 / 0.14); --hot: #d9620f; --hot-soft: rgb(217 98 15 / 0.1);
  --good: #12a150; --good-text: #0b7a3b; --good-soft: rgb(18 161 80 / 0.1);
  --warn: #f0a020; --warn-text: #8a5600; --warn-soft: rgb(240 160 32 / 0.14);
  --bad: #e03e3e; --bad-text: #b42323; --bad-soft: rgb(224 62 62 / 0.1);
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --shadow: 0 10px 40px rgb(15 20 30 / 0.12); --bar-bg: rgb(244 245 247 / 0.88);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, p { margin: 0; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.pos { color: var(--good-text); } .neg { color: var(--bad-text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- shell ---------- */
.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.rail {
  position: sticky; top: 0; height: 100vh; padding: 22px 14px; display: flex; flex-direction: column; gap: 26px;
  background: var(--bg-2); border-right: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; font-weight: 800; letter-spacing: -0.02em; font-size: 17px; }
.logo { width: 32px; height: 32px; border-radius: 10px; background: var(--accent); display: grid; place-items: center; flex: none; color: var(--accent-ink); }
.logo svg { width: 18px; height: 18px; }
.nav { display: grid; gap: 2px; }
.nav button {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 0; border-radius: 12px; background: none;
  color: var(--text-2); font-weight: 550; text-align: left; transition: background 0.15s, color 0.15s;
}
.nav button:hover { background: var(--surface); color: var(--text); }
.nav button[aria-current="page"] { background: var(--surface-2); color: var(--text); }
.nav button[aria-current="page"] svg { color: var(--accent-text); }
.nav svg, .tabbar svg { width: 20px; height: 20px; flex: none; }
.nav .badge { margin-left: auto; }
.rail-foot { margin-top: auto; display: grid; gap: 14px; padding: 0 4px; }
.status { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.dot { width: 7px; height: 7px; border-radius: 99px; background: var(--good); box-shadow: 0 0 0 3px var(--good-soft); flex: none; }
.dot.off { background: var(--muted); box-shadow: none; }
.who { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-2); }
.avatar { width: 28px; height: 28px; border-radius: 99px; background: var(--surface-3); display: grid; place-items: center; font-weight: 700; font-size: 12px; color: var(--text); flex: none; }
.linkbtn { border: 0; background: none; color: var(--muted); font-size: 12px; padding: 0; text-decoration: underline; text-underline-offset: 2px; }

.mbar { display: none; }
.main { padding: 32px 36px 140px; max-width: 1200px; width: 100%; min-width: 0; }
.tabbar { display: none; }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 12px;
  padding: 9px 16px; font-weight: 650; font-size: 14px; background: var(--accent); color: var(--accent-ink); white-space: nowrap;
  transition: transform 0.12s var(--ease), filter 0.15s;
}
.btn svg { width: 16px; height: 16px; flex: none; }
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; pointer-events: none; }
.btn.ghost { background: var(--surface-2); color: var(--text); border-color: var(--line-2); }
.btn.sm { padding: 6px 12px; font-size: 13px; border-radius: 10px; }
.btn.block { width: 100%; }
.iconbtn { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text-2); flex: none; }
.iconbtn svg { width: 18px; height: 18px; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 2px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { border: 0; background: none; padding: 6px 12px; border-radius: 9px; color: var(--text-2); font-weight: 550; font-size: 13.5px; white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--surface-3); color: var(--text); }
.seg button .n { color: var(--muted); margin-left: 5px; font-weight: 500; }
.seg.lang button { padding: 4px 10px; font-size: 12px; font-weight: 700; }
.field { display: inline-flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; height: 40px; color: var(--muted); max-width: 100%; }
.field input, .field select { border: 0; background: none; outline: none; color: var(--text); height: 100%; min-width: 0; }
.field select option { background: var(--surface); color: var(--text); }
.field svg { width: 16px; height: 16px; flex: none; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 18px 0 8px; }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); font-size: 11.5px; font-weight: 800; display: inline-grid; place-items: center; }
.badge:empty { display: none; }
.odds-in {
  width: 92px; height: 38px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg);
  font-variant-numeric: tabular-nums; font-weight: 600; outline: none; transition: border-color 0.15s;
}
.odds-in:focus { border-color: var(--accent); }
.odds-in::placeholder { color: var(--muted); font-weight: 500; }

/* ---------- page ---------- */
.page-h h1 { font-size: 28px; font-weight: 800; letter-spacing: -0.03em; }
.page-h p { color: var(--text-2); margin-top: 4px; }
.section { margin-top: 34px; }
.section-h { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.section-h h2 { font-size: 18px; font-weight: 750; letter-spacing: -0.02em; }
.section-h p { color: var(--muted); font-size: 13.5px; max-width: 680px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.empty { padding: 36px 20px; text-align: center; color: var(--text-2); }
.empty b { display: block; color: var(--text); font-size: 15px; margin-bottom: 4px; }
.note { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 12px 14px; font-size: 13.5px; color: var(--text-2); }
.note b { color: var(--text); }
.budget { display: flex; align-items: center; gap: 12px; padding: 12px 16px; flex-wrap: wrap; font-size: 13.5px; color: var(--text-2); }
.budget input { width: 64px; height: 32px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--bg); font-weight: 650; }
.meter { flex: 1 1 140px; height: 6px; background: var(--surface-3); border-radius: 99px; overflow: hidden; min-width: 90px; }
.meter > span { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width 0.3s var(--ease); }
.meter.over > span { background: var(--bad); }

/* ---------- generated tickets ---------- */
.tix { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.tk { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.tk-h { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.tk-mult { font-size: 30px; font-weight: 900; letter-spacing: -0.04em; color: var(--accent-text); line-height: 1; }
.tk.hot .tk-mult { color: var(--hot); }
.tk-h > div { flex: 1; min-width: 0; }
.tk-h b { display: block; font-weight: 750; }
.tk-h small { color: var(--muted); font-size: 12.5px; }
.tk-chance { text-align: right; }
.tk-chance strong { display: block; font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.tk-chance small { color: var(--muted); font-size: 12px; }
.tk-legs { padding: 4px 0; }
.tk-leg { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 10px 18px; border-top: 1px solid var(--line); }
.tk-leg:first-child { border-top: 0; }
.tk-leg .m { font-size: 12.5px; color: var(--muted); display: flex; gap: 6px; align-items: center; min-width: 0; }
.tk-leg .m span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-leg .s { font-weight: 700; grid-column: 1; }
.tk-leg .o { grid-column: 2; grid-row: 1 / span 2; text-align: right; align-self: center; }
.tk-leg .o b { display: block; font-variant-numeric: tabular-nums; font-size: 15px; }
.tk-leg .o small { color: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.tk-f { margin-top: auto; padding: 14px 18px; border-top: 1px solid var(--line); background: var(--surface-2); display: grid; gap: 12px; }
.tk-sum { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--text-2); }
.tk-sum b { color: var(--text); font-variant-numeric: tabular-nums; }
.tk-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tk-actions .btn { flex: 1; }
.chancebar { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.chancebar span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.tk.hot .chancebar span { background: var(--hot); }
.honest { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; margin-top: 14px; }
.honest svg { width: 20px; height: 20px; flex: none; color: var(--warn-text); margin-top: 1px; }
.honest p { font-size: 13.5px; color: var(--text-2); }
.honest b { color: var(--text); }

.combo { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; margin-bottom: 14px; flex-wrap: wrap; }
.combo b { display: block; font-weight: 700; }
.combo small { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }

/* ---------- pick cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.card { padding: 16px; display: flex; flex-direction: column; gap: 14px; transition: border-color 0.2s; }
.card:hover { border-color: var(--line-2); }
.meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.lg { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.lg span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc { font-size: 10px; font-weight: 800; letter-spacing: 0.04em; padding: 2px 5px; border-radius: 5px; background: var(--surface-3); color: var(--text-2); flex: none; }
.teams { font-weight: 650; line-height: 1.35; }
.teams span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick { display: flex; align-items: center; gap: 14px; background: var(--surface-2); border-radius: 12px; padding: 12px 14px; }
.pick .sel { flex: 1; min-width: 0; }
.pick .sel b { display: block; font-size: 16px; font-weight: 750; letter-spacing: -0.01em; }
.pick .sel small { color: var(--muted); font-size: 12px; }
.ring { width: 54px; height: 54px; flex: none; position: relative; }
.ring svg { width: 54px; height: 54px; transform: rotate(-90deg); }
.ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 13.5px; font-weight: 750; font-variant-numeric: tabular-nums; }
.prices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.prices div { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; }
.prices small { display: block; color: var(--muted); font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.05em; }
.prices strong { font-size: 20px; font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.prices .hl { border-color: rgb(196 240 77 / 0.35); background: var(--accent-soft); }
.prices .hl strong { color: var(--accent-text); }
.check { display: flex; align-items: center; gap: 10px; }
.verdict { font-size: 12.5px; color: var(--muted); display: flex; gap: 7px; align-items: center; min-height: 20px; line-height: 1.3; }
.verdict .ic { width: 18px; height: 18px; border-radius: 99px; display: grid; place-items: center; font-size: 10px; font-weight: 900; flex: none; }
.verdict.good { color: var(--good-text); } .verdict.good .ic { background: var(--good); color: #04140a; }
.verdict.warn { color: var(--warn-text); } .verdict.warn .ic { background: var(--warn); color: #261800; }
.verdict.bad { color: var(--bad-text); } .verdict.bad .ic { background: var(--bad); color: #fff; }
.card .actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: auto; }
.on-slip { background: var(--accent-soft) !important; border-color: rgb(196 240 77 / 0.45) !important; color: var(--accent-text) !important; }

/* ---------- matches ---------- */
.lgroup { margin-top: 16px; overflow: hidden; }
.lgroup-h { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); font-weight: 700; font-size: 13.5px; }
.lgroup-h .muted { font-weight: 500; margin-left: auto; font-size: 12.5px; }
.mrow { display: grid; grid-template-columns: 64px minmax(0, 1fr) 232px 84px; gap: 14px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--line); }
.mrow:first-of-type { border-top: 0; }
.mrow .when { font-weight: 700; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.mrow .when small { display: block; font-weight: 500; color: var(--muted); font-size: 11.5px; }
.mrow .teams { font-size: 14.5px; border: 0; background: none; text-align: left; padding: 0; min-width: 0; color: var(--text); }
.obs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.ob {
  border: 1px solid var(--line-2); background: var(--surface-2); border-radius: 10px; padding: 5px 8px; display: flex;
  justify-content: space-between; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; transition: border-color 0.15s, background 0.15s;
}
.ob:hover { border-color: var(--muted); }
.ob small { color: var(--muted); font-size: 11.5px; font-weight: 700; }
.ob b { font-weight: 700; font-size: 14px; }
.more { border: 0; background: none; color: var(--text-2); font-size: 12.5px; font-weight: 650; display: inline-flex; align-items: center; gap: 2px; justify-self: end; padding: 6px 4px; white-space: nowrap; }
.more:hover { color: var(--text); }

/* ---------- drawers ---------- */
.scrim { position: fixed; inset: 0; background: rgb(0 0 0 / 0.55); backdrop-filter: blur(2px); z-index: 30; opacity: 0; transition: opacity 0.25s; }
.scrim.show { opacity: 1; }
.drawer {
  position: fixed; top: 0; right: 0; height: 100vh; height: 100dvh; width: min(440px, 100vw); z-index: 40; background: var(--bg-2);
  border-left: 1px solid var(--line); box-shadow: var(--shadow); display: flex; flex-direction: column;
  transform: translateX(105%); transition: transform 0.32s var(--ease), visibility 0s linear 0.32s; visibility: hidden;
}
.drawer.wide { width: min(760px, 100vw); }
.drawer.open { transform: none; visibility: visible; transition: transform 0.32s var(--ease); }
.drawer-h { display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.drawer-h > div { flex: 1; min-width: 0; }
.drawer-h h2 { font-size: 18px; font-weight: 800; letter-spacing: -0.02em; }
.drawer-b { flex: 1; overflow-y: auto; padding: 16px 20px 28px; overscroll-behavior: contain; }
.drawer-f { border-top: 1px solid var(--line); padding: 14px 20px calc(14px + env(safe-area-inset-bottom)); display: grid; gap: 10px; background: var(--bg-2); }
.grab { display: none; }
.slipfab {
  position: fixed; right: 28px; bottom: 28px; z-index: 25; border: 0; border-radius: 99px; padding: 12px 18px 12px 16px;
  background: var(--accent); color: var(--accent-ink); font-weight: 800; display: inline-flex; gap: 10px; align-items: center;
  box-shadow: 0 8px 30px rgb(196 240 77 / 0.25); transition: transform 0.15s var(--ease);
}
.slipfab[hidden] { display: none; }
.slipfab:active { transform: scale(0.96); }
.slipfab .badge { background: var(--accent-ink); color: var(--accent); }
.slipfab svg { width: 18px; height: 18px; }

.leg { padding: 12px 14px; display: grid; gap: 8px; margin-bottom: 10px; }
.leg-top { display: flex; gap: 10px; align-items: flex-start; }
.leg-top div { flex: 1; min-width: 0; }
.leg-top b { display: block; }
.leg-top small { color: var(--muted); font-size: 12px; }
.leg-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); }
.x { border: 0; background: none; color: var(--muted); font-size: 20px; line-height: 1; padding: 0 4px; }
.x:hover { color: var(--text); }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stat { padding: 12px 14px; }
.stat small { display: block; color: var(--muted); font-size: 12px; font-weight: 600; }
.stat strong { display: block; font-size: 22px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; margin-top: 2px; }
.stat p { font-size: 12px; color: var(--muted); }

/* match sheet */
.sheet-teams { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.25; }
.sheet-sub { color: var(--muted); font-size: 13px; margin-top: 4px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.tabs2 { display: flex; gap: 4px; padding: 0 20px; border-bottom: 1px solid var(--line); }
.tabs2 button { border: 0; background: none; padding: 12px 6px; margin-right: 14px; color: var(--muted); font-weight: 650; border-bottom: 2px solid transparent; }
.tabs2 button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; margin-bottom: 12px; }
.chips::-webkit-scrollbar { display: none; }
.chip { border: 1px solid var(--line-2); background: var(--surface); border-radius: 99px; padding: 5px 12px; font-size: 13px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.chip[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.mkgroup { margin-bottom: 18px; overflow: hidden; }
.mkgroup h4 { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); font-weight: 700; padding: 10px 12px 4px; }
.mk {
  display: grid; grid-template-columns: minmax(0, 1fr) 150px 56px 64px 36px; gap: 12px; align-items: center;
  padding: 9px 12px; border-top: 1px solid var(--line); font-size: 14px;
}
.mkgroup h4 + .mk { border-top: 0; }
.mk .lbl { min-width: 0; }
.mk .lbl span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.bar i { flex: 1; height: 5px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.bar i span { display: block; height: 100%; background: var(--text-2); border-radius: 99px; }
.mk .fair { color: var(--text-2); font-variant-numeric: tabular-nums; text-align: right; }
.mk .min { font-weight: 750; color: var(--accent-text); font-variant-numeric: tabular-nums; text-align: right; }
.mk .odds-in { width: 100%; height: 34px; }
.mk .add { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text-2); font-weight: 800; }
.mk .verdict { grid-column: 1 / -1; min-height: 0; }
.mk .verdict:empty { display: none; }
.mk-head { display: grid; grid-template-columns: minmax(0, 1fr) 150px 56px 64px 36px; gap: 10px; font-size: 11px; color: var(--muted); font-weight: 650; text-transform: uppercase; letter-spacing: 0.05em; padding: 0 12px 8px; }
.mk-head span:nth-child(3), .mk-head span:nth-child(4) { text-align: right; }
.mk-head { margin-top: 2px; }
.ctx { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ctx .panel { padding: 14px; }
.ctx .full { grid-column: 1 / -1; }
.ctx h4 { font-size: 14px; font-weight: 750; }
.ctx .sub { color: var(--muted); font-size: 12.5px; margin: 2px 0 10px; }
.form { display: flex; gap: 4px; margin-bottom: 10px; }
.form span { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; font-size: 11px; font-weight: 800; color: #fff; }
.form .W { background: var(--good); color: #04140a; } .form .D { background: var(--surface-3); color: var(--text); } .form .L { background: var(--bad); }
.games { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.games td { padding: 3px 0; color: var(--text-2); }
.games td:last-child { text-align: right; color: var(--muted); }
.games td:nth-child(2) { text-align: right; font-weight: 650; color: var(--text); padding-right: 8px; white-space: nowrap; }
.scores { display: flex; gap: 6px; flex-wrap: wrap; }
.scores span { background: var(--surface-2); border-radius: 8px; padding: 4px 10px; font-size: 13px; font-variant-numeric: tabular-nums; }
.scores b { margin-right: 6px; }

/* ---------- tables (bets, evidence) ---------- */
.tbl { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-size: 11.5px; color: var(--muted); font-weight: 650; text-transform: uppercase; letter-spacing: 0.05em; padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 11px 14px; border-top: 1px solid var(--line); vertical-align: top; }
table.t tbody tr:first-child td { border-top: 0; }
table.t .r { text-align: right; white-space: nowrap; }
table.t .sm { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.status-pill { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 99px; white-space: nowrap; display: inline-block; }
.status-pill.won, .status-pill.part-won { background: var(--good-soft); color: var(--good-text); }
.status-pill.lost, .status-pill.part-lost { background: var(--bad-soft); color: var(--bad-text); }
.status-pill.open, .status-pill.void { background: var(--surface-3); color: var(--text-2); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.tile { padding: 16px; }
.tile small { display: block; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.tile strong { display: block; font-size: 30px; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; margin: 2px 0; }
.tile p { color: var(--muted); font-size: 12px; }

/* evidence */
.panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; }
.chartcard { padding: 16px; }
.chartcard h4 { font-size: 14px; font-weight: 700; }
.chartcard .cap { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.chartcard svg { display: block; width: 100%; height: auto; overflow: visible; }
.legend { display: flex; gap: 18px; font-size: 12.5px; color: var(--text-2); flex-wrap: wrap; margin-bottom: 12px; }
.legend i { display: inline-block; width: 18px; border-top: 2px solid var(--text-2); vertical-align: middle; margin-right: 6px; }
.legend i.dash { border-top-style: dashed; border-top-color: var(--muted); }
.axis text { fill: var(--muted); font-size: 11px; font-family: inherit; }
.endlbl { fill: var(--text); font-size: 12px; font-weight: 700; font-family: inherit; }
.endlbl.m { fill: var(--muted); font-weight: 500; }
.calwrap { display: grid; grid-template-columns: minmax(0, 440px) 1fr; gap: 16px; align-items: start; }
.calwrap .note p + p { margin-top: 10px; }
details.tv { margin-top: 10px; font-size: 13px; }
details.tv summary { cursor: pointer; color: var(--text-2); }
details.tv table { border-collapse: collapse; margin-top: 6px; }
details.tv td, details.tv th { padding: 2px 14px 2px 0; text-align: right; font-variant-numeric: tabular-nums; }
.findings { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.finding { padding: 16px; }
.finding strong { display: block; font-size: 30px; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.finding p { color: var(--text-2); font-size: 13.5px; margin-top: 4px; }

/* gate */
.gate { max-width: 420px; margin: 12vh auto 0; padding: 28px; display: grid; gap: 14px; text-align: center; }
.gate .logo { width: 48px; height: 48px; margin: 0 auto; border-radius: 14px; }
.gate .logo svg { width: 26px; height: 26px; }
.gate h1 { font-size: 22px; font-weight: 800; }
.gate p { color: var(--text-2); font-size: 14px; }
.gate .seg { justify-self: center; }
.gate input { height: 46px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--bg); padding: 0 14px; font-size: 16px; text-align: center; }

/* overlays */
.tip { position: fixed; z-index: 60; pointer-events: none; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 8px 10px; font-size: 12px; box-shadow: var(--shadow); min-width: 140px; }
.tip .d { color: var(--muted); margin-bottom: 4px; }
.tip .r { display: flex; align-items: center; gap: 8px; color: var(--text-2); }
.tip .r b { font-size: 14px; color: var(--text); font-variant-numeric: tabular-nums; }
.tip .k { width: 14px; border-top: 2px solid; flex: none; }
.tip .k.dash { border-top-style: dashed; }
.toasts { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 70; display: grid; gap: 8px; pointer-events: none; }
.toast { background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-weight: 600; font-size: 14px; box-shadow: var(--shadow); animation: up 0.25s var(--ease); }
@keyframes up { from { opacity: 0; transform: translateY(8px); } }
dialog.log { border: 1px solid var(--line-2); border-radius: 20px; background: var(--surface); color: var(--text); padding: 22px; width: min(420px, calc(100vw - 32px)); box-shadow: var(--shadow); }
dialog.log::backdrop { background: rgb(0 0 0 / 0.55); backdrop-filter: blur(2px); }
dialog.log form { display: grid; gap: 14px; }
dialog.log h3 { font-size: 18px; font-weight: 800; }
dialog.log label { display: grid; gap: 6px; font-size: 12.5px; color: var(--text-2); font-weight: 600; }
dialog.log input { height: 44px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--bg); padding: 0 12px; font-size: 16px; font-weight: 650; }
dialog.log .row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .calwrap { grid-template-columns: 1fr; }
}
@media (max-width: 1023px) {
  .app { grid-template-columns: 1fr; grid-template-rows: auto 1fr; align-content: start; }
  .rail { display: none; }
  .mbar {
    display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 20; padding: 10px 16px;
    padding-top: calc(10px + env(safe-area-inset-top)); background: var(--bar-bg); backdrop-filter: blur(16px) saturate(1.4);
    -webkit-backdrop-filter: blur(16px) saturate(1.4); border-bottom: 1px solid var(--line);
  }
  .mbar .brand { padding: 0; font-size: 16px; flex: 1; min-width: 0; }
  .main { padding: 18px 16px calc(150px + env(safe-area-inset-bottom)); }
  .tabbar {
    display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: var(--bar-bg); backdrop-filter: blur(18px) saturate(1.4);
    -webkit-backdrop-filter: blur(18px) saturate(1.4); border-top: 1px solid var(--line);
  }
  .tabbar button { border: 0; background: none; color: var(--muted); display: grid; justify-items: center; gap: 3px; padding: 6px 0; font-size: 11px; font-weight: 600; border-radius: 10px; }
  .tabbar button[aria-current="page"] { color: var(--text); }
  .tabbar button[aria-current="page"] svg { color: var(--accent-text); }
  .slipfab { right: 16px; bottom: calc(76px + env(safe-area-inset-bottom)); }
  .toasts { bottom: calc(140px + env(safe-area-inset-bottom)); }
  .tix { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .page-h h1 { font-size: 24px; }
  .toolbar { gap: 8px; }
  .toolbar .seg, .toolbar .field { width: 100%; }
  .toolbar .seg button { flex: 1; }
  .mrow { grid-template-columns: 50px minmax(0, 1fr) auto; grid-template-areas: "when teams more" "obs obs obs"; row-gap: 8px; padding: 12px 14px; }
  .mrow .when { grid-area: when; } .mrow .teams { grid-area: teams; } .mrow .obs { grid-area: obs; } .mrow .more { grid-area: more; }
  .ob { padding: 8px 10px; }
  .mk { grid-template-columns: minmax(0, 1fr) 46px 50px 36px; grid-template-areas: "lbl fair min add" "bar bar bar add"; gap: 6px 10px; padding: 11px 12px; }
  .mk .lbl { grid-area: lbl; } .mk .bar { grid-area: bar; } .mk .fair { grid-area: fair; } .mk .min { grid-area: min; } .mk .add { grid-area: add; align-self: center; }
  .mk-head { display: none; }
  .ctx { grid-template-columns: 1fr; }
  .drawer, .drawer.wide {
    top: auto; bottom: 0; width: 100vw; height: 92vh; height: 92dvh; border-left: 0; border-top: 1px solid var(--line-2);
    border-radius: 22px 22px 0 0; transform: translateY(105%);
  }
  .drawer.open { transform: none; }
  .grab { display: block; width: 40px; height: 5px; border-radius: 99px; background: var(--line-2); margin: 8px auto 0; flex: none; }
  .drawer-h { padding: 12px 16px 14px; }
  .drawer-b { padding: 14px 16px 24px; }
  .tabs2 { padding: 0 16px; }
  .cards { grid-template-columns: 1fr; }
  .tk-h { padding: 14px 16px; }
  .tk-leg { padding: 10px 16px; }
  .tk-f { padding: 14px 16px; }
  table.t th, table.t td { padding: 10px; }
}
