:root {
  --bg: #edf3f9;
  --bg-soft: #f6f9fc;
  --panel: #ffffff;
  --panel-soft: #f8fbff;
  --panel-strong: #eef4fb;
  --border: #dbe5f0;
  --border-strong: #c7d5e6;
  --text: #16202d;
  --muted: #62748b;
  --accent: #ff0a54;
  --accent-soft: #ffe6ee;
  --success: #12946b;
  --success-soft: #def8ef;
  --warning: #c98a00;
  --warning-soft: #fff3d2;
  --danger: #d53f6a;
  --danger-soft: #fde5ec;
  --blue: #245dff;
  --blue-soft: #e8efff;
  --shadow: 0 18px 48px rgba(28, 48, 77, 0.08);
}

body.theme-dark {
  --bg: #0b1320;
  --bg-soft: #101b2a;
  --panel: #142132;
  --panel-soft: #17273b;
  --panel-strong: #1c3048;
  --border: rgba(163, 190, 226, 0.14);
  --border-strong: rgba(163, 190, 226, 0.24);
  --text: #ecf3ff;
  --muted: #98abc5;
  --accent: #ff4b79;
  --accent-soft: rgba(255, 75, 121, 0.15);
  --success: #55d5ab;
  --success-soft: rgba(85, 213, 171, 0.16);
  --warning: #ffd166;
  --warning-soft: rgba(255, 209, 102, 0.15);
  --danger: #ff86a0;
  --danger-soft: rgba(255, 134, 160, 0.15);
  --blue: #8ab0ff;
  --blue-soft: rgba(138, 176, 255, 0.16);
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", sans-serif;
  font-size: clamp(14px, 0.78vw, 16px);
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.25), transparent 220px),
    var(--bg);
}

button,
input,
select,
summary {
  font: inherit;
  color: inherit;
}

.app-shell {
  max-width: 1440px;
  margin: 0 auto;
  padding: 10px 12px 14px;
}

.app-header,
.brand-block,
.header-actions,
.sync-pill,
.controls-bar,
.status-filter-bar,
.hero-top,
.panel-head,
.match-row-head,
.match-title-line,
.match-secondary-line,
.match-signal-col,
.expanded-top,
.context-line,
.team-card-head,
.analysis-block-head,
.prob-head,
.detail-stat-values,
.acc-row,
.accumulator-stats {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-actions {
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.header-actions .top-tabs {
  order: 3;
  margin-left: 2px;
}

.header-actions .top-tab {
  padding: 5px 10px;
  font-size: 0.8rem;
}

.app-header {
  justify-content: space-between;
  margin-bottom: 10px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.app-header h1 {
  font-size: clamp(1.75rem, 2vw, 2.5rem);
}

.app-header h1,
.hero-panel h2,
.panel-head h3,
.team-card h5,
.analysis-block h5 {
  margin: 0;
}

.header-subtitle,
.panel-note,
.panel-summary,
.muted-line,
.inline-note,
.status-copy,
.match-secondary-line,
.summary-card small,
.fact-item span,
.detail-stat-card span,
.acc-stat-card span {
  color: var(--muted);
}

.panel-summary {
  display: flex;
  align-items: center;
  gap: 12px;
}

.panel-summary .theme-btn {
  white-space: nowrap;
}

#betImportHint {
  margin-top: 8px;
  font-size: 0.8rem;
}

.header-subtitle,
.panel-note {
  margin: 3px 0 0;
  font-size: 0.84rem;
}

.header-subtitle {
  display: none;
}

.sync-pill,
.theme-btn,
.panel,
.league-group {
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.sync-pill,
.theme-btn {
  border-radius: 999px;
}

.sync-pill {
  padding: 7px 12px;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--success);
}

.theme-btn {
  padding: 7px 12px;
  cursor: pointer;
}

.dashboard {
  display: grid;
  gap: 12px;
}

.panel {
  padding: 10px 12px;
  border-radius: 16px;
}

.compact-helper-panel {
  order: 20;
  position: sticky;
  bottom: 10px;
  z-index: 12;
  padding: 0;
  overflow: hidden;
}

.hero-panel {
  display: grid;
  gap: 6px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  min-width: min(720px, 100%);
}

.compact-stats {
  min-width: 0;
}

.stat-card {
  padding: 7px 10px;
  border-radius: 10px;
  background: var(--panel-soft);
  border: 1px solid var(--border);
}

.stat-card span {
  display: block;
  font-size: 0.74rem;
  color: var(--muted);
}

.stat-card strong {
  display: block;
  margin-top: 2px;
  font-size: 1.02rem;
}

.controls-bar {
  flex-wrap: nowrap;
  align-items: center;
  display: contents;
}

.toolbar-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.62fr) auto auto minmax(0, 1.28fr);
  gap: 4px;
  align-items: center;
}

.search-box,
.field {
  display: grid;
  gap: 6px;
}

.search-box {
  min-width: 0;
}

.field span {
  font-size: 0.84rem;
  color: var(--muted);
}

.search-box input,
.field input,
.field select {
  width: 100%;
  padding: 6px 9px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  outline: none;
}

.search-box input::placeholder {
  color: #90a2ba;
}

.switch-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 7px;
  min-width: 0;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--panel-soft);
  white-space: nowrap;
}

.switch-toggle input,
.row-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch-slider {
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: var(--border-strong);
  position: relative;
  flex: 0 0 auto;
  transition: background 0.18s ease;
}

.switch-slider::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 10px rgba(22, 32, 45, 0.18);
  transition: transform 0.18s ease;
}

.switch-toggle input:checked + .switch-slider,
.row-switch input:checked + .switch-slider {
  background: var(--accent);
}

.switch-toggle input:checked + .switch-slider::after,
.row-switch input:checked + .switch-slider::after {
  transform: translateX(18px);
}

.switch-copy,
.switch-copy strong {
  display: block;
  font-size: 0.78rem;
}

.status-filter-bar {
  flex-wrap: wrap;
}

