/* betXD — iOS-native dark-first styles */
:root, :root[data-theme="dark"] {
  --bg: #0B0D12; --surface: #161A22; --surface2: #1E232D; --surface3: #232833; --sep: #262C38;
  --label: #F2F4F8; --secondary: #9AA3B2; --tertiary: #6F7889; --chevron: #5C6577; --placeholder: #6F7889;
  --win: #3DDC84; --win-bg: #16301F; --win-sub: #8FD9B0;
  --loss: #FF8A7D; --loss-bg: #3A1A17; --loss-sub: #F2B8B0;
  --warn: #F5B94A; --warn-bg: #2A2110; --warn-text: #F2E3C2;
  --bar: rgba(11, 13, 18, 0.94); --backdrop: rgba(0, 0, 0, 0.55); --badge: #FF5A4E;
  --accent: #A99BFF; --accent-ink: #120E2B; --accent-tint: #1A1630; --accent-tint2: #2B2552; --accent-soft: #B9B2E6;
  color-scheme: dark;
}
:root[data-theme="dark"][data-accent="orange"] {
  --accent: #FF9F43; --accent-ink: #2A1400; --accent-tint: #2B1D0F; --accent-tint2: #3D2810; --accent-soft: #E9C9A6;
  --warn: #FFD60A; --warn-bg: #2A2610; --warn-text: #F2EBC2; --loss: #FF7A99; --loss-bg: #3A1622; --loss-sub: #F6B8C8;
}
:root[data-theme="light"] {
  --bg: #F2F2F7; --surface: #FFFFFF; --surface2: #E9EAF0; --surface3: #E3E5EC; --sep: #DCDFE6;
  --label: #12151C; --secondary: #5C6270; --tertiary: #6B717D; --chevron: #A3A8B3; --placeholder: #8A909C;
  --win: #1B7F45; --win-bg: #DDF3E5; --win-sub: #1E6B41;
  --loss: #C2352A; --loss-bg: #FBE3E0; --loss-sub: #9B2C22;
  --warn: #946000; --warn-bg: #FFF1D6; --warn-text: #5A4210;
  --bar: rgba(242, 242, 247, 0.94); --backdrop: rgba(0, 0, 0, 0.35); --badge: #E5372B;
  --accent: #5B45D6; --accent-ink: #FFFFFF; --accent-tint: #ECE8FF; --accent-tint2: #DCD5FF; --accent-soft: #4A3AA8;
  color-scheme: light;
}
:root[data-theme="light"][data-accent="orange"] {
  --accent: #B85A08; --accent-ink: #FFFFFF; --accent-tint: #FFEBD8; --accent-tint2: #FFDDBD; --accent-soft: #8A4508;
  --warn: #7A6300; --warn-bg: #FFF6CC; --loss: #C2304F; --loss-bg: #FCE1E8;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--label); }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; touch-action: manipulation; }
/* iOS zooms into any field under 16px: keep every field at 16px or more */
input, textarea, select { font-size: max(16px, 1em) !important; }
@media (display-mode: standalone) { :root { --edge-fade: 20px; } }
/* Netlify badge: never cover the app */
#nl-badge-frame, iframe[id^="nl-badge"] { display: none !important; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, system-ui, sans-serif;
  font-size: 17px; line-height: 1.3; -webkit-font-smoothing: antialiased; min-height: 100vh;
  overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
.num { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* wordmark */
.wordmark { height: 22px; width: auto; display: block; }
.wordmark.big { height: 44px; }
.wm-bet { fill: var(--label); } .wm-xd { fill: var(--accent); }

/* ---------- top bar ---------- */
.topbar {
  position: fixed; left: 0; right: 0; top: 0; z-index: 20;
  /* iOS draws a frosted fade ~20pt below the status bar: keep the bar's content clear of it */
  padding: calc(env(safe-area-inset-top) + var(--edge-fade, 0px)) 16px 0; height: calc(env(safe-area-inset-top) + var(--edge-fade, 0px) + 112px);
  display: flex; flex-direction: column;
  background: var(--bg); border-bottom: 1px solid var(--sep);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}
.topbar-row { height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex: none; }
.topbar .wordmark { height: 27px; flex: none; }
.bankbar { height: 52px; flex: none; margin: 0 -4px 6px; padding: 0 12px; border: 0; border-radius: 14px; background: var(--surface);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--label); text-align: left; font: inherit; }
.bank-main { display: flex; flex-direction: column; line-height: 1; min-width: 0; }
.bank-main small { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--secondary); margin-bottom: 4px; }
.bank-main b { font-size: 28px; font-weight: 800; letter-spacing: -.01em; white-space: nowrap; }
.bank-main .cents { font-size: 18px; font-weight: 700; color: var(--secondary); }
.bank-side { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; font-size: 13px; font-weight: 600; text-align: right; white-space: nowrap; }
.topbar-right { display: flex; align-items: center; gap: 6px; }
.topbar-date { font-size: 15px; font-weight: 700; color: var(--label); opacity: .85; }
.pill { display: inline-flex; align-items: baseline; gap: 4px; padding: 6px 9px; border-radius: 9px; font-variant-numeric: tabular-nums; }
.pill b { font-size: 15px; font-weight: 800; } .pill small { font-size: 10.5px; font-weight: 800; letter-spacing: .04em; }
.pill.up { background: var(--win-bg); } .pill.up b { color: var(--win); } .pill.up small { color: var(--win-sub); }
.pill.down { background: var(--loss-bg); } .pill.down b { color: var(--loss); } .pill.down small { color: var(--loss-sub); }
.pill.flat { background: var(--surface3); } .pill.flat b { color: var(--label); } .pill.flat small { color: var(--secondary); }

