:root {
  color-scheme: dark;
  --bg: #090b12;
  --surface: #101522;
  --surface-2: #151b2a;
  --surface-3: #1d2440;
  --line: rgba(166, 180, 255, 0.18);
  --line-strong: rgba(166, 180, 255, 0.34);
  --text: #f5f7ff;
  --muted: #98a3c7;
  --muted-2: #687295;
  --blue: #5b6cff;
  --purple: #8b5cf6;
  --good: #4ade80;
  --warn: #facc15;
  --bad: #fb7185;
}

* {
  box-sizing: border-box;
}

.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;
}

html,
body {
  max-width: 100%;
  overflow-x: clip;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 0%, rgba(91, 108, 255, 0.18), transparent 32rem),
    linear-gradient(180deg, #0d1020 0%, var(--bg) 54%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.initial-loading {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  background: rgba(8, 11, 20, 0.94);
  color: #dce2ff;
}

.initial-loading[hidden] {
  display: none;
}

.initial-loading i {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(166, 180, 255, 0.18);
  border-top-color: #8b70ee;
  border-radius: 50%;
  animation: initial-loading-spin 0.8s linear infinite;
}

@keyframes initial-loading-spin {
  to { transform: rotate(360deg); }
}

button,
input {
  font: inherit;
}

button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  cursor: pointer;
}

button:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.09);
}

button:disabled {
  cursor: wait;
  opacity: 0.58;
}

input {
  width: 140px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(7, 10, 18, 0.84);
  color: var(--text);
  padding: 0 12px;
  text-transform: uppercase;
}

.app-shell {
  display: grid;
  gap: 18px;
  width: min(1240px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 22px 0 36px;
}

.research-layout {
  display: grid;
  grid-template-columns: minmax(135px, 145px) minmax(0, 1fr);
  align-items: start;
  gap: 18px;
}

.research-layout > .rank-section {
  grid-column: 1;
  grid-row: 1;
  align-self: start;
}

.research-layout > .detail-column {
  grid-column: 2;
  grid-row: 1;
}

.research-layout.has-empty-ranking > .rank-section {
  grid-column: 1 / -1;
  position: static;
  width: 100%;
  max-height: none;
}

.detail-column {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.rank-section.rank-footer {
  display: none;
  position: static;
  width: min(100%, 145px);
  max-height: calc(100vh - 32px);
}

.rank-footer[hidden] {
  display: none;
}

.app-footer {
  position: relative;
  z-index: 20;
  min-height: 150px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  margin-top: 36px;
  border-top: 1px solid var(--line);
  background: var(--bg);
  color: #737e98;
  font-size: 11px;
}

.app-footer-brand {
  opacity: 0.65;
}

.app-footer-brand img {
  width: 32px;
  height: 32px;
}

.app-footer-brand strong {
  color: inherit;
}

.app-footer-legal {
  display: grid;
  gap: 5px;
  text-align: right;
}

.app-footer-legal p {
  margin: 0;
}

.command-section,
.rank-section,
.price-history-panel,
.detail-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(16, 21, 34, 0.82);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.28);
}

.detail-panel[hidden] {
  display: none;
}

.price-history-panel {
  padding: 16px;
}

.embedded-price-history {
  padding: 12px;
  box-shadow: none;
  background: rgba(255, 255, 255, 0.025);
}

.price-history-content {
  display: grid;
  gap: 14px;
}

.price-history-head,
.price-history-controls,
.chart-control-group,
.price-chart-meta,
.price-chart-foot {
  display: flex;
  align-items: center;
  gap: 10px;
}

.price-history-head,
.price-chart-meta,
.price-chart-foot {
  justify-content: space-between;
}

.price-history-head h2 {
  font-size: 20px;
}