.compact-status-bar {
  display: flex;
  align-content: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}

.filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--panel-strong);
  border: 1px solid var(--border);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--muted);
}

.compact-status-bar::-webkit-scrollbar {
  display: none;
}

.status-filter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  border: 1px solid var(--border);
  background: var(--panel-soft);
  color: var(--muted);
  border-radius: 999px;
  padding: 3px 9px;
  font-weight: 700;
  cursor: pointer;
  font-size: 0.74rem;
  line-height: 1;
  white-space: nowrap;
}

.status-filter.active {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: rgba(255, 10, 84, 0.18);
}

.bet-inline-action {
  font-weight: 800;
  color: var(--blue);
  background: var(--blue-soft);
  border-color: rgba(36, 93, 255, 0.18);
}

#betFilters {
  justify-content: flex-start;
  gap: 4px;
  margin-bottom: 0;
}

#betFilters .status-filter {
  min-height: 30px;
  padding: 4px 9px;
  font-size: 0.76rem;
}

#betFilters .bet-inline-action {
  color: var(--text);
  background: var(--panel-soft);
  border-color: var(--border);
}

#betFilters .bet-inline-action:hover {
  background: var(--blue-soft);
  border-color: rgba(36, 93, 255, 0.18);
  color: var(--blue);
}

.bet-toolbar #betFilters {
  justify-content: flex-end;
}

.panel-head {
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 14px;
}

.matches-list {
  display: grid;
  gap: 14px;
}

.league-group {
  overflow: hidden;
  border-radius: 20px;
}

.league-group > summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 16px;
  background: var(--panel-soft);
  border-bottom: 1px solid var(--border);
}

.league-group > summary::-webkit-details-marker {
  display: none;
}

.league-summary {
  justify-content: space-between;
}

.league-summary-line {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  width: 100%;
  white-space: nowrap;
}

.league-summary-line strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.league-summary span {
  color: var(--muted);
  font-size: 0.86rem;
}

.mini-pill,
.time-pill,
.score-pill,
.inline-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.time-pill,
.score-pill,
.inline-chip,
.mini-pill {
  background: var(--panel-strong);
  border: 1px solid var(--border);
}

.score-pill.live-score {
  background: rgba(255, 94, 94, 0.12);
  border-color: rgba(255, 94, 94, 0.45);
  color: #cf3b3b;
  box-shadow: 0 0 0 1px rgba(255, 94, 94, 0.1), 0 0 10px rgba(255, 94, 94, 0.12);
}

.match-row.live .score-pill.live-score {
  font-weight: 800;
}

.league-meta-inline {
  flex: 0 0 auto;
}

.success-pill,
.success-chip {
  background: var(--success-soft);
  color: var(--success);
  border-color: transparent;
}

.warning-pill {
  background: var(--warning-soft);
  color: #8d6500;
  border-color: transparent;
}

body.theme-dark .warning-pill {
  color: #f0d178;
}

.info-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  margin-left: 4px;
  border-radius: 50%;
  border: 1px solid currentColor;
  font-size: 0.66rem;
  font-weight: 800;
  line-height: 1;
}

.limited-hint {
  color: var(--warning);
  font-size: 0.72rem;
  font-weight: 700;
}

.mini-help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-left: 4px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--panel-strong);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  cursor: help;
}

.chance-hint {
  color: var(--muted);
  font-size: 0.72rem;
}

.danger-chip {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: transparent;
}

.league-list {
  display: grid;
}

.match-row {
  display: grid;
  gap: 0;
  border-bottom: 1px solid var(--border);
  transition: background 0.18s ease;
}

.match-row:last-child {
  border-bottom: 0;
}

.match-row.active {
  background: var(--blue-soft);
}

.match-row.live {
  border-left: 3px solid var(--accent);
}

.match-row.chance-high {
  border-left: 3px solid rgba(30, 160, 90, 0.7);
}

.match-row.chance-high .match-row-head {
  background: rgba(30, 160, 90, 0.08);
}

.match-row.chance-medium {
  border-left: 3px solid rgba(201, 138, 0, 0.6);
}

.match-row.chance-low {
  border-left: 3px solid rgba(180, 180, 180, 0.6);
}

.match-row-head {
  align-items: stretch;
  padding: 14px 16px;
  cursor: pointer;
}

.match-time-col {
  min-width: 112px;
  display: grid;
  gap: 6px;
  align-content: start;
}

.status-copy {
  font-size: 0.78rem;
}

.match-main-copy {
  min-width: 0;
  flex: 1 1 auto;
  display: grid;
  gap: 8px;
}

.match-title-line {
  justify-content: space-between;
  gap: 10px;
}

.match-title-line strong {
  min-width: 0;
  font-size: 1rem;
}

.match-secondary-line {
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.84rem;
}

.odds-line {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
}

.odds-line span {
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.78rem;
}

.match-signal-col {
  min-width: 142px;
  display: grid;
  gap: 5px;
  align-content: center;
  justify-items: end;
  text-align: right;
}

.match-signal-col strong {
  font-size: 0.95rem;
}

.match-signal-col span {
  color: var(--muted);
  font-size: 0.8rem;
}

.row-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  align-self: center;
  padding-left: 2px;
}

.compact-slider {
  width: 44px;
  height: 25px;
}

.compact-slider::after {
  width: 17px;
  height: 17px;
}

.row-switch input:checked + .compact-slider::after {
  transform: translateX(18px);
}

.row-switch-copy {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
}

.match-expanded {
  display: grid;
  gap: 8px;
  padding: 0 10px 10px;
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(36, 93, 255, 0.04), transparent 55%);
  font-size: 0.94rem;
}

.expanded-top,
.context-line,
.analysis-grid,
.compare-grid,
.probability-grid,
.detail-stats-grid,
.facts-grid {
  display: grid;
  gap: 8px;
}

.expanded-top,
.context-line {
  display: flex;
  flex-wrap: wrap;
}

.expanded-top {
  padding-top: 10px;
}

