:root {
  --bg-deep: #070b14;
  --bg-panel: #0d1322;
  --bg-panel-elevated: #131c31;
  --bg-glass: rgba(13, 19, 34, 0.88);
  --border-subtle: rgba(148, 163, 184, 0.14);
  --border-highlight: rgba(245, 158, 11, 0.45);

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-gold: #f59e0b;
  --accent-gold-bright: #fbbf24;
  --accent-sky: #38bdf8;
  --accent-emerald: #10b981;
  --accent-crimson: #ef4444;
  --accent-purple: #a855f7;

  --font-display: 'Cinzel', Georgia, serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-serif: 'Merriweather', Georgia, serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-deep);
  color: var(--text-primary);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

body {
  height: 100dvh;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* =========================================================
   TOP GAMIFIED HUD HEADER
   ========================================================= */
.hud-header {
  grid-row: 1;
  height: 64px;
  background: linear-gradient(180deg, #0f172a 0%, #090e1a 100%);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  gap: 24px;
  z-index: 100;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.brand-emblem {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: radial-gradient(circle at 30% 30%, #fbbf24, #b45309);
  color: #090d16;
  font-weight: 800;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 18px rgba(245, 158, 11, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.brand-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #ffffff;
}

.brand-subtitle {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent-gold-bright);
  letter-spacing: 0.1em;
}

/* THE HOUR TENSION METER */
.hour-hud-widget {
  flex: 1;
  max-width: 460px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 7px 14px;
}

.hour-hud-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.hour-hud-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-secondary);
  letter-spacing: 0.06em;
}

.hour-status-pill {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 99px;
}

.hour-status-pill.preparation {
  background: rgba(56, 189, 248, 0.15);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.hour-status-pill.not-yet {
  background: rgba(14, 165, 233, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(14, 165, 233, 0.4);
}

.hour-status-pill.rising-tension {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.45);
}

.hour-status-pill.has-come {
  background: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.6);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.4);
}

.hour-status-pill.glorified {
  background: rgba(168, 85, 247, 0.25);
  color: #e9d5ff;
  border: 1px solid rgba(168, 85, 247, 0.55);
}

.hour-meter-track {
  position: relative;
  height: 6px;
  background: #1e293b;
  border-radius: 99px;
  overflow: visible;
}

.hour-meter-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #38bdf8 0%, #f59e0b 70%, #ef4444 100%);
  transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}

.hour-threshold-marker {
  position: absolute;
  top: -3px;
  width: 3px;
  height: 12px;
  background: #ef4444;
  border-radius: 2px;
  box-shadow: 0 0 6px #ef4444;
}

/* TELEMETRY STATS */
.telemetry-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.stat-box {
  background: rgba(19, 28, 49, 0.9);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 5px 12px;
  display: flex;
  flex-direction: column;
  min-width: 105px;
}

.stat-label {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-gold-bright);
}

.stat-value small {
  font-size: 10px;
  color: var(--text-secondary);
}

/* =========================================================
   3-COLUMN WORKSPACE
   ========================================================= */
.workspace {
  grid-row: 3;
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr) 430px;
  min-height: 0;
  width: 100%;
}

/* =========================================================
   LEFT RAIL: QUEST LOG / CHRONICLE STREAM
   ========================================================= */
.quest-sidebar {
  background: var(--bg-panel);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.sidebar-header {
  padding: 14px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(7, 11, 20, 0.5);
}

.sidebar-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.sidebar-title-row h2 {
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--text-primary);
}

.event-count-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent-sky);
  padding: 2px 8px;
  border-radius: 99px;
}

.search-box input {
  width: 100%;
  background: #070b14;
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 12px;
  padding: 8px 10px;
  border-radius: 7px;
  outline: none;
  margin-bottom: 10px;
  transition: border-color 0.2s;
}

.search-box input:focus {
  border-color: var(--accent-sky);
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.filter-pill {
  background: #131c31;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.filter-pill:hover {
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.25);
}