.price-history-controls {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.chart-control-group {
  gap: 4px;
}

.chart-control-group button {
  min-height: 30px;
  padding: 0 9px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.chart-control-group button.is-active {
  border-color: rgba(139, 92, 246, 0.8);
  background: rgba(139, 92, 246, 0.2);
  color: var(--text);
}

.price-history-empty {
  display: grid;
  place-items: center;
  min-height: 140px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
}

.price-chart {
  position: relative;
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(7, 10, 18, 0.35);
  padding: 12px;
}

.price-chart-meta,
.price-chart-foot {
  color: var(--muted);
  font-size: 14px;
}

.price-chart-meta strong {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: flex-end;
  gap: 4px;
  color: var(--text);
  font-size: 17px;
}

.price-chart-meta > div {
  display: grid;
  gap: 2px;
}

.price-chart-meta > div > span {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.price-chart-meta small,
.price-chart-context {
  color: var(--muted-2);
  font-size: 11px;
}

.price-chart-context {
  margin: 0;
}

.price-chart-meta em {
  margin-left: 6px;
  font-size: 16px;
  font-style: normal;
}

.price-chart-meta .is-up { color: var(--good); }
.price-chart-meta .is-down { color: var(--bad); }

.price-chart svg {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1000 / 280;
}

.price-chart-grid {
  stroke: rgba(166, 180, 255, 0.16);
  stroke-dasharray: 4 5;
}

.price-chart-marker {
  stroke: rgba(91, 108, 255, 0.22);
  stroke-width: 1;
}

.price-chart-session {
  stroke: rgba(214, 220, 255, 0.58);
  stroke-width: 1.3;
  stroke-dasharray: 3 3;
  pointer-events: none;
}

.price-chart-session-label {
  fill: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-anchor: middle;
  text-transform: uppercase;
  pointer-events: none;
}

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

.price-chart-y-label,
.price-chart-baseline-label,
.price-chart-volume-label {
  fill: var(--muted-2);
  font-size: 10px;
  font-weight: 700;
  pointer-events: none;
}

.price-chart-baseline {
  stroke: rgba(214, 220, 255, 0.34);
  stroke-width: 1;
  stroke-dasharray: 3 5;
  pointer-events: none;
}

.price-chart-area {
  fill: rgba(91, 108, 255, 0.08);
  pointer-events: none;
}

.price-chart-volume-divider {
  stroke: rgba(166, 180, 255, 0.13);
  pointer-events: none;
}

.price-chart-volume {
  fill: rgba(91, 108, 255, 0.28);
  pointer-events: none;
}

.price-chart-hover {
  cursor: crosshair;
  fill: transparent;
}

.price-chart-hover:hover {
  fill: rgba(91, 108, 255, 0.13);
}

.price-chart-line,
.price-chart-sma20,
.price-chart-sma50 {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.price-chart-line { stroke: #d6dcff; stroke-width: 2.5; pointer-events: none; }
.price-chart-sma20 { stroke: rgba(91, 108, 255, 0.78); stroke-width: 1.5; stroke-dasharray: 5 4; pointer-events: none; }
.price-chart-sma50 { stroke: rgba(250, 204, 21, 0.72); stroke-width: 1.5; stroke-dasharray: 5 4; pointer-events: none; }

.rank-trend-chart {
  position: relative;
  display: grid;
  gap: 5px;
  margin-top: 10px;
  border-top: 1px solid rgba(166, 180, 255, 0.16);
  padding-top: 10px;
}

.score-backtest-card {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 14px;
  border: 1px solid rgba(166, 180, 255, 0.16);
  border-radius: 14px;
  background: rgba(13, 19, 39, 0.55);
}

.etf-header-scores { display: flex; flex: 0 0 auto; align-items: start; gap: 10px; }
.header-score-item { display: grid; justify-items: center; gap: 4px; }
.header-score-item > span { display: grid; justify-items: center; line-height: 1.1; }
.header-score-item > span strong { color: var(--text); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.header-score-item > span small { color: var(--muted-2); font-size: 8px; white-space: nowrap; }
.etf-header-scores .score-orb { width: 58px; flex-basis: 58px; }
.etf-header-scores .score-orb strong { font-size: 23px; }

@media (max-width: 620px) {
  .sticky-detail-top { align-items: flex-start; flex-wrap: wrap; }
  .etf-header-scores { order: 1; width: 100%; padding-right: 145px; box-sizing: border-box; }
  .detail-heading-copy { order: 2; padding-right: 0; }
  .detail-heading-copy .kicker { padding-right: 145px; }
  .detail-freshness { top: 9px; right: 9px; max-width: 145px; }
}

.score-backtest-card.is-empty { color: var(--muted-2); }
.score-backtest-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; }
.score-backtest-head strong { color: var(--text); }
.score-backtest-head small, .score-backtest-card > p { color: var(--muted-2); font-size: 11px; }
.score-backtest-card > p { margin: 0; line-height: 1.5; }
.score-backtest-horizons { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.score-backtest-horizons span { display: grid; gap: 2px; padding: 8px; border-radius: 10px; background: rgba(91, 108, 255, 0.09); text-align: center; }
.score-backtest-horizons b, .score-backtest-horizons small { color: var(--muted-2); font-size: 10px; }
.score-backtest-horizons em { color: var(--text); font-size: 16px; font-style: normal; font-weight: 800; }
.score-backtest-timing { display: flex; flex-wrap: wrap; gap: 7px; }
.score-backtest-timing span { padding: 5px 8px; border-radius: 999px; background: rgba(255,255,255,.05); color: var(--muted-2); font-size: 11px; }
.score-backtest-timing b { color: var(--text); }
.score-audit-badge { padding: 4px 7px; border: 1px solid rgba(250,204,21,.24); border-radius: 999px; color: #e8cb72; font-size: 9px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.score-backtest-bands { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.score-band-title { grid-column: 1 / -1; margin: 0; color: var(--muted-2); font-size: 11px; }
.score-backtest-bands span { display: grid; gap: 3px; padding: 9px; border: 1px solid rgba(166,180,255,.1); border-radius: 10px; background: rgba(255,255,255,.025); }
.score-backtest-bands b, .score-backtest-bands small { color: var(--muted-2); font-size: 11px; }
.score-backtest-bands em { color: var(--text); font-size: 15px; font-style: normal; font-weight: 800; }
.score-backtest-card > p strong { color: var(--text); }

@media (max-width: 620px) {
  .score-backtest-head { align-items: start; flex-direction: column; gap: 4px; }
  .score-backtest-horizons { grid-template-columns: repeat(5, minmax(48px, 1fr)); overflow-x: auto; }
  .score-backtest-bands { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.rank-trend-chart.is-empty {
  color: var(--muted-2);
  font-size: 12px;
}

.rank-trend-head,
.rank-trend-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.rank-trend-head span,
.rank-trend-foot {
  color: var(--muted-2);
  font-size: 11px;
}

.rank-trend-head strong {
  color: var(--text);
  font-size: 16px;
}

.rank-trend-head em {
  margin-left: 5px;
  color: var(--muted-2);
  font-size: 11px;
  font-style: normal;
}

.rank-trend-chart svg {
  display: block;
  width: 100%;
  height: 72px;
}

.rank-trend-midline {
  stroke: rgba(91, 108, 255, 0.2);
  stroke-dasharray: 4 5;
}

.rank-trend-y-label {
  fill: var(--muted-2);
  font-size: 9px;
  font-weight: 700;
}

.rank-trend-line {
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rank-trend-point {
  stroke: var(--surface);
  stroke-width: 1.2;
  pointer-events: none;
}

.rank-trend-line.is-rebound { stroke: var(--good); }
.rank-trend-line.is-pullback { stroke: var(--bad); }
.rank-trend-line.is-neutral { stroke: #7c8cff; }
.rank-trend-point.is-rebound { fill: var(--good); }
.rank-trend-point.is-pullback { fill: var(--bad); }
.rank-trend-point.is-neutral { fill: #7c8cff; }

.rank-trend-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted-2);
  font-size: 10px;
}

.rank-trend-legend span::before {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 5px;
  border-radius: 50%;
  background: #7c8cff;
  content: "";
}

.rank-trend-legend .is-rebound::before { background: var(--good); }
.rank-trend-legend .is-pullback::before { background: var(--bad); }

.rank-trend-hit {
  fill: transparent;
  cursor: crosshair;
}

.rank-trend-tooltip {
  position: absolute;
  z-index: 3;
  top: 48px;
  display: grid;
  min-width: 84px;
  transform: translateX(-50%);
  gap: 2px;
  border: 1px solid rgba(251, 113, 133, 0.5);
  border-radius: 6px;
  background: rgba(9, 11, 18, 0.96);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.32);
  color: var(--muted);
  font-size: 10px;
  padding: 6px 8px;
  pointer-events: none;
  text-align: center;
}

.rank-trend-tooltip[hidden] {
  display: none;
}

.rank-trend-tooltip strong {
  color: var(--text);
  font-size: 12px;
}

.rank-trend-head .is-up,
.rank-trend-foot .is-up { color: var(--good); }
.rank-trend-head .is-down,
.rank-trend-foot .is-down { color: var(--bad); }

.price-chart-latest {
  fill: #5b6cff;
  stroke: var(--surface);
  stroke-width: 1.3;
  pointer-events: none;
}

.price-chart-axis {
  position: relative;
  height: 20px;
  border-top: 1px solid rgba(166, 180, 255, 0.16);
  color: var(--muted);
  font-size: 12px;
}

.price-chart-axis span {
  position: absolute;
  top: 4px;
  transform: translateX(-50%);
  white-space: nowrap;
}

.price-chart-axis span:first-child { transform: none; }
.price-chart-axis span:last-child { transform: translateX(-100%); }

.price-chart-read {
  margin: 2px 0 0;
  border-left: 3px solid var(--blue);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  padding-left: 8px;
}

.price-chart-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  border-top: 1px solid rgba(166, 180, 255, 0.13);
  padding-top: 7px;
}

.price-chart-facts.is-day {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.price-chart-facts span {
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.price-chart-facts b { color: var(--text); }
.price-chart-facts .is-up b { color: var(--good); }
.price-chart-facts .is-down b { color: var(--bad); }

.price-chart-facts .is-up b,
.price-chart-facts .is-down b {
  font-size: 15px;
}

.earnings-chart-scroll {
  overflow-x: auto;
}

.earnings-results-chart {
  display: block;
  width: 100%;
  min-width: 720px;
}

.earnings-zero-line {
  stroke: rgba(166, 180, 255, 0.24);
  stroke-dasharray: 5 6;
}

.earnings-result-bar { fill: rgba(91, 108, 255, 0.72); }
.earnings-result-bar.is-beat { fill: rgba(74, 222, 128, 0.72); }
.earnings-result-bar.is-miss { fill: rgba(251, 113, 133, 0.72); }

.earnings-estimate-marker {
  stroke: var(--text);
  stroke-width: 3;
}

.earnings-period-label,
.earnings-surprise-label,
.earnings-axis-label {
  fill: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-anchor: middle;
}

.earnings-axis-label {
  font-size: 12px;
  text-anchor: start;
}

.earnings-surprise-label.is-beat { fill: var(--good); }
.earnings-surprise-label.is-miss { fill: var(--bad); }

.earnings-chart-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.earnings-results-legend {
  display: flex;
  align-items: center;
  gap: 7px;
}

.earnings-results-legend i {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: var(--blue);
}

.earnings-results-legend b {
  width: 16px;
  border-top: 2px solid var(--text);
}

.price-history-tooltip {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 72px;
  display: grid;
  min-width: 185px;
  gap: 3px;
  border: 1px solid rgba(166, 180, 255, 0.4);
  border-radius: 6px;
  background: rgba(9, 11, 18, 0.95);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.32);
  color: var(--muted);
  font-size: 11px;
  padding: 9px 10px;
  pointer-events: none;
  transform: translateX(-50%);
  text-align: center;
}

.price-history-tooltip[hidden] {
  display: none;
}

.price-history-tooltip strong { color: var(--text); }

.command-section {
  display: grid;
  gap: 18px;
  padding: 18px;
}

.command-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  align-items: start;
  gap: 14px;
}

.collections-panel {
  min-width: 0;
}

.command-secondary-stack {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 12px;
}

.command-card {
  display: grid;
  min-width: 0;
  align-self: start;
  overflow: hidden;
  border: 1px solid rgba(166, 180, 255, 0.16);
  border-radius: 10px;
  background: rgba(15, 21, 38, 0.72);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.1);
}

.universe-panel {
  display: grid;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.universe-heading,
.universe-controls,
.universe-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.universe-heading {
  justify-content: space-between;
}

.universe-heading h2 {
  font-size: 18px;
}

.universe-heading button,
.universe-row button {
  min-height: 34px;
  padding: 0 12px;
}

.universe-controls label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.universe-controls input {
  width: min(320px, 100%);
  min-height: 36px;
  text-transform: none;
}

#universe-summary {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
}

.universe-list {
  display: grid;
  max-height: 330px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(7, 10, 18, 0.38);
}

.universe-row {
  min-height: 54px;
  padding: 9px 10px 9px 12px;
  border-bottom: 1px solid rgba(166, 180, 255, 0.1);
}

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

.universe-row > div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.universe-row strong {
  font-size: 14px;
}

.universe-row span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.universe-exchange {
  margin-left: auto;
}

.universe-empty {
  padding: 22px 12px;
  color: var(--muted);
  font-size: 13px;
}

.command-header,
.section-heading,
.detail-heading,
.command-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.ranking-collection-buttons {
  display: grid;
  width: 100%;
  align-items: start;
  gap: 10px;
}

.command-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

.collection-primary-actions,
.collection-group-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.collection-group {
  display: grid;
  min-width: 0;
  width: 100%;
  gap: 5px;
}

.collection-group-buttons {
  min-width: 0;
  width: 100%;
}

.collection-group-label {
  color: #697596;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.ranking-collection-buttons button {
  min-height: 30px;
  padding: 0 9px;
}

.brand-lockup span,
.snapshot-status-label,
.kicker,
.ticker-form label,
.metric-card span,
.evidence-row span,
.score-orb span,
.rank-number {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.scan-status,
.ticker-freshness {
  color: #b9c3e6;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.ticker-freshness {
  margin: 7px 0 0;
}

.detail-company-context {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.brand-lockup strong {
  display: grid;
  color: var(--text);
  font-size: 15px;
  line-height: 0.9;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.brand-lockup strong span {
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
}

.brand-lockup {
  display: flex;
  align-items: center;
  justify-self: start;
  text-align: left;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}

.brand-lockup:focus-visible {
  border-radius: 6px;
  outline: 2px solid var(--blue);
  outline-offset: 4px;
}

.brand-lockup img {
  display: block;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
}

.command-header {
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr);
  align-items: center;
  gap: 28px;
  width: 100%;
  min-height: 32px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(166, 180, 255, 0.12);
}

.watchlist-add-form {
  flex: 0 0 auto;
  width: 210px;
  margin: 0;
  position: relative;
  z-index: 8;
}

.ticker-combobox { position: relative; }

.watchlist-add-form input {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 3px 11px;
  border: 1px dashed rgba(166, 180, 255, 0.28);
  border-radius: 8px;
  outline: 0;
  background: rgba(255, 255, 255, 0.025);
  color: var(--text);
  font-size: 13px;
  letter-spacing: 0.03em;
  transition: border-color 150ms ease, color 150ms ease;
}

.watchlist-add-form input::placeholder {
  color: rgba(166, 180, 255, 0.48);
  text-transform: none;
}

.watchlist-add-form input:focus {
  border-color: #8d7bff;
  background: rgba(141, 123, 255, 0.08);
}

.ticker-suggestions {
  position: absolute;
  z-index: 30;
  top: calc(100% + 7px);
  left: 0;
  width: min(320px, calc(100vw - 32px));
  max-height: 310px;
  overflow: auto;
  padding: 6px;
  border: 1px solid rgba(141, 123, 255, 0.42);
  border-radius: 12px;
  background: rgba(13, 17, 32, 0.98);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(18px);
}

.ticker-suggestions[hidden] {
  display: none !important;
}

.ticker-suggestions button {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.ticker-suggestions button:hover,
.ticker-suggestions button[aria-selected="true"] {
  background: rgba(141, 123, 255, 0.16);
}

.ticker-suggestions strong { color: #9bf6ca; letter-spacing: 0.06em; }
.ticker-suggestions span { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 600px) {
  .watchlist-add-form { width: min(100%, 260px); }
  .watchlist-add-form input { min-height: 44px; font-size: 16px; }
  .ticker-suggestions {
    position: fixed;
    top: auto;
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
    left: 12px;
    width: auto;
    max-height: min(46vh, 360px);
    border-radius: 16px;
    padding: 8px;
  }
  .ticker-suggestions button { min-height: 52px; grid-template-columns: 70px minmax(0, 1fr); padding: 10px 12px; }
  .ticker-suggestions span { font-size: 13px; }
}

.snapshot-status-block {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}

.scan-status {
  display: grid;
  grid-template-columns: minmax(72px, 120px) auto;
  gap: 4px 10px;
  width: min(100%, 320px);
  align-content: center;
  justify-content: end;
}

.scan-status-primary,
.scan-status-secondary {
  display: flex;
  align-items: center;
  min-width: 0;
}

.scan-status-primary {
  grid-column: 2;
  justify-content: flex-end;
  gap: 7px;
  color: #d7dcff;
  font-size: 12px;
}

.scan-status-primary strong {
  color: #aeb8e2;
  font-size: 11px;
}

.scan-status.is-paused .scan-status-primary {
  grid-column: 1;
  color: #aeb8e2;
}

.scan-status.is-paused {
  grid-template-columns: minmax(0, 1fr);
}

.scan-status-primary > span {
  white-space: nowrap;
}

.scan-status-track {
  grid-column: 1;
  grid-row: 1;
  align-self: center;
  height: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(166, 180, 255, 0.12);
}

.scan-status-track b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #6275ee, #8b70ee);
}

.scan-status-secondary {
  grid-column: 1 / -1;
  justify-content: flex-end;
  text-align: right;
  color: #7f89ad;
  font-size: 10px;
  font-weight: 600;
}

.scan-status-failures {
  display: flex;
  grid-column: 1 / -1;
  justify-content: flex-end;
  min-width: 0;
}

.scan-failure-badge {
  border: 0;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(215, 168, 80, 0.11);
  color: #caa35d;
  font: inherit;
  white-space: nowrap;
  cursor: pointer;
}

.scan-failure-badge:hover,
.scan-failure-badge:focus-visible {
  background: rgba(215, 168, 80, 0.2);
  color: #f0c36f;
}

.scan-failures-dialog {
  width: min(420px, calc(100vw - 28px));
  max-height: min(520px, calc(100vh - 40px));
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(166, 180, 255, 0.24);
  border-radius: 14px;
  background: #111728;
  color: #f3f5ff;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.42);
}

.scan-failures-dialog::backdrop {
  background: rgba(4, 7, 15, 0.42);
}

.scan-failures-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 16px 12px;
  border-bottom: 1px solid rgba(166, 180, 255, 0.14);
}

.scan-failures-heading h2,
.scan-failures-heading p {
  margin: 0;
}

.scan-failures-heading h2 {
  font-size: 18px;
}

.scan-failures-close {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(166, 180, 255, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: #d7dcff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.scan-failures-list {
  display: grid;
  gap: 10px;
  max-height: 390px;
  padding: 12px 16px 16px;
  overflow-y: auto;
}

.scan-failure-row {
  padding: 13px 14px;
  border: 1px solid rgba(215, 168, 80, 0.18);
  border-radius: 12px;
  background: rgba(215, 168, 80, 0.06);
}

.scan-failure-row div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.scan-failure-row span {
  color: #caa35d;
  font-size: 11px;
  font-weight: 700;
}

.scan-failure-row p,
.scan-failures-empty {
  margin: 6px 0 0;
  color: #aeb8d8;
  font-size: 13px;
  line-height: 1.45;
}

.command-header .ticker-form {
  min-width: 250px;
  gap: 0;
}

.command-header .ticker-form input {
  width: 150px;
}

.external-ticker-links {
  display: flex;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  flex-wrap: nowrap;
  gap: 10px;
  margin-top: 6px;
  overscroll-behavior-inline: contain;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  touch-action: pan-x;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
}

.external-ticker-links::-webkit-scrollbar {
  display: none;
}

.detail-freshness {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  max-width: min(220px, 42%);
  text-align: right;
}

.detail-freshness small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.detail-freshness .data-quality-stale {
  color: #facc15;
}

.external-ticker-prefix {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.external-ticker-link {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  color: #aeb8ff;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
}

.external-ticker-link:hover {
  color: #d7dcff;
  text-decoration: underline;
}

.kicker {
  margin: 0 0 8px;
  color: #9aa7ff;
}

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

h1 {
  max-width: 780px;
  font-size: clamp(32px, 6vw, 70px);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  font-size: 24px;
}

h3 {
  font-size: 18px;
}

.ticker-form {
  display: grid;
  gap: 7px;
}

.ticker-form div {
  display: flex;
  gap: 8px;
}

.ticker-form button,
.ranking-collection-buttons button {
  min-height: 30px;
  padding: 0 9px;
}

.ranking-collection-buttons button {
  position: relative;
  border-radius: 7px;
  border-color: rgba(166, 180, 255, 0.22);
  background: rgba(21, 27, 43, 0.72);
  color: #8994b8;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.025em;
  box-shadow: none;
}

.collection-group-buttons button {
  display: inline-flex;
  width: auto;
  max-width: 100%;
  min-width: 0;
  height: 40px;
  min-height: 40px;
  padding: 4px 6px;
  align-items: center;
  gap: 4px;
  text-align: left;
}

.collection-average {
  --collection-score: 0;
  --collection-direction-color: #8997ff;
  position: relative;
  display: grid;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  margin-right: 3px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--collection-direction-color) calc(var(--collection-score) * 1%), rgba(101, 112, 143, 0.22) 0);
}

.collection-average::before {
  position: absolute;
  inset: 3px;
  border-radius: inherit;
  background: #12182a;
  content: "";
}

.collection-average b {
  position: relative;
  z-index: 1;
  color: #eef1ff;
  font-size: 10px;
  font-weight: 850;
  line-height: 1;
}

.collection-average.is-unavailable {
  opacity: 0.55;
}

.ranking-collection-buttons button.is-active .collection-average::before {
  background: #4e51c2;
}

.collection-primary-actions button {
  height: 36px;
  min-height: 36px;
  padding-inline: 6px;
  color: var(--text);
  font-size: 16px;
  letter-spacing: 0;
}

.collection-group-buttons button strong {
  color: var(--text);
  font-family: inherit;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: 0;
}

.collection-group-buttons button small {
  display: grid;
  flex: 0 0 auto;
  color: #65708f;
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0;
  line-height: 1.05;
  text-transform: none;
}

.collection-group-buttons button small span {
  color: inherit;
  font: inherit;
  line-height: inherit;
  white-space: nowrap;
}

.collection-group-buttons button.is-active small {
  color: rgba(255, 255, 255, 0.7);
}

.ranking-collection-buttons button:hover {
  border-color: rgba(141, 123, 255, 0.58);
  background: rgba(42, 47, 75, 0.82);
  color: #d6dcfa;
}

.ranking-collection-buttons button.is-active {
  color: #fff;
  border-color: #8d7bff;
  background: linear-gradient(135deg, #5367ff, #8c4ee8);
  box-shadow: 0 0 0 1px rgba(141, 123, 255, 0.25), 0 6px 18px rgba(83, 103, 255, 0.22);
}

.ticker-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 42px;
}

.ticker-strip-row {
  display: contents;
}

.watchlist-label {
  margin-bottom: -10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.collapsible-heading {
  display: flex;
  width: 100%;
  min-height: 30px;
  padding: 2px 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  text-align: left;
}

.command-card-header {
  min-height: 44px;
  padding: 10px 12px 10px 14px;
  border-radius: 0;
}

.command-card-title {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.command-card-tools {
  display: flex;
  align-items: center;
  gap: 7px;
}

.command-card-body {
  padding: 12px 14px 14px;
  border-top: 1px solid rgba(166, 180, 255, 0.1);
}

.collapsible-heading .watchlist-label {
  margin-bottom: 0;
}

.command-panel-caret {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
}

.collapsible-heading:hover,
.collapsible-heading:focus-visible {
  background: rgba(141, 123, 255, 0.12);
}

.collapsible-heading:hover .watchlist-label,
.collapsible-heading:hover .command-card-title,
.collapsible-heading:hover .command-panel-caret,
.collapsible-heading:focus-visible .watchlist-label,
.collapsible-heading:focus-visible .command-card-title,
.collapsible-heading:focus-visible .command-panel-caret {
  color: var(--text);
}

.command-panel-content[hidden] {
  display: none;
}

.notification-card {
  position: relative;
  z-index: 3;
  overflow: visible;
}

.notification-card .command-card-header {
  overflow: visible;
  border-radius: 10px 10px 0 0;
}

#notification-state-pill {
  padding: 3px 7px;
  border: 1px solid rgba(166, 180, 255, 0.16);
  border-radius: 999px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1;
  text-transform: uppercase;
}

#notification-state-pill.is-active {
  border-color: rgba(74, 222, 128, 0.28);
  background: rgba(74, 222, 128, 0.08);
  color: #75e6a0;
}

.notification-settings {
  display: grid;
  gap: 11px;
}

.notification-actions {
  display: grid;
  gap: 8px;
}

.notification-rule-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #dce1f7;
  font-size: 12px;
  font-weight: 700;
}

.notification-rule-copy label {
  display: flex;
  align-items: center;
}

.notification-rule-copy input {
  width: 78px;
  min-height: 38px;
  padding: 0 10px;
  color: #f7f8ff;
  font-size: 20px;
  font-variant-numeric: tabular-nums;
  font-weight: 850;
  text-align: center;
}

#notification-status {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

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

.notification-rule-controls label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.notification-rule-controls input,
.notification-rule-controls select {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 0 9px;
  border: 1px solid rgba(166, 180, 255, 0.18);
  border-radius: 8px;
  background-color: #0a0f1c;
  color: var(--text);
  color-scheme: dark;
  font-size: 12px;
  font-weight: 750;
}

.notification-rule-copy input,
.notification-rule-controls input,
.notification-rule-controls select {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.notification-rule-copy input:focus,
.notification-rule-controls input:focus,
.notification-rule-controls select:focus {
  border-color: rgba(139, 112, 238, 0.72);
  outline: 2px solid rgba(139, 112, 238, 0.16);
  outline-offset: 1px;
}

#notification-toggle {
  min-height: 34px;
  padding-inline: 13px;
  white-space: normal;
}

.notification-help {
  position: relative;
  display: inline-grid;
  width: 16px;
  height: 16px;
  place-items: center;
  border: 1px solid rgba(166, 180, 255, 0.25);
  border-radius: 50%;
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  line-height: 1;
  cursor: help;
}

.notification-help::after {
  position: absolute;
  z-index: 20;
  top: calc(100% + 9px);
  right: -6px;
  width: 210px;
  padding: 9px 10px;
  border: 1px solid rgba(166, 180, 255, 0.2);
  border-radius: 8px;
  background: #151b2c;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.32);
  color: #d7dcf3;
  content: attr(data-tooltip);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.4;
  text-align: left;
  text-transform: none;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-3px);
  transition: opacity 120ms ease, transform 120ms ease;
}

.notification-help:hover,
.notification-help:focus-visible {
  border-color: rgba(166, 180, 255, 0.5);
  color: var(--text);
  outline: none;
}

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

@media (max-width: 899px) {
  .command-workspace {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .notification-card {
    align-self: start;
  }
}

.ranking-label {
  display: grid;
  justify-items: start;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ranking-label-copy {
  display: flex;
  width: 100%;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  text-align: left;
}

.ranking-label-copy > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: normal;
  text-transform: uppercase;
}

.rank-sticky-logo {
  display: block;
  width: 0;
  height: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(-5px) scale(0.82);
  transition: width 160ms ease, height 160ms ease, opacity 160ms ease, transform 160ms ease;
}

.rank-sticky-logo img {
  display: block;
  width: 100%;
  height: 100%;
}

.rank-sticky-logo:focus-visible {
  border-radius: 8px;
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.rank-section.is-stuck .rank-sticky-logo {
  width: 48px;
  height: 48px;
  opacity: 1;
  transform: translateY(0) scale(1);
}

.rank-section.is-stuck .ranking-label {
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  padding-left: 0;
  column-gap: 9px;
}

.rank-section.is-stuck .ranking-label-copy,
.rank-section.is-stuck .ranking-label small {
  align-items: flex-end;
  text-align: right;
}

.ranking-label small {
  display: flex;
  width: 100%;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
  text-align: left;
  text-transform: none;
}

#rank-summary > span,
#rank-summary > button {
  display: block;
  line-height: 1.25;
  white-space: nowrap;
}

#rank-summary > button {
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #caa35d;
  font: inherit;
}

#rank-summary > button:hover,
#rank-summary > button:focus-visible {
  background: transparent;
  color: #f0c36f;
  text-decoration: underline;
}

.watchlist-label span {
  color: var(--muted-2);
}

.mover-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.suggestion-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.mover-strip {
  transition: max-height 180ms ease;
}

.mover-strip.is-collapsed {
  overflow: hidden;
  max-height: 42px;
}

.blocked-toggle {
  min-height: 24px;
  padding: 0 7px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 700;
  text-transform: none;
}

.blocked-toggle:hover,
.blocked-toggle.is-open {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
}

.mover-pill {
  background: rgba(91, 108, 255, 0.07);
}

.mover-pill.is-pending > button:first-child {
  cursor: pointer;
  opacity: 0.46;
}

.mover-pill.is-pending > button:first-child:hover {
  opacity: 0.78;
}

.blocked-ticker-strip {
  min-height: 0;
}

.blocked-ticker-strip[hidden] {
  display: none;
}

.blocked-ticker-pill {
  align-items: center;
  border-style: dashed;
  color: var(--muted);
}

.blocked-ticker-pill > span {
  padding: 0 11px;
}

.blocked-ticker-pill button {
  border-left: 1px solid var(--line);
  color: #aeb8ff;
  font-size: 11px;
}

.ticker-pill {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}

.ticker-pill.is-selected {
  border-color: rgba(91, 108, 255, 0.72);
}

.ticker-pill button {
  min-height: 36px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0 11px;
}

.ticker-pill .remove-button {
  border-left: 1px solid var(--line);
  color: var(--muted);
}

.watchlist-rank-card {
  position: relative;
  display: block;
  width: max-content;
  min-width: 72px;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.watchlist-rank-card.is-rebound {
  border-color: rgba(74, 222, 128, 0.2);
  background: rgba(74, 222, 128, 0.055);
  box-shadow: inset 2px 0 0 rgba(74, 222, 128, 0.65);
}

.watchlist-rank-card.is-pullback {
  border-color: rgba(251, 113, 133, 0.2);
  background: rgba(251, 113, 133, 0.055);
  box-shadow: inset 2px 0 0 rgba(251, 113, 133, 0.65);
}

.watchlist-rank-card.is-selected {
  outline: 1px solid rgba(139, 124, 255, 0.8);
  outline-offset: 1px;
}

.watchlist-rank-select {
  display: flex;
  align-items: center;
  width: auto;
  min-width: 100%;
  min-height: 38px;
  padding: 3px 26px 3px 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  text-align: left;
}

.watchlist-remove {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 20px;
  min-height: 20px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted-2);
  font-size: 14px;
}

.watchlist-remove:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.empty-line,
#status-line,
#rank-summary,
.empty-detail p,
.setup-card p {
  color: var(--muted);
}

#status-line.is-error {
  color: var(--bad);
}

#status-line {
  flex: 0 0 auto;
  white-space: nowrap;
}

.suggestion-preview {
  position: fixed;
  z-index: 30;
  display: grid;
  gap: 6px;
  width: 290px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(9, 11, 18, 0.96);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.42);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  padding: 10px 11px;
  pointer-events: none;
  backdrop-filter: blur(12px);
}

.suggestion-preview[hidden] {
  display: none;
}

.suggestion-preview > strong {
  color: var(--text);
  font-size: 13px;
}

.suggestion-preview strong small {
  margin-left: 4px;
  color: var(--muted-2);
  font-size: 10px;
}

.suggestion-preview > div {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  border-top: 1px solid var(--line);
  padding-top: 7px;
}

.suggestion-preview > div span,
.suggestion-preview > div b {
  display: block;
}

.suggestion-preview > div b {
  margin-top: 2px;
  color: var(--text);
  font-size: 12px;
}

.rank-section {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  padding: 14px;
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
}

.rank-section > .section-heading {
  align-items: flex-start;
  flex-direction: column;
  gap: 4px;
}

.section-heading.compact {
  margin-bottom: 10px;
}

.rank-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 5px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}

.rank-grid.is-empty {
  overflow: hidden;
  padding-right: 0;
}

.rank-grid.is-empty .loading-card {
  min-height: 72px;
  text-align: center;
}

.rank-card,
.loading-card {
  min-height: 44px;
  padding: 4px 7px;
}

.rank-card {
  display: grid;
  grid-template-columns: 36px minmax(48px, 1fr);
  gap: 8px;
  align-items: center;
  text-align: left;
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.025);
}

.rank-card.is-rebound {
  border-color: rgba(74, 222, 128, 0.2);
  background: rgba(74, 222, 128, 0.055);
  box-shadow: inset 2px 0 0 rgba(74, 222, 128, 0.65);
}

.rank-card.is-pullback {
  border-color: rgba(251, 113, 133, 0.2);
  background: rgba(251, 113, 133, 0.055);
  box-shadow: inset 2px 0 0 rgba(251, 113, 133, 0.65);
}

.rank-card.is-weak-thesis {
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: inset 1px 0 0 var(--thesis-color);
}

.rank-card.is-selected {
  outline: none;
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow:
    inset 2px 0 0 var(--thesis-color),
    0 0 0 1px rgba(255, 255, 255, 0.06);
}

.rank-card:focus-visible {
  outline: none;
  box-shadow:
    inset 3px 0 0 var(--thesis-color),
    inset 0 0 0 1px rgba(255, 255, 255, 0.22),
    0 0 0 1px rgba(166, 180, 255, 0.28);
}

.rank-card.is-loading {
  --rank-color: rgba(255, 255, 255, 0.12) !important;
  border-color: rgba(255, 255, 255, 0.28);
  cursor: progress;
  box-shadow: inset 3px 0 0 rgba(255, 255, 255, 0.42);
  animation: rank-card-loading 1.6s ease-in-out infinite;
}

.rank-card-placeholder {
  pointer-events: none;
  opacity: 0.72;
}

.rank-card.is-loading .rank-score {
  color: rgba(255, 255, 255, 0.78);
}

.rank-card.is-unavailable {
  filter: grayscale(0.7);
}

.rank-card.is-retryable {
  border-color: rgba(245, 158, 11, 0.5);
  background: rgba(245, 158, 11, 0.07);
  box-shadow: inset 3px 0 0 rgba(245, 158, 11, 0.72);
}

.rank-card.is-retryable .rank-score {
  color: #f6bd60;
}

.rank-card.is-deferred {
  border-style: dashed;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
}

.rank-card > strong {
  grid-column: 2;
  grid-row: 1;
  font-size: 16px;
  line-height: 1;
  text-align: left;
}

.rank-score {
  position: relative;
  grid-column: 1;
  grid-row: 1;
  display: grid;
  place-items: center;
  align-content: center;
  width: 36px;
  aspect-ratio: 1;
  border-radius: 50%;
  isolation: isolate;
  background: conic-gradient(
    from 210deg,
    var(--score-color, var(--rank-color)) calc(var(--score) * 0.8%),
    rgba(255, 255, 255, 0.09) 0 80%,
    transparent 0
  );
}

.rank-score::before {
  position: absolute;
  z-index: -1;
  inset: 2px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: inherit;
  background: #111625;
  content: "";
}

.rank-score strong {
  font-size: 13px;
  line-height: 1;
}

.rank-score.is-loading {
  --score-color: rgba(255, 255, 255, 0.5) !important;
}

.rank-score.is-deferred {
  --score-color: var(--muted-2) !important;
}

@keyframes rank-card-loading {
  50% {
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: inset 3px 0 0 rgba(255, 255, 255, 0.68), 0 0 18px rgba(255, 255, 255, 0.08);
  }
}

@media (prefers-reduced-motion: reduce) {
  .rank-card.is-loading {
    animation: none;
  }
}

.loading-card {
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
}

.detail-panel {
  display: grid;
  gap: 13px;
  min-height: 280px;
  padding: 15px;
}

.sticky-detail-heading {
  position: sticky;
  z-index: 12;
  top: 10px;
  margin: -8px -8px 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: rgba(15, 19, 34, 0.94);
  box-shadow: 0 12px 28px rgba(4, 7, 14, 0.42);
  backdrop-filter: blur(16px);
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  padding: 8px 10px;
}

.sticky-detail-top {
  display: flex;
  align-items: center;
  gap: 11px;
}

.detail-heading-copy {
  min-width: 0;
  flex: 1;
}

.detail-heading-copy h2 {
  margin: 1px 0 0;
  font-size: 18px;
  line-height: 1.15;
}

.detail-heading-copy .kicker {
  padding-right: 150px;
}

.sticky-detail-heading > .detail-company-context {
  margin: 8px 0 0;
}

.sticky-detail-heading > .external-ticker-links {
  margin-top: 8px;
}



.thesis-banner {
  display: grid;
  gap: 3px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-left: 5px solid var(--thesis-color);
  border-radius: 8px;
  padding: 9px 12px;
}

.thesis-banner.is-rebound {
  border-color: rgba(74, 222, 128, 0.34);
  background: rgba(74, 222, 128, 0.1);
}

.thesis-banner.is-pullback {
  border-color: rgba(251, 113, 133, 0.34);
  background: rgba(251, 113, 133, 0.1);
}

.thesis-banner.is-weak-thesis {
  background: rgba(255, 255, 255, 0.035);
}

.thesis-banner > strong {
  color: var(--thesis-color);
  font-size: 16px;
}

.thesis-banner > span {
  color: rgba(245, 247, 255, 0.78);
  font-size: 12px;
}

.empty-detail {
  display: grid;
  align-content: center;
  gap: 10px;
  min-height: 240px;
}

.score-orb {
  position: relative;
  display: grid;
  grid-template-rows: auto;
  place-items: center;
  align-content: center;
  width: 68px;
  flex: 0 0 68px;
  aspect-ratio: 1;
  border-radius: 50%;
  isolation: isolate;
  background: conic-gradient(
    from 210deg,
    var(--score-color, var(--rank-color)) calc(var(--score) * 0.8%),
    rgba(255, 255, 255, 0.09) 0 80%,
    transparent 0
  );
  box-shadow:
    0 7px 18px rgba(0, 0, 0, 0.25),
    0 0 16px color-mix(in srgb, var(--score-color, var(--rank-color)) 20%, transparent);
}

.score-orb::before {
  position: absolute;
  z-index: -1;
  inset: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: inherit;
  background:
    radial-gradient(circle at 50% 25%, rgba(255, 255, 255, 0.07), transparent 45%),
    #111625;
  content: "";
}

.score-orb span {
  color: #aeb8dc;
  font-size: 9px;
  letter-spacing: 0.16em;
  line-height: 1;
}

.score-orb strong {
  margin: 0;
  font-size: 27px;
  font-variant-numeric: tabular-nums;
  line-height: 0.95;
  letter-spacing: -0.04em;
}

.score-orb small {
  color: var(--muted-2);
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
}

.detail-grid,
.setup-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
}

