:root {
  --bg: #070b10;
  --card: #141c27;
  --card-2: #1b2633;
  --ink: #f7f4ee;
  --muted: #c5d0db;
  --gold: #ffc857;
  --gold-2: #ffe3a3;
  --on-ink: #241804;
  --pink: #ff4d8d;
  --mint: #3dffb0;
  --sky: #7ec8ff;
  --orange: #ff9f43;
  --red: #ff4d6a;
  --line: rgba(255, 255, 255, 0.1);
  --display: "Oswald", "Arial Narrow", Impact, sans-serif;
  --body: "Source Sans 3", "Segoe UI", sans-serif;
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 18px;
  font-weight: 600;
}

body {
  background:
    radial-gradient(900px 420px at 50% -10%, rgba(255, 200, 87, 0.16), transparent 55%),
    radial-gradient(700px 380px at 110% 80%, rgba(255, 77, 141, 0.12), transparent 50%),
    var(--bg);
}

button, input, textarea { font-family: inherit; }

button {
  cursor: pointer;
  border: 0;
  color: inherit;
}

#app {
  width: min(480px, 100%);
  margin: 0 auto;
  min-height: 100dvh;
  padding: calc(14px + env(safe-area-inset-top)) 16px calc(28px + env(safe-area-inset-bottom));
}

.silk {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.brand {
  font-family: var(--display);
  letter-spacing: 0.04em;
  line-height: 0.95;
  font-size: 26px;
  margin: 0;
  text-transform: uppercase;
  max-width: 250px;
}

.welcome {
  font-size: 26px;
  line-height: 1.15;
  margin: 0 0 12px;
  font-weight: 800;
}

.lib-entry {
  margin-top: 18px;
  opacity: 0.7;
}

.brand span {
  display: block;
  color: var(--gold);
  font-size: 22px;
  letter-spacing: 0.18em;
}

.sub {
  color: var(--muted);
  margin: 6px 0 0;
  font-size: 16px;
  font-weight: 700;
}

.live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 0 rgba(61, 255, 176, 0.7);
  animation: pulse 1.8s infinite;
}

.live.down .dot {
  background: var(--red);
  animation: none;
}

.live.down { color: #ffd0d6; }

@keyframes pulse {
  70% { box-shadow: 0 0 0 8px rgba(61, 255, 176, 0); }
  100% { box-shadow: 0 0 0 0 rgba(61, 255, 176, 0); }
}

.icon-btn, .text-btn {
  background: transparent;
  color: var(--gold-2);
  font-weight: 800;
  font-size: 16px;
  padding: 10px 8px;
  min-height: 44px;
  white-space: nowrap;
}

.silk-right {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-left: auto;
}
body.desk .silk-right { flex: 1; min-width: 0; justify-content: flex-end; }

.top-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0;
}

h1, h2, h3 { font-family: var(--display); letter-spacing: 0.04em; font-weight: 600; }

.who { margin: 8px 0 14px; font-size: 28px; }

.names, .stack, .finish-grid, .type-grid, .race-grid, .pad, .keys {
  display: grid;
  gap: 10px;
}

.names { gap: 12px; }

.name-btn, .big, .key, .race-btn, .type-btn, .finish-btn, .person-btn {
  min-height: 64px;
  border-radius: 18px;
  font-size: 22px;
  font-weight: 800;
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow);
  text-align: left;
  padding: 14px 16px;
}

.name-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--display);
  font-size: 34px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  min-height: 84px;
}

.swatch {
  width: 18px;
  height: 46px;
  border-radius: 8px;
  flex: 0 0 auto;
}

