:root {
  --bg: #030503;
  --panel: #0b0f0b;
  --panel-soft: #111812;
  --panel-hover: #122016;
  --line: #1f3325;
  --line-strong: #31533b;
  --text: #f2f5f1;
  --muted: #aab4aa;
  --accent: #24f86a;
  --accent-strong: #76ff9c;
  --accent-soft: #0b3518;
  --good: #24f86a;
  --good-soft: #0b3518;
  --bad: #ff5c6c;
  --bad-soft: #351016;
  --warn: #f0bd65;
  --warn-soft: #44331a;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(36, 248, 106, 0.08), transparent 28rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
}

button,
input,
select {
  font: inherit;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at top, rgba(36, 248, 106, 0.12), transparent 30rem),
    var(--bg);
}

.login-panel {
  width: min(100%, 380px);
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  background: rgba(11, 15, 11, 0.98);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.login-logo {
  width: 72px;
  height: 72px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  object-fit: cover;
  background: #000;
}

.login-panel h1 {
  font-size: 26px;
}

.login-panel p {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.login-panel button {
  margin-top: 4px;
  background: var(--accent);
  border-color: var(--accent);
  color: #061008;
  font-weight: 800;
}

.login-panel .text-button {
  justify-self: start;
  margin-top: -4px;
  padding: 0;
  background: transparent;
  border: 0;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.login-panel .text-button:hover {
  color: var(--accent);
  text-decoration: underline;
}

.login-panel .text-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.secondary-button {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--accent-strong);
}

.login-error {
  min-height: 18px;
  color: var(--bad);
  font-weight: 700;
}

.login-message {
  color: var(--muted);
  line-height: 1.45;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.62);
}

.modal-panel {
  width: min(100%, 420px);
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  background: var(--panel);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}

.modal-panel h2 {
  margin: 0;
  font-size: 20px;
}

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

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
}

.checkbox-label input {
  width: auto;
}

.row-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.row-action-button {
  padding: 5px 9px;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  background: rgba(118, 255, 156, 0.08);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
}

.row-action-button.danger {
  background: rgba(255, 92, 108, 0.08);
  border-color: rgba(255, 92, 108, 0.42);
  color: var(--bad);
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 24px;
  background: rgba(5, 8, 5, 0.96);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(36, 248, 106, 0.16);
  position: sticky;
  top: 0;
  z-index: 10;
}

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

.brand-logo {
  width: 58px;
  height: 58px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #000;
  object-fit: cover;
  box-shadow: 0 0 22px rgba(36, 248, 106, 0.18);
  flex: 0 0 auto;
}

.brand-copy {
  min-width: 0;
}

.brand-kicker {
  display: block;
  margin: 2px 0 3px;
  color: var(--text);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 21px;
  line-height: 1.25;
  color: var(--accent);
}

#statusText {
  margin-top: 4px;
  color: var(--muted);
}

#statusText:empty {
  display: none;
}

.status-link {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.status-link:hover {
  text-decoration: underline;
}

.team-tag {
  color: var(--muted);
  font-weight: 700;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.controls,
.toolbar {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
}

label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

input {
  height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 0 10px;
  background: var(--panel-soft);
  color: var(--text);
  min-width: 132px;
}

select {
  height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 0 32px 0 10px;
  background: var(--panel-soft);
  color: var(--text);
  min-width: 240px;
}

.persona-control select {
  min-width: 116px;
}

button {
  height: 36px;
  border: 1px solid var(--line-strong);
  background: var(--panel-soft);
  color: var(--text);
  border-radius: 6px;
  padding: 0 12px;
  cursor: pointer;
}

button:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

#refreshModelButton {
  background: var(--accent);
  border-color: var(--accent);
  color: #061008;
  font-weight: 700;
}

#refreshButton {
  font-weight: 700;
}

#exportButton {
  font-weight: 700;
}

.user-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 10px;
  background: var(--panel);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

main {
  padding: 18px 24px 28px;
}

