/* ============== Layout shell ============== */
main {
  width: 100%;
  max-width: var(--content-wide);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-6);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  background: color-mix(in oklab, var(--color-bg) 75%, transparent);
  border-bottom: 1px solid var(--color-divider);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--color-text);
  text-decoration: none;
}
.brand svg {
  color: var(--accent-cyan);
}
.brand-meta {
  color: var(--color-text-muted);
}
.topbar-meta {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}
@media (max-width: 720px) {
  .topbar-meta .topbar-pill,
  .topbar-meta .link-quiet {
    display: none;
  }
}
@media (max-width: 420px) {
  .vvn-chip-label {
    display: none;
  }
}

/* === Viral Video Ninja co-brand === */
.vvn-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px 10px 6px 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: color-mix(in oklab, var(--color-surface) 75%, transparent);
  color: var(--color-text);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.02em;
  transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
}
.vvn-chip:hover {
  border-color: color-mix(in oklab, var(--accent-cyan) 60%, var(--color-border));
  background: color-mix(in oklab, var(--color-surface) 85%, transparent);
  transform: translateY(-1px);
}
.vvn-chip .vvn-mark {
  flex: 0 0 auto;
  filter: drop-shadow(0 0 6px color-mix(in oklab, var(--accent-magenta) 35%, transparent));
}
.vvn-chip-label {
  white-space: nowrap;
}
.vvn-chip-accent {
  background: linear-gradient(135deg, var(--accent-magenta), var(--accent-cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 600;
}

.vvn-footer {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--color-text);
  padding: 10px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: color-mix(in oklab, var(--color-surface) 60%, transparent);
  margin-bottom: var(--space-3);
  transition: border-color 160ms ease, transform 160ms ease;
}
.vvn-footer:hover {
  border-color: color-mix(in oklab, var(--accent-cyan) 50%, var(--color-border));
  transform: translateY(-1px);
}
.vvn-footer svg {
  filter: drop-shadow(0 0 8px color-mix(in oklab, var(--accent-magenta) 40%, transparent));
}
.vvn-footer-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.15;
}
.vvn-footer-name {
  font-family: var(--font-display, var(--font-serif, serif));
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.vvn-footer-name em {
  font-style: italic;
  background: linear-gradient(135deg, var(--accent-magenta), var(--accent-cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.vvn-footer-domain {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-top: 2px;
}
.footer-credit {
  display: block;
  margin-top: 4px;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  color: var(--color-text-muted);
  background: color-mix(in oklab, var(--color-surface) 70%, transparent);
}
.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.6);
  animation: pulse 1.8s ease-out infinite;
}
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.55);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(74, 222, 128, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(74, 222, 128, 0);
  }
}
.link-quiet {
  text-decoration: none;
  color: var(--color-text-muted);
}
.link-quiet:hover {
  color: var(--accent-cyan);
}

/* ============== HERO ============== */
.hero {
  position: relative;
  padding: var(--space-16) 0 var(--space-12);
  overflow: hidden;
}
.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 880px;
  margin: 0 auto;
  text-align: center;
}
.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  background: var(--color-surface);
  margin-bottom: var(--space-6);
}
.hero-tag .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: var(--glow-cyan);
}
.hero-h1 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 400;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-5);
}
.hero-h1 em {
  font-style: italic;
  color: var(--accent-cyan);
}
.hero-sub {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  max-width: 640px;
  margin: 0 auto var(--space-10);
}
.hero-brain {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 1;
  opacity: 0.65;
}
.hero-brain svg {
  width: 110%;
  height: 110%;
  filter: blur(20px);
}

