:root {
  --bg: #0a0a0f;
  --bg2: #111118;
  --bg3: #1a1a26;
  --border: #2a2a3a;
  --accent: #5b6af0;
  --accent2: #8b5cf6;
  --clean: #34d399;
  --raw: #f59e0b;
  --attractor: #f87171;
  --text: #e2e8f0;
  --text2: #94a3b8;
  --text3: #64748b;
  --radius: 8px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Layout ───────────────────────────────────────────────────────── */
.app {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
}

header {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 24px;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo { font-size: 18px; font-weight: 700; letter-spacing: -0.5px; }
.logo span { color: var(--accent); }

.status-pill {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 20px;
  border: 1px solid var(--border);
  color: var(--text2);
  white-space: nowrap;
}
.status-pill.ok { border-color: var(--clean); color: var(--clean); }

nav { margin-left: auto; display: flex; gap: 8px; align-items: center; }
nav a {
  color: var(--text2);
  text-decoration: none;
  font-size: 13px;
  padding: 4px 10px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}
nav a:hover { color: var(--text); background: var(--bg3); }

.patreon-btn {
  background: #ff424d;
  color: white !important;
  padding: 4px 12px !important;
  font-weight: 600;
}
.patreon-btn:hover { opacity: 0.9; background: #ff424d !important; }

main {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 0;
  max-height: calc(100vh - 56px - 36px);
}

/* ── Sidebar ──────────────────────────────────────────────────────── */
aside {
  background: var(--bg2);
  border-right: 1px solid var(--border);
  padding: 20px 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 8px;
}

.query-input-wrap { position: relative; }
.query-input-wrap input {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 9px 36px 9px 12px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
}
.query-input-wrap input:focus { border-color: var(--accent); }
.query-input-wrap button {
  position: absolute;
  right: 6px; top: 50%;
  transform: translateY(-50%);
  background: var(--accent);
  border: none;
  border-radius: 5px;
  color: white;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 12px;
}

.toggle-row {
  display: flex;
  gap: 4px;
  background: var(--bg3);
  border-radius: var(--radius);
  padding: 3px;
}
.toggle-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text2);
  padding: 6px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.15s;
}
.toggle-btn.active {
  background: var(--accent);
  color: white;
}
.toggle-btn.raw.active { background: var(--raw); }

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text2);
}
.checkbox-row input { accent-color: var(--accent); cursor: pointer; }

.slider-row { display: flex; flex-direction: column; gap: 4px; }
.slider-row label { font-size: 12px; color: var(--text2); display: flex; justify-content: space-between; }
.slider-row input[type=range] { width: 100%; accent-color: var(--accent); }

.btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: var(--radius);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text);
  width: 100%;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: white; }
.btn.primary:hover { opacity: 0.9; }

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.stat-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
}
.stat-card .val {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}
.stat-card .lbl {
  font-size: 10px;
  color: var(--text3);
  margin-top: 3px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.attractor-list { display: flex; flex-wrap: wrap; gap: 4px; }
.attractor-tag {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.3);
  color: var(--attractor);
}

/* ── Graph canvas ─────────────────────────────────────────────────── */
.graph-pane {
  position: relative;
  overflow: hidden;
  background: var(--bg);
}

#graph-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.graph-overlay {
  position: absolute;
  top: 12px; right: 12px;
  display: flex; gap: 6px;
  flex-direction: column;
  align-items: flex-end;
}

.graph-badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.graph-badge.filtered { background: rgba(91,106,240,0.15); color: var(--accent); border: 1px solid rgba(91,106,240,0.3); }
.graph-badge.raw { background: rgba(245,158,11,0.15); color: var(--raw); border: 1px solid rgba(245,158,11,0.3); }

.empty-state {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: var(--text3);
  pointer-events: none;
}
.empty-state p { font-size: 14px; }

/* ── Brain canvas (idle neural animation) ─────────────────────────── */
#brain-canvas {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  display: block;
}

/* D3 nodes & links */
.link { stroke: var(--border); stroke-width: 1; }
.link.clean { stroke: rgba(91,106,240,0.5); }
.link.raw-only { stroke: rgba(245,158,11,0.35); stroke-dasharray: 3 3; }

/* Anchor pulse ring */
.anchor-ring {
  animation: anchor-pulse 2.8s ease-in-out infinite;
  pointer-events: none;
}
@keyframes anchor-pulse {
  0%, 100% { opacity: 0.35; }
  50%       { opacity: 0.85; }
}