.walkers-ticker {
  display: flex;
  align-items: center;
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  margin-bottom: 16px;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.ticker-label {
  align-self: stretch;
  display: flex;
  align-items: center;
  padding: 0 16px;
  background: var(--accent-soft);
  border-right: 1px solid var(--line-strong);
  color: var(--accent);
  font-weight: 850;
  white-space: nowrap;
}

.ticker-window {
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

.ticker-track {
  display: inline-flex;
  align-items: center;
  gap: 28px;
  padding-left: 18px;
  white-space: nowrap;
}

.ticker-track.scrolling {
  animation: ticker-scroll 150s linear infinite;
}

.ticker-item {
  color: var(--text);
  font-size: 15px;
  font-weight: 750;
}

.ticker-item::after {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-left: 28px;
  border-radius: 50%;
  background: var(--accent);
  vertical-align: middle;
}

@keyframes ticker-scroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

.toolbar {
  justify-content: space-between;
  margin-bottom: 12px;
}

.table-filters {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
}

.tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tab,
.subtab {
  background: var(--panel-soft);
}

.tab.active,
.subtab.active {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
  font-weight: 750;
}

.subtabs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin: -2px 0 12px;
}

.subtab-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  margin: 0 2px 0 8px;
  text-transform: uppercase;
}

.subtab-label:first-child {
  margin-left: 0;
}

.search input {
  width: 260px;
}

.chart-region {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 12px;
  overflow: hidden;
}

.chart-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.chart-heading h2 {
  margin: 0;
  font-size: 16px;
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.legend-item {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: inherit;
  font-weight: 750;
  padding: 3px 4px;
  transition: color 140ms ease, opacity 140ms ease;
}

.legend-item:hover,
.legend-item.active {
  color: var(--text);
}

.legend-item.dimmed {
  opacity: 0.38;
}

.legend-line,
.legend-bar {
  width: 18px;
  height: 3px;
  border-radius: 999px;
}

.legend-bar {
  height: 10px;
  background: #6f7872;
}

.legend-line {
  background: var(--accent);
}

.model-a-line {
  background: #8fd69d;
}

.model-b-line {
  background: #8cb7ff;
}

.model-c-line {
  background: #f2c879;
}

.gb-score-line {
  background: #d0f06c;
}

.chart-grid-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  background: var(--line);
}

.chart-panel {
  min-width: 0;
  background: var(--panel);
}

.chart-panel h3 {
  margin: 0;
  padding: 12px 16px 0;
  font-size: 13px;
  color: var(--text);
}

.chart {
  height: 560px;
  padding: 10px 14px 14px;
}

.chart svg {
  width: 100%;
  height: 100%;
  display: block;
}

.chart-grid {
  stroke: var(--line);
  stroke-width: 1;
}