/* upload */
.upload-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  text-align: left;
  overflow: hidden;
  max-width: 720px;
  margin: 0 auto;
}
.upload-tabs {
  display: flex;
  border-bottom: 1px solid var(--color-divider);
  background: var(--color-surface-2);
}
.tab {
  flex: 1;
  padding: var(--space-4) var(--space-5);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  border-bottom: 2px solid transparent;
}
.tab:hover {
  color: var(--color-text);
}
.tab.active {
  color: var(--color-text);
  border-bottom-color: var(--accent-cyan);
  background: var(--color-surface);
}
.upload-body {
  padding: var(--space-6);
}
.url-row {
  display: flex;
  gap: var(--space-3);
  align-items: stretch;
}
#urlInput {
  flex: 1;
  padding: var(--space-4) var(--space-5);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-text);
  outline: none;
}
#urlInput::placeholder {
  color: var(--color-text-faint);
}
#urlInput:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.15);
}
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-5);
  background: linear-gradient(135deg, var(--accent-cyan) 0%, #5af0ff 100%);
  color: #021018;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: var(--text-sm);
  letter-spacing: 0.01em;
  box-shadow: var(--glow-cyan);
}
.btn-primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}
.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  font-size: var(--text-sm);
  background: var(--color-surface-2);
}
.btn-ghost:hover {
  border-color: var(--color-border-strong);
  color: var(--accent-cyan);
}
.upload-help {
  margin-top: var(--space-3);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-10);
  border: 1.5px dashed var(--color-border-strong);
  border-radius: var(--radius-lg);
  background: var(--color-surface-2);
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition-interactive), background var(--transition-interactive);
}
.dropzone svg {
  color: var(--accent-cyan);
}
.dropzone strong {
  font-size: var(--text-sm);
  font-weight: 600;
}
.dropzone:hover,
.dropzone.is-drag {
  border-color: var(--accent-cyan);
  background: color-mix(in oklab, var(--accent-cyan) 6%, var(--color-surface-2));
}
.sample-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}
@media (max-width: 540px) {
  .sample-grid {
    grid-template-columns: 1fr;
  }
}
.sample-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 4px;
  padding: var(--space-4);
  border: 1px solid var(--color-border);
  background: var(--color-surface-2);
  border-radius: var(--radius-md);
  color: var(--color-text);
  transition: all var(--transition-interactive);
}
.sample-btn strong {
  font-size: var(--text-sm);
}
.sample-btn span {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-family: var(--font-mono);
}
.sample-btn:hover {
  border-color: var(--accent-cyan);
  transform: translateY(-2px);
  box-shadow: var(--glow-cyan);
}

.hero-trust {
  display: flex;
  gap: var(--space-8);
  justify-content: center;
  margin-top: var(--space-12);
  flex-wrap: wrap;
}
.trust {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.trust-num {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--accent-cyan);
}
.trust-lbl {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

/* ============== ANALYZING ============== */
.analyzing {
  padding: var(--space-12) 0;
  display: flex;
  justify-content: center;
}
.analyzing-card {
  width: 100%;
  max-width: 920px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-10);
  box-shadow: var(--shadow-lg);
}
.analyzing-header {
  margin-bottom: var(--space-8);
}
.encoder-stack {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  justify-content: center;
}
.enc-pillar {
  flex: 1 1 110px;
  min-width: 100px;
  padding: var(--space-3);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  text-align: center;
}
.enc-fuse {
  border-color: var(--accent-cyan);
}
.enc-out {
  border-color: var(--accent-magenta);
}
.enc-label {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  letter-spacing: 0.05em;
  margin-bottom: var(--space-2);
}
.enc-bar {
  height: 4px;
  background: var(--color-surface-3);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: var(--space-2);
}
.enc-fill {
  height: 100%;
  width: 0%;
  background: var(--accent-cyan);
  border-radius: inherit;
  transition: width 200ms ease;
}
.enc-out .enc-fill {
  background: var(--accent-magenta);
}
.enc-fuse .enc-fill {
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-magenta));
}
.enc-meta {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--color-text-faint);
}
.enc-arrow {
  font-family: var(--font-mono);
  color: var(--color-text-faint);
}
.analyzing-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 400;
  margin-bottom: var(--space-2);
}
.analyzing-step {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--accent-cyan);
  margin-bottom: var(--space-5);
}
.progress-track {
  height: 3px;
  background: var(--color-surface-3);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: var(--space-5);
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-magenta));
  border-radius: inherit;
  transition: width 240ms cubic-bezier(0.16, 1, 0.3, 1);
}
.analyzing-log {
  list-style: none;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 160px;
  overflow: hidden;
}
.analyzing-log li {
  display: flex;
  gap: var(--space-3);
  opacity: 0;
  animation: logIn 320ms ease-out forwards;
}
.analyzing-log li::before {
  content: '›';
  color: var(--accent-cyan);
}
.analyzing-log li.ok::before {
  content: '✓';
  color: var(--accent-green);
}
@keyframes logIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============== RESULTS ============== */
.results {
  padding: var(--space-10) 0 var(--space-20);
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}
.results-top {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: var(--space-6);
}
@media (max-width: 880px) {
  .results-top {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  box-shadow: var(--shadow-md);
}
.card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
}
.card-head h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--text-lg);
  margin-bottom: var(--space-1);
}
.card-head .muted {
  font-size: var(--text-sm);
  max-width: 56ch;
}