.filter-pill.active {
  background: rgba(245, 158, 11, 0.2);
  color: var(--accent-gold-bright);
  border-color: var(--accent-gold);
}

.event-tree {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
}

.act-group {
  margin-bottom: 14px;
}

.act-group-header {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.03);
  border-left: 3px solid var(--accent-sky);
  border-radius: 0 4px 4px 0;
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
}

.quest-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
  margin-bottom: 3px;
  position: relative;
}

.quest-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.quest-item.visited {
  opacity: 0.92;
}

.quest-item.unvisited {
  opacity: 0.5;
}

.quest-item.active {
  opacity: 1;
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.16) 0%, rgba(19, 28, 49, 0.6) 100%);
  border-color: var(--border-highlight);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

.quest-order-num {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: #1e293b;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.quest-item.active .quest-order-num {
  background: var(--accent-gold);
  color: #090d16;
}

.quest-item-content {
  flex: 1;
  min-width: 0;
}

.quest-item-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
  margin-bottom: 3px;
}

.quest-item-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.mini-badge {
  font-family: var(--font-mono);
  font-size: 9.5px;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
}

.mini-badge.hour-badge {
  background: rgba(245, 158, 11, 0.16);
  color: var(--accent-gold-bright);
}

.mini-badge.climax-badge {
  background: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
}

/* =========================================================
   CENTER STAGE: INTERACTIVE MAP & CLEAN DOCKED TOOLBARS
   ========================================================= */
.map-stage {
  min-width: 0;
  min-height: 0;
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #060a12;
  overflow-y: auto;
}

.map-toolbar {
  min-height: 40px;
  height: auto;
  background: #0b111e;
  border-bottom: 1px solid var(--border-subtle);
  padding: 6px 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  z-index: 25;
  flex-shrink: 0;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 5px;
}

.toolbar-label {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--text-muted);
  margin-right: 3px;
}

.toolbar-divider {
  width: 1px;
  height: 18px;
  background: var(--border-subtle);
}

.leaflet-map-canvas {
  flex: 1;
  min-height: 0;
  width: 100%;
  z-index: 1;
  background: radial-gradient(circle at 50% 50%, #0c192c 0%, #07101e 100%);
}

/* Compact Docked Location Strip above Timeline */
.map-location-pill-bar {
  background: rgba(11, 17, 30, 0.94);
  border-top: 1px solid var(--border-subtle);
  padding: 6px 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 20;
  flex-shrink: 0;
}

.loc-pill-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--accent-gold-bright);
  min-width: 0;
  flex-wrap: wrap;
}

.loc-pin-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-gold-bright);
  box-shadow: 0 0 8px var(--accent-gold);
}

.loc-pill-ancient {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-secondary);
}

.loc-visit-chips {
  display: flex;
  align-items: center;
  gap: 5px;
  overflow-x: auto;
}

