:root {
  --bg0: #0a0a0c;
  --bg1: #101014;
  --panel: #14141a;
  --panel2: #1a1a22;
  --line: #2a2a36;
  --text: #ffffff;
  --muted: #a8a8b3;
  --accent: #7719a0;
  --accent-dim: rgba(119, 25, 160, 0.22);
  --accent-bright: #c26dff;
  --jelly: #7719a0;
  --jelly-dim: rgba(119, 25, 160, 0.18);
  --money-pos: #00e676;
  --money-pos-dim: rgba(0, 230, 118, 0.14);
  --money-neg: #ff5252;
  --money-neg-dim: rgba(255, 82, 82, 0.12);
  --danger: #ff5252;
  --amber: #7dd3fc;
  --blue: #8ec5ff;
  --rad: 12px;
  --font: "DM Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --logo: "Oswald", Impact, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; overflow-x: clip; }
body {
  background:
    radial-gradient(1000px 480px at 8% -8%, rgba(119, 25, 160, 0.22) 0%, transparent 55%),
    radial-gradient(900px 420px at 92% 0%, rgba(119, 25, 160, 0.1) 0%, transparent 50%),
    linear-gradient(180deg, var(--bg0), var(--bg1) 45%, #07070a);
  color: var(--text);
  font: 14px/1.45 var(--font);
}

button, input, select {
  font: inherit;
  color: var(--text);
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 8px 11px;
}
button {
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    color 0.15s ease,
    filter 0.15s ease,
    box-shadow 0.15s ease;
}
button:not(:disabled):hover {
  border-color: color-mix(in srgb, var(--line) 30%, var(--jelly));
  background: color-mix(in srgb, var(--panel2) 78%, var(--jelly-dim));
}
button.primary {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
  font-weight: 700;
}
button.primary:not(:disabled):hover {
  background: #8e2bc0;
  border-color: transparent;
  box-shadow: 0 0 0 3px var(--jelly-dim);
}
button.ghost {
  background: transparent;
}
button.ghost:not(:disabled):hover {
  background: color-mix(in srgb, var(--panel2) 65%, var(--jelly-dim));
  color: var(--text);
  border-color: color-mix(in srgb, var(--line) 40%, var(--jelly));
}
button.active, .mode-bar button.active, .nav button.active, .storage-toggle button.active {
  border-color: var(--accent-bright);
  color: var(--accent-bright);
  background: var(--accent-dim);
}
button.active:not(:disabled):hover,
.mode-bar button.active:not(:disabled):hover,
.nav button.active:not(:disabled):hover,
.storage-toggle button.active:not(:disabled):hover {
  border-color: var(--accent-bright);
  color: #fff;
  background: color-mix(in srgb, var(--accent-dim) 80%, transparent);
}
button:disabled { opacity: 0.55; cursor: default; }

.settings-gear {
  width: 38px;
  height: 38px;
  min-width: 38px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
}
.settings-gear:not(:disabled):hover,
.settings-gear:focus-visible {
  color: #c26dff;
  border-color: color-mix(in srgb, var(--line) 25%, var(--jelly));
  background: color-mix(in srgb, var(--panel) 70%, var(--jelly-dim));
  outline: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(16, 16, 16, 0.92);
  backdrop-filter: blur(10px);
}
.brand {
  min-width: 0;
}
.oddsomatic-logo {
  display: inline-block;
  font-family: var(--logo);
  font-weight: 700;
  font-size: clamp(1.55rem, 3.2vw, 2.15rem);
  line-height: 1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-decoration: none;
  color: inherit;
}
.oddsomatic-logo .odds { color: #fff; }
.oddsomatic-logo .omatic { color: var(--jelly); }
.oddsomatic-logo .app {
  color: #fff;
  text-transform: none;
  letter-spacing: 0;
}
.oddsomatic-logo:hover .omatic { color: var(--accent-bright); }
.nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
}

.status {
  margin: 8px 16px 0;
  color: var(--blue);
  font-size: 13px;
}
.status:empty {
  display: none;
  margin: 0;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 8px 12px;
  align-items: start;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 8px 16px 24px;
  overflow-x: clip;
}
.mode-bar {
  grid-column: 1 / -1;
  grid-row: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px 16px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.mode-bar-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
}
.mode-bar-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.2;
}
.mode-bar-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}
.mode-bar-tabs button { padding: 7px 12px; font-size: 13.5px; }
.mode-bar-stats {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
}
.stats-toggle {
  flex: 0 0 auto;
  box-sizing: border-box;
  min-height: 32px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  border-radius: 8px;
}
.stats-toggle[aria-pressed="false"] {
  color: var(--accent-bright);
  border-color: color-mix(in srgb, var(--line) 45%, var(--accent-bright));
}
.stats-panel {
  display: flex;
  align-items: center;
  gap: 8px 10px;
  flex: 0 1 auto;
  min-width: 0;
  width: max-content;
  max-width: 100%;
}
.mode-bar.stats-hidden .stats-panel {
  display: none;
}
.period-field {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
}
.period-field select {
  box-sizing: border-box;
  min-height: 32px;
  height: 32px;
  padding: 0 9px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}
