/* VigStamp — cream canvas, blue #2563EB, green/red results. Desktop-first. */
:root {
  color-scheme: light;
  --bg: #FAF8F5;
  --bg-elevated: #FFFFFF;
  --bg-soft: #E7F0FC;
  --canvas: #E4EDF8;
  --sidebar: #F7FBFF;
  --ink: #1E1B2E;
  --ink-muted: #5C6578;
  --ink-faint: #8A93A6;
  --line: #D5E2F5;
  --line-strong: #B9CDED;
  --primary: #2563EB;
  --primary-soft: #EAF1FE;
  --primary-dark: #1D4ED8;
  --accent-ink: #1D4ED8;
  --on-primary: #ffffff;
  --nav-bg: rgba(255, 252, 248, 0.94);
  --hero-from: #ffffff;
  --hero-to: #dbeafe;
  --card: var(--bg-elevated);
  --border: var(--line);
  --muted: var(--ink-muted);
  --banner-bg: #FFF7ED;
  --banner-ink: #92400E;
  --banner-btn: #ffffff;
  --switch-off: #D5E2F5;
  --switch-knob: #ffffff;
  --primary-ring: rgba(37, 99, 235, 0.18);
  --coral: #E85D4C;
  --coral-soft: #FDECEA;
  --amber: #D97706;
  --amber-soft: #FFF7ED;
  --teal: #0F766E;
  --teal-soft: #ECFDF8;
  --violet: #7C3AED;
  --violet-soft: #F3E8FF;
  --sky: #0284C7;
  --sky-soft: #E0F2FE;
  --rose: #E11D48;
  --rose-soft: #FFE4E6;
  --slate: #475569;
  --slate-soft: #F1F5F9;
  --indigo: #4F46E5;
  --indigo-soft: #EEF0FF;
  --tag-indigo: var(--indigo);
  --tag-indigo-bg: var(--indigo-soft);
  --tag-coral: var(--coral);
  --tag-coral-bg: var(--coral-soft);
  --tag-teal: var(--teal);
  --tag-teal-bg: var(--teal-soft);
  --tag-amber: var(--amber);
  --tag-amber-bg: var(--amber-soft);
  --tag-violet: var(--violet);
  --tag-violet-bg: var(--violet-soft);
  --tag-sky: var(--sky);
  --tag-sky-bg: var(--sky-soft);
  --tag-rose: var(--rose);
  --tag-rose-bg: var(--rose-soft);
  --tag-slate: var(--slate);
  --tag-slate-bg: var(--slate-soft);
  --win: #0F766E;
  --win-soft: #ECFDF8;
  --loss: #E85D4C;
  --loss-soft: #FDECEA;
  --chart-up: #15803D;
  --chart-down: #E11D48;
  --series-profit: #2563EB;
  --series-ev: #0284C7;
  --series-clv: #7C3AED;
  --push: #6B6578;
  --pending: #D97706;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --shadow: 0 1px 1px rgba(28, 25, 23, 0.03), 0 1px 2px rgba(28, 25, 23, 0.04);
  --shadow-hover: 0 6px 16px rgba(28, 25, 23, 0.07);
  --nav-h: 62px;
  --sidebar-w: 220px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --ease: 140ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0F172A;
  --bg-elevated: #17233A;
  --bg-soft: #1E3050;
  --canvas: #0B1220;
  --ink: #F8FAFC;
  --ink-muted: #C9D6EA;
  --ink-faint: #93A4C2;
  --line: #2E4468;
  --primary: #2563EB;
  --primary-soft: #1E3A8A;
  --primary-dark: #1D4ED8;
  --accent-ink: #93C5FD;
  --on-primary: #ffffff;
  --nav-bg: rgba(15, 23, 42, 0.94);
  --hero-from: #1A2C4E;
  --hero-to: #1E3A8A;
  --coral: #FB7185;
  --coral-soft: #3F1D2A;
  --amber: #FBBF24;
  --amber-soft: #3A2A12;
  --teal: #2DD4BF;
  --teal-soft: #12352F;
  --violet: #C4B5FD;
  --violet-soft: #2E2160;
  --sky: #7DD3FC;
  --sky-soft: #123044;
  --rose: #FDA4AF;
  --rose-soft: #3F1D2A;
  --slate: #CBD5E1;
  --slate-soft: #243044;
  --indigo: #A5B4FC;
  --indigo-soft: #1E1B4B;
  --win: #93C5FD;
  --loss: #FB7185;
  --chart-up: #4ADE80;
  --chart-down: #FB7185;
  --series-profit: #60A5FA;
  --series-ev: #7DD3FC;
  --series-clv: #C084FC;
  --push: #93A4C2;
  --pending: #FBBF24;
  --banner-bg: #3A2A12;
  --banner-ink: #FDE68A;
  --banner-btn: #2A2114;
  --switch-off: #2E4468;
  --switch-knob: #F8FAFC;
  --sidebar: #0B1220;
  --line-strong: #3D5680;
  --primary-ring: rgba(37, 99, 235, 0.35);
  --win-soft: #12352F;
  --loss-soft: #3F1D2A;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.28), 0 10px 28px rgba(0, 0, 0, 0.35);
  --card: var(--bg-elevated);
  --border: var(--line);
  --muted: var(--ink-muted);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  min-height: 100%;
}

body { line-height: 1.45; }

button, input, select, textarea { font-family: inherit; }

button { -webkit-tap-highlight-color: transparent; }

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

#app {
  --app-max: 520px;
  max-width: var(--app-max);
  margin: 0 auto;
  min-height: 100dvh;
  padding-bottom: calc(var(--nav-h) + var(--safe-b) + 16px);
  position: relative;
  border-top: 3px solid var(--primary);
}

#app {
  min-height: 100dvh;
}

.shell-main {
  min-width: 0;
  padding-bottom: calc(var(--nav-h) + var(--safe-b) + 28px);
}

.view { display: none; padding: 18px 16px 12px; }
.view.active {
  display: block;
  animation: view-in 160ms var(--ease);
}

@keyframes view-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

.top-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.eyebrow {
  margin: 0 0 2px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.top-bar h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.1;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  flex-shrink: 0;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.32);
}
.brand-name {
  margin: 0;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--ink);
}
.brand-lockup .eyebrow {
  color: var(--primary);
  margin-top: 2px;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--bg-elevated);
  color: var(--ink-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--ease), border-color var(--ease), transform 100ms ease, color var(--ease);
}
.icon-btn svg { stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn:hover { background: var(--bg-soft); color: var(--ink); border-color: var(--line-strong); }
.icon-btn:active { transform: scale(0.96); }

.link-btn {
  border: none;
  background: none;
  color: var(--accent-ink);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  padding: 6px 2px;
  border-radius: 6px;
  transition: color var(--ease), background var(--ease);
}
.link-btn:hover { color: var(--primary-dark); background: var(--primary-soft); }

.card {
  background: var(--bg-elevated);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  padding: 14px;
}

.banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--banner-bg);
  color: var(--banner-ink);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
}
.banner button {
  border: none;
  background: var(--banner-btn);
  color: var(--banner-ink);
  font-weight: 600;
  font-size: 12px;
  border-radius: 7px;
  padding: 5px 9px;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--ease), transform 100ms ease;
}
.banner button:hover { background: #FFFBEB; }
.banner button:active { transform: scale(0.97); }

.ext-banner {
  align-items: center;
  padding: 12px 12px 12px 14px;
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 58%, #3b82f6 100%);
  color: #fff;
  border: 1px solid rgba(29, 78, 216, 0.4);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.18);
}
.ext-banner-copy { min-width: 0; }
.ext-banner-title {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.ext-banner-sub {
  margin: 3px 0 0;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.9);
}
.ext-banner-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.ext-banner-download {
  display: inline-flex;
  align-items: center;
  background: #fff;
  color: #1d4ed8;
  text-decoration: none;
  font-weight: 800;
  font-size: 13px;
  border-radius: 8px;
  padding: 7px 12px;
  white-space: nowrap;
}
.ext-banner-download:hover { background: #eaf1fe; }
.ext-banner .ext-banner-dismiss {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}
.ext-banner .ext-banner-dismiss:hover { background: rgba(255, 255, 255, 0.28); color: #fff; }
.ext-banner .ext-banner-dismiss:active { transform: scale(0.96); }

.hidden { display: none !important; }

/* ---------- Desktop chrome ---------- */
.side-nav { display: none; }

.nav-svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

/* Home dashboard */
.home-layout {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}
.dash-panel {
  padding: 12px 14px 14px;
  margin: 0;
}
.dash-panel > .period-strip { margin-bottom: 0; }
.dash-panel > .pnl-hero,
.dash-panel > .pnl-hero.compact {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 12px 0 0;
  margin: 0;
  text-align: left;
  display: block;
  border-radius: 0;
}
.dash-panel .pnl-hero .stat-value { margin: 2px 0 4px; }
.dash-panel .pnl-sub { margin: 0; }

.quick-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.quick-stat {
  padding: 12px 12px 11px;
  border-radius: var(--radius);
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transition: border-color var(--ease), box-shadow var(--ease);
}
.quick-stat .stat-label { margin-bottom: 4px; }
.quick-stat .stat-value { font-size: 18px; font-weight: 700; letter-spacing: -0.03em; }

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 4px 0 8px;
}
.section-head h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.015em;
}
.section-head.tight { margin-bottom: 8px; }
.section-head-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}
.top-actions.can-wrap { flex-wrap: wrap; justify-content: flex-end; }

.stat-label {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.stat-value {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
}
.stat-value.xl { font-size: 40px; line-height: 1.02; }
.stat-value.lg { font-size: 32px; line-height: 1.05; }
.stat-value.md { font-size: 20px; }
.stat-value.sm { font-size: 22px; }
.pos { color: var(--win); }
.neg { color: var(--loss); }
.neu { color: var(--ink); }

/* Bet rows */
.bet-list { display: flex; flex-direction: column; gap: 8px; }

.bet-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
  padding: 11px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  cursor: pointer;
  text-align: left;
  width: 100%;
  font: inherit;
  color: inherit;
  transition: border-color var(--ease), box-shadow var(--ease), transform 110ms ease, background var(--ease);
}
.bet-row:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}
.bet-row:active { transform: translateY(0) scale(0.995); background: var(--bg-soft); }

.bet-row-wrap {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}
.bet-row-wrap.is-selected .bet-row {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}
.bet-check {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  margin: 0;
  gap: 0;
}
.bet-check input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0;
  margin: 0;
  accent-color: var(--primary);
  cursor: pointer;
}