/* SCORE CARD */
.score-card {
  background: linear-gradient(180deg, var(--color-surface) 0%, var(--color-surface-2) 100%);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.score-card::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: radial-gradient(
    400px 200px at 50% 0%,
    color-mix(in oklab, var(--accent-cyan) 22%, transparent),
    transparent 60%
  );
  pointer-events: none;
}
.score-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
  position: relative;
}
.dot-cyan {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: var(--glow-cyan);
}
.score-ring {
  position: relative;
  width: 220px;
  height: 220px;
  margin: 0 auto var(--space-4);
}
.score-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.ring-bg {
  stroke: var(--color-divider);
}
.ring-fg {
  stroke: url(#ringGradient);
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  transition: stroke-dashoffset 1200ms cubic-bezier(0.16, 1, 0.3, 1);
  filter: drop-shadow(0 0 12px rgba(0, 229, 255, 0.5));
}
.score-num {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 3.6rem;
  line-height: 1;
}
.score-num small {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-top: var(--space-2);
}
.score-label {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-lg);
  color: var(--accent-cyan);
  margin-bottom: var(--space-2);
}
.score-sub {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  max-width: 38ch;
  margin: 0 auto var(--space-6);
}
.score-pillars {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  text-align: left;
}
.pillar-key {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.pillar-bar {
  height: 6px;
  background: var(--color-surface-3);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 4px;
  position: relative;
}
.pillar-fill {
  height: 100%;
  width: 0%;
  background: var(--accent-cyan);
  border-radius: inherit;
  transition: width 900ms cubic-bezier(0.16, 1, 0.3, 1);
}
.pillar-bar-inv .pillar-fill {
  background: var(--accent-magenta);
}
.pillar[data-pillar='value'] .pillar-fill {
  background: var(--accent-amber);
}
.pillar[data-pillar='attention'] .pillar-fill {
  background: var(--accent-violet);
}
.pillar-val {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text);
}

/* PREVIEW CARD */
.preview-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.preview-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background:
    radial-gradient(circle at 30% 20%, rgba(0, 229, 255, 0.18), transparent 40%),
    radial-gradient(circle at 70% 80%, rgba(255, 61, 138, 0.18), transparent 40%),
    repeating-linear-gradient(
      45deg,
      rgba(255, 255, 255, 0.012) 0,
      rgba(255, 255, 255, 0.012) 1px,
      transparent 1px,
      transparent 8px
    ),
    #050a12;
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.preview-frame.is-empty::after {
  content: 'reference archetype';
  position: absolute;
  inset: auto 0 var(--space-4) 0;
  text-align: center;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-faint);
}
.preview-frame video,
.preview-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.preview-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    400px 200px at var(--gx, 50%) var(--gy, 50%),
    rgba(255, 61, 138, 0.25) 0%,
    rgba(255, 61, 138, 0) 60%
  );
  mix-blend-mode: screen;
  opacity: 0;
  transition: opacity 600ms ease;
}
.preview-card.active .preview-overlay {
  opacity: 1;
}
.preview-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.preview-meta strong {
  font-size: var(--text-base);
}
.preview-meta .muted {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}

