:root {
  color-scheme: light;
  --bg: #f5f7fa;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --text: #202733;
  --muted: #687386;
  --border: #d7dde6;
  --border-strong: #b9c3d1;
  --blue: #2563eb;
  --blue-soft: #e8f0ff;
  --green: #148a4b;
  --green-soft: #e8f7ef;
  --amber: #a16207;
  --amber-soft: #fff5d6;
  --red: #bf2d2d;
  --red-soft: #ffecec;
  --shadow: 0 10px 30px rgba(24, 32, 44, 0.08);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
  display: flex;
  flex-direction: column;
}

.app-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  padding: 8px 14px 10px;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: #eef2f7;
  color: #273244;
  font-weight: 800;
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-size: 16px;
}

.brand div span {
  color: var(--muted);
  font-size: 12px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.auto-refresh {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  white-space: nowrap;
}

.status-pill,
.count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.status-pill.ok {
  border-color: #99d8b3;
  background: var(--green-soft);
  color: var(--green);
}

.status-pill.error {
  border-color: #f2a6a6;
  background: var(--red-soft);
  color: var(--red);
}

.status-pill.muted {
  color: var(--muted);
}

.app-shell {
  display: grid;
  grid-template-areas: "watch markets";
  grid-template-columns: minmax(300px, 380px) minmax(520px, 1fr);
  grid-template-rows: 1fr;
  gap: 14px;
  width: 100%;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 14px;
}

.app-shell.checklist-open {
  grid-template-areas: "watch markets";
  grid-template-columns: minmax(280px, 340px) minmax(520px, 1fr);
}

.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;
}

.check-wizard-dialog,
.check-result-dialog {
  width: min(560px, calc(100vw - 28px));
  max-height: min(88vh, 720px);
  border: 0;
  border-radius: 8px;
  background: transparent;
  padding: 0;
  color: var(--text);
}

.check-wizard-dialog::backdrop,
.check-result-dialog::backdrop {
  background: rgba(20, 27, 38, 0.48);
}

.wizard-frame,
.result-frame {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  max-height: min(88vh, 720px);
}

.wizard-progress-bar {
  height: 4px;
  margin: 0 0 12px;
  border-radius: 999px;
  background: #e8edf5;
  overflow: hidden;
}

.wizard-progress-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #3b82f6, #2563eb);
  transition: width 0.2s ease;
}

.wizard-body {
  min-height: 180px;
  padding: 4px 2px 8px;
}

.wizard-question {
  margin: 0 0 12px;
  font-size: 20px;
  line-height: 1.45;
  font-weight: 700;
}

.wizard-hint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.wizard-market-card {
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
}

.wizard-market-card strong {
  display: block;
  margin-bottom: 4px;
}

.wizard-market-card span {
  color: var(--muted);
  font-size: 12px;
}

.wizard-footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.wizard-footer.single-action {
  grid-template-columns: 1fr;
}

.wizard-answer-button {
  min-height: 48px;
  font-size: 16px;
  font-weight: 700;
}

.wizard-setup-grid {
  display: grid;
  gap: 10px;
}

.result-dialog-body {
  min-height: 120px;
}

.result-dialog-body.red-alert {
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fff5f5;
  padding: 14px;
}

.result-dialog-body.green-alert {
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  background: #f0fdf4;
  padding: 14px;
}

.result-dialog-body.amber-alert {
  border: 1px solid #fde68a;
  border-radius: 8px;
  background: #fffbeb;
  padding: 14px;
}

