:root {
  --ge-bg: #0b1220;
  --ge-bg-elevated: #121a2b;
  --ge-bg-panel: #172235;
  --ge-border: #2a3a55;
  --ge-text: #e8eef9;
  --ge-muted: #9aadc8;
  --ge-accent: #3d9cf0;
  --ge-accent-strong: #1f7fd6;
  --ge-warning: #e0a106;
  --ge-success: #3cba7a;
  --ge-danger: #e35d6a;
  --ge-font-sans: "Roboto", system-ui, sans-serif;
  --ge-font-mono: "Cascadia Mono", "Consolas", monospace;
  color-scheme: dark;
}

html, body {
  margin: 0;
  min-height: 100%;
  font-family: var(--ge-font-sans);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(61, 156, 240, 0.18), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(60, 186, 122, 0.08), transparent 55%),
    linear-gradient(180deg, #0a101c 0%, var(--ge-bg) 40%, #0a0f18 100%);
  color: var(--ge-text);
}

a {
  color: var(--ge-accent);
  text-decoration: none;
}

a:hover {
  color: #7bbcff;
}

h1, h2, h3 {
  letter-spacing: 0.01em;
  font-weight: 650;
}

.page-shell {
  display: grid;
  grid-template-columns: 250px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: rgba(10, 16, 28, 0.92);
  border-right: 1px solid var(--ge-border);
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.25rem 0.5rem 0.75rem;
  border-bottom: 1px solid var(--ge-border);
}

.brand-lockup {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  color: inherit;
  text-decoration: none;
}

.brand-lockup:hover {
  color: inherit;
  text-decoration: none;
}

.brand-lockup-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.brand-mark {
  display: block;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
}

.brand-lockup-login {
  margin-bottom: 0.35rem;
  flex-direction: row;
  align-items: center;
  gap: 0.7rem;
}

.brand-lockup-login .brand-mark {
  width: 48px;
  height: 48px;
}

.brand-name {
  font-size: 1.45rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  line-height: 1.15;
}

.brand-tag {
  color: var(--ge-muted);
  font-size: 0.78rem;
  line-height: 1.25;
  white-space: nowrap;
}