.summary-card,
.analysis-block,
.team-card,
.prob-card,
.detail-stat-card,
.acc-row,
.acc-stat-card {
  padding: 9px 10px;
  border-radius: 12px;
  background: var(--panel-soft);
  border: 1px solid var(--border);
}

.summary-card {
  flex: 1 1 240px;
  display: grid;
  gap: 4px;
}

.summary-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.summary-card strong {
  font-size: 0.98rem;
  line-height: 1.3;
}

.summary-card small {
  font-size: 0.8rem;
  line-height: 1.35;
}

.primary-card {
  background: linear-gradient(180deg, var(--panel-soft), rgba(36, 93, 255, 0.08));
}

.accent-card {
  background: linear-gradient(180deg, var(--panel-soft), rgba(255, 10, 84, 0.08));
}

.muted-card {
  background: var(--panel);
}

.expanded-top-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

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

.team-card-head {
  justify-content: space-between;
  margin-bottom: 8px;
}

.team-card h5 {
  font-size: 0.95rem;
}

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

.fact-item {
  display: grid;
  gap: 5px;
  padding: 9px 10px;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
}

.fact-item span {
  font-size: 0.8rem;
}

.fact-item strong {
  font-size: 0.9rem;
}

.fact-success {
  color: var(--success);
}

.fact-danger {
  color: var(--danger);
}

.fact-warning {
  color: var(--warning);
}

.fact-neutral {
  color: var(--text-secondary);
}

.fact-rich {
  display: grid;
  gap: 6px;
}

.fact-item-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.fact-item-inline > span {
  flex: 0 0 auto;
}

.fact-item-inline .fact-rich {
  margin-left: auto;
}

.stats-comparison-table {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.stats-comparison-header {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 8px;
  padding: 8px 12px;
  background: var(--panel);
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.stats-comparison-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 8px;
  padding: 6px 12px;
  background: var(--panel);
  border-radius: 8px;
  align-items: center;
}

.stats-label {
  font-size: 0.85rem;
  font-weight: 500;
}

.stats-value {
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 4px 8px;
  background: var(--bg);
  border-radius: 6px;
}

.stats-diff {
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.stats-diff-positive {
  background: rgba(34, 197, 94, 0.1);
  color: var(--success);
}

.stats-diff-negative {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

.stats-diff-neutral {
  background: var(--bg);
  color: var(--text-secondary);
}

.form-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: nowrap;
}

.form-cubes {
  display: flex;
  align-items: center;
  gap: 4px;
}

.form-cube {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 800;
  color: #fff;
  cursor: help;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}

.form-cube.win {
  background: #22a06b;
}

.form-cube.draw {
  background: #d7a62c;
}

.form-cube.loss {
  background: #d84f5f;
}

.form-summary {
  color: var(--muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

.compare-table {
  display: grid;
  gap: 6px;
}

.compare-table-head,
.compare-table-row {
  display: grid;
  grid-template-columns: minmax(150px, 180px) minmax(0, 1fr) minmax(0, 1fr) 110px;
  gap: 8px;
  align-items: stretch;
}

.compare-cell {
  min-width: 0;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel);
}

.metric-head,
.team-head {
  background: var(--panel-soft);
}

.advantage-head {
  text-align: center;
}

.team-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.team-head strong {
  font-size: 0.9rem;
}

.metric-cell {
  display: flex;
  align-items: center;
  color: var(--muted);
  font-weight: 700;
  cursor: help;
  font-size: 0.8rem;
}

.value-cell {
  display: flex;
  align-items: center;
}

.value-cell strong {
  font-size: 0.88rem;
}

.value-cell.is-strong {
  border-color: rgba(34, 160, 107, 0.28);
  background: rgba(34, 160, 107, 0.08);
}

.advantage-cell {
  display: flex;
  align-items: center;
  justify-content: center;
}

.advantage-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 68px;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  border: 1px solid var(--border);
  background: var(--panel-soft);
  color: var(--text);
}

.advantage-badge.home {
  background: rgba(34, 160, 107, 0.12);
  border-color: rgba(34, 160, 107, 0.26);
}

.advantage-badge.away {
  background: rgba(36, 93, 255, 0.1);
  border-color: rgba(36, 93, 255, 0.24);
}

.advantage-badge.even {
  background: rgba(215, 166, 44, 0.12);
  border-color: rgba(215, 166, 44, 0.24);
}

.compare-rich {
  width: 100%;
}

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

.analysis-block {
  display: grid;
  gap: 8px;
}

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

.compact-line {
  display: grid;
  gap: 3px;
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
}

.compact-line span {
  color: var(--muted);
  font-size: 0.74rem;
}

.compact-line strong {
  font-size: 0.86rem;
  line-height: 1.35;
}

.compact-line-wide {
  grid-column: 1 / -1;
}

.context-line {
  gap: 6px;
}

.inline-chip {
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 0.76rem;
}

.verdict-block {
  display: grid;
  gap: 4px;
  padding: 9px 10px;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
}

.verdict-block strong {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.verdict-block span {
  line-height: 1.35;
  font-weight: 600;
  font-size: 0.9rem;
}

.inline-help-btn {
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--blue);
  border-radius: 999px;
  padding: 5px 8px;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.78rem;
}

.analysis-fold {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel-soft);
  overflow: hidden;
}

.analysis-fold > summary {
  list-style: none;
  cursor: pointer;
  padding: 9px 10px;
  font-weight: 700;
  font-size: 0.86rem;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}

.analysis-fold > summary::-webkit-details-marker {
  display: none;
}

.analysis-fold > .analysis-grid,
.analysis-fold > .compare-grid,
.analysis-fold > .analysis-block {
  padding: 9px 10px;
}

.analysis-block-head {
  justify-content: space-between;
  align-items: flex-start;
}

.analysis-block h5 {
  font-size: 0.9rem;
}

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

.bullet-item {
  padding: 9px 10px;
  border-radius: 12px;
  line-height: 1.35;
  font-size: 0.86rem;
}

.bullet-item.positive {
  background: var(--success-soft);
  color: var(--success);
}

.bullet-item.caution {
  background: var(--warning-soft);
  color: #8d6500;
}

body.theme-dark .bullet-item.caution {
  color: #f0d178;
}

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

.detail-stat-card {
  display: grid;
  gap: 5px;
}

.detail-stat-card span {
  font-size: 0.76rem;
}

.detail-stat-values {
  justify-content: space-between;
}

.detail-stat-values strong,
.detail-stat-values small {
  font-size: 0.86rem;
}

.detail-stat-values small {
  color: var(--muted);
}

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

.prob-card {
  display: grid;
  gap: 5px;
}

.prob-card span {
  font-size: 0.76rem;
}

.prob-card strong {
  font-size: 0.82rem;
}

.prob-head {
  justify-content: space-between;
}

.bar-track {
  height: 6px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--border);
}