.result-dialog-body.caution-alert {
  border: 1px solid #fca5a5;
  border-radius: 8px;
  background: linear-gradient(135deg, #f0fdf4 0%, #fff5f5 100%);
  padding: 14px;
}

.result-dialog-title {
  margin: 0 0 8px;
  font-size: 22px;
  line-height: 1.2;
}

.result-dialog-calm {
  margin: 0 0 12px;
  color: #7f1d1d;
  font-size: 15px;
  line-height: 1.6;
}

.result-dialog-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.result-dialog-metrics div {
  padding: 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.result-dialog-metrics span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.result-dialog-metrics strong {
  display: block;
  margin-top: 4px;
  font-size: 20px;
}

.panel {
  min-width: 0;
  min-height: 0;
  height: auto;
  max-height: calc(100vh - 92px);
  overflow-y: auto;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.watch-panel {
  grid-area: watch;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 92px);
  max-height: calc(100vh - 92px);
  min-height: 0;
  overflow: hidden;
}

.watch-panel > .panel-heading {
  flex: 0 0 auto;
  margin-bottom: 10px;
}

.watchlist-scroll {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  margin-bottom: 10px;
  padding-right: 2px;
}

.watch-panel .watchlist-list {
  display: grid;
  gap: 8px;
  margin-bottom: 0;
}

.watch-panel .watchlist-list.empty-state {
  min-height: 120px;
}

.bankroll-panel {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(280px, 36vh);
  min-height: 0;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.bankroll-panel h2 {
  margin: 0;
  font-size: 14px;
  line-height: 1.2;
}

.bankroll-panel .compact-heading {
  margin-bottom: 0;
}

.open-bets-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}

.bankroll-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  padding: 6px 12px;
  color: var(--text);
  cursor: pointer;
}

.bankroll-chip strong {
  font-size: 15px;
}

.open-bets-list,
.ledger-list {
  display: grid;
  gap: 8px;
}

.open-bets-list.empty-state,
.ledger-list.empty-state {
  min-height: 72px;
}

.open-bet-card,
.ledger-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
}

.open-bet-head,
.ledger-item-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.open-bet-meta,
.ledger-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin: 8px 0;
  color: var(--muted);
  font-size: 12px;
}

.bankroll-dialog,
.settle-bet-dialog {
  width: min(560px, calc(100vw - 28px));
  max-height: min(88vh, 760px);
  border: 0;
  border-radius: 8px;
  background: transparent;
  padding: 0;
  color: var(--text);
}

.bankroll-dialog::backdrop,
.settle-bet-dialog::backdrop {
  background: rgba(20, 27, 38, 0.48);
}

.bankroll-adjust-form {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.ledger-section h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.result-dialog-metrics.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.markets-panel {
  grid-area: markets;
  height: calc(100vh - 92px);
}

.checklist-panel {
  grid-area: checklist;
  height: calc(100vh - 92px);
}

.checklist-panel.is-hidden {
  display: none;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 36px;
  margin-bottom: 12px;
}

.heading-title,
.heading-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.panel h1 {
  margin: 0;
  font-size: 17px;
  line-height: 1.2;
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.compact-field {
  margin-bottom: 8px;
}

.field span,
.section-title {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

input,
select,
.plain-input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 8px 10px;
  outline: none;
}

input:focus,
select:focus,
.plain-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-soft);
}

.inline-add {
  display: flex;
  align-items: end;
  gap: 8px;
  margin-bottom: 4px;
}

.inline-add .field {
  margin-bottom: 0;
}

.grow {
  flex: 1;
  min-width: 0;
}

.form-grid {
  display: grid;
  gap: 8px;
}

.form-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.fixture-context {
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
}

.fixture-context-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.fixture-context-title h2 {
  margin: 0 0 4px;
  font-size: 14px;
  line-height: 1.2;
}

