:root {
  --bg: #fafbfc;
  --bg-elevated: #ffffff;
  --bg-panel: #ffffff;
  --bg-hover: #f3f6f5;
  --bg-subtle: #eef2f1;
  --wash-mint: #f0f7f5;
  --wash-peach: #fff8f0;
  --wash-sky: #f3f8fc;
  --border: rgba(21, 32, 43, 0.08);
  --border-strong: rgba(21, 32, 43, 0.14);
  --text: #15202b;
  --text-secondary: #5b6775;
  --text-muted: #7a8694;
  --accent: #0f766e;
  --accent-hover: #0b5f59;
  --accent-glow: rgba(15, 118, 110, 0.18);
  --accent-dim: rgba(15, 118, 110, 0.1);
  --learning: #0d9488;
  --morality: #7c3aed;
  --health: #dc2626;
  --order: #d97706;
  --yes: #0f766e;
  --partial: #d97706;
  --no: #d4dbe3;
  --danger: #dc2626;
  --success: #059669;
  --gold: #b45309;
  --shadow: 0 8px 28px rgba(21, 32, 43, 0.06);
  --shadow-lg: 0 18px 48px rgba(21, 32, 43, 0.1);
  --radius: 14px;
  --radius-lg: 22px;
  --radius-pill: 999px;
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.05rem;
  line-height: 1.62;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 70% 45% at 12% -10%, rgba(15, 118, 110, 0.09), transparent 55%),
    radial-gradient(ellipse 55% 40% at 92% 8%, rgba(255, 214, 170, 0.28), transparent 50%),
    radial-gradient(ellipse 45% 35% at 70% 100%, rgba(186, 220, 255, 0.22), transparent 55%);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea, select {
  font-family: inherit;
  color: var(--text);
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text);
}

.section-desc { color: var(--text-secondary); }
.section-desc strong { color: var(--text); font-weight: 600; }

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-ghost, .btn-sm {
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: background 0.2s, border-color 0.2s, transform 0.15s, box-shadow 0.2s, color 0.2s;
  border: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  padding: 0.7rem 1.35rem;
  box-shadow: 0 8px 20px rgba(15, 118, 110, 0.22);
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(15, 118, 110, 0.28);
}

.btn-secondary {
  background: #ffffff;
  color: var(--text);
  border: 1px solid var(--border-strong);
  padding: 0.7rem 1.35rem;
}

.btn-secondary:hover {
  background: var(--wash-mint);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border-strong));
  transform: translateY(-1px);
}

.btn-sm { padding: 0.45rem 0.95rem; font-size: 0.8rem; }

.btn-ghost {
  background: transparent;
  color: var(--accent);
  padding: 0.5rem 0.85rem;
  font-size: 0.92rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Header & nav */
.site-header {
  border-bottom: 1px solid transparent;
  padding-bottom: 3rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(250, 251, 252, 0.55) 100%);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
  gap: 1rem;
  flex-wrap: wrap;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -0.03em;
  color: var(--text);
  text-decoration: none;
}

.nav-logo__icon { color: var(--accent); font-size: 0.85rem; }

.nav-links { display: flex; gap: 0.2rem; flex-wrap: wrap; }

.nav-link {
  padding: 0.45rem 0.95rem;
  border-radius: var(--radius-pill);
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 600;
  transition: color 0.2s, background 0.2s;
}

.nav-link:hover { color: var(--text); background: rgba(255, 255, 255, 0.85); }
.nav-link.active { color: var(--accent); background: var(--accent-dim); }

.nav-cta { display: none; }

@media (min-width: 900px) {
  .nav-cta { display: inline-flex; }
}

/* Hero */
.hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 2rem 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  align-items: center;
}

@media (min-width: 900px) {
  .hero { grid-template-columns: 1.15fr 0.85fr; }
}

.hero-eyebrow {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  font-weight: 700;
  margin: 0 0 0.75rem;
}

.hero h1 {
  font-size: clamp(2.1rem, 4.2vw, 3.15rem);
  font-weight: 800;
  line-height: 1.08;
  margin: 0 0 0.85rem;
  letter-spacing: -0.045em;
}

.hero-subtitle {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin: 0 0 1rem;
  max-width: 34rem;
}

.hero-intro {
  color: var(--text-secondary);
  margin: 0 0 1.5rem;
  max-width: 36rem;
  line-height: 1.7;
  font-size: 1.02rem;
}

.hero__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.hero__visual {
  position: relative;
  min-height: 220px;
  display: none;
}

@media (min-width: 900px) {
  .hero__visual { display: block; }
}

.hero-card {
  position: absolute;
  top: 40px;
  right: 0;
  width: 300px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.4rem;
  box-shadow: var(--shadow-lg);
}

.hero-card__label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 1rem;
  font-weight: 700;
}

.hero-card__stats {
  display: flex;
  gap: 1.25rem;
  margin-bottom: 0.85rem;
}

.hero-stat-num {
  display: block;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.hero-stat-lbl { font-size: 0.7rem; color: var(--text-muted); font-weight: 500; }

.hero-card__fears {
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.hero-card__fears-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.hero-card__chips { display: flex; flex-wrap: wrap; gap: 0.35rem; }

.chip-mini {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.28rem 0.65rem;
  border-radius: var(--radius-pill);
  background: var(--bg-subtle);
  color: var(--text-secondary);
}

.chip-mini--learning { color: var(--learning); background: rgba(13, 148, 136, 0.12); }
.chip-mini--morality { color: var(--morality); background: rgba(124, 58, 237, 0.1); }
.chip-mini--health { color: var(--health); background: rgba(220, 38, 38, 0.1); }
.chip-mini--order { color: var(--order); background: rgba(217, 119, 6, 0.12); }

.hero--compact { padding: 1.5rem 2rem 2rem; text-align: center; }
.hero--compact h1 { margin-bottom: 0.5rem; }

.site-header--compact { padding-bottom: 0; }

/* Main */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem 4rem;
}

.section-title {
  font-size: clamp(1.55rem, 2.4vw, 1.85rem);
  font-weight: 800;
  margin: 0 0 0.55rem;
  letter-spacing: -0.035em;
  line-height: 1.15;
}

.section-desc {
  color: var(--text-muted);
  margin: 0 0 2rem;
  max-width: 640px;
}

/* Match the timeline content column (full main width) for analysis sections */
.dial-method-section .section-desc,
.pattern-primer .section-desc,
.pattern-section .section-desc,
.stats-section .section-desc {
  max-width: none;
  width: 100%;
}

/* Controls */
.controls {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(250, 251, 252, 0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
  margin: 0 -2rem 2rem;
  padding-left: 2rem;
  padding-right: 2rem;
}

.controls-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem 2rem;
  align-items: flex-end;
}

.filter-group { display: flex; flex-direction: column; gap: 0.55rem; }

.filter-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 700;
  color: var(--text-secondary);
}

.filter-chips { display: flex; flex-wrap: wrap; gap: 0.45rem; }

.chip {
  padding: 0.5rem 1.05rem;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: #ffffff;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
}

