:root {
  color-scheme: dark;
  --bg: #0b1220;
  --panel: rgba(17, 27, 46, 0.88);
  --panel-strong: rgba(20, 31, 52, 0.95);
  --line: rgba(190, 212, 240, 0.30);
  --text: #f4f8ff;
  --muted: #b8c7dc;
  --known: #79f2c9;
  --plausible: #8fb4ff;
  --speculative: #ff9ec4;
  --warning: #ffd166;
  --shadow: 0 18px 54px rgba(0, 0, 0, 0.36);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html,
body,
.app-shell {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  background:
    radial-gradient(circle at 48% 34%, rgba(96, 165, 250, 0.16), transparent 34%),
    radial-gradient(circle at 72% 22%, rgba(94, 234, 212, 0.10), transparent 28%),
    radial-gradient(circle at 24% 78%, rgba(196, 181, 253, 0.10), transparent 30%),
    linear-gradient(180deg, #0f1a2e 0%, #0a1323 54%, #0b1220 100%);
  color: var(--text);
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: var(--known);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.graph-stage {
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, rgba(11, 18, 32, 0.04), rgba(11, 18, 32, 0.28));
}

#graph {
  position: absolute;
  inset: 0;
}

.ambient-grid {
  position: absolute;
  inset: auto 0 0;
  height: 34vh;
  pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(transparent, black 35%);
  opacity: 0.24;
}

.quick-dock,
.floating-logic-nav,
.top-overlay,
.prototype-console,
.map-guide,
.control-deck,
.side-panel,
.comments-drawer,
.first-visit-strip,
.brain-note,
.boundary-strip {
  position: fixed;
  z-index: 5;
}


.quick-dock {
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(17, 27, 46, 0.86);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  z-index: 8;
}

.floating-logic-nav {
  left: 50%;
  bottom: 50px;
  display: grid;
  grid-template-columns: 44px minmax(160px, 300px) 44px;
  align-items: center;
  gap: 8px;
  max-width: calc(100vw - 28px);
  padding: 8px;
  border: 1px solid rgba(121, 242, 201, 0.42);
  border-radius: 999px;
  background: rgba(7, 13, 24, 0.82);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.42), 0 0 28px rgba(121, 242, 201, 0.10);
  backdrop-filter: blur(18px);
  transform: translateX(-50%);
  z-index: 9;
}

.floating-logic-nav button {
  width: 44px;
  height: 36px;
  border: 1px solid rgba(143, 180, 255, 0.62);
  border-radius: 999px;
  background: rgba(143, 180, 255, 0.18);
  color: #f4f9ff;
  cursor: pointer;
  font-size: 1.2rem;
  font-weight: 900;
}

.floating-logic-nav button:hover:not(:disabled) {
  border-color: rgba(121, 242, 201, 0.82);
  background: rgba(121, 242, 201, 0.18);
}

.floating-logic-nav button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.floating-logic-nav span {
  overflow: hidden;
  color: #dce8f9;
  font-size: 0.78rem;
  font-weight: 800;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dock-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(220, 236, 255, 0.14);
  border-radius: 999px;
  padding: 7px 11px;
  background: rgba(255, 255, 255, 0.055);
  color: #dce8f9;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 750;
  text-decoration: none;
}

.dock-button.active,
.dock-button:hover {
  border-color: rgba(121, 242, 201, 0.7);
  background: rgba(121, 242, 201, 0.14);
  color: #effffb;
  text-decoration: none;
}

.overlay-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(220, 236, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: #dce8f9;
  cursor: pointer;
  z-index: 2;
}

.top-overlay:not(.open),
.prototype-console:not(.open),
.map-guide:not(.open),
.control-deck:not(.open),
.first-visit-strip:not(.open) {
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
}

