/* ============================================================
   Top Lists — dark dashboard design system
   ============================================================ */

:root {
  --bg: #080b10;
  --bg-glow-1: rgba(56, 112, 255, 0.07);
  --bg-glow-2: rgba(246, 196, 83, 0.04);
  --panel: #0e1319;
  --panel-2: #121924;
  --panel-3: #172130;
  --line: #1c2634;
  --line-strong: #263447;
  --text: #e9eff6;
  --text-dim: #9aa9ba;
  --text-faint: #64758a;
  --up: #3fdf9a;
  --up-dim: #2aa574;
  --up-soft: rgba(63, 223, 154, 0.11);
  --down: #ff6b81;
  --down-soft: rgba(255, 107, 129, 0.11);
  --accent: #5b9dff;
  --accent-soft: rgba(91, 157, 255, 0.13);
  --gold: #f6c453;
  --gold-soft: rgba(246, 196, 83, 0.12);
  --bench: #aab7c6;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 10px 34px rgba(0, 0, 0, 0.42);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  background:
    radial-gradient(1100px 500px at 12% -10%, var(--bg-glow-1), transparent 60%),
    radial-gradient(900px 420px at 88% -14%, var(--bg-glow-2), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -0.01em; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
p { margin: 0; }

.num, .data-table td.num, .data-table th.num { text-align: right; }
.pos { color: var(--up); }
.neg { color: var(--down); }
.dim { color: var(--text-dim); }

.app {
  max-width: 1560px;
  margin: 0 auto;
  padding: 14px 22px 30px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 100vh;
}

/* ---------------- App bar ---------------- */

.appbar {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 8px 4px;
}

.brand { display: flex; align-items: center; gap: 11px; }

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.02em;
  color: #0a0f16;
  background: linear-gradient(135deg, var(--gold) 0%, #ffb45e 55%, #ff8a5e 120%);
  box-shadow: 0 4px 18px rgba(246, 196, 83, 0.22);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 15px; letter-spacing: -0.01em; }
.brand-text span { font-size: 11px; color: var(--text-faint); }

.tabs {
  display: flex;
  gap: 4px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
}

.tab {
  border: 0;
  background: transparent;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 560;
  padding: 7px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.tab:hover { color: var(--text); }

.tab.active {
  background: var(--panel-3);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.performance-control, .universe-control {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-faint);
  font-size: 10px;
  font-weight: 680;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.global-range-toggle {
  background: var(--panel);
  align-self: center;
}

.global-range-toggle button {
  font-size: 11.5px;
  letter-spacing: 0;
  text-transform: none;
}

.global-range-toggle button.active {
  color: #d7e7ff;
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px rgba(91, 157, 255, 0.36);
}

.detail-actions { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.detail-universe-control { display: flex; align-items: center; gap: 6px; color: var(--text-faint); font-size: 9px; font-weight: 700; text-transform: uppercase; white-space: nowrap; }
.detail-universe-toggle button { padding-left: 8px; padding-right: 8px; font-size: 10.5px; }

.status-cluster { margin-left: auto; display: flex; gap: 8px; align-items: center; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--text-dim);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  white-space: nowrap;
}

.pill .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-faint);
}

.pill.open .dot { background: var(--up); box-shadow: 0 0 0 3px var(--up-soft); animation: pulse 2.4s infinite; }
.pill.closed .dot { background: var(--text-faint); }
.pill.fresh { color: var(--text); }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px var(--up-soft); }
  50% { box-shadow: 0 0 0 6px rgba(63, 223, 154, 0.05); }
}

/* ---------------- Notices / states ---------------- */

.notice {
  background: var(--down-soft);
  border: 1px solid rgba(255, 107, 129, 0.35);
  color: #ffc9d2;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
}

.hidden { display: none !important; }

.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--panel-2);
  border-radius: var(--radius-sm);
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.045) 50%, transparent 70%);
  animation: shimmer 1.6s infinite;
}

@keyframes shimmer {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}

.empty-state {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--text-dim);
  font-size: 13px;
  text-align: center;
  padding: 20px;
  background: rgba(8, 11, 16, 0.55);
  border-radius: var(--radius-sm);
}

/* ---------------- Views ---------------- */

.content { display: block; }
.view { display: none; flex-direction: column; gap: 14px; }
.view.active { display: flex; }