.fixture-context-title strong {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.fixture-context-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.score-inline {
  font-size: 12px;
  color: var(--muted);
}

.fixture-metrics {
  margin-top: 10px;
}

.leisu-context {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.leisu-context-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 12px;
}

.leisu-context-head a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.leisu-metrics {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.live-statistics {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.live-statistics-head {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.live-statistics-table,
.head-to-head-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.live-statistics-table th,
.live-statistics-table td,
.head-to-head-table th,
.head-to-head-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  text-align: center;
}

.live-statistics-table th:first-child,
.live-statistics-table td:first-child,
.head-to-head-table th:first-child,
.head-to-head-table td:first-child {
  text-align: left;
}

.live-statistics-table th[scope="row"] {
  color: var(--muted);
  font-weight: 600;
}

.head-to-head-dialog {
  width: min(920px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  padding: 0;
  border: none;
  background: transparent;
}

.head-to-head-dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
}

.head-to-head-body {
  padding: 0 16px 16px;
  overflow: auto;
}

.head-to-head-table-wrap {
  overflow: auto;
}

.head-to-head-body.empty-state {
  padding: 16px;
  color: var(--muted);
  font-size: 13px;
}

.score-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 2px 0 10px;
}

.score-toolbar span {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.observation-toggle {
  justify-content: flex-start;
  margin-bottom: 10px;
}

.summary-strip {
  min-height: 34px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--muted);
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 700;
}

.observation-list {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.watchlist-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 28px;
  margin: 4px 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.watchlist-heading strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  min-height: 24px;
  border-radius: 8px;
  background: var(--blue-soft);
  color: #1642a5;
}

.compact-heading {
  margin-bottom: 8px;
}

.watchlist-list {
  display: grid;
  gap: 8px;
}

.observation-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.observation-card.muted-card {
  background: #fbfaf7;
}

.watchlist-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
  min-width: 0;
}

.watchlist-card.selected {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-soft);
}

.watchlist-card.pinned {
  background: #fffdf6;
}

.watchlist-switch {
  display: grid;
  gap: 5px;
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 9px;
  text-align: left;
}

.watchlist-switch:hover {
  background: #fbfdff;
}

.watchlist-card.selected .watchlist-switch {
  background: var(--blue-soft);
}

.watchlist-switch strong {
  overflow-wrap: anywhere;
  font-size: 14px;
}