.top-overlay,
.prototype-console,
.map-guide,
.control-deck,
.first-visit-strip {
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.top-overlay {
  top: 70px;
  left: 22px;
  width: min(520px, calc(100vw - 520px));
  display: flex;
  gap: 18px;
  align-items: flex-start;
  pointer-events: none;
}

.top-overlay.open {
  pointer-events: auto;
}

.top-overlay > div,
.quick-dock,
.dock-button,
.guide-card,
.legend-card,
.control-block,
.side-panel,
.brain-note {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.top-overlay > div {
  position: relative;
  padding: 18px 44px 18px 20px;
  border-radius: 8px;
}

.map-intent {
  max-width: 610px;
  margin: 10px 0 0;
  color: #aedad2;
  font-size: 0.9rem;
  line-height: 1.38;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  pointer-events: auto;
}

.hero-actions button,
.hero-actions a,
.prototype-actions button,
.prototype-actions a {
  border: 1px solid rgba(121, 242, 201, 0.5);
  border-radius: 8px;
  padding: 9px 11px;
  background: rgba(121, 242, 201, 0.12);
  color: #effffb;
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 800;
  text-decoration: none;
}

.hero-actions button + button,
.hero-actions a,
.prototype-actions a {
  border-color: rgba(143, 180, 255, 0.5);
  background: rgba(143, 180, 255, 0.12);
  color: #edf4ff;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.hero-metrics span {
  min-width: 0;
  border: 1px solid rgba(220, 236, 255, 0.14);
  border-radius: 8px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: #aebfd3;
  font-size: 0.76rem;
  line-height: 1.25;
}

.hero-metrics strong {
  display: block;
  color: #f4f9ff;
  font-size: 1rem;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--known);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(1.7rem, 3vw, 3rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.thesis {
  max-width: 650px;
  margin: 12px 0 0;
  color: #d4e2f7;
  font-size: clamp(0.95rem, 1.5vw, 1.1rem);
  line-height: 1.45;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  pointer-events: auto;
}

.hero-links a {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(121, 242, 201, 0.48);
  border-radius: 8px;
  padding: 9px 11px;
  background: rgba(121, 242, 201, 0.1);
  color: #effffb;
  font-size: 0.86rem;
  font-weight: 750;
}

.hero-links button,
.inline-tool-button {
  border: 1px solid rgba(143, 180, 255, 0.5);
  border-radius: 8px;
  padding: 9px 11px;
  background: rgba(143, 180, 255, 0.12);
  color: #edf4ff;
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 750;
}

.panel-toggle {
  display: none;
  pointer-events: auto;
  color: var(--text);
  border-radius: 8px;
  padding: 11px 13px;
  cursor: pointer;
}


.map-guide {
  left: 22px;
  top: 70px;
  bottom: auto;
  width: min(320px, calc(100vw - 460px));
  display: grid;
  gap: 10px;
}

.guide-card,
.legend-card {
  position: relative;
  border-radius: 14px;
  padding: 12px 13px;
}

.first-visit-strip {
  left: 50%;
  bottom: 104px;
  width: min(760px, calc(100vw - 420px));
  transform: translateX(-50%);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 44px 12px 14px;
  background: rgba(18, 29, 50, 0.93);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.first-visit-strip:not(.open) {
  transform: translate(-50%, 10px);
}

.first-visit-strip ol {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.first-visit-strip p {
  margin: 0 0 10px;
  color: #f6e7aa;
  font-size: 0.84rem;
  line-height: 1.35;
}

.first-visit-strip li {
  display: flex;
  gap: 9px;
  align-items: center;
  min-width: 0;
  color: #dce8f9;
  font-size: 0.82rem;
  line-height: 1.25;
}

.first-visit-strip span {
  display: grid;
  flex: 0 0 24px;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(121, 242, 201, 0.42);
  border-radius: 50%;
  background: rgba(121, 242, 201, 0.12);
  color: var(--known);
  font-size: 0.76rem;
  font-weight: 850;
}

.first-visit-strip strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.guide-card ol {
  margin: 0;
  padding-left: 19px;
  color: #c5d4e8;
  font-size: 0.8rem;
  line-height: 1.45;
}

.guide-card li + li {
  margin-top: 7px;
}

.legend-card {
  display: grid;
  gap: 8px;
  color: #d8e5f8;
  font-size: 0.82rem;
}

.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 8px;
  border-radius: 999px;
  box-shadow: 0 0 14px currentColor;
}

.legend-dot.known { background: var(--known); color: var(--known); }
.legend-dot.plausible { background: var(--plausible); color: var(--plausible); }
.legend-dot.speculative { background: var(--speculative); color: var(--speculative); }

.control-deck {
  left: 22px;
  bottom: 56px;
  width: min(460px, calc(100vw - 460px));
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.prototype-console {
  top: 70px;
  right: 20px;
  bottom: 56px;
  width: 420px;
  display: grid;
  align-content: start;
  gap: 12px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: rgba(8, 15, 28, 0.9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.prototype-console:not(.open) {
  transform: translateX(calc(100% + 24px));
}

.prototype-head {
  padding-right: 28px;
}

.prototype-head h2 {
  margin: 0;
  color: #f4f9ff;
  font-size: 1.55rem;
  line-height: 1.08;
}

.prototype-head p {
  margin: 10px 0 0;
  color: #bdcde2;
  font-size: 0.88rem;
  line-height: 1.45;
}

.prototype-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.prototype-controls label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: #dce8f9;
  font-size: 0.8rem;
  font-weight: 800;
}

.prototype-controls label:nth-child(n + 3) {
  grid-column: 1 / -1;
}

.prototype-controls span {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.prototype-controls select {
  width: 100%;
  min-height: 38px;
  border: 1px solid rgba(190, 212, 240, 0.32);
  border-radius: 8px;
  padding: 7px 9px;
  overflow: hidden;
  background: rgba(3, 7, 14, 0.68);
  color: var(--text);
  text-overflow: ellipsis;
}

.prototype-controls input[type="range"] {
  margin: 4px 0;
}

.prototype-readout {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.metric-tile {
  display: grid;
  gap: 6px;
  min-width: 0;
  border: 1px solid rgba(220, 236, 255, 0.14);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.055);
}

.metric-tile span {
  color: #9fb0c8;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.metric-tile strong {
  color: #f4f9ff;
  font-size: 1.35rem;
  line-height: 1;
}

.metric-tile i {
  display: block;
  width: 0;
  height: 4px;
  border-radius: 999px;
  background: var(--known);
  box-shadow: 0 0 16px rgba(121, 242, 201, 0.34);
}

.metric-tile:nth-child(2) i {
  background: var(--speculative);
  box-shadow: 0 0 16px rgba(255, 158, 196, 0.32);
}

.metric-tile:nth-child(3) i {
  background: var(--plausible);
  box-shadow: 0 0 16px rgba(143, 180, 255, 0.32);
}

.prototype-trace {
  display: grid;
  gap: 10px;
}

.prototype-trace canvas {
  width: 100%;
  aspect-ratio: 3.4 / 1;
  border: 1px solid rgba(220, 236, 255, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(121, 242, 201, 0.07), transparent 42%),
    rgba(4, 8, 16, 0.92);
}

.prototype-trace p {
  margin: 0;
  color: #cfdbed;
  font-size: 0.86rem;
  line-height: 1.45;
}

.prototype-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.control-block {
  padding: 14px;
  border-radius: 12px;
}

.control-deck > .overlay-close {
  top: -12px;
  right: -12px;
}

.block-heading,
.control-block label {
  display: grid;
  gap: 4px;
}

.block-heading span,
.control-block label span,
.slider-scale,
.mode-copy {
  color: var(--muted);
  font-size: 0.82rem;
}

.block-heading strong,
.control-block label strong {
  font-size: 0.95rem;
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.mode-button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  cursor: pointer;
}

.mode-button.active {
  border-color: rgba(121, 242, 201, 0.86);
  background: rgba(121, 242, 201, 0.16);
  color: #effffb;
}

.mode-copy {
  min-height: 54px;
  margin: 0;
  line-height: 1.45;
}

input[type="range"] {
  width: 100%;
  margin: 18px 0 10px;
  accent-color: var(--known);
}

.slider-scale {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.side-panel {
  top: 70px;
  right: 20px;
  bottom: 56px;
  width: 360px;
  overflow: auto;
  padding: 18px;
  border-radius: 8px;
  transform: translateX(0);
  transition: transform 0.22s ease, opacity 0.22s ease;
}

.side-panel:not(.open) {
  transform: translateX(calc(100% + 24px));
  opacity: 0;
  pointer-events: none;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

#closePanel {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  cursor: pointer;
  font-size: 1.25rem;
}

.side-panel h2 {
  margin: 8px 0 12px;
  font-size: 1.6rem;
  line-height: 1.08;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.cluster-pill,
.status-badge {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px;
  color: #dce8f9;
  font-size: 0.78rem;
}

.status-known {
  border-color: rgba(121, 242, 201, 0.65);
  background: rgba(121, 242, 201, 0.14);
}

.status-plausible {
  border-color: rgba(143, 180, 255, 0.65);
  background: rgba(143, 180, 255, 0.14);
}

.status-speculative {
  border-color: rgba(255, 158, 196, 0.65);
  background: rgba(255, 158, 196, 0.14);
}

#nodeDescription,
.boundary-card li {
  color: #bccbe0;
  line-height: 1.55;
  overflow-wrap: anywhere;
}


.node-explainer-grid,
.connection-card {
  display: grid;
  gap: 10px;
  margin: 14px 0;
}

.node-explainer-grid > div,
.connection-card {
  border: 1px solid rgba(220, 236, 255, 0.12);
  border-radius: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.045);
}

.node-explainer-grid h3,
.connection-card h3 {
  margin: 0 0 6px;
  color: #f4f9ff;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.node-explainer-grid p,
.connection-card li {
  margin: 0;
  color: #c6d5e9;
  font-size: 0.88rem;
  line-height: 1.48;
}

.connection-card ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 18px;
}

.connection-card span {
  color: #93a7bd;
}

.doc-button {
  display: inline-flex;
  margin: 6px 0 18px;
  border: 1px solid rgba(121, 242, 201, 0.54);
  border-radius: 999px;
  padding: 9px 12px;
  background: rgba(121, 242, 201, 0.12);
  font-weight: 750;
}

.secondary-doc-button {
  margin-left: 8px;
  border-color: rgba(143, 180, 255, 0.54);
  background: rgba(143, 180, 255, 0.12);
  color: #eaf0ff;
}

.doc-button.hidden {
  display: none;
}

.journey-step-link {
  margin: 12px 0 0;
}

.boundary-card {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
  margin: 4px 0 16px;
}

.boundary-card h3 {
  margin: 0 0 10px;
  font-size: 0.95rem;
}

.boundary-card ul {
  margin: 0;
  padding-left: 19px;
}

.boundary-card li {
  margin: 0 0 9px;
}

.doc-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.doc-links a {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.05);
  color: #dce8f9;
  font-size: 0.85rem;
}

.brain-note {
  display: none;
}

.boundary-strip {
  left: 0;
  right: 0;
  bottom: 0;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-top: 1px solid rgba(190, 212, 240, 0.30);
  background: rgba(12, 22, 39, 0.92);
  color: #dbe7f7;
  font-size: 0.8rem;
  text-align: center;
}

.node-tooltip {
  position: fixed;
  z-index: 10;
  max-width: 260px;
  pointer-events: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(7, 11, 20, 0.94);
  color: var(--text);
  box-shadow: var(--shadow);
  transform: translate(14px, 14px);
  font-size: 0.83rem;
}

.node-tooltip.hidden {
  display: none;
}

.graph-fallback {
  position: fixed;
  top: 50%;
  left: 50%;
  display: grid;
  gap: 8px;
  max-width: min(420px, calc(100vw - 40px));
  padding: 16px;
  pointer-events: auto;
  transform: translate(-50%, -50%);
  line-height: 1.45;
}

.graph-fallback span {
  color: #c7d5e8;
}

body.journey-page {
  min-height: 100vh;
  overflow: auto;
  background:
    radial-gradient(circle at 20% 18%, rgba(121, 242, 201, 0.18), transparent 28%),
    radial-gradient(circle at 78% 8%, rgba(255, 209, 102, 0.12), transparent 24%),
    linear-gradient(135deg, rgba(3, 5, 10, 0.94), rgba(13, 22, 35, 0.94)),
    var(--bg);
}

body.brief-page {
  min-height: 100vh;
  overflow: auto;
  background:
    radial-gradient(circle at 74% 12%, rgba(121, 242, 201, 0.14), transparent 30%),
    linear-gradient(135deg, rgba(3, 5, 10, 0.96), rgba(15, 23, 33, 0.96)),
    var(--bg);
}

.journey-header,
.journey-shell,
.journey-disclaimer,
.brief-hero,
.brief-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.journey-header {
  padding: 28px 0 18px;
}

.brief-hero {
  padding: 28px 0 24px;
}

.journey-header h1 {
  max-width: 900px;
  font-size: clamp(2rem, 6vw, 4.25rem);
}

.brief-hero h1 {
  max-width: 960px;
  font-size: clamp(2.3rem, 7vw, 5.2rem);
}

.brief-hook {
  max-width: 900px;
  margin: 16px 0 0;
  color: #d7e5f7;
  font-size: clamp(1rem, 1.8vw, 1.2rem);
  line-height: 1.55;
}

.journey-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

.journey-nav a,
.journey-nav button,
.journey-controls button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  cursor: pointer;
  font: inherit;
}

.journey-nav a[aria-current="page"],
.journey-nav button.active {
  border-color: rgba(121, 242, 201, 0.7);
  background: rgba(121, 242, 201, 0.14);
}

.journey-nav button:hover {
  border-color: rgba(121, 242, 201, 0.7);
}

.brief-shell {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  padding-bottom: 56px;
}

.brief-toc {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.brief-toc a {
  border-radius: 6px;
  padding: 9px 10px;
  color: #dce8f9;
  font-size: 0.9rem;
}

.brief-toc a:hover {
  background: rgba(255, 255, 255, 0.06);
  text-decoration: none;
}

.brief-content {
  display: grid;
  gap: 16px;
}

.brief-section {
  scroll-margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(18px, 3vw, 28px);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.brief-section h2 {
  margin: 0 0 12px;
  color: #f5fbff;
  font-size: clamp(1.45rem, 3vw, 2.2rem);
  line-height: 1.12;
}

.brief-section h3 {
  margin: 0 0 8px;
  color: #f5fbff;
  font-size: 1rem;
}

.brief-section p,
.brief-section li {
  color: #dbe7f7;
  line-height: 1.62;
}

.brief-section p {
  margin: 0;
}

.brief-section p + p {
  margin-top: 12px;
}

.brief-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.brief-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.brief-grid.state-vector-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.brief-grid > div,
.brief-grid > article {
  border: 1px solid rgba(220, 236, 255, 0.12);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.045);
}

.brief-grid ul,
.brief-section ul,
.brief-steps {
  margin: 0;
  padding-left: 20px;
}

.brief-steps {
  display: grid;
  gap: 8px;
}

.brief-caveat {
  border-left: 3px solid rgba(255, 209, 102, 0.78);
  padding-left: 12px;
  color: #f5df9a;
}

.flow-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin: 16px 0;
}

.flow-strip span {
  position: relative;
  min-height: 72px;
  border: 1px solid rgba(143, 180, 255, 0.32);
  border-radius: 8px;
  padding: 10px;
  background: rgba(143, 180, 255, 0.08);
  color: #dce8f9;
  font-size: 0.78rem;
  font-weight: 750;
  line-height: 1.32;
}

.flow-strip span:not(:last-child)::after {
  content: ">";
  position: absolute;
  top: 50%;
  right: -8px;
  transform: translate(50%, -50%);
  color: var(--known);
  font-weight: 900;
}

.anchor-table {
  display: grid;
  overflow: hidden;
  border: 1px solid rgba(220, 236, 255, 0.14);
  border-radius: 8px;
}

.anchor-table > div {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr 1.3fr 1.3fr;
  gap: 12px;
  padding: 11px 12px;
  border-top: 1px solid rgba(220, 236, 255, 0.12);
}

.anchor-table > div:first-child {
  border-top: 0;
  background: rgba(121, 242, 201, 0.1);
}

.anchor-table strong,
.anchor-table span {
  color: #dce8f9;
  font-size: 0.82rem;
  line-height: 1.42;
}

.anchor-table span {
  color: #bfcee3;
}

.boundary-emphasis {
  border-color: rgba(255, 209, 102, 0.36);
}

.artifact-list {
  display: grid;
  gap: 10px;
}

.artifact-list a {
  display: grid;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
  background: rgba(255, 255, 255, 0.045);
  color: #effffb;
}

.artifact-list a:hover {
  border-color: rgba(121, 242, 201, 0.62);
  text-decoration: none;
}

.artifact-list span {
  color: #aebfd3;
  font-size: 0.9rem;
  line-height: 1.45;
}

.journey-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 18px;
  align-items: start;
  padding-bottom: 110px;
}

.journey-board,
.journey-card,
.journey-disclaimer {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.journey-board {
  padding: 18px;
}

.journey-path {
  display: grid;
  gap: 12px;
}

.journey-step {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  align-items: center;
  min-height: 74px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.journey-step[aria-current="step"] {
  border-color: rgba(121, 242, 201, 0.74);
  background: rgba(121, 242, 201, 0.13);
}

.journey-step span {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--known);
  font-weight: 800;
}

.journey-step strong {
  line-height: 1.25;
}

.journey-card {
  padding: 20px;
}

.step-count {
  margin: 0 0 8px;
  color: var(--known);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.journey-card h2 {
  margin: 0 0 12px;
  font-size: 1.55rem;
  line-height: 1.15;
}

.journey-card p {
  color: #dbe7f7;
  line-height: 1.6;
}

.state-panel {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.state-bar {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 0.86rem;
}

.state-bar meter {
  width: 100%;
  height: 16px;
  accent-color: var(--known);
}

.journey-controls {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.journey-controls button {
  flex: 1;
  cursor: pointer;
}

.journey-controls button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.journey-disclaimer {
  position: static;
  transform: none;
  padding: 12px 14px;
  color: #d5e3f4;
  font-size: 0.86rem;
  line-height: 1.45;
  margin-bottom: 18px;
}

@media (max-width: 980px) {
  body {
    overflow: hidden;
  }

  .quick-dock {
    top: 10px;
    width: calc(100vw - 24px);
    justify-content: center;
    overflow-x: auto;
  }

  .dock-button {
    white-space: nowrap;
  }

  .top-overlay {
    top: 58px;
    left: 12px;
    right: 12px;
    width: auto;
  }

  .top-overlay > div {
    padding: 14px;
  }

  .panel-toggle {
    display: block;
    flex: 0 0 auto;
  }

  .map-guide {
    top: 58px;
    left: 12px;
    right: 12px;
    width: auto;
  }

  .control-deck {
    left: 12px;
    right: auto;
    bottom: 48px;
    width: min(520px, calc(100vw - 48px));
    grid-template-columns: 1fr;
    max-height: 38vh;
    overflow: auto;
  }

  .prototype-console {
    top: 58px;
    right: 12px;
    bottom: 48px;
    width: min(420px, calc(100vw - 24px));
    max-height: calc(100vh - 118px);
  }

  .mode-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .side-panel {
    top: auto;
    left: 12px;
    right: auto;
    bottom: 48px;
    width: min(360px, calc(100vw - 48px));
    max-height: 56vh;
    padding: 16px;
    overflow-x: hidden;
  }

  .brain-note {
    display: none;
  }

  .first-visit-strip {
    left: 12px;
    right: 12px;
    bottom: 88px;
    width: auto;
    transform: none;
  }

  .first-visit-strip:not(.open) {
    transform: translateY(10px);
  }

  .first-visit-strip ol {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  h1 {
    font-size: 1.9rem;
  }

  .journey-shell {
    grid-template-columns: 1fr;
  }

  .brief-shell {
    grid-template-columns: 1fr;
  }

  .brief-toc {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .brief-grid,
  .brief-grid.three,
  .brief-grid.state-vector-grid {
    grid-template-columns: 1fr;
  }

  .flow-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .flow-strip span:not(:last-child)::after {
    display: none;
  }

  .anchor-table > div {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .journey-disclaimer {
    position: static;
    transform: none;
    margin-bottom: 16px;
  }

  .journey-shell {
    padding-bottom: 18px;
  }
}

@media (max-width: 540px) {
  .top-overlay {
    align-items: stretch;
  }

  .map-intent {
    font-size: 0.84rem;
  }

  .mode-grid,
  .doc-links,
  .hero-metrics,
  .prototype-controls,
  .prototype-readout {
    grid-template-columns: 1fr;
  }

  .control-deck {
    max-height: 34vh;
  }

  .side-panel {
    max-height: 50vh;
  }

  .hero-links {
    margin-top: 10px;
  }

  .hero-links a {
    padding: 8px 9px;
    font-size: 0.78rem;
  }

  .hero-links button {
    padding: 8px 9px;
    font-size: 0.78rem;
  }

  .journey-step {
    grid-template-columns: 34px 1fr;
  }

  .state-bar {
    grid-template-columns: 1fr;
  }
}


.node-papers-card {
  border: 1px solid rgba(190, 212, 240, 0.28);
  border-radius: 12px;
  padding: 12px;
  margin: 14px 0;
  background: rgba(255, 255, 255, 0.06);
}

.node-papers-card h3 {
  margin: 0 0 8px;
  color: #f4f9ff;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.node-papers-card ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
}

.node-papers-card li {
  color: #cfdbed;
  font-size: 0.84rem;
  line-height: 1.42;
}

.node-papers-card a {
  color: #b7f7eb;
  font-weight: 750;
}

.node-papers-card span {
  display: block;
  color: #9fb0c9;
  margin-top: 2px;
}


.logic-chain-card,
.node-papers-card {
  border: 1px solid rgba(190, 212, 240, 0.28);
  border-radius: 12px;
  padding: 12px;
  margin: 14px 0;
  background: rgba(255, 255, 255, 0.06);
}

.logic-chain-card h3,
.node-papers-card h3 {
  margin: 0 0 8px;
  color: #f4f9ff;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.logic-chain-card p {
  margin: 0 0 10px;
  color: #cfdbed;
  font-size: 0.84rem;
  line-height: 1.42;
}

.logic-chain-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.logic-chain-actions button {
  min-height: 34px;
  border: 1px solid rgba(143, 180, 255, 0.44);
  border-radius: 8px;
  padding: 7px 9px;
  overflow: hidden;
  background: rgba(143, 180, 255, 0.12);
  color: #edf4ff;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logic-chain-actions button:hover:not(:disabled) {
  border-color: rgba(121, 242, 201, 0.7);
  background: rgba(121, 242, 201, 0.14);
}

.logic-chain-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

.comments-drawer {
  top: 70px;
  right: 20px;
  bottom: 56px;
  width: min(390px, calc(100vw - 40px));
  z-index: 12;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(11, 18, 32, 0.96);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  transform: translateX(calc(100% + 28px));
  opacity: 0;
  pointer-events: none;
  transition: transform 0.22s ease, opacity 0.22s ease;
}

.comments-drawer.open {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

.comments-drawer-inner {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.comments-head,
.comment-meta,
.comment-actions,
.comments-tools {
  display: flex;
  gap: 10px;
  align-items: center;
}

.comments-head {
  justify-content: space-between;
}

.comments-head h2 {
  margin: 0;
  font-size: 1.45rem;
  line-height: 1.1;
}

.comments-close {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  cursor: pointer;
  font-size: 1.25rem;
}

.comments-target-card,
.comment-item {
  border: 1px solid rgba(220, 236, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}

.comments-target-card {
  display: grid;
  gap: 4px;
  padding: 11px 12px;
}

.comments-target-card strong {
  color: #f4f9ff;
  font-size: 0.92rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.comments-target-card span,
.comments-summary,
.comments-empty,
.comment-meta time {
  color: var(--muted);
  font-size: 0.8rem;
}

.comments-form {
  display: grid;
  gap: 10px;
}

.comments-form label {
  display: grid;
  gap: 6px;
  color: #dce8f9;
  font-size: 0.82rem;
  font-weight: 750;
}

.comments-form select,
.comments-form textarea {
  width: 100%;
  border: 1px solid rgba(190, 212, 240, 0.32);
  border-radius: 8px;
  background: rgba(3, 7, 14, 0.62);
  color: var(--text);
  font: inherit;
}

.comments-form select {
  min-height: 38px;
  padding: 7px 9px;
}

.comments-form textarea {
  min-height: 118px;
  resize: vertical;
  padding: 10px;
  line-height: 1.45;
}

.comments-form button,
.comments-tools button,
.comments-import,
.comment-actions button {
  border: 1px solid rgba(121, 242, 201, 0.5);
  border-radius: 8px;
  padding: 9px 10px;
  background: rgba(121, 242, 201, 0.12);
  color: #effffb;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 750;
}

.comments-tools {
  flex-wrap: wrap;
}

.comments-import {
  position: relative;
  border-color: rgba(143, 180, 255, 0.5);
  background: rgba(143, 180, 255, 0.12);
  color: #edf4ff;
}

.comments-import input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.comments-list {
  display: grid;
  gap: 10px;
}

.comments-summary,
.comments-empty,
.comments-status {
  margin: 0;
}

.comments-status {
  min-height: 1.1em;
  color: #9fb0c8;
  font-size: 0.78rem;
  line-height: 1.35;
}

.comments-status.error {
  color: #ffb4c6;
}

.comment-item {
  display: grid;
  gap: 9px;
  padding: 11px;
}

.comment-item.resolved {
  opacity: 0.62;
}

.comment-meta {
  justify-content: space-between;
}

.comment-meta strong {
  border: 1px solid rgba(255, 209, 102, 0.42);
  border-radius: 999px;
  padding: 4px 7px;
  background: rgba(255, 209, 102, 0.1);
  color: #ffe6a3;
  font-size: 0.72rem;
  text-transform: uppercase;
}

.comment-item p {
  margin: 0;
  color: #dbe7f7;
  font-size: 0.9rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.comment-actions {
  justify-content: flex-end;
}

.comment-actions button {
  border-color: rgba(190, 212, 240, 0.28);
  background: rgba(255, 255, 255, 0.06);
  color: #dce8f9;
}

@media (max-width: 980px) {
  .comments-drawer {
    top: auto;
    left: 12px;
    right: 12px;
    bottom: 48px;
    width: auto;
    max-height: min(620px, calc(100vh - 88px));
    transform: translateY(calc(100% + 28px));
  }

  .comments-drawer.open {
    transform: translateY(0);
  }
}
