/* Theme tokens. Light by default; dark follows the OS unless the viewer picked a theme (data-theme on <html>), and
   the viewer's pick wins both ways. Text colours meet 4.5:1 on their panel in both modes. */
:root {
  color-scheme: light;
  --bg: #f5f6f8; --panel: #ffffff; --panel2: #f0f2f5; --line: #d5dbe1; --line-soft: #e6e9ed; --text: #1b1f24; --muted: #57606a;
  --accent: #bc4c00; --accent-ink: #ffffff; --good: #1a7f37; --warn: #9a6700; --bad: #cf222e; --serious: #c4552b; --s2: #8250df; --blue: #0969da;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --bg: #0f1419; --panel: #171d24; --panel2: #1e262f; --line: #2a3440; --line-soft: #212a33; --text: #e6edf3; --muted: #8b98a5;
    --accent: #f0a020; --accent-ink: #111111; --good: #3fb950; --warn: #d29922; --bad: #f85149; --serious: #ec835a; --s2: #a371f7; --blue: #58a6ff;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1419; --panel: #171d24; --panel2: #1e262f; --line: #2a3440; --line-soft: #212a33; --text: #e6edf3; --muted: #8b98a5;
  --accent: #f0a020; --accent-ink: #111111; --good: #3fb950; --warn: #d29922; --bad: #f85149; --serious: #ec835a; --s2: #a371f7; --blue: #58a6ff;
}
/* qualification tiers (one definition for the whole site, tierOf() in app.js): always shown with a text label too */
:root { --q-safe: var(--good); --q-likely: color-mix(in srgb, var(--good) 60%, var(--panel)); --q-open: var(--blue); --q-slim: var(--serious); --q-out: var(--bad); }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.45; }
h1 { font-size: 20px; margin: 0; }
h2 { font-size: 15px; margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.hint { color: var(--muted); font-size: 12px; margin: 6px 0; }
.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 14px 20px 0; border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0; z-index: 5; flex-wrap: wrap; }
.brand p { margin: 4px 0 10px; font-size: 12px; }
.sync-line { margin: -6px 0 10px; font-size: 12px; color: var(--muted); }
.sync-line details { display: inline; }
.sync-line summary { cursor: pointer; display: inline; }
.sync-line ul { margin: 4px 0 0; padding-left: 18px; }
.sync-line .warn, .sync-line .warn-text { color: var(--warn); }
.sync-line a { cursor: pointer; }
.sync-line summary { text-decoration: underline dotted; text-underline-offset: 3px; margin-left: 4px; }
.sync-line .sync-new { color: var(--accent); }
.sync-line .sync-new button { margin-left: 6px; }
.tabs { display: flex; gap: 2px; }
.tabs button { background: none; border: 0; color: var(--muted); padding: 10px 14px; cursor: pointer; border-bottom: 2px solid transparent; font-size: 14px; }
.tabs button.active { color: var(--text); border-bottom-color: var(--accent); }
.tabs button:hover { color: var(--text); }
main { padding: 16px 20px 40px; max-width: 1500px; margin: 0 auto; }
.tab { display: none; }
.tab.active { display: block; }
.grid { display: grid; grid-template-columns: minmax(340px, 440px) 1fr; gap: 16px; align-items: start; }
@media (max-width: 1000px) { .grid { grid-template-columns: 1fr; } }
.col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 14px; min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.card-head h2 { margin: 0; }
details.card > summary { cursor: pointer; list-style: none; }
details.card > summary h2 { display: inline; }
details.card > summary::before { content: "▸ "; color: var(--muted); }
details.card[open] > summary::before { content: "▾ "; }
button.primary { background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 6px; padding: 7px 14px; font-weight: 600; cursor: pointer; }
button.primary:disabled { opacity: .5; cursor: progress; }
button.ghost { background: none; border: 1px solid var(--line); color: var(--muted); border-radius: 6px; padding: 4px 10px; cursor: pointer; }
button.ghost:hover { color: var(--text); }
select, input[type=number] { background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 5px; padding: 4px 6px; font-size: 13px; }
input[type=number] { width: 80px; }
.run { display: flex; gap: 8px; align-items: center; }
.run label { color: var(--muted); font-size: 12px; display: flex; gap: 6px; align-items: center; }