.watchlist-brief,
.watchlist-market,
.watchlist-note {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.watchlist-market {
  font-weight: 700;
}

.watchlist-detail-state {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.watchlist-detail-state.loaded {
  color: var(--green);
}

.watchlist-detail-state.error {
  color: var(--red);
}

.watchlist-note {
  color: var(--amber);
}

.watchlist-more {
  border-top: 1px solid var(--border);
  padding: 0 9px 9px;
}

.watchlist-more summary {
  min-height: 32px;
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  list-style: none;
}

.watchlist-more summary::-webkit-details-marker {
  display: none;
}

.watchlist-more[open] summary {
  margin-bottom: 6px;
}

.observation-card-head,
.watchlist-card-head,
.observation-meta,
.observation-actions,
.watchlist-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.observation-card-head,
.watchlist-card-head {
  justify-content: space-between;
}

.level-badge,
.time-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 8px;
  padding: 3px 7px;
  font-size: 11px;
  font-weight: 800;
}

.level-badge {
  background: var(--blue-soft);
  color: #1642a5;
}

.time-badge {
  background: var(--panel-soft);
  color: var(--muted);
}

.english-name,
.observation-meta,
.market-summary {
  color: var(--muted);
  font-size: 12px;
}

.observation-meta {
  flex-wrap: wrap;
}

.market-summary {
  min-height: 30px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 6px 8px;
  font-weight: 700;
}

.market-summary.available {
  border-color: #99d8b3;
  background: var(--green-soft);
  color: var(--green);
}

.market-summary.none,
.market-summary.error {
  border-color: #f2a6a6;
  background: var(--red-soft);
  color: var(--red);
}

.market-summary.pending {
  border-color: #f3d086;
  background: var(--amber-soft);
  color: var(--amber);
}

.strength-summary {
  display: grid;
  gap: 5px;
  min-height: 72px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 8px;
}

.strength-summary div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.strength-summary span,
.strength-summary small {
  color: var(--muted);
  font-size: 11px;
}

.strength-summary strong {
  font-size: 12px;
}

.strength-summary p {
  margin: 0;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.strength-summary small {
  overflow-wrap: anywhere;
}

.strength-summary.ok {
  border-color: #99d8b3;
  background: var(--green-soft);
}

.strength-summary.watch,
.strength-summary.warning {
  border-color: #f3d086;
  background: var(--amber-soft);
}

.strength-summary.danger {
  border-color: #f2a6a6;
  background: var(--red-soft);
}

.observation-actions {
  align-items: stretch;
}

.watchlist-actions {
  flex-wrap: wrap;
  align-items: stretch;
}

.watchlist-card .plain-input {
  margin-top: 0;
}

.observation-actions .plain-input {
  margin-top: 0;
  min-width: 0;
}

.observation-actions button {
  min-width: 62px;
}

.watchlist-actions button {
  flex: 1 1 64px;
}

.primary-button,
.icon-button,
.secondary-button,
.wide-button,
.decision-button,
.danger-button {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 12px;
  font-weight: 700;
}

.icon-button {
  display: inline-grid;
  width: 36px;
  min-width: 36px;
  padding: 0;
  place-items: center;
  border-color: var(--border);
  background: #fff;
  color: var(--text);
  font-size: 22px;
  line-height: 1;
}

.primary-button,
.wide-button,
.decision-button {
  background: var(--blue);
  color: #fff;
}

.secondary-button {
  border-color: var(--border);
  background: #fff;
  color: var(--text);
}

.danger-button {
  border-color: #f2a6a6;
  background: var(--red-soft);
  color: var(--red);
}

.compact-button {
  min-height: 32px;
  padding: 6px 9px;
  white-space: nowrap;
}

.wide-button,
.decision-button {
  width: 100%;
}

.decision-button {
  margin-top: 4px;
  background: #1f7a46;
}

.primary-button:hover,
.wide-button:hover {
  background: #1d4ed8;
}

.decision-button:hover {
  background: #166137;
}

.secondary-button:hover {
  border-color: var(--border-strong);
  background: var(--panel-soft);
}

.icon-button:hover {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: #1642a5;
}

.danger-button:hover {
  border-color: var(--red);
  background: #ffdede;
}

button:disabled {
  cursor: default;
  opacity: 0.62;
}

.compact-metrics {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.compact-metrics div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 34px;
  border-top: 1px solid var(--border);
}

.compact-metrics span {
  color: var(--muted);
  font-size: 12px;
}

.compact-metrics strong {
  font-size: 12px;
  text-align: right;
}

.candidate-list {
  display: grid;
  gap: 8px;
}

.candidate-notes {
  margin: 0 0 4px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff8e6;
  color: #8a5b00;
  font-size: 13px;
  line-height: 1.45;
}

.candidate-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  width: 100%;
  min-height: 82px;
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: inherit;
  text-align: left;
}

.candidate-row:hover {
  border-color: var(--blue);
  background: #fbfdff;
}

.candidate-row.selected {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-soft);
}

.candidate-row.below-min-odds {
  border-style: dashed;
  background: #fffdf8;
}

.below-min-tag {
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #fff4e5;
  color: #9a6700;
  font-size: 11px;
  font-weight: 700;
}

.core-strategy-tag {
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #e8f5e9;
  color: #1b5e20;
  font-size: 11px;
  font-weight: 700;
}

.candidate-main {
  min-width: 0;
}

.candidate-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  min-width: 0;
  margin-bottom: 7px;
}

.candidate-title strong {
  overflow-wrap: anywhere;
  font-size: 15px;
}

.candidate-title span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.candidate-desc {
  color: var(--muted);
  font-size: 13px;
}

.odds-box {
  display: grid;
  align-content: start;
  justify-items: end;
  gap: 4px;
  min-width: 78px;
}

.odds-box span {
  color: var(--muted);
  font-size: 11px;
}

.odds-box strong {
  color: var(--blue);
  font-size: 22px;
  line-height: 1;
}