.chip:hover { border-color: var(--accent); color: var(--text); background: var(--accent-dim); }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.chip--learning.active { background: var(--learning); border-color: var(--learning); color: #fff; }
.chip--morality.active { background: var(--morality); border-color: var(--morality); color: #fff; }
.chip--health.active { background: var(--health); border-color: var(--health); color: #fff; }
.chip--order.active { background: var(--order); border-color: var(--order); color: #fff; }

.dial-slider-wrap { display: flex; align-items: center; gap: 0.55rem; }
.dial-slider-wrap input { width: 88px; accent-color: var(--accent); height: 1.1rem; }
.dial-range-label, .dial-range-display { font-size: 0.95rem; font-weight: 600; color: var(--text-secondary); }
.filter-count { margin: 0.85rem 0 0; font-size: 0.92rem; color: var(--text-secondary); font-weight: 500; }

/* Timeline - horizontal scroll */
.timeline-section {
  margin: 0 -2rem 4rem;
  min-height: 72vh;
  display: flex;
  flex-direction: column;
  background: #000000;
  padding: 1.75rem 2rem 0;
  border-radius: var(--radius-lg);
}

.timeline-section .section-title {
  color: #ffffff;
}

.timeline-section .section-desc {
  color: rgba(255, 255, 255, 0.72);
  margin-bottom: 1.25rem;
}

.timeline-scroll-outer {
  position: relative;
  margin: 0;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding-bottom: 0.5rem;
  overflow: visible;
}

.timeline-scroll-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  margin: 0;
  padding: 0.75rem 1rem 1rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.02em;
  transition: opacity 0.3s;
}

.timeline-scroll-hint.is-hidden { opacity: 0; height: 0; padding: 0; overflow: hidden; }

.timeline-scroll-hint__icon {
  font-size: 1.1rem;
  line-height: 1;
  animation: scroll-pulse 2s ease-in-out infinite;
}

.timeline-scroll-hint__icon:last-child { animation-delay: 1s; }

@keyframes scroll-pulse {
  0%, 100% { opacity: 0.35; transform: translateX(0); }
  50% { opacity: 1; transform: translateX(3px); }
}

.timeline-scroll-hint__icon:first-child {
  animation-name: scroll-pulse-left;
}

@keyframes scroll-pulse-left {
  0%, 100% { opacity: 0.35; transform: translateX(0); }
  50% { opacity: 1; transform: translateX(-3px); }
}

.timeline-scroll-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 30;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: #ffffff;
  color: var(--accent);
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s, transform 0.2s, opacity 0.2s;
}

.timeline-scroll-btn:hover {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
  transform: translateY(-50%) scale(1.06);
}

.timeline-scroll-btn:disabled {
  opacity: 0;
  pointer-events: none;
}

.timeline-scroll-btn--left { left: 12px; }
.timeline-scroll-btn--right { right: 12px; }

.timeline-scroll-fade {
  position: absolute;
  top: 0;
  bottom: 2.5rem;
  width: 72px;
  z-index: 20;
  pointer-events: none;
  display: flex;
  align-items: center;
  transition: opacity 0.3s;
}

.timeline-scroll-fade.is-hidden { opacity: 0; }

.timeline-scroll-fade--left {
  left: 0;
  background: linear-gradient(90deg, #ffffff 30%, transparent 100%);
  justify-content: flex-start;
  padding-left: 8px;
}

.timeline-scroll-fade--right {
  right: 0;
  background: linear-gradient(270deg, #ffffff 30%, transparent 100%);
  justify-content: flex-end;
  padding-right: 8px;
}

.timeline-scroll-cue {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: var(--text-muted);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  opacity: 0.7;
}

.timeline-scroll-fade--right .timeline-scroll-cue {
  transform: rotate(0deg);
}

.timeline-scroll {
  overflow-x: auto;
  overflow-y: visible;
  padding: 3.5rem 3.5rem 3.5rem;
  min-height: 640px;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) var(--bg-subtle);
  -webkit-overflow-scrolling: touch;
  background: #ffffff;
  cursor: grab;
}

.timeline-scroll.is-dragging { cursor: grabbing; user-select: none; }

.timeline-scroll::-webkit-scrollbar { height: 10px; }
.timeline-scroll::-webkit-scrollbar-track { background: var(--bg-subtle); border-radius: 4px; }
.timeline-scroll::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 4px; }

.timeline-track {
  position: relative;
  min-height: 560px;
  --axis-y: 280px;
  transform-origin: 0 0;
}

.timeline-axis {
  position: absolute;
  left: 0;
  top: var(--axis-y);
  transform: translateY(-50%);
  height: 56px;
}

.axis-seg {
  position: absolute;
  top: 26px;
  height: 2px;
  border-radius: 1px;
}

.axis-seg--ancient {
  background: linear-gradient(90deg, var(--gold), rgba(252, 211, 77, 0.4));
}

.axis-seg--modern,
.axis-seg--early {
  background: linear-gradient(90deg, var(--accent), rgba(42, 125, 114, 0.35));
}

.axis-seg--dense {
  background: linear-gradient(90deg, rgba(42, 125, 114, 0.55), rgba(42, 125, 114, 0.2));
}

.axis-marker--dense {
  font-weight: 700;
  color: var(--accent);
}

.axis-break {
  position: absolute;
  top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 56px;
}

.axis-break__mark {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-muted);
  opacity: 0.4;
  letter-spacing: -0.12em;
  line-height: 1;
}

.axis-break__label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-top: 0.3rem;
  font-weight: 600;
}

.axis-marker {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  text-align: center;
}

.axis-marker::after {
  content: '';
  display: block;
  width: 2px;
  height: 14px;
  background: var(--border-strong);
  margin: 4px auto 0;
}

.axis-marker--ancient {
  color: var(--gold);
  top: auto;
  bottom: -1.35rem;
}

.axis-marker--ancient::after {
  display: none;
}

.timeline-nodes {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.timeline-connectors {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: visible;
}

.timeline-key__connector {
  display: inline-block;
  width: 28px;
  height: 18px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 18'%3E%3Cpath d='M22 2 L22 10 L8 10 L8 16' fill='none' stroke='%232a7d72' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Ccircle cx='8' cy='16' r='2.5' fill='%232a7d72'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Tech nodes on timeline */
.tech-node {
  position: absolute;
  width: 148px;
  transform: translateX(-50%);
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  --lane-step: 118px;
  --node-size: 52px;
  --icon-size: 26px;
}

.tech-node--scaled {
  width: 168px;
}

.tech-node--above {
  bottom: calc(100% - var(--axis-y) + var(--lane, 0) * var(--lane-step) + 10px);
  top: auto;
  flex-direction: column-reverse;
  transform: translateX(-50%);
  padding-bottom: 4px;
}

.tech-node--below {
  top: calc(var(--axis-y) + var(--lane, 0) * var(--lane-step) + 10px);
  bottom: auto;
  transform: translateX(-50%);
  padding-top: 4px;
}

.tech-node.hidden {
  opacity: 0.2;
  pointer-events: none;
  filter: grayscale(0.7);
}

.tech-node:hover,
.tech-node:focus-within {
  z-index: 100;
}

.tech-node__stem {
  position: relative;
  width: 2px;
  height: 28px;
  background: linear-gradient(180deg, var(--accent), transparent);
  opacity: 0.6;
  flex-shrink: 0;
}

.tech-node--below .tech-node__stem {
  background: linear-gradient(0deg, var(--accent), transparent);
}

.tech-node__trigger {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-align: center;
  font-family: var(--font);
  color: var(--text);
  width: 100%;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tech-node:hover .tech-node__trigger,
.tech-node:focus-within .tech-node__trigger {
  transform: scale(1.06);
}

.tech-node__icon-wrap {
  position: relative;
  width: var(--node-size, 52px);
  height: var(--node-size, 52px);
  border-radius: 14px;
  background: #ffffff;
  border: 1.5px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  box-shadow: var(--shadow);
  transition: border-color 0.25s, box-shadow 0.25s, background 0.25s, width 0.25s, height 0.25s;
  z-index: 3;
  isolation: isolate;
}

.tech-node__added-marker {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--gold);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 6;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.25);
  border: 2px solid #fff;
  pointer-events: none;
}

.tech-node__dial-badge {
  position: absolute;
  bottom: -5px;
  left: -5px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: #c41e1e;
  color: #fff;
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
  z-index: 3;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  border: 1.5px solid #fff;
  pointer-events: none;
}

.tech-node--quiet .tech-node__dial-badge {
  display: none;
}

/* Panic-associated technologies: red backlight on timeline */
.tech-node--panic .tech-node__icon-wrap {
  background: linear-gradient(145deg, #fff8f8 0%, #ffecec 100%);
  border-color: rgba(224, 32, 32, 0.55);
  box-shadow:
    0 0 0 1px rgba(224, 32, 32, 0.18),
    0 0 22px rgba(224, 32, 32, 0.28),
    0 4px 14px rgba(224, 32, 32, 0.12);
  color: #c41e1e;
}

.tech-node--panic:hover .tech-node__icon-wrap,
.tech-node--panic:focus-within .tech-node__icon-wrap {
  border-color: #e02020;
  background: linear-gradient(145deg, #fff5f5 0%, #ffe0e0 100%);
  box-shadow:
    0 0 0 1px rgba(224, 32, 32, 0.35),
    0 0 28px rgba(224, 32, 32, 0.42),
    0 6px 20px rgba(224, 32, 32, 0.18);
  color: #a81818;
}

.tech-node--panic .tech-node__year {
  color: #c41e1e;
}

.timeline-key {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  margin: 0 0 1rem;
  padding: 0.65rem 1rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  max-width: 52rem;
}

.timeline-view-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
}

.timeline-view-group {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.timeline-view-label,
.timeline-decade-nav__label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.62);
}

.timeline-view-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.88);
  cursor: pointer;
}