.period-field select:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--line) 40%, var(--accent-bright));
}
.workspace-board {
  grid-column: 1 / -1;
  grid-row: 2;
  display: grid;
  grid-template-columns: subgrid;
  grid-template-rows: auto auto;
  gap: 10px 12px;
  align-items: stretch;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: clip;
  scroll-margin-top: 72px;
}
.workspace-calc {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  min-height: 0;
  height: 100%;
  font-size: 15px;
}
.workspace-calc .results {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.workspace-calc .results > h2 {
  margin: 0 0 4px;
}
.results-outcome {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 10px;
  min-height: 0;
  padding: 0 0 8px;
}
.results-hint-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}
.results-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}
.results-actions button {
  padding: 8px 12px;
  font-size: 14px;
}
.results-hint-row .suggestion {
  flex: 1 1 12rem;
  min-width: 0;
  margin: 0;
  text-align: left;
}
.results-hint-row .suggestion:not(:empty) {
  justify-self: stretch;
  width: auto;
  max-width: none;
  margin-inline: 0;
}
.workspace-calc .results-save {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.workspace-board .calendar-panel {
  grid-column: 2;
  grid-row: 1;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
.workspace-board .table-panel {
  grid-column: 1 / -1;
  grid-row: 2;
  max-width: 100%;
  min-width: 0;
}
.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;
}

.sides {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: stretch;
  min-width: 0;
}
.hedge-cta,
#hedge-panel,
#bet-panel,
.results {
  min-width: 0;
}
.hedge-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 0;
  text-align: center;
  border-style: dashed;
  background: color-mix(in srgb, var(--panel) 85%, transparent);
}
.hedge-cta h2 {
  margin: 0;
  font-size: 1.05rem;
  max-width: 22ch;
  text-wrap: balance;
}
.hedge-cta p {
  margin: 0;
  max-width: 28ch;
  color: var(--muted);
  line-height: 1.45;
}
.hedge-cta[hidden],
#hedge-panel[hidden] {
  display: none !important;
}
#view-calc[data-calc-mode="straight"] #hedge-panel {
  display: none !important;
}
#view-calc[data-calc-mode="straight"] #hedge-cta {
  display: flex !important;
}
#view-calc:not([data-calc-mode="straight"]) #hedge-cta {
  display: none !important;
}
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--rad);
  padding: 8px 10px;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.workspace-calc .panel-head h2 { font-size: 16px; }
.section-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
}
.workspace-calc .results > h2.section-title,
.workspace-calc .panel-head .section-title {
  font-size: 16px;
}
.table-panel-head .section-title {
  font-size: 16px;
  color: var(--text);
}
.add-at-best {
  height: 42px;
  padding: 0 14px;
  font-size: 13.5px;
  align-self: end;
  flex: 0 0 auto;
}
.panel h2 { margin: 0; font-size: 15px; }
.muted { color: var(--muted); }
.nav-action {
  font-size: 13px;
  padding: 8px 12px;
}
.pos { color: var(--money-pos) !important; }
.neg { color: var(--money-neg) !important; }

