/* StatsToGreen web UI — clean light + blue, Betfair-trader framing.
   The trade verdict (STRONG green / lean blue / sit-out grey) is the most prominent element. */
:root {
  /* brand tokens mirror the Flutter app (lib/theme.dart BrandColors) — green/cream */
  --bg: #f4f1ea; --surface: #ffffff; --surface-2: #f1f4f2;
  --ink: #17251e; --muted: #55675e; --faint: #8a9a90;
  --line: #e3e0d5; --line-strong: #d2dcd4;
  --primary: #0e6b45; --primary-ink: #0a5235; --on-primary: #ffffff;
  --home: #0e6b45; --away: #b5832b; --draw: #9fb3a8;
  --strong: #1f9d57; --strong-bg: #dcfce7; --strong-ink: #166534;
  --standard-bg: #eff7f2; --standard-border: #cbe6d8; --standard-ink: #135c3e;
  --lean: #135c3e; --lean-bg: #eff7f2; --lean-ink: #135c3e;
  --sit: #55675e; --sit-bg: #f1f4f2; --sit-ink: #55675e;
  --high: #166534; --high-bg: #dcfce7; --lean2-bg: #eff7f2; --tight: #55675e; --tight-bg: #f1f4f2;
  --edge: #8a5a0b; --edge-bg: #fbf0d9; --edge-line: #ead9ac;
  --amber: #8a5a0b; --amber-bg: #fbf0d9;
  --miss: #b42318; --miss-bg: #fdeaea;
  --info: #1d4ed8; --info-ink: #1d4ed8; --info-bg: #e7effb; --info-border: #c5d8f5;
  --shadow: 0 1px 2px rgba(15,27,45,.04), 0 4px 16px rgba(15,27,45,.06);
  --radius: 14px; --maxw: 620px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; background: var(--bg); }
