@font-face { font-family: "Archivo"; src: url("fonts/archivo.woff2") format("woff2"); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("fonts/plexmono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("fonts/plexmono-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("fonts/plexmono-600.woff2") format("woff2"); font-weight: 600 700; font-display: swap; }

:root {
  --page: #F3F1EA; --panel: #FBFAF6; --alt: #F5F3EC; --ink: #16181D; --sec: #5E6066; --rule: #D6D2C4;
  --up: #1F7A4D; --dn: #B8402A; --you: #2347C9; --cpu: #C9781F;
  --mono: "Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --ui: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--page); color: var(--ink); }
body { font-family: var(--ui); font-stretch: 87.5%; font-weight: 500; font-size: 14px; line-height: 1.35; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
.sec { color: var(--sec); }
.hidden { display: none !important; }
.up { color: var(--up); } .dn { color: var(--dn); }
.lbl, dt, .kicker, th, .clocklabel, .ddlabel {
  font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--sec); font-weight: 500;
}

#app { max-width: 1680px; margin: 0 auto; padding: 0 12px 16px; }

/* ---------- MATCH BAR ---------- */
.matchbar {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: stretch;
  background: var(--panel); border: 1px solid var(--rule); border-top: 0; min-height: 96px;
}
.side { padding: 8px 14px 8px; display: flex; flex-direction: column; justify-content: space-between; gap: 4px; min-width: 0; position: relative; }
.side.you { border-left: 4px solid var(--you); }
.side.cpu { border-right: 4px solid var(--cpu); align-items: stretch; text-align: right; }
.who { display: flex; align-items: center; gap: 8px; font-size: 12px; letter-spacing: .06em; font-weight: 700; }
.side.cpu .who { justify-content: flex-end; }
.you .tag { color: var(--you); } .cpu .tag { color: var(--cpu); }
.handle { color: var(--sec); font-weight: 500; letter-spacing: 0; text-transform: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bust-stamp { display: none; color: var(--dn); border: 1px solid var(--dn); padding: 0 5px; font-size: 10px; letter-spacing: .08em; }
.side.busted .bust-stamp { display: inline-block; }
.side.busted .score { text-decoration: line-through; text-decoration-color: var(--dn); text-decoration-thickness: 2px; }
.scorerow { display: flex; align-items: baseline; gap: 18px; }
.side.cpu .scorerow { justify-content: flex-end; }
.score { font-size: 34px; font-weight: 600; line-height: 1; letter-spacing: -.01em; white-space: nowrap; }
.figs { display: flex; gap: 16px; margin: 0; }
.figs div { display: flex; flex-direction: column; }
.figs dt { font-size: 10.5px; }
.figs dd { margin: 0; font-size: 14px; font-weight: 500; white-space: nowrap; }
.dd { display: flex; align-items: center; gap: 8px; }
.dd .track { position: relative; flex: 1; height: 6px; background: var(--page); border: 1px solid var(--rule); min-width: 60px; max-width: 360px; }
.dd .fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--ink); transition: width .25s linear; }
.dd.warn .fill { background: var(--dn); }
.dd .endmark { position: absolute; right: -2px; top: -4px; bottom: -4px; width: 3px; background: var(--dn); }
.dd.mirror { justify-content: flex-end; }
.dd.mirror .fill { left: auto; right: 0; }
.dd.mirror .endmark { right: auto; left: -2px; }
.ddval { font-size: 12px; min-width: 64px; }
.dd.mirror .ddval { text-align: right; }
.ddcap { font-size: 11px; color: var(--dn); }
.dd.warn .ddval { color: var(--dn); font-weight: 600; }

.clock { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 6px 22px; border-left: 1px solid var(--rule); border-right: 1px solid var(--rule); min-width: 190px; }
.timer { font-size: 40px; font-weight: 500; line-height: 1.05; }
.timer.low { color: var(--dn); }
.tug { position: relative; width: 150px; height: 4px; background: var(--page); border: 1px solid var(--rule); margin: 5px 0 3px; }
.tug .mid { position: absolute; left: 50%; top: -4px; bottom: -4px; width: 1px; background: var(--ink); }
.tug .bar { position: absolute; top: 0; bottom: 0; left: 50%; width: 0; background: var(--you); }
.lead { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; font-weight: 700; color: var(--sec); white-space: nowrap; }
.lead.you { color: var(--you); } .lead.cpu { color: var(--cpu); }

.goal { display: flex; align-items: center; gap: 14px; padding: 6px 2px; border-bottom: 1px solid var(--rule); color: var(--sec); font-size: 12.5px; }
.goaltext { flex: 1; }
.goalkeys { font-size: 11.5px; white-space: nowrap; }
.linkbtn { background: none; border: 1px solid var(--ink); border-radius: 4px; padding: 3px 10px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; font-weight: 700; }
.linkbtn:hover { background: var(--ink); color: var(--panel); }

/* ---------- MAIN ROW ---------- */
.mainrow { display: grid; grid-template-columns: minmax(0, 68fr) minmax(300px, 32fr); gap: 0; margin-top: 10px; border: 1px solid var(--rule); background: var(--panel); }
.chartpanel { position: relative; display: flex; flex-direction: column; min-width: 0; border-right: 1px solid var(--rule); }
.rulesmini { display: none; position: absolute; top: 12px; right: 10px; z-index: 2; background: var(--panel); }
.tabs { display: flex; border-bottom: 1px solid var(--rule); overflow-x: auto; scrollbar-width: none; }
.tab { background: none; border: 0; border-right: 1px solid var(--rule); padding: 8px 16px 7px; text-align: left; display: flex; flex-direction: column; gap: 1px; border-bottom: 2px solid transparent; margin-bottom: -1px; min-width: 0; flex: 0 0 auto; }
.tab .sym { font-weight: 700; letter-spacing: .06em; font-size: 12px; color: var(--sec); display: flex; gap: 6px; align-items: center; }
.tab .px { font-size: 15px; font-weight: 500; padding: 0 2px; margin: 0 -2px; }
.tab .chg { font-size: 11px; }
.tab.on { border-bottom-color: var(--ink); }
.tab.on .sym { color: var(--ink); }
.tab .pos { font-family: var(--mono); font-size: 10px; color: var(--you); font-weight: 600; letter-spacing: 0; }
.chartmeta { display: flex; gap: 14px; align-items: baseline; padding: 6px 12px; font-size: 12px; color: var(--sec); border-bottom: 1px solid var(--rule); flex-wrap: wrap; }
.chartmeta #chartName { color: var(--ink); font-weight: 700; }
.chartwrap { position: relative; flex: 1; min-height: 380px; }
#chart { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: pan-y; }
.legend { display: flex; gap: 16px; padding: 6px 12px; border-top: 1px solid var(--rule); font-size: 11px; color: var(--sec); flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg { display: inline-block; width: 18px; height: 0; border-top: 2px solid var(--you); }
.lg.tp { border-top: 2px dashed var(--up); } .lg.sl { border-top: 2px dashed var(--dn); }
.lg.tri { width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 9px solid var(--cpu); border-top: 0; }

/* ---------- TICKET ---------- */
.ticket { padding: 0 0 12px; display: flex; flex-direction: column; min-width: 0; }
.tickethead { margin: 0; display: flex; gap: 6px; align-items: baseline; padding: 10px 14px 9px; font-size: 13px; letter-spacing: .08em; font-weight: 700; border-bottom: 1px solid var(--ink); background: var(--panel); }
.tickethead .dot { color: var(--sec); }
.tickethead .ordtype { margin-left: auto; font-size: 10.5px; color: var(--sec); font-weight: 500; }
.trow { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; padding: 9px 14px; border-bottom: 1px solid var(--rule); background: var(--panel); }
.trow > .lbl:first-child { width: 86px; }
.seg { display: flex; flex: 1; border: 1px solid var(--rule); border-radius: 4px; overflow: hidden; }
.seg button { flex: 1; background: none; border: 0; border-right: 1px solid var(--rule); padding: 6px 0; font-weight: 700; font-size: 12px; letter-spacing: .05em; color: var(--sec); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--ink); color: var(--panel); }
.quote { justify-content: space-between; }
.quote > div { display: flex; flex-direction: column; }
.quote .q { font-size: 18px; font-weight: 500; padding: 0 3px; margin: 0 -3px; }
.quote .tv { text-align: right; } .quote .tv .mono { font-size: 12px; color: var(--sec); }
.stepper { display: flex; border: 1px solid var(--ink); border-radius: 4px; overflow: hidden; height: 34px; background: var(--panel); }
.stepper .stp { width: 34px; border: 0; background: none; font-size: 18px; line-height: 1; }
.stepper .stp:hover { background: var(--alt); }
.stepper input { width: 48px; border: 0; border-left: 1px solid var(--rule); border-right: 1px solid var(--rule); text-align: center; font-size: 16px; font-weight: 600; background: transparent; color: var(--ink); outline: none; }
.stepper.sm { height: 30px; } .stepper.sm .stp { width: 30px; } .stepper.sm input { width: 50px; font-size: 14px; }
.stepper.off { opacity: .4; }
.note { font-size: 12px; color: var(--sec); margin-left: auto; }
.unit { font-size: 12px; color: var(--sec); }
.tog { display: inline-flex; align-items: center; gap: 8px; width: 112px; cursor: pointer; }
.tog input { position: absolute; opacity: 0; pointer-events: none; }
.tog .box { width: 16px; height: 16px; border: 1px solid var(--ink); border-radius: 2px; position: relative; flex: 0 0 auto; background: var(--panel); }
.tog input:checked + .box::after { content: ""; position: absolute; left: 4px; top: 1px; width: 5px; height: 9px; border: solid var(--ink); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.tog input:focus-visible + .box { outline: 2px solid var(--you); outline-offset: 1px; }
.proj { width: 100%; display: flex; justify-content: space-between; gap: 8px; font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 12px; color: var(--sec); padding-left: 0; }
.proj b { font-weight: 600; font-size: 13px; }
.proj.off { visibility: hidden; height: 0; margin-top: -8px; }
.margin { justify-content: space-between; font-size: 13px; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px 14px 4px; background: var(--panel); }
.actions > button { border: 0; border-radius: 4px; color: #fff; padding: 10px 6px; display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 60px; }
.actions .big { font-weight: 700; font-size: 17px; letter-spacing: .08em; }
.actions .sub { font-size: 12px; opacity: .9; }
.buy { background: var(--up); } .sell { background: var(--dn); }
.actions { grid-template-columns: 1fr auto 1fr; }
.actions > button.flatall { background: var(--ink); padding-left: 12px; padding-right: 12px; }
.actions .flatall .big { font-size: 13px; }
.lg.vwap { border-top: 2px solid #7B3FB8; }
.actions > button:hover:not(:disabled) { filter: brightness(1.08); }
.actions > button:active:not(:disabled) { transform: translateY(1px); }
.actions > button:disabled { background: #B9B6AC; color: #F3F1EA; cursor: not-allowed; }
.reason { min-height: 18px; padding: 4px 14px 0; font-size: 12px; color: var(--dn); background: var(--panel); }
.fees { font-size: 11px; padding: 6px 14px 0; line-height: 1.4; }

/* ---------- LEDGER ---------- */
.ledger { margin-top: 10px; border: 1px solid var(--rule); background: var(--panel); }
.ledgerhead { display: flex; align-items: stretch; border-bottom: 1px solid var(--ink); }
.ltabs { display: flex; flex: 1; overflow-x: auto; scrollbar-width: none; }
.ltab { background: none; border: 0; border-right: 1px solid var(--rule); padding: 9px 14px 8px; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--sec); font-weight: 700; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; align-items: center; gap: 6px; }
.ltab.on { color: var(--ink); border-bottom-color: var(--ink); }
.ltab .mono { font-weight: 500; }
.omark { display: inline-block; width: 8px; height: 8px; background: var(--cpu); }
.flatten { background: none; border: 0; border-left: 1px solid var(--rule); padding: 0 14px; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; font-weight: 700; white-space: nowrap; }
.flatten:hover:not(:disabled) { background: var(--ink); color: var(--panel); }
.flatten:disabled { color: var(--rule); cursor: default; }
.tablewrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: right; padding: 7px 12px; border-bottom: 1px solid var(--rule); white-space: nowrap; font-size: 10.5px; }
.tbl td { text-align: right; padding: 7px 12px; border-bottom: 1px solid var(--rule); white-space: nowrap; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.tbl .l { text-align: left; }
.tbl td.l { font-family: var(--ui); font-weight: 700; letter-spacing: .04em; font-size: 12px; }
.tbl tbody tr:nth-child(even) { background: var(--alt); }
.tbl tbody tr.clickable { cursor: pointer; }
.tbl tbody tr.clickable:hover { background: #EFECE3; }
.tbl td.reason-cell { font-family: var(--ui); font-weight: 500; color: var(--sec); font-size: 12px; letter-spacing: .03em; }
.tbl td .cmark { display: inline-block; width: 8px; height: 8px; background: var(--cpu); margin-right: 7px; vertical-align: 1px; }
.tbl td.pnl { font-weight: 600; }
.xbtn { border: 1px solid var(--ink); background: var(--panel); border-radius: 4px; padding: 3px 9px; font-family: var(--ui); font-size: 11px; font-weight: 700; letter-spacing: .06em; }
.xbtn:hover { background: var(--ink); color: var(--panel); }
.empty { padding: 18px 14px; color: var(--sec); font-size: 13px; }
.flash { border-radius: 2px; }

/* ---------- OVERLAY / SLIPS ---------- */
.overlay { position: fixed; inset: 0; background: rgba(243,241,234,.86); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; overflow-y: auto; }
.overlay.hidden { display: none; }
.slip { position: relative; width: min(680px, 100%); background: var(--panel); border: 1px solid var(--ink); padding: 22px 26px 20px; margin: auto; }
.perf { position: absolute; left: 10px; right: 10px; top: 7px; border-top: 1px dashed var(--rule); }
.sliphead { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; border-bottom: 1px solid var(--ink); padding-bottom: 10px; }
.kicker.r { text-align: right; }
.slip h1 { margin: 4px 0 0; font-size: 34px; font-weight: 700; letter-spacing: .02em; font-stretch: 87.5%; line-height: 1.05; }
.rules { margin: 12px 0; padding-left: 20px; font-size: 14px; line-height: 1.5; }
.rules li { padding: 3px 0; border-bottom: 1px solid var(--rule); }
.rules li::marker { font-family: var(--mono); color: var(--sec); font-size: 12px; }
.levelrow { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
.levelrow .seg { max-width: 420px; }
.levelnote { font-size: 12px; margin: 5px 0 8px 74px; min-height: 16px; }
.specs { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 6px; }
.specs th, .specs td { padding: 6px 8px; border-bottom: 1px solid var(--rule); text-align: right; }
.specs td { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.specs .l { text-align: left; }
.specs td.l { font-family: var(--ui); }
.specs td.l b { letter-spacing: .05em; margin-right: 8px; }
.slipfoot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.slipfoot .sec { font-size: 12.5px; flex: 1; min-width: 180px; }
.inkbtn { background: var(--ink); color: var(--panel); border: 0; border-radius: 4px; padding: 13px 26px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: 14px; }
.inkbtn:hover { filter: brightness(1.25); }
.verdict.you { color: var(--you); } .verdict.cpu { color: var(--cpu); } .verdict.bust { color: var(--dn); }
.settlegrid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin-top: 14px; border-top: 1px solid var(--rule); }
.scol { position: relative; padding: 0 14px 6px; }
.scol.you { border-left: 4px solid var(--you); border-right: 1px solid var(--rule); }
.scol.cpu { border-right: 4px solid var(--cpu); }
.scol h3 { margin: 0; padding: 9px 0 7px; font-size: 12px; letter-spacing: .08em; border-bottom: 1px solid var(--ink); display: flex; justify-content: space-between; }
.scol.you h3 { color: var(--you); } .scol.cpu h3 { color: var(--cpu); }
.scol h3 .st { color: var(--sec); font-weight: 500; }
.scol h3 .st.bust { color: var(--dn); font-weight: 700; }
.srow { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--rule); font-size: 13px; }
.srow .k { color: var(--sec); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.srow .v { font-family: var(--mono); font-variant-numeric: tabular-nums; font-weight: 500; }
.srow.big .v { font-size: 20px; font-weight: 600; }
.scol.busted::after { content: ""; position: absolute; left: 0; right: 0; top: 112px; height: 2px; background: var(--dn); }
.scol.busted .srow .v { text-decoration: line-through; text-decoration-color: var(--dn); }
.board { margin-top: 14px; }
.board h4 { margin: 0 0 4px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--sec); font-weight: 500; display: flex; justify-content: space-between; }
.board .brow { display: flex; gap: 10px; padding: 4px 0; border-bottom: 1px solid var(--rule); font-size: 13px; }
.board .brow .rk { width: 26px; color: var(--sec); font-family: var(--mono); }
.board .brow .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board .brow .nm a { color: var(--ink); }
.board .brow.mine { font-weight: 700; }
.board .brow .vl { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1100px) {
  .score { font-size: 28px; }
  .figs { gap: 12px; }
  .goalkeys { display: none; }
}
@media (max-width: 960px) {
  .mainrow { grid-template-columns: 1fr; }
  .chartpanel { border-right: 0; border-bottom: 1px solid var(--rule); }
  .chartwrap { min-height: 340px; }
}
@media (max-width: 860px) {
  .scorerow { flex-direction: column; align-items: flex-start; gap: 4px; }
  .side.cpu .scorerow { flex-direction: column-reverse; align-items: flex-end; }
  .clock { min-width: 0; padding: 6px 10px; }
  .tug { width: 100px; }
}
@media (max-width: 760px) {
  #app { padding: 0 0 calc(86px + env(safe-area-inset-bottom)); }
  .matchbar { border-left: 0; border-right: 0; min-height: 0; }
  .side { padding: 6px 8px; }
  .score { font-size: 22px; }
  .figs { gap: 8px; flex-wrap: wrap; }
  .figs div { flex-direction: row; gap: 4px; align-items: baseline; }
  .side.cpu .figs { justify-content: flex-end; }
  .figs dt { font-size: 9.5px; }
  .figs dd { font-size: 12px; }
  .figs div.balfig { display: none; }
  .timer { font-size: 28px; }
  .clock { padding: 4px 8px; }
  .tug { width: 74px; }
  .lead { font-size: 9.5px; letter-spacing: .03em; }
  .clocklabel { font-size: 9.5px; }
  .dd { gap: 4px; }
  .dd .track { min-width: 30px; }
  .ddval { font-size: 11px; min-width: 0; }
  .ddcap, .ddlabel { display: none; }
  .who { font-size: 11px; }
  .goal { padding: 6px 10px; font-size: 12px; }
  .mainrow, .ledger { margin-top: 8px; border-left: 0; border-right: 0; }
  .tab { padding: 7px 8px 6px; }
  .tab .px { font-size: 13.5px; }
  .chartwrap { flex: none; min-height: 240px; height: 46vh; max-height: 420px; }
  .tab { flex: 1 1 0; min-width: 0; }
  .tab .px { font-size: 12.5px; }
  .tab .pct { display: none; }
  .side.cpu .handle { display: none; }
  .tbl .nlast { display: none; }
  .legend { gap: 10px; padding: 5px 10px; }
  .chartmeta { padding: 5px 10px; gap: 10px; }
  .trow { padding: 8px 12px; }
  .trow > .lbl:first-child { width: 72px; }
  .tog { width: 104px; }
  .actions { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); border-top: 1px solid var(--ink); gap: 8px; }
  .actions > button { min-height: 56px; }
  .reason { position: fixed; left: 0; right: 0; bottom: calc(72px + env(safe-area-inset-bottom)); z-index: 31; padding: 4px 12px; min-height: 0; border-top: 1px solid var(--rule); }
  .reason:empty { display: none; }
  .tbl { font-size: 12px; }
  .tbl th, .tbl td { padding: 7px 8px; }
  .slip { padding: 18px 16px 16px; }
  .slip h1 { font-size: 28px; }
  .rules { font-size: 13px; }
  .scol { padding: 0 8px 6px; }
  .srow.big .v { font-size: 16px; }
  .srow { font-size: 12px; }
  .srow .k { font-size: 10px; }
}
@media (max-width: 380px) {
  .figs div.eqfig { display: none; }
  .lead { white-space: normal; text-align: center; max-width: 92px; line-height: 1.15; }
  .score { font-size: 19px; }
  .timer { font-size: 24px; }
  .figs dd { font-size: 11px; }
}
@media (max-height: 520px) and (min-width: 600px) {
  .matchbar { min-height: 0; }
  .side { padding: 5px 10px; gap: 2px; }
  .score { font-size: 24px; }
  .timer { font-size: 28px; }
  .goal { padding: 4px 2px; font-size: 11.5px; }
  .goalkeys { display: none; }
  .mainrow { grid-template-columns: minmax(0, 1fr) 300px; margin-top: 6px; }
  .chartpanel { border-right: 1px solid var(--rule); border-bottom: 0; }
  #app { padding-bottom: 76px; }
  .chartwrap { flex: none; min-height: 120px; height: calc(100vh - 222px); }
  .mainrow { align-items: start; grid-template-columns: minmax(0, 1fr) 264px; }
  .ticket { max-height: calc(100vh - 174px); min-height: 120px; overflow-y: auto; overscroll-behavior: contain; }
  .goal { display: none; }
  .rulesmini { display: block; top: 8px; }
  .figs div.balfig { display: none; }
  .tab { padding: 4px 10px 3px; }
  .goaltext { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .score { font-size: 22px; }
  .figs dd { font-size: 12.5px; }
  .figs dt { font-size: 9.5px; }
  .tab { padding: 5px 12px 4px; }
  .tab .chg { display: none; }
  .who { font-size: 11px; }
  .chartmeta, .legend { display: none; }
  .actions { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: 8px 12px calc(8px + env(safe-area-inset-bottom)) !important; border-top: 1px solid var(--ink); }
  .reason { position: fixed; left: 0; right: 0; bottom: 66px; z-index: 31; padding: 3px 12px; min-height: 0; border-top: 1px solid var(--rule); }
  .reason:empty { display: none; }
  .trow { padding: 5px 12px; }
  .quote .q { font-size: 15px; }
  .actions { padding: 8px 12px 2px; }
  .actions > button { min-height: 50px; padding: 6px; flex-direction: row; justify-content: center; gap: 10px; }
  .fees { display: none; }
}

.seg.locked { opacity: .55; pointer-events: none; }

/* inline rules panel */
.rulespanel { margin-top: 10px; border: 1px solid var(--ink); background: var(--panel); }
.rpanehead { display: flex; justify-content: space-between; align-items: center; padding: 8px 14px; border-bottom: 1px solid var(--rule); }
.rpanebody { display: grid; grid-template-columns: 1.2fr 1fr; gap: 24px; padding: 4px 14px 12px; }
.rpanebody .rules { margin: 8px 0 0; }
@media (max-width: 860px) { .rpanebody { grid-template-columns: 1fr; gap: 4px; } }

/* start box lives where Buy/Sell go */
.startbox { display: none; }
.actions.pre { grid-template-columns: 1fr; }
.actions.pre > button { display: none; }
.actions.pre .startbox { display: flex; flex-direction: column; gap: 8px; }
.sbrow { display: flex; align-items: center; gap: 10px; }
.sbrow .seg button { padding: 7px 2px; font-size: 11.5px; }
.sbnote { font-size: 12px; min-height: 16px; }
.startbtn { width: 100%; min-height: 56px; font-size: 15px; }
@media (max-width: 760px) {
  body.pre #app { padding-bottom: calc(150px + env(safe-area-inset-bottom)); }
  .actions.pre .startbox { gap: 6px; }
  .startbtn { min-height: 50px; }
}
@media (max-height: 520px) and (min-width: 600px) {
  body.pre #app { padding-bottom: 130px; }
  .actions.pre .startbox { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .actions.pre .sbrow { flex: 1; }
  .actions.pre .sbnote { display: none; }
  .actions.pre .startbtn { width: auto; flex: 0 0 260px; min-height: 46px; }
}

.livebtn { position: absolute; left: 10px; top: 10px; background: var(--ink); color: var(--panel); border: 0; border-radius: 4px; padding: 6px 12px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; font-weight: 700; }
@media (max-height: 420px) and (min-width: 600px) {
  .figs { display: none; }
  .side { padding: 4px 10px; }
  .score { font-size: 20px; }
  .timer { font-size: 24px; }
  .clocklabel { font-size: 9px; }
  .tab { padding: 3px 10px 2px; }
  .tab .px { font-size: 12px; }
  .actions { padding-top: 6px !important; padding-bottom: 6px !important; }
  .actions > button { min-height: 44px; }
}
@media (max-height: 520px) and (min-width: 600px) and (max-width: 860px) {
  .mainrow { grid-template-columns: minmax(0, 1fr) 236px; }
  .quote .tv { display: none; }
  #symSeg button { font-size: 11px; padding-left: 0; padding-right: 0; letter-spacing: 0; }
  .trow > .lbl:first-child { width: 64px; }
}
