:root {
  --bg: #0b1220;
  --bg-2: #121d2e;
  --surface: #1a2638;
  --surface-2: #22324a;
  --surface-3: #2b3c57;
  --text: #f2f6fc;
  --muted: #a5b4c9;
  --line: #32455f;
  --line-strong: #425975;
  --accent: #28cf85;
  --accent-strong: #14b56f;
  --accent-soft: rgba(40, 207, 133, 0.18);
  --live: #ff5a63;
  --live-soft: rgba(255, 90, 99, 0.16);
  --warning: #f6c24b;
  --danger: #ff7d7d;

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;

  --shadow-1: 0 6px 18px rgba(0, 0, 0, 0.2);
  --shadow-2: 0 14px 32px rgba(0, 0, 0, 0.3);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 520px at -20% -10%, rgba(45, 94, 162, 0.24), transparent 62%),
    radial-gradient(900px 460px at 100% 0%, rgba(20, 181, 111, 0.16), transparent 68%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 22px;
  letter-spacing: 0.02em;
  line-height: 1.15;
}

h2 {
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #d4deeb;
}

.app-shell {
  max-width: 1400px;
  margin: 0 auto;
  min-height: 100vh;
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4);
  border-bottom: 1px solid var(--line);
}

.panel-note {
  margin-top: var(--space-1);
  font-size: 12px;
  color: var(--muted);
}

.topbar {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
}

.brand {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

.topbar-actions {
  width: 100%;
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 10px;
  min-height: 42px;
  position: relative;
}

.language-flag-btn {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px;
  cursor: pointer;
  position: absolute;
  top: 0;
  right: 0;
  box-shadow: var(--shadow-1);
}

.language-flag-btn img {
  width: 100%;
  height: 100%;
  border-radius: 7px;
  object-fit: cover;
}

.language-flag-btn:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(40, 207, 133, 0.22);
}

.topbar-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  padding-right: 52px;
}

.top-link {
  text-decoration: none;
}

.auth-widget {
  width: min(360px, calc(100vw - 24px));
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: rgba(15, 26, 39, 0.96);
  box-shadow: var(--shadow-2);
  position: absolute;
  top: 50px;
  right: 0;
  z-index: 140;
}

.auth-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.auth-state {
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #dce7f5;
}

.auth-user-meta {
  font-size: 12px;
  color: var(--muted);
  flex: 1;
}

.auth-close-btn {
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--muted);
  border-radius: 8px;
  width: 28px;
  height: 28px;
  line-height: 1;
  font-size: 18px;
  cursor: pointer;
}

.auth-close-btn:hover {
  color: var(--text);
  border-color: var(--line);
}

.auth-close-btn:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(40, 207, 133, 0.2);
}

.auth-choice-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.auth-choice-controls .btn {
  width: 100%;
}

.auth-guest-controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
}

.auth-field input {
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 8px;
  min-height: 34px;
  padding: 6px 8px;
  font-size: 13px;
}

.auth-field input:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(40, 207, 133, 0.2);
}

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

.auth-actions .btn {
  width: 100%;
}

.auth-user-controls {
  display: flex;
  justify-content: flex-end;
}

.auth-error {
  margin: 8px 0 0;
  font-size: 12px;
  color: #ffd0d0;
}

.language-control {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  font-size: 12px;
  color: var(--muted);
  min-width: 112px;
}

.language-select {
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 10px;
  min-height: 40px;
  padding: 8px 10px;
  font-size: 14px;
  outline: none;
}

.language-select:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(40, 207, 133, 0.22);
}

.subtitle {
  margin-top: 3px;
  color: #d2dceb;
  font-size: 14px;
  line-height: 1.35;
}