/* ---------- tab bar ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 6px 0 calc(env(safe-area-inset-bottom) + 4px);
  background: var(--bar); border-top: 1px solid var(--sep);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
}
.tab { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 49px; justify-content: center;
  border: 0; background: none; color: var(--tertiary); font-size: 10px; font-weight: 600; }
.tab svg { width: 26px; height: 26px; }
.tab[aria-current="page"] { color: var(--accent); }
.badge { position: absolute; top: 0; left: 54%; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--badge); color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; }

/* ---------- screens ---------- */
.screen { padding: calc(env(safe-area-inset-top) + var(--edge-fade, 0px) + 128px) 16px calc(env(safe-area-inset-bottom) + 96px); max-width: 640px; margin: 0 auto; }
.screen.with-actions { padding-bottom: calc(env(safe-area-inset-bottom) + 170px); }
.screen.plain { padding-top: calc(env(safe-area-inset-top) + 24px); padding-bottom: calc(env(safe-area-inset-bottom) + 120px); }
.stack { display: flex; flex-direction: column; gap: 12px; }
.large-title { margin: 0; font-size: 34px; line-height: 41px; font-weight: 700; letter-spacing: .01em; }
.title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.subline { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--secondary); margin-top: -4px; }
.dot { width: 8px; height: 8px; border-radius: 4px; background: var(--win); display: inline-block; margin-right: 6px; }
.dot.off { background: var(--tertiary); }
.section-h { font-size: 13px; font-weight: 600; color: var(--secondary); text-transform: uppercase; letter-spacing: .06em; margin: 10px 4px 0; }
.foot { font-size: 13px; line-height: 18px; color: var(--secondary); padding: 0 4px; margin: 0; }
.back { display: inline-flex; align-items: center; gap: 2px; min-height: 44px; padding: 0 8px 0 0; color: var(--accent); background: none; border: 0; font-size: 17px; }
.round-btn { width: 44px; height: 44px; border-radius: 22px; border: 0; background: var(--surface2); color: var(--accent); display: flex; align-items: center; justify-content: center; flex: none; }