.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #ff7f9f);
}

.helper-panel {
  padding: 0;
  overflow: hidden;
}

.helper-panel > summary {
  list-style: none;
  cursor: pointer;
  padding: 16px 18px;
  font-weight: 700;
  background: var(--panel-soft);
  border-bottom: 1px solid var(--border);
}

.helper-panel > summary::-webkit-details-marker {
  display: none;
}

.helper-body {
  display: grid;
  gap: 14px;
  padding: 16px 18px 18px;
}

.compact-helper-panel > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 16px;
  font-size: 0.95rem;
}

.compact-helper-panel > summary::after {
  content: attr(data-summary-meta);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
}

.compact-helper-panel[open] > summary {
  border-bottom: 1px solid var(--border);
}

.compact-helper-panel .helper-body {
  display: grid;
  grid-template-columns: minmax(240px, 0.8fr) minmax(240px, 0.8fr) minmax(320px, 1.4fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px 16px 14px;
}

.express-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.compact-helper-panel .express-controls {
  display: contents;
}

.compact-helper-panel .field {
  gap: 4px;
}

.compact-helper-panel .field span {
  font-size: 0.75rem;
}

.compact-helper-panel .field input,
.compact-helper-panel .field select {
  min-height: 36px;
  padding: 7px 10px;
}

.accumulator-list {
  display: grid;
  gap: 10px;
}

.accumulator-list-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.compact-helper-panel .accumulator-list-inline.empty-state.inline-empty {
  min-height: 36px;
  padding: 8px 10px;
  border-radius: 12px;
  display: flex;
  justify-content: flex-start;
  white-space: nowrap;
}

.acc-row {
  justify-content: space-between;
}

.compact-helper-panel .acc-row {
  gap: 8px;
  flex: 0 0 auto;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel-soft);
}

.compact-helper-panel .acc-row strong {
  display: block;
  font-size: 0.8rem;
  line-height: 1.15;
}

.compact-helper-panel .acc-row .muted-line {
  font-size: 0.72rem;
  white-space: nowrap;
}

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

.compact-helper-panel .accumulator-stats {
  display: flex;
  gap: 8px;
  align-items: center;
}

.compact-helper-panel .acc-stat-card {
  gap: 2px;
  min-width: 120px;
  padding: 7px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel-soft);
}

.compact-helper-panel .acc-stat-card span {
  font-size: 0.7rem;
}

.compact-helper-panel .acc-stat-card strong {
  font-size: 0.86rem;
}

.acc-stat-card {
  display: grid;
  gap: 6px;
}

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

.ghost-btn {
  background: var(--panel-soft);
  border: 1px solid var(--border);
}

.help-dialog {
  width: min(980px, calc(100vw - 32px));
  border: none;
  padding: 0;
  background: transparent;
}

.help-dialog::backdrop {
  background: rgba(10, 18, 28, 0.56);
}

.help-dialog-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.help-dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--panel-soft);
}

.help-dialog-head h3,
.help-section h4 {
  margin: 0;
}

.help-dialog-body {
  display: grid;
  gap: 16px;
  max-height: 75vh;
  overflow: auto;
  padding: 18px;
}

.help-section {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 14px;
  background: var(--panel-soft);
  border: 1px solid var(--border);
}

.help-section p {
  margin: 0;
  line-height: 1.65;
}

.dialog-actions-row {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.danger-btn {
  border-color: rgba(216, 79, 95, 0.28);
  color: #b63b4c;
  background: rgba(216, 79, 95, 0.08);
}

body.theme-dark .danger-btn {
  color: #ff9aa7;
  background: rgba(216, 79, 95, 0.12);
}

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

.log-entry {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel-soft);
}

.log-entry.error {
  border-color: rgba(213, 63, 106, 0.28);
  background: var(--danger-soft);
}

.log-entry-time {
  font-size: 0.74rem;
  color: var(--muted);
}

.log-entry-message {
  font-size: 0.86rem;
  line-height: 1.45;
}

.help-list {
  margin: 0;
  padding-left: 18px;
  line-height: 1.7;
}

.top-tabs {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.top-tab {
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 700;
  cursor: pointer;
}

.top-tab.active {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: rgba(255, 10, 84, 0.18);
}

.hidden-view {
  display: none;
}

.stats-overview,
.league-stats-list {
  display: grid;
  gap: 12px;
}

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

.league-stat-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 16px;
  background: var(--panel-soft);
  border: 1px solid var(--border);
}

.league-stat-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.league-stat-head span,
.league-stat-note,
.league-picker-item span {
  color: var(--muted);
}

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

.league-stat-grid div {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
}

.league-stat-grid span {
  font-size: 0.82rem;
}

.league-stat-note {
  margin: 0;
  line-height: 1.55;
}

.league-picker-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.planner-limit-field {
  display: inline-grid;
  gap: 4px;
  min-width: 120px;
}

.planner-limit-label {
  font-size: 0.74rem;
  color: var(--muted);
  font-weight: 700;
}

.league-picker-list {
  display: grid;
  gap: 10px;
}

.league-picker-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--panel-soft);
  border: 1px solid var(--border);
  cursor: pointer;
}

