:root {
  --bg: #faf6ef;
  --ink: #2c2416;
  --muted: #6b5f4f;
  --paper: var(--bg);
  --panel: #fffdf8;
  --border: #ddd3c4;
  --accent: #8b4513;
  --accent-hover: #6d3610;
  --accent-warm: #8b6914;
  --canvas: #f0ebe0;
  --link: #3d5a80;
  --link-hover: #2c4360;
  --text: var(--ink);
  --chrome-font: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --reading-font: Georgia, "Times New Roman", serif;
  --hud-glow: transparent;
  --input-bg: #fff;
  --btn-surface: #fff;
  --btn-text: #fff;
  --reading-ink: var(--ink);
}

/* Explorer: command-surface HUD (Iron Man–inspired, original artwork) */
.explore-body {
  --bg: #060a10;
  --ink: #dce8f0;
  --muted: #7a9aad;
  --paper: var(--bg);
  --panel: #0a101c;
  --border: rgba(77, 208, 225, 0.28);
  --accent: #4dd0e1;
  --accent-hover: #80deea;
  --accent-warm: #e8a838;
  --canvas: #050810;
  --link: #5ec8e8;
  --link-hover: #8ae0f5;
  --text: var(--ink);
  --chrome-font: "JetBrains Mono", "SF Mono", "Consolas", "Liberation Mono", monospace;
  --reading-font: Georgia, "Times New Roman", serif;
  --hud-glow: rgba(77, 208, 225, 0.14);
  --input-bg: rgba(6, 10, 16, 0.72);
  --btn-surface: rgba(8, 14, 24, 0.82);
  --btn-text: #060a10;
  --reading-ink: #e8eef2;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--chrome-font);
  font-size: 15px;
  line-height: 1.5;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
}

.wrap {
  max-width: 42rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--accent-hover);
}

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

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

.hint, .empty, .estimate-note, .edition-label {
  color: var(--muted);
  font-size: 0.95rem;
}

.search-form {
  display: flex;
  gap: 0.5rem;
}

.search-form input[type="search"] {
  flex: 1;
  font: inherit;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--input-bg);
  color: var(--ink);
  min-width: 0;
}

.search-form input[type="search"]::placeholder {
  color: var(--muted);
}

.search-form button {
  font: inherit;
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--accent);
  border-radius: 4px;
  background: var(--accent);
  color: var(--btn-text);
  cursor: pointer;
  font-family: var(--chrome-font);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.search-form button:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  box-shadow: 0 0 12px var(--hud-glow);
}

/* Graph explorer layout */
.explore-body {
  overflow: hidden;
}

.explore-app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  width: 100%;
  max-width: 100vw;
  overflow: hidden;
}

.explore-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  box-shadow: inset 0 -1px 0 var(--hud-glow);
  flex-shrink: 0;
}

.explore-header .site-title {
  font-family: var(--chrome-font);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.explore-header .site-title:hover {
  color: var(--accent);
}

.explore-header .header-link {
  font-family: var(--chrome-font);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  margin-left: auto;
}

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

.explore-search {
  flex: 1;
  max-width: 28rem;
}

.explore-nav {
  display: flex;
  gap: 0.25rem;
}

.nav-btn {
  font: inherit;
  font-family: var(--chrome-font);
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--btn-surface);
  color: var(--ink);
  cursor: pointer;
}

.nav-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 10px var(--hud-glow);
}

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

