:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #06080d;
  color: #f8fafc;
  --page: #06080d;
  --panel: rgba(9, 14, 24, 0.82);
  --panel-strong: rgba(12, 18, 30, 0.94);
  --ink: #f8fafc;
  --soft: #cbd5e1;
  --muted: #94a3b8;
  --line: rgba(148, 163, 184, 0.24);
  --line-strong: rgba(226, 232, 240, 0.38);
  --accent: #5eead4;
  --navy: #082b66;
  --teal: #0f8a8d;
  --green: #16743a;
  --violet: #5b3aa4;
  --gold: #b27600;
  --orange: #f97316;
  --shadow: 0 24px 90px rgba(0, 0, 0, 0.36);
}

* {
  box-sizing: border-box;
}

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

html,
body {
  min-height: 100%;
  margin: 0;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  min-width: 320px;
  background:
    linear-gradient(rgba(148, 163, 184, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.055) 1px, transparent 1px),
    radial-gradient(circle at 18% 20%, rgba(20, 184, 166, 0.13), transparent 34%),
    radial-gradient(circle at 80% 12%, rgba(96, 165, 250, 0.12), transparent 32%),
    linear-gradient(135deg, #06080d 0%, #0d111d 48%, #071316 100%);
  background-size: 72px 72px, 72px 72px, auto, auto, auto;
  color: var(--ink);
}

button {
  font: inherit;
}

button:focus-visible,
a:focus-visible,
#explorer:focus-visible {
  outline: 2px solid #f8fafc;
  outline-offset: 3px;
}

.app-shell {
  min-height: 100vh;
  padding: 92px 18px 34px;
}

.topbar {
  position: fixed;
  z-index: 10;
  top: 0;
  left: 0;
  right: 0;
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(4, 7, 12, 0.92);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 50%;
  color: #04100e;
  background: var(--accent);
  font-weight: 900;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 1rem;
  line-height: 1.1;
}

.brand small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
}

.top-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.top-actions button,
.segmented-control button,
.filter,
.choice-button,
.choice-link,
.stepper-actions button,
.progress-dot,
.jump-button,
.workflow-card,
.next-button {
  min-height: 40px;
  border: 1px solid rgba(188, 199, 214, 0.3);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(13, 18, 30, 0.82);
  cursor: pointer;
}

.top-actions button:hover,
.segmented-control button:hover,
.filter:hover,
.choice-button:hover,
.choice-link:hover,
.stepper-actions button:hover,
.progress-dot:hover,
.jump-button:hover,
.workflow-card:hover,
.next-button:hover,
.segmented-control button.active,
.filter.active,
.choice-button.active,
.choice-link.active,
.progress-dot.active,
.workflow-card.active {
  border-color: rgba(94, 234, 212, 0.78);
  background: rgba(20, 184, 166, 0.16);
}

.mode-pill {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  max-width: 176px;
  padding: 0 12px;
  border: 1px solid rgba(94, 234, 212, 0.5);
  border-radius: 999px;
  color: #ccfbf1;
  background: rgba(20, 184, 166, 0.14);
  font-size: 0.78rem;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-actions button {
  min-width: 66px;
  padding: 0 14px;
}

.reader-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 390px);
  gap: 18px;
  align-items: start;
  max-width: 1680px;
  margin: 0 auto;
}

.reader-pane {
  min-width: 0;
}

.reader-hero,
.diagram-atlas,
.workflow-overview,
.reader-board,
.map-card,
.control-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.reader-hero {
  position: relative;
  padding: 28px;
  margin-bottom: 18px;
  overflow: hidden;
}

.reader-hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 3px;
  background: linear-gradient(90deg, var(--navy), var(--green), var(--teal), var(--violet), var(--gold), #60a5fa);
}

.launch-panel {
  transition: opacity 180ms ease, transform 180ms ease, visibility 180ms ease, margin 180ms ease, padding 180ms ease;
}