.league-picker-item input {
  margin-top: 4px;
}

.league-picker-item strong {
  display: block;
  margin-bottom: 4px;
}

.league-today-count {
  font-weight: 700;
  color: var(--muted);
}

.league-today-count--active {
  color: var(--success);
}

.bet-suggestion-card {
  align-items: stretch;
  padding: 6px 8px;
  border-radius: 10px;
}

.bet-suggestion-main {
  display: grid;
  gap: 5px;
  width: 100%;
  min-width: 0;
}

.bet-suggestion-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.bet-suggestion-title {
  font-size: 0.92rem;
  line-height: 1.2;
}

.bet-suggestion-meta {
  color: var(--muted);
  font-size: 0.7rem;
}

.bet-suggestion-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
}

.bet-suggestion-grid div {
  display: grid;
  gap: 2px;
  padding: 5px 6px;
  border-radius: 8px;
  background: var(--panel);
  border: 1px solid var(--border);
}

.bet-suggestion-grid span {
  font-size: 0.66rem;
  color: var(--muted);
}

.bet-suggestion-grid strong {
  font-size: 0.82rem;
  line-height: 1.2;
}

.bet-range-row {
  display: grid;
  grid-template-columns: auto minmax(140px, 1fr);
  gap: 6px;
  align-items: center;
}

.bet-range-row--compact span {
  font-size: 0.72rem;
}

.bet-range-row span {
  font-size: 0.76rem;
  color: var(--muted);
  white-space: nowrap;
}

.bet-range-row input[type="range"] {
  width: 100%;
}

@media (min-width: 1100px) {
  .bet-suggestion-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .bet-suggestion-grid div {
    padding: 4px 6px;
    border-radius: 7px;
  }

  .bet-suggestion-grid strong {
    font-size: 0.78rem;
  }
}

.bet-journal-card {
  gap: 8px;
  padding: 10px 12px;
}

.bet-journal-card .league-stat-head {
  margin-bottom: 0;
  align-items: center;
  gap: 10px;
}

.bet-journal-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 0;
  font-size: 0.96rem;
}

.bet-journal-grid {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  padding-bottom: 2px;
}

.bet-journal-grid div {
  flex: 0 0 min(150px, 15vw);
  min-width: 108px;
  padding: 7px 8px;
  border-radius: 10px;
}

.bet-journal-grid span {
  font-size: 0.72rem;
}

.bet-journal-grid strong {
  font-size: 0.92rem;
  line-height: 1.2;
}

.bet-table-wrap {
  overflow-x: auto;
}

.bet-journal-collapsed #betJournalList {
  display: none;
}

.bet-journal-collapsed .bet-table-wrap {
  display: none;
}

.bet-table {
  width: 100%;
  min-width: 980px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.86rem;
}

.bet-table th,
.bet-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
  background: var(--panel);
}

.bet-table td .live-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #b62121;
  background: rgba(255, 94, 94, 0.12);
  border: 1px solid rgba(255, 94, 94, 0.35);
}

.mini-pill.live-pill {
  margin-left: 6px;
  background: rgba(255, 94, 94, 0.12);
  border-color: rgba(255, 94, 94, 0.35);
  color: #b62121;
}

.bet-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--panel-soft);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.bet-table-sort {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  padding: 0;
  color: inherit;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.bet-table-sort-arrow {
  font-size: 0.8rem;
  opacity: 0.72;
}

.bet-table-sort.active {
  color: var(--accent);
}

.bet-table-row {
  cursor: pointer;
}

.bet-table-row:hover td,
.bet-table-row.active td {
  background: var(--blue-soft);
}

.bet-table-main {
  display: grid;
  gap: 2px;
  min-width: 180px;
}

.bet-table-main strong {
  font-size: 0.82rem;
  line-height: 1.2;
}

.bet-table-main span {
  color: var(--muted);
  font-size: 0.7rem;
}

.bet-col-event {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--panel);
  box-shadow: 6px 0 10px rgba(20, 33, 50, 0.04);
}

.bet-table th:nth-child(2),
.bet-table td:nth-child(2) {
  white-space: nowrap;
  width: 108px;
  min-width: 108px;
}

.bet-table th:first-child {
  left: 0;
  z-index: 3;
}

.bet-table-row:hover .bet-col-event,
.bet-table-row.active .bet-col-event {
  background: var(--blue-soft);
}

.bet-profit-positive {
  color: var(--success);
  font-weight: 700;
}

.bet-profit-negative {
  color: var(--danger);
  font-weight: 700;
}

.bet-profit-neutral {
  color: var(--muted);
}

.bet-table-detail td {
  padding: 0;
  background: transparent;
  border-bottom: 1px solid var(--border);
}

.bet-toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 0.9fr) minmax(140px, 180px) minmax(140px, 180px) minmax(260px, 1fr);
  gap: 6px;
  align-items: center;
  margin: 6px 0 10px;
}

.bet-toolbar .field,
.bet-toolbar .search-box {
  min-width: 0;
}

.archive-toolbar {
  margin-top: 4px;
}

.archive-hidden {
  display: none;
}

.archive-overview-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.archive-overview-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel);
  font-size: 0.82rem;
}

.archive-overview-item span {
  color: var(--muted);
}

.archive-overview-item strong {
  font-size: 0.88rem;
}

#archiveMatches .empty-state {
  padding: 12px;
  font-size: 0.86rem;
  border-radius: 10px;
}

.archive-match-card {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--panel-soft);
  border: 1px solid var(--border);
  cursor: pointer;
}

.archive-match-head,
.archive-match-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.archive-match-head strong {
  font-size: 0.96rem;
}

.archive-match-meta {
  color: var(--muted);
  font-size: 0.82rem;
  flex-wrap: wrap;
}

.archive-match-card.active {
  border-color: rgba(36, 93, 255, 0.22);
  background: var(--blue-soft);
}

.archive-pills,
.archive-expanded-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.archive-expanded {
  display: grid;
  gap: 8px;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
}