.timeline-view-toggle input {
  accent-color: var(--accent);
  width: 1rem;
  height: 1rem;
}

.timeline-zoom-display {
  font-size: 0.82rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.75);
  min-width: 3rem;
}

.timeline-view-group--zoom input[type="range"],
.timeline-view-group--size input[type="range"] {
  width: 120px;
  accent-color: var(--accent);
}

.timeline-size-btn {
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s, opacity 0.2s;
}

.timeline-size-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.4);
}

.timeline-size-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.timeline-track-scaler {
  position: relative;
  flex-shrink: 0;
}

.timeline-decade-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 1rem;
  padding: 0.55rem 0.85rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
}

.timeline-decade-chip {
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.timeline-decade-chip:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.35);
}

.timeline-key__item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.78);
}

.timeline-key__swatch {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  background: #ffffff;
  border: 1.5px solid var(--border-strong);
  box-shadow: var(--shadow);
  flex-shrink: 0;
}

.timeline-key__item--panic .timeline-key__swatch {
  background: linear-gradient(145deg, #fff8f8, #ffecec);
  border-color: rgba(224, 32, 32, 0.55);
  box-shadow:
    0 0 0 1px rgba(224, 32, 32, 0.18),
    0 0 14px rgba(224, 32, 32, 0.3);
}

.timeline-key__swatch--added {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 800;
  color: #fff;
  background: var(--gold);
  border-color: #c9922e;
}

.timeline-key-inline {
  color: rgba(255, 255, 255, 0.95);
  font-weight: 700;
}

.timeline-key-inline--panic {
  color: #ff8a8a;
}

.tech-node:hover .tech-node__icon-wrap,
.tech-node:focus-within .tech-node__icon-wrap {
  border-color: var(--accent);
  background: #ffffff;
  box-shadow: 0 4px 20px var(--accent-glow);
  color: var(--accent-hover);
}

.tech-icon-svg { display: block; }

.tech-node__labels {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.12rem;
  padding: 0.2rem 0.35rem 0.25rem;
  background: #ffffff;
  border-radius: 6px;
  position: relative;
  z-index: 2;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.92);
}

.tech-node__year {
  font-size: 0.68rem;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.25;
}

.tech-node__name {
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
  max-width: 148px;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  hyphens: auto;
}

/* Floating timeline tooltip (body-level portal) */
.timeline-tooltip {
  position: fixed;
  z-index: 10050;
  width: min(320px, calc(100vw - 32px));
  transform: translateX(-50%);
  background: #ffffff;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 0.75rem 0.85rem 0.85rem;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.16);
  color: var(--text);
  pointer-events: auto;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.timeline-tooltip.is-visible {
  opacity: 1;
}

.timeline-tooltip[hidden] {
  display: none !important;
}

.timeline-tooltip .tech-node__explore {
  width: 100%;
  margin-top: 0.65rem;
}

.tech-node__panel {
  display: none;
}

.tech-node__era {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0 0 0.5rem;
}

.tech-node__preview {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin: 0 0 0.75rem;
  line-height: 1.5;
}

.tech-node__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.tech-node__dial strong { color: var(--accent); }

.tech-node__fears {
  display: flex;
  gap: 4px;
  margin-bottom: 0.75rem;
}

.tech-node__explore {
  width: 100%;
  margin-top: 0.65rem;
}

.fear-dial-card--panel {
  border: none;
  box-shadow: none;
  padding: 0;
  background: transparent;
}

.fear-dial-card--panel .fear-dial-card__title {
  font-size: 1rem;
  margin-bottom: 0.1rem;
}

.fear-dial-card--panel .fear-dial-card__era {
  font-size: 0.78rem;
  margin-bottom: 0.45rem;
}

.fear-dial-card--panel .fear-dial-card__summary {
  font-size: 0.8rem;
  line-height: 1.45;
}

.fear-dial-card--panel .fear-dial-card__number {
  font-size: 1.65rem;
}

.fear-dial-card--panel .fear-dial-card__tags {
  margin-bottom: 0.45rem;
}

.added-badge {
  font-size: 0.6rem;
  color: var(--gold);
  margin-left: 0.15rem;
}

.tech-node--compact {
  width: 72px;
  z-index: 2;
}

.tech-node--compact .tech-node__name {
  font-size: 0.62rem;
  line-height: 1.15;
  max-width: 68px;
}

.tech-node--compact .tech-node__icon-wrap {
  width: 44px;
  height: 44px;
}

.tech-node--compact .tech-node__year {
  font-size: 0.6rem;
}

.tech-node--compact:hover,
.tech-node--compact:focus-within {
  z-index: 120;
}

.tech-node--compact:hover .tech-node__name,
.tech-node--compact:focus-within .tech-node__name {
  font-size: 0.88rem;
  max-width: 120px;
}

/* Fear dial cards */
.fear-dial-card {
  --dial-color: var(--accent);
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.25rem 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.fear-dial-card--clickable {
  cursor: pointer;
  transition: box-shadow 0.2s, border-color 0.2s, transform 0.2s;
}

.fear-dial-card--clickable:hover {
  border-color: var(--border-strong);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.fear-dial-card__gauge-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 0.75rem;
  overflow: hidden;
  position: relative;
  z-index: 0;
}

.fear-dial-card__dial-heading {
  margin: 0 0 0.7rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: center;
  line-height: 1.35;
  color: #0f172a;
  max-width: 16rem;
  position: relative;
  z-index: 3;
  background: #ffffff;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  flex-shrink: 0;
}

.fear-dial-card__dial-heading--panel {
  font-size: 0.7rem;
  margin-bottom: 0.65rem;
  color: #0f172a;
}

.fear-dial-card--panel .fear-dial-card__dial-heading {
  margin-left: auto;
  margin-right: auto;
}

.fear-dial-svg {
  display: block;
  overflow: hidden;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}

.fear-dial-card__legend-desc {
  margin: 0 0 0.55rem;
  font-size: 0.76rem;
  line-height: 1.45;
  color: var(--text-muted);
  text-align: center;
}

.fear-dial-card__score {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  margin: 0.15rem 0 0;
  line-height: 1;
}

.fear-dial-card__number {
  font-size: 2rem;
  font-weight: 800;
  color: var(--dial-color);
  letter-spacing: -0.03em;
}

.fear-dial-card__label {
  font-size: 0.95rem;
  color: var(--text-muted);
  font-weight: 500;
}

.fear-dial-card__label::before {
  content: '·';
  margin-right: 0.35rem;
  color: var(--text-muted);
}

.fear-dial-card__title {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0 0 0.2rem;
  color: var(--text);
}

.fear-dial-card__era {
  margin: 0 0 0.65rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.fear-dial-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.65rem;
}

.fear-dial-card__tag {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
}

.fear-dial-card__summary {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.fear-dial-card__legend {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}

.fear-dial-card__legend-title {
  margin: 0 0 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text);
}

.fear-dial-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.85rem;
}

.fear-dial-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.68rem;
  color: var(--text-secondary);
}