.launch-panel.dismissed {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  max-height: 0;
  margin: 0;
  padding-top: 0;
  padding-bottom: 0;
  overflow: hidden;
}

.dismiss-button {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid rgba(188, 199, 214, 0.28);
  border-radius: 999px;
  color: #e5e7eb;
  background: rgba(13, 18, 30, 0.76);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 900;
}

.dismiss-button:hover {
  border-color: rgba(248, 250, 252, 0.72);
  background: rgba(248, 250, 252, 0.12);
}

.eyebrow {
  margin: 0 0 9px;
  color: #67e8f9;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

.reader-hero h1,
.section-heading h2,
.selection-header h2 {
  margin: 0;
  color: var(--ink);
  letter-spacing: 0;
}

.reader-hero h1 {
  max-width: 960px;
  font-size: clamp(2rem, 4vw, 4.6rem);
  line-height: 0.96;
}

.reader-hero p:not(.eyebrow),
.section-heading p,
#detailSummary,
.reader-copy {
  color: #d7dee9;
  line-height: 1.56;
}

.reader-hero p:not(.eyebrow) {
  max-width: 840px;
  margin: 18px 0 0;
  font-size: 1.05rem;
}

.launch-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  max-width: 920px;
  margin-top: 22px;
}

.choice-button,
.choice-link {
  display: block;
  width: 100%;
  padding: 11px;
  color: var(--ink);
  text-decoration: none;
  text-align: left;
}

.choice-button strong,
.choice-button small,
.choice-link strong,
.choice-link small {
  display: block;
}

.choice-button strong,
.choice-link strong {
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.25;
}

.choice-button small,
.choice-link small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.workflow-overview,
.diagram-atlas,
.reader-board {
  padding: 22px;
  margin-bottom: 18px;
}

.section-heading {
  display: grid;
  gap: 4px;
  max-width: 980px;
}

.section-heading h2 {
  font-size: clamp(1.5rem, 3vw, 2.75rem);
  line-height: 1.02;
}

.atlas-heading {
  margin-bottom: 18px;
}

.diagram-atlas {
  position: relative;
  overflow: hidden;
}

.diagram-atlas::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(20, 184, 166, 0.08), transparent 26%),
    linear-gradient(180deg, rgba(96, 165, 250, 0.08), transparent 24%);
}

.diagram-feature {
  position: relative;
  display: grid;
  grid-template-columns: minmax(260px, 0.44fr) minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
  padding: 16px;
  border: 1px solid rgba(188, 199, 214, 0.2);
  border-radius: 8px;
  background: rgba(8, 13, 24, 0.64);
}

.diagram-feature + .diagram-feature {
  margin-top: 16px;
}

.diagram-feature.alternate {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.44fr);
}

.diagram-feature.alternate .diagram-copy {
  order: 2;
}

.diagram-feature.alternate .diagram-frame {
  order: 1;
}

.diagram-copy {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  padding: 14px;
}

.diagram-number {
  display: inline-grid;
  width: 42px;
  height: 42px;
  margin-bottom: 14px;
  place-items: center;
  border: 1px solid rgba(94, 234, 212, 0.52);
  border-radius: 50%;
  color: #031212;
  background: #5eead4;
  font-weight: 900;
}

.diagram-copy h3 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.25rem, 2.1vw, 2rem);
  line-height: 1.08;
}

.diagram-copy p:not(.eyebrow) {
  margin: 13px 0 0;
  color: #d7dee9;
  line-height: 1.55;
}

.diagram-points {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.diagram-points span {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 0 9px;
  border: 1px solid rgba(188, 199, 214, 0.24);
  border-radius: 999px;
  color: #dff7ff;
  background: rgba(13, 18, 30, 0.72);
  font-size: 0.76rem;
  font-weight: 800;
}

.diagram-frame {
  position: relative;
  display: grid;
  min-width: 0;
  margin: 0;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 8px;
  background: #f8fafc;
  isolation: isolate;
  touch-action: pan-y;
  user-select: none;
}

.diagram-frame img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 560px;
  object-fit: contain;
  transform: translate(0, 0) scale(1);
  transform-origin: center center;
  transition: transform 180ms ease, filter 180ms ease;
  will-change: transform;
  -webkit-user-drag: none;
  user-select: none;
}