/* events */
.event { border-top: 1px solid var(--line); padding: 10px 0 4px; }
.event:first-child { border-top: 0; }
.event-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.event-head b { font-size: 13px; }
.event-meta { color: var(--muted); font-size: 11px; }
.match { display: grid; grid-template-columns: 1fr auto; gap: 6px; align-items: center; padding: 5px 0; border-bottom: 1px dashed var(--line-soft); }
.match:last-child { border-bottom: 0; }
.match .label { font-size: 11px; color: var(--muted); }
.match .teams { font-size: 13px; }
.match .teams .asia { color: var(--accent); }
.match .prob { font-size: 11px; color: var(--muted); }
.match select { max-width: 170px; }
.match.picked { background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 9%, transparent), transparent); }
.prob-bar { display: inline-block; width: 60px; height: 5px; background: var(--line); border-radius: 3px; vertical-align: middle; margin: 0 4px; overflow: hidden; }
.prob-bar i { display: block; height: 100%; background: var(--blue); }

/* tables */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
table.data th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12px; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data td { padding: 6px 8px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
table.data td.num, table.data th.num { text-align: right; }
table.data tr.cut td { border-bottom: 2px solid var(--accent); }
table.data tr.dim td { color: var(--muted); }
.bar { position: relative; width: 120px; height: 14px; background: var(--panel2); border-radius: 3px; overflow: hidden; display: inline-block; vertical-align: middle; }
.bar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--good); }
.bar i.s2 { background: var(--s2); }
.bar span { position: relative; font-size: 11px; padding-left: 4px; line-height: 14px; }
.tag { display: inline-block; font-size: 11px; padding: 0 6px; border-radius: 9px; border: 1px solid var(--line); color: var(--muted); }
.tag.s2 { color: var(--s2); border-color: var(--s2); }
.tag.s1 { color: var(--good); border-color: var(--good); }
.up { color: var(--good); } .down { color: var(--bad); }
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 8px; }
.chips span { font-size: 11px; background: var(--panel2); border: 1px solid var(--line); padding: 1px 7px; border-radius: 10px; color: var(--muted); }
.chips span.fixed { color: var(--accent); border-color: var(--accent); }
.strength-row { display: flex; justify-content: space-between; align-items: center; padding: 3px 0; font-size: 13px; }
.trend { margin: 8px 0 12px; }
.trend svg { width: 100%; height: 260px; }
.trend .legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12px; color: var(--muted); }
.trend .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
.prose { max-width: 900px; }
.prose h3 { font-size: 15px; margin: 22px 0 6px; }
.prose h3:first-child { margin-top: 4px; }
.prose p { margin: 6px 0; line-height: 1.75; }
.prose li { margin: 4px 0; line-height: 1.75; }
.prose details { margin-top: 18px; }
.prose summary { cursor: pointer; color: var(--muted); }
.prose code { background: var(--panel2); padding: 1px 5px; border-radius: 4px; font-size: 12px; }
.error { color: var(--bad); }