.visit-chip {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 5px;
  background: #131c31;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}

.visit-chip:hover {
  border-color: var(--accent-sky);
  color: #ffffff;
}

.visit-chip.active {
  background: rgba(245, 158, 11, 0.22);
  border-color: var(--accent-gold);
  color: var(--accent-gold-bright);
  font-weight: 600;
}

.hud-btn {
  background: #151f36;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 10.5px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 5px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}

.hud-btn:hover {
  color: #ffffff;
  background: #1e293b;
}

.hud-btn.active {
  background: var(--accent-sky);
  color: #06101e;
  border-color: var(--accent-sky);
  font-weight: 600;
}

.fog-toggle {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
}

/* Custom Map Markers */
.atlas-node {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.atlas-node-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #38bdf8;
  border: 2px solid #ffffff;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.8);
}

.atlas-node.unvisited .atlas-node-dot {
  background: #475569;
  border-color: #94a3b8;
  box-shadow: none;
  opacity: 0.45;
}

.atlas-node.active-node .atlas-node-dot {
  width: 18px;
  height: 18px;
  background: #fbbf24;
  border: 3px solid #ffffff;
  box-shadow: 0 0 22px #f59e0b, 0 0 40px #ef4444;
}

.atlas-pulse-ring {
  position: absolute;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid #fbbf24;
  animation: pulseRing 1.8s infinite ease-out;
  pointer-events: none;
}

@keyframes pulseRing {
  0% { transform: scale(0.4); opacity: 1; }
  100% { transform: scale(1.6); opacity: 0; }
}

.leaflet-tooltip.atlas-label {
  background: rgba(9, 14, 26, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.28);
  color: #e2e8f0;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 5px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.leaflet-tooltip.atlas-label.active-label {
  background: rgba(245, 158, 11, 0.95);
  color: #070b14;
  border-color: #ffffff;
  font-weight: 700;
}

/* =========================================================
   1ST-CENTURY BIBLICAL OVERLAY STYLING (HIGH CONTRAST)
   ========================================================= */
.biblical-region-marker {
  pointer-events: none;
}

.region-label-box {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.region-title {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.28em;
  color: rgba(251, 191, 36, 0.65);
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.95);
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.biblical-water-marker {
  pointer-events: none;
}

.water-label-text {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 10.5px;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: rgba(125, 211, 252, 0.85);
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.95);
  background: transparent;
  border: none;
  padding: 0;
  box-shadow: none;
  text-align: center;
  display: inline-block;
}

.jerusalem-landmark-label {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #fde68a;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(245, 158, 11, 0.45);
  padding: 1px 6px;
  border-radius: 4px;
  display: inline-block;
  white-space: nowrap;
}

.leaflet-tooltip.road-label {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(217, 119, 6, 0.5);
  color: #fcd34d;
  font-family: var(--font-mono);
  font-size: 10px;
}
.map-scripture-container {
  pointer-events: auto;
  cursor: pointer;
}

.map-scripture-anchor {
  display: flex;
  flex-direction: column;
  align-items: center;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.65));
  animation: floatUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes floatUp {
  0% { transform: translateY(12px) scale(0.9); opacity: 0; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

.map-scripture-bubble {
  background: rgba(13, 19, 34, 0.94);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(245, 158, 11, 0.6);
  border-radius: 10px;
  padding: 8px 11px;
  width: 250px;
  color: #f1f5f9;
  text-align: left;
}

.map-scripture-loc-title {
  font-family: var(--font-display);
  font-size: 11.5px;
  font-weight: 700;
  color: #ffffff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding-bottom: 4px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.bubble-close-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  padding: 0 3px;
  border-radius: 4px;
}

.bubble-close-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.15);
}

.map-scripture-bubble-ref {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  color: var(--accent-gold-bright);
  margin-bottom: 3px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.map-scripture-bubble-text {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 11px;
  line-height: 1.45;
  color: #e2e8f0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.map-scripture-pointer {
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 8px solid rgba(245, 158, 11, 0.85);
  margin-top: -1px;
}

/* =========================================================
   BOTTOM TIMELINE DOCK
   ========================================================= */
.timeline-dock {
  background: #0b111e;
  border-top: 1px solid var(--border-subtle);
  padding: 10px 18px 12px;
  z-index: 30;
}

.act-ribbon {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 10px;
}

.act-segment {
  background: #131c31;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 4px 8px;
  cursor: pointer;
  transition: all 0.15s;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.act-segment:hover {
  background: #1e293b;
}

.act-segment.active {
  background: rgba(245, 158, 11, 0.18);
  border-color: var(--accent-gold);
}

.act-seg-num {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  color: var(--accent-gold-bright);
  margin-right: 4px;
}

.act-seg-title {
  font-size: 10.5px;
  color: var(--text-secondary);
}

.act-segment.active .act-seg-title {
  color: #ffffff;
  font-weight: 600;
}

.scrubber-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.transport-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.transport-btn {
  background: #151f36;
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  height: 34px;
  padding: 0 11px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
}

.transport-btn:hover {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.3);
}

.transport-btn.play-btn {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #070b14;
  border: none;
  padding: 0 14px;
}

.transport-btn.play-btn:hover {
  filter: brightness(1.1);
}

.slider-wrapper {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}

.journey-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 99px;
  background: linear-gradient(
    90deg,
    #38bdf8 0%,
    #0ea5e9 25%,
    #10b981 52%,
    #f59e0b 75%,
    #ef4444 82%,
    #a855f7 100%
  );
  outline: none;
  cursor: pointer;
  z-index: 2;
}

.journey-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ffffff;
  border: 4px solid #f59e0b;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.9);
  cursor: grab;
  transition: transform 0.12s;
}