.archive-expanded-summary {
  display: grid;
  gap: 3px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--panel);
  border: 1px solid var(--border);
}

.archive-expanded-summary span {
  color: var(--muted);
  font-size: 0.84rem;
}

.archive-expanded-grid > div {
  min-width: 140px;
  padding: 7px 9px;
  border-radius: 10px;
  background: var(--panel);
  border: 1px solid var(--border);
}

.archive-expanded-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.archive-expanded-grid strong {
  display: block;
  margin-top: 3px;
}

.archive-odds-line {
  color: var(--muted);
  font-size: 0.84rem;
}

.bet-toolbar .search-box input,
.bet-toolbar .field select {
  min-height: 36px;
  padding: 7px 10px;
}

.bet-status-dot {
  display: inline-block;
  font-size: 0.7rem;
  line-height: 1;
  margin-right: 4px;
}

.bet-status-dot.win {
  color: var(--success);
}

.bet-status-dot.loss {
  color: var(--danger);
}

.bet-status-dot.open {
  color: var(--warning);
}

#betSummary .stats-overview-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 4px;
}

#betSummary .stat-card {
  padding: 6px 8px;
  border-radius: 9px;
  min-height: 0;
}

#betSummary .stat-card span {
  font-size: 0.68rem;
}

#betSummary .stat-card strong {
  margin-top: 2px;
  font-size: 0.9rem;
  line-height: 1.05;
}

@media (max-width: 900px) {
  .compact-helper-panel .helper-body {
    grid-template-columns: 1fr 1fr;
  }

  .compact-helper-panel > summary::after {
    max-width: 40vw;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .bet-toolbar {
    grid-template-columns: 1fr 1fr;
  }

  #betSummary .stats-overview-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .compact-helper-panel .helper-body {
    grid-template-columns: 1fr;
  }

  .compact-helper-panel > summary {
    flex-wrap: wrap;
  }

  .compact-helper-panel > summary::after {
    width: 100%;
    max-width: none;
  }

  .bet-toolbar {
    grid-template-columns: 1fr;
  }

  #betSummary .stats-overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .bet-suggestion-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bet-range-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .bet-range-row span {
    white-space: normal;
  }

}

@media (max-width: 640px) {
  .bet-journal-grid div {
    flex-basis: 120px;
  }
}

.formula-box {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
}

.formula-box code {
  display: block;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--blue);
}

button,
summary,
.theme-btn,
.status-filter {
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.theme-btn:hover,
.status-filter:hover,
.league-group > summary:hover {
  transform: translateY(-1px);
}

#logToggleBtn {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 40;
  box-shadow: var(--shadow);
}

.header-actions #logToggleBtn {
  position: static;
  right: auto;
  bottom: auto;
  z-index: auto;
  box-shadow: none;
}

@media (max-width: 1180px) {
  .stats-grid {
    min-width: 0;
    width: 100%;
  }

  .toolbar-row {
    grid-template-columns: 1fr 1fr;
  }

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

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

  .stats-overview-grid,
  .league-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

}

@media (max-width: 900px) {
  .app-shell {
    padding: 12px;
  }

  .app-header,
  .header-actions,
  .panel-head,
  .match-row-head,
  .expanded-top {
    flex-direction: column;
    align-items: stretch;
  }

  .stats-grid,
  .compare-grid,
  .analysis-grid,
  .express-controls,
  .accumulator-stats,
  .facts-grid,
  .detail-stats-grid,
  .probability-grid,
  .stats-overview-grid,
  .league-stat-grid {
    grid-template-columns: 1fr;
  }

  .match-time-col,
  .match-signal-col {
    min-width: 0;
  }

  .match-signal-col {
    justify-items: start;
    text-align: left;
  }

  .row-switch {
    align-self: flex-start;
  }

  .help-dialog-head {
    flex-direction: column;
    align-items: stretch;
  }

  .compare-table-head,
  .compare-table-row {
    grid-template-columns: 1fr;
  }

  .team-head {
    flex-wrap: wrap;
  }
}

@media (max-width: 640px) {
  .toolbar-row {
    grid-template-columns: 1fr;
  }

  .controls-bar {
    display: grid;
  }

  .switch-toggle {
    min-width: 0;
    width: 100%;
  }

  .controls-bar,
  .status-filter-bar,
  .context-line,
  .match-secondary-line {
    flex-direction: column;
    align-items: stretch;
  }

  .match-title-line {
    align-items: flex-start;
    flex-direction: column;
  }

  .league-summary-line {
    gap: 8px;
    overflow: hidden;
  }

  .sync-pill,
  .theme-btn {
    width: 100%;
    justify-content: center;
  }
}

.match-expanded-compact .summary-card strong,
.match-expanded-compact .verdict-block span,
.match-expanded-compact .compact-line strong,
.match-expanded-compact .bullet-item,
.match-expanded-compact .compare-table,
.match-expanded-compact .probability-grid,
.match-expanded-compact .detail-stats-grid {
  font-size: 0.96em;
}

.walkthrough-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.walkthrough-step {
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--panel);
}

.walkthrough-step strong {
  display: block;
  margin-bottom: 6px;
  font-size: 0.96rem;
}

.walkthrough-step p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

@media (max-width: 900px) {
  .walkthrough-grid {
    grid-template-columns: 1fr;
  }
}

.model-breakdown-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.compact-model-card {
  gap: 10px;
  padding: 12px;
}

.compact-model-head {
  min-height: auto;
}

.compact-model-list {
  gap: 8px;
}

.compact-model-list .league-stat-card {
  gap: 8px;
  padding: 10px;
  border-radius: 12px;
}

.compact-model-list .league-stat-head {
  align-items: flex-start;
}

.compact-model-list .league-stat-head strong,
.compact-model-list .league-stat-grid strong {
  font-size: 0.92rem;
}

.compact-model-list .league-stat-head span,
.compact-model-list .league-stat-grid span,
.compact-model-list .league-stat-note {
  font-size: 0.78rem;
}