.header-cues {
  margin-top: var(--space-2);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.trust-pill {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: #d8e3f1;
  background: rgba(255, 255, 255, 0.03);
  font-size: 11px;
  letter-spacing: 0.03em;
}

.england-flag-logo {
  position: relative;
  width: 58px;
  height: 42px;
  border: 1px solid #bfc7d2;
  border-radius: 10px;
  background: #fdfefe;
  overflow: hidden;
  flex-shrink: 0;
  margin-top: 2px;
}

.england-flag-h,
.england-flag-v {
  position: absolute;
  background: #c8102e;
}

.england-flag-h {
  left: 0;
  right: 0;
  top: 50%;
  height: 9px;
  transform: translateY(-50%);
}

.england-flag-v {
  top: 0;
  bottom: 0;
  left: 50%;
  width: 9px;
  transform: translateX(-50%);
}

.action-bar {
  position: sticky;
  top: var(--space-2);
  z-index: 40;
  backdrop-filter: blur(8px);
}

.action-header {
  align-items: center;
}

.action-content {
  padding: var(--space-3) var(--space-4) var(--space-4);
}

.league-filter-row {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.league-filter-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.league-filter-select {
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 10px;
  min-height: 38px;
  padding: 6px 10px;
  min-width: min(320px, 100%);
  font-size: 14px;
}

.league-filter-select:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(40, 207, 133, 0.22);
}

.filters {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  position: relative;
}

.filter-btn {
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: #d8e1ee;
  border-radius: 999px;
  padding: 9px 14px;
  min-height: 42px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.filter-btn:hover {
  border-color: #5a7392;
}

.filter-btn:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(40, 207, 133, 0.24);
}

.filter-btn.active {
  background: linear-gradient(180deg, var(--accent), var(--accent-strong));
  border-color: transparent;
  color: #05160f;
  box-shadow: 0 10px 20px rgba(20, 181, 111, 0.32);
}

.filter-btn[data-filter="live"].active {
  background: linear-gradient(180deg, #ff7a7f, #ff555e);
  color: #2c0003;
  box-shadow: 0 10px 20px rgba(255, 90, 99, 0.34);
}

.custom-filter-wrap {
  position: relative;
  display: inline-flex;
}

.custom-range {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 50;
  width: min(310px, 86vw);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: #111b2c;
  box-shadow: var(--shadow-2);
}

.range-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
}

.range-field input {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  border-radius: 8px;
  padding: 7px 8px;
  min-height: 34px;
  font-size: 13px;
}

.range-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  grid-column: 1 / -1;
}

.layout {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-height: 0;
  flex: 1;
}

.locations-panel,
.events-panel,
.odds-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.locations-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.locations-toggle {
  display: inline-flex;
}

.panel-body {
  min-height: 0;
}

.tree {
  overflow: auto;
  padding: 10px 12px 14px;
  max-height: 380px;
}

.tree ul {
  list-style: none;
  margin: 0;
  padding-left: 0;
}

.tree .tree-node-row {
  --level: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  padding-left: calc(8px + (var(--level) * 12px));
  border-radius: 10px;
  margin-bottom: 2px;
}

.tree .tree-node-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

.tree .tree-node-row.selected {
  background: var(--accent-soft);
  border: 1px solid rgba(40, 207, 133, 0.45);
}

.expand-btn {
  width: 22px;
  height: 22px;
  border: 1px solid transparent;
  background: transparent;
  color: #bfd0e4;
  border-radius: 6px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
}

.expand-btn:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
}

.expand-btn:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(40, 207, 133, 0.2);
}

.tree-node-spacer {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.tree .tree-node-btn {
  flex: 1;
  text-align: left;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--text);
  font-size: 14px;
  min-height: 30px;
  border-radius: 8px;
}

.tree .tree-node-btn.active {
  color: #e6fff4;
  font-weight: 700;
}

.tree .tree-node-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(40, 207, 133, 0.3);
}

.tree .unknown {
  color: #2d2100;
  border: 1px solid #f0c96c;
  background: #ffe7b2;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
}

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

.events-list {
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
}

.event-card {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: linear-gradient(180deg, #1d2b3f, #1a2738);
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}

.event-card:hover {
  transform: translateY(-1px);
  border-color: #557292;
}

.event-card:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(40, 207, 133, 0.22);
}

.event-card.selected {
  border-color: var(--accent);
  box-shadow: 0 12px 24px rgba(20, 181, 111, 0.2);
}

.event-card.is-live {
  border-color: rgba(255, 90, 99, 0.68);
  background: linear-gradient(180deg, rgba(255, 90, 99, 0.12), rgba(26, 39, 56, 0.98));
}

.event-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.event-competition {
  color: #d4deeb;
  font-size: 12px;
  line-height: 1.3;
}

.event-kickoff {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.event-status {
  border-radius: 999px;
  padding: 4px 10px;
  border: 1px solid var(--line-strong);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.event-status.live {
  border-color: rgba(255, 90, 99, 0.7);
  background: var(--live-soft);
  color: #ffd9db;
  font-weight: 700;
}

.event-status.live::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
  background: #ff8e95;
  box-shadow: 0 0 0 0 rgba(255, 142, 149, 0.8);
  animation: pulse-live 1.8s ease infinite;
  vertical-align: middle;
}

.event-status.upcoming {
  background: rgba(120, 160, 210, 0.15);
  color: #dbe9fb;
}

.event-status.finished {
  background: rgba(255, 255, 255, 0.06);
  color: #c4d0e1;
}

.event-teams {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
}

.team-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
  text-align: left;
}

.team-label {
  overflow-wrap: anywhere;
}

.team-name.away {
  justify-content: flex-end;
}

.team-name.away .team-label {
  text-align: right;
}

.team-logo {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.team-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}

.team-logo-fallback {
  font-size: 9px;
  font-weight: 700;
  color: #d4e2f4;
}