/* BRAIN CARD */
.brain-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(220px, 1fr);
  gap: var(--space-6);
  align-items: start;
}
@media (max-width: 880px) {
  .brain-grid {
    grid-template-columns: 1fr;
  }
}
.brain-stage {
  background: radial-gradient(circle at 50% 60%, #0a131e 0%, #04080d 70%);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  padding: var(--space-3);
  position: relative;
  aspect-ratio: 1.4 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
[data-theme='light'] .brain-stage {
  background: radial-gradient(circle at 50% 60%, #f1f4fa 0%, #e3e8f1 70%);
}
.brain-stage svg {
  width: 100%;
  height: 100%;
}
.view-toggle {
  display: inline-flex;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  padding: 3px;
  gap: 2px;
}
.view-btn {
  padding: 6px var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  border-radius: var(--radius-full);
}
.view-btn.active {
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: var(--shadow-sm);
}
.brain-legend {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.legend-bar {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
}
.legend-grad {
  height: 8px;
  border-radius: var(--radius-full);
  background: linear-gradient(
    90deg,
    #1a3047 0%,
    #0066b8 18%,
    #00c2cf 38%,
    #ffcf2b 60%,
    #ff6a3a 80%,
    #ff2b6a 100%
  );
  margin-bottom: 6px;
}
.legend-ticks {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--color-text-muted);
  letter-spacing: 0.03em;
}
.region-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  font-size: var(--text-sm);
  max-height: 320px;
  overflow-y: auto;
  padding-right: var(--space-2);
}
.region-list::-webkit-scrollbar {
  width: 6px;
}
.region-list::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 3px;
}
.region-row {
  display: grid;
  grid-template-columns: 14px 1fr auto;
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  cursor: default;
}
.region-row:hover {
  background: var(--color-surface-2);
}
.region-row.is-active {
  background: color-mix(in oklab, var(--accent-cyan) 10%, transparent);
}
.region-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: var(--accent-cyan);
}
.region-name {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.02em;
}
.region-name strong {
  display: block;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text);
  letter-spacing: 0;
}
.region-val {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-align: right;
}

/* TIMELINE */
.timeline-stage {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  overflow-x: auto;
}
.timeline-stage canvas {
  width: 100%;
  height: 220px;
  display: block;
}
.timeline-legend {
  display: flex;
  gap: var(--space-5);
  margin-top: var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  flex-wrap: wrap;
}
.timeline-legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 6px;
  vertical-align: -1px;
}
.timeline-callouts {
  margin-top: var(--space-5);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-3);
}
.callout {
  border: 1px solid var(--color-border);
  background: var(--color-surface-2);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
}
.callout-time {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--accent-cyan);
  letter-spacing: 0.03em;
  margin-bottom: 2px;
}

/* BENCHMARK */
.benchmark-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.bench-row {
  display: grid;
  grid-template-columns: 200px 1fr 60px;
  gap: var(--space-4);
  align-items: center;
}
@media (max-width: 640px) {
  .bench-row {
    grid-template-columns: 1fr 50px;
  }
  .bench-row .bench-label {
    grid-column: 1 / -1;
  }
}
.bench-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  letter-spacing: 0.02em;
}
.bench-label strong {
  display: block;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--color-text);
  font-weight: 500;
  letter-spacing: 0;
}
.bench-bar {
  height: 26px;
  background: var(--color-surface-2);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
  border: 1px solid var(--color-border);
}
.bench-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-cyan-deep), var(--accent-cyan));
  border-radius: inherit;
  transition: width 1100ms cubic-bezier(0.16, 1, 0.3, 1);
}
.bench-row.is-you .bench-fill {
  background: linear-gradient(90deg, var(--accent-magenta-deep), var(--accent-magenta));
  box-shadow: var(--glow-magenta);
}
.bench-marker {
  position: absolute;
  top: -3px;
  bottom: -3px;
  width: 2px;
  background: var(--accent-magenta);
}
.bench-val {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-text);
  text-align: right;
}
.bench-row.is-you {
  padding: var(--space-2);
  background: color-mix(in oklab, var(--accent-magenta) 6%, transparent);
  border-radius: var(--radius-md);
  margin: 0 calc(-1 * var(--space-2));
}