.explore-main {
  display: flex;
  flex: 1;
  min-height: 0;
  min-width: 0;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.left-rail,
.right-rail {
  width: min(14rem, 22vw);
  background: var(--panel);
  box-shadow: inset 0 0 0 1px var(--hud-glow), inset 0 1px 0 rgba(77, 208, 225, 0.06);
  border-color: var(--border);
  border-style: solid;
  overflow-x: hidden;
  overflow-y: auto;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 2;
  min-height: 0;
}

.left-rail {
  border-right-width: 1px;
}

.right-rail {
  width: min(18rem, 26vw);
  border-left-width: 1px;
}

.left-rail.rail-collapsed,
.right-rail.rail-collapsed {
  display: none;
}

.rail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.rail-title {
  font-family: var(--chrome-font);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0;
}

.rail-toggle {
  font: inherit;
  font-family: var(--chrome-font);
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--btn-surface);
  color: var(--muted);
  cursor: pointer;
  width: 1.6rem;
  height: 1.6rem;
  line-height: 1;
  padding: 0;
}

.rail-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 8px var(--hud-glow);
}

.rail-section {
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid var(--border);
}

.rail-section-title {
  font-family: var(--chrome-font);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin: 0 0 0.5rem;
}

.rail-collapsible {
  margin: 0;
}

.rail-collapsible > summary {
  list-style: none;
  cursor: pointer;
  margin: 0 0 0.5rem;
  user-select: none;
}

.rail-collapsible > summary::-webkit-details-marker {
  display: none;
}

.rail-collapsible > summary::before {
  content: "▸ ";
  font-size: 0.7rem;
  color: var(--muted);
}

.rail-collapsible[open] > summary::before {
  content: "▾ ";
}

.rail-collapsible[open] > summary {
  margin-bottom: 0.5rem;
}

.rail-collapsible:not([open]) > summary {
  margin-bottom: 0;
}

.menu-actions {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.menu-btn {
  font: inherit;
  font-family: var(--chrome-font);
  font-size: 0.78rem;
  text-align: left;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--btn-surface);
  color: var(--ink);
  cursor: pointer;
}

.menu-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 10px var(--hud-glow);
}

.filter-list {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.filter-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.88rem;
  cursor: pointer;
}

.filter-item input {
  accent-color: var(--accent);
}

.filter-input {
  width: 100%;
  font: inherit;
  font-family: var(--chrome-font);
  font-size: 0.78rem;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--input-bg);
  color: var(--ink);
}

.filter-input::placeholder {
  color: var(--muted);
}

.graph-settings {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-family: var(--chrome-font);
}

.setting-row {
  display: block;
  color: var(--ink);
}

.setting-check {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
}

.setting-input {
  width: 100%;
  font: inherit;
  font-family: var(--chrome-font);
  font-size: 0.78rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--input-bg);
  color: var(--ink);
}

.setting-range {
  width: 100%;
  accent-color: var(--accent);
}

.setting-value {
  color: var(--muted);
  font-size: 0.82rem;
}

.graph-legend {
  font-size: 0.72rem;
  font-family: var(--chrome-font);
}

.legend-group + .legend-group {
  margin-top: 0.5rem;
}

.legend-heading {
  margin: 0 0 0.25rem;
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: normal;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.legend-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.legend-list li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.12rem 0;
}

.legend-swatch {
  display: inline-block;
  flex-shrink: 0;
}

.legend-swatch-node {
  width: 0.75rem;
  height: 0.75rem;
  border: 2px solid;
  border-radius: 50%;
}

.legend-swatch-edge {
  width: 1.1rem;
  height: 0.18rem;
  border-radius: 1px;
}

.legend-swatch-edge.dashed {
  background: repeating-linear-gradient(
    90deg,
    currentColor 0 3px,
    transparent 3px 5px
  ) !important;
  background-color: transparent !important;
  color: inherit;
}

.graph-truncation-note {
  margin: 0;
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  font-family: var(--chrome-font);
  color: var(--muted);
  background: rgba(232, 168, 56, 0.08);
  border-bottom: 1px solid var(--border);
}

.graph-truncation-note.hidden {
  display: none;
}

.center-column {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  position: relative;
  z-index: 0;
  isolation: isolate;
}

.graph-viewport {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  outline: none;
  overflow: hidden;
  position: relative;
  isolation: isolate;
  transition: opacity 0.28s ease;
}