.model-results-head {
  margin-bottom: 6px;
}

.model-results-head h3 {
  font-size: 1.2rem;
  line-height: 1.15;
}

#modelResultsSummary .stats-overview-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.45rem;
  align-items: stretch;
  margin-bottom: 0.55rem;
}

#modelResultsSummary .stat-card {
  display: grid;
  gap: 0.1rem;
  padding: 0.2rem 0.45rem 0.28rem;
  border-radius: 0;
  background: transparent;
  border: none;
  border-right: 1px solid var(--border);
  min-width: 0;
}

#modelResultsSummary .stat-card span {
  font-size: clamp(0.7rem, 0.64rem + 0.16vw, 0.82rem);
  line-height: 1.15;
}

#modelResultsSummary .stat-card strong {
  font-size: clamp(0.98rem, 0.88rem + 0.24vw, 1.14rem);
  line-height: 1.05;
  margin-top: 0;
}

#modelResultsSummary .stat-card:last-child {
  border-right: none;
}

#modelResultsSummary .stat-card span,
#modelResultsSummary .stat-card strong {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#modelResultsBreakdown .model-breakdown-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

#modelResultsBreakdown .compact-model-card {
  gap: 6px;
  padding: 8px;
  border-radius: 12px;
}

#modelResultsBreakdown .compact-model-list {
  gap: 4px;
}

#modelResultsBreakdown .compact-model-list .league-stat-card {
  gap: 5px;
  padding: 6px;
  border-radius: 8px;
}

#modelResultsBreakdown .compact-model-list .league-stat-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
}

#modelResultsBreakdown .compact-model-list .league-stat-grid div {
  padding: 5px 6px;
  gap: 2px;
  border-radius: 8px;
}

#modelResultsBreakdown .compact-model-list .league-stat-head strong,
#modelResultsBreakdown .compact-model-list .league-stat-grid strong {
  font-size: 0.83rem;
}

#modelResultsBreakdown .compact-model-list .league-stat-head span,
#modelResultsBreakdown .compact-model-list .league-stat-grid span,
#modelResultsBreakdown .compact-model-list .league-stat-note {
  font-size: 0.7rem;
}

#modelResultsBreakdown .compact-model-list .league-stat-head {
  gap: 8px;
  align-items: center;
}

#modelResultsBreakdown .compact-model-list .league-stat-note {
  line-height: 1.35;
}

.compact-model-tables {
  gap: 6px;
}

.model-mini-table-card {
  display: grid;
  gap: 6px;
  padding: 7px 8px;
  border-radius: 8px;
  background: var(--panel);
  border: 1px solid var(--border);
}

.model-mini-table-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.model-mini-table-head strong {
  font-size: 0.88rem;
}

.model-mini-table-head span {
  font-size: 0.72rem;
  color: var(--muted);
}

.model-mini-table-wrap {
  overflow-x: auto;
}

.model-mini-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.77rem;
}

.model-mini-table th,
.model-mini-table td {
  padding: 5px 6px;
  border-top: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}

.model-mini-table tbody tr:first-child th,
.model-mini-table tbody tr:first-child td {
  border-top: none;
}

.model-mini-table th {
  color: var(--muted);
  font-weight: 500;
}

.model-mini-table td {
  font-weight: 600;
}

.model-mini-table td.positive {
  color: #15906f;
}

.model-mini-table td.negative {
  color: #d84f5f;
}

.model-mini-table td.neutral {
  color: var(--text);
}

.home-away-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.home-away-team h6 {
  margin: 0 0 12px 0;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  text-align: center;
}

.home-away-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.stat-card {
  background: var(--panel-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  text-align: center;
}

.stat-card .stat-label {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-card .stat-value {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.stat-card .stat-value:last-child {
  margin-bottom: 0;
}

.form-trends-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form-trend-team h6 {
  margin: 0 0 12px 0;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  text-align: center;
}

.trend-chart {
  background: var(--panel-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
}

.trend-chart.empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.85rem;
  font-style: italic;
  min-height: 80px;
}

.trend-legend {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-top: 8px;
}

.trend-result {
  font-size: 0.8rem;
  padding: 2px 4px;
  background: var(--panel);
  border-radius: 4px;
  border: 1px solid var(--border);
}

@media (max-width: 900px) {
  .model-breakdown-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1380px) {
  #modelResultsBreakdown .compact-model-list .league-stat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  #modelResultsBreakdown .compact-model-list .league-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1200px) {
  #modelResultsSummary .stats-overview-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #modelResultsSummary .stat-card:nth-child(3n) {
    border-right: none;
  }
}

@media (max-width: 900px) {
  #modelResultsBreakdown .model-breakdown-row,
  #modelResultsSummary .stats-overview-grid,
  #modelResultsBreakdown .compact-model-list .league-stat-grid {
    grid-template-columns: 1fr;
  }

  #modelResultsSummary .stat-card {
    padding: 0.45rem 0;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  #modelResultsSummary .stat-card:last-child {
    border-bottom: none;
  }

  .analysis-tab-grid {
    grid-template-columns: 1fr;
  }

  .form-display {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
  }
}

/* Form history badges */
.form-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  border-radius: 7px;
  font-size: 0.77rem;
  font-weight: 700;
  color: white;
  cursor: help;
  transition: all 0.15s ease;
  opacity: 0.92;
  letter-spacing: 0.3px;
}

.form-badge:hover {
  opacity: 1;
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.form-badge.form-w {
  background: #22c55e;
  box-shadow: 0 2px 4px rgba(34, 197, 94, 0.2);
}

.form-badge.form-d {
  background: #eab308;
  color: #3c2c1c;
  box-shadow: 0 2px 4px rgba(234, 179, 8, 0.2);
}

.form-badge.form-l {
  background: #ef4444;
  box-shadow: 0 2px 4px rgba(239, 68, 68, 0.2);
}

.form-empty {
  display: block;
  padding: 6px 8px;
  color: var(--muted);
  font-size: 0.85rem;
  font-style: italic;
}

  .unified-analytics-table,
  .home-away-stats,
  .form-trends-grid {
    grid-template-columns: 1fr;
  }
}