.bulk-tag-bar { margin-bottom: 10px; }
.bulk-tag-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.bulk-tag-count {
  margin: 0;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.bulk-tag-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.bulk-tag-bar .tag-hint { margin-top: 10px; }
.bulk-replace {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  margin: 10px 0 0;
  font-size: 13px;
}
.bulk-replace input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0;
  margin: 0;
  accent-color: var(--primary);
}
#btn-bulk-select[aria-pressed="true"] {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--accent-ink);
}

.bet-row-main { min-width: 0; }
.bet-selection {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.015em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bet-slip-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}
.bet-meta {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bet-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}
.tag {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--ink-muted);
}
.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  line-height: 1.35;
  max-width: 100%;
  white-space: nowrap;
}
.tag-pill.tag-indigo { background: var(--tag-indigo-bg); color: var(--tag-indigo); }
.tag-pill.tag-coral { background: var(--tag-coral-bg); color: var(--tag-coral); }
.tag-pill.tag-teal { background: var(--tag-teal-bg); color: var(--tag-teal); }
.tag-pill.tag-amber { background: var(--tag-amber-bg); color: var(--tag-amber); }
.tag-pill.tag-violet { background: var(--tag-violet-bg); color: var(--tag-violet); }
.tag-pill.tag-sky { background: var(--tag-sky-bg); color: var(--tag-sky); }
.tag-pill.tag-rose { background: var(--tag-rose-bg); color: var(--tag-rose); }
.tag-pill.tag-slate { background: var(--tag-slate-bg); color: var(--tag-slate); }
.tag-pill .tag-x {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 13px;
  line-height: 1;
  padding: 0 0 0 2px;
  cursor: pointer;
  opacity: 0.65;
}
.tag-pill .tag-x:hover { opacity: 1; }
.tag-selected-row,
.tag-quick-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 26px;
}
.tag-selected-row:empty::before {
  content: "No tags yet";
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-faint);
}
.tag-quick-chip {
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink-muted);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color var(--ease), color var(--ease), background var(--ease), transform 100ms ease;
}
.tag-quick-chip:hover { border-color: var(--primary); color: var(--primary-dark); }
.tag-quick-chip:active { transform: scale(0.97); }
.tag-quick-chip.is-on { border-color: transparent; }
.tag-quick-chip.is-on.tag-indigo { background: var(--tag-indigo-bg); color: var(--tag-indigo); }
.tag-quick-chip.is-on.tag-coral { background: var(--tag-coral-bg); color: var(--tag-coral); }
.tag-quick-chip.is-on.tag-teal { background: var(--tag-teal-bg); color: var(--tag-teal); }
.tag-quick-chip.is-on.tag-amber { background: var(--tag-amber-bg); color: var(--tag-amber); }
.tag-quick-chip.is-on.tag-violet { background: var(--tag-violet-bg); color: var(--tag-violet); }
.tag-quick-chip.is-on.tag-sky { background: var(--tag-sky-bg); color: var(--tag-sky); }
.tag-quick-chip.is-on.tag-rose { background: var(--tag-rose-bg); color: var(--tag-rose); }
.tag-quick-chip.is-on.tag-slate { background: var(--tag-slate-bg); color: var(--tag-slate); }
.tag-add-row { display: flex; flex-direction: column; gap: 8px; }
.tag-add-controls { display: flex; gap: 8px; align-items: stretch; }
.tag-add-controls input { flex: 1; min-width: 0; }
.tag-add-controls .btn-secondary { min-height: 40px; padding: 8px 14px; }
.tag-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-swatch {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  box-shadow: inset 0 0 0 1px rgba(28, 25, 23, 0.08);
  transition: transform 100ms ease;
}
.tag-swatch:hover { transform: scale(1.08); }
.tag-swatch[data-color="indigo"] { background: var(--tag-indigo); }
.tag-swatch[data-color="coral"] { background: var(--tag-coral); }
.tag-swatch[data-color="teal"] { background: var(--tag-teal); }
.tag-swatch[data-color="amber"] { background: var(--tag-amber); }
.tag-swatch[data-color="violet"] { background: var(--tag-violet); }
.tag-swatch[data-color="sky"] { background: var(--tag-sky); }
.tag-swatch[data-color="rose"] { background: var(--tag-rose); }
.tag-swatch[data-color="slate"] { background: var(--tag-slate); }
.tag-swatch.is-selected {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
  border-color: var(--bg);
}
.tag-hint {
  margin: 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-faint);
}
.tag-hint-gap { margin-bottom: 6px; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }

.bet-side {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  gap: 4px;
}
.bet-odds {
  font-weight: 700;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.bet-pnl {
  font-weight: 700;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.bet-profit-track { display: none; }
.bet-list.is-bars .bet-profit-track {
  display: block;
  grid-column: 1 / -1;
  height: 8px;
  margin-top: 6px;
  border-radius: 99px;
  background: var(--bg-soft);
  overflow: hidden;
}
.bet-list.is-bars .bet-profit-track span {
  display: block;
  height: 100%;
  border-radius: 99px;
  min-width: 0;
}
.bet-list.is-bars .bet-profit-track span.up { background: var(--chart-up); }
.bet-list.is-bars .bet-profit-track span.down { background: var(--chart-down); }
.bet-list.is-bars .bet-profit-track span.flat { background: var(--ink-faint); opacity: 0.45; }
.bet-list.is-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  align-items: stretch;
}
.bet-list.is-grid > .bet-row,
.bet-list.is-grid > .bet-row-wrap {
  min-width: 0;
  width: auto;
}
.bet-list.is-grid .bet-row-wrap { align-items: stretch; height: 100%; }
.bet-list.is-grid .bet-row {
  width: 100%;
  min-width: 0;
  height: 100%;
  align-content: start;
  grid-template-columns: minmax(0, 1fr);
}
.bet-list.is-grid .bet-selection,
.bet-list.is-grid .bet-meta { white-space: normal; }
.bet-list.is-grid .bet-side {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
  margin-top: 8px;
  gap: 6px 10px;
}
.bet-units {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-faint);
  margin-left: 4px;
}
.bet-slip-pills {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 4px;
  flex-shrink: 1;
  min-width: 0;
  max-width: 58%;
}
.bet-book-pill,
.bet-sub-pill {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--accent-ink);
  background: var(--primary-soft);
  padding: 2px 7px;
  border-radius: 999px;
  flex-shrink: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bet-sub-pill {
  background: transparent;
  border: 1px solid var(--primary);
}
.badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 6px;
  border-radius: 6px;
}
.badge.win { background: var(--win-soft); color: var(--win); }
.badge.loss { background: var(--loss-soft); color: var(--loss); }
.badge.push { background: var(--bg-soft); color: var(--push); }
.badge.pending { background: var(--amber-soft); color: var(--pending); }
.espn-flag {
  display: inline-block;
  margin-top: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--loss);
}
.detail-hero .espn-flag { margin: 0 0 6px 8px; vertical-align: middle; }
.detail-notes.espn-conflict {
  color: var(--loss);
  background: var(--loss-soft);
}