.team-divider {
  font-size: 11px;
  color: #a8b7ca;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.event-bottom {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

.odd-cta {
  flex: 1 1 86px;
  min-width: 86px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  padding: 8px;
}

.odd-market {
  display: inline-block;
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 4px;
}

.odd-value {
  font-size: 20px;
  font-weight: 800;
  color: #f3fffa;
  line-height: 1;
}

.odd-value.missing {
  font-size: 13px;
  color: #d1dbe8;
  font-weight: 600;
}

.odd-bookmaker {
  display: flex;
  align-items: center;
  margin-top: 4px;
  font-size: 11px;
  color: #c0ccdc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.bookmaker-logo,
.bookmaker-logo-fallback {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.bookmaker-logo {
  object-fit: cover;
  background: #fff;
}

.bookmaker-logo-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  color: #dce8f7;
}

.bookmaker-name {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bookmaker-brand-compact {
  gap: 6px;
}

.bookmaker-logo-compact,
.bookmaker-logo-fallback-compact {
  width: 16px;
  height: 16px;
  border-radius: 4px;
}

.bookmaker-name-compact {
  font-size: 11px;
}

.event-footnote {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}

.bookmakers-count {
  color: #dce6f4;
  font-weight: 600;
}

.card-affordance {
  color: #8ae9bb;
  font-weight: 700;
  letter-spacing: 0.01em;
}

#matchMeta {
  padding: 12px;
}

.match-meta-card {
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 12px;
  background: linear-gradient(180deg, #1e2c40, #1a2738);
}

.match-meta-card.is-live {
  border-color: rgba(255, 90, 99, 0.7);
  background: linear-gradient(180deg, rgba(255, 90, 99, 0.14), #1a2738);
}

.match-meta-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.match-status {
  border-radius: 999px;
  padding: 3px 9px;
  border: 1px solid var(--line-strong);
  color: #d7e3f2;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.match-status.live {
  border-color: rgba(255, 90, 99, 0.65);
  background: var(--live-soft);
  color: #ffe3e5;
  font-weight: 700;
}

.match-kickoff {
  color: #d0dbee;
  font-size: 12px;
}

.match-meta-title {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.match-meta-team {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  min-width: 0;
}

.match-meta-team.away {
  justify-content: flex-end;
}

.match-meta-team-name {
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.match-meta-team.away .match-meta-team-name {
  text-align: right;
}

.match-meta-versus {
  font-size: 11px;
  color: #a8b7ca;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.match-meta-line {
  font-size: 12px;
  color: var(--muted);
}

#oddsList {
  overflow: auto;
  padding: 0 12px 12px;
}

.odds-scroll {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.12);
  overflow-x: auto;
}

.odds-table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  font-size: 13px;
}

.odds-table th,
.odds-table td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px 8px;
  text-align: left;
}

.odds-table .bookmaker-col,
.odds-table .bookmaker-cell {
  width: auto;
}

.bookmaker-cell {
  min-width: 150px;
  max-width: 240px;
}

.odds-table .odds-col,
.odds-table .odds-number {
  width: 1%;
  white-space: nowrap;
}

.odds-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #1b2a3d;
  color: #cbd8ea;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 11px;
}

.odds-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.odds-number {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: #f4fffa;
  text-align: center;
}

.best-value {
  background: var(--accent-soft);
  color: #dffff0;
}

.odds-updated {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.btn {
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  min-height: 38px;
  font-weight: 600;
}

.btn:hover {
  border-color: #6a82a0;
}

.btn:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(40, 207, 133, 0.22);
}

.btn.ghost {
  background: transparent;
}

.btn.small {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 12px;
}

.btn:disabled,
.filter-btn:disabled {
  opacity: 0.58;
  cursor: default;
}

.chip {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line-strong);
  color: #d6e2f2;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.state {
  margin: 12px;
  border-radius: 12px;
  border: 1px dashed var(--line-strong);
  padding: 12px;
  color: #d6dfeb;
  font-size: 14px;
  line-height: 1.35;
}

.state-loading {
  background: rgba(255, 255, 255, 0.03);
}

.state-error {
  border-color: rgba(255, 125, 125, 0.45);
  color: #ffdada;
  background: rgba(255, 125, 125, 0.12);
}

.state-empty,
.state-initial {
  background: rgba(255, 255, 255, 0.015);
}

.simple-page {
  max-width: 1400px;
  margin: 0 auto;
  min-height: 100vh;
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.simple-header {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4);
}

.simple-header-actions {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex-wrap: wrap;
}

.account-status-body,
.account-auth-body,
.admin-access-body {
  padding: var(--space-4);
}

.account-status-list {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #dbe5f3;
  font-size: 14px;
}