.metric-card,
.setup-card,
.evidence-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.metric-card {
  display: grid;
  gap: 5px;
  min-height: 72px;
  padding: 10px;
}

.metric-card strong {
  font-size: 17px;
}

.setup-card {
  display: grid;
  gap: 11px;
  padding: 12px;
}

.setup-explanation {
  display: grid;
  gap: 5px;
  border-left: 3px solid var(--thesis-color, var(--accent));
  background: rgba(255, 255, 255, 0.035);
  padding: 10px 12px;
}

.setup-explanation p {
  margin: 0;
  line-height: 1.45;
}

.setup-explanation .setup-caveat {
  color: var(--muted-2);
}

.context-section {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 13px;
}

.earnings-date-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.earnings-date-figure {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  padding: 10px 12px;
}

.earnings-date-figure.is-today {
  border-color: rgba(245, 158, 11, 0.82);
  background:
    radial-gradient(circle at 100% 0%, rgba(245, 158, 11, 0.3), transparent 48%),
    linear-gradient(135deg, rgba(245, 158, 11, 0.19), rgba(255, 255, 255, 0.05) 72%);
  box-shadow: inset 4px 0 0 #fbbf24, 0 8px 28px rgba(120, 53, 15, 0.22);
}

.earnings-date-figure.is-shared {
  grid-column: 1 / -1;
}