.diagram-inspect-toggle {
  position: absolute;
  z-index: 3;
  top: 10px;
  left: 10px;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid rgba(15, 23, 42, 0.28);
  border-radius: 999px;
  color: #031b23;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 12px 28px rgba(2, 6, 23, 0.16);
  backdrop-filter: blur(10px);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
}

.diagram-inspect-toggle:hover,
.diagram-inspect-toggle:focus-visible {
  border-color: rgba(20, 184, 166, 0.72);
  color: #042f2e;
  background: rgba(204, 251, 241, 0.94);
}

.diagram-frame.inspect-active {
  cursor: grab;
  background:
    linear-gradient(rgba(2, 6, 23, 0.05), rgba(2, 6, 23, 0.05)),
    #f8fafc;
  touch-action: none;
}

.diagram-frame.inspect-active img {
  cursor: grab;
  filter: saturate(1.04) contrast(1.02);
}

.diagram-frame.inspect-active .diagram-inspect-toggle {
  color: #ecfeff;
  border-color: rgba(94, 234, 212, 0.72);
  background: rgba(8, 47, 73, 0.88);
}

.diagram-frame.dragging,
.diagram-frame.dragging img {
  cursor: grabbing;
}

.diagram-frame.dragging img {
  transition: none;
}

.diagram-zoom-controls {
  position: absolute;
  z-index: 3;
  top: 10px;
  right: 10px;
  display: none;
  gap: 6px;
  align-items: center;
  padding: 5px;
  border: 1px solid rgba(15, 23, 42, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 12px 28px rgba(2, 6, 23, 0.16);
  backdrop-filter: blur(10px);
}

.diagram-frame.inspect-active .diagram-zoom-controls {
  display: inline-flex;
}

.diagram-zoom-controls button {
  display: inline-grid;
  min-width: 36px;
  min-height: 32px;
  place-items: center;
  border: 1px solid rgba(15, 23, 42, 0.24);
  border-radius: 999px;
  color: #031b23;
  background: rgba(248, 250, 252, 0.94);
  font-size: 0.84rem;
  font-weight: 900;
  line-height: 1;
}

.diagram-zoom-controls button:hover,
.diagram-zoom-controls button:focus-visible {
  border-color: rgba(20, 184, 166, 0.72);
  color: #042f2e;
  background: rgba(204, 251, 241, 0.96);
}

.constellation-section {
  position: relative;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.constellation-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: end;
  margin-bottom: 16px;
}

.constellation-header h2 {
  max-width: 960px;
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.55rem, 3vw, 3rem);
  line-height: 1.02;
}

.constellation-header p:not(.eyebrow) {
  max-width: 860px;
  margin: 12px 0 0;
  color: #d7dee9;
  line-height: 1.56;
}

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

.constellation-actions button {
  min-height: 40px;
  min-width: 92px;
  border: 1px solid rgba(188, 199, 214, 0.3);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(13, 18, 30, 0.82);
  cursor: pointer;
  font-weight: 800;
}

.constellation-actions button:hover {
  border-color: rgba(94, 234, 212, 0.78);
  background: rgba(20, 184, 166, 0.16);
}

.constellation-shell {
  position: relative;
  min-height: min(72vh, 780px);
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 8px;
  background: #050608;
}

.constellation-shell canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: grab;
}

.constellation-shell canvas:active {
  cursor: grabbing;
}

.constellation-hud {
  position: absolute;
  z-index: 2;
  left: 14px;
  right: 14px;
  bottom: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}