.journey-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.step-counter-box {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  min-width: 135px;
  flex-shrink: 0;
}

.step-num {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-gold-bright);
}

.step-date {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-secondary);
}

/* =========================================================
   RIGHT DOCK: HIGH-VOLUME SCRIPTURE & HARMONY CODEX
   ========================================================= */
.codex-panel {
  background: var(--bg-panel);
  border-left: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.codex-banner {
  padding: 18px 20px 14px;
  background: linear-gradient(180deg, #131c31 0%, #0d1322 100%);
  border-bottom: 1px solid var(--border-subtle);
}

.codex-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.act-badge {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--accent-sky);
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 2px 8px;
  border-radius: 5px;
}

.category-badge {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--accent-gold-bright);
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.35);
  padding: 2px 8px;
  border-radius: 5px;
}

.codex-event-title {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.3;
  margin-bottom: 6px;
}

.codex-time-place {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

/* THE HOUR CALLOUT BOX */
.hour-callout-box {
  background: rgba(245, 158, 11, 0.1);
  border-left: 3px solid var(--accent-gold);
  border-radius: 0 8px 8px 0;
  padding: 10px 12px;
  margin-top: 6px;
}

.hour-callout-box.climax {
  background: rgba(239, 68, 68, 0.15);
  border-left-color: #ef4444;
}

.hour-callout-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-gold-bright);
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}

.hour-callout-box.climax .hour-callout-header {
  color: #fca5a5;
}

.hour-callout-box blockquote {
  font-family: var(--font-serif);
  font-size: 12.5px;
  font-style: italic;
  color: #f8fafc;
  line-height: 1.5;
}

/* CODEX SCROLLABLE BODY */
.codex-scroll-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px 32px;
}

.codex-section {
  margin-bottom: 22px;
}

.codex-section-heading {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  margin-bottom: 10px;
  text-transform: uppercase;
}

.codex-summary-text {
  font-size: 13.5px;
  line-height: 1.65;
  color: #e2e8f0;
  margin-bottom: 12px;
}

.historical-note-card {
  background: #11192c;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  padding: 11px 13px;
}

.hist-note-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-sky);
  margin-bottom: 4px;
}

.historical-note-card p {
  font-size: 12.5px;
  line-height: 1.55;
  color: #cbd5e1;
}

/* RELATED / DUAL EVENTS */
.related-cards-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.related-event-btn {
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 8px;
  padding: 9px 12px;
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.15s;
}

.related-event-btn:hover {
  background: rgba(56, 189, 248, 0.18);
  border-color: var(--accent-sky);
}

.rel-btn-title {
  font-size: 12.5px;
  font-weight: 600;
  color: #bae6fd;
}

.rel-btn-sub {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-secondary);
}

/* 4-GOSPEL READER */
.reader-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.reader-view-toggle {
  display: flex;
  background: #070b14;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 2px;
}

.view-mode-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
}

.view-mode-btn.active {
  background: #1e293b;
  color: #ffffff;
  font-weight: 600;
}

.gospel-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}

.gospel-tab {
  background: #11192c;
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  padding: 7px 6px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
}

.gospel-tab.disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.gospel-tab.active {
  background: rgba(245, 158, 11, 0.18);
  border-color: var(--accent-gold);
}

.gospel-tab-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  display: block;
}

.gospel-tab-ref {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--accent-gold-bright);
  display: block;
  margin-top: 2px;
}

.scripture-passages-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.scripture-card {
  background: #090e1a;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 15px 16px;
}

.scripture-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 8px;
  margin-bottom: 10px;
}

