:root {
  --bg-primary: #0a0e17;
  --bg-secondary: #0d1117;
  --bg-tertiary: #111827;
  --bg-card: #0d1117cc;
  --foreground: #e2e8f0;
  --foreground-muted: #8b95a5;
  --foreground-dim: #76808c;
  --neon-cyan: #00d4ff;
  --market-positive: #00ff88;
  --market-negative: #ff4466;
  --market-neutral: #ffaa00;
  --market-muted: #8b949e;
  --line: rgba(0, 212, 255, 0.12);
  --line-strong: rgba(0, 212, 255, 0.28);
  --glass: #0a0e17a6;
  --max: 1800px;
  --mono: ui-monospace, "Geist Mono", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: ui-sans-serif, system-ui, "Segoe UI", sans-serif;
}

html[data-theme="light"] {
  --bg-primary: #f4f7fb;
  --bg-secondary: #ffffff;
  --bg-tertiary: #e7eef7;
  --bg-card: #ffffffe0;
  --foreground: #0f172a;
  --foreground-muted: #475569;
  --foreground-dim: #64748b;
  --neon-cyan: #0369a1;
  --market-positive: #065f46;
  --market-negative: #b91c1c;
  --market-neutral: #92400e;
  --market-muted: #64748b;
  --line: rgba(3, 105, 161, 0.18);
  --line-strong: rgba(3, 105, 161, 0.35);
  --glass: #ffffffc2;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--foreground);
  background: var(--bg-primary);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.55;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(0, 212, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 212, 255, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.3;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(0, 212, 255, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(0, 255, 136, 0.05) 0%, transparent 50%);
}

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

button,
input,
select {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--neon-cyan);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -40px;
  z-index: 80;
  padding: 8px 12px;
  background: var(--neon-cyan);
  color: #041018;
  font-weight: 700;
}

.skip-link:focus {
  top: 12px;
}

.wrap {
  position: relative;
  z-index: 1;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 16px 48px;
}

.ticker {
  position: sticky;
  top: 0;
  z-index: 30;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 40px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-secondary) 95%, transparent);
}

.ticker::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(0, 212, 255, 0.08) 20%,
    rgba(0, 255, 136, 0.06) 40%,
    rgba(0, 212, 255, 0.08) 60%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: holographicShimmer 8s linear infinite;
}

.ticker-track {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 22px;
  align-items: center;
  flex: 1;
  min-width: 0;
  position: relative;
  padding: 8px 0;
}

.tick {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  white-space: nowrap;
}

.tick b {
  letter-spacing: 0.04em;
}

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

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

.flat {
  color: var(--market-muted);
}

.ticker-meta {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  font-size: 11px;
  color: var(--foreground-muted);
}

.corte {
  border: 1px solid rgba(0, 255, 136, 0.35);
  background: rgba(0, 255, 136, 0.08);
  color: var(--market-positive);
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: 800;
  letter-spacing: 0.08em;
  font-size: 10px;
}

.mast {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  padding: 22px 0 8px;
}

.brand-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 16px;
}

.wordmark {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--neon-cyan);
  font-weight: 800;
}

.kicker {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--foreground-dim);
}

h1 {
  margin: 8px 0 6px;
  font-family: var(--sans);
  font-size: clamp(28px, 4.2vw, 44px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 750;
}

.lede {
  margin: 0;
  max-width: 72ch;
  color: var(--foreground-muted);
}

.tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.icon-btn,
.lang-btn,
.mode-btn {
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 999px;
  padding: 7px 12px;
  cursor: pointer;
}

.icon-btn:hover,
.lang-btn:hover,
.mode-btn:hover {
  border-color: var(--line-strong);
  color: var(--foreground);
}

.lang-switch {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}

.lang-btn {
  border: 0;
  border-radius: 0;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.08em;
  font-size: 11px;
}

.lang-btn.active {
  background: rgba(0, 212, 255, 0.14);
  color: var(--neon-cyan);
}

.mode-switch {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}

.mode-btn.active {
  background: rgba(0, 212, 255, 0.16);
  color: var(--neon-cyan);
  font-weight: 800;
}

.mode-note {
  margin: 6px 0 0;
  font-size: 11px;
  color: var(--foreground-dim);
}

.tabs {
  position: sticky;
  top: 40px;
  z-index: 29;
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  margin: 18px 0 0;
  background: var(--bg-primary);
  scrollbar-width: thin;
}

.tabs a {
  flex: 0 0 auto;
  padding: 10px 14px;
  color: var(--foreground-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 700;
  border-bottom: 2px solid transparent;
}

.tabs a:hover,
.tabs a[aria-current="page"] {
  color: var(--neon-cyan);
  border-bottom-color: var(--neon-cyan);
  text-shadow: 0 0 12px rgba(0, 212, 255, 0.35);
}

.summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: center;
  margin: 14px 0 18px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-card);
}

.summary span {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}

.score-chip {
  border: 1px solid rgba(0, 255, 136, 0.35);
  padding: 3px 8px;
  border-radius: 6px;
  color: var(--market-positive);
  font-weight: 800;
}

