:root {
  /* dark is the default theme for every visitor; light is opt-in via the header toggle (remembered) */
  --bg: #0d0f13; --surface: #151820; --surface-2: #1c2029; --border: #262b36;
  --text: #e8ebf1; --muted: #a1a9b8; --faint: #7d8597;
  --team-a: #5b8eff; --team-b: #f39a4a; --team-a-soft: rgba(91,142,255,.16); --team-b-soft: rgba(243,154,74,.16);
  --win: #3ccf7b; --loss: #f06a6a; --focus: #5b8eff;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
  --radius: 14px;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f6f7f9; --surface: #ffffff; --surface-2: #f0f2f5; --border: #e2e5ea;
  --text: #14171c; --muted: #5d6573; --faint: #6f7786;
  --team-a: #2f6fed; --team-b: #e07a1f; --team-a-soft: rgba(47,111,237,.12); --team-b-soft: rgba(224,122,31,.14);
  --win: #1f9d55; --loss: #d64545; --focus: #2f6fed;
  --shadow: 0 1px 2px rgba(16,24,40,.05), 0 4px 16px rgba(16,24,40,.06);
  color-scheme: light;
}
* { 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;
  font-feature-settings: "tnum" 1, "cv11" 1;
}
.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }
header { padding: 28px 0 8px; display: flex; align-items: center; gap: 12px; }
.mark { width: 34px; height: 34px; border-radius: 10px; flex: none;
  background: linear-gradient(135deg, var(--team-a) 0 50%, var(--team-b) 50% 100%); }
h1 { font-size: 20px; line-height: 1.2; margin: 0; letter-spacing: -.01em; }
.sub { color: var(--muted); font-size: 13.5px; margin: 2px 0 0; }
.icon-btn { margin-left: auto; background: var(--surface); border: 1px solid var(--border); color: var(--muted);
  width: 44px; height: 44px; border-radius: 12px; cursor: pointer; display: grid; place-items: center; flex: none; }
.icon-btn .sun { display: block; } .icon-btn .moon { display: none; }
:root[data-theme="light"] .icon-btn .sun { display: none; } :root[data-theme="light"] .icon-btn .moon { display: block; }
.icon-btn:hover { color: var(--text); }
section { margin-top: 22px; }
h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 10px; font-weight: 600; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.pick { padding: 16px; display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: end; }
.pick .actions { grid-column: 1 / -1; display: flex; gap: 10px; }
label.lbl { display: block; font-size: 12px; color: var(--muted); margin: 0 0 6px; font-weight: 500; }
.combo { position: relative; }
.combo input {
  width: 100%; font: inherit; color: var(--text); background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 12px 12px 34px; min-height: 48px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.combo input:focus { border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 25%, transparent); }
.combo .dot { position: absolute; left: 13px; top: 50%; width: 10px; height: 10px; border-radius: 50%; transform: translateY(-50%); }
.combo[data-side="a"] .dot { background: var(--team-a); }
.combo[data-side="b"] .dot { background: var(--team-b); }
.combo ul {
  position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 6px); margin: 0; padding: 6px; list-style: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow);
  max-height: 280px; overflow: auto; display: none;
}
.combo.open ul { display: block; }
.combo li { padding: 8px 10px; border-radius: 8px; cursor: pointer; display: flex; justify-content: space-between; gap: 12px; }
.combo li small { color: var(--faint); white-space: nowrap; }
.combo li[aria-selected="true"], .combo li:hover { background: var(--surface-2); }
.combo li.empty { color: var(--faint); cursor: default; }
.vs { color: var(--faint); font-size: 13px; padding-bottom: 12px; text-align: center; }
.swap { background: none; border: 0; color: var(--muted); cursor: pointer; width: 44px; height: 44px; border-radius: 10px;
  display: grid; place-items: center; }
