@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;600;700&display=swap");

:root,
[data-theme="dark"] {
  --bg: #0b0e14;
  --bg-soft: #0f141f;
  --surface: #151a22;
  --surface-strong: #1b2430;
  --surface-soft: #111720;
  --text-primary: #f5f7fa;
  --text-secondary: #c4cfdd;
  --text-muted: #9aa9bd;
  --line: rgba(196, 207, 221, 0.16);
  --line-strong: rgba(196, 207, 221, 0.28);
  --brand: #63a2ff;
  --brand-strong: #8ebcff;
  --accent: #2dd4bf;
  --grad-aurora: linear-gradient(135deg, #2dd4bf 0%, #60a5fa 45%, #a78bfa 75%, #f472b6 100%);
  --grad-verdigris: linear-gradient(135deg, #0f766e 0%, #14b8a6 55%, #5eead4 100%);
  --grad-inksteel: linear-gradient(135deg, #475569 0%, #0ea5a3 60%, #22d3ee 100%);
  --grad-ember: linear-gradient(135deg, #f59e0b 0%, #fb7185 55%, #c084fc 100%);
  --grad-indigo: linear-gradient(135deg, #60a5fa 0%, #818cf8 50%, #a78bfa 100%);
  --grad-copper: linear-gradient(135deg, #d0824a 0%, #b8712a 42%, #14b8a6 100%);
  --accent-gradient: var(--grad-copper);
  --cta-gradient: linear-gradient(135deg, #d0824a 0%, #c2703a 45%, #0f766e 100%);
  --cta-gradient-hover: linear-gradient(135deg, #b8712a 0%, #a8631f 45%, #0b5e57 100%);
  --positive: #10d27a;
  --negative: #ff3d00;
  --warning: #f59e0b;
  --info: #38bdf8;
  --badge-neutral: #64748b;
  --shadow-lg: 0 24px 48px rgba(0, 0, 0, 0.44);
  --shadow-md: 0 14px 32px rgba(0, 0, 0, 0.34);
  --radius-xl: 24px;
  --radius-lg: 16px;
  --radius-md: 10px;
  --max-width: 1320px;
  --header-bg: rgba(11, 14, 20, 0.88);
  --chart-grid: rgba(196, 207, 221, 0.12);
  --chart-axis: rgba(196, 207, 221, 0.2);
  --chart-trend-line: #63a2ff;
  --chart-trend-fill: rgba(99, 162, 255, 0.14);
  --chart-portfolio-line: #00e676;
  --chart-benchmark-line: #7aa2ff;
  --chart-benchmark-acwi-line: #22d3ee;
  --chart-benchmark-qqq-line: #f59e0b;
  --chart-benchmark-iwm-line: #f43f5e;
  --chart-benchmark-efa-line: #a78bfa;
  --focus-outline: rgba(99, 162, 255, 0.45);
  --anim-duration: 0.45s;
  --anim-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="light"] {
  --bg: #eef1f7;
  --bg-soft: #e7ecf4;
  --surface: #ffffff;
  --surface-strong: #f9fbff;
  --surface-soft: #f2f6ff;
  --text-primary: #0f1d33;
  --text-secondary: #273b57;
  --text-muted: #5f7390;
  --line: rgba(15, 29, 51, 0.12);
  --line-strong: rgba(15, 29, 51, 0.2);
  --brand: #3b82f6;
  --brand-strong: #2563eb;
  --accent: #14b8a6;
  --grad-aurora: linear-gradient(135deg, #14b8a6 0%, #3b82f6 45%, #8b5cf6 75%, #ec4899 100%);
  --grad-verdigris: linear-gradient(135deg, #0f766e 0%, #14b8a6 55%, #5eead4 100%);
  --grad-inksteel: linear-gradient(135deg, #334155 0%, #0ea5a3 60%, #22d3ee 100%);
  --grad-ember: linear-gradient(135deg, #f59e0b 0%, #f43f5e 55%, #a855f7 100%);
  --grad-indigo: linear-gradient(135deg, #3b82f6 0%, #6366f1 50%, #7c3aed 100%);
  --grad-copper: linear-gradient(135deg, #c2703a 0%, #a8631f 42%, #0f766e 100%);
  --accent-gradient: var(--grad-copper);
  --cta-gradient: linear-gradient(135deg, #c2703a 0%, #b45309 45%, #0f766e 100%);
  --cta-gradient-hover: linear-gradient(135deg, #a8631f 0%, #92400e 45%, #0b5e57 100%);
  --positive: #10b981;
  --negative: #e53935;
  --warning: #c97a00;
  --info: #0284c7;
  --badge-neutral: #475569;
  --shadow-lg: 0 18px 42px rgba(15, 29, 51, 0.12);
  --shadow-md: 0 10px 24px rgba(15, 29, 51, 0.1);
  --header-bg: rgba(245, 248, 255, 0.55);
  --chart-grid: rgba(15, 29, 51, 0.1);
  --chart-axis: rgba(15, 29, 51, 0.2);
  --chart-trend-line: #1d4ed8;
  --chart-trend-fill: rgba(29, 78, 216, 0.12);
  --chart-portfolio-line: #00c853;
  --chart-benchmark-line: #3b82f6;
  --chart-benchmark-acwi-line: #0891b2;
  --chart-benchmark-qqq-line: #d97706;
  --chart-benchmark-iwm-line: #e11d48;
  --chart-benchmark-efa-line: #7c3aed;
  --focus-outline: rgba(29, 78, 216, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: var(--text-primary);
  position: relative;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 0% 0%, rgba(20, 184, 166, 0.16), transparent 34%),
    radial-gradient(circle at 100% 4%, rgba(139, 92, 246, 0.16), transparent 32%),
    radial-gradient(circle at 88% 92%, rgba(236, 72, 153, 0.12), transparent 34%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-soft) 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: -12% -8%;
  pointer-events: none;
  z-index: 0;
}

body::before {
  background:
    radial-gradient(circle at 18% 24%, rgba(59, 130, 246, 0.22), transparent 40%),
    radial-gradient(circle at 84% 30%, rgba(45, 212, 191, 0.2), transparent 40%),
    radial-gradient(circle at 70% 84%, rgba(168, 85, 247, 0.2), transparent 42%);
  animation: background-drift-1 16s ease-in-out infinite alternate;
}

body::after {
  background:
    linear-gradient(130deg, transparent 0%, rgba(236, 72, 153, 0.1) 46%, transparent 78%),
    linear-gradient(300deg, transparent 0%, rgba(45, 212, 191, 0.1) 42%, transparent 74%);
  animation: background-drift-2 20s ease-in-out infinite alternate;
}

.site-header,
.page,
.footer {
  position: relative;
  z-index: 1;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
}

.shell {
  width: min(100%, calc(var(--max-width) + 56px));
  margin: 0 auto;
  padding-inline: 28px;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(16px);
  background: var(--header-bg);
  border-bottom: 1px solid var(--line);
}

.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 0;
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-secondary);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.nav-toggle:hover,
.nav-toggle:focus-visible {
  color: var(--text-primary);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
  outline: none;
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-primary);
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 0;
  border: none;
  background-image: url("images/arken-mark.svg");
  background-size: contain;
  background-repeat: no-repeat;
  color: transparent;
  background-position: center;
  background-repeat: no-repeat;
  box-shadow: var(--shadow-md);
  color: transparent;
  font-size: 0;
  line-height: 0;
  font-weight: 800;
  overflow: hidden;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.nav-links a,
.nav-dropdown > summary {
  padding: 9px 13px;
  border-radius: 999px;
  color: var(--text-secondary);
  transition: all 0.3s ease;
}

.nav-links a:hover,
.nav-links a.active,
.nav-dropdown > summary:hover,
.nav-dropdown.active > summary {
  color: var(--text-primary);
  background: rgba(99, 162, 255, 0.16);
  box-shadow: inset 0 0 0 1px rgba(99, 162, 255, 0.34);
  transform: translateY(-1px);
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.nav-dropdown > summary::-webkit-details-marker {
  display: none;
}

.nav-dropdown > summary::after {
  content: "▾";
  font-size: 0.78rem;
  opacity: 0.8;
}

.nav-dropdown[open] > summary::after {
  transform: rotate(180deg);
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 220px;
  padding: 10px;
  display: grid;
  gap: 6px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(17, 23, 32, 0.98);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-lg);
  z-index: 40;
}

[data-theme="light"] .nav-dropdown-menu {
  background: rgba(255, 255, 255, 0.98);
}

.nav-dropdown-menu a {
  display: block;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.3s ease;
  font: inherit;
}

.theme-toggle:hover {
  transform: translateY(-2px);
  color: var(--text-primary);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--focus-outline);
  outline-offset: 2px;
}

.theme-toggle-icon {
  font-size: 0.95rem;
}

.theme-toggle-label {
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.language-selector {
  align-items: center;
  display: inline-flex;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.language-selector select {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-primary);
  padding: 8px 10px;
}

.page {
  padding: 36px 0 92px;
}

.hero {
  padding: 34px;
  border-radius: var(--radius-xl);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  animation: fade-in-up var(--anim-duration) var(--anim-ease) both;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(330px, 0.7fr);
  gap: 24px;
}

.hero-copy {
  display: grid;
  gap: 18px;
  align-content: start;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(99, 162, 255, 0.16);
  color: var(--brand-strong);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border: 1px solid rgba(99, 162, 255, 0.32);
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.08;
  color: var(--text-primary);
}

h1 {
  font-size: clamp(2.2rem, 6vw, 4rem);
  margin-top: 14px;
  font-weight: 800;
}

h2 {
  font-size: clamp(1.6rem, 3.5vw, 2.3rem);
  font-weight: 700;
}

h3 {
  font-size: 1.18rem;
  font-weight: 700;
}

.lede,
.muted {
  color: var(--text-secondary);
}

.lede {
  font-size: 1.04rem;
  line-height: 1.65;
  margin: 16px 0 0;
  max-width: 72ch;
}

.hero-meta {
  display: grid;
  gap: 14px;
  align-content: end;
}

.hero-performance-card {
  display: grid;
  gap: 10px;
  margin-top: 8px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.015));
}

.hero-performance-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.hero-performance-note {
  margin: 0;
}

.stat-grid,
.card-grid,
.two-up,
.three-up {
  display: grid;
  gap: 18px;
}

.stat-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 26px;
}

.three-up {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.two-up {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.card-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.section {
  margin-top: 32px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.card,
.stat-card,
.table-shell,
.empty-state,
.link-card,
.faq-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease, background 0.3s ease;
}

.card:hover,
.stat-card:hover,
.link-card:hover,
.faq-item:hover,
.table-shell:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
}

.card,
.stat-card,
.empty-state,
.link-card,
.faq-item {
  padding: 22px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.stat-card .value,
.value,
.metric,
.component-score,
.numeric {
  font-family: "JetBrains Mono", "Fira Code", "Consolas", monospace;
  font-variant-numeric: tabular-nums;
}

.stat-card {
  color: #ffffff;
  border: none;
  background: var(--grad-copper);
}
.stat-card:nth-of-type(4n + 2) {
  background: var(--grad-verdigris);
}
.stat-card:nth-of-type(4n + 3) {
  background: var(--grad-indigo);
}
.stat-card:nth-of-type(4n + 4) {
  background: var(--grad-inksteel);
}
.stat-card .kicker,
.stat-card .positive,
.stat-card .negative,
.stat-card .subtle,
.stat-card .muted,
.stat-card .change {
  color: rgba(255, 255, 255, 0.9);
}
.stat-card .value {
  font-size: 1.95rem;
  margin-top: 8px;
  color: #ffffff;
}
.hero h1,
.hero-copy h1,
.page-intro h1 {
  background: linear-gradient(110deg, #c2703a, #a8631f, #0f766e, #14b8a6, #c2703a);
  background-size: 300% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: akHue 9s linear infinite;
}
@keyframes akHue {
  to {
    background-position: 300% center;
  }
}

.kicker {
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  color: var(--text-secondary);
  font-size: 0.84rem;
  font-weight: 500;
}

#home-snapshot-badge,
#home-model-health {
  font-weight: 700;
}

#home-snapshot-note,
#home-model-health-note {
  line-height: 1.45;
}

.score-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 14px;
  color: #ffffff;
  box-shadow: var(--shadow-md);
}

.score-chip strong {
  font-size: 1.35rem;
  font-family: "JetBrains Mono", "Fira Code", "Consolas", monospace;
  font-variant-numeric: tabular-nums;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.mode-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  align-items: center;
}

.mode-switch-btn {
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 8px 12px;
  font: inherit;
  font-size: 0.86rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.mode-switch-btn:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
}

.mode-switch-btn.active {
  color: var(--text-primary);
  background: rgba(99, 162, 255, 0.16);
  border-color: rgba(99, 162, 255, 0.4);
}

.mode-switch-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.mode-switch-hint {
  margin-left: 4px;
}

.top-movers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
  margin-bottom: 6px;
  align-items: start;
}

.mover-column {
  padding: 16px;
  height: 100%;
}

.mover-list {
  display: grid;
  gap: 10px;
}

.mover-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  padding: 12px;
  transition: all 0.3s ease;
}

.mover-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
}

.mover-card-positive {
  border-left: 3px solid var(--positive);
}

.mover-card-negative {
  border-left: 3px solid var(--negative);
}

.mover-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.mover-title-link {
  color: var(--text-primary);
}

.mover-delta {
  font-family: "JetBrains Mono", "Fira Code", "Consolas", monospace;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.mover-name {
  margin-top: 2px;
}

.mover-reason {
  margin: 8px 0 0;
  color: var(--text-secondary);
  line-height: 1.45;
  font-size: 0.88rem;
}

.toolbar input,
.toolbar select {
  min-width: 160px;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--text-primary);
  font: inherit;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.toolbar input:focus,
.toolbar select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--focus-outline);
}

.toolbar input:hover,
.toolbar select:hover {
  transform: translateY(-1px);
}

.rankings-filters-card {
  margin-top: 24px;
}

.rankings-filters-card .toolbar.hidden {
  display: none;
}

.rankings-filters-card .toolbar {
  margin-top: 10px;
}

.factor-screener-panel {
  flex-basis: 100%;
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(99, 162, 255, 0.11), rgba(16, 185, 129, 0.07));
}

.factor-screener-panel.hidden {
  display: none;
}

.factor-screener-copy,
.factor-screener-mode-note {
  color: var(--text-secondary);
  line-height: 1.45;
}

.factor-screener-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 14px;
}

.factor-screener-primary {
  display: grid;
  gap: 6px;
  min-width: min(280px, 100%);
}

.factor-screener-thresholds {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.factor-slider-row {
  display: grid;
  grid-template-columns: minmax(92px, 1fr) minmax(88px, 1.4fr) 38px;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--text-secondary);
}

.factor-slider-row input[type="range"] {
  width: 100%;
  accent-color: var(--brand);
}

.factor-slider-row output {
  font-family: "JetBrains Mono", "Fira Code", "Consolas", monospace;
  color: var(--text-primary);
  text-align: right;
}

.factor-screener-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.factor-screener-row td {
  vertical-align: top;
}

.factor-component-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.factor-component-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border-radius: 999px;
  border: 1px solid rgba(99, 162, 255, 0.34);
  background: rgba(99, 162, 255, 0.12);
  color: var(--text-secondary);
  font-family: "JetBrains Mono", "Fira Code", "Consolas", monospace;
  font-size: 0.78rem;
}

.table-shell {
  overflow: hidden;
  border-radius: 18px;
}

.table-responsive {
  overflow-x: auto;
}

.band-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 11px;
  border-radius: 999px;
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.bar-track {
  width: 100%;
  height: 9px;
  margin-top: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

[data-theme="light"] .bar-track {
  background: rgba(15, 29, 51, 0.09);
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--accent-gradient);
}

table {
  width: 100%;
  border-collapse: collapse;
}

.sector-groups {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.sector-group-card {
  padding: 16px;
}

.sector-table {
  min-width: 1040px;
}

.sector-table th:nth-child(1),
.sector-table td:nth-child(1) {
  min-width: 86px;
}

.sector-table th:nth-child(2),
.sector-table td:nth-child(2) {
  min-width: 380px;
}

.sector-table th:nth-child(3),
.sector-table td:nth-child(3),
.sector-table th:nth-child(4),
.sector-table td:nth-child(4),
.sector-table th:nth-child(5),
.sector-table td:nth-child(5),
.sector-table th:nth-child(6),
.sector-table td:nth-child(6) {
  min-width: 138px;
}

.sector-company-cell {
  max-width: 440px;
}

.sector-alert-reason {
  margin-top: 4px;
  line-height: 1.35;
}

.sector-country-flag {
  margin-top: 3px;
}

thead {
  background: rgba(99, 162, 255, 0.11);
}

th,
td {
  padding: 13px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  font-size: 0.93rem;
}

tbody tr {
  transition: all 0.3s ease;
}

tbody tr:hover {
  background: rgba(99, 162, 255, 0.08);
  transform: translateY(-1px);
}

.ranking-row {
  cursor: pointer;
}

.ranking-detail-row {
  background: transparent;
}

.ranking-detail-row.hidden {
  display: none;
}

.ranking-detail-row:hover {
  background: transparent;
  transform: none;
}

.ranking-detail-shell {
  margin: 6px 0 8px;
  padding: 16px;
  border-radius: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  display: grid;
  gap: 10px;
}

.ranking-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.ranking-detail-grid > div {
  padding: 11px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.ranking-detail-components {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ranking-quick-summary {
  display: grid;
  gap: 6px;
  padding: 12px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.ranking-quick-summary p {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.45;
}

.ranking-signal-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.ranking-signal-pill {
  border: 1px solid transparent;
}

.ranking-signal-validated {
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(16, 185, 129, 0.45);
  color: #9af2cf;
}

.ranking-signal-heuristic {
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(245, 158, 11, 0.45);
  color: #fdd28f;
}

.ranking-signal-unavailable {
  background: rgba(148, 163, 184, 0.16);
  border-color: rgba(148, 163, 184, 0.45);
  color: #d3dbe6;
}

.ranking-technical-details {
  border-top: 1px dashed var(--line);
  padding-top: 10px;
}

.ranking-technical-details > summary {
  cursor: pointer;
  color: var(--text-primary);
  font-weight: 600;
  margin-bottom: 8px;
}

.validation-advanced-details {
  padding: 0;
  overflow: hidden;
}

.validation-advanced-summary {
  cursor: pointer;
  display: grid;
  gap: 8px;
  list-style: none;
  padding: 22px;
  position: relative;
}

.validation-advanced-summary::-webkit-details-marker {
  display: none;
}

.validation-advanced-summary::after {
  content: "Expand";
  color: var(--accent);
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  position: absolute;
  right: 22px;
  text-transform: uppercase;
  top: 22px;
}

.validation-advanced-details[open] .validation-advanced-summary::after {
  content: "Collapse";
}

.validation-advanced-summary .advanced-title {
  color: var(--text-primary);
  font-size: clamp(1.25rem, 2vw, 1.8rem);
  font-weight: 800;
  line-height: 1.15;
  padding-right: 92px;
}

.validation-advanced-body {
  border-top: 1px solid var(--line);
  padding: 0 22px 22px;
}

.validation-compact-note {
  margin-top: 12px;
}

.metric {
  font-size: 2.45rem;
  line-height: 1;
}

.list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.list li {
  padding: 11px 12px;
  background: var(--surface-soft);
  border-radius: 10px;
  border: 1px solid var(--line);
}

.company-title {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}

.company-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.company-snapshot-mode {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.company-snapshot-pill {
  border-color: rgba(148, 163, 184, 0.4);
}

.company-snapshot-pill[data-snapshot-mode="daily"] {
  border-color: rgba(56, 189, 248, 0.5);
}

.company-snapshot-pill[data-snapshot-mode="monthly"] {
  border-color: rgba(16, 185, 129, 0.5);
}

.company-dashboard-toolbar {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.company-peer-filters {
  align-items: center;
}

.company-peer-filters label {
  align-self: center;
  font-size: 0.78rem;
}

.company-insight-grid .card {
  min-height: 210px;
}

.panel-stack {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
}

.report-card {
  display: grid;
  gap: 1rem;
}

.report-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.report-card-head h2 {
  margin-bottom: 0;
}

.report-metric-grid {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.report-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.report-link.primary,
.btn-primary,
button.btn-primary {
  border: none;
  color: #ffffff;
  background: var(--cta-gradient);
  box-shadow: 0 8px 22px rgba(180, 83, 9, 0.32);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.report-link.primary:hover,
.btn-primary:hover,
button.btn-primary:hover {
  background: var(--cta-gradient-hover);
  color: #ffffff;
}

.insight-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 9px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  min-width: 0;
}

.insight-label {
  color: var(--text-muted);
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.insight-value {
  color: var(--text-primary);
  font-family: "JetBrains Mono", "Fira Code", "Consolas", monospace;
  font-variant-numeric: tabular-nums;
  font-size: 0.95rem;
  min-width: 0;
  overflow-wrap: anywhere;
  text-align: right;
}

.quality-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  border: 1px solid var(--line);
}

.quality-indicator-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
}

.quality-indicator-green .quality-indicator-dot {
  background: var(--positive);
}

.quality-indicator-yellow .quality-indicator-dot {
  background: var(--warning);
}

.quality-indicator-red .quality-indicator-dot {
  background: var(--negative);
}

.strategy-source-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  border: 1px solid var(--line);
  margin-bottom: 8px;
}

.strategy-source-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  display: inline-block;
}

.strategy-source-classifier {
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(16, 185, 129, 0.38);
  color: #9af2cf;
}

.strategy-source-classifier .strategy-source-dot {
  background: #10b981;
}

.strategy-source-heuristic_bottom_strategy {
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(245, 158, 11, 0.42);
  color: #fdd28f;
}

.strategy-source-heuristic_bottom_strategy .strategy-source-dot {
  background: #f59e0b;
}

.strategy-source-unavailable {
  background: rgba(148, 163, 184, 0.14);
  border-color: rgba(148, 163, 184, 0.35);
  color: #d3dbe6;
}

.strategy-source-unavailable .strategy-source-dot {
  background: #94a3b8;
}

.strategy-source-note {
  margin-top: 4px;
}

.histogram-shell {
  width: 100%;
}

.histogram-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.histogram-badge {
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 0.82rem;
}

.company-stock-chart-shell {
  width: 100%;
}

.company-stock-window-btn {
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 7px 11px;
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.25s ease;
}

.company-stock-window-btn.active {
  color: var(--text-primary);
  border-color: rgba(99, 162, 255, 0.42);
  background: rgba(99, 162, 255, 0.16);
}

.inline-company-link {
  color: var(--brand-strong);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ticker-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  min-width: 0;
}

.ticker-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 9px;
  border-radius: 999px;
  border: 1px solid rgba(99, 162, 255, 0.28);
  background: rgba(99, 162, 255, 0.1);
  color: var(--brand-strong);
  font-family: "JetBrains Mono", "Fira Code", "Consolas", monospace;
  font-size: 0.82rem;
  text-decoration: none;
  max-width: 100%;
}

.ticker-chip:hover {
  border-color: rgba(99, 162, 255, 0.55);
  background: rgba(99, 162, 255, 0.18);
}

.ticker-chip-more {
  color: var(--text-muted);
  border-color: var(--line);
  background: var(--surface-soft);
}

.compact-empty {
  padding: 12px;
  box-shadow: none;
}

.validation-composition-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.validation-composition-card {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
  padding: 15px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.validation-composition-card:hover,
.validation-composition-card:focus-visible,
.validation-composition-card.active {
  border-color: rgba(121, 169, 255, 0.72);
  box-shadow: 0 18px 44px rgba(31, 111, 235, 0.16);
  outline: none;
  transform: translateY(-1px);
}

.validation-composition-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.validation-composition-head h3 {
  margin: 2px 0 0;
}

.composition-performance-panel {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(12, 18, 28, 0.45);
  padding: 16px;
}

.composition-performance-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.composition-performance-head h3 {
  margin: 3px 0 6px;
}

.composition-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.composition-metric-grid > div {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
  padding: 11px;
}

.composition-metric-grid strong {
  display: block;
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 1.05rem;
}

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

.backtest-summary-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(145deg, var(--surface), var(--surface-soft));
  padding: 16px;
  min-width: 0;
}

.backtest-metric-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.backtest-contributor-row {
  display: grid;
  gap: 8px;
  padding: 10px 0 0;
}

.backtest-contributor-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.narrative-candidate-grid {
  margin-top: 12px;
}

.narrative-candidate-card {
  align-content: start;
  display: grid;
  gap: 10px;
}

.narrative-risk-row {
  margin-top: 2px;
}

.risk-badge {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.32);
}

.validation-sleeve-row {
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.validation-sleeve-row .insight-label {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.validation-ticker-links {
  flex: 1 1 100%;
  line-height: 1.8;
  min-width: 0;
  overflow-wrap: anywhere;
}

.cohort-composition {
  display: grid;
  gap: 10px;
  padding: 12px 0;
}

.cohort-composition-row {
  display: grid;
  grid-template-columns: minmax(90px, 130px) 1fr;
  gap: 12px;
  align-items: start;
}

body.company-view-quick .deep-dive-only {
  display: none;
}

.company-alert-slot {
  margin-top: 14px;
}

.alert-card {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid;
  background: rgba(245, 158, 11, 0.14);
  color: #ffe8bf;
}

.alert-card strong {
  display: block;
  margin-bottom: 4px;
}

.alert-card-warning {
  border-color: rgba(245, 158, 11, 0.5);
  background: rgba(245, 158, 11, 0.16);
  color: #ffdba2;
}

.alert-card-critical {
  border-color: rgba(255, 61, 0, 0.52);
  background: rgba(255, 61, 0, 0.18);
  color: #ffd3c4;
}

.alert-card-info {
  border-color: rgba(56, 189, 248, 0.5);
  background: rgba(56, 189, 248, 0.16);
  color: #c8f1ff;
}

[data-theme="light"] .alert-card-warning {
  color: #7a4700;
}

[data-theme="light"] .alert-card-critical {
  color: #8f2900;
}

[data-theme="light"] .alert-card-info {
  color: #0b4f73;
}

.alert-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  border: 1px solid transparent;
}

.alert-chip-warning {
  background: rgba(245, 158, 11, 0.18);
  color: #ffd18b;
  border-color: rgba(245, 158, 11, 0.4);
}

.alert-chip-critical {
  background: rgba(255, 61, 0, 0.2);
  color: #ffc1ac;
  border-color: rgba(255, 61, 0, 0.45);
}

.alert-chip-info {
  background: rgba(56, 189, 248, 0.18);
  color: #baeafd;
  border-color: rgba(56, 189, 248, 0.38);
}

.chart-shell {
  padding: 14px;
  border-radius: var(--radius-lg);
  background: var(--surface-soft);
  border: 1px solid var(--line);
}

.company-score-rail {
  margin-top: 11px;
}

.chart-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.trend-chip {
  padding: 9px 11px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text-secondary);
  font-size: 0.84rem;
}

.mini-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.mini-card {
  padding: 13px;
  border-radius: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
}

.mini-card strong {
  display: block;
  margin-top: 6px;
  font-family: "JetBrains Mono", "Fira Code", "Consolas", monospace;
  font-size: 1.12rem;
  color: var(--text-primary);
}

.footer {
  padding: 20px 0 34px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.notice {
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.34);
  color: var(--text-secondary);
}

.notice.compact {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  font-size: 0.92rem;
  overflow-wrap: anywhere;
}

.page-intro {
  max-width: 840px;
  margin-bottom: 22px;
}

.link-card {
  display: grid;
  gap: 9px;
  min-height: 180px;
}

.component-score {
  font-size: 1.52rem;
}

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

.subtle {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.performance-card {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
}

.performance-metrics {
  margin-top: 11px;
}

.performance-chart-shell {
  margin-top: 11px;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 0.86rem;
}

.chart-legend.compact {
  gap: 10px;
  margin-bottom: 6px;
  font-size: 0.8rem;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.legend-swatch {
  width: 20px;
  height: 0;
  border-top: 3px solid var(--legend-color, var(--chart-trend-line));
  border-radius: 999px;
  display: inline-block;
  opacity: 0.95;
}

.legend-swatch.dashed {
  border-top-style: dashed;
}

.legend-dot-portfolio {
  background: var(--chart-portfolio-line);
}

.legend-dot-benchmark {
  background: var(--chart-benchmark-line);
}

.benchmark-toggle-wrap {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.benchmark-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.benchmark-toggle-btn {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 6px 11px;
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.25s ease;
}

.benchmark-toggle-btn:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
}

.benchmark-toggle-btn.active {
  color: var(--text-primary);
  border-color: rgba(99, 162, 255, 0.45);
  background: rgba(99, 162, 255, 0.14);
}

.performance-chart-placeholder {
  color: var(--text-muted);
  font-size: 0.92rem;
}

.hero-chart-shell {
  margin-top: 0;
}

.hero-chart-shell svg {
  height: 210px;
}

.cohort-performance-card {
  display: grid;
  gap: 10px;
}

.cohort-dashboard {
  display: none;
  gap: 10px;
}

.cohort-dashboard.active {
  display: grid;
  animation: fade-in-up var(--anim-duration) var(--anim-ease) both;
}

.cohort-chart-shell {
  min-height: 300px;
}

#home-cohort-performance-canvas {
  width: 100%;
  height: 280px;
  display: block;
}

.cohort-dashboard canvas {
  width: 100%;
  height: 280px;
  display: block;
}

.cohort-narrative-block {
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.ambient-cursor-glow {
  position: fixed;
  left: 0;
  top: 0;
  width: 380px;
  height: 380px;
  border-radius: 999px;
  pointer-events: none;
  z-index: 0;
  opacity: 0.62;
  filter: blur(22px);
  transform: translate3d(-9999px, -9999px, 0);
  background:
    radial-gradient(circle, rgba(99, 162, 255, 0.3) 0%, rgba(99, 162, 255, 0.15) 38%, transparent 72%),
    radial-gradient(circle, rgba(0, 230, 118, 0.22) 0%, transparent 66%);
  transition: opacity 240ms ease;
}

[data-theme="light"] .ambient-cursor-glow {
  opacity: 0.48;
  background:
    radial-gradient(circle, rgba(29, 78, 216, 0.22) 0%, rgba(29, 78, 216, 0.1) 40%, transparent 72%),
    radial-gradient(circle, rgba(15, 118, 110, 0.16) 0%, transparent 68%);
}

.mermaid {
  width: 100%;
  overflow-x: auto;
  padding: 10px 4px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.45);
}

.performance-status-outperforming {
  background: rgba(0, 230, 118, 0.17);
  color: var(--positive);
  border: 1px solid rgba(0, 230, 118, 0.38);
}

.performance-status-underperforming {
  background: rgba(255, 61, 0, 0.18);
  color: var(--negative);
  border: 1px solid rgba(255, 61, 0, 0.38);
}

.performance-status-matching,
.performance-status-insufficient {
  background: rgba(100, 116, 139, 0.18);
  color: var(--text-secondary);
  border: 1px solid rgba(100, 116, 139, 0.36);
}

.alert-stream-item {
  border-left: 3px solid rgba(255, 61, 0, 0.45);
}

.subscribe-form {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.subscribe-form label {
  display: grid;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 0.92rem;
}

.subscribe-form input,
.subscribe-form select {
  width: 100%;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--text-primary);
  font: inherit;
}

.subscribe-form input:focus,
.subscribe-form select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--focus-outline);
}

.checkbox-row {
  grid-template-columns: auto 1fr;
  align-items: center;
  column-gap: 10px;
}

.checkbox-row input {
  width: 16px;
  height: 16px;
}

.primary-btn {
  border: 1px solid rgba(99, 162, 255, 0.4);
  background: linear-gradient(120deg, rgba(99, 162, 255, 0.28), rgba(0, 230, 118, 0.2));
  color: var(--text-primary);
  border-radius: 10px;
  padding: 10px 14px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.status-ready {
  color: var(--positive);
}

.status-pending {
  color: var(--warning);
}

.status-scheduled {
  color: var(--info);
}

.faq-item p {
  margin-bottom: 0;
}

.text-positive {
  color: var(--positive);
  font-weight: 700;
}

.text-negative {
  color: var(--negative);
  font-weight: 700;
}

.text-neutral {
  color: var(--text-secondary);
}

.delta-cell {
  font-family: "JetBrains Mono", "Fira Code", "Consolas", monospace;
  font-variant-numeric: tabular-nums;
}

.score-cell {
  font-family: "JetBrains Mono", "Fira Code", "Consolas", monospace;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.hidden {
  display: none !important;
}

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes background-drift-1 {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(-1.2%, 1.6%, 0) scale(1.04);
  }
}

@keyframes background-drift-2 {
  from {
    transform: translate3d(0, 0, 0) scale(1);
    opacity: 0.8;
  }
  to {
    transform: translate3d(1.4%, -1.4%, 0) scale(1.05);
    opacity: 1;
  }
}

.card-grid > *,
.three-up > *,
.two-up > *,
.stat-grid > *,
.table-shell tbody tr,
.faq-item,
.link-card {
  animation: fade-in-up var(--anim-duration) var(--anim-ease) both;
}

.card-grid > *:nth-child(1),
.three-up > *:nth-child(1),
.two-up > *:nth-child(1),
.stat-grid > *:nth-child(1),
.table-shell tbody tr:nth-child(1) {
  animation-delay: 30ms;
}

.card-grid > *:nth-child(2),
.three-up > *:nth-child(2),
.two-up > *:nth-child(2),
.stat-grid > *:nth-child(2),
.table-shell tbody tr:nth-child(2) {
  animation-delay: 70ms;
}

.card-grid > *:nth-child(3),
.three-up > *:nth-child(3),
.two-up > *:nth-child(3),
.stat-grid > *:nth-child(3),
.table-shell tbody tr:nth-child(3) {
  animation-delay: 110ms;
}

.card-grid > *:nth-child(4),
.three-up > *:nth-child(4),
.two-up > *:nth-child(4),
.stat-grid > *:nth-child(4),
.table-shell tbody tr:nth-child(4) {
  animation-delay: 150ms;
}

.card-grid > *:nth-child(5),
.three-up > *:nth-child(5),
.two-up > *:nth-child(5),
.stat-grid > *:nth-child(5),
.table-shell tbody tr:nth-child(5) {
  animation-delay: 190ms;
}

.card-grid > *:nth-child(6),
.three-up > *:nth-child(6),
.two-up > *:nth-child(6),
.stat-grid > *:nth-child(6),
.table-shell tbody tr:nth-child(6) {
  animation-delay: 230ms;
}

@media (max-width: 980px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }

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

  .three-up {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .validation-composition-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .composition-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .backtest-summary-grid {
    grid-template-columns: 1fr;
  }

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

  .nav-row {
    flex-wrap: wrap;
    align-items: center;
  }

  .nav-toggle {
    display: inline-flex;
    margin-left: auto;
  }

  .nav-shell {
    width: 100%;
    order: 3;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  body.js-ready .nav-shell {
    display: none;
  }

  body.js-ready .nav-shell.is-open {
    display: flex;
  }

  .nav-links {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .theme-toggle,
  .language-selector {
    width: 100%;
    justify-content: center;
  }

  .nav-dropdown-menu {
    position: static;
    min-width: 0;
    margin-top: 8px;
    box-shadow: none;
    background: rgba(99, 162, 255, 0.06);
  }
}

@media (max-width: 680px) {
  .shell {
    padding-inline: 16px;
  }

  .page {
    padding-top: 22px;
  }

  .composition-performance-head {
    display: grid;
  }

  .composition-metric-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 20px;
  }

  h1 {
    font-size: 2.15rem;
  }

  th,
  td {
    padding: 11px 10px;
  }

  .toolbar input,
  .toolbar select {
    width: 100%;
  }

  .stat-grid {
    grid-template-columns: 1fr;
  }

  .three-up {
    grid-template-columns: 1fr;
  }

  .validation-composition-grid {
    grid-template-columns: 1fr;
  }

  .validation-composition-head {
    display: grid;
  }

  .insight-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .insight-value {
    text-align: left;
  }

  .mini-grid {
    grid-template-columns: 1fr;
  }

  .top-movers-grid {
    margin-bottom: 14px;
  }

  .theme-toggle-label {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  body::before,
  body::after {
    animation: none !important;
  }

  .ambient-cursor-glow {
    display: none;
  }
}

@media (pointer: coarse) {
  .ambient-cursor-glow {
    display: none;
  }
}

/* ----------------------------------------------------------------------
   Quick views: one-click preset filters on the rankings page.
   ---------------------------------------------------------------------- */
.quick-views {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0 4px;
}

.quick-view-btn {
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid rgba(99, 162, 255, 0.45);
  background: rgba(99, 162, 255, 0.12);
  color: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.quick-view-btn:hover {
  background: rgba(99, 162, 255, 0.22);
  border-color: rgba(99, 162, 255, 0.75);
}

.quick-view-btn.quick-view-reset {
  border-color: rgba(255, 255, 255, 0.18);
  background: transparent;
  opacity: 0.75;
}

[data-theme="light"] .quick-view-btn {
  border-color: rgba(36, 99, 235, 0.35);
  background: rgba(36, 99, 235, 0.08);
}

[data-theme="light"] .quick-view-btn:hover {
  background: rgba(36, 99, 235, 0.16);
}

[data-theme="light"] .quick-view-btn.quick-view-reset {
  border-color: rgba(15, 29, 51, 0.18);
  background: transparent;
}

#rankings-basic-filters {
  margin-top: 10px;
}

@media (max-width: 680px) {
  .quick-view-btn {
    flex: 1 1 calc(50% - 10px);
    text-align: center;
  }
}

/* ----------------------------------------------------------------------
   Mobile card layout for ranking tables.
   Below 680px the rankings table stops being a wide scrolling table and
   renders each row as a stacked card using td[data-label] captions.
   ---------------------------------------------------------------------- */
@media (max-width: 680px) {
  .rankings-table thead {
    display: none;
  }

  .rankings-table,
  .rankings-table tbody {
    display: block;
    width: 100%;
  }

  .rankings-table tr.ranking-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 14px;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  [data-theme="light"] .rankings-table tr.ranking-row {
    border-bottom: 1px solid rgba(15, 29, 51, 0.10);
  }

  .rankings-table tr.ranking-row td {
    display: block;
    padding: 0;
    border: none;
    min-width: 0;
  }

  .rankings-table tr.ranking-row td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 2px;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    opacity: 0.55;
  }

  .rankings-table tr.ranking-row td.cell-company,
  .rankings-table tr.ranking-row td[data-label="Company"] {
    grid-column: 1 / -1;
  }

  .rankings-table tr.ranking-row td[data-label="Top Components"] {
    grid-column: 1 / -1;
  }

  /* Detail drawer rows stay full-width blocks. */
  .rankings-table tr.ranking-detail-row {
    display: block;
  }

  .rankings-table tr.ranking-detail-row.hidden {
    display: none;
  }

  .rankings-table tr.ranking-detail-row td {
    display: block;
    width: 100%;
    border: none;
  }

  /* Sector tables keep horizontal scroll but with a saner minimum width. */
  .sector-table {
    min-width: 640px;
  }

  .sector-table th:nth-child(2),
  .sector-table td:nth-child(2) {
    min-width: 200px;
  }
}