.earnings-date-figure.is-today::after {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fbbf24;
  box-shadow: 0 0 0 5px rgba(245, 158, 11, 0.14), 0 0 18px rgba(251, 191, 36, 0.8);
  content: "";
}

.earnings-date-figure.is-today > small {
  color: #fcd34d;
  font-weight: 800;
}

.earnings-date-figure > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.earnings-date-figure > strong {
  font-size: 19px;
}

.earnings-date-figure > small {
  color: var(--muted-2);
  font-size: 12px;
}

@media (max-width: 560px) {
  .app-shell {
    width: calc(100vw - 8px);
  }

  .ranking-label,
  .ranking-label-copy {
    width: 100%;
  }

  .ranking-label {
    padding-inline: 12px;
  }

  .ranking-label-copy {
    flex-direction: row;
    min-height: 30px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
  }

  .ranking-label small {
    width: auto;
    align-items: flex-end;
    text-align: right;
  }

  #rank-summary > span,
  #rank-summary > button {
    padding-top: 0;
  }

  #rank-summary > :not(:first-child) {
    padding-top: 3px;
  }

  .detail-panel {
    gap: 10px;
    padding: 8px;
  }

  .sticky-detail-heading {
    margin-inline: 0;
  }

  .embedded-price-history {
    overflow: hidden;
    padding: 8px;
  }

  .price-history-content {
    gap: 9px;
  }

  .price-chart {
    width: auto;
    margin-inline: -17px;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
    padding: 10px max(8px, env(safe-area-inset-right)) 12px max(8px, env(safe-area-inset-left));
  }

  .price-chart svg {
    height: 224px;
    aspect-ratio: auto;
  }

  .price-chart-meta {
    display: grid;
    align-items: start;
    gap: 6px;
  }

  .price-chart-meta strong {
    justify-content: flex-start;
    font-size: 18px;
  }

  .price-chart-meta em {
    margin-left: 2px;
    font-size: 14px;
  }

  .price-chart-axis {
    font-size: 10px;
  }

  .price-chart-context {
    display: none;
  }

  .price-history-tooltip {
    top: 86px;
    min-width: 150px;
  }

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

  .price-chart-facts.is-day .is-secondary {
    display: none;
  }

  .earnings-date-grid {
    grid-template-columns: 1fr;
  }
}