/* INSIGHTS */
.insights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-4);
}
.insight {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--accent-cyan);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.insight.is-warn {
  border-left-color: var(--accent-magenta);
}
.insight.is-good {
  border-left-color: var(--accent-green);
}
.insight-tag {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.insight strong {
  font-size: var(--text-base);
  font-weight: 600;
}
.insight p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* METHOD */
.method-body p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
  max-width: 80ch;
}
.method-body a {
  color: var(--accent-cyan);
  text-decoration: none;
  border-bottom: 1px dotted var(--accent-cyan);
}
.method-body a:hover {
  border-bottom-style: solid;
}

/* TOOLTIP */
.tooltip {
  position: fixed;
  z-index: 80;
  background: var(--color-surface-3);
  color: var(--color-text);
  border: 1px solid var(--color-border-strong);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: var(--text-sm);
  max-width: 280px;
  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}
.tooltip.show {
  opacity: 1;
  transform: translateY(0);
}
.tooltip strong {
  display: block;
  font-size: var(--text-sm);
  margin-bottom: 2px;
}
.tooltip .muted {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}

/* BRAIN SVG REGION STATES */
.region-shape {
  cursor: pointer;
  transition: filter 160ms ease, opacity 160ms ease;
}
.region-shape:hover,
.region-shape.is-hover {
  filter: brightness(1.4);
}
.brain-outline {
  fill: none;
  stroke: var(--color-border-strong);
  stroke-width: 1.6;
  stroke-linejoin: round;
  opacity: 0.55;
}
.brain-shadow {
  fill: var(--color-surface);
  opacity: 0.4;
}

/* footer */
.footer {
  border-top: 1px solid var(--color-divider);
  padding: var(--space-6);
  margin-top: var(--space-12);
}
.footer-inner {
  max-width: var(--content-wide);
  margin: 0 auto;
  text-align: center;
  font-size: var(--text-xs);
}
.footer-sep {
  margin: 0 var(--space-2);
  color: var(--color-text-faint);
}