.constellation-hud span,
.constellation-hud strong {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 0 10px;
  border: 1px solid rgba(188, 199, 214, 0.24);
  border-radius: 999px;
  color: #e5f5ff;
  background: rgba(7, 10, 18, 0.78);
  font-size: 0.76rem;
  line-height: 1;
  backdrop-filter: blur(10px);
}

.constellation-hud strong {
  max-width: min(720px, 100%);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.constellation-hint {
  position: absolute;
  z-index: 2;
  top: 14px;
  left: 14px;
  max-width: min(520px, calc(100% - 28px));
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(94, 234, 212, 0.24);
  border-radius: 8px;
  color: #d7dee9;
  background: rgba(7, 10, 18, 0.72);
  font-size: 0.85rem;
  line-height: 1.45;
  backdrop-filter: blur(12px);
}

.constellation-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.constellation-legend span {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid rgba(188, 199, 214, 0.22);
  border-radius: 999px;
  color: #d7dee9;
  background: rgba(13, 18, 30, 0.62);
  font-size: 0.78rem;
  font-weight: 800;
}

.constellation-legend i {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.legend-root {
  background: #5eead4;
}

.legend-folder {
  background: #a78bfa;
}

.legend-file {
  background: #dbeafe;
}

.legend-doc {
  background: #60a5fa;
}

.legend-runtime {
  background: #14b8a6;
}

.constellation-boundary {
  margin-top: 16px;
}

.section-heading h3,
.tour-section h3,
.outcome-card h3 {
  margin: 0;
  color: var(--ink);
  line-height: 1.2;
}

.compact-heading h3 {
  font-size: 1.1rem;
}

.stage-flow {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.stage-card {
  position: relative;
  min-height: 154px;
  padding: 38px 13px 13px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.045);
}

.stage-card::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -15px;
  width: 18px;
  height: 2px;
  background: rgba(148, 163, 184, 0.44);
}

.stage-card:last-child::after {
  display: none;
}

.stage-number,
.progress-number,
.workflow-number {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: #fff;
  font-weight: 900;
}

.stage-number {
  position: absolute;
  top: -12px;
  left: 14px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
}

.stage-card strong {
  display: block;
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.22;
}

.stage-card span {
  display: block;
  margin-top: 8px;
  color: var(--soft);
  font-size: 0.78rem;
  line-height: 1.36;
}

.principle-rail {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed rgba(148, 163, 184, 0.32);
}

.principle-item {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  min-height: 72px;
  padding: 10px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 8px;
  background: rgba(4, 7, 12, 0.38);
}

.principle-swatch {
  width: 8px;
  height: 100%;
  min-height: 42px;
  border-radius: 999px;
}

.principle-item strong {
  display: block;
  font-size: 0.78rem;
  line-height: 1.2;
}

.principle-item span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.32;
}

.selection-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
}

.selection-header h2 {
  font-size: clamp(2rem, 4vw, 4.2rem);
  line-height: 0.96;
}

#detailSummary {
  max-width: 820px;
  margin: 14px 0 0;
  font-size: 1.02rem;
}

.detail-meta,
.chip-list,
.mini-chip-list,
.next-selection-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.detail-meta {
  justify-content: flex-end;
  min-width: 220px;
}

.detail-meta span,
.chip-list span,
.mini-chip-list span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  max-width: 100%;
  padding: 0 10px;
  border: 1px solid rgba(188, 199, 214, 0.28);
  border-radius: 999px;
  color: #e5e7eb;
  background: rgba(13, 18, 30, 0.78);
  font-size: 0.78rem;
  line-height: 1.2;
}

.reader-section {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.tour-topline,
.stability-section,
.relation-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.54fr);
  gap: 18px;
  align-items: start;
}

.tour-progress,
.stability-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--soft);
  font-size: 0.78rem;
}

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

.stepper-actions button {
  padding: 0 10px;
}

.progress-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 0 8px;
}