.scripture-gospel-label {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-gold-bright);
}

.scripture-ref-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent-sky);
}

.scripture-body-text {
  font-family: var(--font-serif);
  font-size: 13.5px;
  line-height: 1.8;
  color: #f1f5f9;
  white-space: pre-line;
}

/* TAG CLOUD */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.theme-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 4px 9px;
  border-radius: 6px;
  background: #131c31;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #070b14;
}
::-webkit-scrollbar-thumb {
  background: #1e293b;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #334155;
}

/* Keyboard Focus Ring */
.map-sequence-note {
  flex-shrink: 0;
  padding: 5px 14px;
  background: #0b111e;
  color: var(--text-secondary);
  font-size: 11px;
}

.atlas-node.precision-regional .atlas-node-dot,
.atlas-node.precision-traditional .atlas-node-dot {
  border-style: dashed;
}

.atlas-node.precision-uncertain .atlas-node-dot {
  border-style: dotted;
  border-color: #fbbf24;
}

.textual-note {
  padding: 10px;
  border-left: 3px solid var(--accent-gold);
  color: #fbbf24;
  font-size: 12px;
}

.load-error {
  position: fixed;
  inset: 12px 12px auto;
  z-index: 10000;
  padding: 18px;
  background: #411b21;
  color: #fff;
  border: 1px solid #fda4af;
}

/* Keyboard Focus Ring */
.quest-item:focus-visible,
.gospel-tab:focus-visible,
.hud-btn:focus-visible,
.filter-pill:focus-visible,
.transport-btn:focus-visible,
.visit-chip:focus-visible {
  outline: 2px solid var(--accent-gold-bright);
  outline-offset: 2px;
}

/* Mobile / Tablet Responsive Layout (< 1024px) */
.mobile-pane-nav {
  grid-row: 2;
  display: none;
  height: 40px;
  background: #0b111e;
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 10px;
  align-items: center;
  justify-content: space-around;
  gap: 6px;
}

.mobile-pane-btn {
  flex: 1;
  background: #131c31;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
}

.mobile-pane-btn.active {
  background: rgba(245, 158, 11, 0.2);
  border-color: var(--accent-gold);
  color: var(--accent-gold-bright);
}

@media (max-width: 1024px) {
  .hud-header {
    height: auto;
    flex-wrap: wrap;
    padding: 8px 12px;
    gap: 8px;
  }
  .telemetry-bar {
    display: none;
  }
  .mobile-pane-nav {
    display: flex;
  }
  .workspace {
    grid-template-columns: 1fr;
  }
  .workspace[data-mobile-pane="chronicle"] .map-stage,
  .workspace[data-mobile-pane="chronicle"] .codex-panel {
    display: none;
  }
  .workspace[data-mobile-pane="map"] .quest-sidebar,
  .workspace[data-mobile-pane="map"] .codex-panel {
    display: none;
  }
  .workspace[data-mobile-pane="codex"] .quest-sidebar,
  .workspace[data-mobile-pane="codex"] .map-stage {
    display: none;
  }
  .act-ribbon {
    display: none;
  }
}