body { color: var(--ink); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; padding-bottom: calc(28px + env(safe-area-inset-bottom)); }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 14px 32px; }
.screen-center { min-height: 60vh; display: grid; place-items: center; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line-strong); border-top-color: var(--primary); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.94); backdrop-filter: saturate(1.3) blur(8px); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: var(--maxw); margin: 0 auto; padding: 11px 14px 0; }
.brand { display: flex; align-items: center; gap: 8px; }
.brand .logo { width: 22px; height: 22px; border-radius: 7px; background: var(--primary); color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 800; }
.brand h1 { font-size: 17px; font-weight: 700; letter-spacing: -.2px; margin: 0; }
.brand h1 .pro { color: var(--primary); }
.brand .tag { font-size: 11px; color: var(--faint); margin-left: auto; }
.dates { display: flex; gap: 7px; overflow-x: auto; padding: 11px 0 3px; scrollbar-width: none; }
.dates::-webkit-scrollbar { display: none; }
.datechip { flex: 0 0 auto; padding: 6px 12px; border-radius: 11px; background: var(--surface); border: 1px solid var(--line-strong); text-align: center; min-width: 52px; line-height: 1.15; }
.datechip .dow { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.datechip .dnum { font-size: 14px; font-weight: 600; }
.datechip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.datechip.active .dow { color: rgba(255,255,255,.78); }
.tabs { display: flex; gap: 2px; padding: 9px 0 0; }
.tab { flex: 1; padding: 9px 4px 11px; text-align: center; border-bottom: 2.5px solid transparent; color: var(--muted); font-weight: 600; font-size: 14px; }
.tab .cnt { font-size: 11px; font-weight: 700; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); border-radius: 9px; padding: 1px 7px; margin-left: 5px; }
.tab.active { color: var(--ink); border-bottom-color: var(--primary); }
.tab.active .cnt { background: var(--primary); color: #fff; border-color: var(--primary); }

.sec-h { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin: 16px 2px 9px; display: flex; align-items: center; gap: 6px; }
.sec-h .ic { color: var(--strong); }
.sec-h.muted { color: var(--faint); }

/* trade verdict box */
.verdict { border-radius: 12px; padding: 11px 13px; margin: 9px 0; border: 1px solid; }
.verdict .vh { font-weight: 700; font-size: 14px; }
.verdict .vs { font-size: 12px; margin-top: 2px; opacity: .92; }
.verdict.strong { background: var(--strong-bg); border-color: var(--strong); border-width: 2px; color: var(--strong-ink); }
.verdict.lean { background: var(--lean-bg); border-color: #bcd6fb; color: var(--lean-ink); }
.verdict.sit_out { background: var(--sit-bg); border-color: var(--line-strong); color: var(--sit-ink); }
.verdict.big { padding: 14px 16px; margin: 4px 0 14px; }
.verdict.big .vh { font-size: 16px; }
.verdict.big .vs { font-size: 13px; }
.verdict.row { padding: 8px 11px; margin: 9px 0 0; }
.verdict.row .vh { font-size: 13px; }
.verdict.row .vs { font-size: 11.5px; }

/* STRONG hero cards */
.strongs { display: flex; gap: 10px; overflow-x: auto; padding: 1px 2px 4px; scrollbar-width: none; }
.strongs::-webkit-scrollbar { display: none; }
.scard { flex: 0 0 78%; max-width: 250px; background: var(--strong-bg); border: 2px solid var(--strong); border-radius: var(--radius); padding: 13px; box-shadow: var(--shadow); color: var(--strong-ink); }
.scard .sc-comp { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; opacity: .8; }
.scard .sc-team { font-size: 19px; font-weight: 800; margin-top: 3px; }
.scard .sc-conf { font-size: 22px; font-weight: 800; margin-top: 6px; }
.scard .sc-conf span { font-size: 11px; font-weight: 600; opacity: .8; margin-left: 5px; }
.scard .sc-mt { font-size: 12px; margin-top: 6px; opacity: .85; }
.scard .sc-cal { font-size: 10.5px; margin-top: 6px; background: var(--strong); color: #fff; display: inline-block; border-radius: 6px; padding: 1px 7px; }

.discipline { background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 14px 15px; }
.discipline .dh { font-weight: 700; font-size: 14px; }
.discipline .ds { font-size: 12.5px; color: var(--muted); margin-top: 5px; line-height: 1.5; }

/* chips */
.chip { font-size: 10.5px; font-weight: 600; border-radius: 8px; padding: 2px 8px; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.chip.high { background: var(--high-bg); color: var(--high); }
.chip.lean { background: var(--lean2-bg); color: var(--primary-ink); }
.chip.tight { background: var(--tight-bg); color: var(--tight); }
.chip.await { background: var(--amber-bg); color: var(--amber); }

/* search / groups */
.toolbar { margin: 12px 0 4px; }
.search { position: relative; }
.search input { width: 100%; height: 40px; padding: 0 12px 0 36px; border-radius: 11px; border: 1px solid var(--line-strong); background: var(--surface); outline: none; font-size: 14px; }
.search input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(31,111,235,.12); }
.search .si { position: absolute; left: 12px; top: 11px; color: var(--faint); }
.group-h { font-size: 12px; font-weight: 700; color: var(--muted); margin: 16px 3px 8px; display: flex; align-items: center; gap: 7px; }
.group-h .gn { font-size: 11px; font-weight: 700; color: var(--faint); background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 0 7px; }

/* fixture list */
.list { display: flex; flex-direction: column; gap: 10px; }
.fixture { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 14px; box-shadow: var(--shadow); transition: transform .07s ease; }
.fixture:active { transform: scale(.99); }
.fx-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 3px; }
.fx-comp { font-size: 11px; color: var(--faint); text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx-title { font-size: 16px; font-weight: 600; letter-spacing: -.2px; }
.fx-sub { font-size: 12px; color: var(--faint); margin-top: 1px; }
.fx-pick { display: flex; align-items: baseline; gap: 7px; margin-top: 9px; }
.fx-pick .lbl { font-size: 12px; color: var(--muted); }
.fx-pick .who { font-size: 14px; font-weight: 600; }
.fx-pick .pc { margin-left: auto; font-size: 16px; font-weight: 700; }
.bar { display: flex; height: 8px; border-radius: 6px; overflow: hidden; margin-top: 9px; background: var(--line); }
.bar.lg { height: 11px; border-radius: 7px; }
.bar > span { display: block; height: 100%; }
.seg-home { background: var(--home); } .seg-away { background: var(--away); } .seg-draw { background: var(--draw); } .seg-dim { opacity: .3; }
.txt-home { color: var(--home); } .txt-away { color: var(--away); } .txt-draw { color: var(--draw); }

.empty, .errbox { text-align: center; padding: 40px 18px; color: var(--muted); line-height: 1.5; }
.empty .big, .errbox .big { font-size: 28px; margin-bottom: 8px; color: var(--faint); }
.errbox { color: #b23b2c; }
.retry { margin-top: 12px; display: inline-block; padding: 8px 16px; border-radius: 10px; background: var(--primary); color: #fff; font-weight: 600; font-size: 13px; }

/* detail */
.detail { padding-top: 6px; }
.back { display: inline-flex; align-items: center; gap: 5px; padding: 11px 2px; font-size: 14px; color: var(--muted); font-weight: 600; }
.d-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.d-head { text-align: center; margin-bottom: 12px; }
.d-title { font-size: 20px; font-weight: 700; letter-spacing: -.3px; }
.d-sub { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.toggle { display: flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 11px; padding: 3px; margin: 4px 0 12px; }
.toggle button { flex: 1; padding: 8px 0; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--muted); }
.toggle button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(15,27,45,.1); }
.tabnav { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.tabnav button { flex: 0 0 auto; padding: 9px 15px 11px; font-size: 13px; font-weight: 600; color: var(--muted); border-bottom: 2.5px solid transparent; }
.tabnav button.on { color: var(--primary); border-bottom-color: var(--primary); }
.panel { min-height: 60px; }

.prob { margin-bottom: 6px; }
.prob-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; }
.prob-cell .nm { font-size: 13px; color: var(--muted); }
.prob-cell .rk { font-size: 11px; color: var(--faint); }
.prob-cell .pc { font-size: 26px; font-weight: 800; line-height: 1.05; }
.prob-cell.r { text-align: right; } .prob-cell.c { text-align: center; flex: 1; } .prob-cell.c .pc { font-size: 20px; }
.pickline { font-size: 13px; color: var(--muted); margin: 10px 0; }
.pickline b { color: var(--ink); }
.box { border: 1px solid var(--line); border-radius: 12px; padding: 12px 13px; margin: 12px 0; }
.box .hd { font-size: 13px; }
.factors { margin-top: 9px; display: flex; flex-direction: column; gap: 7px; }
.factor { display: flex; gap: 9px; align-items: flex-start; font-size: 12.5px; }
.factor .d { font-weight: 700; min-width: 36px; }
.factor .d.up { color: var(--strong); } .factor .d.dn { color: #b4452f; } .factor .d.flat { color: var(--muted); }
.factor .n { color: var(--muted); }
.await-banner { background: var(--amber-bg); border: 1px solid #f0d9b8; border-radius: 11px; padding: 10px 12px; margin-bottom: 12px; font-size: 12.5px; color: var(--amber); line-height: 1.5; }

.players { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 6px; }
@media (max-width: 460px) { .players { grid-template-columns: 1fr; } }
.pteam { font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 7px; margin-bottom: 9px; }
.pdot { width: 9px; height: 9px; border-radius: 50%; }
.psub { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 9px 0 6px; }
.pl { margin-bottom: 9px; }
.pl-row { display: flex; justify-content: space-between; font-size: 13.5px; }
.pl-row .sc { font-weight: 700; }
.pl-tr { height: 4px; background: var(--line); border-radius: 3px; margin: 4px 0; overflow: hidden; }
.pl-fl { height: 4px; border-radius: 3px; }
.pl-st { font-size: 11.5px; color: var(--muted); }
.facts { margin: 4px 0 6px; }
.fact { font-size: 13.5px; padding: 8px 0; border-top: 1px solid var(--line); display: flex; gap: 8px; align-items: baseline; }
.fact:first-child { border-top: 0; }
.fact .fi { color: var(--primary); flex: 0 0 auto; font-weight: 700; }

.kv { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.kvr { display: flex; justify-content: space-between; gap: 10px; padding: 9px 13px; font-size: 13px; border-top: 1px solid var(--line); }
.kvr:first-child { border-top: 0; }
.kvr .k { color: var(--muted); } .kvr .v { font-weight: 600; text-align: right; }

.edge { background: var(--edge-bg); border: 1px solid var(--edge-line); border-radius: 12px; padding: 12px 13px; margin: 12px 0; }
.edge.trade-angle { background: #eaf6ef; border-color: #bfe0cc; }
.edge .et { font-size: 10.5px; font-weight: 700; color: var(--edge); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 7px; }
.edge.trade-angle .et { color: var(--strong-ink); }
.edge .ef { font-size: 12.8px; color: #5b4711; padding: 4px 0 4px 18px; position: relative; line-height: 1.4; }
.edge.trade-angle .ef { color: #224b35; }
.edge .ef::before { content: "✦"; position: absolute; left: 0; font-size: 11px; top: 4px; }

.soon { background: var(--surface-2); border: 1px dashed var(--line-strong); border-radius: 11px; padding: 11px 13px; margin-top: 12px; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.numbers { margin-top: 12px; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 12px; }
.numbers summary { cursor: pointer; color: var(--primary); font-weight: 600; list-style: none; }
.numbers summary::-webkit-details-marker { display: none; }
.numbers summary::after { content: " ⌄"; } .numbers[open] summary::after { content: " ⌃"; }
.numbers .nline { margin-top: 8px; line-height: 1.5; }
.foot { font-size: 13px; color: var(--muted); line-height: 1.6; }
.foot b { color: var(--ink); }
.howpick { font-size: 12px; color: var(--faint); font-style: italic; margin-top: 10px; line-height: 1.45; }
.availnote { font-size: 12.5px; color: var(--amber); background: var(--amber-bg); border-radius: 9px; padding: 8px 11px; margin-top: 12px; }
.trust { margin: 14px 2px 0; font-size: 11px; color: var(--faint); text-align: center; }
.trust .dotsep { margin: 0 5px; }

/* desktop responsive */
@media (min-width: 900px) {
  .topbar-inner, .wrap { max-width: 1080px; }
  .wrap.detail { max-width: 720px; }
  .list { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; align-items: start; }
  .list .group-h { grid-column: 1 / -1; margin-top: 8px; }
  .strongs { flex-wrap: wrap; }
  .strongs .scard { flex: 1 1 300px; max-width: 360px; }
  .players { gap: 22px; }
}
.verdict.read { background: var(--lean-bg); border-color: #bcd6fb; color: var(--lean-ink); }


/* ---------- post-prediction review (C4) ---------- */
.strikebadge { display: block; background: var(--surface); border: 1px solid var(--line-strong); border-left: 4px solid var(--primary); border-radius: var(--radius); padding: 12px 14px; margin: 14px 0 4px; box-shadow: var(--shadow); }
.strikebadge .rb-h { display: flex; justify-content: space-between; align-items: baseline; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 8px; }
.strikebadge .rb-tgt { color: var(--faint); font-weight: 600; letter-spacing: 0; text-transform: none; }
.rb-row { display: flex; justify-content: space-between; align-items: baseline; padding: 4px 0; font-size: 13.5px; }
.rb-lbl { color: var(--muted); }
.rb-val { font-size: 15px; } .rb-val b { font-weight: 800; }
.rb-val .rb-n { font-size: 11.5px; color: var(--faint); font-weight: 600; }
.rb-pend { font-size: 12px; color: var(--faint); font-weight: 600; }
.rb-foot { font-size: 11.5px; color: var(--faint); margin-top: 8px; border-top: 1px solid var(--line); padding-top: 8px; }
.good { color: var(--strong); } .warn { color: var(--amber); } .bad { color: #b4452f; } .pend { color: var(--faint); }
.rb-val.good, .rb-val.warn, .rb-val.bad, .rb-val.pend, .rsum-val.good, .rsum-val.warn, .rsum-val.bad, .rsum-val.pend { font-weight: 800; }

.rev-head { margin: 8px 0 4px; }
.rev-head h2 { font-size: 20px; font-weight: 800; letter-spacing: -.3px; margin: 0 0 6px; }
.rev-head .rev-meta { font-size: 12px; color: var(--muted); line-height: 1.5; }
.rsum { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 15px; margin: 10px 0; box-shadow: var(--shadow); }
.rsum-h { font-size: 14px; font-weight: 700; display: flex; align-items: baseline; gap: 8px; }
.rsum-sub { font-size: 11px; color: var(--faint); font-weight: 600; }
.rsum-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; }
.rsum-cell { background: var(--surface-2); border: 1px solid var(--line); border-radius: 11px; padding: 10px 12px; text-align: center; }
.rsum-lbl { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.rsum-val { font-size: 28px; font-weight: 800; line-height: 1.1; margin: 3px 0; }
.rsum-n { font-size: 11px; color: var(--faint); }
.rsum-foot { font-size: 11.5px; color: var(--faint); margin-top: 9px; }

.rev-tbl { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.rt-row { display: flex; align-items: center; padding: 9px 12px; font-size: 13px; border-top: 1px solid var(--line); }
.rt-row:first-child { border-top: 0; }
.rt-head { background: var(--surface-2); font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.rt-l { flex: 1; font-weight: 600; } .rt-head .rt-l { font-weight: 700; }
.rt-s { width: 58px; text-align: right; font-weight: 700; } .rt-head .rt-s { color: var(--muted); }
.rt-mut { color: var(--faint); font-weight: 600; }

.rev-picks { display: flex; flex-direction: column; gap: 9px; }
.rpk { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--line-strong); border-radius: 12px; padding: 11px 13px; box-shadow: var(--shadow); }
.rpk.hit { border-left-color: var(--strong); } .rpk.miss { border-left-color: #b4452f; } .rpk.pending { border-left-color: var(--amber); } .rpk.unmatched { border-left-color: var(--faint); }
.rpk-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.rpk-fx { font-size: 14.5px; font-weight: 700; }
.rpk-sub { font-size: 11.5px; color: var(--faint); margin-top: 2px; }
.rpk-pick { font-size: 13px; color: var(--muted); margin-top: 5px; }
.rpk-strong { background: var(--strong); color: #fff; font-size: 10px; font-weight: 800; border-radius: 5px; padding: 1px 5px; letter-spacing: .03em; }
.rpk-det { font-size: 12px; color: var(--muted); margin-top: 5px; font-style: italic; }

.rpill { font-size: 10px; font-weight: 800; border-radius: 7px; padding: 2px 8px; letter-spacing: .04em; white-space: nowrap; }
.rpill.hit { background: var(--strong-bg); color: var(--strong-ink); } .rpill.miss { background: #fbe6e1; color: #9e3322; } .rpill.pend { background: var(--amber-bg); color: var(--amber); } .rpill.unm { background: var(--surface-2); color: var(--faint); }

.rstatus { border-radius: 12px; padding: 12px 14px; margin: 4px 0 6px; border: 1px solid var(--line); }
.rstatus.hit { background: var(--strong-bg); border-color: var(--strong); } .rstatus.miss { background: #fbe6e1; border-color: #e3a99c; } .rstatus.pending { background: var(--amber-bg); border-color: #f0d9b8; } .rstatus.unmatched { background: var(--surface-2); }
.rs-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rs-pick { font-size: 13.5px; font-weight: 700; }
.rs-det { font-size: 12.5px; color: var(--muted); margin-top: 7px; line-height: 1.5; }
.rev-link { color: var(--primary); font-weight: 600; }


/* ---------- brand-align with Flutter app: standard verdict + var-based states + dark mode ---------- */
.verdict.standard { background: var(--standard-bg); border-color: var(--standard-border); color: var(--standard-ink); }
.verdict.lean, .verdict.sit_out { background: var(--standard-bg); border-color: var(--standard-border); color: var(--standard-ink); }
.verdict.read { background: var(--info-bg); border-color: var(--info-border); color: var(--info-ink); }
.errbox { color: var(--miss); }
.factor .d.dn { color: var(--miss); }
.bad { color: var(--miss); }
.rpk.miss { border-left-color: var(--miss); }
.rpill.miss { background: var(--miss-bg); color: var(--miss); }
.rstatus.miss { background: var(--miss-bg); border-color: var(--miss); }
.await-banner { border-color: var(--edge-line); }

:root[data-theme="dark"] {
  --bg:#09241b; --surface:#103a2c; --surface-2:#12342a;
  --ink:#eaf2ec; --muted:#a9c4b5; --faint:#7e988a;
  --line:#1c5b45; --line-strong:#274c3c;
  --primary:#e8b23a; --primary-ink:#c9962c; --on-primary:#0e3b2e;
  --home:#e8b23a; --away:#4fa37a; --draw:#5e7a6c;
  --strong:#1f6b47; --strong-bg:#12432e; --strong-ink:#8fe3b0;
  --standard-bg:#143a30; --standard-border:#235c44; --standard-ink:#cfe8dc;
  --lean:#cfe8dc; --lean-bg:#143a30; --lean-ink:#cfe8dc;
  --sit:#a9c4b5; --sit-bg:#12342a; --sit-ink:#a9c4b5;
  --high:#8fe3b0; --high-bg:#12432e; --lean2-bg:#143a30; --tight:#a9c4b5; --tight-bg:#12342a;
  --edge:#e8c97a; --edge-bg:#40320f; --edge-line:#5a4a1e;
  --amber:#e8c97a; --amber-bg:#40320f;
  --miss:#f2a8a8; --miss-bg:#4a1f1f;
  --info:#9cc4f2; --info-ink:#9cc4f2; --info-bg:#15324e; --info-border:#1f4a72;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.45);
}
[data-theme="dark"] .topbar { background: rgba(16,58,44,.92); }
[data-theme="dark"] .brand .logo, [data-theme="dark"] .datechip.active, [data-theme="dark"] .tab.active .cnt, [data-theme="dark"] .retry { color: var(--on-primary); }
[data-theme="dark"] .datechip.active .dow { color: rgba(14,59,46,.72); }
[data-theme="dark"] .edge.trade-angle { background: var(--standard-bg); border-color: var(--standard-border); }
[data-theme="dark"] .edge.trade-angle .et, [data-theme="dark"] .edge.trade-angle .ef { color: var(--standard-ink); }
[data-theme="dark"] .edge .ef { color: var(--edge); }
[data-theme="dark"] .rstatus.pending { border-color: var(--amber); }
[data-theme="dark"] .rstatus.hit { border-color: var(--strong); }
.topactions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.topactions > button { margin-left: 0; }
.themebtn { padding: 4px 9px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface-2); color: var(--muted); font-size: 14px; line-height: 1; cursor: pointer; font-family: inherit; }
.themebtn:hover { color: var(--ink); border-color: var(--primary); }

/* toss-status chip (replaces the pre/post toggle) */
.tchip { display: inline-flex; align-items: center; gap: 5px; margin-top: 9px; font-size: 11.5px; font-weight: 700; border-radius: 8px; padding: 3px 10px; letter-spacing: .02em; }
.tchip.live { background: var(--strong-bg); color: var(--strong-ink); }
.tchip.await { background: var(--amber-bg); color: var(--amber); }

.pl-nm { font-weight: 600; font-size: 14px; }
.pl { margin-bottom: 11px; }

.rpk-res, .rs-res { font-size: 12.5px; color: var(--ink); margin-top: 4px; }
.rpk-res b, .rs-res b { font-weight: 700; }

.rev-lg-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; margin: 16px 2px 8px; }
.rev-lg-nm { font-size: 13px; font-weight: 700; }
.rev-lg-st { font-size: 11.5px; color: var(--muted); }
.rev-lg-st b { font-weight: 800; }

.rpill.won { background: var(--strong-bg); color: var(--strong-ink); }
.rpill.traded { background: var(--standard-bg); color: var(--standard-ink); }

.lgrow { display: flex; gap: 8px; overflow-x: auto; padding: 2px 1px 12px; scrollbar-width: none; }
.lgrow::-webkit-scrollbar { display: none; }
.lgchip { flex: 0 0 auto; border: 1px solid var(--line-strong); background: var(--surface); color: var(--muted); border-radius: 999px; padding: 6px 13px; font-size: 12.5px; font-weight: 600; white-space: nowrap; cursor: pointer; font-family: inherit; }
.lgchip.active { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }

.tabnav { overflow-x: auto; scrollbar-width: none; }
.tabnav::-webkit-scrollbar { display: none; }
.tabnav button { white-space: nowrap; }

.disclaimer { font-size: 11px; color: var(--faint); padding: 9px 2px 0; line-height: 1.45; }

/* ---------- customer login (C12) ---------- */
.authwrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.authcard { width: 100%; max-width: 360px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 26px 22px; box-shadow: var(--shadow); }
.authbrand { font-size: 21px; font-weight: 800; display: flex; align-items: center; gap: 9px; color: var(--ink); }
.authbrand .logo { width: 30px; height: 30px; border-radius: 8px; background: var(--primary); color: var(--on-primary); display: grid; place-items: center; font-size: 15px; font-weight: 800; }
.authbrand .pro { color: var(--primary); }
.authsub { color: var(--muted); font-size: 13px; margin: 4px 0 18px; }
.authtabs { display: flex; gap: 6px; margin-bottom: 16px; }
.authtabs button { flex: 1; padding: 9px; border-radius: 9px; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--muted); font-weight: 700; font-size: 13px; cursor: pointer; font-family: inherit; }
.authtabs button.on { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.authform { display: flex; flex-direction: column; gap: 13px; }
.authform label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 700; color: var(--muted); }
.authform input { padding: 11px 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--ink); font-size: 15px; font-family: inherit; }
.authform input:focus { outline: none; border-color: var(--primary); }
.authnote { font-size: 11px; font-weight: 500; color: var(--faint); }
.autherr { color: var(--miss); font-size: 12.5px; font-weight: 600; }
.autherr:empty { display: none; }
.authbtn { margin-top: 4px; padding: 12px; border: none; border-radius: 10px; background: var(--primary); color: var(--on-primary); font-weight: 800; font-size: 15px; cursor: pointer; font-family: inherit; }
.authbtn:disabled { opacity: .6; }
.authfoot { margin-top: 16px; text-align: center; font-size: 12.5px; color: var(--muted); }
.authfoot a { color: var(--primary); font-weight: 700; text-decoration: none; }
.logoutbtn { margin-left: auto; padding: 5px 11px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface-2); color: var(--muted); font-size: 11.5px; font-weight: 700; cursor: pointer; font-family: inherit; }

/* ---------- Trade Desk: Betfair-exchange market grid ---------- */
.bfmkt { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin: 4px 0 16px; box-shadow: var(--shadow); }
.bfmkt-h { background: #2b2b2b; color: #fff; padding: 8px 12px; font-size: 12px; font-weight: 700; display: flex; justify-content: space-between; align-items: center; }
.bfmkt-h i { font-style: normal; margin-right: 4px; }
.bfstatus { font-size: 10.5px; font-weight: 700; color: #cfcfcf; }
.bfstatus.on { color: #6ee7a8; }
.bfmkt-cols { display: grid; grid-template-columns: 1fr 72px 72px; background: var(--surface-2); }
.bfmkt-cols span { padding: 6px 8px; text-align: center; font-size: 9.5px; font-weight: 800; letter-spacing: .05em; color: var(--muted); text-transform: uppercase; }
.bfmkt-cols span:first-child { text-align: left; }
.bfrow { display: grid; grid-template-columns: 1fr 72px 72px; border-top: 1px solid var(--line); background: var(--surface); }
.bfrow.fav { box-shadow: inset 3px 0 0 var(--primary); }
.bfsel { padding: 10px 11px; display: flex; flex-direction: column; justify-content: center; }
.bfsel-nm { font-weight: 700; font-size: 13.5px; color: var(--ink); }
.bfstar { font-size: 8.5px; font-weight: 800; color: var(--strong-ink); background: var(--strong-bg); padding: 1px 6px; border-radius: 5px; vertical-align: 1px; margin-left: 5px; letter-spacing: .03em; }
.bfsel-mt { font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.bfcell { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 6px 4px; }
.bfcell .px { font-size: 14.5px; font-weight: 800; }
.bfcell .sz { font-size: 9.5px; font-weight: 600; opacity: .8; margin-top: 1px; }
.bfback { background: #9bd0fb; color: #0a3a6b; }
.bflay { background: #f6b8c8; color: #7a1530; }
.bfcell.est { opacity: .6; }
.bftarget { font-size: 11px; color: var(--muted); padding: 9px 11px; border-top: 1px solid var(--line); background: var(--surface-2); line-height: 1.45; }
.bftarget b { color: var(--ink); }

:root { --exch-bg: #ffb80c; }
:root[data-theme="dark"] { --exch-bg: #0b1712; }
.panel-exch { background: var(--exch-bg); margin: 8px -16px -16px; padding: 15px 16px 16px; border-top: 1px solid var(--line); border-radius: 0 0 13px 13px; }
.panel-exch .soon { background: transparent; }

.panel-exch .verdict, .panel-exch .edge.trade-angle { background: var(--surface); border-color: var(--line); }
.panel-exch .sec-h, .panel-exch .foot { color: #1c1407; }
[data-theme="dark"] .panel-exch .sec-h, [data-theme="dark"] .panel-exch .foot { color: var(--ink); }
[data-theme="dark"] .panel-exch { border-top-color: #1c5b45; }

.bfcell .bflock { font-size: 12.5px; font-weight: 400; opacity: .9; }

.panel-exch .sec-h { background: #2b2b2b; color: #fff; padding: 8px 12px; border-radius: 6px; margin: 14px 0 0; font-weight: 700; }
.panel-exch .sec-h .ic { color: #fff; }
.panel-exch .foot, .panel-exch .bftarget { color: var(--ink); }
.panel-exch .foot b, .panel-exch .bftarget b, .panel-exch .bfsel-nm { color: var(--ink); }
.panel-exch .edge.trade-angle { padding: 0; overflow: hidden; }
.panel-exch .edge.trade-angle .et { background: #2b2b2b; color: #fff; padding: 8px 12px; font-size: 12.5px; font-weight: 700; }
.panel-exch .edge.trade-angle .ef { color: var(--ink); padding: 7px 12px 0; }
.panel-exch .edge.trade-angle .ef:last-child { padding-bottom: 11px; }

.bfmkt-cols span:nth-child(2) { background: #cfe7fb; color: #0a3a6b; }
.bfmkt-cols span:nth-child(3) { background: #fbdde6; color: #7a1530; }
.panel-exch .verdict, .panel-exch .edge.trade-angle, .panel-exch .bfmkt { box-shadow: 0 1px 2px rgba(0,0,0,.05); }

.bf-top { background: #ffb80c; color: #1a1407; margin: -15px -16px 14px; padding: 10px 16px; font-size: 12.5px; font-weight: 700; letter-spacing: .02em; display: flex; align-items: center; gap: 8px; }
.bf-top .bf-mark { font-weight: 800; font-size: 14px; letter-spacing: -.01em; }

.panel-exch .verdict, .panel-exch .edge.trade-angle { background: transparent; border-color: transparent; box-shadow: none; }
.panel-exch .verdict .vh, .panel-exch .verdict .vs, .panel-exch .edge.trade-angle .ef, .panel-exch .foot, .panel-exch .bftarget { color: #1a1407; }
.panel-exch .foot b, .panel-exch .bftarget b, .panel-exch .verdict .vh b { color: #000; }
[data-theme="dark"] .panel-exch .verdict, [data-theme="dark"] .panel-exch .edge.trade-angle { background: var(--surface); }
[data-theme="dark"] .panel-exch .verdict .vh, [data-theme="dark"] .panel-exch .verdict .vs, [data-theme="dark"] .panel-exch .edge.trade-angle .ef, [data-theme="dark"] .panel-exch .foot, [data-theme="dark"] .panel-exch .bftarget { color: var(--ink); }

.verdict.td-pill { background: #ffb80c; border-color: #e0a700; }
.verdict.td-pill .vh, .verdict.td-pill .vs { color: #1a1407; }
.verdict.td-pill .vh b { color: #000; }

.panel-trade .et, .panel-trade .sec-h, .panel-trade .foot, .panel-trade .bftarget, .panel-trade .edge.trade-angle .ef { color: #1a1407; }
.panel-trade .foot b, .panel-trade .bftarget b { color: #000; }
[data-theme="dark"] .panel-trade .et, [data-theme="dark"] .panel-trade .sec-h, [data-theme="dark"] .panel-trade .foot, [data-theme="dark"] .panel-trade .bftarget, [data-theme="dark"] .panel-trade .edge.trade-angle .ef { color: var(--ink); }

.panel-trade .edge.trade-angle { background: var(--surface); border-color: var(--line); }

a.rpk { display: block; text-decoration: none; color: inherit; cursor: pointer; transition: border-color .12s ease, box-shadow .12s ease, transform .12s ease; }
a.rpk:hover { border-color: var(--primary); box-shadow: 0 5px 16px rgba(0,0,0,.12); transform: translateY(-1px); }
.rpk-go { display: block; margin-top: 7px; font-size: 11.5px; font-weight: 700; color: var(--faint); text-align: right; }
a.rpk:hover .rpk-go { color: var(--primary); }

/* phase score (projected in Prediction, actual in Review) */
.phaseproj { margin: 6px 0 4px; }
.phaseproj .ph-team { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin: 6px 0; background: var(--surface-2); }
.phaseproj.actual .ph-team { background: var(--strong-bg); border-color: var(--strong); }
.ph-nm { font-weight: 700; font-size: 13px; margin-bottom: 5px; }
.ph-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; font-size: 12.5px; color: var(--muted); }
.ph-row .ph-c b { color: var(--text, inherit); font-weight: 700; }
.ph-tot { margin-left: auto; font-weight: 800; font-size: 14px; color: var(--strong); }

/* top-performer (top batter/bowler) review rows */
.pp-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; font-size: 12.5px; padding: 4px 0; border-top: 1px solid var(--line); }
.pp-row:first-of-type { border-top: none; }
.pp-row .pp-r { color: var(--muted); }
.pp-row.hit .pp-r { color: var(--strong); font-weight: 600; }
.pp-row.miss .pp-r { color: var(--miss, #c0392b); }

/* match result line (tennis serve stats / soccer scoreline in Review) */
.ph-score { font-size: 14px; font-weight: 600; margin: 4px 0 8px; color: var(--text, inherit); }
.ph-ht { color: var(--muted); font-weight: 400; font-size: 12.5px; }
.pp-row.neutral .pp-r { color: var(--muted); }

.tossline { margin: 6px 0 10px; font-size: 13px; color: var(--text, inherit); background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; }

/* tennis/soccer per-side form & key players (Prediction tab) */
.sideprof { margin: 8px 0 4px; }
.sp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sp-team { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: var(--surface-2); }
.sp-nm { font-weight: 700; font-size: 13px; margin-bottom: 5px; }
.sp-l { font-size: 12.5px; color: var(--muted); margin: 3px 0; line-height: 1.4; }
@media (max-width: 520px) { .sp-grid { grid-template-columns: 1fr; } }

.brand-mark { height: 30px; width: auto; display: block; border-radius: 7px; }
[data-theme="dark"] .brand-mark, [data-theme="dark"] .authbrand-mark { box-shadow: 0 0 0 1px rgba(255,255,255,.14); }
.authbrand-mark { height: 46px; width: auto; display: block; margin: 0 auto 4px; border-radius: 9px; }