.progress-dot {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  min-width: 128px;
  padding: 8px 10px;
  text-align: left;
}

.progress-dot span:last-child {
  color: var(--soft);
  font-size: 0.76rem;
  line-height: 1.2;
}

.reader-copy {
  margin: 0;
  font-size: 0.96rem;
}

.insight-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.insight-card,
.outcome-card {
  min-height: 128px;
  padding: 14px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.045);
}

.insight-label {
  display: block;
  color: #67e8f9;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.insight-card p,
.outcome-card p {
  margin: 8px 0 0;
  color: var(--soft);
  line-height: 1.48;
}

.composition-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.workflow-card {
  position: relative;
  min-height: 170px;
  padding: 13px;
  text-align: left;
  background: rgba(13, 18, 30, 0.72);
}

.workflow-card::after {
  content: "";
  position: absolute;
  top: 24px;
  right: -14px;
  width: 15px;
  height: 2px;
  background: rgba(148, 163, 184, 0.42);
}

.workflow-card:last-child::after {
  display: none;
}

.workflow-card strong {
  display: block;
  margin-top: 10px;
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.22;
}

.workflow-card small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.35;
}

.workflow-card p {
  margin: 10px 0 0;
  color: var(--soft);
  font-size: 0.8rem;
  line-height: 1.4;
}

.workflow-number {
  background: var(--teal);
}

.outcome-card {
  margin-top: 14px;
  min-height: 0;
  border-color: rgba(94, 234, 212, 0.36);
  background: rgba(20, 184, 166, 0.08);
}

.stability-meter {
  position: relative;
  height: 10px;
  margin-bottom: 10px;
  overflow: hidden;
  border: 1px solid rgba(188, 199, 214, 0.22);
  border-radius: 999px;
  background: rgba(13, 18, 30, 0.82);
}

.stability-meter span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f59e0b 0%, #60a5fa 48%, #5eead4 100%);
  transition: width 180ms ease;
}

.stability-row {
  margin-bottom: 10px;
}

.stability-row strong {
  color: var(--ink);
  font-size: 1rem;
}

.bond-list {
  display: grid;
  gap: 8px;
}

.bond-item {
  border-left: 2px solid rgba(94, 234, 212, 0.65);
  padding-left: 10px;
  color: var(--soft);
  font-size: 0.82rem;
  line-height: 1.42;
}

.bond-item strong {
  color: var(--ink);
}

.jump-button,
.next-button {
  min-height: 34px;
  padding: 0 10px;
  font-size: 0.78rem;
}

.map-pane {
  position: sticky;
  top: 86px;
  display: grid;
  gap: 14px;
  max-height: calc(100vh - 104px);
  overflow: auto;
}

.map-card,
.control-panel {
  padding: 14px;
}

.map-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.map-heading h2 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.2;
}

.map-status {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  min-height: 28px;
  padding: 0 8px;
  border: 1px solid rgba(94, 234, 212, 0.4);
  border-radius: 999px;
  color: #ccfbf1;
  background: rgba(20, 184, 166, 0.12);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.minimap-viewport {
  position: relative;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 1 / 0.72;
  min-height: 240px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 8px;
  background: #050608;
}

#explorer {
  position: absolute;
  inset: 0;
  width: 100%;
  max-width: 100%;
  height: 100%;
  cursor: grab;
}

#explorer:active {
  cursor: grabbing;
}

.panel-section + .panel-section {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(188, 199, 214, 0.18);
}

.stack-list {
  display: grid;
  gap: 8px;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.segmented-control button {
  min-width: 0;
  padding: 0 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.78rem;
  font-weight: 800;
  text-align: center;
}

.compact-choice {
  min-height: 74px;
}

.split-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}

.panel-copy {
  margin: 0 0 10px;
  color: var(--soft);
  font-size: 0.82rem;
  line-height: 1.45;
}

.atom-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
}