/* Unified Analytics Table Styles */
.unified-analysis-section {
  display: grid;
  gap: 12px;
}

.analysis-section-head {
  display: grid;
  gap: 6px;
}

.analysis-section-head h5 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.analysis-section-body {
  display: grid;
  gap: 16px;
}

.analysis-probabilities {
  display: grid;
  gap: 8px;
}

.analysis-probabilities h6 {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Analytics Cards Grid */
.analytics-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.metric-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 10px;
  background: var(--panel);
  border: 1px solid var(--border);
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.metric-card:hover {
  border-color: var(--border-strong);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.metric-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
}

.metric-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.metric-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  flex: 1;
}

.metric-card-body {
  display: grid;
  gap: 10px;
}

.team-stat {
  display: grid;
  gap: 4px;
  padding: 8px;
  border-radius: 8px;
  background: var(--bg);
  text-align: center;
  border-left: 3px solid var(--border);
}

.team-stat.home-stat {
  border-left-color: #1e6b4d;
}

.team-stat.away-stat {
  border-left-color: #1e4fa0;
}

.team-name {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.team-stat strong {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.metric-diff {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px;
  border-radius: 7px;
  font-weight: 700;
  font-size: 0.8rem;
}

.metric-diff.positive {
  background: rgba(34, 160, 107, 0.15);
  color: #178754;
}

.metric-diff.negative {
  background: rgba(216, 79, 95, 0.15);
  color: #c3453a;
}

.metric-diff.neutral {
  background: var(--border);
  color: var(--muted);
}

.diff-symbol {
  font-size: 1rem;
  font-weight: 800;
}

.diff-value {
  font-size: 0.85rem;
  font-weight: 700;
}

.form-card {
  grid-column: span 1;
}

@media (min-width: 1200px) {
  .form-card {
    grid-column: span 2;
  }
}

@media (min-width: 1600px) {
  .form-card {
    grid-column: span 1;
  }
}

.form-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.form-body-vertical {
  grid-template-columns: 1fr;
  gap: 12px;
}

.form-column {
  display: grid;
  gap: 6px;
  padding: 8px;
  border-radius: 8px;
  background: var(--bg);
}

.form-column-team {
  border-left: 3px solid var(--border);
  padding-left: 10px;
}

.form-column-team:first-child {
  border-left-color: #1e6b4d;
}

.form-column-team:last-child {
  border-left-color: #1e4fa0;
}

.team-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.form-display {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  min-height: 32px;
}

.unified-analytics-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.unified-analytics-table thead {
  background: linear-gradient(135deg, var(--panel-soft) 0%, var(--panel) 100%);
  border-bottom: 2px solid var(--border);
}

.unified-analytics-table th {
  padding: 14px 16px;
  text-align: left;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  background: transparent;
}

.metric-col {
  width: 35%;
  text-align: left;
}

.team-col {
  width: 21.5%;
  text-align: center;
}

.diff-col {
  width: 21.5%;
  text-align: center;
}

.unified-analytics-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
  vertical-align: middle;
}

.unified-analytics-table tbody tr:last-child td {
  border-bottom: none;
}

.metric-row {
  cursor: default;
  transition: background-color 0.15s ease;
}

.metric-row:hover {
  background: var(--panel-soft);
}

.metric-row.form-history-row {
  background: linear-gradient(90deg, transparent 0%, rgba(36, 93, 255, 0.02) 100%);
}

.metric-row.form-history-row:hover {
  background: linear-gradient(90deg, transparent 0%, rgba(36, 93, 255, 0.06) 100%);
}

.metric-row.recent-points-row,
.metric-row.injuries-row {
  border-top: 2px solid var(--border-strong);
}

.metric-label {
  font-weight: 600;
  color: var(--text);
  font-size: 0.88rem;
}

.team-value {
  text-align: center;
  font-weight: 650;
  color: var(--text);
  font-size: 0.9rem;
}

.home-value {
  color: #1e6b4d;
}

.away-value {
  color: #1e4fa0;
}

.form-display {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  min-height: 36px;
}

.diff-value {
  text-align: center;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 7px;
  font-size: 0.87rem;
  letter-spacing: 0.3px;
}

.diff-value.positive {
  background: rgba(34, 160, 107, 0.15);
  color: #178754;
}

.diff-value.negative {
  background: rgba(216, 79, 95, 0.15);
  color: #c3453a;
}

.diff-value.neutral {
  background: var(--border);
  color: var(--muted);
}

.unified-conclusions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.conclusion-block {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--panel-soft);
  border: 1px solid var(--border);
  transition: all 0.2s ease;
}

.conclusion-block:hover {
  border-color: var(--border-strong);
  background: var(--panel);
}

.conclusion-block h6 {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.conclusion-block ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
}

.conclusion-block li {
  color: var(--text);
  font-size: 0.87rem;
  line-height: 1.5;
}

.reasons-block h6 {
  color: #168754;
}

.warnings-block h6 {
  color: #b8860b;
}

.verdict-block {
  background: var(--blue-soft);
  border-color: rgba(36, 93, 255, 0.24);
}

.verdict-block h6 {
  color: var(--blue);
}

.verdict-block:hover {
  border-color: rgba(36, 93, 255, 0.34);
  background: rgba(36, 93, 255, 0.08);
}

.verdict-text {
  margin: 0;
  color: var(--text);
  font-size: 0.87rem;
  line-height: 1.55;
  font-weight: 500;
}

@media (max-width: 1200px) {
  .unified-conclusions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .unified-conclusions {
    grid-template-columns: 1fr;
  }

  .unified-analytics-table {
    font-size: 0.8rem;
  }

  .unified-analytics-table th,
  .unified-analytics-table td {
    padding: 8px 10px;
  }

  .metric-col {
    width: auto;
  }

  .team-col,
  .diff-col {
    width: auto;
  }