/* ---------------- Hero ---------------- */

.hero {
  position: relative;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background:
    radial-gradient(640px 300px at 8% -30%, rgba(91, 157, 255, 0.14), transparent 60%),
    radial-gradient(560px 280px at 92% -40%, rgba(246, 196, 83, 0.12), transparent 55%),
    linear-gradient(180deg, var(--panel-2), var(--panel));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero-skeleton { height: 168px; margin: 18px; }

.hero-inner {
  display: grid;
  grid-template-columns: minmax(300px, 1.15fr) minmax(260px, 1fr) minmax(215px, 0.62fr);
  gap: 26px;
  padding: 22px 26px;
  align-items: center;
}

.hero-eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--gold);
  font-weight: 650;
  margin-bottom: 8px;
}

.hero-headline {
  font-size: 24px;
  font-weight: 720;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 14px;
}

.hero-headline b { color: var(--up); font-weight: 760; }

.hero-stats { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }

.hero-stat { display: flex; flex-direction: column; gap: 2px; }
.hero-stat span { font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.09em; }
.hero-stat strong {
  font-size: 30px;
  font-weight: 740;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.hero-vs { color: var(--text-faint); font-size: 13px; font-weight: 600; padding-top: 12px; }

.hero-delta {
  align-self: center;
  font-size: 13px;
  font-weight: 680;
  border-radius: 999px;
  padding: 7px 13px;
  font-variant-numeric: tabular-nums;
}

.hero-delta.pos { background: var(--up-soft); color: var(--up); border: 1px solid rgba(63, 223, 154, 0.3); }
.hero-delta.neg { background: var(--down-soft); color: var(--down); border: 1px solid rgba(255, 107, 129, 0.3); }

.hero-sub { margin-top: 12px; font-size: 12px; color: var(--text-faint); }

.hero-chart-block { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.hero-chart { position: relative; height: 148px; }
.hero-chart svg { width: 100%; height: 100%; display: block; }

.hero-chart-legend { display: flex; gap: 14px; font-size: 11px; color: var(--text-dim); }
.hero-chart-legend i {
  display: inline-block;
  width: 14px;
  height: 3px;
  border-radius: 2px;
  margin-right: 5px;
  vertical-align: middle;
}

.hero-side { display: flex; flex-direction: column; gap: 10px; }

.hero-badge {
  background: rgba(8, 11, 16, 0.5);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hero-badge > span {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--text-faint);
  font-weight: 640;
}

.hero-badge strong { font-size: 13px; font-weight: 640; line-height: 1.25; }
.hero-badge .badge-value { font-size: 19px; font-weight: 720; font-variant-numeric: tabular-nums; }
.hero-badge small { font-size: 11px; color: var(--text-dim); }

/* ---------------- KPI strip ---------------- */

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

.kpi {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.kpi > span {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  font-weight: 640;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kpi strong {
  font-size: 19px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kpi small {
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------------- Panels ---------------- */

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.panel-head.compact { align-items: center; }

.eyebrow {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-faint);
  font-weight: 650;
  margin-bottom: 3px;
}

.detail-meta { font-size: 12px; color: var(--text-dim); margin-top: 4px; }

.dash-grid {
  display: grid;
  grid-template-columns: minmax(440px, 545px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

/* ---------------- Family filter / chips ---------------- */

.list-filter-controls { display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
.family-filter { display: contents; }

.chip {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-dim);
  font-size: 11.5px;
  font-weight: 580;
  padding: 5px 11px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.chip:hover { color: var(--text); border-color: var(--line-strong); }
.chip.active { background: var(--accent-soft); border-color: rgba(91, 157, 255, 0.45); color: #bcd6ff; }

.model-filter { position: relative; }
.model-filter summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  color: var(--text-dim);
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}
.model-filter summary::-webkit-details-marker { display: none; }
.model-filter summary::after { content: "⌄"; color: var(--text-faint); font-size: 11px; }
.model-filter[open] summary, .model-filter.active summary { border-color: rgba(91, 157, 255, 0.45); color: #bcd6ff; }
.filter-count { min-width: 17px; height: 17px; padding: 0 4px; display: inline-grid; place-items: center; border-radius: 999px; background: var(--accent-soft); color: #bcd6ff; font-size: 9px; }
.model-filter-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 7px);
  right: 0;
  width: 224px;
  padding: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #111821;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.38);
}
.model-filter-head, .model-filter-option { display: flex; align-items: center; }
.model-filter-head { justify-content: space-between; padding: 3px 5px 7px; color: var(--text-faint); font-size: 9.5px; font-weight: 700; text-transform: uppercase; }
.model-filter-head button { border: 0; background: transparent; color: var(--accent); font: inherit; cursor: pointer; text-transform: none; }
.model-filter-head button:disabled { color: var(--text-faint); cursor: default; opacity: 0.55; }
.model-filter-option { gap: 8px; padding: 7px 6px; border-radius: 5px; color: var(--text-dim); font-size: 11.5px; cursor: pointer; }
.model-filter-option:hover { background: rgba(255,255,255,0.04); color: var(--text); }
.model-filter-option input { accent-color: var(--accent); }
.model-filter-option small { margin-left: auto; color: var(--text-faint); font-size: 10px; }
.model-chip { display: inline-block; padding: 2px 6px; border: 1px solid var(--line); border-radius: 5px; color: var(--text-dim); font-size: 9.5px; font-weight: 650; vertical-align: middle; }
.filter-empty { height: 92px; text-align: center; color: var(--text-faint); }

.family-chip {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  border-radius: 5px;
  padding: 2px 6px;
  vertical-align: middle;
}

.family-chip.agent_trader { background: rgba(139, 92, 246, 0.16); color: #c9b3ff; }
.family-chip.top30 { background: rgba(91, 157, 255, 0.14); color: #a9ccff; }
.family-chip.top50 { background: rgba(75, 198, 207, 0.14); color: #9fe6eb; }
.family-chip.top100 { background: rgba(63, 223, 154, 0.13); color: #97ecc6; }
.family-chip.special { background: var(--gold-soft); color: #ffe1a1; }

/* ---------------- Tables ---------------- */

.table-scroll {
  overflow: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(8, 11, 16, 0.35);
}

.leaderboard-scroll { max-height: 720px; }
.constituent-scroll { max-height: 430px; }
.health-scroll { max-height: 420px; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  min-width: 460px;
}

.data-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--panel-2);
  color: var(--text-faint);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-weight: 650;
  text-align: left;
  padding: 9px 11px;
  border-bottom: 1px solid var(--line-strong);
  white-space: nowrap;
}

.data-table td {
  padding: 8px 11px;
  border-bottom: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  vertical-align: middle;
}

.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover td { background: rgba(255, 255, 255, 0.022); }

.sort-button {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.sort-button:hover { color: var(--text); }
.sort-button.active { color: var(--accent); }
.sort-indicator { font-size: 10px; min-width: 8px; }

/* leaderboard specifics */

.leaderboard-table tbody tr { cursor: pointer; }

.leaderboard-table tbody tr.active td {
  background: var(--accent-soft);
}

.leaderboard-table tbody tr.active td:first-child { box-shadow: inset 3px 0 0 var(--accent); }

.lb-rank { color: var(--text-faint); font-weight: 620; width: 30px; }

.data-table td.lb-name {
  max-width: 190px;
  font-weight: 570;
  white-space: normal;
}

.lb-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 12px;
  line-height: 1.28;
}

.lb-name .lb-sub { display: block; font-size: 10px; color: var(--text-faint); font-weight: 500; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.leaderboard-table th, .leaderboard-table td { padding-left: 7px; padding-right: 7px; }
.leaderboard-table td { font-size: 12px; padding-top: 7px; padding-bottom: 7px; }
.leaderboard-table { min-width: 0; }

.spark-col { width: 68px; }
.spark-cell svg { display: block; }

.delta-chip {
  display: inline-block;
  font-size: 11px;
  font-weight: 660;
  border-radius: 6px;
  padding: 2px 7px;
  font-variant-numeric: tabular-nums;
}

.delta-chip.pos { background: var(--up-soft); color: var(--up); }
.delta-chip.neg { background: var(--down-soft); color: var(--down); }
.delta-chip.zero { background: var(--panel-3); color: var(--text-dim); }

/* constituents */

.constituent-controls { display: flex; gap: 8px; align-items: center; }

.constituent-controls input[type="search"] {
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  padding: 7px 11px;
  width: 200px;
  outline: none;
}

.constituent-controls input[type="search"]:focus { border-color: var(--accent); }

select {
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  padding: 7px 9px;
  outline: none;
  cursor: pointer;
}

.constituent-table .company {
  max-width: 210px;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-dim);
}

.return-col { min-width: 130px; }

.return-cell { position: relative; }

.return-cell .bar {
  position: absolute;
  top: 20%;
  bottom: 20%;
  border-radius: 3px;
  opacity: 0.18;
}

.return-cell .bar.pos { background: var(--up); right: 0; }
.return-cell .bar.neg { background: var(--down); right: 0; }
.return-cell b { position: relative; font-weight: 640; }

.status-pill {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 660;
  border-radius: 999px;
  padding: 2.5px 9px;
  letter-spacing: 0.02em;
  cursor: default;
}

.status-pill.fresh { background: var(--up-soft); color: var(--up); }
.status-pill.stale { background: var(--gold-soft); color: var(--gold); }
.status-pill.baseline_pending { background: var(--accent-soft); color: #a9ccff; }
.status-pill.current_missing, .status-pill.baseline_missing { background: var(--down-soft); color: var(--down); }
.status-pill.unknown { background: var(--panel-3); color: var(--text-dim); }

/* ---------------- Range toggle / legend ---------------- */

.range-toggle {
  display: inline-flex;
  gap: 2px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  align-self: flex-start;
}

.range-toggle button {
  border: 0;
  background: transparent;
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 580;
  padding: 5px 13px;
  border-radius: 999px;
  cursor: pointer;
}

.range-toggle button:hover { color: var(--text); }
.range-toggle button.active { background: var(--panel-3); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-strong); }

.legend { display: flex; gap: 7px; flex-wrap: wrap; }

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-dim);
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 570;
  padding: 4.5px 11px;
  cursor: pointer;
  transition: all 0.15s;
}

.legend-item:hover { color: var(--text); border-color: var(--line-strong); }
.legend-item.focused { color: var(--text); border-color: var(--line-strong); background: rgba(255, 255, 255, 0.03); }
.legend-item.disabled { opacity: 0.42; }
.legend-item.disabled .legend-swatch { background: var(--text-faint) !important; }

.legend-swatch { width: 10px; height: 10px; border-radius: 3px; flex: none; }

/* ---------------- Chart ---------------- */

.chart-wrap {
  position: relative;
  height: 380px;
  min-width: 0;
}

.chart-wrap.tall { height: 460px; }

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

.chart-tooltip {
  position: absolute;
  pointer-events: none;
  background: rgba(10, 14, 20, 0.96);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  padding: 9px 12px;
  font-size: 12px;
  min-width: 190px;
  max-width: 260px;
  opacity: 0;
  transition: opacity 0.1s;
  z-index: 5;
}

.chart-tooltip.show { opacity: 1; }
.chart-tooltip .tt-head { font-weight: 640; color: var(--text-dim); font-size: 11.5px; margin-bottom: 6px; }

.tooltip-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 1.5px 0;
  font-variant-numeric: tabular-nums;
}

.tooltip-row span { display: inline-flex; align-items: center; gap: 6px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tooltip-row i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; flex: none; }
.tooltip-row b { font-weight: 640; white-space: nowrap; }

/* ---------------- Cutoff cards ---------------- */

.cutoff-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(138px, 1fr);
  gap: 9px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.cutoff-card {
  border: 1px solid var(--line);
  background: var(--panel-2);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  cursor: pointer;
  text-align: left;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: border-color 0.15s, background 0.15s;
  min-width: 0;
}

.cutoff-card:hover { border-color: var(--line-strong); }

.cutoff-card.active {
  border-color: rgba(91, 157, 255, 0.55);
  background: linear-gradient(180deg, rgba(91, 157, 255, 0.09), var(--panel-2));
}

.cutoff-card.hidden-series { opacity: 0.5; }

.cutoff-card .cc-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.cutoff-card .cc-label { font-size: 12px; font-weight: 650; display: inline-flex; align-items: center; gap: 6px; }
.cutoff-card .cc-label .legend-swatch { width: 8px; height: 8px; }
.cutoff-card .cc-score { font-size: 12px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.cutoff-card .cc-return { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.cutoff-card .cc-meta { font-size: 10.5px; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------------- Compare ---------------- */

.compare-picker {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.compare-family { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; min-width: 0; }

.compare-family .cf-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  font-weight: 650;
  min-width: 92px;
}

.compare-family .cf-chips { display: flex; gap: 6px; flex-wrap: wrap; min-width: 0; max-width: 100%; }
.compare-family .cf-chips .chip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }

.chip .chip-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 3px;
  margin-right: 6px;
  background: var(--text-faint);
}

.chip.selected { color: var(--text); border-color: var(--line-strong); background: rgba(255, 255, 255, 0.035); }

.compare-table td:first-child { max-width: 330px; overflow: hidden; text-overflow: ellipsis; }
.compare-table .cmp-dot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 8px; }

/* ---------------- Health ---------------- */

.health-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}

.health-wide { grid-column: 1 / -1; }

.health-grid .data-table td { white-space: normal; }
.health-grid .data-table td.wrap { max-width: 480px; overflow-wrap: anywhere; color: var(--text-dim); font-size: 12px; }

.run-pill {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 680;
  border-radius: 999px;
  padding: 2.5px 9px;
}

.run-pill.inserted { background: var(--up-soft); color: var(--up); }
.run-pill.skipped { background: var(--panel-3); color: var(--text-dim); }
.run-pill.error { background: var(--down-soft); color: var(--down); }

/* ---------------- Footer ---------------- */

.foot {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  color: var(--text-faint);
  font-size: 11.5px;
  padding: 4px 6px 0;
}

/* ---------------- Scrollbars ---------------- */

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 6px; border: 2px solid var(--panel); }
::-webkit-scrollbar-thumb:hover { background: #33445c; }

/* ---------------- Responsive ---------------- */

@media (max-width: 1240px) {
  .dash-grid { grid-template-columns: 1fr; }
  .leaderboard-scroll { max-height: 480px; }
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero-inner { grid-template-columns: 1fr 1fr; }
  .hero-side { flex-direction: row; grid-column: 1 / -1; }
  .hero-badge { flex: 1; }
}

@media (max-width: 780px) {
  .app { padding: 10px 12px 24px; }
  .appbar { flex-wrap: wrap; gap: 10px; }
  .tabs { order: 3; width: 100%; justify-content: stretch; }
  .performance-control { order: 2; width: 100%; }
  .performance-control .global-range-toggle { margin-left: auto; }
  .universe-control { order: 2; width: 100%; }
  .universe-control .global-range-toggle { margin-left: auto; }
  .universe-control .global-range-toggle button { padding-left: 9px; padding-right: 9px; }
  .tab { flex: 1; text-align: center; padding: 7px 6px; font-size: 12px; }
  .status-cluster { margin-left: auto; }
  .brand-text span { display: none; }
  .pill { font-size: 11px; padding: 5px 9px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .spark-col, .spark-cell { display: none; }
  .leaderboard-table th:first-child, .leaderboard-table td.lb-rank { display: none; }
  .data-table td.lb-name { max-width: clamp(108px, 34vw, 152px); }
  .leaderboard-table td { font-size: 11.5px; }
  .leaderboard-table th, .leaderboard-table td { padding-left: 5px; padding-right: 5px; }
  .leaderboard-table th { font-size: 9.5px; letter-spacing: 0.02em; }
  .leaderboard-table .sort-indicator { min-width: 6px; font-size: 9px; }
  .leaderboard-table .delta-chip { padding: 2px 5px; }
  .hero-inner { grid-template-columns: 1fr; gap: 16px; padding: 18px; }
  .hero-side { flex-direction: column; }
  .hero-headline { font-size: 20px; }
  .hero-stat strong { font-size: 25px; }
  .health-grid { grid-template-columns: 1fr; }
  .chart-wrap { height: 300px; }
  .chart-wrap.tall { height: 340px; }
  .detail-actions { width: 100%; justify-content: space-between; }
  .detail-universe-control { min-width: 0; }
  .detail-universe-toggle button { padding-left: 6px; padding-right: 6px; }
  .constituent-controls { width: 100%; }
  .constituent-controls input[type="search"] { flex: 1; width: auto; }
  .panel { padding: 13px 13px; }
  .foot { flex-direction: column; gap: 4px; }
}