.swap:hover { color: var(--text); background: var(--surface-2); }
.btn {
  font: inherit; font-weight: 600; border: 0; border-radius: 10px; padding: 12px 18px; min-height: 48px; cursor: pointer;
  background: var(--text); color: var(--bg); flex: 1;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:focus-visible, .icon-btn:focus-visible, .swap:focus-visible, summary:focus-visible {
  outline: 2px solid var(--focus); outline-offset: 2px; }
.err { color: var(--loss); font-size: 13.5px; padding: 0 16px 14px; margin: 0; }

.result { padding: 20px 16px 18px; border-top: 1px solid var(--border); }
.result[hidden] { display: none; }
.teams { display: flex; justify-content: space-between; gap: 12px; align-items: flex-end; }
.teams .t { min-width: 0; }
.teams .t.b { text-align: right; }
.teams .name { font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.teams .pct { font-size: 40px; font-weight: 700; letter-spacing: -.02em; line-height: 1.05; }
/* ONE colour convention, used by every component: team A (left) = --team-a, team B (right) = --team-b */
.side-a { color: var(--team-a); } .side-b { color: var(--team-b); }
.tdot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: middle; position: relative; top: -1px; flex: none; }
.tdot.side-a { background: var(--team-a); } .tdot.side-b { background: var(--team-b); }
.bar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; margin: 12px 0 10px; background: var(--surface-2); }
.bar span { transition: width .5s cubic-bezier(.2,.8,.2,1); }
.bar .ba { background: var(--team-a); } .bar .bb { background: var(--team-b); }
.bar.sm { height: 6px; margin: 8px 0 0; }
.bar .mid { width: 2px; background: var(--surface); margin-left: -1px; z-index: 1; }
.verdict { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; margin-top: 4px; }
.chip { font-size: 12.5px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.chip.a { background: var(--team-a-soft); color: var(--team-a); }
.chip.b { background: var(--team-b-soft); color: var(--team-b); }
.note { color: var(--muted); font-size: 13px; text-align: center; margin: 10px 0 0; }
.ctx { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.xc-body .ctx { margin-top: 4px; }
.ctx .box { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; }
.ctx .k { font-size: 11.5px; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; }
.form { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; }
.form i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.form i.w { background: var(--win); } .form i.l { background: var(--loss); opacity: .75; }
.formrow { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; margin-top: 4px; }
.formrow span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.series-tbl { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 13px; }
.series-tbl th, .series-tbl td { padding: 6px 4px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.series-tbl th { color: var(--muted); font-weight: 600; font-size: 13px; text-transform: none; letter-spacing: 0; padding-right: 14px; }
.series-tbl th:first-child, .dt-tbl th:first-child { color: var(--faint); font-weight: 500; }
.series-tbl th .team, .dt-tbl th .team { white-space: nowrap; }
@media (max-width: 560px) { .series-tbl th .team, .dt-tbl th .team { white-space: normal; } }
.series-tbl td { padding-right: 14px; }
.series-tbl td.n { font-weight: 600; white-space: nowrap; }
.series-tbl .sc { color: var(--muted); font-size: 12.5px; }
.series-tbl .sc span { white-space: nowrap; }
.series-tbl tr.scrow { display: none; }
.series-tbl tr.scrow td { padding-top: 0; }

.day { font-size: 12.5px; color: var(--muted); font-weight: 600; margin: 16px 2px 8px; }
/* shared expandable card (upcoming fixtures + track record) */
.xc { margin-bottom: 10px; transition: border-color .15s; overflow: hidden; }
.xc:hover { border-color: color-mix(in srgb, var(--text) 25%, var(--border)); }
.xc-head { display: block; width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer;
  background: none; border: 0; padding: 14px 16px; }
.xc-head:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; border-radius: var(--radius); }
.xc-chev { display: inline-block; margin-left: 6px; color: var(--faint); transition: transform .15s; }
.xc-head[aria-expanded="true"] .xc-chev { transform: rotate(180deg); }
.xc-body { border-top: 1px solid var(--border); padding: 12px 16px 14px; font-size: 13.5px; }
.xc-body[hidden] { display: none; }
.dt-sec { margin-top: 12px; } .dt-sec:first-child { margin-top: 0; }
.dt-h { font-size: 11.5px; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
.dt-tbl { width: 100%; border-collapse: collapse; }
.dt-tbl td, .dt-tbl th { padding: 4px 4px; text-align: left; border-bottom: 1px dashed var(--border); font-weight: 400; }
.dt-tbl th { color: var(--muted); font-size: 13px; font-weight: 600; padding-right: 14px; }
.dt-tbl td.side-a, .dt-tbl td.side-b { font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips span { background: var(--surface-2); border-radius: 999px; padding: 2px 9px; font-size: 12.5px; white-space: nowrap; }
.chips span.top { outline: 1.5px solid var(--text); font-weight: 600; }
.dt-note { color: var(--muted); font-size: 12.5px; margin: 6px 0 0; }
.dt-games li { padding: 3px 0; }
.dt-games { margin: 0; padding-left: 18px; }
.xlist .xc .tr-row { padding: 0; border: 0; }
.tr-row .m span:last-child, .fx .meta span:last-child { white-space: nowrap; flex: none; }
.fx .meta { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--muted); }
.fx .meta b { color: var(--text); font-weight: 600; }
.fx .row { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; margin-top: 8px; }
.fx .row .n { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx .row .n.b { text-align: right; }
.fx .row .p { font-weight: 700; font-size: 15px; }
.fx .series { font-size: 12px; color: var(--faint); margin-top: 6px; text-align: center; }
.empty-state { padding: 22px 16px; color: var(--muted); text-align: center; }
details.more { margin-top: 6px; }
details.more summary { cursor: pointer; color: var(--muted); font-size: 13.5px; padding: 8px 2px; list-style: none; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::before { content: "▸"; display: inline-block; width: 14px; transition: transform .15s; }
details.more[open] summary::before { transform: rotate(90deg); }
.mini { list-style: none; margin: 0 0 8px; padding: 0; font-size: 13px; color: var(--muted); }
.mini li { padding: 6px 2px; border-bottom: 1px dashed var(--border); display: flex; justify-content: space-between; gap: 12px; }
.mini li span:last-child { color: var(--faint); text-align: right; }
.updated { font-size: 12px; color: var(--faint); font-weight: 400; text-transform: none; letter-spacing: 0; margin-left: 6px; }

.tr-note { padding: 12px 14px; font-size: 13.5px; color: var(--muted); margin-bottom: 10px; border-style: dashed; box-shadow: none; }
.tr-note strong { color: var(--text); }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 10px; }
.tile { padding: 12px 14px; }
.tile .k { font-size: 11.5px; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; }
.tile .v { font-size: 24px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; margin-top: 2px; }
.tile .v small { font-size: 14px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.tile .s { font-size: 12px; color: var(--faint); }
.tr-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 11px 16px; border-bottom: 1px solid var(--border); align-items: center; }
.tr-row:last-child { border-bottom: 0; }
.tr-row .m { font-size: 12.5px; color: var(--muted); grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 10px; }
.tr-row .who { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.tr-row .call { font-size: 13px; color: var(--muted); grid-column: 1; }
.tr-row .call b { font-weight: 600; }
.tr-row .call b:not(.side-a):not(.side-b) { color: var(--text); }
.st { font-size: 12.5px; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; grid-column: 2; grid-row: 2 / span 2; justify-self: end; }
.st.ok { color: var(--win); background: color-mix(in srgb, var(--win) 13%, transparent); }
.st.bad { color: var(--loss); background: color-mix(in srgb, var(--loss) 12%, transparent); }
.st.wait { color: var(--muted); background: var(--surface-2); }
.onrec { color: var(--muted); }
.sl-head { font-size: 13px; font-weight: 600; color: var(--text); margin: 22px 2px 6px; }
.sl-text { font-size: 13px; color: var(--muted); margin: 0 2px 10px; }
.tag { display: inline-block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; padding: 2px 8px;
  border-radius: 999px; background: var(--surface-2); color: var(--muted); margin-bottom: 6px; }
footer { margin: 34px 0 40px; font-size: 14.5px; color: var(--text); }
.trust { padding: 0 18px; border-color: color-mix(in srgb, var(--team-a) 30%, var(--border)); }
.trust summary { cursor: pointer; list-style: none; padding: 16px 0; display: flex; flex-wrap: nowrap; align-items: center; gap: 12px; min-height: 56px; }
.trust-title { min-width: 0; }
.trust summary::-webkit-details-marker { display: none; }
.trust-title { font-weight: 700; font-size: 16px; color: var(--text); }
.trust-pills { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.trust-pills span { font-size: 13px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--text); }
.trust-pills span.ok { background: color-mix(in srgb, var(--win) 14%, transparent); color: var(--win); }
.trust-more { margin-left: auto; font-size: 13.5px; color: var(--muted); white-space: nowrap; }
#method[open] .trust-more .xc-chev { transform: rotate(180deg); }
/* condensed lock lines (footer only) */
.lockline { display: flex; gap: 10px; align-items: baseline; padding: 8px 0; border-bottom: 1px dashed var(--border); font-size: 14px; }
.lockline .vi { flex: none; width: 20px; height: 20px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--win); color: var(--bg); font-weight: 800; font-size: 12px; position: relative; top: 4px; }
.lockline.bad .vi { background: var(--loss); }
.lockline code { font: 12.5px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); overflow-wrap: anywhere; }
.lockproof summary { cursor: pointer; color: var(--muted); font-size: 13px; padding: 10px 0 4px; list-style: none; }
.lockproof summary::-webkit-details-marker { display: none; }
.lockproof p { font-size: 13px; color: var(--muted); margin: 4px 0 0; }
#method-body { padding-bottom: 6px; }
#method-body p { margin: 0 0 12px; line-height: 1.55; }
/* game-by-game branches */
.gbg { display: grid; gap: 10px; }
.gbg-g > .gbg-t { font-weight: 600; margin-bottom: 2px; }
.gbg-r { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; padding: 5px 0 5px 12px;
  border-left: 2px solid var(--border); margin-left: 4px; }
.gbg-r .cond { color: var(--text); } .gbg-r .cond small { color: var(--faint); font-size: 12.5px; }
.gbg-r .odds { font-weight: 600; white-space: nowrap; }
/* track-record filters */
.tiles.two { grid-template-columns: 1fr 1fr; }
.subh { font-size: 14.5px; font-weight: 600; color: var(--text); margin: 18px 2px 8px; }
#zone-forecast > h2 + #tool .subh { margin-top: 4px; }
.up-row { padding: 12px 16px; margin-bottom: 10px; box-shadow: none; }
.up-toggle { width: 100%; background: var(--surface-2); color: var(--text); border: 1px solid var(--border); margin-top: 4px; }
.up-row .meta { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--muted); }
.up-row .meta b { color: var(--text); font-weight: 600; }
.up-row .who { font-weight: 600; margin-top: 4px; }
.up-row .state { display: inline-block; margin-top: 6px; font-size: 12.5px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.new-note { padding: 12px 14px; margin-bottom: 10px; font-size: 14px; color: var(--muted); box-shadow: none; }
.new-note b { color: var(--text); }
#method-body .stamp, #method .stamp { margin: 14px 0 12px; }
@media (max-width: 560px) { .tiles.two .tile:last-child { grid-column: auto; }
  .trust { padding: 0 14px; } .trust-title { font-size: 15px; white-space: nowrap; } }
.filter-line .showall { font: inherit; color: var(--focus); background: none; border: 0; cursor: pointer; padding: 10px 4px; min-height: 44px; }
.tiles button.tile { font: inherit; color: inherit; text-align: left; cursor: pointer; width: 100%; }
.tiles button.tile:hover { border-color: color-mix(in srgb, var(--text) 25%, var(--border)); }
.tiles button.tile[aria-pressed="true"] { border-color: var(--focus); box-shadow: 0 0 0 2px color-mix(in srgb, var(--focus) 35%, transparent); }
.tiles button.tile:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.filter-line { font-size: 13.5px; color: var(--muted); margin: 0 2px 10px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.filter-line button { font: inherit; color: var(--focus); background: none; border: 0; cursor: pointer; padding: 10px 4px; }
/* lock badge: plain statement first, proof one click down */
.verify .vm summary { cursor: pointer; color: var(--muted); font-size: 12.5px; margin-top: 4px; list-style: none; min-height: 24px; }
.verify .vm summary::-webkit-details-marker { display: none; }
.verify .vm p { font-size: 12.5px; color: var(--muted); margin: 4px 0 0; }
#method-body h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 18px 0 8px; }
.verify { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; margin: 12px 0 0; border-radius: 10px; font-size: 14px; color: var(--text);
  border: 1px solid color-mix(in srgb, var(--win) 40%, var(--border)); background: color-mix(in srgb, var(--win) 8%, transparent); }
.verify .vi { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--win); color: var(--bg); font-weight: 800; font-size: 13px; }
.verify.bad { border-color: var(--loss); background: color-mix(in srgb, var(--loss) 10%, transparent); } .verify.bad .vi { background: var(--loss); }
.verify code { font: 13px ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; color: var(--text); }
.verify small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.cal { width: 100%; border-collapse: collapse; margin: 6px 0 14px; font-size: 13px; }
.cal th, .cal td { padding: 6px 4px; text-align: left; border-bottom: 1px solid var(--border); }
.cal th { color: var(--faint); font-weight: 500; }
.stamp { font-size: 12px; color: var(--faint); margin: 12px 2px 0; }
.skeleton { height: 92px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); margin-bottom: 10px;
  animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55; } }
.combo li { min-height: 44px; align-items: center; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
@media (max-width: 560px) {
  /* thumb zone: the team picker + Forecast button dock at the bottom of the screen on phones */
  body { padding-bottom: calc(150px + env(safe-area-inset-bottom)); }
  .pick { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; margin: 0;
    grid-template-columns: 1fr 44px 1fr; gap: 8px; align-items: center;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: var(--surface);
    border-top: 1px solid var(--border); border-radius: 18px 18px 0 0; box-shadow: 0 -10px 30px rgba(0,0,0,.35); }
  .pick label.lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .pick .vs { padding: 0; display: grid; place-items: center; }
  .pick .actions { grid-column: 1 / -1; }
  .combo input { padding-left: 30px; font-size: 16px; }  /* 16px stops iOS zooming on focus */
  .combo ul { top: auto; bottom: calc(100% + 8px); max-height: 50vh; min-width: min(300px, calc(100vw - 24px)); }
  #combo-b ul { left: auto; right: 0; }
  .combo li { padding: 12px 10px; }
  #tool:not(.has-result) h3 { display: none; }
  #tool:not(.has-result) .card.tool { background: none; border: 0; box-shadow: none; }
  .tiles { grid-template-columns: 1fr 1fr; }
  .tiles .tile:last-child { grid-column: 1 / -1; }
  .tr-row { grid-template-columns: 1fr; }
  .series-tbl th:last-child, .series-tbl td.sc:not([colspan]) { display: none; }
  .series-tbl tr.scrow { display: table-row; }
  .series-tbl tr.main td { border-bottom: 0; }
  .tr-row .st { grid-column: 1; grid-row: auto; justify-self: start; }
  .teams .pct { font-size: 32px; }
  .ctx { grid-template-columns: 1fr; }
  .fx .row { grid-template-columns: 1fr 1fr; grid-template-areas: "na nb" "p p"; row-gap: 2px; }
  .fx .row .n.a { grid-area: na; } .fx .row .n.b { grid-area: nb; }
  .fx .row .p { grid-area: p; text-align: center; }
}
@media (prefers-reduced-motion: reduce) { .bar span, .skeleton { transition: none; animation: none; } }