.noscript-note,
.cutoff-note {
  margin: 0 0 16px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--foreground-muted);
  background: var(--bg-card);
}

.panel {
  display: none;
  animation: fade 0.2s ease;
}

.panel.is-active,
html.no-js .panel,
.panel:target {
  display: grid;
}

.card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-card);
  padding: 18px 20px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--foreground-dim);
}

.verdict {
  font-family: var(--sans);
  font-size: clamp(36px, 6vw, 64px);
  line-height: 0.95;
  font-weight: 800;
  color: var(--market-neutral);
  margin: 4px 0 10px;
}

.verdict-meta {
  display: inline-flex;
  gap: 8px;
  margin-left: 8px;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--line);
  font-size: 11px;
  color: var(--foreground-muted);
  vertical-align: middle;
}

.pillars {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0 8px;
}

.pillar {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  background: color-mix(in srgb, var(--bg-tertiary) 70%, transparent);
}

.pillar b {
  display: block;
  margin-bottom: 6px;
  letter-spacing: 0.08em;
  font-size: 11px;
  text-transform: uppercase;
  color: var(--neon-cyan);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 11px;
}

.btn-primary {
  background: var(--market-neutral);
  color: #111;
  border: 0;
}

.btn-ghost {
  border: 1px solid var(--neon-cyan);
  color: var(--neon-cyan);
  background: transparent;
}

.btn-mute {
  border: 1px solid var(--line);
  background: transparent;
}

.grid {
  display: grid;
  gap: 12px;
}

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

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

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

.metric {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  background: var(--bg-card);
}

.metric .label {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--foreground-dim);
}

.metric .value {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-top: 4px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

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

th {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--foreground-dim);
  background: var(--bg-tertiary);
}

td.num {
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

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

.health div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--bg-card);
}

.health b {
  display: block;
  font-size: 11px;
  color: var(--foreground-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.chart-frame {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: var(--bg-card);
}

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

.lab {
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  padding: 14px;
  background: color-mix(in srgb, var(--bg-tertiary) 55%, transparent);
}

.lab label {
  display: block;
  margin: 8px 0;
}

.lab input[type="range"] {
  width: 100%;
  accent-color: var(--neon-cyan);
}

.quiz button {
  display: block;
  width: 100%;
  text-align: left;
  margin: 6px 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-secondary);
  cursor: pointer;
}

.quiz button.correct {
  border-color: var(--market-positive);
  background: rgba(0, 255, 136, 0.08);
}

.quiz button.wrong {
  border-color: var(--market-negative);
  background: rgba(255, 68, 70, 0.08);
}

details.answer {
  margin-top: 8px;
  color: var(--foreground-muted);
}

.site-footer {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--foreground-dim);
  font-size: 12px;
}

.asof {
  font-size: 10px;
  color: var(--foreground-dim);
}

.sector-bars {
  display: grid;
  gap: 6px;
}

.sector-row {
  display: grid;
  grid-template-columns: 88px 1fr 64px;
  gap: 8px;
  align-items: center;
}

.bar {
  height: 8px;
  border-radius: 99px;
  background: var(--bg-tertiary);
  overflow: hidden;
}

.bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
}

h2 {
  font-family: var(--sans);
  font-size: 20px;
  margin: 0 0 10px;
  letter-spacing: -0.02em;
}

h3 {
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--neon-cyan);
  margin: 0 0 8px;
}

.stack {
  gap: 14px;
}

.formula {
  overflow-x: auto;
  padding: 10px 12px;
  border-radius: 8px;
  background: #041018;
  color: #b7f6ff;
  font-size: 12px;
}

html[data-theme="light"] .formula {
  background: #e8f3fb;
  color: #0b3a4a;
}

@keyframes holographicShimmer {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -200% 0;
  }
}

@keyframes fade {
  from {
    opacity: 0.4;
  }
  to {
    opacity: 1;
  }
}

@media (max-width: 980px) {
  .pillars,
  .g3,
  .g5,
  .health {
    grid-template-columns: 1fr 1fr;
  }

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

@media (max-width: 640px) {
  .ticker,
  .tabs {
    position: static;
  }

  .wrap {
    padding: 0 12px 36px;
  }

  .pillars,
  .g3,
  .g5,
  .health {
    grid-template-columns: 1fr;
  }

  .ticker-meta {
    width: 100%;
    justify-content: space-between;
  }

  h1 {
    font-size: 28px;
  }

  .verdict {
    font-size: 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .ticker::before,
  .panel,
  html[data-reduced="1"] .ticker::before {
    animation: none;
  }
}

@media print {
  body::before,
  body::after,
  .ticker::before,
  .lang-switch,
  .icon-btn,
  .skip-link {
    display: none !important;
  }

  body,
  .card,
  .metric {
    background: white;
    color: black;
    box-shadow: none;
  }

  html.no-js .panel,
  .panel {
    display: grid !important;
    break-inside: avoid;
  }
}