/* qualification conditions */
#cond-out { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
#cond-out .full { grid-column: 1 / -1; }
@media (max-width: 1000px) { #cond-out { grid-template-columns: 1fr; } }
.headline-num { font-size: 28px; font-weight: 700; }
.paths { list-style: none; padding: 0; margin: 8px 0 0; }
.paths li { border-left: 3px solid var(--line); padding: 6px 10px; margin: 6px 0; background: var(--panel2); border-radius: 0 6px 6px 0; }
.paths.good li { border-left-color: var(--good); }
.paths.bad li { border-left-color: var(--bad); }
.paths .and { color: var(--muted); padding: 0 4px; }
.paths .share { float: right; color: var(--muted); font-size: 12px; margin-left: 8px; }
.ranks { display: flex; gap: 4px; align-items: flex-end; height: 60px; margin-top: 8px; }
.ranks div { flex: 1; background: var(--blue); min-height: 1px; position: relative; border-radius: 2px 2px 0 0; }
.ranks div.in { background: var(--good); }
.ranks span { position: absolute; bottom: -18px; left: 0; right: 0; text-align: center; font-size: 11px; color: var(--muted); }
.tree ul { list-style: none; margin: 0; padding-left: 18px; border-left: 1px dashed var(--line); }
.tree > ul { padding-left: 0; border-left: 0; }
.tree li { margin: 4px 0; }
.tree .q { color: var(--muted); font-size: 12px; }
.badge { display: inline-block; font-size: 11px; padding: 0 6px; border-radius: 9px; margin-left: 4px; }
.badge.good { background: color-mix(in srgb, var(--good) 15%, transparent); color: var(--good); }
.badge.bad { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); }
.badge.mid { background: color-mix(in srgb, var(--blue) 13%, transparent); color: var(--blue); }
td.root-good { color: var(--good); }
td.root-bad { color: var(--bad); }
.badge.likely { background: color-mix(in srgb, var(--good) 9%, transparent); color: var(--good); }
.tag.done { color: var(--text); border-color: var(--muted); background: var(--panel2); }
.warn-picks { color: var(--warn); }
.rival { display: inline-block; font-size: 12px; padding: 0 6px; margin: 1px 2px 1px 0; border-radius: 9px; background: var(--panel2); border: 1px solid var(--line); white-space: nowrap; }
.rival b { color: var(--warn); font-weight: 600; }
.rv { margin: 4px 0; line-height: 1.6; }
details.grid > summary { cursor: pointer; }
table.mini { border-collapse: collapse; margin: 4px 0; }
table.mini th, table.mini td { border: 1px solid var(--line); padding: 2px 6px; font-size: 12px; text-align: center; font-weight: normal; }
table.mini th { color: var(--muted); }
b.warnc { color: var(--warn); }
.story ul.sub { margin: 2px 0 6px; padding-left: 18px; color: var(--muted); }
.story ul.sub li { margin: 0; }
.match.played { opacity: .75; }
.story .lead { font-size: 17px; font-weight: 600; margin: 0 0 8px; }
.story .rule { font-size: 15px; margin: 6px 0; }
.story ul { margin: 6px 0; padding-left: 20px; line-height: 1.7; }
.story ul.rules li::marker { content: "✓  "; color: var(--good); }
.story ul.cases li { margin: 2px 0; }
ul.plain { margin: 6px 0; padding-left: 18px; line-height: 1.7; }
table.outcomes td { vertical-align: top; }
.tree h3 { font-size: 13px; margin: 14px 0 4px; color: var(--muted); font-weight: 600; }