.source-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.move-confidence {
  display: flex;
  gap: 7px;
  align-items: center;
}

.move-confidence i {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--thesis-color);
  box-shadow: 0 0 8px var(--thesis-color);
}

.source-list span {
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 11px;
  padding: 7px 9px;
}

.source-list strong {
  color: var(--text);
  margin-right: 5px;
}

.source-enabled {
  color: #34d399;
  font-size: 13px;
  line-height: 1;
}

.source-stale {
  color: #d3aa61;
  cursor: help;
}

.evidence-list {
  display: grid;
  gap: 6px;
}

.evidence-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 230px) 76px;
  gap: 14px;
  align-items: center;
  padding: 10px 12px;
}

.evidence-row div {
  display: grid;
  gap: 4px;
}

.evidence-row strong {
  overflow-wrap: anywhere;
}

.evidence-row .evidence-note {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.4;
  text-transform: none;
}

.evidence-value strong,
.evidence-points strong {
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
}

.evidence-value strong {
  font-size: 14px;
}

.evidence-points {
  justify-self: stretch;
  border-left: 2px solid rgba(166, 180, 255, 0.28);
  padding-left: 12px;
}

.evidence-points strong {
  color: #d7dcff;
  font-size: 16px;
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100vw - 20px, 1240px);
    padding-top: 10px;
  }

  .command-header,
  .section-heading,
  .detail-heading,
  .command-actions,
  .evidence-row {
    grid-template-columns: 1fr;
    align-items: start;
  }

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

  .research-layout > .rank-section,
  .research-layout > .detail-column {
    grid-column: 1;
    grid-row: auto;
  }

  .rank-section {
    position: static;
    max-height: none;
    padding: 10px;
  }

  .rank-section.rank-footer {
    display: grid;
    width: 100%;
  }

  .app-footer {
    min-height: 130px;
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 18px;
    margin-top: 24px;
  }

  .app-footer-legal {
    text-align: left;
  }

  .rank-sticky-logo,
  .rank-section.is-stuck .rank-sticky-logo {
    display: none;
  }

  .rank-section > .section-heading {
    align-items: center;
    flex-direction: row;
  }

  .rank-grid {
    grid-template-columns: none;
    grid-template-rows: repeat(5, 44px);
    grid-auto-columns: 108px;
    grid-auto-flow: column;
    column-gap: 12px;
    row-gap: 4px;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 65px 5px 0;
    scrollbar-color: rgba(166, 180, 255, 0.42) transparent;
    scrollbar-width: thin;
  }

  .rank-grid.is-empty {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(280px, 1fr);
    grid-auto-columns: auto;
    grid-auto-flow: row;
    padding: 0;
  }

  .ticker-strip {
    display: flex;
    flex-flow: column nowrap;
    align-items: flex-start;
    gap: 4px;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 65px 5px 0;
    scrollbar-color: rgba(166, 180, 255, 0.42) transparent;
    scrollbar-width: thin;
  }

  .ticker-strip-row {
    display: flex;
    flex: 0 0 38px;
    gap: 8px;
    width: max-content;
  }

  .rank-grid::-webkit-scrollbar {
    height: 4px;
  }

  .rank-grid::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(166, 180, 255, 0.42);
  }

  .rank-grid::-webkit-scrollbar-track {
    background: transparent;
  }

  .rank-grid > :nth-child(5n + 2) {
    transform: translateX(20%);
  }

  .rank-grid > :nth-child(5n + 3) {
    transform: translateX(40%);
  }

  .rank-grid > :nth-child(5n + 4) {
    transform: translateX(60%);
  }

  .rank-grid > :nth-child(5n + 5) {
    transform: translateX(80%);
  }

  .rank-card {
    grid-template-columns: 36px minmax(48px, 1fr);
  }

  .command-header,
  .section-heading,
  .detail-heading,
  .command-actions {
    display: grid;
  }

  .brand-lockup {
    display: flex;
    gap: 8px;
  }

  .command-header {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 16px;
    min-width: 0;
  }

  .header-account-area,
  .snapshot-status-block {
    min-width: 0;
    justify-content: flex-end;
  }

  .scan-status {
    width: min(100%, 300px);
    min-width: 0;
    justify-items: end;
  }

  .scan-status-primary,
  .scan-status-secondary {
    justify-content: flex-end;
    text-align: right;
  }

  .command-header .ticker-form {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
  }

  .command-header .ticker-form input {
    width: 100%;
  }

  .score-orb {
    width: 64px;
    flex-basis: 64px;
  }

  h1 {
    font-size: 38px;
  }

  .ticker-form div {
    display: grid;
    grid-template-columns: 1fr auto;
  }

  .universe-heading,
  .universe-controls {
    display: grid;
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .price-history-head {
    display: grid;
    align-items: start;
  }

  .price-history-controls {
    justify-content: flex-start;
  }

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

  #universe-summary {
    margin-left: 0;
  }

  .universe-controls input {
    width: 100%;
  }

  .universe-row {
    gap: 8px;
  }

  .universe-exchange {
    display: none;
  }

  input {
    width: 100%;
  }

  .evidence-row {
    display: grid;
  }
}
.header-account-area {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
}