.pane-meta {
  margin-bottom: 8px;
}
.pane-meta-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: end;
}
.market-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.market-field > span,
.market-field .field-label-with-tip {
  color: var(--muted);
}
.field-label-with-tip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.market-field input,
.market-field select {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  font-size: 15px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: normal;
  background: var(--panel2);
  border: 1px solid color-mix(in srgb, var(--line) 55%, var(--accent-bright));
  border-radius: 10px;
  color: var(--text);
}
.market-field select {
  cursor: pointer;
}
.market-field .market-output {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 0;
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: normal;
  color: var(--text);
  background: transparent;
  border: none;
  border-radius: 0;
  box-sizing: border-box;
}
.market-field input:focus,
.market-field select:focus {
  outline: none;
  border-color: var(--accent-bright);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.market-field input::placeholder {
  color: color-mix(in srgb, var(--muted) 75%, transparent);
  font-weight: 500;
}
.best-odds-field {
  width: auto;
}
.best-odds-field input {
  width: 96px;
  font-family: var(--mono);
  font-weight: 700;
  text-align: center;
  padding: 0 8px;
}
.help-tip-btn {
  width: 18px;
  height: 18px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-size: 11px;
  line-height: 1;
  text-transform: none;
  letter-spacing: normal;
  cursor: help;
}
.help-tip-btn:hover,
.help-tip-btn:focus-visible {
  color: var(--accent-bright);
  border-color: color-mix(in srgb, var(--line) 35%, var(--jelly));
  outline: none;
}
.workspace-calc .track-head.section-title { font-size: 14px; }
.workspace-calc .actions button { padding: 8px 12px; font-size: 14px; }
.rows { display: flex; flex-direction: column; gap: 6px; }
.bet-row {
  position: relative;
  display: grid;
  grid-template-columns: 48px minmax(88px, 140px) minmax(88px, 140px) 48px 48px;
  justify-content: center;
  gap: 8px;
  align-items: center;
  width: 100%;
  padding: 10px 28px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel2);
}
.bet-row .remove {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 2;
  width: 22px;
  height: 22px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  font-size: 15px;
}
.bet-row .remove.is-placeholder {
  opacity: 0;
  pointer-events: none;
}
.bet-row .odds,
.stake-wrap {
  width: 100%;
  min-width: 0;
  height: 48px;
  border: 1px solid #1a2a3d;
  border-radius: 6px;
  background:
    linear-gradient(180deg, #1a1a1a 0%, #0d0d0d 55%, #121212 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.bet-row .odds {
  padding: 0 6px;
  font-family: var(--mono);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  text-align: center;
  color: #f2f6fb;
}
.bet-row .odds:focus,
.stake-wrap:focus-within {
  border-color: var(--accent);
  outline: none;
}
.bet-row .odds::placeholder,
.stake-wrap .stake::placeholder {
  color: #3d5168;
  font-weight: 700;
}
.stake-wrap {
  position: relative;
  overflow: hidden;
}
.stake-prefix {
  position: absolute;
  left: 7px;
  top: 50%;
  transform: translateY(-50%);
  color: #6f849c;
  font: 700 0.9rem/1 var(--mono);
  pointer-events: none;
  user-select: none;
  z-index: 1;
}
.stake-wrap .stake {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0 6px 0 18px;
  outline: none;
  box-shadow: none;
  font-family: var(--mono);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: #f2f6fb;
}
.stake-wrap .stake:focus {
  outline: none;
  border: 0;
  box-shadow: none;
}
.bet-row.suggested {
  border-color: color-mix(in srgb, var(--line) 50%, var(--accent));
}
.bet-row.locked {
  border-color: color-mix(in srgb, var(--line) 55%, var(--money-pos, #3dd68c));
  background: color-mix(in srgb, var(--panel2) 90%, #3dd68c 6%);
  box-shadow: inset 3px 0 0 var(--money-pos, #3dd68c);
}
.bet-row.locked .odds,
.bet-row.locked .stake {
  color: var(--text);
  opacity: 0.92;
}
.book-select {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #141414;
  cursor: pointer;
  padding: 3px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.book-select:hover,
.book-select:focus-visible {
  border-color: color-mix(in srgb, var(--line) 30%, var(--jelly));
  background: color-mix(in srgb, #141414 75%, var(--jelly-dim));
  outline: none;
}
.book-select img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}
.book-select.is-empty {
  border-style: dashed;
  border-color: color-mix(in srgb, var(--line) 55%, var(--accent));
  background: color-mix(in srgb, #141414 88%, var(--accent-dim));
}
.book-select.has-book {
  border-style: solid;
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  background: var(--accent-dim);
}
.book-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  line-height: 1;
  user-select: none;
  pointer-events: none;
}
.book-empty-plus {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-bright);
  line-height: 1;
}
.book-empty-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.book-picker-backdrop {
  position: fixed;
  inset: 0;
  z-index: 79;
  background: transparent;
}
.book-picker {
  position: absolute;
  z-index: 80;
  display: grid;
  grid-template-columns: repeat(6, 36px);
  gap: 6px;
  max-width: min(280px, calc(100vw - 24px));
  max-height: 240px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #1a1a1a;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}
.book-picker .picker-icon {
  width: 36px;
  height: 36px;
  object-fit: contain;
  padding: 4px;
  border-radius: 8px;
  cursor: pointer;
  background: #141414;
  border: 1px solid transparent;
}
.book-picker .picker-icon:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
}
.bet-row .book-cell,
.bonus-cell,
.placed-cell {
  position: relative;
  width: 48px;
  height: 48px;
}
.bonus-toggle {
  width: 100%;
  height: 100%;
  padding: 4px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  border-style: dashed;
  border-color: color-mix(in srgb, var(--line) 55%, var(--accent));
  background: color-mix(in srgb, #141414 88%, var(--accent-dim));
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.bonus-toggle:hover,
.bonus-toggle:focus-visible {
  border-color: color-mix(in srgb, var(--line) 30%, var(--jelly));
  background: color-mix(in srgb, #141414 75%, var(--jelly-dim));
  outline: none;
}
.bonus-toggle[aria-pressed="true"] {
  border-style: solid;
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  background: var(--accent-dim);
  color: var(--accent-bright);
}
.bonus-face {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  line-height: 1;
  pointer-events: none;
  user-select: none;
}
.bonus-face-plus {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-bright);
  line-height: 1;
}
.bonus-toggle[aria-pressed="true"] .bonus-face-plus {
  display: none;
}
.bonus-face-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.bonus-toggle[aria-pressed="true"] .bonus-face-label {
  color: var(--accent-bright);
  font-size: 10px;
}
.placed-toggle {
  width: 100%;
  height: 100%;
  padding: 4px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  border-style: dashed;
  border-color: color-mix(in srgb, var(--line) 55%, var(--money-pos, #3dd68c));
  background: color-mix(in srgb, #141414 88%, transparent);
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.placed-toggle:hover,
.placed-toggle:focus-visible {
  border-color: color-mix(in srgb, var(--line) 30%, var(--money-pos, #3dd68c));
  background: color-mix(in srgb, #141414 78%, #3dd68c 8%);
  outline: none;
}
.placed-toggle[aria-pressed="true"] {
  border-style: solid;
  border-color: color-mix(in srgb, var(--money-pos, #3dd68c) 55%, transparent);
  background: color-mix(in srgb, var(--panel2) 70%, #3dd68c 18%);
  color: var(--money-pos, #3dd68c);
}
.placed-face {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
  pointer-events: none;
  user-select: none;
}
.placed-face-label {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
}
.placed-toggle[aria-pressed="true"] .placed-face-label {
  color: var(--money-pos, #3dd68c);
  font-size: 9px;
}
.bonus-gear,
.placed-help {
  position: absolute;
  right: -5px;
  bottom: -5px;
  z-index: 2;
  width: 20px;
  height: 20px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
}
.bonus-gear:hover,
.bonus-gear:focus-visible,
.placed-help:hover,
.placed-help:focus-visible {
  color: #c26dff;
  border-color: color-mix(in srgb, var(--line) 35%, var(--jelly));
  outline: none;
}
.placed-help {
  font-weight: 700;
}
.bonus-tip {
  position: absolute;
  z-index: 90;
  width: min(260px, calc(100vw - 24px));
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #1a1a1a;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  color: var(--text);
  font-size: 12.5px;
  line-height: 1.45;
}
.bonus-tip strong {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
}
.bonus-tip p {
  margin: 0;
  color: var(--muted);
}
.bonus-tip-backdrop {
  position: fixed;
  inset: 0;
  z-index: 89;
  background: transparent;
}

.track-block {
  margin: 8px 0 0;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.track-head {
  margin: 0 0 8px;
  font-size: 13px;
}
.track-sub {
  margin: 0 0 8px;
  font-size: 12px;
  line-height: 1.35;
}

.meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 8px;
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
.meta-grid .full { grid-column: 1 / -1; }
.meta-grid .market-field { width: 100%; }
.pl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0;
}
.pl-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 120px;
  padding: 18px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--panel2) 70%, #fff 4%), var(--panel2));
  text-align: center;
}
.pl-label {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.2;
}
.pl-value {
  display: block;
  margin: 0;
  font-family: var(--mono);
  font-size: clamp(1.45rem, 2.6vw, 1.95rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
}
.pl-pct {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  opacity: 0.85;
}
.suggestion {
  margin: 0;
  min-height: 0;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}
.suggestion:empty {
  display: none;
}
.suggestion:not(:empty) {
  justify-self: center;
  width: fit-content;
  max-width: 100%;
  margin-inline: auto;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--line) 70%, var(--jelly));
  background: color-mix(in srgb, var(--panel2) 80%, var(--jelly-dim));
  color: var(--accent-bright);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.35;
}
.actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 8px;
}
.actions button { padding: 6px 10px; }
.track-msg {
  margin-left: 4px;
  color: var(--accent-bright);
  font-size: 13px;
  font-weight: 600;
  min-height: 1.2em;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(6, auto);
  gap: 1px 12px;
  margin: 0;
  padding: 0;
  width: max-content;
  max-width: 100%;
  min-width: 0;
}
.metric {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  min-width: 0;
  text-align: right;
}
.metric span {
  color: #c4c4cf;
  font-size: 10.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.2;
  white-space: nowrap;
}
.metric b {
  display: block;
  margin: 0;
  font-size: 13.5px;
  font-family: var(--mono);
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  -webkit-font-smoothing: antialiased;
}
#profit,
#roi {
  font-size: 14px;
}

.calendar-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.compact-panel { padding: 8px 10px; }
.compact-panel .panel-head { margin-bottom: 6px; }
.compact-panel .panel-head h2 { font-size: 13px; }
.compact-panel .panel-head .ghost {
  padding: 2px 8px;
  min-height: 28px;
}
.calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.calendar-pickers {
  display: flex;
  gap: 6px;
  flex: 1;
  justify-content: center;
}
.calendar-pickers select {
  padding: 4px 8px;
  font-size: 13px;
  font-weight: 600;
}
.calendar-head, .calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
.calendar {
  flex: 1;
  grid-auto-rows: 1fr;
  min-height: 240px;
}
.calendar-head { color: var(--muted); font-size: 10px; text-align: center; margin-bottom: 2px; }
.day {
  position: relative;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px;
  background: var(--panel2);
  aspect-ratio: 1;
}
.day.empty { opacity: 0.25; }
.day.has { cursor: pointer; }
.day.profit { background: var(--money-pos-dim); border-color: rgba(0, 230, 118, 0.45); }
.day.loss { background: var(--money-neg-dim); border-color: rgba(255, 82, 82, 0.4); }
.day b {
  position: absolute;
  top: 4px;
  left: 5px;
  font-size: 11px;
  line-height: 1.1;
  font-weight: 600;
  color: var(--muted);
}
.day span {
  position: absolute;
  left: 50%;
  top: 54%;
  transform: translate(-50%, -50%);
  display: block;
  margin: 0;
  width: calc(100% - 6px);
  text-align: center;
  font-weight: 700;
  font-size: clamp(8px, 2.6vw, 14.5px);
  font-family: var(--mono);
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.day.profit span { color: var(--money-pos); }
.day.loss span { color: var(--money-neg); }
body.stats-hidden .day span {
  visibility: hidden;
}
.table-panel {
  overflow-x: auto;
  margin-top: 4px;
  scroll-margin-top: 72px;
  padding-top: 8px;
}
.table-panel-head {
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 8px 12px;
  margin: 0 0 8px;
  min-height: 0;
}
.table-panel-head h2 {
  margin: 0;
  padding: 0;
  font-size: 16px;
  line-height: 1.25;
  white-space: nowrap;
  align-self: flex-start;
}
.table-tools {
  display: flex;
  flex-direction: row;
  gap: 8px;
  align-items: center;
  flex-wrap: nowrap;
  margin-left: auto;
  min-width: 0;
  flex: 1 1 auto;
  justify-content: flex-end;
}
.table-count {
  white-space: nowrap;
  font-size: 13px;
  flex: 0 0 auto;
}
.table-tools .pending-alert {
  flex: 0 0 auto;
  padding: 5px 10px;
  font-size: 12.5px;
  line-height: 1.2;
}
.table-search {
  display: block;
  margin: 0;
  min-width: 140px;
  flex: 0 1 220px;
  max-width: 260px;
}
.table-search input {
  width: 100%;
  padding: 6px 10px;
}
table td.pos,
table td.neg {
  font-size: 15.5px;
  font-weight: 700;
  font-family: var(--mono);
  letter-spacing: -0.01em;
}
.pending-alert {
  flex: 0 1 auto;
  white-space: nowrap;
  color: #041018;
  background: var(--amber);
  border-color: var(--amber);
  font-weight: 700;
}
.pending-alert.none {
  color: var(--muted);
  background: var(--panel2);
  border-color: var(--line);
  font-weight: 500;
}
.pending-alert.active {
  outline: 2px solid color-mix(in srgb, var(--amber) 55%, #fff);
  outline-offset: 1px;
}
.table-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 8px;
  flex-wrap: wrap;
}
.table-pager .ghost:disabled {
  opacity: 0.4;
  cursor: default;
}
table { width: 100%; border-collapse: collapse; min-width: 900px; }
th, td {
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  text-align: left;
}
th { color: var(--muted); font-size: 12px; font-weight: 600; }
.pending-row { background: rgba(125, 211, 252, 0.07); box-shadow: inset 4px 0 0 var(--amber); }
.status-pending {
  display: inline-block;
  padding: 3px 8px;
  border: 1px solid var(--amber);
  border-radius: 999px;
  color: var(--amber);
  font-weight: 700;
}
.status-locked { color: var(--accent-bright); font-weight: 700; }
.books { display: flex; gap: 4px; flex-wrap: wrap; }
.books .book { width: 22px; height: 22px; object-fit: contain; }
.row-actions { display: flex; gap: 6px; align-items: center; }
.edit-bet { color: var(--blue); }
.remove-bet { color: #ff9aa5; }
.empty-state { text-align: center; padding: 48px 16px; color: var(--muted); }

dialog {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  color: var(--text);
  padding: 14px 16px;
}
dialog::backdrop { background: rgba(0, 0, 0, 0.72); }
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  flex-shrink: 0;
}
dialog h2 { margin: 0; }
dialog h3 { margin: 0; font-size: 14px; }

.settings-dialog {
  width: min(720px, calc(100% - 24px));
  max-height: calc(100vh - 28px);
  overflow: auto;
}
.books-dialog {
  width: min(780px, calc(100% - 24px));
  height: min(560px, calc(100vh - 28px));
  max-height: calc(100vh - 28px);
  overflow: hidden;
}
.books-dialog[open] {
  display: flex;
  flex-direction: column;
}
.books-help {
  margin: 0 0 10px;
  font-size: 12.5px;
  flex-shrink: 0;
}
.books-dialog .panel-head {
  gap: 8px;
  margin-bottom: 8px;
  flex-shrink: 0;
  align-items: center;
}
.books-dialog #sb-search {
  flex: 1;
  min-width: 0;
  margin: 0;
}
.settings-section {
  margin: 0;
  padding: 12px 0 0;
  border-top: 1px solid var(--line);
}
.settings-section.is-first {
  padding-top: 0;
  border-top: 0;
}
.settings-section .panel-head {
  margin-bottom: 6px;
}
.sb-actions { display: flex; gap: 6px; flex-shrink: 0; }
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
  gap: 6px;
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel2);
}
.book-cell {
  position: relative;
  width: 52px;
  height: 52px;
}
.book-cell .book-select {
  width: 100%;
  height: 100%;
}
.book-gear {
  position: absolute;
  right: -5px;
  bottom: -5px;
  z-index: 2;
  width: 20px;
  height: 20px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
}
.book-gear:hover,
.book-gear:focus-visible {
  color: #c26dff;
  border-color: color-mix(in srgb, var(--line) 35%, var(--jelly));
  outline: none;
}
.settings-icon {
  width: 40px;
  height: 40px;
  object-fit: contain;
  padding: 5px;
  border-radius: 9px;
  cursor: pointer;
  border: 1px solid transparent;
  background: #141414;
}
.settings-icon.enabled {
  border-color: color-mix(in srgb, var(--accent-bright) 55%, transparent);
  background: var(--accent-dim);
}
.settings-icon.disabled {
  filter: grayscale(1);
  opacity: 0.4;
}
.shortcut-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 6px 0 0;
}
.shortcut-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}
.shortcut-grid input {
  font-family: var(--mono);
  cursor: pointer;
  padding: 7px 9px;
}
.storage-toggle { display: flex; gap: 8px; margin: 8px 0; }
.account-line {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 4px;
}
#cloud-login label { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; color: var(--muted); font-size: 12px; }
.pin-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; }
.pin-row label { flex: 1; min-width: 120px; }
.notice { min-height: 1.2em; margin: 4px 0 0; color: var(--blue); font-size: 12.5px; }
.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  align-items: center;
}
.settings-version {
  margin-left: auto;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.donate-dialog {
  width: min(400px, calc(100vw - 24px));
}
.donate-body {
  font-size: 14px;
  line-height: 1.5;
}
.donate-body > p { margin: 0 0 14px; color: var(--muted); }
.donate-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  text-decoration: none;
  padding: 10px 14px;
  border-radius: 9px;
  font-weight: 700;
  background: var(--accent);
  color: #fff;
  border: 1px solid transparent;
}
.donate-cta:hover {
  background: #8e2bc0;
  color: #fff;
}

.welcome-dialog {
  width: min(440px, calc(100vw - 24px));
}
.welcome-body {
  font-size: 14px;
  line-height: 1.5;
}
.welcome-body > p { margin: 0 0 12px; }
.welcome-points {
  margin: 0 0 12px;
  padding-left: 1.2rem;
  color: var(--muted);
}
.welcome-points li { margin-bottom: 6px; }
.welcome-points strong { color: var(--text); }
.welcome-hint { margin: 0 0 14px; font-size: 13px; }
.welcome-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}
.welcome-check input {
  margin-top: 2px;
  width: 16px;
  height: 16px;
  accent-color: var(--jelly);
}
.welcome-actions {
  justify-content: flex-end;
}
.welcome-setting {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
  user-select: none;
}
.welcome-setting input {
  width: 16px;
  height: 16px;
  accent-color: var(--jelly);
}
.welcome-setting-hint {
  margin: 8px 0 10px;
  font-size: 12.5px;
  line-height: 1.4;
}
#welcome-show-now {
  align-self: flex-start;
}

.install-dialog {
  width: min(440px, calc(100vw - 24px));
}
.install-body {
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}
.install-body p { margin: 0 0 10px; }
.install-body ol {
  margin: 0 0 12px;
  padding-left: 1.25rem;
}
.install-body li { margin-bottom: 6px; }

.tour-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: none;
  background: transparent;
  pointer-events: auto;
}
.tour-overlay.is-open { display: block; }
.tour-overlay.is-dim {
  background: rgba(0, 0, 0, 0.82);
}
body.tour-open { overflow: hidden; }
.tour-spotlight {
  position: fixed;
  border-radius: 12px;
  border: 2px solid var(--accent-bright);
  box-shadow:
    0 0 0 9999px rgba(0, 0, 0, 0.82),
    0 0 0 4px rgba(194, 109, 255, 0.35),
    0 0 28px 2px rgba(194, 109, 255, 0.28);
  background: transparent;
  pointer-events: none;
  z-index: 1;
  transition: none;
}
.tour-spotlight.is-animating {
  transition: top 0.18s ease, left 0.18s ease, width 0.18s ease, height 0.18s ease;
}
.tour-card {
  position: fixed;
  z-index: 2;
  width: min(340px, calc(100vw - 24px));
  padding: 14px 14px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.5);
  color: var(--text);
}
.tour-progress {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11.5px;
  font-family: var(--mono);
}
.tour-card h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}
.tour-card p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.45;
}
.tour-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.tour-nav { display: flex; gap: 6px; }

@media (max-width: 1100px) {
  .mode-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .mode-bar-stats {
    margin-left: 0;
    width: 100%;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 10px;
  }
  .stats-panel {
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    width: auto;
    max-width: 100%;
    gap: 8px 10px;
  }
  .metrics {
    grid-template-columns: repeat(3, auto);
    gap: 4px 14px;
    width: max-content;
    max-width: 100%;
  }
  .metric { align-items: center; text-align: center; }
  .workspace {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
  }
  .mode-bar { grid-column: 1; grid-row: 1; min-height: 0; }
  .workspace-board {
    grid-column: 1;
    grid-row: 2;
    grid-template-columns: 1fr;
    grid-template-rows: none;
  }
  .workspace-calc {
    grid-column: 1;
    grid-row: auto;
    height: auto;
  }
  .sides { grid-template-columns: 1fr; }
  .workspace-board .calendar-panel {
    grid-column: 1;
    grid-row: auto;
  }
  .workspace-board .table-panel {
    grid-column: 1;
    grid-row: auto;
  }
}
@media (max-width: 700px) {
  .oddsomatic-logo {
    font-size: clamp(1.35rem, 7vw, 1.75rem);
  }
  .pane-meta-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .pane-meta-row .add-at-best {
    grid-column: 2;
  }
  .best-odds-field {
    grid-column: 1 / -1;
  }
  .best-odds-field input { width: 100%; }
  .add-at-best { width: 100%; }
  .bet-row {
    grid-template-columns: 44px minmax(0, 1fr) minmax(0, 1fr) 44px 44px;
  }
  .shortcut-grid { grid-template-columns: 1fr; }
  .calendar-pickers { flex-wrap: wrap; }
  .day {
    padding: 2px;
  }
  .day b {
    top: 2px;
    left: 3px;
    font-size: 9px;
  }
  .day span {
    font-size: clamp(7px, 2.4vw, 11px);
    width: calc(100% - 4px);
    letter-spacing: -0.04em;
  }
  .table-panel-head { flex-wrap: wrap; }
  .table-tools { flex-wrap: wrap; width: 100%; margin-left: 0; }
  .table-search { max-width: none; flex: 1 1 160px; }
  .meta-grid, .account-line { grid-template-columns: 1fr; }
}

/* —— Pikkit import page (unlisted) —— */
.pikkit-import-page .oddsomatic-logo {
  text-decoration: none;
  color: inherit;
}
.pikkit-import-page .nav-action {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.pikkit-import {
  max-width: 560px;
  margin: 28px auto 64px;
  padding: 0 16px;
}
.pikkit-import h1 {
  font-family: var(--logo);
  font-size: clamp(1.6rem, 4vw, 2rem);
  letter-spacing: 0.02em;
  margin: 0 0 8px;
}
.pikkit-import > .muted {
  margin: 0 0 20px;
  max-width: 42ch;
}
.pikkit-import code {
  font-family: var(--mono);
  font-size: 0.92em;
}
.pikkit-import-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--rad);
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.pikkit-import-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}
.pikkit-preview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
  margin: 0;
}
.pikkit-preview > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pikkit-preview dt {
  margin: 0;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.pikkit-preview dd {
  margin: 0;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 15px;
}
.pikkit-import-actions {
  display: flex;
  gap: 10px;
}
.pikkit-purge-card {
  margin-top: 18px;
}
.pikkit-purge-card h2 {
  font-family: var(--logo);
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  margin: 0 0 6px;
}
.pikkit-import .notice.is-error {
  color: var(--danger);
}
@media (max-width: 480px) {
  .pikkit-preview { grid-template-columns: 1fr; }
}