.chart-label {
  fill: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.trend-line {
  fill: none;
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: opacity 140ms ease, stroke-width 140ms ease;
}

.model-trend-line {
  cursor: pointer;
}

.model-trend-point {
  cursor: pointer;
  stroke: rgba(0, 0, 0, 0.48);
  stroke-width: 0.8;
  transition: opacity 140ms ease, r 140ms ease;
}

.actual-line {
  stroke: #8fd69d;
  background: #8fd69d;
}

.projection-bar {
  fill: #6f7872;
  opacity: 0.58;
}

.chart-empty {
  height: 100%;
  display: grid;
  place-items: center;
}

.table-region {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.table-heading {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.table-heading h2 {
  font-size: 16px;
}

.model-performance-selectors {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-wrap: wrap;
}

.model-performance-selectors[hidden] {
  display: none;
}

.model-selector {
  height: 32px;
  padding: 0 12px;
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.model-selector:hover,
.model-selector.active {
  border-color: rgba(36, 248, 106, 0.58);
  background: rgba(36, 248, 106, 0.13);
  color: var(--accent-strong);
}

.share-watchlist-button {
  margin-left: auto;
  border-color: var(--accent);
  background: rgba(36, 248, 106, 0.12);
  color: var(--accent-strong);
  font-weight: 800;
}

.share-watchlist-button.danger {
  border-color: rgba(255, 92, 108, 0.42);
  background: rgba(255, 92, 108, 0.08);
  color: var(--bad);
}

.share-watchlist-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.table-wrap {
  overflow: auto;
  max-height: calc(100vh - 275px);
}

.data-credit {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 1120px;
}

th,
td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  background: #0f1711;
  color: #dce6dc;
  z-index: 2;
  font-size: 12px;
  font-weight: 800;
}

.column-header {
  display: flex;
  align-items: center;
  gap: 4px;
}

.sort-header {
  position: relative;
  width: 100%;
  height: auto;
  min-height: 24px;
  border: 0;
  border-radius: 4px;
  padding: 2px 0;
  background: transparent;
  color: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
  font-size: inherit;
  font-weight: inherit;
  text-align: left;
  min-width: 0;
}

.sort-header:hover {
  border-color: transparent;
  color: var(--accent);
}

.sort-header::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: max-content;
  max-width: 260px;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #050805;
  color: var(--text);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  text-align: left;
  transform: translateY(-3px);
  transition: opacity 120ms ease, transform 120ms ease;
  white-space: normal;
  z-index: 50;
}

.sort-header:hover::after,
.sort-header:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

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

.sort-indicator {
  display: inline-flex;
  min-width: 8px;
  color: var(--accent);
  font-size: 11px;
}

td.numeric,
th.numeric {
  text-align: right;
}

th.numeric .sort-header {
  justify-content: flex-end;
  text-align: right;
}

th.numeric .sort-header::after {
  right: 0;
  left: auto;
}

.column-hide-button,
.column-add-button {
  width: 22px;
  min-width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 999px;
  font-size: 16px;
  line-height: 1;
  font-weight: 900;
  flex: 0 0 auto;
}

.column-hide-button {
  border-color: rgba(255, 92, 108, 0.35);
  background: rgba(255, 92, 108, 0.08);
  color: #ff8d98;
}

.column-add-button {
  border-color: rgba(36, 248, 106, 0.35);
  background: rgba(36, 248, 106, 0.10);
  color: var(--accent);
}

.column-add-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.column-control-header {
  position: sticky;
  right: 0;
  width: 42px;
  min-width: 42px;
  text-align: center;
  z-index: 4;
}

.column-control-cell {
  position: sticky;
  right: 0;
  width: 42px;
  min-width: 42px;
  background: var(--panel);
  border-left: 1px solid var(--line);
}

.column-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 8px;
  display: grid;
  gap: 6px;
  min-width: 190px;
  max-height: 280px;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #050805;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.45);
  z-index: 80;
}

.column-menu button {
  justify-content: flex-start;
  height: 30px;
  padding: 0 10px;
  text-align: left;
}

.column-menu span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

tbody tr:hover {
  background: var(--panel-hover);
}

.model-score-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  border-radius: 999px;
  padding: 3px 8px;
  font-weight: 750;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.watchlist-button {
  width: 28px;
  min-width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 999px;
  font-size: 18px;
  line-height: 1;
  font-weight: 800;
  background: rgba(67, 190, 96, 0.12);
  color: var(--accent);
}

.watchlist-button.selected {
  background: rgba(211, 74, 87, 0.12);
  color: #ff8d98;
}

.watchlist-button:disabled {
  cursor: progress;
  opacity: 0.6;
}

.empty {
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-width: 72px;
  justify-content: center;
  border-radius: 999px;
  padding: 3px 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 750;
}

.pill.projected {
  background: var(--warn-soft);
  color: var(--warn);
}

.pill.live {
  background: var(--good-soft);
  color: var(--good);
}

.pill.final {
  background: var(--accent-soft);
  color: var(--accent);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  font-size: 12px;
  font-weight: 850;
}

.status-ok {
  color: #8fe49e;
  border-color: rgba(36, 248, 106, 0.24);
  background: rgba(36, 248, 106, 0.11);
}

.status-warning {
  color: #f2cf88;
  border-color: rgba(240, 189, 101, 0.26);
  background: rgba(240, 189, 101, 0.12);
}

.status-error {
  color: #ff9aa4;
  border-color: rgba(255, 92, 108, 0.28);
  background: rgba(255, 92, 108, 0.12);
}

@media (max-width: 840px) {
  .topbar {
    position: static;
    align-items: stretch;
    flex-direction: column;
  }

  .brand-logo {
    width: 50px;
    height: 50px;
  }

  h1 {
    font-size: 19px;
  }

  .walkers-ticker {
    align-items: stretch;
    flex-direction: column;
  }

  .ticker-label {
    min-height: 36px;
    border-right: 0;
    border-bottom: 1px solid var(--line-strong);
  }

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

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

  .chart-grid-layout {
    grid-template-columns: 1fr;
  }

  .chart {
    height: 440px;
  }

  .search input {
    width: min(100%, 320px);
  }

  select {
    width: min(100%, 320px);
  }
}