.admin-dashboard {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.admin-filter-actions {
  display: flex;
  gap: 8px;
}

.admin-filters-grid {
  padding: 12px 16px 16px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.admin-filters-grid select,
.admin-filters-grid input {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  border-radius: 8px;
  min-height: 34px;
  padding: 6px 8px;
  font-size: 13px;
}

.admin-filters-grid select:focus-visible,
.admin-filters-grid input:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(40, 207, 133, 0.2);
}

.admin-metrics-grid {
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.admin-metric-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.02);
}

.admin-metric-label {
  font-size: 12px;
  color: var(--muted);
}

.admin-metric-value {
  margin-top: 6px;
  font-size: 24px;
  font-weight: 800;
  color: #e9fff4;
}

.admin-timeseries {
  padding: 12px;
  min-height: 160px;
}

.admin-bars {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(14px, 1fr);
  gap: 6px;
  height: 160px;
  align-items: end;
  overflow-x: auto;
}

.admin-bar-item {
  display: grid;
  grid-template-rows: 1fr auto;
  align-items: end;
  justify-items: center;
  min-width: 14px;
}

.admin-bar {
  width: 100%;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, var(--accent), var(--accent-strong));
}

.admin-bar-caption {
  margin-top: 4px;
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
}

.admin-lists-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-3);
}

.admin-top-list {
  list-style: none;
  margin: 0;
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-top-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.02);
}

.admin-top-key {
  font-size: 13px;
  color: #e3ecf8;
  overflow-wrap: anywhere;
}

.admin-top-total {
  color: #caffde;
  font-size: 14px;
}

.admin-top-empty {
  font-size: 13px;
  color: var(--muted);
}

.admin-funnel-list {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-funnel-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.02);
}

.admin-funnel-step {
  color: #e3ecf8;
  overflow-wrap: anywhere;
}

.admin-funnel-sessions {
  color: #d9e5f5;
}

.admin-funnel-conversion {
  color: #98e3ba;
  font-size: 12px;
}

.admin-pagination {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-page-info {
  font-size: 12px;
  color: var(--muted);
}

.admin-events-table td {
  vertical-align: top;
  font-size: 12px;
}

.admin-message {
  margin: 0;
  font-size: 14px;
  color: #dbe5f3;
}

@keyframes pulse-live {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 142, 149, 0.8);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(255, 142, 149, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 142, 149, 0);
  }
}

@media (max-width: 420px) {
  .header-cues {
    display: none;
  }

  .custom-range {
    left: auto;
    right: 0;
    width: min(292px, 88vw);
    grid-template-columns: 1fr;
  }

  .league-filter-row {
    align-items: stretch;
  }

  .league-filter-select {
    width: 100%;
    min-width: 0;
  }

  .range-actions {
    justify-content: stretch;
  }

  .range-actions .btn {
    flex: 1;
  }

  .simple-header-actions,
  .admin-filter-actions,
  .admin-pagination {
    width: 100%;
    justify-content: stretch;
  }

  .auth-actions {
    grid-template-columns: 1fr;
  }

  .auth-actions .btn,
  .admin-filter-actions .btn,
  .admin-pagination .btn {
    width: 100%;
  }

  .best-odds {
    display: grid;
    grid-template-columns: 1fr;
  }

  .event-teams {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .team-name.away {
    justify-content: flex-start;
  }

  .team-name.away .team-label {
    text-align: left;
  }

  .team-divider {
    display: none;
  }

  .event-footnote {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .match-meta-title {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .match-meta-team.away {
    justify-content: flex-start;
  }

  .match-meta-team.away .match-meta-team-name {
    text-align: left;
  }

  .match-meta-versus {
    display: none;
  }
}

@media (min-width: 760px) {
  .app-shell {
    padding: var(--space-4);
    gap: var(--space-4);
  }

  .simple-page {
    padding: var(--space-4);
    gap: var(--space-4);
  }

  .topbar {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
  }

  .topbar-actions {
    width: auto;
    max-width: 580px;
  }

  .topbar-links {
    width: auto;
    margin-left: auto;
  }

  .england-flag-logo {
    width: 62px;
    height: 45px;
  }

  .tree {
    max-height: 560px;
  }

  .locations-toggle {
    display: none;
  }
}

@media (min-width: 980px) {
  .layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr) 360px;
    gap: var(--space-4);
  }

  .events-panel {
    min-height: 620px;
  }

  .locations-panel,
  .odds-panel {
    align-self: start;
  }

  .odds-panel {
    position: sticky;
    top: var(--odds-sticky-top, 92px);
    align-self: start;
    max-height: calc(100vh - 106px);
    transition: top 0.18s ease;
  }

  .events-list {
    height: 100%;
  }

  .tree {
    height: auto;
    max-height: calc(100vh - 240px);
  }

  #oddsList {
    height: auto;
    max-height: calc(100vh - 260px);
  }

  .action-bar {
    position: static;
  }
}