.graph-viewport.lens-switching {
  opacity: 0.72;
}

.graph-hud-carousel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  max-height: 7.5rem;
  padding: 0.35rem 0.55rem 0.5rem;
  pointer-events: none;
  background: linear-gradient(to top, rgba(6, 10, 16, 0.94) 35%, rgba(6, 10, 16, 0.55) 70%, transparent);
}

.graph-hud-carousel-track {
  display: flex;
  flex: 1 1 auto;
  gap: 0.45rem;
  overflow-x: auto;
  overflow-y: hidden;
  align-items: stretch;
  min-height: 5.5rem;
  max-height: 6.5rem;
  pointer-events: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.graph-hud-card {
  flex: 0 0 auto;
  width: 10.5rem;
  max-width: 42vw;
  min-height: 5.25rem;
  max-height: 6.25rem;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--panel);
  box-shadow: 0 0 12px rgba(77, 208, 225, 0.08), inset 0 0 10px rgba(77, 208, 225, 0.04);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.graph-hud-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 14px var(--hud-glow);
}

.graph-hud-card-focus {
  border-color: var(--accent-warm);
  box-shadow: 0 0 16px rgba(232, 168, 56, 0.35), inset 0 0 12px rgba(232, 168, 56, 0.08);
}

.graph-hud-card-visited:not(.graph-hud-card-focus) {
  border-color: rgba(77, 208, 225, 0.55);
}