.fear-dial-legend__swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}

.fear-dial-card--compact .fear-dial-card__number { font-size: 1.5rem; }
.fear-dial-card--compact .fear-dial-card__title { font-size: 1rem; }

.dials-section {
  padding: 3rem 1.5rem 4rem;
  max-width: 1200px;
  margin: 0 auto;
}

.dials-legend-wrap {
  margin-bottom: 1.5rem;
  padding: 1rem 1.25rem;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.dials-legend-wrap .fear-dial-card__legend {
  margin: 0;
  padding: 0;
  border: none;
}

.dials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.fear-dial-card.hidden {
  display: none;
}

.tech-node__dial-mini {
  display: flex;
  justify-content: center;
  margin: -0.25rem 0 0.35rem;
}

.tech-node__dial-score {
  font-size: 0.78rem;
  font-weight: 600;
}

.modal-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin: 0.75rem 0 1.25rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.modal-inner .fear-dial-card {
  margin: 0 2rem 0 0;
  border: none;
  box-shadow: none;
  padding: 0 0 0.5rem;
}

/* Fear pips & badges */
.fear-pip {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  opacity: 0.2;
  background: var(--text-muted);
}

.fear-pip.yes { opacity: 1; }
.fear-pip.partial { opacity: 0.55; }
.fear-pip--learning { background: var(--learning); }
.fear-pip--morality { background: var(--morality); }
.fear-pip--health { background: var(--health); }
.fear-pip--order { background: var(--order); }

.transform-badge {
  font-size: 0.65rem;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.transform-badge--yes { background: #dcfce7; color: #166534; }
.transform-badge--partial { background: #ccfbf1; color: #0f766e; }
.transform-badge--no { background: var(--bg-subtle); color: var(--text-muted); }

.dial-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--bg-subtle);
  border: 1px solid var(--border-strong);
  display: inline-block;
}

.dial-dot.filled { background: var(--accent); border-color: var(--accent); }
.dial-dot.filled.high { background: var(--danger); border-color: var(--danger); }
.dial-dots { display: flex; gap: 4px; }

/* The Pattern / Panic Grid */
.pattern-section {
  margin-bottom: 4rem;
  padding: 1.75rem 1.5rem;
  border-radius: var(--radius-lg);
  background: var(--wash-sky);
  border: 1px solid color-mix(in srgb, #7eb6e0 16%, transparent);
}

.pattern-intro {
  max-width: none;
  width: 100%;
}

.method-footnote {
  margin: -1rem 0 2rem;
  max-width: none;
  width: 100%;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.method-footnote a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.method-footnote a:hover {
  text-decoration: underline;
}

.method-footnote--compact {
  margin: 0.35rem 0 0;
  max-width: 240px;
  line-height: 1.4;
}

/* Fear dial methodology */
.dial-method-section {
  margin-bottom: 3rem;
  padding: 1.75rem 1.5rem;
  border-radius: var(--radius-lg);
  background: var(--wash-mint);
  border: 1px solid color-mix(in srgb, var(--accent) 8%, transparent);
}

.dial-method-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.45rem 1.6rem;
  box-shadow: var(--shadow);
  max-width: none;
  width: 100%;
}

.dial-method-card__title {
  margin: 1.15rem 0 0.45rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.dial-method-card__title:first-child {
  margin-top: 0;
}

.dial-method-card > p {
  margin: 0.65rem 0 0;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

.dial-method-definition {
  margin-top: 0 !important;
  padding: 0.85rem 1rem;
  background: color-mix(in srgb, var(--accent) 8%, #fff);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text) !important;
  font-size: 0.95rem !important;
  line-height: 1.55 !important;
}

.dial-method-fear-types {
  margin: 0.65rem 0 0;
  padding-left: 1.15rem;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.dial-method-fear-types li {
  margin-bottom: 0.45rem;
}

.dial-method-fear-types strong {
  color: var(--text);
}

.dial-method-fear-types em {
  font-style: italic;
  color: var(--accent);
  font-weight: 600;
}

.dial-method-scope {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 0.65rem;
}

.dial-method-scope__col {
  padding: 0.95rem 1.05rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #fff;
}

.dial-method-scope__col h4 {
  margin: 0 0 0.45rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.dial-method-scope__col--in h4 { color: var(--accent); }
.dial-method-scope__col--out h4 { color: var(--text-muted, #6b7280); }

.dial-method-scope__col ul {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--text-secondary);
}

.dial-method-scope__col li {
  margin-bottom: 0.35rem;
}

.dial-method-table-wrap {
  margin-top: 0.65rem;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.dial-method-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
  line-height: 1.4;
}

.dial-method-table th,
.dial-method-table td {
  padding: 0.65rem 0.75rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

.dial-method-table thead th {
  background: color-mix(in srgb, var(--accent) 6%, #f7f7f5);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text);
}

.dial-method-table tbody th {
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

.dial-method-table tbody td {
  color: var(--text-secondary);
}

.dial-method-table tbody tr:last-child th,
.dial-method-table tbody tr:last-child td {
  border-bottom: none;
}

.dial-method-scale li span:last-child {
  flex: 1;
}

.dial-method-steps--plain {
  list-style: disc;
}

.primer-dial-note {
  margin: 0.55rem 0 0;
  font-size: 0.78rem;
  color: var(--text-muted, #6b7280);
}

.primer-dial-note a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.primer-dial-note a:hover {
  text-decoration: underline;
}

@media (max-width: 720px) {
  .dial-method-scope {
    grid-template-columns: 1fr;
  }
}

.dial-method-steps {
  margin: 0.5rem 0 0;
  padding-left: 1.2rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
}

.dial-method-steps li {
  margin-bottom: 0.55rem;
}

.dial-method-steps strong {
  color: var(--text);
}

.dial-method-scale {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.dial-method-scale li {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.dial-method-scale__n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 800;
  color: #fff;
  background: var(--c);
  flex-shrink: 0;
}

.dial-method-note {
  margin-top: 1.15rem !important;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
  font-size: 0.8125rem !important;
  color: var(--text-muted) !important;
}

.dial-method-note a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.dial-method-note a:hover {
  text-decoration: underline;
}

.dial-method-download {
  margin-top: 1.15rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--accent) 6%, #fff);
}

.dial-method-download__label {
  margin: 0 !important;
  font-size: 0.9rem !important;
  font-weight: 700 !important;
  color: var(--text) !important;
}

.dial-method-download__desc {
  margin: 0.4rem 0 0.85rem !important;
  font-size: 0.84rem !important;
  line-height: 1.5 !important;
  color: var(--text-secondary) !important;
}

.dial-method-download__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.1rem;
}

.dial-method-download__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.2);
}

.dial-method-download__btn:hover {
  filter: brightness(0.96);
  text-decoration: none;
  transform: translateY(-1px);
}

.dial-method-download__link {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.dial-method-download__link:hover {
  text-decoration: underline;
}

#fear-dial-method {
  scroll-margin-top: 7rem;
}

/* Pattern primer - variables & engines */
.pattern-primer {
  margin-bottom: 3rem;
  padding: 1.75rem 1.5rem;
  border-radius: var(--radius-lg);
  background: var(--wash-peach);
  border: 1px solid color-mix(in srgb, #f0b27a 18%, transparent);
}

.primer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.primer-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.45rem;
  box-shadow: var(--shadow);
}

.primer-card__title {
  margin: 0 0 1rem;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.primer-vars {
  margin: 0 0 1.15rem;
}

.primer-vars__row {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 0.65rem;
  padding: 0.65rem 0;
  border-top: 1px solid var(--border);
}

.primer-vars__row:last-child {
  border-bottom: 1px solid var(--border);
}

.primer-vars dt {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
}

.primer-vars dd {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.primer-vars a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.primer-vars a:hover {
  text-decoration: underline;
}

.primer-pill {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  margin: 0.15rem 0.15rem 0 0;
}

.primer-pill--institution {
  background: var(--accent-dim);
  color: var(--accent);
}

.primer-pill--adult {
  background: rgba(217, 119, 6, 0.14);
  color: #b45309;
}

.primer-pill--child {
  background: rgba(196, 30, 30, 0.1);
  color: #c41e1e;
}

.primer-insights {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.primer-insights li {
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text-secondary);
  padding-left: 0.85rem;
  border-left: 3px solid var(--accent);
}

.primer-insights mark {
  background: rgba(42, 125, 114, 0.16);
  color: var(--text);
  padding: 0.05em 0.25em;
  border-radius: 3px;
}

.primer-subhead {
  margin: 0 0 0.4rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}

.primer-dial-block,
.primer-engines-block {
  margin-bottom: 1.15rem;
}

.primer-dial-block p,
.primer-engines-block p {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.primer-engines-block mark {
  background: rgba(217, 119, 6, 0.2);
  color: var(--text);
  padding: 0.05em 0.25em;
  border-radius: 3px;
}

.primer-dial-scale {
  display: flex;
  gap: 0.45rem;
  align-items: flex-end;
}

.primer-dial-scale__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.primer-dial-scale__item::before {
  content: '';
  width: calc(10px + 2px * var(--i, 0));
  height: calc(10px + 2px * var(--i, 0));
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9);
}

.primer-dial-scale__item:nth-child(1)::before { width: 10px; height: 10px; }
.primer-dial-scale__item:nth-child(2)::before { width: 12px; height: 12px; }
.primer-dial-scale__item:nth-child(3)::before { width: 14px; height: 14px; }
.primer-dial-scale__item:nth-child(4)::before { width: 16px; height: 16px; }
.primer-dial-scale__item:nth-child(5)::before { width: 18px; height: 18px; }
.primer-dial-scale__item:nth-child(6)::before { width: 20px; height: 20px; }

.primer-dial-scale__item i {
  font-style: normal;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
}

.primer-engines {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.primer-engines li {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 0.5rem;
  align-items: start;
  font-size: 0.8125rem;
  line-height: 1.4;
}

.primer-engines__name {
  font-weight: 700;
  color: #9f1239;
}

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

.legend-block:target {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

#legend-dial {
  scroll-margin-top: 7rem;
}

.panic-grid__title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 0 0 1rem;
  letter-spacing: -0.01em;
}

.pattern-subhead {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
  margin: 2.75rem 0 0.65rem;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.pattern-section > .pattern-subhead:first-of-type {
  margin-top: 1.75rem;
}

.panic-grid__scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0;
  padding: 0 0 0.25rem;
  width: 100%;
}

.panic-grid__figure {
  margin: 0;
  width: 100%;
  max-width: none;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 0.75rem 0.5rem;
  box-shadow: var(--shadow);
}

.panic-grid__figure svg {
  display: block;
  width: 100%;
  height: auto;
}

.panic-grid__axis-label,
.panic-grid__col-label {
  font-family: var(--font);
  font-size: 13px;
  fill: var(--text-muted);
}

.panic-grid__col-label {
  font-size: 14px;
  font-weight: 600;
  fill: var(--text-secondary);
}

.panic-grid__col-count {
  font-size: 12px;
  font-weight: 500;
  fill: var(--text-muted);
}

.panic-grid__annotation {
  font-family: var(--font);
  font-size: 11px;
  fill: var(--text-muted);
}

.panic-grid__caption {
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  fill: #c41e1e;
}

.panic-grid__dot-label {
  font-family: var(--font);
  font-size: 11px;
  font-weight: 600;
  fill: var(--text-secondary);
  pointer-events: none;
}

.panic-grid__dot {
  cursor: pointer;
  outline: none;
}

.panic-grid__visible {
  stroke: rgba(255, 255, 255, 0.85);
  stroke-width: 1.5;
  transition: r 0.15s ease, stroke-width 0.15s ease;
}

.panic-grid__dot:hover .panic-grid__visible,
.panic-grid__dot:focus-visible .panic-grid__visible,
.panic-grid__dot.is-active .panic-grid__visible {
  r: 8;
  stroke-width: 2.5;
  stroke: var(--text);
}

.panic-grid__dot:focus-visible .panic-grid__hit {
  stroke: var(--accent);
  stroke-width: 2;
  stroke-dasharray: 4 3;
}

.panic-grid__legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin-top: 1rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.panic-grid__legend-title {
  font-weight: 600;
  color: var(--text-secondary);
}

.panic-grid__legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.panic-grid__swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid rgba(15, 23, 42, 0.12);
}

.panic-grid__swatch--yes { background: #c41e1e; }
.panic-grid__swatch--partial { background: #d97706; }
.panic-grid__swatch--no { background: #94a3b8; }

.panic-grid-tooltip {
  position: fixed;
  z-index: 500;
  max-width: 260px;
  padding: 0.55rem 0.7rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  font-size: 12.5px;
  line-height: 1.45;
  pointer-events: none;
}

.panic-grid-tooltip[hidden] { display: none; }

.panic-grid-tooltip__name {
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.15rem;
}

.panic-grid-tooltip__meta {
  color: var(--text-muted);
  font-size: 12px;
}

.panic-grid-tooltip__engines {
  margin-top: 0.25rem;
  color: var(--text-secondary);
  font-size: 12px;
}

.tech-node--grid-focus .tech-node__icon-wrap {
  outline: 3px solid #c41e1e;
  outline-offset: 3px;
  box-shadow: 0 0 0 6px rgba(196, 30, 30, 0.2);
}

/* Panic fork diagram */
.panic-fork {
  margin-top: 3.5rem;
}

.panic-fork__intro {
  max-width: none;
  width: 100%;
  margin-bottom: 1.75rem;
}

.panic-fork__diagram {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 1rem 0 0.5rem;
}

.panic-fork__root {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem 1.15rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.panic-fork__root-title {
  font-weight: 700;
  color: var(--text);
}

.panic-fork__badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--accent-dim);
  color: var(--accent);
}

.panic-fork__decision {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 640px;
}

.panic-fork__decision-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 0.65rem 1rem;
  text-align: center;
}

.panic-fork__connector {
  display: block;
  background: var(--border-strong);
}

.panic-fork__connector--down {
  width: 2px;
  height: 28px;
}

.panic-fork__connector--fork {
  position: relative;
  width: min(420px, 72%);
  height: 2px;
  margin-top: 0;
}

.panic-fork__connector--fork::before,
.panic-fork__connector--fork::after {
  content: '';
  position: absolute;
  top: 0;
  width: 2px;
  height: 28px;
  background: var(--border-strong);
}

.panic-fork__connector--fork::before {
  left: 0;
}

.panic-fork__connector--fork::after {
  right: 0;
}

.panic-fork__branches {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  width: 100%;
  max-width: none;
  margin-top: 26px;
}

.panic-fork__branch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  position: relative;
}

.panic-fork__branch::before {
  content: '';
  display: block;
  width: 2px;
  height: 22px;
  background: var(--border-strong);
  margin-top: -22px;
}

.panic-fork__branch-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
}

.panic-fork__branch--no .panic-fork__branch-label {
  background: var(--bg-subtle);
  color: var(--text-muted);
}

.panic-fork__branch--yes .panic-fork__branch-label {
  background: rgba(196, 30, 30, 0.12);
  color: #c41e1e;
}

.panic-fork__card {
  width: 100%;
  padding: 1.1rem 1.15rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  box-shadow: var(--shadow);
}

.panic-fork__branch--no .panic-fork__card {
  border-color: var(--border);
  background: var(--bg-hover);
}

.panic-fork__branch--yes .panic-fork__card {
  border-color: rgba(196, 30, 30, 0.22);
  background: linear-gradient(180deg, rgba(196, 30, 30, 0.04), rgba(255, 255, 255, 0.9));
}

.panic-fork__card-title {
  margin: 0 0 0.85rem;
  font-size: 1rem;
  font-weight: 700;
}

.panic-fork__branch--yes .panic-fork__card-title {
  color: #c41e1e;
}

.panic-fork__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.panic-fork__chip {
  font-family: var(--font);
  font-size: 0.8125rem;
  line-height: 1.3;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.panic-fork__chip--tech {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.55rem 0.35rem 0.7rem;
  background: rgba(255, 255, 255, 0.85);
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, color 0.15s;
}

.panic-fork__chip--tech:hover,
.panic-fork__chip--tech:focus-visible,
.panic-fork__chip--tech.is-active {
  border-color: var(--border-strong);
  color: var(--text);
  box-shadow: var(--shadow);
  outline: none;
}

.panic-fork__chip--tech:focus-visible {
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.panic-fork__chip-name {
  text-align: left;
}

.panic-fork__dial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.25rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--bg-subtle);
  color: var(--text-muted);
}

.panic-fork__partial {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.panic-fork__chip--engine {
  display: inline-flex;
  padding: 0.4rem 0.75rem;
  font-weight: 600;
  background: rgba(196, 30, 30, 0.1);
  border-color: rgba(196, 30, 30, 0.2);
  color: #9f1239;
}

.panic-fork__caption {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.panic-fork__footnote {
  margin: 1.25rem 0 0;
  font-size: 0.8rem;
  max-width: none;
  width: 100%;
  line-height: 1.5;
}

/* Engines matrix */
.engines-matrix {
  margin-top: 3.5rem;
}

.engines-matrix__intro {
  max-width: none;
  width: 100%;
  margin-bottom: 1.25rem;
}

.engines-matrix__scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -0.5rem;
  padding: 0 0.5rem 0.25rem;
  border-radius: var(--radius);
}

.engines-matrix__table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.8125rem;
}

.engines-matrix__table th,
.engines-matrix__table td {
  padding: 0.35rem 0.4rem;
  text-align: center;
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
}

.engines-matrix__sticky {
  position: sticky;
  left: 0;
  z-index: 2;
  text-align: left;
  min-width: 148px;
  max-width: 168px;
  border-right: 1px solid var(--border-strong);
  box-shadow: 4px 0 8px rgba(15, 23, 42, 0.04);
}

.engines-matrix__corner {
  z-index: 3;
  background: var(--bg-hover);
}

.engines-matrix__col-header {
  min-width: 52px;
  max-width: 72px;
  padding-top: 0.55rem;
  font-weight: 600;
  font-size: 0.72rem;
  line-height: 1.2;
  color: var(--text-secondary);
  cursor: pointer;
  vertical-align: bottom;
}

.engines-matrix__col-header:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.engines-matrix__col-header--highlight,
.engines-matrix__dial-header--highlight,
.engines-matrix__cell--highlight {
  background: rgba(42, 125, 114, 0.08);
}

.engines-matrix__col-header--highlight {
  box-shadow: inset 0 3px 0 var(--accent);
}

.engines-matrix__col-name {
  display: block;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  max-height: 92px;
  margin: 0 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.engines-matrix__dial-header {
  min-width: 52px;
  padding-bottom: 0.5rem;
  cursor: pointer;
}

.engines-matrix__dial-wrap {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}

.engines-matrix__dial-bar {
  display: inline-flex;
  gap: 2px;
  align-items: flex-end;
  height: 14px;
}

.engines-matrix__bar-seg {
  display: block;
  width: 5px;
  height: 6px;
  border-radius: 1px;
  background: var(--bg-subtle);
}

.engines-matrix__bar-seg.is-filled {
  background: var(--seg-color, var(--accent));
  height: 14px;
}

.engines-matrix__dial-num {
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 1;
}

.engines-matrix__row-label {
  padding: 0.55rem 0.65rem;
  background: var(--bg-hover);
}

.engines-matrix__engine {
  display: block;
  font-weight: 700;
  color: var(--text);
  font-size: 0.8125rem;
}

.engines-matrix__def {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.35;
  margin-top: 0.15rem;
}

.engines-matrix__cell {
  min-width: 44px;
  width: 44px;
}

.engines-matrix__empty {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid var(--bg-subtle);
  background: transparent;
}

.engines-matrix__dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 50%;
}

.engines-matrix__dot:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.engines-matrix__dot.is-active .engines-matrix__dot-fill,
.engines-matrix__dot:hover .engines-matrix__dot-fill {
  transform: scale(1.15);
  box-shadow: 0 0 0 3px rgba(196, 30, 30, 0.18);
}

.engines-matrix__dot-fill {
  display: block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #c41e1e;
  border: 2px solid rgba(255, 255, 255, 0.9);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.engines-matrix__callout {
  margin: 1rem 0 0;
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--accent);
  background: var(--accent-dim);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
  max-width: none;
  width: 100%;
  line-height: 1.5;
}

.engines-matrix__callout strong {
  color: var(--accent);
}

.engines-matrix__footnote {
  margin: 0.85rem 0 0;
  font-size: 0.8rem;
  max-width: none;
  width: 100%;
  line-height: 1.5;
}

/* Substitution gradient step chart */
.sub-gradient {
  margin-top: 3.5rem;
}

.sub-gradient__intro {
  max-width: none;
  width: 100%;
  margin-bottom: 1.5rem;
}

.sub-gradient__layout {
  display: grid;
  grid-template-columns: minmax(200px, 260px) 1fr;
  gap: 1.25rem;
  align-items: start;
}

.sub-gradient__annotation {
  padding: 1rem 1.1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.sub-gradient__annotation-text {
  margin: 0;
}

.sub-gradient__annotation strong {
  color: var(--text);
}

.sub-gradient__figure {
  margin: 0;
  min-width: 0;
  display: grid;
  grid-template-columns: 1.75rem 1fr;
  grid-template-rows: 1fr auto;
  gap: 0 0.85rem;
}

.sub-gradient__y-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  align-self: center;
  justify-self: center;
  padding-bottom: 1.5rem;
  color: var(--text-muted);
}

.sub-gradient__plot-wrap {
  position: relative;
  grid-column: 2;
  grid-row: 1;
  padding-left: 1.35rem;
}

.sub-gradient__plot {
  position: relative;
  height: 300px;
  border-left: 1px solid var(--border-strong);
  border-bottom: 1px solid var(--border-strong);
  padding: 0 0.5rem 0 0.25rem;
}

.sub-gradient__grid {
  position: absolute;
  inset: 0 0.5rem 0 0.25rem;
  pointer-events: none;
}

.sub-gradient__gridline {
  position: absolute;
  left: 0;
  right: 0;
  top: var(--grid-y);
  height: 1px;
  background: rgba(15, 23, 42, 0.07);
}

.sub-gradient__grid-label {
  position: absolute;
  left: -1.15rem;
  top: -0.45rem;
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
}

.sub-gradient__steps {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.65rem;
  align-items: end;
  height: 100%;
  padding-top: 0.25rem;
}

.sub-gradient__step {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: calc((var(--step-dial) / 5) * 100%);
  min-height: 56px;
  padding: 0;
  border: none;
  border-radius: var(--radius) var(--radius) 2px 2px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--step-color) 88%, white), var(--step-color));
  box-shadow: 0 2px 8px color-mix(in srgb, var(--step-color) 25%, transparent);
  cursor: pointer;
  text-align: left;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.sub-gradient__step:hover,
.sub-gradient__step:focus-visible,
.sub-gradient__step.is-active {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px color-mix(in srgb, var(--step-color) 35%, transparent);
  outline: none;
}

.sub-gradient__step:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.sub-gradient__step-inner {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.55rem 0.5rem;
  font-size: 0.8125rem;
  line-height: 1.3;
}

.sub-gradient__step--light .sub-gradient__step-inner {
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.sub-gradient__step--dark .sub-gradient__step-inner {
  color: #1a1520;
  text-shadow: none;
}

.sub-gradient__step-name {
  font-weight: 700;
  font-size: 0.8125rem;
}

.sub-gradient__step-skill,
.sub-gradient__step-status {
  font-size: 0.75rem;
  opacity: 0.95;
}

.sub-gradient__step-status {
  font-style: italic;
  opacity: 0.88;
}

.sub-gradient__dial-badge {
  align-self: flex-start;
  margin-top: 0.15rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.95);
  color: var(--badge-color);
  border: 1px solid color-mix(in srgb, var(--badge-color) 35%, transparent);
}

.sub-gradient__extras {
  position: absolute;
  inset: 0 0.5rem 0 0.25rem;
  pointer-events: none;
  z-index: 2;
}

.sub-gradient__extra-dot {
  position: absolute;
  left: var(--dot-x);
  bottom: var(--dot-y);
  transform: translate(-50%, 50%);
  width: 14px;
  height: 14px;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--dot-color);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.2);
  cursor: pointer;
  pointer-events: auto;
  transition: transform 0.15s ease;
}

.sub-gradient__extra-dot:hover,
.sub-gradient__extra-dot:focus-visible,
.sub-gradient__extra-dot.is-active {
  transform: translate(-50%, 50%) scale(1.25);
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.sub-gradient__x-label {
  grid-column: 2;
  margin-top: 0.55rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
}

/* Paired fates grid */
.paired-fates {
  margin-top: 3.5rem;
}

.paired-fates__intro {
  max-width: none;
  width: 100%;
  margin-bottom: 1.5rem;
}

.paired-fates__grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.paired-fates__pair {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.75rem;
  align-items: stretch;
}

.paired-fates__divider {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0 0.25rem;
  min-width: 72px;
}

.paired-fates__divider-line {
  display: block;
  width: 2px;
  flex: 1;
  min-height: 20px;
  background: var(--border-strong);
  border-radius: 1px;
}

.paired-fates__divider-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.25;
  max-width: 72px;
}

.paired-fates__card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.paired-fates__card--institution {
  border-top: 3px solid var(--accent);
}

.paired-fates__card--adult {
  border-top: 3px solid #d97706;
}

.paired-fates__card--child {
  border-top: 3px solid #c41e1e;
}

.paired-fates__card:hover,
.paired-fates__card:focus-within {
  box-shadow: var(--shadow-lg);
}

.paired-fates__card--wide {
  grid-column: 1 / -1;
  border-top-color: #64748b;
  background: linear-gradient(180deg, var(--bg-hover), var(--bg-elevated));
}

.paired-fates__single {
  margin-top: 0.25rem;
}

.paired-fates__card-btn {
  display: block;
  width: 100%;
  padding: 1rem 1.1rem;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font-family: var(--font);
  color: inherit;
}

.paired-fates__card-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.paired-fates__name {
  margin: 0 0 0.6rem;
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
}

.paired-fates__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.65rem;
}

.paired-fates__control {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}

.paired-fates__control--institution {
  background: var(--accent-dim);
  color: var(--accent);
}

.paired-fates__control--adult {
  background: rgba(217, 119, 6, 0.14);
  color: #b45309;
}

.paired-fates__control--child {
  background: rgba(196, 30, 30, 0.1);
  color: #c41e1e;
}

.paired-fates__dial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 1.5rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  color: #fff;
  background: var(--dial-color);
}

.paired-fates__fate {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--text-secondary);
}

.paired-fates__fate--wide {
  font-size: 0.875rem;
}

.paired-fates__closing {
  margin: 1.25rem 0 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  text-align: center;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.5;
}

/* Panic flow diagram */
.panic-flow {
  margin-top: 3.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.panic-flow__intro {
  max-width: none;
  width: 100%;
  margin-bottom: 1.5rem;
}

.panic-flow__stages {
  display: flex;
  align-items: stretch;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0;
}

.panic-flow__stage {
  flex: 1 1 0;
  min-width: 0;
  list-style: none;
}

.panic-flow__card {
  height: 100%;
  padding: 1rem 1.05rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.panic-flow__stage-title {
  margin: 0 0 0.55rem;
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
}

.panic-flow__body {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--text-secondary);
}

.panic-flow__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}

.panic-flow__chip {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg-hover);
  color: var(--text-secondary);
  text-transform: lowercase;
}

.panic-flow__sub {
  margin: 0.5rem 0 0;
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--text-muted);
  font-style: italic;
}

.panic-flow__arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  list-style: none;
  padding: 0 0.35rem;
  color: var(--text-muted);
}