.empty-state {
  text-align: center;
  padding: 36px 18px 28px;
  color: var(--ink-muted);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.45);
}
.empty-mark {
  width: 42px;
  height: 42px;
  margin: 0 auto 10px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary);
}
.empty-mark svg {
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.empty-title { margin: 0 0 4px; font-size: 15px; font-weight: 700; color: var(--ink); letter-spacing: -0.02em; }
.empty-sub { margin: 0 auto; max-width: 360px; font-size: 13px; line-height: 1.45; }
.empty-cta { margin-top: 14px; width: auto; min-width: 140px; }
.empty-state.compact { padding: 18px 12px; border: 0; background: transparent; }

/* Form */
.bet-form { display: flex; flex-direction: column; gap: 12px; }
.field-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  min-width: 0;
  border: 1px solid var(--line);
}
.field-group legend {
  padding: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-ink);
}
label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-muted);
}
input, select, textarea {
  font: inherit;
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  min-height: 44px;
  transition: border-color var(--ease), box-shadow var(--ease), background var(--ease);
}
textarea { min-height: 72px; resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: var(--line-strong); }
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
  border-color: transparent;
  background: var(--bg-elevated);
}
input[readonly] { background: var(--bg-soft); color: var(--ink-muted); }
.optional { font-weight: 500; color: var(--ink-faint); }
.hint {
  margin: 0;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-muted);
  line-height: 1.45;
}
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.parlay-leg {
  display: grid;
  grid-template-columns: minmax(7.5rem, 0.9fr) minmax(0, 1.4fr) minmax(5.5rem, 0.6fr) auto;
  gap: 8px;
  align-items: end;
  margin-bottom: 8px;
}
.parlay-leg .link-btn { margin-bottom: 8px; }
#f-legs-wrap { margin-bottom: 12px; }
.detail-legs { margin: 8px 0 12px; }
.parlay-leg-list { margin: 4px 0 0; padding-left: 1.2rem; }
.parlay-leg-list li { margin: 2px 0; }
.parlay-leg-list span { color: var(--muted, #6b645c); font-size: 12px; margin-right: 6px; }
@media (max-width: 640px) {
  .parlay-leg { grid-template-columns: 1fr 1fr; }
  .parlay-leg label:nth-child(2) { grid-column: 1 / -1; }
}
.promo-check {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: var(--ink);
}
.promo-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0;
  accent-color: var(--primary);
}
.live-preview {
  font-size: 13px;
  color: var(--ink-muted);
  background: var(--primary-soft);
  border-color: transparent;
}
.live-preview strong { color: var(--ink); }

.btn-primary, .btn-secondary, .btn-danger {
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  border-radius: 10px;
  padding: 10px 14px;
  min-height: 42px;
  cursor: pointer;
  transition: background var(--ease), border-color var(--ease), color var(--ease), transform 100ms ease, box-shadow var(--ease);
}
a.btn-primary, a.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
}
.btn-block { width: 100%; display: block; }
a.btn-block { display: flex; }
.btn-primary {
  background: var(--primary);
  color: var(--on-primary);
  border: 1px solid var(--primary);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.38);
}
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-primary:active { transform: scale(0.985); }
.btn-secondary {
  background: var(--bg-elevated);
  color: var(--ink);
  border: 1px solid var(--line-strong);
}
.btn-secondary:hover { background: var(--bg-soft); border-color: #C9C0B4; }
.btn-secondary:active { transform: scale(0.985); }
.btn-danger {
  background: var(--loss-soft);
  color: var(--loss);
  border: 1px solid transparent;
}
.btn-danger:hover { background: #FBDADA; }
.btn-danger:active { transform: scale(0.985); }
.danger-gap { margin-top: 8px; }

.grade-note {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.4;
  font-weight: 600;
  color: var(--accent-ink);
}
.settings-odds-grade { margin-bottom: 10px; }

.tools-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  margin-bottom: 14px;
}
.tools-title {
  margin: 0 0 2px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.tools-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tools-actions .btn-primary,
.tools-actions .btn-secondary {
  width: auto;
  white-space: nowrap;
}

/* History */
.search-row { margin-bottom: 10px; }
.search-row input { width: 100%; }
.filters { margin-bottom: 10px; }
.filter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 4px;
}
.filter-grid label.filt-tag-label { grid-column: 1 / -1; }
.hist-summary {
  font-size: 12.5px;
  color: var(--ink-muted);
  margin: 0 0 8px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.history-sub-rail {
  margin: 0 0 12px;
  padding: 14px 14px 10px;
}
.history-sub-title {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.history-sub-rail > .hint { margin: 6px 0 0; }
.history-sub-totals {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 12px 0 4px;
}
.history-sub-total {
  min-width: 0;
  background: var(--bg-soft);
  border-radius: 10px;
  padding: 10px 12px;
}
.history-sub-total .k {
  margin: 0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.history-sub-total .v {
  margin: 4px 0 0;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.history-sub-total .s {
  margin: 2px 0 0;
  font-size: 12px;
  font-weight: 650;
  color: var(--ink-muted);
}
.history-sub-book {
  margin: 14px 0 4px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.history-sub-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1px 10px;
  width: 100%;
  margin: 0 0 4px;
  padding: 8px 8px 7px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.history-sub-row:hover { background: var(--primary-soft); }
.history-sub-row.is-on {
  background: var(--primary-soft);
  box-shadow: inset 3px 0 0 var(--primary);
}
.history-sub-name {
  font-size: 14px;
  font-weight: 800;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.history-sub-pnl {
  font-size: 14px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.history-sub-meta {
  grid-column: 1 / -1;
  font-size: 12px;
  font-weight: 650;
  color: var(--ink-muted);
}
.history-sub-bar {
  grid-column: 1 / -1;
  height: 6px;
  margin-top: 4px;
  border-radius: 99px;
  background: var(--bg-soft);
  overflow: hidden;
}
.history-sub-bar span {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: var(--chart-up);
}
.history-sub-bar span.down { background: var(--chart-down); }
.history-sub-bar span.flat { background: var(--ink-faint); }
@media (min-width: 1100px) {
  #view-history.active {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
    column-gap: 18px;
    align-items: start;
    max-width: none;
    width: 100%;
  }
  #view-history.active > .top-bar { grid-column: 1 / -1; }
  #view-history.active > .history-sub-rail {
    grid-column: 2;
    grid-row: 2 / span 8;
    position: sticky;
    top: 12px;
    max-height: calc(100dvh - 28px);
    overflow: auto;
    margin: 0;
  }
}

/* Accounts */
.accounts-block { margin-bottom: 12px; }
.account-total-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px 16px;
  margin-bottom: 10px;
  padding: 12px 14px;
  background: var(--bg-elevated);
  border-color: var(--line);
  box-shadow: inset 3px 0 0 var(--primary);
}
.account-total-main .stat-value { margin-top: 2px; }
.account-total-meta { display: flex; flex-direction: column; gap: 1px; }
.account-start-hint { margin: 0 0 0 auto; font-size: 11px; }
.account-risk {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-muted);
}
.account-books-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: thin;
  padding: 2px 1px 8px;
}
.account-books-scroll::-webkit-scrollbar { height: 6px; }
.account-books-scroll::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 99px; }
.book-account-card {
  flex: 0 0 auto;
  width: 156px;
  padding: 11px 12px;
  border-radius: 10px;
  cursor: default;
  transition: border-color var(--ease), box-shadow var(--ease), transform 110ms ease;
}
.book-account-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}
.book-account-card .book-name {
  margin: 0;
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.book-account-card .stat-value { margin-top: 6px; font-size: 17px; }
.book-account-card .book-pnl,
.book-account-card .book-risk {
  margin: 3px 0 0;
  font-size: 11px;
  font-weight: 600;
}
.book-account-card .book-risk { color: var(--ink-muted); font-weight: 500; }
.book-account-card .book-subs {
  margin: 4px 0 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.account-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.account-card.highlight { background: var(--primary-soft); border-color: transparent; }
.account-card .stat-value { margin-top: 4px; }
.account-delta { margin: 2px 0 0; font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.account-delta.pos, .book-pnl.pos { color: var(--win); }
.account-delta.neg, .book-pnl.neg { color: var(--loss); }
.account-delta.neu, .book-pnl.neu { color: var(--ink-muted); }

/* Slip upload */
.slip-upload-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.slip-preview-wrap { display: flex; flex-direction: column; gap: 8px; }
.slip-preview-wrap img,
.detail-slip img {
  max-width: 100%;
  max-height: 180px;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
}
.detail-slip { margin: 10px 0; }
.detail-slip img { max-height: 240px; }

/* Settings accounts */
.settings-accounts-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.settings-acct-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--bg-elevated);
}
.settings-acct-card .acct-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.settings-acct-card .acct-name { font-weight: 700; font-size: 13.5px; }
.settings-acct-card .acct-bal { font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.settings-acct-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.settings-acct-actions button { font-size: 12px; padding: 6px 8px; min-height: 32px; }
.acct-subs {
  margin: 0 0 10px;
  padding: 8px 8px 8px 10px;
  border-radius: 8px;
  background: var(--bg-soft);
  border-left: 3px solid var(--primary);
}
.acct-subs-kicker {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-ink);
}
.acct-subs-empty { margin: 0 0 8px; }
.acct-sub-list {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.acct-sub-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.acct-sub-name {
  flex: 1;
  min-width: 0;
  font-weight: 700;
  font-size: 13px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.acct-sub-add {
  display: flex;
  gap: 6px;
  align-items: center;
}
.acct-sub-add input {
  flex: 1;
  min-width: 0;
  min-height: 36px;
  font-size: 14px;
}
.acct-sub-add button,
.acct-sub-row button {
  font-size: 12px;
  padding: 6px 8px;
  min-height: 32px;
}
.account-add-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-end;
  margin-bottom: 4px;
}
.settings-label.grow { flex: 1; min-width: 160px; margin: 0; }
.settings-label.start-amt { width: 110px; margin: 0; }
#btn-add-account { align-self: flex-end; }

/* Period + metric */
.period-strip {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
  padding: 8px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.12), rgba(37, 99, 235, 0.03));
  border: 1px solid rgba(37, 99, 235, 0.16);
}
.period-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 1px;
}
.period-chips::-webkit-scrollbar { display: none; }
.period-chip {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: var(--bg-elevated);
  color: var(--ink-muted);
  padding: 0 12px;
  height: 32px;
  border-radius: 999px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--ease), border-color var(--ease), color var(--ease), transform 100ms ease, box-shadow var(--ease);
}
.period-chip:hover { border-color: var(--line-strong); color: var(--ink); }
.period-chip:active { transform: scale(0.97); }
.period-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}
.metric-toggle {
  display: inline-flex;
  align-self: flex-start;
  gap: 2px;
  padding: 2px;
  background: var(--bg-soft);
  border-radius: 9px;
  border: 1px solid var(--line);
}
.metric-btn {
  border: none;
  background: transparent;
  color: var(--ink-muted);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 0 11px;
  height: 28px;
  border-radius: 7px;
  cursor: pointer;
  min-width: 36px;
  transition: background var(--ease), color var(--ease), box-shadow var(--ease);
}
.metric-btn:hover { color: var(--ink); }
.metric-btn.active {
  background: var(--bg-elevated);
  color: var(--accent-ink);
  box-shadow: 0 1px 4px rgba(37, 99, 235, 0.2);
}

.pnl-hero {
  text-align: center;
  padding: 22px 16px;
  margin-bottom: 14px;
  background: linear-gradient(160deg, var(--hero-from) 0%, var(--hero-to) 100%);
  border: 1px solid rgba(37, 99, 235, 0.22);
}
.pnl-hero.compact {
  padding: 14px 14px 12px;
  margin-bottom: 12px;
  text-align: left;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 12px;
  align-items: center;
}
.pnl-hero.compact .stat-label { grid-column: 1 / -1; }
.pnl-hero.compact .stat-value { margin: 0; }
.pnl-hero.compact .pnl-sub { margin: 0; text-align: right; }
.pnl-hero .stat-value { margin: 8px 0; }
.pnl-hero-figures {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 22px;
  margin: 6px 0 4px;
}
.pnl-hero-figures > .stat-value { margin: 0; }
.pnl-roi {
  text-align: left;
  padding: 0 0 6px 16px;
  border-left: 2px solid rgba(37, 99, 235, 0.4);
}
.pnl-roi .stat-label { margin: 0; }
.pnl-roi .stat-value { margin: 0; font-size: 28px; line-height: 1.1; }
.stat-value.lg { font-size: 28px; line-height: 1.15; }
.pnl-sub { margin: 0; font-size: 14px; color: var(--ink-muted); font-weight: 600; }
.pnl-sub.pos { color: var(--win); }
.pnl-sub.neg { color: var(--loss); }
.pnl-record {
  margin-top: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-muted);
}