.graph-hud-card-type {
  font-family: var(--chrome-font);
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.graph-hud-card-title {
  font-family: var(--chrome-font);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.graph-hud-card-snippet {
  margin: 0;
  font-size: 0.66rem;
  line-height: 1.3;
  color: var(--muted);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.graph-hud-carousel-more {
  margin: 0;
  padding: 0 0.15rem;
  font-family: var(--chrome-font);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  pointer-events: none;
}

.graph-lens-strip {
  flex-shrink: 0;
  display: flex;
  gap: 0.35rem;
  padding: 0.45rem 0.65rem;
  border-top: 1px solid var(--border);
  background: var(--panel);
  box-shadow: inset 0 1px 0 var(--hud-glow);
  overflow-x: auto;
  scrollbar-width: thin;
}

.graph-lens-tab {
  flex: 1 0 auto;
  min-width: 4.5rem;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: var(--btn-surface);
  color: var(--muted);
  font-family: var(--chrome-font);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.graph-lens-tab:hover {
  color: var(--ink);
  border-color: var(--accent);
  box-shadow: 0 0 10px var(--hud-glow);
}

.graph-lens-tab-active {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(77, 208, 225, 0.1);
  box-shadow: 0 0 14px var(--hud-glow), inset 0 0 12px rgba(77, 208, 225, 0.06);
  font-weight: 600;
}

.graph-canvas-stage {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  position: relative;
  display: flex;
  flex-direction: column;
}

.graph-canvas-hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.graph-focus-hud {
  position: absolute;
  top: 0.45rem;
  left: 50%;
  transform: translateX(-50%);
  max-width: min(92%, 42rem);
  padding: 0.28rem 0.65rem;
  border: 1px solid rgba(232, 168, 56, 0.45);
  border-radius: 2px;
  background: rgba(6, 10, 16, 0.82);
  color: var(--ink);
  font-family: var(--chrome-font);
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 0 12px rgba(232, 168, 56, 0.12);
}

.graph-trail-filters {
  position: absolute;
  top: 2.35rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  justify-content: center;
  max-width: min(96%, 48rem);
  pointer-events: none;
}

.graph-trail-chip {
  pointer-events: auto;
  padding: 0.22rem 0.5rem;
  border: 1px solid rgba(232, 168, 56, 0.55);
  border-radius: 2px;
  background: rgba(232, 168, 56, 0.08);
  color: #e8c878;
  font-family: var(--chrome-font);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.graph-trail-chip-active {
  background: rgba(232, 168, 56, 0.22);
  border-color: #e8a838;
  color: #ffe6a8;
}

.graph-trail-chip-testament {
  border-color: rgba(232, 168, 56, 0.75);
}

.graph-text-stack {
  position: absolute;
  top: 0.55rem;
  left: 0.55rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  max-width: 8.5rem;
  pointer-events: none;
}

.graph-text-stack-card {
  pointer-events: auto;
  padding: 0.25rem 0.45rem;
  border: 1px solid rgba(102, 187, 106, 0.55);
  border-radius: 2px;
  background: rgba(6, 10, 16, 0.88);
  color: #9be7a0;
  font-family: var(--chrome-font);
  font-size: 0.65rem;
  text-align: left;
  cursor: pointer;
  transform: translateX(calc(var(--stack-index, 0) * 4px));
}

.graph-text-stack-card-active,
.graph-carousel-card-active {
  border-color: var(--accent);
  box-shadow: 0 0 10px var(--hud-glow);
}

.graph-time-bar {
  position: absolute;
  left: 0.65rem;
  right: 0.65rem;
  bottom: 0.55rem;
  height: 1.35rem;
  pointer-events: none;
}

.graph-time-track {
  position: relative;
  height: 100%;
  border-top: 2px solid rgba(232, 168, 56, 0.65);
}

.graph-time-tick {
  position: absolute;
  top: -0.35rem;
  width: 2px;
  height: 0.65rem;
  background: rgba(232, 168, 56, 0.85);
  transform: translateX(-50%);
}

.graph-time-tick-label {
  position: absolute;
  top: 0.75rem;
  transform: translateX(-50%);
  font-size: 0.58rem;
  color: var(--muted);
  white-space: nowrap;
}

.graph-places-lead {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.graph-places-lead-line {
  position: absolute;
  height: 2px;
  background: linear-gradient(90deg, rgba(232, 168, 56, 0.85), rgba(232, 168, 56, 0.05));
  transform-origin: left center;
  box-shadow: 0 0 8px rgba(232, 168, 56, 0.35);
}

.graph-places-lead-target {
  position: absolute;
  right: 0;
  top: 50%;
  width: 0.65rem;
  height: 0.65rem;
  border: 2px solid rgba(232, 168, 56, 0.9);
  border-radius: 50%;
  transform: translateY(-50%);
  box-shadow: 0 0 10px rgba(232, 168, 56, 0.45);
}

.graph-carousel {
  flex-shrink: 0;
  display: flex;
  gap: 0.35rem;
  padding: 0.4rem 0.65rem;
  border-top: 1px solid var(--border);
  background: rgba(8, 12, 20, 0.94);
  overflow-x: auto;
  scrollbar-width: thin;
  pointer-events: auto;
}

.graph-carousel-card {
  flex: 0 0 auto;
  min-width: 5.5rem;
  max-width: 10rem;
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: var(--btn-surface);
  color: var(--ink);
  font-family: var(--chrome-font);
  font-size: 0.68rem;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.graph-carousel-card-type {
  display: block;
  font-size: 0.58rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.graph-canvas-stage .graph-canvas {
  flex: 1 1 auto;
}

.right-rail.map-highlight-pulse #dynamic-window {
  box-shadow: inset 0 0 0 2px rgba(232, 168, 56, 0.55);
}

.graph-canvas {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  width: 100%;
  background: var(--canvas);
  background-image:
    linear-gradient(rgba(77, 208, 225, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(77, 208, 225, 0.04) 1px, transparent 1px);
  background-size: 32px 32px;
  position: relative;
  overflow: hidden;
  contain: layout paint;
}

.graph-canvas.graph-canvas-3d {
  background: var(--canvas);
  background-image:
    radial-gradient(circle at 50% 45%, rgba(77, 208, 225, 0.08), transparent 55%),
    radial-gradient(circle at 1px 1px, rgba(77, 208, 225, 0.06) 1px, transparent 0);
  background-size: 100% 100%, 28px 28px;
}

.graph-canvas.graph-canvas-3d canvas {
  outline: none;
}

.graph-canvas canvas {
  display: block;
}

.rail-detail-section {
  flex-shrink: 0;
  border-top: 1px solid var(--border);
  background: var(--panel);
  display: flex;
  flex-direction: column;
}

.dynamic-window-header {
  padding: 0.45rem 0.85rem;
  border-bottom: 1px solid var(--border);
}

.dynamic-window-title {
  font-family: var(--chrome-font);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin: 0;
}

.dynamic-window.hidden {
  display: none;
}

.timeline-section-header {
  padding: 0.45rem 0.85rem;
  border-bottom: 1px solid var(--border);
}

.timeline-section-title {
  font-family: var(--chrome-font);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin: 0;
}

.timeline-body {
  padding: 0.65rem 0.85rem 0.85rem;
  overflow: auto;
}

.timeline-estimate-note {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
}

.timeline-axis-bar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.35rem;
}

.timeline-axis-end {
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
}

.timeline-axis-track {
  position: relative;
  height: 0.55rem;
  border-radius: 999px;
  background: rgba(77, 208, 225, 0.08);
  border: 1px solid var(--border);
  overflow: hidden;
}

.timeline-span {
  position: absolute;
  top: 0;
  bottom: 0;
  min-width: 2px;
  border-radius: 999px;
  background: #4dd0e1;
  opacity: 0.85;
  box-shadow: 0 0 8px rgba(77, 208, 225, 0.45);
}

.timeline-span-static {
  background: #7eb8d4;
}

.timeline-list {
  list-style: none;
  padding: 0;
  margin: 0.65rem 0 0;
  max-height: 14rem;
  overflow-y: auto;
}

.timeline-list-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.28rem 0;
  border-bottom: 1px solid rgba(77, 208, 225, 0.12);
  font-size: 0.82rem;
  font-family: var(--chrome-font);
}

.timeline-list-item:last-child {
  border-bottom: none;
}

.timeline-list-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
  font: inherit;
  color: var(--ink);
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
}

.timeline-list-name:hover {
  color: var(--accent);
}

.timeline-list-name-static {
  cursor: default;
}

.timeline-list-name-static:hover {
  color: var(--ink);
}

.timeline-list-range {
  flex: 0 0 auto;
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
}

.timeline-list-item-selected .timeline-list-name {
  font-weight: 600;
  color: var(--accent-warm);
}

.dynamic-window-body {
  padding: 0.85rem 1rem;
  overflow: auto;
}

.reading-pane {
  max-width: none;
}

.reading-ref {
  font-size: 1.1rem;
  margin: 0 0 0.35rem;
  color: var(--muted);
}

.reading-meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0.25rem 0;
}

.reading-text {
  margin: 0.75rem 0 0.5rem;
  padding: 0 0 0 1rem;
  border-left: 4px solid var(--accent-warm);
  font-family: var(--reading-font);
  font-size: 1.35rem;
  line-height: 1.55;
  color: var(--reading-ink);
}

.reading-list {
  list-style: none;
  padding: 0;
  margin: 0.35rem 0 0;
}

.reading-list li {
  padding: 0.2rem 0;
}

.reading-tree {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0;
}

.reading-tree[data-depth="0"] {
  margin-top: 0.75rem;
}

.reading-tree-item {
  margin: 0.1rem 0;
}

.reading-tree-row {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.reading-tree-toggle,
.reading-tree-link {
  font: inherit;
  font-size: 0.92rem;
  border: none;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  padding: 0.15rem 0.1rem;
  text-align: left;
}

.reading-tree-toggle {
  width: 1.1rem;
  flex-shrink: 0;
  color: var(--muted);
}

.reading-tree-spacer {
  display: inline-block;
  width: 1.1rem;
  flex-shrink: 0;
}

.reading-tree-link:hover,
.reading-tree-toggle:hover {
  color: var(--accent);
}

.reading-tree-children {
  padding-left: 1.1rem;
}

.reading-tree-children.hidden {
  display: none;
}

.reading-tree-verse-text {
  margin: 0.35rem 0 0.5rem 1.35rem;
  font-family: var(--reading-font);
  font-size: 1.05rem;
  color: var(--reading-ink);
}

.concepts-block {
  font-size: 0.88rem;
}

.concepts-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.concepts-list li {
  padding: 0.25rem 0;
}

.concepts-subheading {
  font-size: 0.82rem;
  margin: 0.5rem 0 0.2rem;
  color: var(--muted);
}

.concepts-sublist {
  list-style: none;
  padding: 0.15rem 0 0.15rem 0.85rem;
  margin: 0;
}

.concept-link {
  display: inline;
  font: inherit;
  font-size: inherit;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: var(--border);
}

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

.easton-definition {
  font-family: var(--reading-font);
  font-size: 0.92rem;
  line-height: 1.55;
  white-space: pre-wrap;
  color: var(--reading-ink);
}

.easton-term {
  margin: 0 0 0.35rem;
}

.rail-section.hidden {
  display: none;
}

.map-embed {
  width: 100%;
  height: 12rem;
  border: 1px solid var(--border);
  border-radius: 3px;
}

.map-attribution {
  margin: 0.35rem 0 0;
}

.rail-reveal {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  font: inherit;
  font-family: var(--chrome-font);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.35rem 0.45rem;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
  writing-mode: vertical-rl;
  border-radius: 0 3px 3px 0;
  box-shadow: 0 0 12px var(--hud-glow);
}

.rail-reveal-left {
  left: 0;
}

.rail-reveal-right {
  right: 0;
  border-radius: 3px 0 0 3px;
}

.rail-reveal.hidden {
  display: none;
}

.related-list,
.suggestions-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.related-list li,
.suggestions-list li {
  padding: 0.15rem 0;
}

.related-link,
.suggestion-link {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  font-size: 0.88rem;
  padding: 0.35rem 0.45rem;
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.related-link:hover,
.suggestion-link:hover {
  border-color: var(--border);
  background: rgba(77, 208, 225, 0.08);
  box-shadow: inset 0 0 0 1px var(--hud-glow);
}

.related-static {
  display: block;
  font-size: 0.88rem;
  padding: 0.35rem 0.45rem;
  color: var(--muted);
}

.related-type {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.empty-item {
  color: var(--muted);
  font-size: 0.88rem;
  padding: 0.25rem 0;
}

.detail-panel {
  width: min(22rem, 38vw);
  border-left: 1px solid var(--border);
  background: var(--panel);
  overflow-y: auto;
  flex-shrink: 0;
}

.graph-canvas.loading::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(6, 10, 16, 0.55);
  pointer-events: none;
}

.detail-panel {
  width: min(22rem, 38vw);
  border-left: 1px solid var(--border);
  background: var(--panel);
  overflow-y: auto;
  flex-shrink: 0;
}

.panel-content {
  padding: 1rem 0.85rem 0.5rem;
}

.panel-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin: 0 0 0.65rem;
  font-size: 0.88rem;
}

.breadcrumb-sep {
  color: var(--muted);
}

.breadcrumb-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--link);
  cursor: pointer;
  font: inherit;
  font-family: var(--chrome-font);
  text-decoration: underline;
}

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

.panel-title {
  font-family: var(--reading-font);
  font-size: 1.35rem;
  margin: 0 0 0.35rem;
  line-height: 1.25;
  color: var(--reading-ink);
}

.panel-meta {
  color: var(--muted);
  font-size: 0.82rem;
  font-family: var(--chrome-font);
  margin: 0.25rem 0;
}

.panel-text {
  margin: 1rem 0 0.5rem;
  padding: 0 0 0 0.85rem;
  border-left: 3px solid var(--accent-warm);
  font-family: var(--reading-font);
  font-size: 1.05rem;
  color: var(--reading-ink);
}

.panel-section {
  margin-top: 1.25rem;
}

.panel-section h2 {
  font-family: var(--chrome-font);
  font-size: 0.72rem;
  margin: 0 0 0.35rem;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.2rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.panel-section ul {
  list-style: none;
  padding: 0;
  margin: 0.35rem 0 0;
}

.panel-section li {
  padding: 0.2rem 0;
}

.panel-hint {
  color: var(--muted);
  font-size: 0.95rem;
}

.map-link {
  font-size: 0.85rem;
}

.explore-footer {
  padding: 0.45rem 1rem;
  border-top: 1px solid var(--border);
  background: var(--panel);
  flex-shrink: 0;
}

.explore-footer p {
  margin: 0;
  color: var(--muted);
  font-family: var(--chrome-font);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
}

.search-results-banner {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  max-height: 30vh;
  overflow-y: auto;
}

.search-results-banner h2 {
  font-size: 0.95rem;
  margin: 0.75rem 0 0.25rem;
  color: var(--muted);
}

.search-results-banner ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.search-results-banner li {
  padding: 0.15rem 0;
}

@media (max-width: 900px) {
  .explore-main {
    flex-direction: column;
  }

  .left-rail,
  .right-rail {
    width: 100%;
    max-height: 28vh;
    border-left: none;
    border-right: none;
    overflow-y: auto;
  }

  .left-rail {
    border-bottom: 1px solid var(--border);
    order: 2;
  }

  .center-column {
    order: 1;
    min-height: 58vh;
  }

  .graph-viewport {
    min-height: 48vh;
  }

  .graph-canvas {
    min-height: 42vh;
    touch-action: pan-x pan-y pinch-zoom;
  }

  .graph-hud-carousel {
    max-height: 6.75rem;
    padding: 0.3rem 0.45rem 0.4rem;
  }

  .graph-hud-carousel-track {
    min-height: 4.75rem;
    max-height: 5.75rem;
  }

  .graph-hud-card {
    width: 9.5rem;
    min-height: 4.5rem;
    max-height: 5.5rem;
  }

  .graph-lens-strip {
    position: sticky;
    bottom: 0;
    z-index: 2;
    padding: 0.55rem 0.5rem;
    gap: 0.45rem;
  }

  .graph-lens-tab {
    min-width: 5.25rem;
    min-height: 2.35rem;
    font-size: 0.82rem;
  }

  .right-rail {
    border-top: 1px solid var(--border);
    order: 3;
    max-height: none;
  }

  .rail-reveal {
    top: auto;
    bottom: 4.5rem;
    transform: none;
  }

  #show-left-rail.rail-reveal {
    left: 0.5rem;
  }

  #show-right-rail.rail-reveal {
    right: 0.5rem;
  }

  .explore-header {
    flex-wrap: wrap;
  }

  .explore-search {
    order: 3;
    flex: 1 1 100%;
    max-width: none;
  }
}

/* Not-found page: one problem line, one next step (search), one fallback link. */
.not-found-body .explore-header {
  gap: 1rem;
}

.not-found {
  max-width: 34rem;
  margin: 12vh auto 0;
  padding: 0 1.25rem;
}

.not-found h1 {
  font-family: var(--chrome-font);
  font-size: 1.25rem;
  letter-spacing: 0.04em;
  margin: 0 0 0.6rem;
}

.not-found p {
  color: var(--muted);
  margin: 0 0 1.25rem;
  line-height: 1.6;
}

.not-found .not-found-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: center;
}

.not-found .search-form {
  flex: 1 1 18rem;
}

.not-found .secondary-link {
  color: var(--link);
  font-size: 0.85rem;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