.empty-state {
  display: grid;
  min-height: 96px;
  place-items: center;
  border: 1px dashed var(--border-strong);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--muted);
  text-align: center;
}

.below-min {
  margin-top: 14px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

.below-min summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  color: var(--muted);
  font-weight: 700;
  list-style: none;
}

.below-min summary::-webkit-details-marker {
  display: none;
}

.below-min-list {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

.below-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  min-height: 54px;
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fffdf6;
}

.below-row strong {
  color: var(--amber);
}

.selected-market,
.result-panel {
  min-height: 76px;
  margin-bottom: 12px;
  padding: 10px;
  border-radius: 8px;
}

.muted-box {
  border: 1px dashed var(--border-strong);
  background: var(--panel-soft);
  color: var(--muted);
}

.selected-market.active {
  border: 1px solid #a9c1f5;
  background: var(--blue-soft);
  color: var(--text);
}

.selected-market strong {
  display: block;
  margin-bottom: 3px;
}

.check-section {
  margin: 12px 0;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.toggle-grid,
.chip-grid,
.radio-grid {
  display: grid;
  gap: 8px;
}

.toggle-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.chip-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.radio-grid {
  grid-template-columns: 1fr;
}

.toggle-grid label,
.chip-grid label,
.radio-grid label,
.segmented label {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 36px;
  cursor: pointer;
}

.toggle-grid input,
.chip-grid input,
.radio-grid input,
.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle-grid span,
.chip-grid span,
.radio-grid span,
.segmented span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 7px 9px;
  text-align: center;
}

.toggle-grid input:checked + span {
  border-color: #f0a0a0;
  background: var(--red-soft);
  color: var(--red);
  font-weight: 800;
}

.chip-grid input:checked + span,
.radio-grid input:checked + span {
  border-color: #91b2ff;
  background: var(--blue-soft);
  color: #1642a5;
  font-weight: 800;
}

.chip-grid label[data-counts="false"] span {
  color: var(--amber);
}

.plain-input {
  margin-top: 8px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.segmented input:checked + span {
  border-color: #80bf9b;
  background: var(--green-soft);
  color: var(--green);
  font-weight: 800;
}

.result-panel {
  margin-top: 12px;
  border: 1px solid var(--border);
  background: var(--panel-soft);
}

.result-panel.win {
  border-color: #8ed1aa;
  background: var(--green-soft);
}

.result-panel.stop {
  border-color: #f1abab;
  background: var(--red-soft);
}

.result-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.result-title strong {
  font-size: 18px;
}

.stake-number {
  color: var(--green);
  font-size: 24px;
  font-weight: 900;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 8px 0;
}

.result-grid div {
  min-height: 48px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.65);
  padding: 8px;
}

.result-grid span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.result-grid strong {
  font-size: 16px;
}

.final-reason {
  margin: 8px 0 0;
  color: #273244;
}

.error-text {
  color: var(--red);
  font-weight: 700;
}

.observation-dialog {
  width: min(920px, calc(100vw - 28px));
  max-height: min(86vh, 820px);
  border: 0;
  border-radius: 8px;
  background: transparent;
  padding: 0;
  color: var(--text);
}

.observation-dialog::backdrop {
  background: rgba(20, 27, 38, 0.42);
}

.dialog-frame {
  display: grid;
  grid-template-rows: auto auto minmax(160px, 1fr) auto;
  max-height: min(86vh, 820px);
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24);
  padding: 14px;
}

.dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.dialog-heading h2 {
  margin: 0 0 4px;
  font-size: 18px;
  line-height: 1.2;
}