/* Month calendar */
.calendar-card {
  margin-bottom: 14px;
  padding: 14px;
}
.calendar-hero {
  padding: 16px 12px 18px;
  border: 1px solid rgba(37, 99, 235, 0.32);
  box-shadow: 0 12px 32px rgba(37, 99, 235, 0.14);
}
.calendar-hero .cal-month-label { font-size: 22px; }
.calendar-hero .cal-month-pnl { font-size: 18px; }
.calendar-hero .cal-day {
  min-height: 58px;
  border-radius: 14px;
}
.calendar-hero .cal-day .val { font-size: 11px; }
.home-overview {
  scroll-margin-top: 12px;
  outline: none;
}
.cal-top { margin-bottom: 12px; }
.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.cal-nav-btn {
  width: 32px;
  height: 32px;
  font-size: 20px;
  line-height: 1;
}
.cal-title-block { text-align: center; flex: 1; min-width: 0; }
.cal-month-label {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.cal-month-pnl {
  margin: 1px 0 0;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.cal-month-roi {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.cal-hint { margin-top: 4px; text-align: center; font-size: 12px; }
.cal-metric-toggle {
  display: flex;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-soft);
  flex-shrink: 0;
}
.cal-metric-btn {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-muted);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  padding: 6px 10px;
  cursor: pointer;
  transition: background var(--ease), color var(--ease), box-shadow var(--ease);
}
.cal-metric-btn.active {
  background: var(--bg-elevated);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(28, 25, 23, 0.08);
}
.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 4px;
  text-align: left;
  padding: 0 4px;
  font-size: 10px;
  font-weight: 700;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-day {
  aspect-ratio: auto;
  min-height: 52px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--bg-soft);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2px;
  padding: 5px 5px 4px;
  text-align: left;
  transition: transform 100ms ease, box-shadow var(--ease), filter var(--ease);
}
.cal-day:disabled {
  opacity: 0.28;
  cursor: default;
  background: transparent;
  color: var(--ink-faint);
}
.cal-day .d { font-size: 11px; font-weight: 700; line-height: 1; }
.cal-day .val {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.cal-day .dot { display: none; width: 4px; height: 4px; border-radius: 50%; }
.cal-day.pending-only .dot { display: block; }
.cal-day.win {
  background: var(--primary-soft);
  color: var(--accent-ink);
  border-color: rgba(37, 99, 235, 0.38);
}
.cal-day.win .dot { background: var(--primary); }
.cal-day.loss {
  background: var(--coral-soft);
  color: var(--loss);
  border-color: rgba(232, 93, 76, 0.2);
}
.cal-day.loss .dot { background: var(--loss); }
.cal-day.flat {
  background: var(--bg-soft);
  color: var(--ink-muted);
}
.cal-day.flat .dot { background: var(--ink-faint); }
.cal-day.pending-only {
  background: var(--amber-soft);
  color: var(--pending);
}
.cal-day.pending-only .dot { background: var(--pending); }
.cal-day.today { box-shadow: inset 0 0 0 1.5px var(--primary); }
.cal-day.selected { outline: 2px solid var(--primary); outline-offset: 1px; }
.cal-day:not(:disabled):hover { transform: translateY(-1px); filter: saturate(1.05); }
.cal-day:not(:disabled):active { transform: scale(0.97); }

.cal-day-section { margin-bottom: 12px; }

.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.mini-stat { padding: 10px 12px; }
.mini-stat .stat-value { margin-top: 4px; }
.summary-stats-grid .mini-stat:last-child { grid-column: 1 / -1; }

.explain-card h3 { margin: 0 0 8px; font-size: 13px; letter-spacing: -0.01em; }
.explain-card ul { margin: 0; padding-left: 16px; font-size: 12.5px; color: var(--ink-muted); }
.explain-card li { margin-bottom: 5px; }
.explain-card li:last-child { margin-bottom: 0; }

/* Analytics performance chart + personal stats */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.analytics-stage {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 8px;
}
.analytics-stage .profit-chart-card { order: 1; }
.analytics-stage .personal-stats { order: 2; }
.analytics-stage .analytics-rail { order: 3; }
.analytics-stage > .card,
.analytics-stage > .analytics-rail { min-width: 0; }
.analytics-rail .analytics-heading:first-child { margin-top: 0; }
.analytics-rail .analytics-heading { margin-top: 16px; }
.analytics-rail .hint { margin-top: 0; }
.profit-chart-card { padding: 14px 14px 12px; margin-bottom: 0; }
.profit-chart-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}
.profit-chart-titleblock { min-width: 0; }
.profit-chart-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  margin-left: auto;
}
.chart-filter select {
  appearance: none;
  background-color: var(--bg-soft);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  min-width: 108px;
  padding: 5px 28px 5px 10px;
  cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-muted) 50%),
    linear-gradient(135deg, var(--ink-muted) 50%, transparent 50%);
  background-position: calc(100% - 14px) 55%, calc(100% - 9px) 55%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.performance-kicker {
  margin: 10px 0 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-muted);
}
.performance-date { margin-left: 6px; color: var(--ink-faint); font-weight: 700; }
.profit-chart-net {
  margin: 2px 0 0;
  font-size: clamp(36px, 4.6vw, 52px);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}
.profit-chart-net.pos { color: var(--chart-up); }
.profit-chart-net.neg { color: var(--chart-down); }
.profit-chart-net.neu { color: var(--ink-muted); }
.profit-chart-daily {
  margin: 4px 0 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-muted);
}
.profit-chart-daily .pos { color: var(--chart-up); }
.profit-chart-daily .neg { color: var(--chart-down); }
.profit-chart-daily .daily-label,
.profit-chart-daily .daily-bets { color: var(--ink-muted); margin-right: 6px; }
.profit-chart-net-units {
  margin: 2px 0 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}
.expected-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-start;
  margin-top: 10px;
}
.expected-card {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 132px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--bg-soft);
}
.expected-swatch,
.expected-icon {
  flex-shrink: 0;
}
.expected-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: var(--series-ev);
}
.expected-icon.clv { color: var(--series-clv); }
.expected-icon svg { display: block; }
.expected-swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.expected-swatch.ev { background: var(--series-ev); }
.expected-swatch.clv { background: var(--series-clv); }
.expected-k {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-muted);
}
.expected-v {
  display: block;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: var(--chart-up);
}
.expected-v.neg { color: var(--chart-down); }
.expected-v.neu { color: var(--ink-muted); }
.profit-chart-toolbar { margin: 0; }
.clv-source-note { margin: 8px 2px 0; font-size: 12px; }
.chart-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
.chart-range {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--bg-soft);
  flex-shrink: 1;
  max-width: 100%;
}
.chart-range button {
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-muted);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  padding: 6px 8px;
  cursor: pointer;
}
.chart-range button.active {
  background: var(--primary);
  color: var(--on-primary);
}
.profit-chart-plot {
  position: relative;
  background: var(--bg);
  border-radius: 12px;
  padding: 4px 2px 2px;
  min-width: 0;
}
.chart-legend {
  position: absolute;
  top: 8px;
  left: 12px;
  z-index: 1;
  display: flex;
  gap: 12px;
  pointer-events: none;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-muted);
}
.chart-legend:empty { display: none; }
.legend-item { display: inline-flex; align-items: center; }
.legend-line {
  display: inline-block;
  width: 16px;
  height: 0;
  border-top: 2px solid var(--series-profit);
  margin-right: 5px;
}
.legend-line.ev { border-top-style: dashed; border-top-color: var(--series-ev); }
.legend-line.clv { border-top-style: dashed; border-top-color: var(--series-clv); }
.profit-chart-svg { width: 100%; height: auto; display: block; touch-action: manipulation; }
.profit-zero, .chart-zero { stroke: var(--ink-faint); stroke-width: 1.15; }
.chart-grid { stroke: var(--line); stroke-width: 1; }
.profit-axis, .chart-axis { fill: var(--ink-faint); font-size: 11px; font-weight: 700; }
.profit-hit, .chart-hit { fill: transparent; cursor: pointer; }
.chart-hit.is-on { fill: rgba(96, 165, 250, 0.1); }
.profit-bar.up, .wick-up { fill: var(--chart-up); }
.profit-bar.down, .wick-down { fill: var(--chart-down); }
.profit-bar.flat { fill: var(--ink-faint); }
.profit-col.is-on .profit-bar { stroke: var(--ink); stroke-width: 1.4; }
.series-profit, .series-profit-area, .series-ev, .series-clv, .wick-up, .wick-down, .series-dot, .chart-grid, .chart-zero, .chart-axis {
  pointer-events: none;
}
.series-profit-area { stroke: none; }
.profit-fill-start,
.profit-fill-end { stop-color: var(--chart-up); }
.analytics-rail .analytics-card {
  max-height: 280px;
  overflow: auto;
}
.series-profit {
  fill: none;
  stroke: var(--series-profit);
  stroke-width: 2.6;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.series-ev {
  fill: none;
  stroke: var(--series-ev);
  stroke-width: 1.8;
  stroke-dasharray: 7 5;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.series-clv {
  fill: none;
  stroke: var(--series-clv);
  stroke-width: 1.8;
  stroke-dasharray: 2.2 3.4;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.series-dot { fill: var(--bg-elevated); stroke: var(--series-profit); stroke-width: 2; }
.profit-chart-readout { margin: 8px 4px 0; min-height: 1.2em; }
html[data-theme="dark"] .profit-chart-card {
  background: #10192c;
  border-color: #243656;
}
html[data-theme="dark"] .chart-filter select {
  background-color: #1d4ed8;
  color: #fff;
  border-color: #2563eb;
  background-image: linear-gradient(45deg, transparent 50%, #fff 50%),
    linear-gradient(135deg, #fff 50%, transparent 50%);
}
html[data-theme="dark"] .expected-card {
  background: #17263f;
}
html[data-theme="dark"] .personal-stats {
  background: #091220;
  border-color: #18304e;
}
html[data-theme="dark"] .personal-clv-cell,
html[data-theme="dark"] .personal-clv-empty {
  background: #0e182a;
}
html[data-theme="dark"] .profit-chart-plot { background: #0d1628; }
html[data-theme="dark"] .series-dot { fill: #f8fafc; }

.personal-stats { padding: 16px 16px 14px; }
.personal-head { display: flex; align-items: center; gap: 12px; }
.personal-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--teal-soft);
  color: var(--teal);
  font-weight: 800;
  font-size: 18px;
  flex-shrink: 0;
}
.personal-id { flex: 1; min-width: 0; }
.personal-name {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.personal-role { margin: 1px 0 0; font-size: 12px; color: var(--ink-muted); font-weight: 650; }
.personal-kpis {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 0;
  margin: 14px 0 6px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.personal-kpi { min-width: 0; padding-right: 8px; }
.personal-kpi + .personal-kpi {
  border-left: 1px solid var(--line);
  padding-left: 10px;
}
.personal-kpi .k {
  margin: 0;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.personal-kpi { container-type: inline-size; }
.personal-kpi .v {
  margin: 4px 0 0;
  font-size: clamp(11px, 20cqi, 20px);
  font-weight: 800;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.personal-kpi .v,
.personal-row .v,
.personal-clv-cell .v {
  color: var(--accent-ink);
}
.personal-row .v.pos {
  color: var(--chart-up);
}
.personal-kpi .v.neg,
.personal-row .v.neg,
.personal-clv-cell .v.neg {
  color: var(--chart-down);
}
.personal-rows { margin-top: 4px; }
.personal-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 6px 0;
  font-size: 14px;
}
.personal-row .k { color: var(--ink-muted); font-weight: 650; }
.personal-row .v { font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; }
.personal-plus { color: var(--accent-ink); font-weight: 800; margin-left: 6px; font-size: 13px; }
.personal-clv-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 12px 0 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-muted);
}
.personal-info {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink-faint);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  cursor: help;
  padding: 0;
}
.personal-clv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.personal-clv-cell {
  background: var(--bg-soft);
  border-radius: 10px;
  padding: 10px 12px;
}
.personal-clv-cell .k { margin: 0; font-size: 11px; color: var(--ink-faint); font-weight: 700; }
.personal-clv-cell .v {
  margin: 4px 0 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.personal-clv-empty {
  margin: 8px 0 0;
  font-size: 13px;
  font-weight: 650;
  color: var(--ink-muted);
}
.personal-clv-empty {
  margin: 0;
  padding: 12px;
  border-radius: 10px;
  background: var(--bg-soft);
}
@media (min-width: 1180px) {
  #view-analytics { max-width: none; }
  .analytics-stage {
    display: grid;
    grid-template-columns: minmax(240px, 18vw) minmax(0, 1fr) minmax(260px, 22vw);
    align-items: stretch;
    gap: 18px;
    min-height: calc(100dvh - 196px);
  }
  .analytics-stage .personal-stats { order: 0; grid-column: 1; }
  .analytics-stage .profit-chart-card { order: 0; grid-column: 2; }
  .analytics-stage .analytics-rail { order: 0; grid-column: 3; }
  #view-analytics .personal-stats {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    padding: 26px 24px 22px;
  }
  #view-analytics .personal-name { font-size: 24px; }
  #view-analytics .personal-kpi .k { font-size: 12px; }
  #view-analytics .personal-kpi .v { font-size: clamp(11px, 20cqi, 22px); }
  #view-analytics .personal-row { font-size: 17px; padding: 10px 0; }
  #view-analytics .personal-clv-cell .v { font-size: 26px; }
  #view-analytics .profit-chart-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 18px 18px 14px;
  }
  #view-analytics .profit-chart-plot {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 240px;
  }
  #view-analytics #analytics-chart {
    flex: 1 1 auto;
    min-height: 200px;
  }
  #view-analytics #analytics-chart .profit-chart-svg {
    width: 100%;
    height: 100%;
    min-height: 200px;
  }
  #view-analytics .profit-chart-net { font-size: clamp(52px, 4.2vw, 76px); }
  #view-analytics .profit-chart-card > .hint { margin: 6px 0 0; font-size: 12.5px; line-height: 1.35; }
  #view-analytics .chart-axis { font-size: 13px; }
  #view-analytics .series-profit { stroke-width: 3.2; }
  #view-analytics .analytics-rail {
    display: flex;
    flex-direction: column;
    min-height: 100%;
  }
  #view-analytics .analytics-rail .analytics-heading { font-size: 18px; }
  #view-analytics .analytics-rail .analytics-card {
    flex: 1 1 0;
    max-height: none;
    min-height: 140px;
    overflow: auto;
  }
  #view-analytics .analytics-rail .analytics-label { font-size: 16px; }
  #view-analytics .analytics-rail .analytics-metrics .primary-metric { font-size: 18px; }
  #view-analytics .analytics-rail .analytics-row { padding: 14px 0; }
}