.node circle {
  stroke-width: 1.5;
  cursor: pointer;
  transition: r 0.1s;
}
.node circle.anchor { stroke-width: 3; }
.node circle.attractor { stroke: var(--attractor); }
.node text {
  fill: var(--text2);
  font-size: 10px;
  pointer-events: none;
  text-anchor: middle;
  dominant-baseline: central;
}

.tooltip {
  position: absolute;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 12px;
  pointer-events: none;
  max-width: 220px;
  z-index: 200;
  display: none;
}
.tooltip .t-name { font-weight: 700; color: var(--text); margin-bottom: 6px; }
.tooltip .t-row { display: flex; justify-content: space-between; gap: 12px; color: var(--text2); margin: 2px 0; }
.tooltip .t-badge {
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 3px;
  margin-top: 5px;
  display: inline-block;
}
.tooltip .t-badge.attractor { background: rgba(248,113,113,0.15); color: var(--attractor); }
.tooltip .t-badge.anchor { background: rgba(91,106,240,0.15); color: var(--accent); }

/* ── Copy/Export panel ────────────────────────────────────────────── */
.copy-panel {
  position: absolute;
  bottom: 12px; left: 12px;
  display: flex; gap: 6px;
}

/* ── Node detail panel ────────────────────────────────────────────── */
.detail-panel {
  position: absolute;
  bottom: 12px; right: 12px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  min-width: 200px;
  max-width: 280px;
  display: none;
}
.detail-panel .d-name { font-weight: 700; font-size: 14px; margin-bottom: 8px; }
.detail-panel .d-row { font-size: 12px; color: var(--text2); display: flex; justify-content: space-between; margin: 3px 0; }
.detail-panel .d-close {
  position: absolute; top: 8px; right: 10px;
  background: none; border: none; color: var(--text3); cursor: pointer; font-size: 16px;
}

/* ── Disclaimer ───────────────────────────────────────────────────── */
.disclaimer {
  background: rgba(245,158,11,0.07);
  border: 1px solid rgba(245,158,11,0.2);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 11px;
  color: var(--text2);
  line-height: 1.5;
}
.disclaimer strong { color: var(--raw); }

/* ── Footer ───────────────────────────────────────────────────────── */
footer {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  height: 36px;
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  font-size: 11px;
  color: var(--text3);
  overflow: hidden;
}
footer a { color: var(--text3); text-decoration: none; }
footer a:hover { color: var(--text2); }

.footer-sep { flex: 1; }
.footer-meta {
  font-size: 10px;
  color: var(--text3);
  white-space: nowrap;
  opacity: 0.7;
}
.footer-clock {
  padding-left: 12px;
  border-left: 1px solid var(--border);
}

/* ── Modal (Contact / Copy) ───────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 500;
  align-items: center;
  justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  max-width: 520px;
  width: 90vw;
  position: relative;
}
.modal h2 { font-size: 16px; margin-bottom: 16px; }
.modal-close {
  position: absolute; top: 12px; right: 16px;
  background: none; border: none; color: var(--text3); font-size: 20px; cursor: pointer;
}
.modal input, .modal textarea {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 9px 12px;
  font-size: 13px;
  outline: none;
  margin-bottom: 10px;
  font-family: inherit;
  transition: border-color 0.15s;
}
.modal input:focus, .modal textarea:focus { border-color: var(--accent); }
.modal textarea { resize: vertical; min-height: 90px; }
.modal .copy-box {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  font-size: 12px;
  font-family: monospace;
  white-space: pre-wrap;
  max-height: 240px;
  overflow-y: auto;
  color: var(--text2);
  margin-bottom: 12px;
}
.modal .msg { font-size: 12px; color: var(--clean); margin-top: 6px; min-height: 18px; }

/* ── Scrollbar ────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ── Loading ──────────────────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Traversal panel ──────────────────────────────────────────────── */
.traversal-panel {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: 16px 24px;
}
.traversal-inner {
  display: grid;
  grid-template-columns: 1fr 1fr 2fr;
  gap: 24px;
  max-width: 1400px;
}
.traversal-col { display: flex; flex-direction: column; gap: 6px; }
.tp-list { display: flex; flex-direction: column; gap: 3px; max-height: 200px; overflow-y: auto; }
.tp-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 11px;
  color: var(--text2);
  padding: 2px 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  gap: 8px;
}
.tp-item span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-score { color: var(--text3); flex-shrink: 0; font-variant-numeric: tabular-nums; }
.tp-anchor { color: var(--accent); font-weight: 600; }
.tp-att span:first-child { color: var(--attractor); }
.tp-raw span:first-child { color: var(--raw); }