.dialog-heading strong {
  display: block;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.dialog-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.dialog-toolbar-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.observation-card.picked {
  border-color: #9ec5ff;
  background: #f5f9ff;
}

.observation-pick {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.observation-pick input[type="checkbox"] {
  margin-top: 2px;
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  accent-color: var(--blue);
}

.observation-pick-body {
  flex: 1;
  min-width: 0;
}

.observation-dialog .observation-list {
  min-height: 160px;
  overflow-y: auto;
  padding-right: 2px;
}

.observation-dialog .inline-add {
  margin-top: 10px;
  margin-bottom: 0;
}

.mobile-shell-nav {
  display: none;
}

.mobile-shell-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
  color: var(--text);
  font-weight: 700;
  touch-action: manipulation;
}

.mobile-shell-tab.is-active {
  border-color: #93b4f6;
  background: var(--blue-soft);
  color: #1d4ed8;
}

.mobile-shell-badge {
  display: inline-grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 12px;
  line-height: 1;
}

@media (max-width: 1120px) {
  .app-shell,
  .app-shell.checklist-open {
    grid-template-areas:
      "watch"
      "markets"
      "checklist";
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    height: auto;
    overflow: visible;
  }

  .form-grid.four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .panel,
  .markets-panel,
  .watch-panel,
  .checklist-panel {
    height: auto;
    max-height: none;
    min-height: auto;
    overflow: visible;
  }
}

@media (max-width: 760px) {
  body.mobile-shell-active {
    padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px));
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .mobile-shell-nav {
    display: grid;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 6;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
  }

  .app-shell {
    grid-template-columns: 1fr;
    padding: 10px;
    overflow: visible;
    min-height: auto;
  }

  .watch-panel.mobile-hidden,
  .markets-panel.mobile-hidden {
    display: none !important;
  }

  .watch-panel:not(.mobile-hidden) {
    display: flex;
    flex-direction: column;
    min-height: calc(100dvh - 180px);
    overflow: hidden;
  }

  .markets-panel:not(.mobile-hidden) {
    min-height: calc(100dvh - 180px);
  }

  .watchlist-scroll {
    flex: 1 1 auto;
    min-height: 220px;
    max-height: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .bankroll-panel {
    flex: 0 0 auto;
    max-height: 34dvh;
  }

  .watchlist-switch {
    min-height: 48px;
    touch-action: manipulation;
  }

  .panel {
    min-height: auto;
  }

  .toggle-grid,
  .chip-grid {
    grid-template-columns: 1fr;
  }

  .dialog-toolbar,
  .inline-add {
    align-items: stretch;
    flex-direction: column;
  }
}

.mapping-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.6rem;
  margin: 0.35rem 0 0.5rem;
}

.mapping-picks .link-button,
.mapping-pick {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  padding: 0;
  text-align: left;
  text-decoration: underline;
}

.mapping-hint {
  color: var(--muted);
  font-size: 0.85rem;
}

.leisu-mapping-dialog {
  border: none;
  border-radius: 12px;
  max-width: min(520px, 92vw);
  padding: 0;
  width: 100%;
}

.leisu-mapping-dialog::backdrop {
  background: rgba(0, 0, 0, 0.45);
}

.leisu-mapping-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-height: min(50vh, 420px);
  overflow: auto;
  padding: 0.25rem 0;
}

.leisu-mapping-option {
  justify-content: flex-start;
  text-align: left;
  white-space: normal;
}

.leisu-mapping-empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.settings-button {
  font-size: 18px;
}

.settings-dialog {
  border: none;
  border-radius: 12px;
  max-width: min(520px, 92vw);
  padding: 0;
  width: 100%;
}

.settings-dialog::backdrop {
  background: rgba(0, 0, 0, 0.45);
}

.settings-section h3 {
  margin: 0 0 0.35rem;
  font-size: 15px;
}

.settings-hint {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.settings-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-height: min(50vh, 420px);
  overflow: auto;
}

.settings-list-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  width: 100%;
  min-height: 38px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  text-align: left;
}

.settings-list-item:hover {
  border-color: var(--border-strong);
  background: #f8fafc;
}

.settings-list-item strong {
  font-size: 14px;
}

.settings-list-item span {
  color: var(--muted);
  font-size: 12px;
}

.settings-list-item small {
  color: var(--blue);
  font-size: 12px;
}