/* Analytics */
.analytics-heading {
  margin: 18px 0 8px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.section-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}
.section-toolbar .analytics-heading { margin: 0; }
.section-toolbar + .hint { margin-top: 4px; }
.analytics-bar-copy { flex: 1 1 auto; min-width: 0; }
.analytics-diverging {
  position: relative;
  height: 8px;
  margin-top: 7px;
  border-radius: 99px;
  background: var(--bg-soft);
  overflow: hidden;
}
.analytics-diverging-zero {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--ink-faint);
}
.analytics-diverging-fill { position: absolute; top: 0; bottom: 0; }
.analytics-diverging-fill.up {
  left: 50%;
  background: var(--chart-up);
  border-radius: 0 99px 99px 0;
}
.analytics-diverging-fill.down {
  right: 50%;
  background: var(--chart-down);
  border-radius: 99px 0 0 99px;
}
.analytics-diverging-fill.flat {
  left: calc(50% - 1px);
  width: 2px;
  background: var(--ink-faint);
}
.analytics-card { padding: 2px 14px; }
.analytics-card.is-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
  padding: 10px;
}
.analytics-card.is-grid .analytics-row {
  flex-direction: column;
  gap: 8px;
  height: 100%;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-soft);
}
.analytics-card.is-grid .analytics-row:last-child { border-bottom: 1px solid var(--line); }
.analytics-card.is-grid .analytics-metrics { text-align: left; }
.analytics-card.is-grid .analytics-empty { grid-column: 1 / -1; }
.analytics-block { margin-bottom: 10px; }
.analytics-block .stat-value.lg { margin: 4px 0; }
.analytics-metrics-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}
.analytics-metrics-row .stat-value { margin: 0; }
.analytics-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.analytics-split .analytics-block { margin-bottom: 0; }
.analytics-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.analytics-row:last-child { border-bottom: none; }
.analytics-label {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
}
.analytics-sub {
  margin: 2px 0 0;
  font-size: 12px;
  line-height: 1.35;
  color: var(--ink-muted);
  font-weight: 600;
}
.analytics-metrics {
  text-align: right;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.analytics-metrics .primary-metric {
  font-size: 15px;
  font-weight: 800;
}
.analytics-empty {
  margin: 0;
  padding: 14px 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-muted);
}
@media (max-width: 560px) {
  .profit-chart-top { flex-direction: column; }
  .profit-chart-side { align-items: flex-start; margin-left: 0; }
  .expected-cards { justify-content: flex-start; }
  .chart-controls { justify-content: flex-start; }
  .chart-range button { padding: 6px 7px; font-size: 11px; }
  .chart-legend { left: 8px; }
}
@media (max-width: 420px) {
  .analytics-split { grid-template-columns: 1fr; }
  .ext-banner { align-items: flex-start; }
  .ext-banner-actions { flex-direction: column; align-items: flex-end; }
}

/* Bottom nav — Home | Analytics | + | Summary | History */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(var(--nav-h) + var(--safe-b));
  padding: 6px 6px calc(6px + var(--safe-b));
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: flex-start;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  border-top: 2px solid var(--primary);
  z-index: 40;
}
.bottom-nav .nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  border: none;
  background: none;
  color: var(--ink-faint);
  font: inherit;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 0;
  min-height: 48px;
  min-width: 0;
}
.nav-item > span:last-child:not(.nav-add-circle) {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-item.active { color: var(--accent-ink); font-weight: 800; }
.nav-icon {
  font-size: 18px;
  line-height: 1;
  width: 32px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}
.nav-item.active .nav-icon {
  background: var(--primary-soft);
  color: var(--accent-ink);
}
.nav-add { position: relative; top: -6px; }
.nav-add-circle {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--on-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 400;
  line-height: 1;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.45);
}
.nav-item.nav-add.active .nav-add-circle,
.nav-item.nav-add:active .nav-add-circle {
  background: var(--primary-dark);
}
.nav-item.nav-add:hover .nav-add-circle,
.nav-item.nav-add:active .nav-add-circle,
.nav-item.nav-add.active .nav-add-circle { background: var(--primary-dark); }

/* Sheets */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(28, 25, 23, 0.38);
  animation: fade-in 140ms ease;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.sheet-panel {
  position: relative;
  width: 100%;
  max-height: 92dvh;
  overflow: auto;
  background: var(--bg);
  border-radius: 16px 16px 0 0;
  padding: 8px 16px calc(16px + var(--safe-b));
  box-shadow: 0 -10px 36px rgba(28, 25, 23, 0.16);
  animation: sheet-up 170ms var(--ease);
}
@keyframes sheet-up {
  from { transform: translateY(12px); opacity: 0.6; }
  to { transform: none; opacity: 1; }
}
.sheet-handle {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: var(--line-strong);
  margin: 4px auto 10px;
}
.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.sheet-head h2 { margin: 0; font-size: 18px; letter-spacing: -0.02em; }
.sheet-body { padding-bottom: 8px; }
.detail-hero {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
}
.detail-hero h3 { margin: 8px 0 4px; font-size: 18px; letter-spacing: -0.025em; }
.detail-sub { margin: 0; color: var(--ink-muted); font-size: 13px; }
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}
.detail-cell {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px;
}
.detail-cell .k,
.detail-slip .k {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 3px;
}
.detail-cell .v { margin: 0; font-size: 14.5px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.detail-notes {
  font-size: 13px;
  color: var(--ink-muted);
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 8px;
}
.sheet-actions { display: flex; flex-direction: column; gap: 10px; padding-top: 4px; }
.settle-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.settle-label { font-size: 12px; font-weight: 700; color: var(--ink-muted); margin-right: 2px; }
.chip {
  border: none;
  border-radius: 999px;
  padding: 7px 12px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  min-height: 34px;
  background: var(--bg-soft);
  color: var(--ink);
  transition: transform 100ms ease, filter var(--ease);
}
.chip:hover { filter: brightness(0.97); }
.chip:active { transform: scale(0.97); }
.chip.win { background: var(--win-soft); color: var(--win); }
.chip.loss { background: var(--loss-soft); color: var(--loss); }
.chip.push { background: var(--bg-soft); color: var(--push); }
.chip.pending { background: var(--amber-soft); color: var(--pending); }
.action-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.action-row-gap { margin-top: 8px; }
.settings-label { margin-bottom: 12px; }
.divider { border: none; border-top: 1px solid var(--line); margin: 16px 0; }
.settings-section {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-ink);
}
.sync-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  margin: 0 0 10px;
  background: var(--bg-elevated);
}
.sync-card h4 {
  margin: 0 0 4px;
  font-size: 15px;
  letter-spacing: -0.02em;
}
.sync-card .settings-label:last-of-type { margin-bottom: 8px; }
.sync-card .btn-primary { margin-top: 2px; }
.sync-card > div > .btn-primary { width: 100%; }
.sync-card button:disabled { opacity: 0.6; cursor: wait; }
.sync-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.sync-actions:not(:has(button:not([hidden]))) { display: none; }
.sync-actions[hidden],
.sync-card [hidden] { display: none !important; }
.sync-actions .btn-primary,
.sync-actions .btn-secondary {
  width: auto;
  flex: 1 1 140px;
}
.sync-status {
  min-height: 1.2em;
  margin: 8px 0 0;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-muted);
}
.sync-status.is-ok { color: var(--accent-ink); }
.sync-status.is-error { color: var(--loss); }
textarea.secret-input {
  -webkit-text-security: disc;
  text-security: disc;
}
.settings-label a, .hint a { color: var(--accent-ink); }

.theme-setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 4px;
}
.theme-setting .settings-section { margin-bottom: 4px; }
.theme-setting .hint { max-width: 36ch; }
.theme-switch {
  width: 52px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--switch-off);
  padding: 3px;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
}
.theme-switch-knob {
  display: block;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--switch-knob);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.25);
  transition: transform 0.15s ease;
}
.theme-switch.is-on {
  background: var(--primary);
  border-color: var(--primary);
}
.theme-switch.is-on .theme-switch-knob { transform: translateX(20px); }
.open-settled-grid { margin-bottom: 10px; }
.summary-stats-grid { margin-bottom: 14px; }