/* === TLDR / Score interpreter === */
.tldr-card {
  margin-bottom: var(--space-6);
  padding: var(--space-6);
  background:
    linear-gradient(
      135deg,
      color-mix(in oklab, var(--accent-cyan) 7%, transparent) 0%,
      color-mix(in oklab, var(--accent-magenta) 5%, transparent) 100%
    ),
    var(--color-surface);
  border: 1px solid color-mix(in oklab, var(--accent-cyan) 25%, var(--color-border));
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
}
.tldr-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at 0% 0%,
    color-mix(in oklab, var(--accent-cyan) 14%, transparent),
    transparent 50%
  );
  pointer-events: none;
}
.tldr-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
  position: relative;
}
.tldr-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.tldr-band {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  background: color-mix(in oklab, var(--color-surface) 60%, transparent);
}
.tldr-band-hot {
  color: var(--accent-cyan);
  border-color: color-mix(in oklab, var(--accent-cyan) 50%, transparent);
  background: color-mix(in oklab, var(--accent-cyan) 12%, transparent);
}
.tldr-band-warm {
  color: var(--accent-amber, #ffc857);
  border-color: color-mix(in oklab, var(--accent-amber, #ffc857) 50%, transparent);
  background: color-mix(in oklab, var(--accent-amber, #ffc857) 12%, transparent);
}
.tldr-band-mid {
  color: var(--color-text);
  border-color: var(--color-border);
}
.tldr-band-cold {
  color: var(--accent-magenta);
  border-color: color-mix(in oklab, var(--accent-magenta) 50%, transparent);
  background: color-mix(in oklab, var(--accent-magenta) 12%, transparent);
}
.tldr-headline {
  font-family: var(--font-display);
  font-size: clamp(20px, 2.4vw, 28px);
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 0 0 var(--space-5) 0;
  color: var(--color-text);
  position: relative;
}
.tldr-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
  padding: var(--space-4) 0;
  border-top: 1px solid color-mix(in oklab, var(--color-divider) 80%, transparent);
  border-bottom: 1px solid color-mix(in oklab, var(--color-divider) 80%, transparent);
  position: relative;
}
.tldr-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.tldr-stat-key {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-faint);
}
.tldr-stat-val {
  font-family: var(--font-display);
  font-size: 30px;
  line-height: 1;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--color-text);
}
.tldr-stat-val-sm {
  font-size: 15px;
  font-family: var(--font-body, var(--font-sans));
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.3;
  word-break: break-word;
  overflow-wrap: anywhere;
  hyphens: auto;
}
.tldr-stat-sub {
  font-size: 11px;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tldr-explain {
  margin: var(--space-4) 0 0 0;
  font-size: var(--text-sm, 14px);
  line-height: 1.55;
  color: var(--color-text-muted);
  position: relative;
}
@media (max-width: 720px) {
  .tldr-row {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
  }
  .tldr-stat-val {
    font-size: 24px;
  }
  .tldr-stat-val-sm {
    font-size: 14px;
  }
}

/* === Tips & Recommendations === */
.tips-card .card-head {
  align-items: flex-start;
}
.tips-summary {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  padding: 8px 14px;
  border: 1px solid color-mix(in oklab, var(--accent-cyan) 30%, var(--color-border));
  border-radius: var(--radius-md);
  background: color-mix(in oklab, var(--accent-cyan) 8%, transparent);
}
.tips-summary-key {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.tips-summary-val {
  font-family: var(--font-display);
  font-size: 26px;
  line-height: 1;
  color: var(--accent-cyan);
}
.tips-summary-sub {
  font-size: 10px;
  color: var(--color-text-muted);
}

.tips-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.tip {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-4);
  background: color-mix(in oklab, var(--color-surface-2) 60%, transparent);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: border-color 160ms ease, transform 160ms ease;
}
.tip:hover {
  border-color: color-mix(in oklab, var(--accent-cyan) 40%, var(--color-border));
}
.tip[data-pri="1"] {
  border-left: 3px solid var(--accent-cyan);
}
.tip[data-pri="2"] {
  border-left: 3px solid color-mix(in oklab, var(--accent-cyan) 60%, var(--accent-amber, #ffc857));
}
.tip[data-pri="3"] {
  border-left: 3px solid var(--accent-amber, #ffc857);
}
.tip[data-pri="4"], .tip[data-pri="5"] {
  border-left: 3px solid var(--color-border);
}
.tip-num {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: color-mix(in oklab, var(--accent-cyan) 15%, transparent);
  border: 1px solid color-mix(in oklab, var(--accent-cyan) 40%, var(--color-border));
  color: var(--accent-cyan);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tip-body {
  flex: 1 1 auto;
  min-width: 0;
}
.tip-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: 4px;
}
.tip-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  padding: 3px 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
}
.tip-lift {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-cyan);
  background: color-mix(in oklab, var(--accent-cyan) 10%, transparent);
  border: 1px solid color-mix(in oklab, var(--accent-cyan) 35%, transparent);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}
.tip-lift small {
  font-size: 9px;
  font-weight: 500;
  margin-left: 2px;
  opacity: 0.7;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.tip-lift-zero {
  color: var(--color-text-muted);
  background: transparent;
  border-color: var(--color-border);
}
.tip-title {
  display: block;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--color-text);
  margin: 2px 0;
}
.tip-text {
  margin: 4px 0 0 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--color-text-muted);
}
.tips-foot {
  margin-top: var(--space-4);
  color: var(--color-text-faint);
}
@media (max-width: 540px) {
  .tip { padding: var(--space-3); }
  .tip-num { width: 24px; height: 24px; font-size: 12px; }
  .tips-summary { align-self: flex-start; }
}