.panic-flow__arrow-icon {
  font-size: 1.1rem;
  line-height: 1;
  font-weight: 600;
}

.pattern-section__footer {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  text-align: center;
}

.pattern-section__refs-link {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.pattern-section__refs-link:hover {
  text-decoration: underline;
}

/* Stats */
.stats-section {
  margin-bottom: 4rem;
  padding: 1.75rem 1.5rem;
  border-radius: var(--radius-lg);
  background: var(--wash-mint);
  border: 1px solid color-mix(in srgb, var(--accent) 8%, transparent);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card, .fear-stat-block, .legend-block {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.4rem;
  box-shadow: var(--shadow);
}

.stat-card .stat-value {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}

.stat-card .stat-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.35rem;
}

.stat-card .stat-note {
  margin: 0.55rem 0 0;
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--text-muted, #6b7280);
}

.fear-stat-block { margin-bottom: 1rem; }

.fear-stat-block h3 {
  font-size: 1rem;
  margin: 0 0 0.35rem;
}

.fear-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0 0 1rem;
}

.bar-chart {
  display: flex;
  height: 28px;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.bar-segment {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 600;
  color: #fff;
  min-width: 0;
}

.bar-segment--yes { background: var(--yes); }
.bar-segment--partial { background: var(--partial); color: #0b0e14; }
.bar-segment--no { background: var(--no); color: var(--text-secondary); }

.bar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Legend */
.legend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.legend-block h3 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin: 0 0 1rem;
}

.legend-block dt {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.15rem;
}

.legend-block dd {
  margin: 0 0 0.85rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Comments */
.comment-slot { margin-top: 1rem; }

.comment-widget {
  border-top: 1px solid var(--border);
  padding-top: 0.85rem;
  margin-top: 0.85rem;
}

.comment-widget--full {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.comment-widget__header {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  margin-bottom: 0.65rem;
}

.comment-widget__icon { font-size: 1rem; opacity: 0.7; }

.comment-widget__invite {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.45;
  font-style: italic;
}

.comment-count {
  display: inline-block;
  font-size: 0.7rem;
  color: var(--accent);
  font-weight: 600;
  margin-top: 0.25rem;
}

.comment-toggle { margin-bottom: 0.5rem; }

.comment-panel { margin-top: 0.75rem; }

.comment-storage-note {
  font-size: 0.7rem;
  color: #92400e;
  margin: 0 0 0.75rem;
  padding: 0.5rem 0.75rem;
  background: #fffbeb;
  border-radius: 6px;
  border: 1px solid #fde68a;
}

.comment-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  max-height: 200px;
  overflow-y: auto;
}

.comment-item {
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
}

.comment-item__meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.comment-item__body {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.5;
}

.comment-empty {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0 0 1rem;
}

.comment-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.comment-form input,
.comment-form textarea {
  font-family: var(--font);
  font-size: 0.85rem;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: #ffffff;
  color: var(--text);
}

.comment-form input:focus,
.comment-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.comment-form textarea { resize: vertical; min-height: 72px; }

/* Modal */
.detail-modal {
  border: none;
  padding: 0;
  max-width: 560px;
  width: calc(100% - 2rem);
  border-radius: var(--radius-lg);
  background: transparent;
}

.detail-modal::backdrop {
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
}

.modal-inner {
  background: #ffffff;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.75rem 1.5rem;
  max-height: 92vh;
  overflow-y: auto;
  position: relative;
  color: var(--text);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  background: #ffffff;
  border-radius: 8px;
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--text);
}

.modal-close:hover { background: var(--bg-hover); }

.modal-header h2 {
  font-size: 1.5rem;
  margin: 0 0 0.35rem;
  padding-right: 0;
}

.modal-header__top {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding-right: 2rem;
}

.modal-header__icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}