.person-btn {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.person-btn b {
  font-family: var(--display);
  font-size: 32px;
  letter-spacing: 0.05em;
}

.big, .go, .hot, .ghost {
  width: 100%;
  text-align: center;
  justify-content: center;
}

.go {
  background: linear-gradient(180deg, #ffd56a, #f0b429);
  color: #241804;
  min-height: 72px;
  font-size: 26px;
  border-radius: 18px;
  font-weight: 800;
  box-shadow: 0 10px 30px rgba(255, 200, 87, 0.25);
}

.hot {
  background: linear-gradient(180deg, #ff6fa3, #ff3d78);
  color: white;
  min-height: 64px;
  font-size: 22px;
  border-radius: 18px;
  font-weight: 800;
}

.ghost {
  background: var(--card-2);
  color: var(--ink);
  min-height: 56px;
  border-radius: 16px;
  font-weight: 800;
  font-size: 18px;
}

.name-btn:active, .go:active, .hot:active, .ghost:active, .key:active, .race-btn:active, .type-btn:active, .finish-btn:active, .person-btn:active {
  transform: translateY(1px) scale(0.99);
}

.hero {
  background:
    linear-gradient(180deg, rgba(255, 200, 87, 0.12), transparent 40%),
    var(--card);
  border-radius: 24px;
  padding: 18px 16px 16px;
  text-align: center;
  margin: 12px 0;
  border: 1px solid rgba(255, 200, 87, 0.25);
}

.hero p { margin: 0; color: var(--muted); font-size: 16px; letter-spacing: 0.12em; text-transform: uppercase; }

.money {
  font-family: var(--display);
  font-size: 84px;
  line-height: 0.9;
  margin: 4px 0;
  color: var(--gold-2);
}

.money small { font-size: 40px; }

.hero .line { color: var(--ink); letter-spacing: 0; text-transform: none; font-size: 18px; margin-top: 4px; }

.next {
  background: #102033;
  border-radius: 18px;
  padding: 14px 16px;
  margin: 10px 0;
  border: 1px solid rgba(126, 200, 255, 0.25);
}

.next strong {
  display: block;
  font-family: var(--display);
  font-size: 28px;
  letter-spacing: 0.04em;
}

.next em { font-style: normal; color: var(--sky); font-weight: 800; }

.next.soon { border-color: rgba(255, 200, 87, 0.7); background: #2a220f; }
.next.now { border-color: var(--red); background: #2a1218; }

.section {
  margin: 18px 0 8px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.section h2 {
  margin: 0;
  font-size: 26px;
}

.count {
  background: var(--gold);
  color: #241804;
  border-radius: 999px;
  min-width: 32px;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  padding: 4px 10px;
  white-space: nowrap;
}

.count.bad { background: var(--red); color: white; }

.check-board {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px 12px 12px;
  margin: 0 0 12px;
}

.check-board.bad { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }

.check-progress {
  margin: 0 0 8px;
  color: var(--sky);
  font-size: 15px;
  line-height: 1.3;
}

.check-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
}

.check-table th {
  text-align: right;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0 8px 6px;
}

.check-table th:first-child,
.check-table td:first-child { text-align: left; }

.check-table td {
  text-align: right;
  padding: 3px 8px;
  font-variant-numeric: tabular-nums;
}

.check-table td:first-child {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
}

.book-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  font-weight: 800;
  padding: 2px 0;
  cursor: pointer;
}

.book-link span {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.activity-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 10px;
}

.activity-card .horses div { font-size: 26px; }

.ledger {
  list-style: none;
  margin: 8px 0 10px;
  padding: 0;
}

.ledger li {
  display: grid;
  grid-template-columns: 4.8rem 6.4rem minmax(0, 1fr) auto;
  gap: 4px 8px;
  align-items: baseline;
  padding: 7px 0;
  border-top: 1px solid var(--line);
  font-size: 15px;
}

.ledger time { color: var(--muted); }
.ledger b { font-weight: 800; }
.ledger span { color: var(--ink); }
.ledger em {
  font-style: normal;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

@media (max-width: 720px) {
  .ledger li { grid-template-columns: 4.6rem minmax(0, 1fr) auto; }
  .ledger span { grid-column: 2 / -1; }
}

.check-table .swatch { width: 8px; height: 16px; }

.check-table tr.total td {
  border-top: 1px solid var(--line);
  font-weight: 800;
  padding-top: 8px;
}

.check-table tr.lib td { color: var(--muted); font-weight: 700; }
.check-table tr.bad td { color: var(--gold); }

.check-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.card {
  background: var(--card);
  border-radius: 20px;
  padding: 14px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
}

.card.urgent { border-color: rgba(255, 77, 106, 0.85); box-shadow: 0 0 0 1px rgba(255, 77, 106, 0.35); }
.card.soon { border-color: rgba(255, 200, 87, 0.7); }
.card.win { border-color: rgba(61, 255, 176, 0.55); }
.card.place { border-color: rgba(126, 200, 255, 0.45); }
.card.bad { border-color: rgba(255, 77, 106, 0.45); }

.who-line {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 16px;
  font-weight: 800;
}

.horses {
  margin: 8px 0;
}

.horses div {
  font-family: var(--display);
  font-size: 30px;
  letter-spacing: 0.03em;
  line-height: 1.05;
  text-transform: uppercase;
}

.stake {
  font-size: 20px;
  margin: 6px 0 10px;
}

.stake b { color: var(--gold); font-size: 24px; }

.row-actions, .split {
  display: flex;
  gap: 8px;
}

.row-actions .text-btn { padding-left: 0; }

.board-row {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px 4px;
  border-bottom: 1px solid var(--line);
}

.board-row:last-child { border-bottom: 0; }

.board-row strong {
  font-family: var(--display);
  font-size: 26px;
  letter-spacing: 0.05em;
}

.board-row p { margin: 2px 0 0; color: var(--muted); font-size: 16px; }

.up { color: var(--mint); }
.down { color: #ff8fa3; }
.even { color: var(--muted); }

.pot {
  background: var(--card);
  border-radius: 20px;
  padding: 14px 16px;
  margin-top: 8px;
}

.pot strong { font-family: var(--display); font-size: 28px; letter-spacing: 0.03em; display: block; }

.pad {
  grid-template-columns: repeat(3, 1fr);
  margin-top: 12px;
}

.pin-dots {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin: 18px 0;
}

.pin-dots i {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  display: block;
}

.pin-dots i.on { background: var(--gold); }

.key, .race-btn, .type-btn, .finish-btn {
  text-align: center;
  min-height: 68px;
  font-family: var(--display);
  font-size: 28px;
  letter-spacing: 0.04em;
}

.race-grid, .type-grid { grid-template-columns: repeat(4, 1fr); }
.type-grid { grid-template-columns: repeat(2, 1fr); }
.finish-grid { grid-template-columns: repeat(2, 1fr); }

.race-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
  gap: 2px;
}

.race-btn b { font-weight: 600; }

.race-btn small {
  font-family: var(--body);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  opacity: 0.8;
}

.card-label {
  margin: 8px 0 0;
  font-family: var(--display);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gold);
  font-size: 22px;
}

.horse-grid {
  display: grid;
  gap: 8px;
  margin: 8px 0 4px;
}

.horse-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 10px 14px;
  border-radius: 16px;
  background: var(--card);
  text-align: left;
  font-size: 20px;
  box-shadow: inset 0 0 0 1px var(--line);
}

.horse-btn i {
  font-family: var(--display);
  font-style: normal;
  font-size: 28px;
  color: var(--gold);
  min-width: 36px;
}

.horse-btn.on {
  background: var(--gold);
  color: var(--on-ink);
}

.horse-btn.on i { color: var(--on-ink); }

.horse-btn.scratched {
  opacity: 0.45;
  text-decoration: line-through;
}

.missing {
  margin: 8px 0 12px;
  padding: 14px;
  border-radius: 16px;
  background: #3a1720;
  color: white;
  border: 2px solid var(--red);
  font-size: 22px;
  font-weight: 800;
  line-height: 1.25;
}

.unit-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.style-btn {
  min-height: 64px;
  border-radius: 16px;
  background: var(--card);
  font-family: var(--display);
  font-size: 26px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: inset 0 0 0 1px var(--line);
}

.style-btn.on {
  background: var(--gold);
  color: var(--on-ink);
}

.runner-fact {
  margin: 10px 0 0;
  padding: 12px 14px;
  border-radius: 16px;
  background: #241804;
  box-shadow: inset 0 0 0 2px var(--gold);
}

.runner-fact b {
  display: block;
  font-family: var(--display);
  font-size: 24px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.runner-fact div {
  margin-top: 4px;
  font-size: 18px;
  line-height: 1.3;
}

.ticket-window {
  margin: 10px 0 0;
  padding: 8px 12px 10px;
  border-radius: 16px;
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--line);
}
.ticket-window .hint { margin-bottom: 4px; }
.ticket-line, .ticket-total {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
}
.ticket-line b, .ticket-total b { flex: 1; }
.ticket-total {
  margin-top: 4px;
  font-family: var(--display);
  font-size: 22px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.ticket-line .text-btn { min-height: 32px; padding: 0 4px; }
.ticket-line span { flex: 1 1 100%; color: var(--muted); font-size: 15px; }
.ticket-line.on { box-shadow: inset 0 0 0 2px var(--sky); border-radius: 10px; }
.order-slots { display: flex; gap: 8px; margin: 8px 0; }
.order-slot {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--line);
}
.order-slot span {
  display: block;
  color: var(--gold-2);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.order-slot b {
  display: block;
  font-size: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.order-slot.on { box-shadow: inset 0 0 0 2px var(--gold); }
.horse-btn em {
  margin-left: auto;
  font-style: normal;
  font-weight: 800;
  color: var(--gold-2);
  font-size: 14px;
}

.race-btn.on, .type-btn.on, .finish-btn.on, .chip.on {
  background: var(--gold);
  color: var(--on-ink);
}

.race-btn.on small,
.race-btn.on em {
  color: var(--on-ink);
  opacity: 0.85;
}

.finish-btn.bad { background: #3a1720; }
.finish-btn.bad.on { background: var(--red); color: white; }
.finish-btn.win.on { background: var(--gold); color: var(--on-ink); }

label.field {
  display: block;
  margin: 12px 0;
  color: var(--muted);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

input[type="text"], input[type="date"], input[type="time"], textarea {
  width: 100%;
  margin-top: 6px;
  background: #0d141d;
  color: var(--ink);
  border: 2px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  padding: 14px 14px;
  font-size: 24px;
  font-weight: 700;
}

textarea { min-height: 110px; resize: vertical; }

.hint { color: var(--gold-2); text-transform: none; letter-spacing: 0; font-size: 16px; margin: 0 0 8px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }

.chip {
  min-height: 52px;
  min-width: 72px;
  padding: 0 14px;
  border-radius: 14px;
  background: var(--card-2);
  color: var(--ink);
  font-weight: 800;
  font-size: 20px;
}

.keys { grid-template-columns: repeat(3, 1fr); }

.stake-show {
  font-family: var(--display);
  font-size: 64px;
  text-align: center;
  margin: 6px 0;
  color: var(--gold-2);
}

.error {
  background: #3a1720;
  color: #ffd5dc;
  border-radius: 14px;
  padding: 12px 14px;
  margin: 10px 0;
  font-size: 18px;
}

.empty {
  color: var(--muted);
  padding: 8px 2px 16px;
  font-size: 18px;
}

.switch {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 10px;
  min-height: 72px;
}

.switch b { display: block; font-size: 20px; }
.switch span { color: var(--muted); font-size: 15px; }

.toggle {
  min-width: 92px;
  min-height: 48px;
  border-radius: 999px;
  font-weight: 800;
  background: #2a3340;
  color: var(--muted);
}

.toggle.on { background: var(--mint); color: #062216; }

.links { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; }
.freshness {
  margin: 0 0 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: #143226;
  color: #b6f5cf;
  font-weight: 800;
}
.freshness.stale {
  background: #3a2a12;
  color: var(--gold);
}
.see-others { margin: 14px 0 8px; font-size: 20px; }
.back-bets { margin: 8px 0 16px; }
.stamp { margin-top: 4px; }

.note {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.35;
}

#fx {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 400;
}

#celebrate {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.62);
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}

#celebrate[hidden] { display: none; }

.cele {
  width: min(100%, 420px);
  text-align: center;
  background: #141008;
  border-radius: 28px;
  padding: 28px 18px 18px;
  border: 2px solid var(--gold);
}

.cele.raspberry { border-color: var(--red); background: #1a0c10; }
.cele.place { border-color: var(--sky); }
.cele.arrived { border-color: var(--pink); background: #1a0c14; }
.cele.scratch { border-color: var(--orange); background: #1c140c; }
.cele.cancel { border-color: var(--gold); background: #1c180c; }
.cele.missed { border-color: var(--sky); background: #101820; }

.cele h2 {
  font-size: 68px;
  margin: 0;
  line-height: 0.9;
  color: var(--gold);
}

.cele.raspberry h2 { color: var(--red); }
.cele.place h2 { color: var(--sky); }
.cele.arrived h2 { color: var(--pink); font-size: 56px; }
.cele.scratch h2 { color: var(--orange); }
.cele.cancel h2 { color: var(--gold); }
.cele.missed h2 { color: var(--sky); }

.outcome-row { display: flex; gap: 8px; margin-top: 12px; }
.outcome-row .finish-btn { flex: 1; min-height: 64px; }

.odds-field {
  width: 100%;
  min-height: 64px;
  margin-top: 6px;
  border: 0;
  border-radius: 16px;
  background: #0c1218;
  color: var(--gold-2);
  font-family: var(--display);
  font-size: 42px;
  letter-spacing: 0.03em;
  padding: 8px 14px;
  box-shadow: inset 0 0 0 2px var(--sky);
}

body.desk .odds-field { font-size: 36px; min-height: 52px; }

.field textarea {
  width: 100%;
  min-height: 72px;
  margin-top: 6px;
  border: 0;
  border-radius: 14px;
  background: #0c1218;
  color: var(--ink);
  font: inherit;
  padding: 10px 12px;
}

.cele .who-cele {
  font-family: var(--display);
  font-size: 28px;
  letter-spacing: 0.08em;
  margin-top: 8px;
}

.cele p {
  font-size: 26px;
  line-height: 1.2;
  margin: 12px 0 18px;
}

body.shake { animation: shake 0.45s linear 2; }

@keyframes shake {
  25% { transform: translateX(-8px) rotate(-0.4deg); }
  50% { transform: translateX(8px) rotate(0.4deg); }
  75% { transform: translateX(-5px); }
}

body.desk {
  background:
    radial-gradient(1100px 480px at 12% -8%, rgba(255, 200, 87, 0.2), transparent 52%),
    radial-gradient(900px 520px at 100% 0%, rgba(255, 77, 141, 0.16), transparent 48%),
    var(--bg);
}

body.desk #app {
  width: min(1440px, 100%);
  padding: 12px 28px 12px;
}

body.desk .brand { max-width: none; font-size: 34px; }
body.desk .welcome { font-size: 32px; }

body.desk .desk-top {
  display: grid;
  grid-template-columns: 1.3fr 1fr 220px;
  gap: 16px;
  align-items: stretch;
  margin-bottom: 16px;
}

body.desk .next { margin: 0; min-height: 120px; display: flex; flex-direction: column; justify-content: center; }
body.desk .desk-pot {
  background:
    linear-gradient(180deg, rgba(255, 200, 87, 0.16), transparent 55%),
    var(--card);
  border: 1px solid rgba(255, 200, 87, 0.28);
  border-radius: 16px;
  padding: 8px 12px;
  min-width: 210px;
  max-width: 280px;
}
body.desk .desk-pot p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.25; }
body.desk .desk-pot b {
  display: block;
  font-family: var(--display);
  font-size: 28px;
  line-height: 1;
  color: var(--gold);
  letter-spacing: 0.02em;
}
body.desk .desk-figure {
  font-family: var(--display);
  font-size: 54px;
  line-height: 0.95;
  color: var(--gold);
  letter-spacing: 0.02em;
}
body.desk .desk-top .hot { align-self: stretch; font-size: 24px; }

body.desk .race-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: stretch;
  margin-bottom: 12px;
}
body.desk .race-bar,
body.desk .race-panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 10px 12px;
  margin-bottom: 0;
  min-width: 0;
}
body.desk .header-punters { display: flex; gap: 8px; align-items: stretch; flex: 1; justify-content: flex-end; }
body.desk .header-punter {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  flex: 1 1 120px;
  max-width: 168px;
  min-width: 112px;
  padding: 7px 10px;
  border: 0;
  border-radius: 12px;
  background: var(--card);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line);
}
body.desk .header-punter .swatch { height: 4px; width: 36px; margin-bottom: 2px; }
body.desk .header-punter b {
  font-family: var(--display);
  font-size: 16px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
body.desk .header-punter em {
  font-style: normal;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.2;
}
body.desk .header-punter.on { box-shadow: inset 0 0 0 2px var(--sky); }
body.desk .header-punter.add-lay {
  box-shadow: inset 0 0 0 2px var(--gold);
  max-width: 132px;
}
body.desk .add-meeting { min-height: 380px; }

.add-sheet {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.8fr);
  gap: 16px;
  align-items: start;
}

.add-meeting {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  margin-bottom: 12px;
  min-height: 0;
}

.add-meeting h2 { margin: 0; font-size: 28px; }
.add-meeting p { margin: 4px 0 0; }
.add-meeting .hint { margin: 8px 0 6px; }

.add-regions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 10px 0 8px;
}

.region-btn {
  min-height: 56px;
  border: 1px solid var(--line);
  background: var(--card-2);
  color: var(--ink);
  border-radius: 14px;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.region-btn em {
  display: block;
  margin-top: 2px;
  font-style: normal;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
}

.region-btn.on {
  background: var(--gold, #f5c15c);
  color: var(--on-ink);
  border-color: transparent;
}

.region-btn.on em { color: var(--on-ink); }

.horse-btn small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
}

.horse-btn.on small { color: var(--on-ink); }

.runner-labels {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 6px;
  margin: 10px 0 14px;
}

.runner-labels div {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px 8px;
  min-width: 0;
}

.runner-labels div.wide { grid-column: 1 / -1; }
.runner-labels b { display: block; color: var(--muted); font-size: 12px; font-weight: 700; }
.runner-labels span { display: block; font-size: 14px; line-height: 1.3; word-break: break-word; }

.add-types { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; }
.add-meets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(108px, 1fr));
  gap: 8px;
  margin: 0 0 8px;
}
.add-meets .chip { width: 100%; min-width: 0; }
.add-legs { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.add-leg {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 10px;
}
.add-leg b, .add-leg span { display: block; }
.add-leg span { color: var(--muted); font-size: 13px; font-weight: 700; }

.add-races {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 1fr;
  gap: 8px;
  margin: 0;
  flex: 1;
  min-height: 0;
  align-content: stretch;
}

.add-race {
  width: 100%;
  min-width: 0;
  max-width: none;
  height: 100%;
  min-height: 64px;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8px 6px;
}

.add-race small, .add-race em {
  display: block;
  font-family: var(--body);
  font-style: normal;
  letter-spacing: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.add-race.on small, .add-race.on em { color: var(--on-ink); opacity: 0.85; }

.add-pick {
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

@media (max-width: 900px) {
  .add-sheet { grid-template-columns: 1fr; }
}

body.phone-add,
body.phone-admin {
  height: 100dvh;
}

body.phone-add #app,
body.phone-admin #app {
  width: 100%;
  height: 100dvh;
  min-height: 100dvh;
  padding: calc(8px + env(safe-area-inset-top)) 12px calc(10px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

body.phone-add .silk { margin-bottom: 8px; flex: 0 0 auto; align-items: center; }
body.phone-add .top-actions { flex-direction: row; align-items: center; gap: 4px; }
body.phone-add .icon-btn[data-full],
body.phone-add #desk,
body.phone-add #mute,
body.phone-add .live { display: none; }
body.phone-add .brand { font-size: 18px; max-width: 170px; }
body.phone-add .brand span { font-size: 13px; letter-spacing: 0.12em; }
body.phone-add .sub { font-size: 13px; margin: 2px 0 0; }
body.phone-add .icon-btn, body.phone-add .text-btn { min-height: 36px; font-size: 14px; padding: 4px 6px; }
body.phone-add .live { font-size: 12px; padding: 4px 8px; }

body.phone-add .add-sheet {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
  align-items: stretch;
}

body.phone-add .add-pick,
body.phone-add .add-meeting,
body.phone-add .bet-money {
  width: 100%;
}

body.phone-add .add-pick,
body.phone-add .bet-money {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

body.phone-add .add-meeting {
  flex: 1;
  margin-bottom: 0;
  padding: 10px 10px 8px;
}

body.phone-add .add-meeting h2 { font-size: 22px; }
body.phone-add .add-meeting .note { font-size: 13px; }
body.phone-add .region-btn { min-height: 48px; font-size: 18px; }
body.phone-add .add-meets .chip { min-height: 44px; font-size: 16px; }
body.phone-add .add-race em { display: none; }
body.phone-add .add-race { min-height: 0; font-size: 22px; }

body.phone-add .add-pick h2 { margin: 0 0 4px; font-size: 22px; }
body.phone-add .add-pick > .hint { flex: 0 0 auto; margin: 4px 0 8px; }

body.phone-add .horse-grid {
  flex: 1;
  min-height: 0;
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: 1fr;
  overflow: hidden;
  margin: 0;
}

body.phone-add .horse-btn {
  min-height: 0;
  height: 100%;
  padding: 6px 8px;
  font-size: 16px;
  gap: 8px;
}

body.phone-add .horse-btn i { font-size: 22px; min-width: 28px; }
body.phone-add .horse-btn small { display: none; }
body.phone-add .runner-labels { display: none; }

body.phone-add .bet-money .stake-show { font-size: 40px; margin: 2px 0; }
body.phone-add .bet-money .key { min-height: 44px; font-size: 22px; }
body.phone-add .bet-money .chip { min-height: 40px; font-size: 16px; }
body.phone-add .odds-field { min-height: 48px; font-size: 28px; }
body.phone-add .go { min-height: 52px; font-size: 22px; }

body.phone-admin .silk { margin-bottom: 8px; flex: 0 0 auto; align-items: center; }
body.phone-admin .top-actions { flex-direction: row; align-items: center; gap: 4px; }
body.phone-admin .icon-btn[data-full] { display: none; }
body.phone-admin .brand { font-size: 18px; max-width: 170px; }
body.phone-admin .brand span { font-size: 13px; letter-spacing: 0.12em; }
body.phone-admin .sub { font-size: 13px; margin: 2px 0 0; }
body.phone-admin .icon-btn, body.phone-admin .text-btn { min-height: 36px; font-size: 14px; padding: 4px 6px; }
body.phone-admin .live { font-size: 12px; padding: 4px 8px; }

body.phone-admin .admin-home,
body.phone-admin .admin-pane {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
}

body.phone-admin .admin-home .next {
  flex: 0 0 auto;
  margin: 0;
  padding: 10px 12px;
}
body.phone-admin .admin-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
  flex: 0 0 auto;
}
body.phone-admin .admin-top .next { margin: 0; }
body.phone-admin .admin-top .play-btn {
  min-height: 0;
  padding: 8px 12px;
  font-size: 15px;
}
body.phone-admin .admin-home .next strong { font-size: 22px; }
body.phone-admin .admin-home .go { flex: 0 0 auto; min-height: 56px; margin: 0; }

body.phone-admin .admin-tiles {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 8px;
}

.admin-tile {
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  padding: 14px 14px 12px;
  border-radius: 18px;
  background: var(--card);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line);
  text-align: left;
}

.admin-tile b {
  font-family: var(--display);
  font-size: 22px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.admin-tile em {
  font-style: normal;
  font-family: var(--display);
  font-size: 42px;
  line-height: 1;
  color: var(--gold);
}

.admin-tile span {
  font-size: 15px;
  font-weight: 700;
  color: var(--muted);
}

.admin-tile.on {
  background: var(--gold);
  color: var(--on-ink);
  box-shadow: none;
}

.admin-tile.on em { color: var(--on-ink); }

body.phone-admin .admin-pane h2,
body.phone-admin .admin-pane .who {
  flex: 0 0 auto;
  margin: 0;
  font-size: 24px;
}

body.phone-admin .admin-queue {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
}

body.phone-admin .admin-queue .card {
  flex: 1;
  min-height: 0;
  margin: 0;
  padding: 10px 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

body.phone-admin .admin-queue .horses { margin: 4px 0; }
body.phone-admin .admin-queue .horses div { font-size: 20px; }
body.phone-admin .admin-queue .stake { font-size: 16px; margin: 4px 0 6px; }
body.phone-admin .admin-queue .go { min-height: 44px; font-size: 18px; }
body.phone-admin .admin-queue .row-actions { margin-top: 2px; }
body.phone-admin .admin-queue .stamp { display: none; }
body.phone-admin .admin-queue .empty { margin: auto; }

body.phone-admin .admin-more {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: 1fr;
  gap: 8px;
}

body.phone-admin .admin-more .ghost,
body.phone-admin .admin-more .hot {
  min-height: 0;
  height: 100%;
  margin: 0;
  font-size: 18px;
}

body.phone-admin .admin-more .hot { grid-column: 1 / -1; }

body.phone-admin .card-meets { overflow: hidden; }
body.phone-admin .card-meets .note { flex: 0 0 auto; margin: 0; }
body.phone-admin .card-meets .add-regions { flex: 0 0 auto; }
body.phone-admin .card-meets .meet-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: 1fr;
  gap: 8px;
  overflow: hidden;
}
body.phone-admin .card-meets .meet-grid .chip {
  width: 100%;
  min-height: 0;
  height: 100%;
  margin: 0;
}
body.phone-admin .card-meets .meet-grid .chip small {
  display: block;
  font-size: 12px;
  font-weight: 700;
}
body.phone-admin .card-meets .meet-grid .empty { margin: auto; grid-column: 1 / -1; }
body.phone-admin .card-meets .card-nav {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
body.phone-admin .card-meets .card-nav .ghost { min-height: 40px; margin: 0; }

.day-sheet .takings { display: flex; flex-direction: column; gap: 8px; }
.day-sheet .takings .row, .day-bets .row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 4px 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--card);
  color: var(--ink);
  text-align: left;
}
.day-sheet .day-link { width: 100%; }
.day-sheet .line { margin: 8px 0; }
.day-bets { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.day-bets .row span, .day-bets .row b { font-size: 15px; }
.day-bets i { font-style: normal; }

body.phone-admin .day-sheet .takings {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
body.phone-admin .day-sheet .takings .row { flex: 1; min-height: 0; }
body.phone-admin .day-sheet .go, body.phone-admin .day-sheet .ghost { flex: 0 0 auto; margin: 0; }
body.phone-admin .day-bets { flex: 1; min-height: 0; overflow: auto; }

.card-meets .meet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
}
.card-meets .chip small { display: block; font-size: 12px; font-weight: 700; }

body.phone-admin .names {
  flex: 1;
  min-height: 0;
  grid-template-columns: 1fr;
  grid-auto-rows: 1fr;
  gap: 8px;
}

body.phone-admin .person-btn {
  min-height: 0;
  height: 100%;
  margin: 0;
  padding: 10px 14px;
}

body.phone-admin .person-btn b { font-size: 26px; }

body.desk .pick-line {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
}
body.desk .punter-names { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
body.desk .pick-back { min-height: 44px; padding: 0 12px; font-size: 18px; }
body.desk .bet-money .desk-types { grid-template-columns: repeat(7, 1fr); margin-bottom: 8px; }
body.desk .bet-money .desk-types .type-btn { min-height: 40px; font-size: 16px; padding: 4px; }
body.desk .race-bar-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
body.desk .race-bar-top strong {
  display: block;
  font-family: var(--display);
  font-size: 22px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
body.desk .race-bar-top span { color: var(--muted); }
.play-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #3b4bdb;
  color: white;
  text-decoration: none;
  border-radius: 14px;
  padding: 10px 16px;
  font-weight: 800;
  min-height: 48px;
}
.play-btn::before {
  content: "";
  width: 0;
  height: 0;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 12px solid white;
}
body.desk .race-pills { display: flex; gap: 8px; margin-top: 12px; }
body.desk .race-pill {
  flex: 1;
  min-height: 36px;
  border: 0;
  border-radius: 10px;
  background: var(--card-2);
  color: var(--ink);
  font-family: var(--display);
  font-size: 18px;
  padding: 4px;
}
body.desk .race-pill.on { background: var(--sky); color: #071018; }
body.desk .race-panel {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 18px;
}
body.desk .race-panel h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 22px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
body.desk .race-lead {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 14px;
}
body.desk .race-lead b {
  font-family: var(--display);
  font-size: 22px;
  color: var(--gold);
  letter-spacing: 0.03em;
}
body.desk .race-rest { margin: 8px 0 0; }
body.desk .punter-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; }
body.desk .race-panel p { margin: 0 0 4px; color: var(--muted); }
body.desk .race-when { text-align: right; }
body.desk .race-when .desk-figure { font-size: 32px; }
body.desk .race-when .to-go { color: var(--sky); font-size: 22px; font-weight: 800; }
body.desk .desk-main > .hot { width: 100%; margin-bottom: 12px; }
body.desk .desk-main > .desk-pot {
  max-width: none;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 12px;
}

body.desk .desk-people {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

body.desk .person-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  text-align: left;
  background: var(--card);
  border-radius: 18px;
  padding: 14px;
  min-height: 0;
  box-shadow: inset 0 0 0 1px var(--line);
}

body.desk .person-tile b {
  font-family: var(--display);
  font-size: 26px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
body.desk .person-tile .desk-figure { font-size: 40px; }
body.desk .person-tile span { color: var(--muted); font-size: 15px; }
body.desk .person-tile p { margin: 4px 0 0; color: var(--ink); font-size: 15px; line-height: 1.25; }
body.desk .person-tile .swatch { height: 8px; width: 42px; }

body.desk .desk-shell {
  display: block;
}

body.desk .desk-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
}

body.desk .desk-side .card.peek,
.punter-col .card.peek { cursor: pointer; }
body.desk .desk-side .stake-row,
.punter-col .stake-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}
body.desk .desk-side .stake-row .stake,
.punter-col .stake-row .stake { margin: 6px 0 0; }
body.desk .desk-side .stake-row .result-money,
.punter-col .stake-row .result-money { flex: none; }
body.desk .desk-side .result-money,
.punter-col .result-money {
  font-family: var(--display);
  font-size: 28px;
  letter-spacing: 0.04em;
  line-height: 1;
  text-transform: uppercase;
}

.punter-open { width: 100%; margin: 0 0 12px; }
.punter-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}
.punter-col {
  min-width: 0;
  max-height: calc(100dvh - 150px);
  overflow: auto;
  padding: 10px;
  border-radius: 18px;
  background: rgba(20, 28, 39, 0.72);
  box-shadow: inset 0 0 0 1px var(--line);
}
.punter-col-head { margin-bottom: 10px; }
.punter-col-head .swatch { display: block; height: 6px; width: 42px; border-radius: 6px; margin-bottom: 6px; }
.punter-col-head b {
  display: block;
  font-family: var(--display);
  font-size: 22px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.punter-col-head span { display: block; color: var(--muted); font-size: 14px; }
.punter-col-head strong {
  display: block;
  margin-top: 4px;
  font-family: var(--display);
  font-size: 20px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.punter-col .card { margin-bottom: 8px; }

body.desk .desk-side {
  position: sticky;
  top: 12px;
  max-height: calc(100dvh - 24px);
  overflow: auto;
  padding: 4px 12px 8px;
  border-radius: 22px;
  background: rgba(20, 28, 39, 0.72);
  box-shadow: inset 0 0 0 1px var(--line);
}

body.desk .desk-main .links { margin-top: 14px; }

body.desk .bet-layout,
body.desk .result-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 22px 28px;
  align-items: start;
}

.runner-result { margin: 0 0 14px; }
.runner-result b { display: block; margin-bottom: 6px; font-size: 20px; }
.finish-row { display: flex; gap: 8px; }
.finish-row .finish-btn { flex: 1; min-height: 52px; padding: 8px 4px; font-size: 16px; }

body.desk .bet-head { grid-column: 1 / -1; }
body.desk .bet-head .who { margin-bottom: 0; }
body.desk .bet-money {
  position: sticky;
  top: 12px;
  padding: 10px 14px 6px;
  border-radius: 22px;
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--line);
}
body.desk .bet-money .stake-show { font-size: 32px; margin: 0; line-height: 1; }
body.desk .bet-pick .card-label { font-size: 16px; margin: 0; }
body.desk .bet-pick .horse-grid { max-height: 220px; overflow: auto; }
body.desk .bet-pick .horse-grid.with-ticket { max-height: 100px; }
body.desk .bet-pick .horse-btn { min-height: 44px; }
body.desk .bet-money .keys { grid-template-columns: repeat(4, 1fr); gap: 6px; }
body.desk .bet-money .key { min-height: 36px; font-size: 18px; padding: 2px; }
body.desk .header-punter { padding: 4px 8px; }
body.desk .header-punter em { font-size: 12px; line-height: 1.15; }
body.desk .bet-money .chip { min-height: 44px; }
body.desk .bet-money .go,
body.desk .bet-money .ghost,
body.desk .bet-money #add-ticket { min-height: 34px; font-size: 16px; }
body.desk .bet-money .stack { margin-top: 6px !important; gap: 6px; }
body.desk .ticket-window { max-height: 132px; overflow: auto; }
body.desk .bet-money .missing { margin-top: 10px; }
body.desk .race-grid { grid-template-columns: repeat(5, 1fr); }
body.desk .type-grid { grid-template-columns: repeat(4, 1fr); }
body.desk .horse-grid { grid-template-columns: 1fr 1fr; }
body.desk .names { grid-template-columns: repeat(5, 1fr); }
body.desk .names .person-btn { flex-direction: column; align-items: flex-start; min-height: 110px; border-radius: 18px; }

@media (max-width: 980px) {
  body.desk .desk-shell,
  body.desk .desk-top,
  body.desk .desk-cols,
  body.desk .race-pair,
  body.desk .race-panel,
  body.desk .bet-layout,
  body.desk .result-layout,
  body.desk .punter-board { grid-template-columns: 1fr; }
  body.desk .race-when { text-align: left; }
  body.desk .desk-people,
  body.desk .names { grid-template-columns: 1fr 1fr; }
  body.desk .desk-side,
  body.desk .bet-money { position: static; max-height: none; }
}

.dash-open {
  display: flex;
  gap: 8px;
  margin: 0 0 12px;
}

.dash-open .punter-open { width: auto; flex: 1; margin: 0; }

.dash-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
}

.dash-bar .who { margin: 0; }

.dash-order { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.dash-lane {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 8px 12px;
}
.dash-lane.lead { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.dash-lane .place { font-family: var(--display); font-size: 32px; color: var(--gold); line-height: 1; }
.dash-lane .swatch { width: 8px; height: 16px; display: inline-block; vertical-align: -2px; }
.dash-track { height: 8px; margin: 6px 0; background: rgba(255, 255, 255, 0.08); border-radius: 99px; overflow: hidden; }
.dash-track i { display: block; height: 100%; border-radius: 99px; background: var(--gold); }
.dash-lane .note { margin: 0; }

.dash-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.dash-chip {
  flex: 1 1 150px;
  text-align: left;
  background: var(--card);
  color: inherit;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 10px;
  min-height: 58px;
}
.dash-chip b { display: flex; align-items: center; gap: 6px; font-size: 16px; }
.dash-chip span { display: block; margin-top: 2px; color: var(--muted); font-size: 13px; font-weight: 700; line-height: 1.25; }
.dash-chip .swatch { width: 8px; height: 14px; }
.dash-chip.open, .dash-chip.lead { border-color: var(--gold); }
.dash-detail {
  margin-top: 8px;
  padding: 8px 10px 2px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.dash-top, .dash-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.dash-person, .dash-cell {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px 12px;
  min-width: 0;
}

.dash-person.lead, .dash-cell.lead {
  border-color: var(--gold);
  box-shadow: inset 0 0 0 1px var(--gold);
}

.dash-person .who-line em {
  font-style: normal;
  color: var(--gold);
  font-size: 13px;
  font-weight: 800;
}

.dash-person .profit { font-family: var(--display); font-size: 34px; line-height: 1; margin: 6px 0; }
.dash-person .swatch, .dash-cell .swatch { width: 8px; height: 16px; display: inline-block; vertical-align: -2px; }
.dash-cell h3 { margin: 0 0 8px; font-size: 16px; }

.dash-race { margin-top: 16px; }
.dash-race-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 8px;
}
.dash-race-head h2 { margin: 0; font-size: 22px; }
.dash-race-head strong { font-size: 16px; text-align: right; }

.dash-bet { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.dash-bet b { display: block; font-size: 15px; }
.dash-bet span {
  display: block;
  font-family: var(--display);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-size: 20px;
  line-height: 1.05;
}
.dash-bet em { display: block; font-style: normal; color: var(--muted); font-size: 14px; }
.dash-bet strong { display: block; font-size: 15px; }
.dash-bet strong.wait { color: var(--gold); }
.dash-bet strong.ride { color: var(--sky); }
.dash-empty { margin: 0; color: var(--muted); }

body.screen-dash #app { width: min(1680px, 100%); }

body.filled { overflow: hidden; }
body.filled #app {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100vh;
  overflow: auto;
  z-index: 30;
  padding: 18px 28px 36px;
  background: #070b10;
}

html:fullscreen, html:fullscreen body { background: #070b10; }
html:fullscreen #app {
  width: 100%;
  max-width: none;
  min-height: 100vh;
  padding: 18px 28px 36px;
}
html:fullscreen .dash-bet span { font-size: 26px; }
html:fullscreen .dash-race-head h2 { font-size: 28px; }
html:fullscreen .dash-person .profit { font-size: 42px; }

@media (max-width: 1100px) {
  .dash-top, .dash-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  body.shake { animation: none; }
  .dot { animation: none; }
}