.toast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--nav-h) + var(--safe-b) + 12px);
  z-index: 80;
  max-width: min(440px, calc(100% - 24px));
  background: var(--ink);
  color: #fff;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 10px 28px rgba(28, 25, 23, 0.22);
  animation: toast-in 160ms var(--ease);
}
@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(6px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.toast.error { background: var(--loss); }
.toast.ok { background: var(--win); }

.snapshot-pick { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.snapshot-pick button {
  text-align: left;
  border: 1px solid var(--line);
  background: var(--bg-elevated);
  color: var(--ink);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--ease), border-color var(--ease);
}
.snapshot-pick button:hover { background: var(--primary-soft); border-color: #C7D7FB; }

@media (min-width: 640px) {
  body { background: var(--canvas); }
  #app {
    --app-max: 640px;
    margin-top: 28px;
    margin-bottom: 28px;
    min-height: calc(100dvh - 56px);
    border-radius: 24px;
    box-shadow: var(--shadow);
    background: var(--bg);
    overflow: hidden;
  }
  .bottom-nav {
    max-width: var(--app-max);
    border-radius: 0 0 24px 24px;
  }
  .view { padding: 20px 24px 12px; }
  .quick-stats { grid-template-columns: repeat(4, 1fr); }
  .summary-stats-grid { grid-template-columns: repeat(3, 1fr); }
  .filter-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 900px) {
  #app { --app-max: 720px; }
  .calendar-hero .cal-day { min-height: 72px; font-size: 15px; }
}

@media (min-width: 640px) {
  .period-strip {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .period-chips { flex: 1; min-width: 0; }
  .metric-toggle { align-self: center; flex-shrink: 0; }
  .cal-day { min-height: 52px; font-size: 14px; }
}


/* ---------- VigStamp capture widget (SlipSync-inspired) ---------- */
.vigstamp-widget {
  position: fixed;
  right: 14px;
  bottom: calc(var(--nav-h) + var(--safe-b) + 12px);
  z-index: 50;
  user-select: none;
  width: min(300px, calc(100vw - 24px));
  padding: 14px 14px 12px;
  background: var(--bg-elevated);
  color: var(--ink);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(28, 25, 23, 0.14);
  border: 1px solid var(--line);
  animation: view-in 180ms var(--ease);
}
.vigstamp-widget-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-faint);
  font-size: 13px;
  cursor: pointer;
  transition: background var(--ease), color var(--ease);
}
.vigstamp-widget-close:hover { background: var(--bg-soft); color: var(--ink); }
.vigstamp-widget-brand {
  margin: 0 0 8px;
  padding-right: 28px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--primary);
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.vigstamp-widget-msg {
  margin: 0 0 8px;
  font-size: 11px;
  line-height: 1.45;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ink-muted);
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.vigstamp-widget-note {
  margin: 0 0 10px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--ink-muted);
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.vigstamp-widget.is-dragging,
.vigstamp-widget.is-dragging .vigstamp-widget-brand,
.vigstamp-widget.is-dragging .vigstamp-widget-msg,
.vigstamp-widget.is-dragging .vigstamp-widget-note { cursor: grabbing; }
.vigstamp-widget-book {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-muted);
}
.vigstamp-widget input,
.vigstamp-widget textarea { user-select: text; }
.vigstamp-widget-book input[type="text"] {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-weight: 600;
  color: var(--ink);
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg);
}
.vigstamp-widget-lock {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  font-size: 11px;
}
.vigstamp-widget-cta { width: 100%; margin-bottom: 8px; }
.vigstamp-widget-upload {
  display: block;
  width: 100%;
  border: none;
  background: transparent;
  color: var(--primary);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 6px 2px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.vigstamp-widget-upload:hover { color: var(--primary-dark); }
.vigstamp-widget-report {
  display: block;
  margin-top: 6px;
  text-align: center;
  font-size: 12px;
  color: var(--ink-faint);
  text-decoration: none;
}
.vigstamp-widget-report:hover { color: var(--primary); }
.vigstamp-fab {
  position: fixed;
  right: 14px;
  bottom: calc(var(--nav-h) + var(--safe-b) + 12px);
  z-index: 48;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--bg-elevated);
  color: var(--primary);
  display: grid;
  place-items: center;
  box-shadow: 0 8px 20px rgba(28, 25, 23, 0.12);
  cursor: pointer;
  transition: transform 100ms ease, background var(--ease), border-color var(--ease);
}
.vigstamp-fab svg { stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.vigstamp-fab:hover { background: var(--primary-soft); border-color: #C7D7FB; }
.vigstamp-fab:active { transform: scale(0.96); }

/* ---------- Desktop ---------- */
@media (min-width: 860px) {
  html.tracker-open,
  html.tracker-open body { height: 100%; overflow: hidden; background: var(--bg); }
  #app {
    display: grid;
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
    height: 100dvh;
    min-height: 0;
    max-width: none;
    width: 100%;
    margin: 0;
    padding-bottom: 0;
    border-top: none;
    border-radius: 0;
    box-shadow: none;
    background: var(--bg);
    overflow: hidden;
  }
  .side-nav {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    overflow: auto;
    padding: 16px 12px 14px;
    background: var(--sidebar);
    border-right: 1px solid var(--line);
    position: sticky;
    top: 0;
  }
  .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin: 0 0 16px;
    padding: 4px 6px;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
    border-radius: 10px;
    transition: background var(--ease);
  }
  .brand:hover { background: var(--bg-soft); }
  .side-nav .brand-mark {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: var(--primary);
    display: grid;
    place-items: center;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.28);
    flex-shrink: 0;
  }
  .brand-copy { display: flex; flex-direction: column; min-width: 0; }
  .side-nav .brand-name {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
  }
  .side-nav .brand-tag { font-size: 11px; color: var(--ink-faint); font-weight: 600; }
  .side-nav-links { display: flex; flex-direction: column; gap: 2px; }
  .side-nav .nav-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    width: 100%;
    border: 0;
    background: transparent;
    color: var(--ink-muted);
    font: inherit;
    font-size: 13.5px;
    font-weight: 600;
    text-align: left;
    padding: 8px 10px;
    border-radius: 9px;
    cursor: pointer;
    transition: background var(--ease), color var(--ease), transform 100ms ease;
  }
  .side-nav .nav-item:hover { background: var(--bg-soft); color: var(--ink); }
  .side-nav .nav-item:active { transform: scale(0.985); }
  .side-nav .nav-item.active {
    background: var(--primary-soft);
    color: var(--primary-dark);
  }
  .side-nav .nav-item.side-add {
    margin-top: 10px;
    background: var(--primary);
    color: #fff;
    justify-content: center;
    min-height: 38px;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.24);
  }
  .side-nav .nav-item.side-add:hover { background: var(--primary-dark); color: #fff; }
  .side-nav .nav-item.side-add.active { background: var(--primary-dark); color: #fff; }
  .side-add-plus { font-size: 18px; font-weight: 500; line-height: 1; margin-top: -1px; }
  .side-foot { margin-top: auto; padding-top: 10px; }
  .side-settings {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    border: 0;
    background: transparent;
    color: var(--ink-muted);
    font: inherit;
    font-size: 13.5px;
    font-weight: 600;
    padding: 8px 10px;
    border-radius: 9px;
    cursor: pointer;
    transition: background var(--ease), color var(--ease);
  }
  .side-settings:hover { background: var(--bg-soft); color: var(--ink); }

  .shell-main {
    height: 100dvh;
    overflow: auto;
    padding-bottom: 0;
    background: var(--bg);
  }
  .view {
    max-width: 1080px;
    margin: 0 auto;
    padding: 22px 28px 48px;
  }
  #view-analytics {
    max-width: none;
    width: 100%;
    padding: 18px 22px 36px;
  }
  #view-analytics .top-bar { margin-bottom: 8px; }
  #view-analytics > .hint {
    margin: 0 0 12px;
    font-size: 12.5px;
    line-height: 1.35;
  }
  .bottom-nav { display: none; }
  .top-bar h1 { font-size: 24px; }
  .icon-btn.mobile-only, #btn-home-settings, #btn-summary-settings { display: none; }

  input, select, textarea { font-size: 14px; min-height: 38px; padding: 7px 10px; }
  .tag-add-controls .btn-secondary { min-height: 38px; }

  .home-layout {
    grid-template-columns: minmax(0, 1.45fr) minmax(260px, 0.7fr);
    gap: 12px;
    align-items: stretch;
  }
  .quick-stats { height: 100%; align-content: stretch; }
  .quick-stat { display: flex; flex-direction: column; justify-content: center; }

  .tools-card {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
  }
  .tools-copy { min-width: 0; }
  .tools-actions { flex-shrink: 0; justify-content: flex-end; }

  .bet-row.slip { align-items: center; padding: 10px 14px; }
  .bet-side {
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    min-width: 168px;
  }
  .bet-odds { min-width: 52px; }
  .bet-pnl { min-width: 76px; }

  .filter-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .filter-grid label.filt-tag-label { grid-column: auto; }

  .period-strip {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .metric-toggle { align-self: center; }
  #summary-period-strip .period-chip { height: 34px; padding: 0 14px; font-size: 13px; }

  #view-summary.active {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.72fr);
    grid-template-areas:
      "head head"
      "accounts accounts"
      "hero hero"
      "cal side"
      "day side";
    gap: 12px 14px;
    align-items: start;
    align-content: start;
  }
  #view-summary .top-bar { grid-area: head; }
  #view-summary .accounts-block { grid-area: accounts; }
  #view-summary .dash-panel { grid-area: hero; }
  #view-summary .calendar-card { grid-area: cal; margin-bottom: 0; }
  #view-summary .cal-day-section { grid-area: day; margin-bottom: 0; }
  #view-summary .summary-side { grid-area: side; }
  .summary-stats-grid { grid-template-columns: 1fr 1fr; }
  .summary-stats-grid .mini-stat:last-child { grid-column: auto; }
  .cal-day { min-height: 64px; padding: 6px 6px 5px; }
  .cal-day .val { font-size: 11px; }
  .stat-value.xl { font-size: 44px; }

  .bet-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 14px;
    align-items: start;
  }
  .bet-form > .form-span,
  .bet-form > .live-preview,
  .bet-form > .btn-primary { grid-column: 1 / -1; }

  .sheet { align-items: center; padding: 28px 20px; }
  .sheet-panel {
    width: min(640px, 100%);
    max-height: min(86dvh, 840px);
    border-radius: 16px;
    padding: 16px 18px 18px;
    box-shadow: 0 24px 60px rgba(28, 25, 23, 0.2);
    animation: sheet-pop 160ms var(--ease);
  }
  .sheet-panel-settings { width: min(560px, 100%); }
  .sheet-handle { display: none; }
  .toast, .vigstamp-widget, .vigstamp-fab { bottom: 22px; }
  .vigstamp-widget, .vigstamp-fab { right: 22px; }
}