.modal-header .modal-meta {
  margin-bottom: 0;
}

.modal-meta {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
}

.modal-dial-large {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: #f8fafc;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  border: 1px solid var(--border);
  color: var(--text);
}

.dial-label { font-size: 0.8rem; font-weight: 600; color: var(--text); }
.dial-score { font-weight: 700; color: var(--accent); }

.modal-fears-section {
  margin-bottom: 1.25rem;
}

.modal-fears-section h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 0.45rem;
  font-weight: 700;
  color: var(--text);
}

.modal-fears-intro {
  margin: 0 0 0.65rem;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.modal-fears-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-bottom: 0.75rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.modal-fears-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.55rem;
  margin-bottom: 0;
}

.fear-cell {
  padding: 0.65rem 0.8rem;
  border-radius: 8px;
  font-size: 0.8rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  background: #f8fafc;
  border: 1px solid var(--border);
  color: var(--text);
}

.fear-cell__text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.fear-cell__name {
  font-weight: 700;
  font-size: 0.82rem;
  line-height: 1.3;
}

.fear-cell__desc {
  font-size: 0.76rem;
  line-height: 1.4;
  color: var(--text-muted);
}

.fear-value {
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  color: var(--text);
  flex-shrink: 0;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  background: #fff;
  border: 1px solid var(--border);
}