.nav-section {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.nav-link {
  display: block;
  padding: 0.55rem 0.7rem;
  border-radius: 0.4rem;
  color: var(--ge-text);
}

.nav-link:hover,
.nav-link.active {
  background: var(--ge-bg-panel);
  color: #fff;
}

.nav-link.active {
  border-left: 3px solid var(--ge-accent);
}

.content {
  padding: 1.5rem 1.75rem 2.5rem;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  gap: 1rem;
}

.demo-banner {
  background: rgba(224, 161, 6, 0.12);
  border: 1px solid rgba(224, 161, 6, 0.45);
  color: #f2d48a;
  padding: 0.65rem 0.9rem;
  border-radius: 0.45rem;
  margin-bottom: 1rem;
  font-size: 0.92rem;
}

.panel {
  background: rgba(18, 26, 43, 0.88);
  border: 1px solid var(--ge-border);
  border-radius: 0.55rem;
  padding: 1rem 1.1rem;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.stat-card {
  background: var(--ge-bg-elevated);
  border: 1px solid var(--ge-border);
  border-radius: 0.5rem;
  padding: 0.9rem 1rem;
}

.stat-card .label {
  color: var(--ge-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-card .value {
  font-size: 1.6rem;
  font-weight: 700;
  margin-top: 0.25rem;
  font-variant-numeric: tabular-nums;
}

.table-wrap {
  overflow-x: auto;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

table.data th,
table.data td {
  text-align: left;
  padding: 0.65rem 0.55rem;
  border-bottom: 1px solid var(--ge-border);
  vertical-align: top;
}

table.data th {
  color: var(--ge-muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 0.3rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.badge-demo {
  background: rgba(224, 161, 6, 0.2);
  color: #f0c45a;
  border: 1px solid rgba(224, 161, 6, 0.45);
}

.badge-status {
  background: rgba(61, 156, 240, 0.15);
  color: #8ec5f8;
  border: 1px solid rgba(61, 156, 240, 0.35);
}

.muted {
  color: var(--ge-muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border: 1px solid var(--ge-border);
  background: var(--ge-bg-panel);
  color: var(--ge-text);
  border-radius: 0.4rem;
  padding: 0.45rem 0.85rem;
  cursor: pointer;
  font: inherit;
}

.btn-primary {
  background: var(--ge-accent-strong);
  border-color: var(--ge-accent);
  color: #fff;
}

.btn-primary:hover {
  filter: brightness(1.08);
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.login-card {
  width: min(420px, 100%);
  background: rgba(18, 26, 43, 0.95);
  border: 1px solid var(--ge-border);
  border-radius: 0.65rem;
  padding: 1.5rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.login-card h1 {
  margin: 0 0 0.35rem;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.9rem;
}

.form-field input,
.form-field select {
  background: #0d1524;
  border: 1px solid var(--ge-border);
  border-radius: 0.4rem;
  color: var(--ge-text);
  padding: 0.55rem 0.7rem;
  font: inherit;
}

.form-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
}

.form-grid .form-field {
  margin-bottom: 0;
}

.segment-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.segment-tabs .btn.active {
  background: var(--ge-accent-strong);
  border-color: var(--ge-accent);
  color: #fff;
}

.segment-tabs.secondary {
  margin-bottom: 0.85rem;
}

.segment-tabs.secondary .btn {
  padding: 0.35rem 0.7rem;
  font-size: 0.9rem;
}

.admin-action-grid {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr));
}

.status-line {
  margin: -0.35rem 0 1rem;
}

.runbook-steps {
  margin: 0.5rem 0 0;
  padding-left: 1.35rem;
  display: grid;
  gap: 0.55rem;
}

.runbook-steps li {
  line-height: 1.45;
}

.runbook-steps .step-title {
  font-weight: 650;
  color: var(--ge-text);
}

.runbook-note {
  margin: 0.85rem 0 0;
}

.howto-list {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
  display: grid;
  gap: 0.4rem;
  line-height: 1.45;
}

.lab-layout {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(12rem, 16rem) minmax(0, 1fr);
  align-items: start;
}

.lab-sidebar {
  min-width: 0;
}

.lab-main {
  min-width: 0;
  display: grid;
  gap: 1rem;
}

.strategy-list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 28rem;
  overflow-y: auto;
  display: grid;
  gap: 0.35rem;
}

.strategy-list .btn {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.35;
}

.strategy-list .btn.active {
  background: var(--ge-accent-strong);
  border-color: var(--ge-accent);
  color: #fff;
}

.lab-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.compare-picks {
  display: grid;
  gap: 0.4rem;
  max-height: 14rem;
  overflow: auto;
  margin-bottom: 0.75rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--ge-border);
  border-radius: 0.4rem;
  background: rgba(13, 21, 36, 0.55);
}

.compare-picks label {
  display: flex;
  gap: 0.45rem;
  align-items: flex-start;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

@media (max-width: 900px) {
  .lab-layout {
    grid-template-columns: 1fr;
  }
}

.page-intro {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}

.page-intro h1 {
  margin: 0;
}

.page-intro-lead {
  margin: 0.3rem 0 0;
}

.bt-coverage {
  margin-bottom: 0.55rem;
}

.bt-coverage-meta {
  margin: 0 0 1rem;
  font-size: 0.85rem;
  line-height: 1.45;
}

.bt-layout .lab-sidebar h2,
.bt-layout .lab-main h2 {
  margin-top: 0;
  font-size: 1.05rem;
}

.bt-sidebar-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.bt-sidebar-head h2 {
  margin: 0;
}

.bt-run-name {
  display: block;
  font-weight: 650;
}

.bt-run-meta {
  display: block;
  font-size: 0.78rem;
  margin-top: 0.15rem;
}

.bt-subhead {
  margin: 1.1rem 0 0.55rem;
  font-size: 0.95rem;
}

.bt-staking-note {
  margin: 0 0 0.65rem;
  font-size: 0.85rem;
}

.bt-result-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}

.bt-result-head h2 {
  margin: 0;
}

.bt-metrics {
  margin-bottom: 0.75rem;
}

.bt-metrics .value-sm {
  font-size: 1.2rem;
}

.bt-extra-metrics {
  margin: 0 0 0.75rem;
  font-size: 0.88rem;
  line-height: 1.45;
}

.bt-chart {
  margin-top: 0.35rem;
  max-width: 100%;
}

.label-guide {
  margin-bottom: 1rem;
}

.label-guide summary {
  cursor: pointer;
  font-weight: 650;
  font-size: 1.05rem;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.label-guide summary::-webkit-details-marker {
  display: none;
}

.label-guide summary::before {
  content: "▸";
  color: var(--ge-muted);
  font-size: 0.9rem;
  line-height: 1;
}

.label-guide[open] summary::before {
  content: "▾";
}

.label-guide[open] summary {
  margin-bottom: 0.75rem;
}

.label-guide-list {
  display: grid;
  gap: 0.65rem;
  margin: 0;
}

.label-guide-list > div {
  display: grid;
  grid-template-columns: minmax(7.5rem, 9.5rem) minmax(0, 1fr);
  gap: 0.55rem 0.85rem;
  align-items: start;
}

.label-guide-list dt {
  margin: 0;
  font-weight: 650;
  color: var(--ge-text);
}

.label-guide-list dd {
  margin: 0;
  color: var(--ge-muted);
  line-height: 1.4;
  font-size: 0.92rem;
}

.label-guide-list code {
  font-family: var(--ge-font-mono);
  font-size: 0.86em;
  color: var(--ge-text);
}

@media (max-width: 700px) {
  .label-guide-list > div {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }
}

.error-text {
  color: var(--ge-danger);
  margin-bottom: 0.75rem;
}

.placeholder-note {
  color: var(--ge-muted);
  line-height: 1.5;
}

.badge-fresh {
  background: rgba(60, 186, 122, 0.18);
  color: #7ad9a8;
  border: 1px solid rgba(60, 186, 122, 0.4);
}

.badge-stale {
  background: rgba(224, 161, 6, 0.18);
  color: #f0c45a;
  border: 1px solid rgba(224, 161, 6, 0.4);
}

.row-primary td:first-child {
  font-weight: 650;
}

.odds-chart {
  width: 100%;
  max-width: 640px;
  height: auto;
  display: block;
}

.odds-chart-bg {
  fill: rgba(13, 21, 36, 0.9);
}

.odds-chart-grid {
  stroke: rgba(42, 58, 85, 0.7);
  stroke-width: 1;
}

.odds-chart-line {
  stroke: var(--ge-accent);
  stroke-width: 2.2;
}

.odds-chart-dot {
  fill: var(--ge-accent);
}

.odds-chart-dot.unavailable {
  fill: var(--ge-warning);
}

.odds-chart-label {
  fill: var(--ge-muted);
  font-size: 10px;
}

@media (max-width: 900px) {
  .page-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: none;
    border-bottom: 1px solid var(--ge-border);
  }

  .nav-section {
    flex-direction: row;
    flex-wrap: wrap;
  }
}

.league-page-header {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 0.85rem;
}

.league-page-logo {
  width: 3.5rem;
  height: 3.5rem;
  object-fit: contain;
  border-radius: 0.85rem;
  flex: 0 0 auto;
  background: #fff;
  padding: 0.2rem;
  box-shadow: 0 8px 20px rgba(8, 16, 32, 0.18);
}

.league-page-copy h1 {
  margin: 0;
}

.league-page-copy .muted {
  margin: 0.3rem 0 0;
  max-width: 42rem;
}

.league-page-official {
  margin: 0.45rem 0 0;
  font-size: 0.92rem;
}

.league-page-official a {
  font-weight: 600;
}

.dash-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.1rem;
  flex-wrap: wrap;
}

.dash-hero h1 {
  margin: 0;
  font-size: 1.85rem;
}

.dash-subtitle {
  margin: 0.25rem 0 0;
}

.dash-hero-note {
  margin: 0.35rem 0 0;
  max-width: 22rem;
  text-align: right;
  font-size: 0.88rem;
  line-height: 1.4;
}

.rec-section {
  margin-bottom: 1.25rem;
}

.rec-section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.rec-section-head h2 {
  margin: 0;
  font-size: 1.15rem;
}

.rec-list {
  display: grid;
  gap: 0.85rem;
}

.rec-card {
  display: block;
  background: rgba(18, 26, 43, 0.92);
  border: 1px solid var(--ge-border);
  border-radius: 0.75rem;
  padding: 1rem 1.1rem;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.rec-card:hover {
  border-color: rgba(61, 156, 240, 0.55);
  background: rgba(23, 34, 53, 0.98);
  color: inherit;
  text-decoration: none;
}

.rec-card-league {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  font-weight: 650;
  margin-bottom: 0.2rem;
}

.rec-card-matchup {
  font-size: 0.92rem;
}

.rec-card-kickoff {
  font-size: 0.8rem;
  margin-top: 0.15rem;
}

.rec-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0.9rem 0 0.85rem;
}

.rec-metrics .label {
  color: var(--ge-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.rec-metric-value {
  margin-top: 0.2rem;
  font-size: 1.2rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.roi-positive {
  color: var(--ge-success);
}

.roi-negative {
  color: var(--ge-danger);
}

.rec-callout {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  background: rgba(13, 21, 36, 0.75);
  border: 1px solid rgba(42, 58, 85, 0.9);
  border-radius: 0.55rem;
  padding: 0.7rem 0.8rem;
  font-size: 0.92rem;
  line-height: 1.4;
}

.rec-callout-icon {
  flex-shrink: 0;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  margin-top: 0.05rem;
}

.rec-callout.tone-positive {
  border-color: rgba(60, 186, 122, 0.35);
}

.rec-callout.tone-positive .rec-callout-icon {
  background: rgba(60, 186, 122, 0.18);
  color: #7ad9a8;
}

.rec-callout.tone-caution {
  border-color: rgba(227, 93, 106, 0.35);
}

.rec-callout.tone-caution .rec-callout-icon {
  background: rgba(227, 93, 106, 0.18);
  color: #f0a0a8;
}

.rec-callout.tone-neutral .rec-callout-icon {
  background: rgba(61, 156, 240, 0.15);
  color: #8ec5f8;
}

.rec-disclaimer {
  margin: 0.85rem 0 0;
  font-size: 0.82rem;
  line-height: 1.4;
}

.ops-strip {
  margin-top: 0.5rem;
}

.ops-strip summary {
  cursor: pointer;
  font-weight: 650;
  list-style: none;
}

.ops-strip summary::-webkit-details-marker {
  display: none;
}

.ops-strip[open] summary {
  margin-bottom: 0.75rem;
}

.ops-strip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
}

.ops-strip-grid .label {
  color: var(--ge-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.2rem;
}

@media (max-width: 700px) {
  .dash-hero-note {
    text-align: left;
    max-width: none;
  }

  .rec-metrics {
    grid-template-columns: 1fr;
  }
}

/* Blazor shows this only when a real circuit error occurs (sets display). */
#blazor-error-ui {
  background: #3a1d24;
  border-top: 1px solid var(--ge-danger);
  bottom: 0;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.35);
  color: #f6d5d9;
  display: none;
  left: 0;
  padding: 0.75rem 1.25rem;
  position: fixed;
  width: 100%;
  z-index: 1000;
}

#blazor-error-ui .reload {
  margin-left: 0.75rem;
}

#blazor-error-ui .dismiss {
  cursor: pointer;
  position: absolute;
  right: 0.9rem;
  top: 0.65rem;
}