/* ── Sidebar query summary ────────────────────────────────────────── */
.query-summary {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.qs-counts {
  font-size: 11px;
  color: var(--text3);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.qs-counts strong { color: var(--text2); }

.qs-block { display: flex; flex-direction: column; gap: 4px; }

.qs-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text3);
}

.qs-list { display: flex; flex-direction: column; gap: 2px; }

.qs-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 10px;
  color: var(--text2);
  gap: 6px;
  padding: 1px 0;
}
.qs-item .qs-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.qs-item .qs-val {
  color: var(--text3);
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  font-size: 9px;
}
.qs-anchor { color: var(--accent); }
.qs-att .qs-name { color: var(--attractor); }

/* ── Scroll hint ──────────────────────────────────────────────────── */
.scroll-hint {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(91, 106, 240, 0.12);
  border: 1px solid rgba(91, 106, 240, 0.25);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  padding: 5px 14px;
  font-size: 10px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.5px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.scroll-hint.visible { opacity: 1; }
.scroll-hint.fading  { opacity: 0; transition: opacity 0.8s ease; }

@media (max-width: 768px) {
  main { grid-template-columns: 1fr; }
  aside { max-height: 280px; }
  .traversal-inner { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════════════
   Homepage — .home-page
   ═══════════════════════════════════════════════════════════════════ */
.home-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg);
}

/* ── Homepage header ──────────────────────────────────────────────── */
.home-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  height: 56px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.home-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}
.home-nav a {
  color: var(--text2);
  text-decoration: none;
  font-size: 13px;
  padding: 5px 12px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
  display: flex;
  align-items: center;
}
.home-nav a:hover { color: var(--text); background: var(--bg3); }
.home-nav .yt-link {
  color: var(--text3);
  font-size: 12px;
  border: 1px solid var(--border);
}
.home-nav .yt-link:hover {
  color: var(--text2);
  border-color: var(--text3);
  background: var(--bg3);
}

/* ── Homepage main ────────────────────────────────────────────────── */
.home-main {
  display: flex;
  flex-direction: column;
  padding-bottom: 60px;
}

/* ── Hero parallax section ────────────────────────────────────────── */
.home-hero {
  position: relative;
  width: 100%;
  height: 46vh;
  min-height: 240px;
  max-height: 380px;
  overflow: hidden;
}
.home-hero-bg {
  position: absolute;
  inset: -40% 0 -40% 0;
  background-image: url('/img/hero_generated.png');
  background-size: cover;
  background-position: center center;
  will-change: transform;
}
.home-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(10,10,15,0.72) 0%,
    rgba(10,10,15,0.58) 40%,
    rgba(10,10,15,0.80) 80%,
    var(--bg) 100%
  );
}
.home-greet-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.home-greet {
  font-size: clamp(22px, 4vw, 38px);
  font-weight: 300;
  letter-spacing: 0.04em;
  color: rgba(255,255,255,0.82);
  text-shadow: 0 2px 24px rgba(0,0,0,0.7);
  transition: opacity 0.5s ease;
  user-select: none;
}
.greet-fade-out { opacity: 0 !important; }
.greet-fade-in  { animation: greet-pop 0.5s ease; }
@keyframes greet-pop {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Arrive intro line ────────────────────────────────────────────── */
.home-arrive {
  font-size: 11px;
  color: var(--text3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 20px;
  opacity: 0.7;
}

/* ── Intro section ────────────────────────────────────────────────── */
.home-intro {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 40px 64px;
  animation: home-fade-in 0.8s ease forwards;
}

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

.home-name {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text);
  margin-bottom: 6px;
}

.home-tagline {
  font-size: 13px;
  color: var(--text3);
  letter-spacing: 0.3px;
  margin-bottom: 36px;
}

.home-text {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 48px;
  color: var(--text2);
  font-size: 15px;
  line-height: 1.8;
}
.home-text p { margin: 0; }
.home-text p:first-child {
  font-size: 16px;
  color: var(--text);
  font-style: italic;
}

/* ── Section cards ────────────────────────────────────────────────── */
.home-sections {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.home-section-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg2);
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}
.home-section-card:hover {
  border-color: var(--accent);
  background: var(--bg3);
  transform: translateX(2px);
}