/* cards & lists */
.card { background: var(--surface); border-radius: 14px; }
.card.pad { padding: 14px 16px; }
.sig { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; background: var(--surface); border-radius: 14px; border: 0; text-align: left; width: 100%; color: var(--label); }
.sig-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.meta { font-size: 12px; font-weight: 600; color: var(--secondary); text-transform: uppercase; letter-spacing: .05em; }
.sig-sel { font-size: 17px; font-weight: 600; line-height: 22px; }
.sig-bottom { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.sig-nums { display: flex; gap: 14px; font-size: 13px; color: var(--secondary); font-variant-numeric: tabular-nums; flex-wrap: wrap; }
.sig-nums b { color: var(--label); font-weight: 600; }
.sig-stake { text-align: right; display: flex; flex-direction: column; }
.sig-stake small { font-size: 11px; color: var(--secondary); }
.sig-stake span { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.c-accent { color: var(--accent); } .c-win { color: var(--win); } .c-loss { color: var(--loss); } .c-muted { color: var(--secondary); } .c-dim { color: var(--tertiary); } .c-warn { color: var(--warn); }
.tag { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 4px 8px; border-radius: 6px; white-space: nowrap; }
.tag.new { background: var(--accent); color: var(--accent-ink); }
.tag.placed { background: var(--win-bg); color: var(--win); }
.tag.lost { background: var(--loss-bg); color: var(--loss); }
.tag.skip, .tag.missed { background: var(--surface3); color: var(--secondary); }
.tag.src { background: transparent; color: var(--tertiary); padding: 0; }
.row-compact { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; background: var(--surface); border-radius: 14px; width: 100%; border: 0; text-align: left; color: var(--label); }
.list { background: var(--surface); border-radius: 14px; display: flex; flex-direction: column; overflow: hidden; }
.list > .li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; min-height: 48px; border: 0; border-bottom: 1px solid var(--sep); background: none; text-align: left; width: 100%; color: var(--label); font-size: 17px; }
.list > .li:last-child { border-bottom: 0; }
.li-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.li-title { font-size: 16px; font-weight: 600; }
.li-sub { font-size: 13px; color: var(--secondary); }
.li-right { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.li-right b { font-size: 16px; }
.chev { color: var(--chevron); display: inline-flex; align-items: center; gap: 8px; }
.empty { text-align: center; color: var(--secondary); font-size: 15px; line-height: 21px; padding: 28px 16px; background: var(--surface); border-radius: 14px; }

/* tiles */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tile { background: var(--surface); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.tile small { font-size: 13px; color: var(--secondary); }
.tile b { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ticket */
.stake-card { background: var(--accent-tint); border-radius: 16px; padding: 14px 18px; display: flex; flex-direction: column; gap: 4px; }
.stake-card.skip { background: var(--surface); }
.verdict { font-size: 12px; font-weight: 800; letter-spacing: .1em; color: var(--accent); }
.stake-card.skip .verdict { color: var(--secondary); }
.stake-big { font-size: 46px; line-height: 50px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stake-sub { font-size: 14px; color: var(--accent-soft); font-variant-numeric: tabular-nums; }
.stake-card.skip .stake-sub { color: var(--secondary); }
.chip-btn { min-height: 36px; padding: 0 12px; border-radius: 9px; border: 0; background: var(--accent-tint2); color: var(--accent-soft); font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.warnbox { background: var(--warn-bg); border-radius: 12px; padding: 12px 14px; display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 19px; color: var(--warn-text); }
.warnbox b { color: var(--warn); }
.stepper { display: flex; align-items: center; gap: 4px; }
.stepper button { width: 44px; height: 36px; border-radius: 8px; border: 0; background: var(--surface3); color: var(--label); font-size: 20px; }
.stepper input { width: 64px; height: 36px; text-align: center; border: 0; background: transparent; color: var(--label); font-weight: 600; font-size: 17px; font-variant-numeric: tabular-nums; }
.actions { position: fixed; left: 0; right: 0; bottom: calc(env(safe-area-inset-bottom) + 59px); z-index: 15; padding: 12px 16px; background: var(--bg); border-top: 1px solid var(--surface2); display: flex; gap: 10px; }
.btn { height: 50px; border-radius: 14px; border: 0; font-size: 17px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; padding: 0 16px; white-space: nowrap; }
.actions .btn.secondary { flex: 0 0 auto; }
@media (max-width: 370px) { .actions .btn { font-size: 15px; padding: 0 12px; } .topbar-date { display: none; } .topbar .wordmark { height: 23px; } }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.secondary { background: var(--surface2); color: var(--accent); font-weight: 600; }
.btn.plain { background: transparent; color: var(--accent); font-weight: 600; }
.btn.danger { background: transparent; color: var(--loss); font-weight: 600; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; }
.grow { flex: 1 1 auto; }
.result-btns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.rb { height: 42px; border-radius: 10px; border: 0; font-size: 15px; font-weight: 600; }
.rb.won { background: var(--win-bg); color: var(--win); } .rb.lost { background: var(--loss-bg); color: var(--loss); } .rb.void { background: var(--surface3); color: var(--label); }
.rb.sel { outline: 2px solid var(--accent); outline-offset: -2px; }

/* forms */
.field { display: flex; flex-direction: column; gap: 2px; padding: 10px 16px; border-bottom: 1px solid var(--sep); }
.field:last-child { border-bottom: 0; }
.field label { font-size: 13px; color: var(--secondary); }
.field input, .field textarea, .field select { border: 0; background: transparent; color: var(--label); font-size: 17px; padding: 2px 0; outline: none; width: 100%; }
.field textarea { min-height: 150px; resize: vertical; line-height: 21px; }
input::placeholder, textarea::placeholder { color: var(--placeholder); }
.row-input { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 0 16px; min-height: 52px; border-bottom: 1px solid var(--sep); }
.row-input:last-child { border-bottom: 0; }
.row-input input { width: 110px; text-align: right; border: 0; background: transparent; color: var(--label); font-weight: 600; font-size: 17px; outline: none; font-variant-numeric: tabular-nums; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); background: var(--surface3); border-radius: 9px; padding: 2px; gap: 2px; }
.seg button { height: 32px; border: 0; border-radius: 7px; background: transparent; color: var(--secondary); font-size: 13px; font-weight: 600; padding: 0 8px; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--label); box-shadow: 0 1px 3px rgba(0,0,0,.25); }
:root[data-theme="dark"] .seg button[aria-pressed="true"] { background: #3A4150; color: #fff; }
.toggle { position: relative; width: 51px; height: 31px; flex: none; }
.toggle input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.toggle span { position: absolute; inset: 0; border-radius: 16px; background: var(--surface3); transition: background .2s; }
.toggle span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 14px; background: #fff; transition: transform .2s; box-shadow: 0 2px 4px rgba(0,0,0,.25); }
.toggle input:checked + span { background: var(--accent); }
.toggle input:checked + span::after { transform: translateX(20px); }
.swatch { width: 44px; height: 44px; border-radius: 22px; border: 2px solid transparent; background: none; padding: 0; display: flex; align-items: center; justify-content: center; }
.swatch span { width: 30px; height: 30px; border-radius: 15px; display: block; }
.swatch[aria-pressed="true"] { border-color: var(--accent); }
.radio-card { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px; border: 2px solid transparent; background: var(--surface); text-align: left; width: 100%; color: var(--label); }
.radio-card[aria-checked="true"] { background: var(--accent-tint); border-color: var(--accent); }
.radio-dot { flex: none; width: 22px; height: 22px; border-radius: 11px; border: 2px solid var(--chevron); }
.radio-card[aria-checked="true"] .radio-dot { border: 7px solid var(--accent); background: var(--accent-ink); }
.rec { margin-left: 8px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 2px 6px; border-radius: 5px; background: var(--accent-tint2); color: var(--accent-soft); vertical-align: 2px; }
.err { color: var(--loss); font-size: 14px; line-height: 19px; padding: 0 4px; }
.ok { color: var(--win); font-size: 14px; padding: 0 4px; }

/* sheets */
.backdrop { position: fixed; inset: 0; background: var(--backdrop); z-index: 40; animation: fade .2s ease; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-height: 92vh; overflow-y: auto; background: var(--surface); border-radius: 14px 14px 0 0;
  padding: 0 0 calc(env(safe-area-inset-bottom) + 16px); animation: up .28s cubic-bezier(.2,.8,.2,1); max-width: 640px; margin: 0 auto; }
:root[data-theme="dark"] .sheet { background: #12151C; }
.sheet .grabber { width: 36px; height: 5px; border-radius: 3px; background: var(--chevron); margin: 6px auto 0; opacity: .6; }
.sheet-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 4px 8px 0; min-height: 52px; }
.sheet-head h2 { margin: 0; font-size: 17px; font-weight: 600; text-align: center; }
.sheet-head .l { justify-self: start; } .sheet-head .r { justify-self: end; font-weight: 700; }
.sheet-body { padding: 8px 16px 8px; display: flex; flex-direction: column; gap: 10px; }
.sheet .list { background: var(--surface2); }
:root[data-theme="dark"] .sheet .list { background: #1C2029; }
@keyframes up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .sheet, .backdrop { animation: none; } }

/* toast */
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom) + 150px); z-index: 60; background: var(--label); color: var(--bg);
  padding: 10px 16px; border-radius: 12px; font-size: 15px; font-weight: 600; box-shadow: 0 8px 24px rgba(0,0,0,.3); max-width: 90vw; text-align: center; }

/* stats */
.hero { background: var(--surface); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.hero-big { font-size: 34px; line-height: 40px; font-weight: 800; font-variant-numeric: tabular-nums; }
.chart svg { width: 100%; height: 150px; display: block; }
.legend { display: flex; gap: 16px; font-size: 13px; color: var(--secondary); flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; background: var(--accent); margin-right: 6px; vertical-align: middle; }
.legend i.dash { background: none; border-top: 2px dashed var(--secondary); height: 0; }
.cal { background: var(--surface); border-radius: 14px; padding: 8px 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.cal-head { display: flex; justify-content: space-between; align-items: center; }
.cal-title { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-wd { font-size: 11px; font-weight: 600; color: var(--secondary); text-align: center; padding-bottom: 2px; }
.cal-day { height: 54px; border-radius: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; font-variant-numeric: tabular-nums; border: 0; padding: 0; background: transparent; color: var(--label); }
.cal-day .d { font-size: 10px; line-height: 12px; font-weight: 600; color: var(--secondary); }
.cal-day .p { font-size: 11px; line-height: 13px; font-weight: 700; }
.cal-day .a { font-size: 9.5px; line-height: 11px; }
.cal-day.up { background: var(--win-bg); } .cal-day.up .d, .cal-day.up .a { color: var(--win-sub); } .cal-day.up .p { color: var(--win); }
.cal-day.down { background: var(--loss-bg); } .cal-day.down .d, .cal-day.down .a { color: var(--loss-sub); } .cal-day.down .p { color: var(--loss); }
.cal-day.flat { background: var(--surface3); }
.cal-day.none { border: 1px solid var(--sep); }
.cal-day.future .d { color: var(--tertiary); }
.cal-day.today { box-shadow: inset 0 0 0 2px var(--accent); }
.cal-day.blank { visibility: hidden; }
.cal-foot { display: flex; justify-content: space-between; gap: 8px; padding: 0 4px; font-size: 12px; color: var(--secondary); font-variant-numeric: tabular-nums; }

/* onboarding */
.center { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; }
.app-icon { width: 88px; height: 88px; border-radius: 20px; display: block; }
.hero-title { margin: 8px 0 0; font-size: 32px; line-height: 38px; font-weight: 800; letter-spacing: -.01em; }
.lead { margin: 0; font-size: 17px; line-height: 23px; color: var(--secondary); }
.bottom-actions { position: fixed; left: 16px; right: 16px; bottom: calc(env(safe-area-inset-bottom) + 20px); display: flex; flex-direction: column; gap: 10px; max-width: 608px; margin: 0 auto; }
.steps { list-style: none; margin: 0; padding: 0; }
.steps li { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-bottom: 1px solid var(--sep); }
.steps li:last-child { border-bottom: 0; }
.step-n { width: 28px; height: 28px; border-radius: 14px; background: var(--accent-tint2); color: var(--accent-soft); font-size: 15px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex: none; }
.loading { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.spinner { width: 28px; height: 28px; border-radius: 14px; border: 3px solid var(--surface3); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* leaderboard */
.lb { gap: 12px; justify-content: flex-start; }
.lb .li-main { flex: 1; min-width: 0; }
.lb .rank { width: 26px; height: 26px; flex: none; border-radius: 13px; background: var(--surface3); color: var(--secondary); font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; }
.lb:nth-child(1) .rank { background: var(--accent); color: var(--accent-ink); }
.lb.me { background: var(--accent-tint, rgba(169,155,255,.08)); }
.li[disabled] { opacity: .45; }

/* signals: filter pills + sort */
.fchips { display: flex; gap: 6px; overflow-x: auto; margin: 2px -16px 0; padding: 0 16px 2px; scrollbar-width: none; }
.fchips::-webkit-scrollbar { display: none; }
.fchip { flex: none; min-height: 36px; padding: 0 10px 0 12px; border-radius: 18px; border: 1px solid var(--sep); background: var(--surface); color: var(--label);
  font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.fchip .n { font-size: 12px; font-weight: 700; color: var(--secondary); background: var(--surface3); border-radius: 9px; padding: 2px 7px; font-variant-numeric: tabular-nums; }
.fchip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.fchip[aria-pressed="true"] .n { background: rgba(0,0,0,.18); color: var(--accent-ink); }
.sortrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; }
@media (max-width: 370px) { .bank-main b { font-size: 24px; } .bank-side { font-size: 12px; } }

/* expired signals: result box */
.sig.expired .sig-sel { color: var(--secondary); }
.tag.res { font-size: 12px; padding: 5px 10px; border-radius: 7px; letter-spacing: .05em; }
.tag.res.won { background: var(--win); color: var(--bg); }
.tag.res.lost { background: var(--loss); color: var(--bg); }
.tag.res.void { background: var(--surface3); color: var(--label); }
.tag.res.pending { background: transparent; color: var(--secondary); border: 1px solid var(--sep); }

/* bets: per-bookmaker sub-boxes, deliberately quieter than the two main tiles */
.books { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 8px; margin-top: -4px; padding: 0 6px; }
.book { border: 1px solid var(--sep); background: transparent; border-radius: 10px; padding: 7px 10px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.book-head { display: flex; align-items: center; gap: 6px; min-width: 0; }
.book-mono { width: 18px; height: 18px; flex: none; border-radius: 5px; display: flex; align-items: center; justify-content: center;
  font-size: 8.5px; font-weight: 900; font-style: italic; letter-spacing: -.02em; color: #fff; background: #5B6475; }
.book-stoiximan .book-mono { background: #2F6FED; }
.book-superbet .book-mono { background: #E5484D; }
.book-name { flex: 1; min-width: 0; font-size: 12px; font-weight: 600; color: var(--secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.book b { font-size: 14px; font-weight: 700; color: var(--label); }
.book small { font-size: 11.5px; color: var(--tertiary, var(--secondary)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 24px; }
@media (max-width: 370px) {
  .books { padding: 0; gap: 6px; }
  .book { padding: 6px 8px; }
  .book-name { font-size: 11px; }
  .book b { font-size: 13px; }
  .book small { font-size: 10.5px; padding-left: 0; }
}
/* 2.0.15 */
.sig { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.sig:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sig-quick { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 10px; border-top: 1px solid var(--sep); font-size: 13px; }
.quick-place { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: 18px; border: 0; background: var(--accent-tint2); color: var(--accent-soft); font-size: 15px; font-weight: 600; flex: none; }
.quick-place:active { opacity: .7; }
.toast.has-action { display: flex; align-items: center; gap: 14px; pointer-events: auto; }
.toast-btn { background: none; border: 0; color: inherit; text-decoration: underline; text-underline-offset: 3px; font-weight: 700; font-size: 15px; padding: 6px 2px; min-height: 32px; }
.tile-count { font-size: 15px; font-weight: 600; color: var(--secondary); }
.tile small.ellip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bank-side b { color: var(--label); }
.reader.down { box-shadow: inset 0 0 0 1px var(--loss); }
.dot.off.down, .reader.down .dot.off { background: var(--loss); }
.bank-main small span { letter-spacing: 0; margin-left: 4px; text-transform: none; }
.toast.has-action { white-space: nowrap; }
/* 2.0.16 */
/* app chrome isn't selectable text (no copy/paste popups on long-press); fields stay editable */
body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
input, textarea, select, [contenteditable="true"] { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
/* keep the tab bar pinned on iPhone: no rubber-band on the page, own compositing layer */
html { overscroll-behavior: none; }
body { min-height: 100dvh; overscroll-behavior: none; }
.tabbar, .topbar { transform: translateZ(0); -webkit-transform: translateZ(0); }
.note-card { background: var(--surface); border-radius: 14px; padding: 12px 14px; font-size: 15px; line-height: 20px; color: var(--secondary); }
.note-card b { color: var(--label); font-weight: 600; }
.check-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; background: var(--surface); border-radius: 14px; font-size: 15px; line-height: 20px; color: var(--secondary); cursor: pointer; }
.check-row b { color: var(--label); font-weight: 600; }
.check-row input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check-box { flex: none; width: 24px; height: 24px; border-radius: 7px; border: 2px solid var(--tertiary); display: flex; align-items: center; justify-content: center; color: transparent; margin-top: -1px; }
.check-box svg { width: 16px; height: 16px; }
.check-row input:checked + .check-box { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.check-row input:focus-visible + .check-box { outline: 2px solid var(--accent); outline-offset: 2px; }
details.terms { background: var(--surface); border-radius: 14px; padding: 0 14px; }
details.terms summary { min-height: 44px; display: flex; align-items: center; color: var(--accent); font-size: 15px; font-weight: 600; cursor: pointer; list-style: none; }
details.terms summary::-webkit-details-marker { display: none; }
details.terms summary::after { content: "›"; margin-left: auto; font-size: 22px; transition: transform .2s; }
details.terms[open] summary::after { transform: rotate(90deg); }
details.terms[open] { padding-bottom: 12px; }
.terms-body h3 { font-size: 15px; margin: 12px 0 2px; color: var(--label); }
.terms-body h3:first-child { margin-top: 0; }
.terms-body p { margin: 0; font-size: 14px; line-height: 19px; color: var(--secondary); }
.kelly-note { margin: -4px 4px 2px; font-size: 14px; line-height: 19px; color: var(--secondary); }
.kelly-note b { color: var(--label); }
.risk { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 2px 7px; border-radius: 5px; white-space: nowrap; }
.risk-low { background: var(--win-bg); color: var(--win); }
.risk-medium { background: var(--warn-bg); color: var(--warn); }
.risk-high { background: var(--loss-bg); color: var(--loss); }
.book-max { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; margin-top: 5px; padding: 4px 8px; border-radius: 7px; background: var(--surface); font-size: 11.5px; color: var(--secondary); }
.book .book-max b { font-size: 13px; color: inherit; }
.book .book-max b.c-win { color: var(--win); }
.book-max span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.book .book-max b { white-space: nowrap; flex: none; }
.book-max .short { display: none; }
@media (max-width: 370px) { .book-max { padding: 4px 6px; } .book-max .long { display: none; } .book-max .short { display: inline; } }
.quick-place { text-decoration: none; } .quick-place svg { width: 14px; height: 14px; }

/* admin: signal performance */
.pf-card { padding: 4px 0; }
.pf-row { padding: 10px 16px; border-bottom: 1px solid var(--sep); display: flex; flex-direction: column; gap: 6px; }
.pf-row:last-child { border-bottom: 0; }
.pf-row.few { opacity: .62; }
.pf-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.pf-name { font-size: 16px; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-top b { font-size: 16px; white-space: nowrap; }
.pf-bar { position: relative; height: 6px; border-radius: 3px; background: var(--surface3); overflow: hidden; }
.pf-bar::after { content: ""; position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: var(--tertiary); }
.pf-bar span { position: absolute; top: 0; bottom: 0; }
.pf-bar span.up { background: var(--win); border-radius: 0 3px 3px 0; }
.pf-bar span.down { background: var(--loss); border-radius: 3px 0 0 3px; }
.pf-sub { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--secondary); font-variant-numeric: tabular-nums; }
.pf-sub > span:last-child { white-space: nowrap; }
.tiles .tile small:last-child { line-height: 17px; }
.kc { padding: 2px 0; }
.kc-row { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--sep); font-size: 15px; }
.kc-row:last-child { border-bottom: 0; }
.kc-row > :not(:first-child) { text-align: right; white-space: nowrap; }
.kc-row b { font-size: 16px; }
.kc-row > span.num { font-size: 14px; }
.kc-head { font-size: 12px; font-weight: 600; color: var(--secondary); text-transform: uppercase; letter-spacing: .04em; padding-top: 8px; padding-bottom: 8px; }
.kc-name { display: flex; flex-direction: column; font-weight: 600; font-size: 16px; min-width: 0; }
.kc-name small { font-size: 12px; font-weight: 400; color: var(--secondary); }
.kc-row.me { background: var(--accent-tint); }
.kc-row.me .kc-name small { color: var(--accent-soft); font-weight: 600; }