.member-account { position: relative; flex: 0 0 auto; }
.account-avatar {
  display: grid; place-items: center; width: 42px; height: 42px; padding: 0;
  border: 1px solid rgba(156, 171, 218, .34); border-radius: 50%; overflow: hidden;
  background: #222a3d; color: #f7f8ff; font-weight: 800; cursor: pointer;
}
.account-avatar img { width: 100%; height: 100%; object-fit: cover; }
.account-menu {
  position: absolute; z-index: 30; top: calc(100% + 10px); right: 0; width: 260px;
  padding: 10px; border: 1px solid rgba(156, 171, 218, .22); border-radius: 16px;
  background: rgba(17, 23, 39, .98); box-shadow: 0 20px 50px rgba(0, 0, 0, .42);
  backdrop-filter: blur(18px);
}
.account-menu div { display: grid; gap: 3px; padding: 8px 9px 10px; }
.account-menu strong { font-size: 14px; line-height: 1.25; }
.account-menu small { color: #8e9aba; font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.account-menu p { margin: 0 9px 9px; color: #73e7b3; font-size: 10px; font-weight: 850; text-transform: uppercase; letter-spacing: .11em; }
.account-menu button {
  display: flex; align-items: center; gap: 9px; width: 100%; margin: 0; padding: 10px 9px;
  border: 0; border-top: 1px solid rgba(156, 171, 218, .15); border-radius: 0 0 10px 10px;
  background: transparent; color: #c2cae1; font-size: 12px; font-weight: 750; text-align: left; cursor: pointer;
}
.account-menu button:hover { background: rgba(139, 124, 255, .09); color: #fff; }
.account-menu button span { color: #8895b8; font-size: 15px; transform: rotate(180deg); }
.auth-gate {
  position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(circle at top left, rgba(103, 87, 255, .15), transparent 38%), #090e1b;
}
.auth-gate[hidden] { display: none; }
.auth-gate section { box-sizing: border-box; width: min(430px, 100%); padding: 36px; border: 1px solid #27304a; border-radius: 22px; background: #111727; box-shadow: 0 28px 70px rgba(0,0,0,.4); }
.auth-gate h1 { margin: 14px 0 10px; font-size: clamp(30px, 7vw, 44px); }
.auth-gate section > p:not(.kicker) { color: #a9b3d2; line-height: 1.55; }
.auth-gate #google-signin-button { margin: 24px 0 18px; min-height: 44px; }
.auth-gate #subscribe-button, .auth-gate #preview-button { width: 100%; margin: 20px 0 14px; padding: 14px; }
.auth-gate a { color: #aeb8ff; }
.auth-gate #auth-gate-error { color: #ff7891; font-size: 13px; }
.is-auth-gated .app-shell { visibility: hidden; }
.preview-status { position: relative; display: flex; align-items: center; gap: 9px; margin: 0; padding: 6px 7px 6px 11px; border: 1px solid rgba(139, 92, 246, .45); border-radius: 12px; background: rgba(139, 92, 246, .12); color: #dcd7ff; white-space: nowrap; }
.preview-status span { display: grid; gap: 1px; }
.preview-status small { color: #9ea8c8; font-size: 8px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.preview-status strong { font-variant-numeric: tabular-nums; font-size: 13px; letter-spacing: .04em; }
.preview-status button { min-height: 32px; padding: 0 11px; border-color: rgba(164, 150, 255, .58); background: linear-gradient(135deg, #6757ff, #8d68ff); color: #fff; font-size: 10px; font-weight: 850; }
.preview-status-error { position: absolute; top: calc(100% + 4px); right: 0; color: #ff7891; font-size: 10px; font-style: normal; }

@media (max-width: 760px) {
  .command-section,
  .command-actions,
  .command-panel-content,
  .collapsible-heading,
  .ticker-strip,
  .ranking-collection-buttons,
  .collection-group,
  .collection-group-buttons {
    min-width: 0;
    max-width: 100%;
  }

  .ranking-collection-buttons {
    display: grid;
    align-items: start;
    gap: 10px;
  }

  .collection-primary-actions,
  .collection-group-buttons {
    gap: 6px;
  }

  .collection-group-label {
    font-size: 10px;
  }

  .collection-group-buttons button {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  #status-line {
    max-width: 100%;
    white-space: normal;
  }

  .header-account-area { gap: 10px; }
  .account-avatar { width: 38px; height: 38px; }
  .account-menu { position: fixed; top: 76px; right: 12px; left: 12px; width: auto; }
  .auth-gate section { padding: 30px 24px; }
}