.active-card { border-color: rgba(91, 106, 240, 0.3); }
.active-card:hover { border-color: var(--accent); }

.muted-card { opacity: 0.45; }
.muted-card:hover { opacity: 0.65; border-color: var(--border); }

.hsc-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(91, 106, 240, 0.08);
  border: 1px solid rgba(91, 106, 240, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.hsc-icon-muted {
  background: var(--bg3);
  border-color: var(--border);
  color: var(--text3);
  font-size: 14px;
}

.hsc-content { flex: 1; min-width: 0; }
.hsc-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}
.hsc-desc {
  font-size: 11px;
  color: var(--text3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hsc-arrow { color: var(--accent); font-size: 16px; flex-shrink: 0; }
.muted-arrow { color: var(--text3); }

/* ── Homepage footer ──────────────────────────────────────────────── */
.home-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 40px;
  height: 44px;
  background: var(--bg2);
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text3);
}
.home-footer a {
  color: var(--text3);
  text-decoration: none;
  transition: color 0.15s;
}
.home-footer a:hover { color: var(--text2); }

/* ── Dali clock ───────────────────────────────────────────────────── */
.footer-clock-wrap {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.dali-clock {
  display: block;
  overflow: visible;
}
.clock-hand {
  animation: hand-glow 4s ease-in-out infinite;
}
#clock-minute-cw  { animation-delay: -1s; }
#clock-hour-ccw   { animation-delay: -2s; }
#clock-minute-ccw { animation-delay: -3s; }
@keyframes hand-glow {
  0%,100% { opacity: 1; }
  50%     { opacity: 0.55; filter: drop-shadow(0 0 3px rgba(91,106,240,0.8)); }
}

/* ── Homepage responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .home-header { padding: 0 16px; height: 48px; }
  .home-nav a { padding: 4px 8px; font-size: 12px; }
  .logo { font-size: 15px; }

  .home-hero { height: 32vh; min-height: 180px; }
  .home-greet { font-size: 18px; }

  .home-intro { padding: 28px 16px 80px; }
  .home-name { font-size: 22px; }
  .home-tagline { font-size: 12px; }
  .home-text { font-size: 14px; gap: 8px; }

  .home-sections { gap: 8px; }
  .home-section-card { padding: 12px 14px; gap: 12px; }
  .hsc-title { font-size: 13px; }
  .hsc-desc {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    font-size: 11px;
    line-height: 1.4;
  }
  .hsc-icon { width: 30px; height: 30px; }
  .hsc-arrow { font-size: 14px; }

  .home-footer {
    padding: 10px 16px;
    flex-wrap: wrap;
    height: auto;
    gap: 10px;
    font-size: 11px;
  }
  .footer-clock-wrap { display: none; }
  #home-est-clock { display: none; }
}

/* Brain Archive page responsive */
@media (max-width: 768px) {
  /* Stack sidebar above graph */
  main {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    max-height: none;
    height: auto;
  }

  aside {
    max-height: 220px;
    overflow-y: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 12px;
    gap: 12px;
  }

  .graph-pane {
    height: calc(100vh - 56px - 220px - 36px);
    min-height: 300px;
    position: relative;
  }

  #graph-svg {
    width: 100%;
    height: 100%;
  }

  /* Nav: hide less important links, keep essentials */
  nav a:not(.patreon-btn) { display: none; }
  .logo { font-size: 15px; }

  /* Detail panel fits screen */
  .detail-panel {
    max-width: calc(100vw - 32px);
    min-width: 0;
    left: 16px;
    right: 16px;
  }

  /* Traversal panel */
  .traversal-panel { overflow-x: auto; }
  .traversal-inner { flex-direction: column; gap: 12px; }
  .traversal-col { min-width: 0; }

  /* Footer */
  footer {
    flex-wrap: wrap;
    height: auto;
    padding: 8px 12px;
    gap: 8px;
    font-size: 11px;
  }

  /* Slider/controls tighter */
  .section-label { margin-bottom: 4px; }
  .slider-row { gap: 2px; }
}