/* prediction page */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; padding: 10px 14px; }
.pin-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-width: 0; }
.pin { font-size: 12px; background: color-mix(in srgb, var(--accent) 10%, transparent); border: 1px solid var(--accent); color: var(--text); padding: 1px 4px 1px 8px; border-radius: 10px; }
.pin.done { border-color: var(--muted); background: var(--panel2); padding-right: 8px; }
.pin.warn { border-color: var(--warn); background: color-mix(in srgb, var(--warn) 10%, transparent); padding-right: 8px; }
.pin .x { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 14px; line-height: 1; padding: 0 4px; }
.pin .x:hover { color: var(--bad); }
button.small { font-size: 12px; padding: 1px 8px; }
.grid.predict { grid-template-columns: 1fr minmax(320px, 400px); }
@media (max-width: 1100px) { .grid.predict { grid-template-columns: 1fr; } }
.col.side { position: sticky; top: 92px; max-height: calc(100vh - 104px); overflow-y: auto; }
@media (max-width: 1100px) { .col.side { position: static; max-height: none; } }
#predict-main { transition: opacity .15s; }
#predict-main.busy { opacity: .55; }
a.team-link { color: inherit; text-decoration: none; border-bottom: 1px dotted var(--muted); }
a.team-link:hover { border-bottom-color: var(--accent); }
.spark { display: inline-flex; align-items: flex-end; gap: 2px; height: 22px; vertical-align: middle; }
.spark i { width: 7px; background: var(--blue); border-radius: 1px; opacity: .8; }
.spark i.in { background: var(--good); }
.tchip { display: inline-block; font-size: 12px; padding: 0 7px; margin: 1px 3px 1px 0; border-radius: 9px; border: 1px solid var(--c); color: var(--text); background: color-mix(in srgb, var(--c) 18%, transparent); white-space: nowrap; }
/* pick your own combination */
.combo-lead { font-size: 14px; line-height: 1.8; margin: 8px 0; }
.combo-p { font-size: 18px; }
.combo { display: flex; flex-direction: column; gap: 4px; }
.cb-row { display: grid; grid-template-columns: 150px auto 80px minmax(0, 1fr); gap: 12px; align-items: center; padding: 4px 8px; border-radius: 6px; }
.cb-row.set { background: var(--panel2); }
.cb-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cb-now, .cb-then { font-variant-numeric: tabular-nums; font-size: 13px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.seg button { background: var(--panel2); border: 0; border-left: 1px solid var(--line); color: var(--muted); padding: 3px 10px; font-size: 12px; cursor: pointer; }
.seg button:first-child { border-left: 0; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.seg button.on[data-v="out"] { background: var(--bad); color: #fff; }
.seg button.on[data-v=""] { background: var(--line); color: var(--text); font-weight: normal; }
@media (max-width: 700px) { .cb-row { grid-template-columns: 1fr auto; } .cb-now, .cb-then { grid-column: span 1; } }
.combo-how { margin-top: 12px; font-size: 14px; line-height: 1.75; }
.combo-how:empty { display: none; }
.combo-how p { margin: 6px 0; }
.how-h { font-size: 15px; margin: 14px 0 4px; padding-top: 10px; border-top: 1px solid var(--line); }
.how-veto { color: var(--bad); }
table.combo-table td, table.combo-table th { padding: 3px 8px; }
table.combo-table .left { text-align: left; }
details.how-more > summary { cursor: pointer; font-size: 13px; color: var(--muted); margin: 6px 0; }
details.how-more ul.sub { margin: 2px 0 6px; padding-left: 18px; color: var(--muted); }
table.hltv-check th.grp { text-align: center; border-bottom: 1px solid var(--line); }
table.hltv-check td { white-space: normal; }
table.hltv-check td.diff { background: color-mix(in srgb, var(--warn) 18%, transparent); }
.km { border-top: 1px solid var(--line); padding: 10px 0 4px; }
.km:first-child { border-top: 0; }
.km-head { margin-bottom: 4px; }
table.km-table th { font-weight: normal; color: var(--text); }
table.km-table tr.now td, table.km-table tr.now th { border-bottom: 1px solid var(--line); }
table.km-table td.strong { font-weight: 700; }
details.more > summary { cursor: pointer; margin: 8px 0; }
button.pick { background: var(--panel2); border: 1px solid var(--line); color: var(--muted); border-radius: 5px; padding: 2px 8px; font-size: 12px; cursor: pointer; white-space: nowrap; }
button.pick:hover { color: var(--text); border-color: var(--accent); }
button.pick.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.match { grid-template-columns: minmax(0, 1fr) auto; }
.match > div:first-child { min-width: 0; overflow-wrap: anywhere; }
.match .acts { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; max-width: 170px; }
.match .acts select { max-width: 150px; }
.match .likely { display: block; font-size: 11px; color: var(--muted); }
details.event { border-top: 1px solid var(--line); padding: 8px 0 2px; }
details.event:first-child { border-top: 0; }
details.event > summary { cursor: pointer; list-style: none; }
details.event > summary::before { content: "▸ "; color: var(--muted); }
details.event[open] > summary::before { content: "▾ "; }
details.rest > summary { cursor: pointer; margin: 6px 0; }

/* overview in words */
.story-card { padding: 16px 18px; }
.sum-lead { font-size: 18px; margin: 0 0 12px; }
.sum-bars { display: flex; flex-direction: column; gap: 6px; }
.sum-row { display: grid; grid-template-columns: 150px minmax(80px, 1fr) 48px minmax(0, 210px); gap: 10px; align-items: center; }
.sum-name { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sum-bar { position: relative; height: 12px; background: var(--panel2); border-radius: 6px; overflow: hidden; }
.sum-bar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--good); border-radius: 6px; }
.sum-bar .half { position: absolute; left: 50%; top: 0; bottom: 0; border-left: 1px dashed color-mix(in srgb, var(--text) 25%, transparent); }
.sum-pct { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
@media (max-width: 700px) { .sum-row { grid-template-columns: 110px 1fr 44px; } .sum-note { display: none; } }
.sum-more { margin: 14px 0 0; line-height: 1.9; font-size: 14px; }
.sum-group { font-size: 12px; color: var(--muted); margin: 8px 0 0; }
.sum-group:first-child { margin-top: 0; }
.team-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin-top: 8px; }
.tcard { background: var(--panel2); border-radius: 8px; padding: 10px 12px; border-left: 4px solid var(--line); }
.tcard-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 15px; }
.tcard-q { font-size: 20px; font-weight: 700; }
.tcard p { margin: 6px 0; line-height: 1.65; }
.tl-day { font-weight: 600; color: var(--accent); margin: 14px 0 4px; }
.tl-day:first-child { margin-top: 4px; }
.tl-match { margin: 4px 0 10px; padding-left: 12px; border-left: 2px solid var(--line); }
.tl-match ul { margin: 4px 0; padding-left: 18px; line-height: 1.8; }
.tl-match li button.pick { margin-left: 6px; }
.section-title { font-size: 13px; color: var(--muted); font-weight: 600; margin: 8px 0 -6px; }
.tl-note { color: var(--warn); font-size: 13px; margin: 2px 0; }

/* own results ladder (conditions tab) */
.lad-group { font-size: 14px; margin: 14px 0 6px; font-weight: 600; }
.ladder { display: flex; flex-direction: column; gap: 6px; }
.lad-row { background: var(--panel2); border-radius: 6px; border-left: 4px solid var(--line); padding: 8px 12px; }
.lad-row.safe { border-left-color: var(--good); }
.lad-row.likely { border-left-color: var(--q-likely); }
.lad-row.open { border-left-color: var(--blue); }
.lad-row.slim { border-left-color: var(--warn); }
.lad-row.out { border-left-color: var(--bad); opacity: .8; }
.lad-head { display: grid; grid-template-columns: minmax(150px, 1.3fr) 80px minmax(170px, 1.6fr) 90px 100px; gap: 10px; align-items: center; }
.lad-label { font-weight: 600; }
.lad-share { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.lad-pts { font-size: 13px; font-variant-numeric: tabular-nums; }
.lad-badge { text-align: right; }
@media (max-width: 800px) { .lad-head { grid-template-columns: 1fr auto; } .lad-pts, .gap-bar { grid-column: 1 / -1; } }
.gap-bar { position: relative; height: 8px; background: var(--bg); border-radius: 4px; margin: 0 6px; overflow: visible; }
.gap-line { position: absolute; left: 50%; top: -3px; bottom: -3px; border-left: 2px solid var(--muted); }
.gap-dot { position: absolute; top: -2px; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; }
.gap-dot.up { background: var(--good); }
.gap-dot.down { background: var(--bad); }
details.lad-more { margin-top: 6px; }
details.lad-more > summary { cursor: pointer; font-size: 12px; color: var(--muted); }
.how { margin: 6px 0 8px; }
.how-title { font-weight: 600; font-size: 13px; margin: 8px 0 2px; }
table.how-table { width: 100%; max-width: 760px; }
table.how-table td, table.how-table th { text-align: left; vertical-align: top; line-height: 1.6; }
table.how-table td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.how-table tr.sub td, table.how-table tr.total td { border-top: 2px solid var(--line); }
table.how-table tr.total td { font-weight: 600; }
.how > p { margin: 2px 0 6px; max-width: 760px; }
.how-opp { padding: 2px 0; }
.how-opp + .how-opp { border-top: 1px dashed var(--line-soft); }
.how-parts { line-height: 1.5; padding-left: 1.4em; }
.how-table .nw { white-space: nowrap; }
.rv-block { margin: 6px 0 2px; font-size: 13px; }
.rv-block p { margin: 4px 0; }
.rv-block ul { margin: 4px 0; padding-left: 18px; line-height: 1.75; }
.rv-block li { margin: 3px 0; }
details.rv-more { display: inline-block; margin-left: 6px; }
details.rv-more > summary { cursor: pointer; font-size: 12px; color: var(--muted); }
details.rv-more[open] { display: block; margin: 4px 0 6px; }

/* ---------- qualification tiers (tierOf in app.js) ---------- */
.qf-safe { background: var(--q-safe) !important; }
.qf-likely { background: var(--q-likely) !important; }
.qf-open { background: var(--q-open) !important; }
.qf-slim { background: var(--q-slim) !important; }
.qf-out { background: var(--q-out) !important; }
.t-safe { --c: var(--q-safe); } .t-likely { --c: var(--q-likely); } .t-open { --c: var(--q-open); } .t-slim { --c: var(--q-slim); } .t-out { --c: var(--q-out); }
.tier-tag { display: inline-block; font-size: 11px; font-weight: 500; line-height: 16px; padding: 0 6px; margin-left: 6px; border-radius: 9px; vertical-align: 2px; color: var(--text);
  background: color-mix(in srgb, var(--c) 16%, transparent); border: 1px solid color-mix(in srgb, var(--c) 50%, transparent); }
.hint .tier-tag { margin-left: 0; }
.tcard { border-left-color: var(--c, var(--line)); }
.tcard-bar { height: 6px; background: var(--bg); border-radius: 3px; overflow: hidden; margin: 6px 0 4px; }
.tcard-bar i { display: block; height: 100%; border-radius: 3px; }
.tcard-next { margin-bottom: 2px; }
.bar { background: var(--panel2); }
.bar span { color: var(--text); }

/* ---------- timeline: one chip per team that moves ---------- */
.tl-match ul { list-style: none; padding-left: 0; }
.tl-match li { margin: 6px 0 8px; }
.tl-line { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.mvs { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.mv { display: inline-flex; align-items: baseline; gap: 4px; font-size: 12px; line-height: 20px; padding: 0 7px; border-radius: 10px; background: var(--panel2); border: 1px solid var(--line); border-left-width: 3px; white-space: nowrap; }
.mv b { font-variant-numeric: tabular-nums; }
.mv-up { border-left-color: var(--good); } .mv-up .mv-d { color: var(--good); }
.mv-down { border-left-color: var(--bad); } .mv-down .mv-d { color: var(--bad); }
.mv-d { font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- page navigation ---------- */
.toolbar .jump { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; border-top: 1px solid var(--line-soft); padding-top: 8px; }
.jump button { background: none; border: 1px solid var(--line); color: var(--text); border-radius: 12px; padding: 1px 10px; font-size: 12px; cursor: pointer; }
.jump button:hover { border-color: var(--accent); }
[id^="sec-"] { scroll-margin-top: var(--header-h, 120px); }
.cond-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 2px; }
.chip-btn { background: var(--panel2); border: 1px solid var(--line); color: var(--text); border-radius: 14px; padding: 3px 12px; font-size: 13px; cursor: pointer; }
.chip-btn:hover { border-color: var(--accent); }
.chip-btn.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); font-weight: 600; }
.tabs .theme-btn { margin-left: 8px; align-self: center; background: none; border: 1px solid var(--line); color: var(--muted); border-radius: 12px; padding: 2px 10px !important; font-size: 12px !important; cursor: pointer; border-bottom: 1px solid var(--line) !important; }
.tabs .theme-btn:hover { color: var(--text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
button:focus:not(:focus-visible) { outline: none; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); margin-top: 24px; padding: 16px 20px 28px; text-align: center; font-size: 12px; color: var(--muted); }
.site-footer p { margin: 4px 0; }
.site-footer a { color: var(--accent); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* ---------- the standings under chosen results (conditions page) ---------- */
button.small { font-size: 12px; padding: 2px 8px; }
.stand-go { margin-top: 6px; }
#stand-body.busy { opacity: .55; }
.stand-facets { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
.facet-group { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; background: var(--panel2); border-radius: 6px; padding: 8px 10px; }
details.facet-group { display: block; }
details.facet-group[open] > .facet { margin: 4px 14px 4px 0; }
.facet-head { flex-basis: 100%; font-size: 12px; color: var(--muted); font-weight: 600; }
details.facet-group > summary.facet-head { cursor: pointer; }
.facet { display: inline-flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; font-size: 13px; }
.facet select { max-width: 100%; }
.stand-sum { margin: 8px 0; }
table.stand-table tr.me td { background: color-mix(in srgb, var(--accent) 8%, transparent); }
table.stand-table tr.stand-detail > td { white-space: normal; background: var(--panel2); padding: 8px; }
table.stand-table tr.stand-detail table.how-table td { white-space: normal; }
/* the breakdown stays on screen while the wide table scrolls sideways (phones) */
.stand-parts-box { position: sticky; left: 0; max-width: calc(100vw - 64px); }
.stand-parts-box table.how-table { width: 100%; }
.stand-parts, .stand-order { margin-left: 6px; }
#stand-card h3 { font-size: 14px; margin: 16px 0 4px; }
.stand-list li, .stand-orders li { padding: 3px 0; border-bottom: 1px dashed var(--line-soft); }
.stand-orders li { display: flex; gap: 10px; align-items: baseline; }
.ord-share { min-width: 44px; text-align: right; font-variant-numeric: tabular-nums; }
.ord { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.ord span { white-space: nowrap; }
.ord span.out { color: var(--muted); }
.ord span.out::before { content: "｜"; color: var(--line); margin-right: 6px; }
.ord span.same { opacity: .55; }
.ord small { color: var(--muted); }

/* ---------- phones: the header scrolls away, tabs scroll sideways ---------- */
@media (max-width: 700px) {
  :root { --header-h: 8px; }
  .top { position: static; padding: 10px 12px 0; gap: 4px; }
  .brand p { font-size: 11px; margin: 2px 0 6px; }
  .tabs { overflow-x: auto; width: 100%; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs button { white-space: nowrap; padding: 8px 10px; }
  main { padding: 12px 12px 32px; }
  .card { padding: 12px; }
  .sum-lead { font-size: 16px; }
  .tcard-q { font-size: 18px; }
}