.fear-value--yes { color: #b42318; border-color: #fecdca; background: #fef3f2; }
.fear-value--partial { color: #b54708; border-color: #fedf89; background: #fffaeb; }
.fear-value--no { color: #027a48; border-color: #abefc6; background: #ecfdf3; }

.fear-cell--learning { border-left: 3px solid var(--learning); background: #f0fdfa; }
.fear-cell--morality { border-left: 3px solid var(--morality); background: #f5f3ff; }
.fear-cell--health { border-left: 3px solid var(--health); background: #fef2f2; }
.fear-cell--order { border-left: 3px solid var(--order); background: #fffbeb; }

.modal-impact { margin-bottom: 1rem; }

.modal-impact h3 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 0.5rem;
  font-weight: 600;
}

.modal-impact--positive h3 { color: var(--success); }
.modal-impact--negative h3 { color: var(--danger); }

.modal-impact p {
  margin: 0;
  font-size: 0.9rem;
  background: #f8fafc;
  padding: 0.85rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  line-height: 1.55;
  color: var(--text);
}

.modal-notes {
  background: #f8fafc;
  border: 1px solid var(--border);
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.modal-notes h3, .modal-refs h3 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 0.5rem;
}

.modal-notes p { margin: 0; font-size: 0.9rem; color: var(--text-secondary); }

.ref-badges { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.ref-badge {
  display: inline-block;
  padding: 0.3rem 0.65rem;
  background: #ffffff;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-size: 0.78rem;
  color: var(--accent);
  text-decoration: none;
}

.ref-badge:hover {
  background: var(--accent-dim);
  border-color: var(--accent);
}

#modal-comments { margin-top: 1.25rem; }

/* References page */
.refs-page .refs-main {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 2rem 4rem;
}

.refs-toolbar { margin-bottom: 2rem; }

#ref-search {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 1rem;
  background: #ffffff;
  color: var(--text);
}

#ref-search:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.ref-count { margin: 0.5rem 0 0; font-size: 0.9rem; color: var(--text-muted); }

.refs-list {
  list-style: none;
  padding: 0;
  margin: 0 0 3rem;
}

.refs-list li {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem 1.15rem 3.25rem;
  margin-bottom: 0.65rem;
  position: relative;
  font-size: 0.9rem;
  line-height: 1.55;
  scroll-margin-top: 6rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  counter-increment: refs;
}

.refs-list { counter-reset: refs; }

.refs-list li::before {
  content: counter(refs);
  position: absolute;
  left: 1rem;
  top: 1.15rem;
  width: 1.6rem;
  height: 1.6rem;
  background: var(--accent);
  color: #fff;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
}

.refs-list li.highlight {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.ref-link {
  color: inherit;
  text-decoration: none;
}

.ref-link:hover { color: var(--accent); }

.ref-external { color: var(--accent); font-size: 0.85em; }

.refs-usage {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
}

.refs-usage h2 {
  font-size: 1.1rem;
  margin: 0 0 0.75rem;
}

.tech-ref-map { margin-top: 1rem; }

.tech-ref-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 0.85rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.tech-ref-row strong { min-width: 130px; }
.tech-ref-row a { color: var(--accent); text-decoration: none; font-size: 0.8rem; }
.tech-ref-row a:hover { text-decoration: underline; }

/* Footer */
.site-footer {
  text-align: center;
  padding: 2rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.9rem;
}

.site-footer a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.site-footer a:hover { text-decoration: underline; }

/* Responsive */
@media (max-width: 768px) {
  .nav { padding: 1rem; }
  main { padding: 0 1rem 3rem; }
  .controls { margin: 0 -1rem 1.5rem; padding-left: 1rem; padding-right: 1rem; }
  .timeline-scroll-outer { margin: 0 -1rem; }
  .timeline-scroll { padding: 1.5rem 1.25rem 2.5rem; }
  .modal-fears-grid { grid-template-columns: 1fr; }
  .tech-node { width: 110px; }
  .tech-node__icon-wrap { width: 46px; height: 46px; }
  .tech-node__name { font-size: 0.8rem; }
  .panic-grid__figure { width: 100%; }
  .panic-grid__annotation { font-size: 10px; }
  .panic-fork__branch::before {
    display: none;
  }
  .panic-fork__branches {
    grid-template-columns: 1fr;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
  }
  .panic-fork__connector--fork {
    width: 2px;
    height: 28px;
  }
  .panic-fork__connector--fork::before,
  .panic-fork__connector--fork::after {
    display: none;
  }
  .sub-gradient__layout {
    grid-template-columns: 1fr;
  }
  .sub-gradient__figure {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
  }
  .sub-gradient__y-label {
    writing-mode: horizontal-tb;
    transform: none;
    grid-column: 1;
    grid-row: 1;
    padding-bottom: 0;
    margin-bottom: 0.25rem;
  }
  .sub-gradient__plot-wrap {
    grid-column: 1;
    grid-row: 2;
  }
  .sub-gradient__x-label {
    grid-column: 1;
    grid-row: 3;
    margin-left: 0;
  }
  .sub-gradient__plot {
    height: auto;
    min-height: 280px;
  }
  .sub-gradient__steps {
    grid-template-columns: repeat(2, 1fr);
    height: auto;
    gap: 0.75rem;
    padding: 0.5rem 0;
  }
  .sub-gradient__step {
    height: auto;
    min-height: 108px;
  }
  .sub-gradient__step-inner {
    font-size: 0.8125rem;
  }
  .sub-gradient__extras {
    display: none;
  }
  .paired-fates__pair {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  .paired-fates__divider {
    flex-direction: row;
    min-width: 0;
    padding: 0.25rem 0;
  }
  .paired-fates__divider-line {
    width: auto;
    height: 2px;
    flex: 1;
    min-height: 0;
  }
  .paired-fates__divider-label {
    max-width: none;
    white-space: nowrap;
    padding: 0 0.5rem;
  }
  .primer-grid {
    grid-template-columns: 1fr;
  }
  .primer-vars__row {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }
  .primer-engines li {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }
  .panic-flow__stages {
    flex-direction: column;
    gap: 0;
  }
  .panic-flow__stage {
    flex: none;
    width: 100%;
  }
  .panic-flow__arrow {
    padding: 0.35rem 0;
  }
  .panic-flow__arrow-icon {
    transform: rotate(90deg);
    display: inline-block;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
  .timeline-scroll-hint__icon { animation: none; opacity: 0.7; }
}