@keyframes sheet-pop {
  from { opacity: 0; transform: translateY(8px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

@media (min-width: 1180px) {
  .view { max-width: 1120px; }
  .cal-day { min-height: 72px; }
  .quick-stats { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* Landing stays on screen until the tracker is opened. */
#app { display: none; }
html.tracker-open #app { display: block; }
#landing[hidden] { display: none !important; }

.landing {
  min-height: 100dvh;
  background:
    radial-gradient(900px 420px at 85% -10%, rgba(37, 99, 235, 0.16), transparent 60%),
    var(--bg);
  color: var(--ink);
}
.landing-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 18px 22px;
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
}
.landing-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-size: 18px;
}
.landing-brand img {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.28);
}
.landing-nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.landing-nav-btn { min-height: 38px; padding: 8px 14px; }
.landing-main {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}
.landing-hero { max-width: 760px; padding: 28px 0 12px; }
.landing-hero h1 {
  margin: 0 0 14px;
  font-size: clamp(40px, 6vw, 64px);
  line-height: 0.98;
  letter-spacing: -0.045em;
  font-weight: 800;
}
.landing-lede {
  margin: 0;
  max-width: 62ch;
  font-size: 18px;
  line-height: 1.5;
  color: var(--ink-muted);
}
.landing-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}
.landing-cta-primary { min-width: 160px; }
.landing-note {
  margin: 14px 0 0;
  max-width: 62ch;
  font-size: 13px;
  color: var(--ink-faint);
}
.landing-sync-note {
  color: var(--ink-muted);
  font-weight: 600;
}
.landing-slip {
  margin: 14px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--primary-soft);
  color: var(--accent-ink);
  font-weight: 700;
}
.landing-previews { margin-top: 28px; }
.landing-previews-head h2 {
  margin: 0 0 6px;
  font-size: clamp(26px, 3vw, 34px);
  letter-spacing: -0.04em;
}
.landing-previews-head p:last-child {
  margin: 0;
  max-width: 62ch;
  color: var(--ink-muted);
  font-size: 15px;
  line-height: 1.45;
}
.landing-preview-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 12px;
  margin-top: 14px;
  align-items: start;
}
.preview-analytics { grid-column: 1 / -1; }
.preview-stage {
  display: grid;
  grid-template-columns: minmax(168px, 0.82fr) minmax(0, 1.4fr) minmax(168px, 0.9fr);
  gap: 10px;
  align-items: stretch;
}
.preview-personal { padding: 12px 12px 10px; }
.preview-stage .personal-name { font-size: 15px; }
.preview-stage .personal-kpi .v { font-size: 15px; }
.preview-stage .personal-kpi .v.pos,
.preview-stage .personal-clv-cell .v.pos { color: var(--chart-up); }
.preview-stage .personal-row { font-size: 13px; padding: 5px 0; }
.preview-stage .personal-clv-cell .v { font-size: 16px; }
.preview-chart-panel { min-width: 0; }
.preview-analytics .preview-net { font-size: 34px; }
.preview-rail {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px 6px;
}
html[data-theme="dark"] .preview-rail {
  background: #0e182a;
  border-color: #18304e;
}
.preview-rail h4 {
  margin: 10px 0 0;
  font-size: 14px;
  letter-spacing: -0.02em;
}
.preview-rail h4:first-child { margin-top: 0; }
.preview-rail .hint { margin: 4px 0 0; font-size: 12px; line-height: 1.35; }
.preview-mini-list { margin-top: 4px; }
.preview-mini-list div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 0;
  border-top: 1px solid var(--line);
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.preview-mini-list .pos { color: var(--chart-up); }
.preview-mini-list .neg { color: var(--chart-down); }
.preview-expected { margin-top: 8px; }
.landing-subs { margin-top: 28px; }
.landing-sub-book {
  margin: 14px 0 8px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.landing-sub-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.landing-sub { padding: 12px 12px 14px; }
.landing-sub h3 {
  margin: 0 0 6px;
  font-size: 16px;
  letter-spacing: -0.02em;
}
.landing-sub p,
.landing-sub-uses p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 13px;
  line-height: 1.4;
}
.landing-sub-uses {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.landing-sub-uses article {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-elevated);
}
.landing-sub-uses h3 {
  margin: 0 0 6px;
  font-size: 14px;
  letter-spacing: -0.02em;
}
.landing-fake-field {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}
.landing-fake-field span {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.preview-card { padding: 14px 14px 12px; }
.preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.preview-head h3 {
  margin: 0;
  font-size: 16px;
  letter-spacing: -0.02em;
}
.preview-tag {
  flex-shrink: 0;
  border-radius: 999px;
  padding: 3px 8px;
  background: var(--primary-soft);
  color: var(--accent-ink);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.preview-cal-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.preview-month {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
}
.preview-month-pnl {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.preview-month-pnl span {
  margin-left: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-muted);
}
.preview-weekdays,
.preview-cal {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}
.preview-weekdays {
  margin-bottom: 4px;
  color: var(--ink-faint);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.preview-weekdays span { text-align: center; }
.preview-day {
  min-height: 36px;
  border-radius: 7px;
  border: 1px solid transparent;
  background: var(--bg-soft);
  color: var(--ink-muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.05;
  padding: 4px 3px 3px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
}
.preview-day small {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.preview-day.mute {
  background: transparent;
  border-color: transparent;
}
.preview-day.win {
  background: var(--primary-soft);
  color: var(--accent-ink);
  border-color: rgba(37, 99, 235, 0.38);
}
.preview-day.loss {
  background: var(--coral-soft);
  color: var(--loss);
  border-color: rgba(232, 93, 76, 0.28);
}
.preview-day.today { box-shadow: inset 0 0 0 1.5px var(--primary); color: var(--ink); }
.preview-chart-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.preview-chart-title {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
}
.preview-chart-head .hint { margin: 2px 0 0; }
.preview-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  max-width: 100%;
}
.preview-ranges {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--bg-soft);
}
.preview-ranges span {
  border-radius: 7px;
  padding: 5px 7px;
  color: var(--ink-muted);
  font-size: 11px;
  font-weight: 800;
}
.preview-ranges span.on {
  background: var(--primary);
  color: var(--on-primary);
}
.preview-chart-body {
  display: flex;
  align-items: center;
  gap: 10px;
}
.preview-chart { flex: 1 1 auto; min-width: 0; height: auto; display: block; }
.preview-zero { stroke: var(--ink-faint); stroke-width: 1.25; }
.preview-line {
  fill: none;
  stroke: var(--series-profit);
  stroke-width: 2.4;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.preview-net-wrap {
  flex: 0 0 auto;
  min-width: 92px;
  text-align: right;
  padding-left: 10px;
  border-left: 1px solid var(--line);
}
.preview-net-label {
  margin: 0;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.preview-net {
  margin: 1px 0 0;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}
.preview-net.pos { color: var(--chart-up); }
.preview-net.neg { color: var(--chart-down); }
.preview-net-units {
  margin: 2px 0 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-muted);
}
.preview-rows { margin-top: 8px; }
.preview-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  border-top: 1px solid var(--line);
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.preview-caption {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--ink-muted);
  font-weight: 600;
}
.preview-perf-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.preview-kicker {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
}
.preview-kicker span {
  margin-left: 6px;
  color: var(--ink-faint);
  font-weight: 700;
}
.preview-performance .preview-net { font-size: 40px; line-height: 1; }
.preview-daily {
  margin: 4px 0 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-muted);
}
.preview-daily .pos { color: var(--chart-up); }
.preview-daily span + span { margin-left: 6px; }
.preview-plot {
  position: relative;
  background: var(--bg);
  border-radius: 12px;
  padding: 2px 0 0;
}
.preview-plot .chart-legend { left: 54px; top: 4px; }
html[data-theme="dark"] .preview-plot { background: #0d1628; }
.preview-view-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.preview-view-row p {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
}
.preview-bars { margin-top: 8px; }
.preview-bar-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 58px;
  gap: 8px;
  align-items: center;
  padding: 5px 0;
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.preview-bar-track {
  height: 8px;
  border-radius: 99px;
  background: var(--bg-soft);
  overflow: hidden;
}
.preview-bar-track span {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: var(--chart-up);
}
.preview-bar-track span.down { background: var(--chart-down); }
.preview-bar-row .pos { color: var(--chart-up); text-align: right; }
.preview-bar-row .neg { color: var(--chart-down); text-align: right; }
.landing-showcase {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin-top: 12px;
  align-items: start;
}
.preview-slip-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 340px);
  gap: 12px;
  align-items: start;
}
.preview-odds-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.preview-odds-row div {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
}
.preview-odds-row span {
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.preview-odds-row strong {
  display: block;
  margin-top: 2px;
  font-size: 28px;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.preview-field-label {
  margin: 12px 0 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.preview-field-label-spaced { margin-top: 14px; }
.preview-exchanges,
.preview-books {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.preview-exchanges span,
.preview-books span {
  border-radius: 999px;
  padding: 4px 8px;
  background: var(--bg-soft);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}
.preview-exchanges span.on {
  background: var(--primary);
  color: var(--on-primary);
}
.preview-fee {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink-muted);
  font-weight: 650;
}
.preview-fee strong { color: var(--ink); }
.preview-oc .oc-split { grid-template-columns: 1fr 0.8fr 1.05fr; }
.preview-oc .oc-col { padding: 10px 8px 12px; }
.preview-oc .oc-figure { font-size: 26px; }
.preview-oc .oc-figure-cents { color: var(--oc-accent); }
.preview-oc .oc-extra-value { font-size: 22px; }
.preview-history { margin-top: 12px; }
.preview-history-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
  gap: 12px;
  align-items: start;
}
.preview-history-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.preview-history-list div {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  font-size: 13px;
  font-weight: 750;
}
.preview-history-list div span:first-child {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.preview-history-list strong {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}
.preview-main-tag {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.preview-history-rail {
  margin: 0;
  padding: 12px 12px 8px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.preview-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.preview-summary div {
  background: #0B1220;
  color: #F8FAFC;
  border-radius: 10px;
  padding: 8px 8px 9px;
}
.preview-summary .k {
  margin: 0;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #93A4C2;
}
.preview-summary .v {
  margin: 3px 0 0;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.preview-summary .v.pos { color: #4ADE80; }
.landing-ext {
  margin-top: 28px;
  padding: 18px 18px 16px;
}
.landing-ext h2 {
  margin: 0 0 8px;
  font-size: 22px;
  letter-spacing: -0.03em;
}
.landing-ext h3 {
  margin: 16px 0 6px;
  font-size: 16px;
  letter-spacing: -0.02em;
}
.landing-ext p {
  margin: 0;
  max-width: 68ch;
  color: var(--ink-muted);
  font-size: 15px;
  line-height: 1.5;
}
.landing-ext .hint { margin-top: 8px; }
.landing-download { margin-top: 14px; }
.install-steps {
  margin: 12px 0 0;
  padding-left: 1.25em;
  max-width: 68ch;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
}
.install-steps li { margin: 4px 0; }
.install-steps code,
.landing code {
  font-size: 0.92em;
  overflow-wrap: anywhere;
}
.settings-download { margin: 8px 0 4px; }
.sheet-body .install-steps { color: var(--ink-muted); }
.csv-guide {
  margin-top: 14px;
  padding: 12px 12px 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-elevated);
}
.csv-guide-title {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.csv-guide-title.spaced { margin-top: 14px; }
.csv-guide .install-steps { margin-top: 0; }
.csv-guide .hint { margin-top: 8px; }
.csv-header-row {
  margin: 8px 0 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--bg-soft);
  overflow-x: auto;
}
.csv-header-row code {
  font-size: 11.5px;
  color: var(--ink);
  white-space: nowrap;
}
.csv-cols {
  margin: 8px 0 4px;
  padding: 0;
  list-style: none;
}
.csv-cols li {
  margin: 0;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--ink-muted);
}
.csv-cols code {
  font-size: 0.92em;
  font-weight: 700;
  color: var(--ink);
}
.landing-csv-tip {
  margin: 16px 0 0;
  max-width: 68ch;
  color: var(--ink-muted);
  font-size: 14px;
  line-height: 1.45;
}
.landing-features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 28px;
}
.landing-feature h2 {
  margin: 0 0 6px;
  font-size: 16px;
  letter-spacing: -0.02em;
}
.landing-feature p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 14px;
  line-height: 1.45;
}
.landing-foot {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding: 8px 0 28px;
  color: var(--ink-faint);
  font-size: 13px;
  font-weight: 600;
}
.landing-foot-brand {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}
.landing-support {
  margin: 0;
  max-width: 62ch;
  color: var(--ink-muted);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
}
.landing-support-label {
  display: block;
  margin-bottom: 2px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.landing-support a,
.settings-support a {
  color: var(--accent-ink);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.landing-support a:hover,
.settings-support a:hover { color: var(--primary); }
.auth-dialog:not([hidden]) {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 20px;
}
.auth-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.46);
}
.auth-card {
  position: relative;
  width: min(440px, 100%);
  background: var(--bg-elevated);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px 20px 18px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
}
.auth-close { position: absolute; top: 12px; right: 12px; }
.auth-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}
.auth-brand img { width: 36px; height: 36px; border-radius: 10px; }
.auth-card h2 { margin: 0 0 6px; font-size: 26px; letter-spacing: -0.03em; }
.auth-copy { margin: 0 0 14px; color: var(--ink-muted); font-size: 14px; line-height: 1.45; }
.auth-modes {
  display: flex;
  gap: 4px;
  padding: 3px;
  margin-bottom: 12px;
  border-radius: 10px;
  background: var(--bg-soft);
}
.auth-mode {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  border-radius: 8px;
  min-height: 32px;
  cursor: pointer;
}
.auth-mode.active { background: var(--bg-elevated); color: var(--accent-ink); }
.auth-card label { margin-bottom: 10px; }
.auth-stay {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
}
.auth-stay input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 0;
  padding: 0;
  flex: 0 0 auto;
}
.auth-status { min-height: 1.2em; margin: 10px 0 0; font-size: 13px; font-weight: 600; color: var(--ink-muted); }
.auth-status.is-error { color: var(--loss); }
#auth-setup .hint { margin-bottom: 14px; }

@media (max-width: 980px) {
  .landing-sub-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .landing-sub-uses { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 800px) {
  .landing-features { grid-template-columns: 1fr; }
  .landing-preview-grid,
  .landing-showcase,
  .preview-stage,
  .preview-slip-layout,
  .preview-history-layout,
  .landing-sub-uses { grid-template-columns: 1fr; }
  .landing-sub-grid { grid-template-columns: 1fr 1fr; }
  .preview-chart-body { align-items: stretch; }
  .preview-net { font-size: 22px; }
  .preview-performance .preview-net { font-size: 36px; }
  .landing-nav { padding: 14px 14px; }
  .landing-nav-btn { padding: 8px 10px; }
  .landing-hero h1 { font-size: 36px; }
  .landing-foot-brand { flex-direction: column; align-items: flex-start; }
}
@media (min-width: 860px) {
  html.tracker-open #app { display: grid; }
}

/* Odds converter sits on New slip. Light uses the site white and blue; dark uses a navy panel. */
.odds-converter-corner { display: none; }
#view-add.active > .odds-converter-corner {
  display: block;
  width: min(460px, 100%);
  margin: 0 0 12px;
}
.odds-converter {
  --oc-bg: #ffffff;
  --oc-ink: #1e1b2e;
  --oc-muted: #5c6578;
  --oc-faint: #8a93a6;
  --oc-line: #d5e2f5;
  --oc-accent: #2563eb;
  --oc-chip: #eaf1fe;
  --oc-chip-ink: #1d4ed8;
  --oc-step: #e7f0fc;
  background: var(--oc-bg);
  color: var(--oc-ink);
  border: 1px solid var(--oc-line);
  border-top: 3px solid var(--oc-accent);
  border-radius: 12px;
  overflow: hidden;
  container-type: inline-size;
  user-select: none;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.08);
}
html[data-theme="dark"] .odds-converter {
  --oc-bg: #0b1220;
  --oc-ink: #f8fafc;
  --oc-muted: #c9d6ea;
  --oc-faint: #93a4c2;
  --oc-line: #1e3a8a;
  --oc-accent: #60a5fa;
  --oc-chip: #17233a;
  --oc-chip-ink: #dbeafe;
  --oc-step: #17233a;
  box-shadow: none;
}
.odds-converter input { user-select: text; }
@media (min-width: 1280px) {
  #view-add.active {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
    column-gap: 16px;
    align-items: start;
    max-width: 1180px;
  }
  #view-add.active > .top-bar,
  #view-add.active > #bet-form {
    grid-column: 1;
  }
  #view-add.active > .odds-converter-corner {
    grid-column: 2;
    grid-row: 1 / span 4;
    position: sticky;
    top: 16px;
    width: auto;
    margin: 0;
    max-height: calc(100dvh - 32px);
    overflow: auto;
    align-self: start;
  }
}
.oc-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px 14px 8px;
}
.oc-title {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--oc-muted);
}
.odds-converter .oc-text-btn {
  border: 0;
  background: transparent;
  color: var(--oc-accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0;
  min-height: 0;
  cursor: pointer;
  border-radius: 0;
}
.oc-split {
  display: grid;
  grid-template-columns: 1fr 0.85fr 1.15fr;
  border-top: 1px solid var(--oc-line);
}
.oc-col { padding: 12px 14px 14px; min-width: 0; }
.oc-col + .oc-col { border-left: 1px solid var(--oc-line); }
.oc-label {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--oc-muted);
}
.oc-mark {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--oc-accent);
}
.oc-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--oc-accent);
  display: inline-block;
}
.odds-converter .oc-figure,
.odds-converter .oc-stake {
  display: block;
  width: 100%;
  margin: 4px 0 2px;
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
  min-height: 0;
  border-radius: 0;
  font-weight: 650;
  letter-spacing: -0.04em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  color: var(--oc-ink);
}
.odds-converter .oc-figure { font-size: 34px; }
.odds-converter .oc-figure-pct,
.odds-converter .oc-figure-pct:hover,
.odds-converter .oc-figure-pct:focus,
.odds-converter .oc-figure-cents,
.odds-converter .oc-figure-cents:hover,
.odds-converter .oc-figure-cents:focus { color: var(--oc-accent); }
.odds-converter .oc-figure-am,
.odds-converter .oc-figure-am:hover,
.odds-converter .oc-figure-am:focus { color: var(--oc-ink); }
.odds-converter input:hover,
.odds-converter input:focus {
  border-color: transparent;
  background: transparent;
  outline: none;
  box-shadow: none;
}
.oc-am-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.oc-am-row .oc-figure { flex: 1; min-width: 0; }
.oc-steps { display: flex; gap: 6px; padding-top: 8px; flex-shrink: 0; }
.odds-converter .oc-step {
  width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  border: 1px solid var(--oc-line);
  background: var(--oc-step);
  color: var(--oc-ink);
  font-size: 18px;
  line-height: 1;
  border-radius: 8px;
  cursor: pointer;
}
.odds-converter .oc-step:hover { border-color: var(--oc-accent); color: var(--oc-accent); }
.oc-caption {
  margin: 2px 0 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--oc-faint);
}
.oc-try-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid var(--oc-line);
}
.oc-try-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--oc-muted);
}
.oc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.odds-converter .oc-chips button {
  border: 1px solid var(--oc-line);
  background: var(--oc-chip);
  color: var(--oc-chip-ink);
  font-size: 13px;
  font-weight: 700;
  padding: 5px 10px;
  min-height: 0;
  border-radius: 999px;
  cursor: pointer;
}
.odds-converter .oc-chips button.is-on {
  background: var(--oc-accent);
  border-color: var(--oc-accent);
  color: #fff;
}
.odds-converter .oc-chips button:hover { border-color: var(--oc-accent); }
.oc-more { margin-left: auto; }
.oc-extra {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--oc-line);
}
.oc-extra[hidden] { display: none; }
.oc-extra-cell { padding: 12px 14px; min-width: 0; }
.oc-extra-cell + .oc-extra-cell { border-left: 1px solid var(--oc-line); }
.oc-extra-value {
  margin: 4px 0 0;
  font-size: 28px;
  font-weight: 650;
  letter-spacing: -0.03em;
  color: var(--oc-ink);
  font-variant-numeric: tabular-nums;
}
.oc-pay {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--oc-line);
}
.odds-converter .oc-pay-cell {
  display: block;
  margin: 0;
  padding: 12px 12px 14px;
  min-width: 0;
  font-weight: 700;
  gap: 0;
  color: inherit;
}
.oc-pay-cell + .oc-pay-cell { border-left: 1px solid var(--oc-line); }
.odds-converter .oc-stake,
.oc-pay-value {
  margin: 6px 0 0;
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.03em;
  color: var(--oc-ink);
  font-variant-numeric: tabular-nums;
}
.oc-pay-total { color: var(--oc-accent); }
.bet-odds-dec {
  display: block;
  font-size: 11px;
  font-weight: 650;
  color: var(--ink-faint);
  letter-spacing: 0;
}
@container (max-width: 520px) {
  .oc-split { grid-template-columns: 0.9fr 0.72fr 1.5fr; }
  .odds-converter .oc-figure { font-size: 22px; }
  .oc-col { padding: 10px 8px 12px; }
  .oc-am-row { gap: 4px; }
  .oc-steps { gap: 4px; padding-top: 2px; }
  .odds-converter .oc-step {
    width: 24px;
    height: 24px;
    min-height: 24px;
    font-size: 15px;
  }
  .odds-converter .oc-stake,
  .oc-pay-value { font-size: 18px; }
  .oc-more { margin-left: 0; }
}