.atom-picker button {
  min-height: 34px;
  overflow-wrap: anywhere;
  border: 1px solid rgba(188, 199, 214, 0.22);
  border-radius: 8px;
  color: #e5e7eb;
  background: rgba(13, 18, 30, 0.7);
  cursor: pointer;
  font-size: 0.72rem;
  line-height: 1.15;
}

.atom-picker button.active,
.atom-picker button:hover {
  border-color: rgba(248, 250, 252, 0.76);
  background: rgba(248, 250, 252, 0.13);
}

.bond-legend {
  display: grid;
  gap: 7px;
}

.bond-legend-item {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  color: var(--soft);
  font-size: 0.76rem;
  line-height: 1.32;
}

.bond-legend-item strong {
  display: block;
  color: var(--ink);
  font-size: 0.78rem;
  line-height: 1.2;
}

.legend-swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-top: 2px;
  border: 1px solid rgba(248, 250, 252, 0.52);
  border-radius: 999px;
}

.status-panel {
  margin-top: 16px;
  padding: 12px;
  border: 1px solid rgba(188, 199, 214, 0.2);
  border-radius: 8px;
  background: rgba(13, 18, 30, 0.56);
}

.status-panel p:last-child {
  margin: 0;
  color: #d7dee9;
  font-size: 0.82rem;
  line-height: 1.45;
}

.filter-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 10px;
  font-size: 0.78rem;
}

@media (max-width: 1260px) {
  .reader-layout {
    display: flex;
    flex-direction: column;
  }

  .reader-pane {
    display: contents;
  }

  .reader-hero {
    order: 1;
    margin-bottom: 0;
  }

  .diagram-atlas {
    order: 2;
  }

  .map-pane {
    position: relative;
    top: auto;
    order: 3;
    width: 100%;
    max-height: none;
    overflow: visible;
  }

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

  .panel-section + .panel-section {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
  }

  .reader-board {
    order: 4;
  }

  .workflow-overview {
    order: 5;
  }
}

@media (max-width: 980px) {
  .app-shell {
    padding: 86px 12px 34px;
  }

  .topbar {
    flex-wrap: wrap;
  }

  .top-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .top-actions button {
    flex: 1;
  }

  .reader-hero,
  .diagram-atlas,
  .constellation-section,
  .workflow-overview,
  .reader-board,
  .map-card,
  .control-panel {
    padding: 16px;
  }

  .launch-actions,
  .diagram-feature,
  .diagram-feature.alternate,
  .constellation-header,
  .stage-flow,
  .principle-rail,
  .insight-grid,
  .selection-header,
  .tour-topline,
  .stability-section,
  .relation-section,
  .control-panel {
    grid-template-columns: 1fr;
  }

  .diagram-feature.alternate .diagram-copy,
  .diagram-feature.alternate .diagram-frame {
    order: initial;
  }

  .diagram-copy {
    padding: 4px;
  }

  .diagram-frame img {
    max-height: none;
  }

  .constellation-actions {
    width: 100%;
  }

  .constellation-actions button {
    flex: 1;
  }

  .constellation-shell {
    min-height: 620px;
  }

  .stage-card::after,
  .workflow-card::after {
    display: none;
  }

  .detail-meta {
    justify-content: flex-start;
    min-width: 0;
  }

  .minimap-viewport {
    min-height: 220px;
  }

}

@media (max-width: 560px) {
  .brand {
    align-items: flex-start;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .reader-hero h1,
  .selection-header h2 {
    font-size: 2rem;
  }

  .section-heading h2 {
    font-size: 1.55rem;
  }

  .split-actions,
  .stepper-actions {
    grid-template-columns: 1fr;
  }

  .constellation-shell {
    min-height: 560px;
  }

  .constellation-hud {
    left: 10px;
    right: 10px;
    bottom: 10px;
  }

  .constellation-hint {
    top: 10px;
    left: 10px;
    max-width: calc(100% - 20px);
    font-size: 0.78rem;
  }
}

@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;
  }
}