/* Focus on the current event; reveal supporting controls when requested. */
.progress-menu, .map-options { position: relative; flex-shrink: 0; }
.progress-menu > summary, .map-options > summary {
  cursor: pointer; padding: 9px 11px; border: 1px solid var(--border-subtle);
  border-radius: 7px; font-size: 12px; color: var(--text-secondary); background: #111a2b;
  white-space: nowrap;
}
.progress-menu[open] > summary, .map-options[open] > summary { color: var(--text-primary); border-color: #475569; }
.progress-panel, .map-options-panel {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 100;
  width: 350px; max-width: calc(100vw - 24px); padding: 16px;
  background: #101827; border: 1px solid #334155; border-radius: 10px;
  box-shadow: 0 14px 40px #0008; max-height: calc(100dvh - 100px); overflow-y: auto;
}
.progress-panel .telemetry-bar { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.progress-panel .stat-box { min-width: 0; }
.menu-heading { font: 12px var(--font-sans); color: var(--text-secondary); margin: 18px 0 10px; }
.progress-panel .act-ribbon { display: grid; grid-template-columns: 1fr; margin: 0; gap: 6px; }
.progress-panel .act-segment { text-align: left; min-height: 32px; }
.progress-panel .act-seg-title { white-space: normal; }
.hour-hud-widget { border: 0; background: transparent; }
.hour-hud-label { font-size: 9px; }
.hour-meter-track { height: 3px; }
.hour-meter-fill { box-shadow: none; }
.map-toolbar { gap: 8px; padding: 8px 12px; }
.map-toolbar .toolbar-label { display: none; }
.map-options > summary { padding: 6px 9px; font-size: 11px; }
.map-options-panel { width: 235px; }
.map-options-panel fieldset { border: 0; margin-bottom: 16px; }
.map-options-panel legend { font-size: 11px; color: var(--text-secondary); margin-bottom: 8px; }
.map-options-panel .hud-btn { min-width: 55px; min-height: 32px; font-size: 12px; }
.map-options-panel .fog-toggle { font-size: 12px; gap: 8px; }
.map-viewport { position: relative; display: flex; flex-direction: column; flex: 1; min-height: 280px; }
.map-viewport .leaflet-map-canvas { min-height: 200px; }
.map-verse-card {
  position: absolute; top: 16px; right: 16px; z-index: 10; width: 270px;
  background: rgba(13, 19, 34, 0.96); border: 1px solid #64748b;
  border-radius: 10px; padding: 8px 12px 12px; box-shadow: 0 6px 24px #0005;
}
.verse-card-header { display: flex; align-items: flex-start; gap: 6px; margin-bottom: 5px; }
.verse-card-drag {
  display: flex; align-items: center; gap: 7px; flex: 1; min-width: 0;
  border: 0; background: transparent; color: #e2e8f0; text-align: left;
  font: 600 12px/1.4 var(--font-sans); padding: 4px 0; cursor: grab; touch-action: none;
}
.verse-card-drag:active { cursor: grabbing; }
.verse-card-grip { color: var(--text-muted); font-size: 18px; }
.bubble-close-btn { flex: 0 0 28px; min-height: 28px; }
.map-verse-card .map-scripture-bubble-text { font-size: 12px; line-height: 1.6; }
.map-verse-card .map-scripture-bubble-ref { font-size: 10px; }
.verse-docked .map-verse-card {
  position: static; width: auto; margin: 0; border-radius: 0;
  border-width: 1px 0 0; box-shadow: none; flex-shrink: 0; padding: 6px 14px 10px;
}
.verse-docked .verse-card-drag { cursor: default; opacity: 1; }
.verse-docked .verse-card-grip { display: none; }
.map-location-pill-bar { padding: 8px 12px; gap: 6px; }
.loc-visit-chips { max-width: 100%; }
.supporting-detail { border-top: 1px solid var(--border-subtle); padding: 12px 0; }
.supporting-detail > summary { cursor: pointer; color: var(--text-secondary); font-size: 12px; font-weight: 600; }
.supporting-detail[open] > summary { margin-bottom: 12px; color: var(--text-primary); }
.supporting-detail p { color: #cbd5e1; font-size: 12.5px; line-height: 1.65; }
.supporting-detail:last-of-type { margin-bottom: 22px; }
.codex-banner { flex-shrink: 0; }
.codex-panel { min-height: 0; }
.codex-time-place { flex-wrap: wrap; }
.codex-scroll-body { min-height: 0; }
.journey-navigation {
  grid-row: 4; display: grid; grid-template-columns: minmax(110px, 1fr) minmax(200px, 560px) minmax(180px, 1fr);
  align-items: center; gap: 24px; padding: 12px 20px; z-index: 40;
  border-top: 1px solid #334155; background: #0b111e;
}
.journey-navigation .transport-btn { min-height: 44px; height: auto; padding: 10px 16px; }
.previous-event { justify-self: start; }
.journey-navigation .next-event {
  justify-self: end; width: min(100%, 330px); min-width: 0; display: flex; flex-direction: column;
  align-items: flex-start; gap: 3px; background: #d99721; border-color: #e8ac3e; color: #101318; text-align: left;
}
.next-event > span { font-weight: 700; }
.next-event small { font-size: 11px; line-height: 1.35; font-weight: 500; width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.transport-btn:disabled { opacity: 0.4; cursor: default; }
.navigation-center { min-width: 0; }
.navigation-status { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.navigation-status .step-num { font-size: 12px; white-space: nowrap; }
.navigation-status .step-date { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.journey-navigation .play-btn { background: transparent; border: 1px solid var(--border-subtle); color: var(--text-secondary); min-height: 28px; padding: 4px 10px; margin-left: auto; font-size: 11px; }
.journey-slider { display: block; height: 4px; background: #334155; }
.journey-slider::-webkit-slider-thumb { width: 16px; height: 16px; border: 3px solid #d99721; box-shadow: none; }
.journey-slider::-moz-range-thumb { width: 12px; height: 12px; border: 2px solid #d99721; border-radius: 50%; background: white; }
summary:focus-visible, button:focus-visible, .journey-slider:focus-visible { outline: 2px solid var(--accent-sky); outline-offset: 3px; }
@media (max-width: 1024px) {
  .hud-header { gap: 10px; }
  .brand-block { flex: 1; }
  .hour-hud-widget { order: 3; flex-basis: 100%; max-width: none; padding: 0; }
  .hour-hud-top { margin-bottom: 5px; }
  .progress-panel { max-height: calc(100dvh - 150px); }
  .codex-panel { overflow-y: auto; }
  .codex-scroll-body { flex: none; overflow-y: visible; }
  .journey-navigation { grid-template-columns: auto minmax(90px, 1fr) minmax(130px, 200px); gap: 12px; padding: 12px; }
  .navigation-status .step-date { display: none; }
}
@media (max-width: 600px) {
  .brand-title { font-size: 12px; letter-spacing: 0.025em; }
  .brand-subtitle { font-size: 7.5px; letter-spacing: 0; }
  .brand-emblem { width: 30px; height: 30px; }
  .brand-block { gap: 8px; }
  .progress-menu > summary { font-size: 11px; padding: 8px; }
  .hour-hud-label { font-size: 8px; }
  .hour-status-pill { font-size: 9px; }
  .mobile-pane-nav { padding: 0 6px; gap: 4px; }
  .mobile-pane-btn { font-size: 11px; padding: 6px; }
  .map-toolbar { padding: 6px 10px; gap: 5px; }
  .map-toolbar .toolbar-group { gap: 3px; }
  .map-toolbar .hud-btn { padding: 5px 6px; }
  .map-options > summary { font-size: 10px; padding: 6px; }
  .map-sequence-note { font-size: 9px; }
  .map-location-pill-bar { padding: 7px 12px; }
  .loc-pill-ancient { font-size: 9px; }
  .loc-visit-chips { display: none; }
  .journey-navigation { grid-template-columns: 90px minmax(64px, 1fr) minmax(110px, 1.4fr); gap: 10px; padding: 10px; }
  .journey-navigation .transport-btn { padding: 10px; font-size: 11px; }
  .navigation-status { flex-direction: column; gap: 5px; margin-bottom: 8px; }
  .navigation-status .step-num { font-size: 10px; }
  .journey-navigation .play-btn { margin: 0; padding: 3px 8px; min-height: 24px; font-size: 10px; }
  .journey-navigation .next-event { min-height: 60px; justify-content: center; }
  .next-event small { font-size: 10px; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .codex-banner { padding: 12px 16px; }
  .codex-event-title { font-size: 17px; }
  .codex-time-place { font-size: 11px; margin-bottom: 0; }
  .codex-meta-row .act-badge, .codex-meta-row .category-badge { font-size: 8px; }
  .codex-scroll-body { padding: 16px; }
}
@media (max-width: 360px) {
  .brand-subtitle { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
