:root {
  /* HorseLay: Deal Sniper green on plain white. Light only, by choice. */
  color-scheme: light;
  --bg: #FFFFFF;
  --panel: #FFFFFF;
  --wash: #F2F8F4;
  --ink: #0C2419;
  --muted: #4F6358;
  --faint: #7D8F85;
  --line: #D5E6DB;
  --line-strong: #BCD6C5;
  --brand: #0E7A45;
  --brand-dark: #095C33;
  --brand-bright: #1FAE5B;
  --on-brand: #FFFFFF;
  --accent: #0E7A45;
  --accent-soft: #DDF2E5;
  --steam: #8A5A00;
  --steam-soft: #FBEFD6;
  --drift: #4F6358;
  --bad: #B3362A;
  --bad-soft: #F9E3E0;
  --row-hi: #EAF6EF;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --sans: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Archivo", "Arial Narrow", Arial, sans-serif;
  --r: 12px;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 var(--sans); -webkit-text-size-adjust: 100%; }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.err { color: var(--bad); min-height: 1.4em; margin: 8px 0 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- top bar ---------- */
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 16px; padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); background: var(--bg); color: var(--ink); border-bottom: 3px solid var(--brand); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand img { width: 34px; height: 34px; }
.brand b { font-family: var(--display); font-weight: 900; font-stretch: 118%; font-size: 20px; letter-spacing: .02em; text-transform: uppercase; line-height: 1; }
.brand b span { color: var(--brand); }
.tabs { display: flex; gap: 4px; margin-left: 8px; }
.tabs button { background: none; border: 0; color: var(--ink); font-weight: 600; font-size: 14px; padding: 7px 12px; border-radius: 999px; cursor: pointer; }
.tabs button:hover { background: var(--wash); }
.tabs button.on { background: var(--brand); color: var(--on-brand); }
.quiet { display: flex; align-items: center; gap: 7px; flex: none; margin-left: auto; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; user-select: none; white-space: nowrap; }
.quiet[hidden] { display: none; }
.quiet input { width: 16px; height: 16px; accent-color: var(--brand); margin: 0; }
.quiet + .conn { margin-left: 0; }
.conn { margin-left: auto; display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #9AABA1; flex: none; }
.dot.live { background: var(--brand-bright); box-shadow: 0 0 0 3px rgba(31,174,91,.18); }
.dot.warn { background: #D99A1E; }
.dot.bad { background: var(--bad); }

.view { min-height: calc(100vh - 52px); }
.wrap { max-width: 980px; margin: 0 auto; padding: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); }
.btn { padding: 8px 14px; border-radius: 8px; border: 1.5px solid var(--brand); background: var(--panel); color: var(--brand); font-weight: 700; cursor: pointer; }
.btn:hover { background: var(--wash); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn.primary:hover { background: var(--brand-dark); }
.btn.small { padding: 4px 9px; font-size: 13px; }
.btn.ghost { background: transparent; border-color: var(--line-strong); color: var(--muted); font-weight: 600; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; background: var(--panel); }
.seg button { border: 0; background: none; padding: 6px 12px; cursor: pointer; color: var(--muted); }
.seg { border-color: var(--brand); }
.seg button { font-weight: 600; }
.seg button.on { background: var(--brand); color: var(--on-brand); }

/* ---------- join ---------- */
.join { max-width: 400px; margin: 64px auto; padding: 26px; display: grid; gap: 12px; background: var(--wash); }
.join h1 { margin: 0; font-size: 26px; font-family: var(--display); font-weight: 900; }
.join { border-top: 4px solid var(--brand); }
.join p { margin: 0; }
label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
input, select { padding: 9px 11px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--panel); font-size: 15px; color: var(--ink); }
input:focus { border-color: var(--accent); }

/* ---------- races ---------- */
.races-layout { display: grid; grid-template-columns: 290px 1fr; min-height: calc(100vh - 52px); }
.race-list { border-right: 1px solid var(--line); background: var(--wash); overflow-y: auto; max-height: calc(100vh - 52px); position: sticky; top: 52px; }
.race-list h3 { margin: 0; padding: 12px 14px 6px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.race-item { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 9px 14px; border-bottom: 1px solid var(--line); cursor: pointer; width: 100%; text-align: left; background: none; border-left: 3px solid transparent; border-top: 0; border-right: 0; }
.race-item:hover { background: #E6F2EA; }
.race-item.on { border-left-color: var(--brand); background: var(--panel); }
.race-item .v { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.race-item .t { font-family: var(--mono); font-size: 13px; text-align: right; }
.race-item .t.soon { color: var(--steam); font-weight: 700; }
.race-item .meta { grid-column: 1 / -1; display: flex; gap: 6px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: 999px; font-size: 11.5px; background: var(--bg); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.chip.steam { background: var(--steam-soft); border-color: transparent; color: var(--steam); font-weight: 600; }
.chip.good { background: var(--accent-soft); border-color: transparent; color: var(--accent); font-weight: 600; }
.chip.stale { background: var(--bad-soft); border-color: transparent; color: var(--bad); }
.empty { padding: 40px 24px; text-align: center; color: var(--muted); }
.empty h2 { color: var(--ink); font-size: 18px; margin: 0 0 6px; }

.race-panel { padding: 16px 20px 40px; min-width: 0; }
.race-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin-bottom: 12px; }
.race-head h2 { margin: 0; font-size: 26px; font-family: var(--display); font-weight: 900; font-stretch: 108%; letter-spacing: -.01em; }
.race-head .jump { font-family: var(--mono); font-size: 15px; color: var(--muted); }
.race-head .jump.soon { color: var(--steam); font-weight: 700; }
.back-link { display: none; background: none; border: 0; color: var(--accent); padding: 0; cursor: pointer; }

.controls { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: end; margin-bottom: 12px; }
.controls label { min-width: 0; }
.controls input { width: 96px; font-family: var(--mono); }
.controls select { min-width: 130px; }
.sources { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }

.grid-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); }
table.grid { width: 100%; border-collapse: collapse; font-size: 14px; }
.grid th { position: sticky; top: 0; background: var(--wash); text-align: right; font-weight: 600; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); padding: 9px 10px; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
.grid th.l, .grid td.l { text-align: left; }
.grid td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.grid tr:last-child td { border-bottom: 0; }
.grid td.name { font-family: var(--sans); font-weight: 600; max-width: 190px; overflow: hidden; text-overflow: ellipsis; }
.grid td.no { color: var(--muted); width: 1%; }
.grid tr.scr td { color: var(--faint); text-decoration: line-through; }
.grid tr.best td.name::after { content: " ★"; color: var(--accent); }
.grid .lay { color: #B23A6E; }
.grid .backp { color: #1F5FA8; }
.grid .bookie { cursor: pointer; text-decoration: underline dotted var(--faint); text-underline-offset: 3px; }
.grid .bookie.manual { color: var(--steam); }
.grid .good { color: var(--accent); font-weight: 700; }
.grid .bad { color: var(--bad); }
.mv { display: inline-flex; align-items: center; justify-content: flex-end; gap: 4px; min-width: 64px; }
.mv.up { color: var(--steam); font-weight: 700; }
.mv.down { color: var(--drift); }
.mv.hot { background: var(--steam-soft); border-radius: 6px; padding: 1px 5px; }
.track-btn { font-family: var(--sans); }
.hint-row { margin-top: 10px; font-size: 13px; color: var(--muted); }
.linker { margin-top: 14px; padding: 12px 14px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------- tracker ---------- */
.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.stat { padding: 14px 16px; }
.stat .k { font-size: 12px; color: var(--muted); }
.stat .v { font-family: var(--display); font-weight: 900; font-stretch: 80%; font-size: 30px; line-height: 1.1; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat:first-child { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.stat:first-child .k, .stat:first-child .s { color: rgba(255,255,255,.85); }
.stat:first-child .v, .stat:first-child .v.pos, .stat:first-child .v.neg { color: var(--on-brand); }
.stat .v.pos { color: var(--accent); } .stat .v.neg { color: var(--bad); }
.stat .s { font-size: 12px; color: var(--faint); }
.tracker-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.bet { padding: 12px 14px; margin-bottom: 8px; display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; }
.bet .title { font-weight: 600; }
.bet .sub { font-size: 13px; color: var(--muted); }
.bet .figs { font-family: var(--mono); font-size: 13px; color: var(--muted); grid-column: 1 / -1; display: flex; gap: 14px; flex-wrap: wrap; }
.bet .pl { font-family: var(--mono); font-weight: 700; text-align: right; }
.bet .acts { grid-column: 1 / -1; display: flex; gap: 6px; flex-wrap: wrap; }
.tag { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: 1px 6px; border-radius: 4px; background: var(--bg); border: 1px solid var(--line); color: var(--muted); margin-right: 6px; }
.tag.bonus { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

/* ---------- settings ---------- */
.settings section { padding: 16px; margin-bottom: 14px; }
.settings h2 { margin: 0 0 4px; font-size: 18px; font-family: var(--display); font-weight: 800; }
.settings p { margin: 0 0 12px; color: var(--muted); font-size: 14px; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.keybox { display: flex; gap: 8px; }
.keybox input { flex: 1; font-family: var(--mono); font-size: 13px; }
.check { display: flex; gap: 8px; align-items: center; color: var(--ink); font-size: 15px; }
.check input { width: 18px; height: 18px; }

/* ---------- dialog & toasts ---------- */
dialog { border: 1px solid var(--line-strong); border-radius: 14px; padding: 0; background: var(--panel); color: var(--ink); width: min(440px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(0,0,0,.45); }
.dlg { padding: 18px; display: grid; gap: 12px; }
.dlg h3 { margin: 0; font-size: 17px; }
.dlg .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dlg .actions { display: flex; justify-content: flex-end; gap: 8px; }
.dlg .calc { font-family: var(--mono); font-size: 13px; color: var(--muted); background: var(--bg); border-radius: 8px; padding: 8px 10px; }
.toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 50; max-width: min(380px, calc(100vw - 32px)); }
.toast { background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.2); font-size: 14px; cursor: pointer; }
.toast.steam { background: #B26F00; color: #fff; }

/* ---------- phone ---------- */
@media (max-width: 760px) {
  .top { gap: 8px; padding: 10px 12px; }
  .brand b { display: none; }
  .tabs { margin-left: 0; }
  .conn .txt { display: none; }
  .top { flex-wrap: wrap; }
  .race-filters { order: 3; flex-basis: 100%; }
  .races-layout { grid-template-columns: 1fr; }
  .race-list { position: static; max-height: none; border-right: 0; }
  .races-layout.has-race .race-list { display: none; }
  .races-layout:not(.has-race) .race-panel { display: none; }
  .back-link { display: inline; }
  .race-panel { padding: 12px 12px 32px; }
  .grid td, .grid th { padding: 7px 7px; }
  .grid td.name { max-width: 120px; }
  .wrap { padding: 12px; }
  .hide-sm { display: none; }
}
.row-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 0; border-top: 1px solid var(--line); }
.row-line:first-child { border-top: 0; }
dialog { overflow-x: hidden; }
.dlg input, .dlg select { width: 100%; min-width: 0; }
.dlg .row2 > * { min-width: 0; }
.dlg .check input { width: 18px; }
.bet .pl.good { color: var(--accent); }
.bet .pl.bad { color: var(--bad); }
.bet .good { color: var(--accent); }
.show-sm { display: none; }
@media (max-width: 760px) {
  .show-sm { display: inline; }
  table.grid { font-size: 13px; }
  .grid td, .grid th { padding: 8px 5px; }
  .grid td.name { max-width: 92px; }
  .grid th { font-size: 10px; letter-spacing: .03em; }
  .mv { min-width: 0; }
  .track-btn { padding: 2px 9px; font-size: 16px; line-height: 1.2; }
  .race-head h2 { font-size: 20px; }
}
@media (max-width: 400px) {
  .grid td, .grid th { padding: 8px 4px; }
  .grid td.name { max-width: 84px; }
}
.g { color: var(--brand); }

/* =================== fun layer =================== */
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 60% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); } }
@keyframes pulse-steam { 0%, 100% { box-shadow: inset 4px 0 0 #E8901A; } 50% { box-shadow: inset 4px 0 0 #F7C46A; } }
@keyframes flicker { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-1px) scale(1.12); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@keyframes floatup { from { transform: translate(-50%, 0); opacity: 1; } to { transform: translate(-50%, -70px); opacity: 0; } }
@keyframes tick { from { transform: translateY(-3px); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes urgent { 0%, 100% { background: var(--bad); } 50% { background: #E25A4D; } }

/* conversion tiers */
.t-elite { --tc: #0B6B3C; --tb: #C9EFD8; }
.t-great { --tc: #0E7A45; --tb: #DDF2E5; }
.t-good  { --tc: #3E8F2E; --tb: #E8F4D8; }
.t-ok    { --tc: #8A5A00; --tb: #FBEFD6; }
.t-poor  { --tc: #B3362A; --tb: #F9E3E0; }
.t-none  { --tc: var(--faint); --tb: var(--wash); }

/* race list */
.race-item .v em { font-style: normal; color: var(--ink); font-weight: 800; }
.race-item.is-steam { box-shadow: inset 3px 0 0 #E8901A; }
.chip.best { background: var(--tb); color: var(--tc); border-color: transparent; font-weight: 700; }
.chip.steam .e, .flame { display: inline-block; animation: flicker 1.1s ease-in-out infinite; }
.empty-icon { font-size: 44px; line-height: 1; margin-bottom: 8px; animation: pop .5s ease-out both; }

/* countdown tiles */
.jump { display: inline-flex; align-items: center; gap: 8px; }
.jump small { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.tiles { display: inline-flex; gap: 3px; align-items: center; }
.tiles b { display: inline-grid; place-items: center; min-width: 26px; height: 34px; padding: 0 4px; border-radius: 7px; background: var(--brand); color: #fff; font: 900 21px/1 var(--display); font-stretch: 85%; box-shadow: inset 0 -3px 0 rgba(0,0,0,.18); animation: tick .25s ease-out; }
.tiles i { font-style: normal; font-weight: 900; color: var(--brand); padding: 0 1px; }
.tiles.soon b { background: #C67B00; }
.tiles.soon i { color: #C67B00; }
.tiles.urgent b { animation: urgent 1s ease-in-out infinite; }
.tiles.urgent i { color: var(--bad); }
.tiles-word { font: 900 18px var(--display); color: var(--bad); text-transform: uppercase; letter-spacing: .04em; }

/* spotlight card */
.spot { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 14px 18px; padding: 14px 18px; margin: 4px 0 14px; border-radius: 16px; border: 2px solid var(--tc, var(--brand)); background: linear-gradient(100deg, var(--tb, var(--wash)) 0%, #fff 70%); }
.spot-new { animation: pop .35s ease-out both; }
.spot-good { --tc: var(--brand); --tb: var(--accent-soft); }
.spot-meh { --tc: #C9A64A; --tb: #FBF3DC; }
.spot-ring { position: relative; width: 72px; height: 72px; }
.spot-ring span { position: absolute; inset: 0; display: grid; place-items: center; font: 900 19px var(--display); font-stretch: 85%; color: var(--tc); }
.ring-bg { fill: none; stroke: rgba(12,36,25,.08); stroke-width: 8; }
.ring-fg { fill: none; stroke: var(--tc); stroke-width: 8; stroke-linecap: round; transition: stroke-dasharray .5s ease; }
.spot-badge { font-size: 34px; width: 56px; height: 56px; display: grid; place-items: center; background: #fff; border-radius: 50%; border: 2px solid var(--tc); }
.spot-k { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.tier-word { color: var(--tc); }
.spot-name { font: 900 22px/1.15 var(--display); font-stretch: 105%; margin: 2px 0; }
.spot-sub { font-size: 13.5px; color: var(--muted); }
.spot-num { text-align: right; }
.spot-num b { display: block; font: 900 30px/1 var(--display); font-stretch: 80%; color: var(--tc); font-variant-numeric: tabular-nums; }
.spot-num b.pos { color: var(--brand); } .spot-num b.neg { color: var(--bad); }
.spot-num span { font-size: 12px; color: var(--muted); }

/* table bits */
.meter { position: relative; display: inline-block; width: 74px; height: 22px; border-radius: 6px; background: var(--tb); overflow: hidden; vertical-align: middle; }
.meter .fill { position: absolute; inset: 0 auto 0 0; background: var(--tc); opacity: .28; border-radius: 6px; transition: width .4s ease; }
.meter .val { position: relative; display: block; line-height: 22px; text-align: center; font-weight: 700; color: var(--tc); }
.mv.hot { font-weight: 800; }
.grid tr.best td.name::after { content: " ★"; color: #E0A800; }

/* tracker hero + badges */
#summary { display: grid; gap: 12px; margin-bottom: 16px; grid-template-columns: none; }
.hero { display: grid; grid-template-columns: 1.3fr 1fr; gap: 0; overflow: hidden; border: 0; }
.hero-rank { display: flex; gap: 16px; align-items: center; padding: 20px; background: var(--brand); color: #fff; }
.hero-rank .k, .hero-rank .s { color: rgba(255,255,255,.85); font-size: 12px; }
.rank-icon { font-size: 40px; width: 68px; height: 68px; display: grid; place-items: center; background: rgba(255,255,255,.14); border-radius: 18px; flex: none; animation: pop .5s ease-out both; }
.rank-name { font: 900 26px/1.1 var(--display); font-stretch: 108%; text-transform: uppercase; letter-spacing: .01em; }
.bar { height: 10px; border-radius: 99px; background: rgba(255,255,255,.22); margin: 8px 0 6px; overflow: hidden; width: min(320px, 100%); }
.bar span { display: block; height: 100%; background: linear-gradient(90deg, #7FE3A9, #FFFFFF); border-radius: 99px; transition: width .8s ease; }
.hero-profit { padding: 20px; background: var(--wash); display: flex; flex-direction: column; justify-content: center; }
.hero-profit .k, .hero-profit .s { font-size: 12px; color: var(--muted); }
.big { font: 900 44px/1 var(--display); font-stretch: 80%; margin: 4px 0; font-variant-numeric: tabular-nums; }
.big.pos { color: var(--brand); } .big.neg { color: var(--bad); }
.streak { color: #B26F00; font-weight: 700; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.stats .stat:first-child { background: var(--panel); border-color: var(--line); color: var(--ink); }
.stats .stat:first-child .k, .stats .stat:first-child .s { color: var(--muted); }
.stats .stat:first-child .v { color: var(--ink); }
.stat .v.t-elite, .stat .v.t-great, .stat .v.t-good, .stat .v.t-ok, .stat .v.t-poor { color: var(--tc); }
.badges { padding: 14px 16px 16px; }
.badges-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.badges-head h3 { margin: 0; font: 800 17px var(--display); }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.badge { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; padding: 9px 10px; border-radius: 12px; border: 1.5px dashed var(--line-strong); background: #fff; filter: grayscale(1); opacity: .55; }
.badge .bi { grid-row: 1 / 3; font-size: 24px; }
.badge b { font-size: 13.5px; }
.badge small { font-size: 11.5px; color: var(--muted); line-height: 1.25; }
.badge.got { filter: none; opacity: 1; border: 1.5px solid var(--brand); background: var(--accent-soft); }
.bet.shake { animation: shake .4s ease; }
.float-text { position: fixed; z-index: 60; transform: translate(-50%, 0); pointer-events: none; font: 900 22px var(--display); color: var(--brand); text-shadow: 0 2px 0 #fff; animation: floatup 1.2s ease-out forwards; }
.float-text.neg { color: var(--bad); }
canvas.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 70; }
.toast { animation: pop .3s ease-out both; }
.toast.unlock { background: var(--brand); color: #fff; font-weight: 600; }

/* join */
.join-icon { font-size: 48px; line-height: 1; animation: pop .5s ease-out both; }
.btn.big { padding: 12px 16px; font-size: 16px; }

@media (max-width: 760px) {
  .spot { grid-template-columns: auto 1fr; padding: 12px 14px; gap: 10px 14px; }
  .spot-num { text-align: left; }
  .spot .btn { grid-column: 1 / -1; }
  .spot-name { font-size: 19px; }
  .hero { grid-template-columns: 1fr; }
  .big { font-size: 38px; }
  .meter { width: 58px; }
  .tiles b { min-width: 22px; height: 30px; font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.race-head .jump { font-family: var(--sans); }
/* row colours: green = target with enough to lay, orange = target but thin, grey = under target */
.grid tr.tone-go td { background: #D9F2E2; }
.grid tr.tone-go td:first-child { box-shadow: inset 4px 0 0 var(--bright); }
.grid tr.tone-thin td { background: #F5E6CF; }
.grid tr.tone-thin td:first-child { box-shadow: inset 4px 0 0 #C98A2E; }
.grid tr.tone-dim td { background: #EEF1EF; opacity: .5; }
.grid td.liqc { color: var(--ink); }
.grid td.liqc.thin { color: var(--bad); font-weight: 700; }
/* tap-to-copy lay stake */
.grid button.copy { font: inherit; color: inherit; background: none; border: 1px dashed transparent; border-radius: 6px; padding: 2px 5px; margin: -3px -6px -3px 0; cursor: copy; }
.grid button.copy:hover { border-color: var(--brand); background: #fff; }
.grid button.copy.copied { border-color: var(--brand); background: var(--brand); color: #fff; text-decoration: none; }
.grid td.cant button.copy { text-decoration: line-through; }
.meter.thin { opacity: .45; }
.meter.thin .val { text-decoration: line-through; }
.grid td.cant { color: var(--faint); text-decoration: line-through; }
.grid td small.liab { display: block; font-size: 10.5px; color: var(--faint); line-height: 1.1; }
.grid td.cant small.liab { color: var(--bad); text-decoration: none; }

/* filters */
/* race type / region ticks, in the top bar */
.race-filters { display: flex; align-items: center; gap: 12px; flex: 1 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.race-filters::-webkit-scrollbar { display: none; }
.race-filters[hidden] { display: none; }
.fgroup { display: flex; gap: 6px; flex: none; }
.fgroup + .fgroup { padding-left: 12px; border-left: 1px solid var(--line); }
.race-filters .fchip { padding: 4px 10px; }
.fchip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; border: 1.5px solid var(--line-strong); background: #fff; color: var(--muted); font: 600 12.5px var(--sans); cursor: pointer; user-select: none; white-space: nowrap; }
.fchip b { font-weight: 700; font-size: 11px; background: var(--wash); color: var(--muted); border-radius: 999px; padding: 0 6px; }
.fchip.on { border-color: var(--brand); background: var(--brand); color: #fff; }
.fchip.on b { background: rgba(255,255,255,.22); color: #fff; }
.fchip:hover { border-color: var(--brand); }
/* tick box so it reads as something you can tick */
.fchip::before { content: ''; flex: none; width: 13px; height: 13px; border-radius: 3px; border: 1.5px solid var(--line-strong); background: #fff; box-sizing: border-box; }
.fchip.on::before { border-color: #fff; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2l2.3 2.3 4.7-5' fill='none' stroke='%230E7A45' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/11px no-repeat; }
.fchip input { width: 52px; padding: 1px 4px; font: 600 12.5px var(--mono); border-radius: 6px; border: 1px solid var(--line-strong); color: var(--ink); background: #fff; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin: 0 0 10px; }
.toolbar .sort { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.toolbar .sort select { padding: 6px 10px; font-size: 14px; }
.fchips { display: flex; flex-wrap: wrap; gap: 6px; }
.hidden-note { font-size: 12.5px; color: var(--muted); margin: -4px 0 6px; }
.grid td.none { text-align: center; color: var(--muted); padding: 22px; font-family: var(--sans); }
.race-list { padding: 0; }

/* ---------- sidebar: Live / Today ---------- */
.side-tabs { position: sticky; top: 0; z-index: 2; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 10px 12px; background: var(--wash); border-bottom: 1px solid var(--line); }
.side-tabs button { border: 1.5px solid var(--line-strong); background: #fff; color: var(--ink); font: 700 13px var(--sans); padding: 7px 10px; border-radius: 999px; cursor: pointer; }
.side-tabs button.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.meet { padding: 10px 14px 12px; border-bottom: 1px solid var(--line); }
.meet-h { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 7px; }
.meet-h b { font-size: 14.5px; }
.meet-h span { font-size: 11.5px; color: var(--faint); white-space: nowrap; }
.meet-done .meet-h b { color: var(--muted); }
.rchips { display: flex; flex-wrap: wrap; gap: 5px; }
.rchip { display: grid; justify-items: center; min-width: 50px; padding: 4px 6px 5px; border-radius: 8px; border: 1.5px solid var(--line-strong); background: #fff; color: var(--ink); font: 700 13px var(--sans); line-height: 1.15; cursor: pointer; }
.rchip small { font: 500 10.5px var(--mono); color: var(--muted); }
.rchip:hover { border-color: var(--brand); }
.rchip.live { border-color: var(--bright); background: #E6F6EC; }
.rchip.live small { color: var(--brand); }
.rchip.next { box-shadow: 0 0 0 2px var(--bright); }
.rchip.done { background: #EEF1EF; border-color: var(--line); color: var(--muted); }
.rchip.ab { background: #EEF1EF; border-color: var(--line); color: var(--faint); text-decoration: line-through; }
.rchip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.rchip.on small { color: rgba(255,255,255,.85); }

/* results + race card */
.results { display: flex; gap: 14px; align-items: flex-start; background: #fff; border: 2px solid var(--brand); border-radius: var(--r); padding: 12px 16px; margin-bottom: 12px; }
.results-k { font: 800 11px var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--brand); padding-top: 3px; }
.results ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; }
.results li { display: flex; align-items: baseline; gap: 7px; }
.results .pos { font: 800 12px var(--sans); padding: 2px 7px; border-radius: 6px; background: var(--wash); color: var(--ink); }
.results .p1 .pos { background: #F2C14E; }
.results .p2 .pos { background: #D7DDE2; }
.results .p3 .pos { background: #E3B48A; }
.results .who { font-weight: 600; }
.results .who small { display: block; font: 500 11px var(--mono); color: var(--muted); }
.race-name { margin: -2px 0 10px; color: var(--muted); font-size: 13.5px; }
.note-card { background: var(--wash); border: 1px dashed var(--line-strong); border-radius: var(--r); padding: 10px 14px; margin-bottom: 12px; font-size: 13.5px; color: var(--muted); }
.card-grid tr.placed td { background: #F5FAF6; font-weight: 600; }
.card-grid tr.p1 td { background: #FFF6DC; }
.tiles-word.clock { color: var(--ink); }

/* ---------- Group 1 drop-down (Live list) ---------- */
.g1drop { margin: 10px 12px 2px; background: #fff; border: 1.5px solid var(--line-strong); border-radius: 10px; }
.g1drop summary { list-style: none; cursor: pointer; padding: 9px 12px; font: 700 13.5px var(--sans); display: flex; align-items: center; gap: 8px; }
.g1drop summary::-webkit-details-marker { display: none; }
.g1drop summary::after { content: '▾'; margin-left: auto; color: var(--muted); transition: transform .15s; }
.g1drop[open] summary::after { transform: rotate(180deg); }
.g1drop summary b { background: var(--brand); color: #fff; border-radius: 999px; padding: 0 8px; font-size: 12px; }
.g1list { border-top: 1px solid var(--line); max-height: 320px; overflow-y: auto; }
.g1item { display: grid; grid-template-columns: 62px 1fr; gap: 1px 8px; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 8px 12px; cursor: pointer; font: inherit; color: var(--ink); }
.g1item:last-child { border-bottom: 0; }
.g1item:hover { background: var(--wash); }
.g1item.on { background: var(--row-hi); }
.g1when { grid-row: span 2; font: 600 12px var(--mono); color: var(--brand); align-self: center; }
.g1item.done .g1when { color: var(--muted); }
.g1v { font-weight: 700; font-size: 13.5px; }
.g1v em { font-style: normal; color: var(--brand); }
.g1n { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g1list .muted { padding: 10px 12px; margin: 0; font-size: 13px; }

/* ---------- Tracker: one block per day, newest first ---------- */
.dayblock { background: #fff; border: 1.5px solid var(--line); border-radius: var(--r); margin-bottom: 10px; overflow: hidden; }
.dayblock.sat { border-color: var(--line-strong); }
.dayblock.open { border-color: var(--brand); }
.day-head { width: 100%; display: grid; grid-template-columns: minmax(170px, 1.1fr) 2fr auto 18px; align-items: center; gap: 6px 14px; padding: 12px 16px; background: none; border: 0; text-align: left; font: inherit; color: var(--ink); cursor: pointer; }
.dayblock.open .day-head { background: var(--wash); border-bottom: 1px solid var(--line); }
.day-head:hover { background: var(--wash); }
.dh-date b { display: block; font-size: 15.5px; }
.dh-date em { font-style: normal; font-size: 11px; font-weight: 800; color: #fff; background: var(--brand); border-radius: 999px; padding: 1px 7px; margin-left: 4px; vertical-align: 2px; }
.dh-g1 { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dh-quick { display: flex; flex-wrap: wrap; gap: 5px; }
.dh-quick .q { font-size: 12px; background: var(--wash); border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; color: var(--muted); white-space: nowrap; }
.dayblock.open .dh-quick .q { background: #fff; }
.dh-quick .q b { color: var(--tc, var(--ink)); }
.dh-pl { font: 800 17px var(--mono); text-align: right; white-space: nowrap; }
.dh-pl.pos { color: var(--accent); } .dh-pl.neg { color: var(--bad); }
.dh-chev { color: var(--muted); transition: transform .15s; }
.dayblock.open .dh-chev { transform: rotate(180deg); }
.day-body { padding: 12px 12px 4px; }
.day-stats { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)) !important; margin-bottom: 10px; }
.day-stats .stat .v { font-size: 22px; }
.day-body .g1card { margin: 0 0 10px; }
.day-none { padding: 4px 4px 10px; margin: 0; }
@media (max-width: 760px) {
  .day-head { grid-template-columns: 1fr auto 16px; }
  .dh-quick { grid-column: 1 / -1; grid-row: 2; }
}
.day-hero .rank-name { font-size: 20px; }
.g1card { padding: 14px 16px; margin-top: 12px; }
.g1row { padding: 9px 0; border-top: 1px solid var(--line); }
.g1row-h { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.g1row-h span { font-size: 12.5px; color: var(--muted); }
.g1row-h em { color: var(--brand); font-style: normal; font-weight: 700; }
.g1row.bet-on { background: linear-gradient(90deg, var(--row-hi), transparent 70%); margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
.g1placed { display: flex; gap: 6px 16px; flex-wrap: wrap; margin-top: 5px; font-size: 13px; }
.g1placed i { font-style: normal; font: 800 11px var(--sans); padding: 1px 6px; border-radius: 5px; margin-right: 5px; background: var(--wash); }
.g1placed .p1 i { background: #F2C14E; } .g1placed .p2 i { background: #D7DDE2; } .g1placed .p3 i { background: #E3B48A; }
.list-h { margin: 18px 2px 8px; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
@media (max-width: 760px) { .daytab { width: 165px; } }

/* ---------- Qualify + Convert tables, each in its own bar you can hide ---------- */
.race-head .bookie-pick { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.race-head .bookie-pick select { min-width: 130px; }
.msec { border: 1.5px solid var(--line-strong); border-radius: var(--r); margin: 12px 0 16px; background: #fff; }
.msec-head { width: 100%; display: flex; align-items: center; gap: 14px; padding: 12px 16px; background: var(--brand); color: #fff; border: 0; border-radius: calc(var(--r) - 2px) calc(var(--r) - 2px) 0 0; font: inherit; cursor: pointer; text-align: left; }
.msec.shut .msec-head { border-radius: calc(var(--r) - 2px); }
.msec-head b { font: 800 16px var(--sans); letter-spacing: .02em; white-space: nowrap; }
.msec-sum { font-size: 13px; color: rgba(255,255,255,.88); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.msec-sum b { color: #fff; font: 800 13px var(--mono); }
.msec-sum b.neg { color: #FFD3CC; }
.msec-chev { margin-left: auto; transition: transform .15s; flex: none; }
.msec.shut .msec-chev { transform: rotate(-90deg); }
.msec-head:hover { background: var(--brand-dark); }
.msec-body { padding: 12px 12px 4px; }
.msec.shut .msec-body { display: none; }
.msec-body .controls { margin-bottom: 10px; }
@media (max-width: 760px) {
  .race-head .bookie-pick { margin-left: 0; width: 100%; }
  .msec-body { padding: 10px 6px 2px; }
  .msec-head { padding: 11px 12px; gap: 10px; }
}

/* all-time total (Tracker) */
.total-card { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px 20px; flex-wrap: wrap; padding: 18px 20px; margin-bottom: 12px; border-left: 6px solid var(--brand); }
.total-card .k { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.total-card .big { font-family: var(--display); font-weight: 900; font-size: 40px; line-height: 1.05; }
.total-card .big.pos { color: var(--accent); } .total-card .big.neg { color: var(--bad); }
.total-card .s { color: var(--muted); font-size: 13.5px; }

/* race list tidy-up */
.race-list { scrollbar-width: none; }
.race-list::-webkit-scrollbar { display: none; }
.race-item .foot { grid-column: 1 / -1; font: 500 11.5px var(--mono); color: var(--muted); margin-top: 1px; }
.g1drop { margin-bottom: 8px; }

/* source chips + bookie picker on one row */
.sources-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: 8px 14px; margin-bottom: 10px; }
.sources-row .sources { margin-bottom: 0; }
.bookgrp { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding-left: 14px; border-left: 1px solid var(--line); }
.bookgrp .lbl { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.bchip { font: 700 12.5px var(--sans); padding: 5px 12px; border-radius: 999px; border: 1.5px solid var(--line-strong); background: #fff; color: var(--ink); cursor: pointer; }
.bchip:hover { border-color: var(--brand); }
.bchip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.bchip.nodata:not(.on) { border-style: dashed; color: var(--faint); }
.msec .bookgrp { padding-left: 0; border-left: 0; margin: 2px 0 12px; }
@media (max-width: 760px) { .bookgrp { padding-left: 0; border-left: 0; } }

/* several bookies: bookie prices sit on white, only the best price per horse goes green (ties both go green) */
.grid tr[class*="tone-"] td.bookie { background: #fff; }
.grid td.bookie.best-bk { background: #BDE6CC !important; color: var(--brand-dark); font-weight: 800; box-shadow: inset 0 0 0 1.5px var(--bright); border-radius: 4px; }
.grid tr.tone-dim td.bookie.best-bk { opacity: 1; }

/* sign in / create account */
.join-seg { display: flex; }
.join-seg button { flex: 1; padding: 8px 10px; }
.join [hidden] { display: none !important; }
.linkish { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; font-size: 14px; cursor: pointer; justify-self: center; }
.linkish:hover { text-decoration: underline; }
.acct-form { display: grid; gap: 10px; max-width: 420px; }
.acct-row { display: flex; gap: 8px; flex-wrap: wrap; }
.note-line { font-size: 13px; color: var(--muted); }
.acct-form .err:empty { display: none; }
.keybox input { min-width: 0; }
@media (max-width: 440px) { .join { margin: 24px 12px; padding: 20px; } }
