:root {
  --lab-paper: #f7f3e8;
  --lab-vivid: #fffff8;
  --lab-ink: #11110f;
  --lab-night: #050505;
  --lab-red: #d83b30;
  --lab-oxblood: #8b0000;
  --lab-flow: #36cbd0;
  --lab-star: #e9b400;
  --lab-muted: #6d6b65;
  --lab-line: rgba(17, 17, 15, 0.2);
  --font-interface: "Inter", sans-serif;
  --font-reading: "Lora", Georgia, serif;
  --font-code: "IBM Plex Mono", monospace;
  --shell-h: 58px;
  --status-h: 28px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--lab-paper);
  color: var(--lab-ink);
  font-family: var(--font-interface);
  -webkit-font-smoothing: antialiased;
}

button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; }

.lab-skip {
  position: fixed;
  left: 8px;
  top: -80px;
  z-index: 1000;
  padding: 10px 14px;
  background: var(--lab-ink);
  color: var(--lab-vivid);
  font: 12px var(--font-code);
}

.lab-skip:focus { top: 8px; }

.lab-shell {
  align-items: stretch;
  background: rgba(247, 243, 232, 0.94);
  border-bottom: 1px solid var(--lab-ink);
  display: grid;
  grid-template-columns: 240px minmax(440px, 1fr) auto;
  height: var(--shell-h);
  left: 0;
  position: fixed;
  right: 0;
  top: 0;
  z-index: 300;
  backdrop-filter: blur(14px);
}

.lab-wordmark {
  align-items: center;
  border-right: 1px solid var(--lab-line);
  display: flex;
  gap: 10px;
  padding: 8px 14px;
  text-decoration: none;
}

.lab-mark {
  align-items: center;
  background: var(--lab-flow);
  border-radius: 50%;
  color: var(--lab-ink);
  display: inline-flex;
  font: 600 15px var(--font-code);
  height: 30px;
  justify-content: center;
  width: 30px;
}
.lab-mark img { border-radius: 50%; display: block; height: 100%; object-fit: cover; width: 100%; }

.lab-wordmark > span:last-child { display: grid; gap: 2px; }
.lab-wordmark b { font: 600 11px/1 var(--font-code); letter-spacing: 0.08em; }
.lab-wordmark small { color: var(--lab-muted); font: 9px/1 var(--font-code); letter-spacing: 0.06em; }

.branch-switcher { display: flex; justify-content: center; min-width: 0; }
.branch-switcher a {
  align-items: center;
  border-right: 1px solid var(--lab-line);
  display: flex;
  gap: 7px;
  min-width: 100px;
  padding: 0 16px;
  text-decoration: none;
  transition: background 160ms ease, color 160ms ease;
}
.branch-switcher a:first-child { border-left: 1px solid var(--lab-line); }
.branch-switcher i { color: var(--lab-muted); font: normal 9px var(--font-code); }
.branch-switcher span { font: 500 10px var(--font-code); letter-spacing: 0.05em; text-transform: uppercase; }
.branch-switcher a:hover, .branch-switcher a[aria-current="page"] { background: var(--lab-ink); color: var(--lab-vivid); }
.branch-switcher a[aria-current="page"] i { color: var(--lab-flow); }

.lab-actions { display: flex; }
.lab-actions button {
  background: transparent;
  border: 0;
  border-left: 1px solid var(--lab-line);
  color: inherit;
  font: 500 9px var(--font-code);
  letter-spacing: 0.05em;
  min-width: 70px;
  padding: 0 13px;
  text-transform: uppercase;
}
.lab-actions button:hover { background: rgba(17, 17, 15, 0.06); }
.lab-actions .lab-primary, .lab-primary { background: var(--lab-flow); color: var(--lab-ink); }
.lab-actions .lab-primary:hover, .lab-primary:hover { background: #5bd9dc; }

html[data-admin="false"] .lab-shell { grid-template-columns: 240px minmax(0, 1fr); }
html[data-admin="false"] [data-admin-only] { display: none !important; }
html[data-admin="false"] .branch-switcher { justify-content: flex-end; }
html[data-admin="false"] .branch-switcher a { min-width: 118px; justify-content: center; }
html[data-admin="false"] .lab-statusline { grid-template-columns: 240px 1fr auto; }
html[data-admin="false"] .lab-statusline > a { display: none; }

html[data-admin="false"][data-branch="red-protocol"],
html[data-admin="false"][data-branch="s26-solar-protocol"] { --status-h: 0px; }
html[data-admin="false"][data-branch="red-protocol"] body,
html[data-admin="false"][data-branch="s26-solar-protocol"] body { background: #070707; color: #f2f0e9; }
html[data-admin="false"][data-branch="red-protocol"] .lab-shell,
html[data-admin="false"][data-branch="s26-solar-protocol"] .lab-shell {
  background: rgba(7, 7, 7, .94);
  border-color: #393938;
  color: #f2f0e9;
}
html[data-admin="false"][data-branch="red-protocol"] .lab-shell *,
html[data-admin="false"][data-branch="s26-solar-protocol"] .lab-shell * { border-color: #393938; }
html[data-admin="false"][data-branch="red-protocol"] .lab-wordmark small,
html[data-admin="false"][data-branch="red-protocol"] .branch-switcher i { color: #aaa8a1; }
html[data-admin="false"][data-branch="s26-solar-protocol"] .lab-wordmark small,
html[data-admin="false"][data-branch="s26-solar-protocol"] .branch-switcher i { color: #aaa69b; }
html[data-admin="false"][data-branch="red-protocol"] .branch-switcher a:hover,
html[data-admin="false"][data-branch="red-protocol"] .branch-switcher a[aria-current="page"] { background: #ff4b43; color: #070707; }
html[data-admin="false"][data-branch="s26-solar-protocol"] .branch-switcher a:hover,
html[data-admin="false"][data-branch="s26-solar-protocol"] .branch-switcher a[aria-current="page"] { background: #e9b400; color: #050505; }
html[data-admin="false"][data-branch="red-protocol"] .status-led { background: #ff4b43; box-shadow: 0 0 8px #ff4b43; }
html[data-admin="false"][data-branch="s26-solar-protocol"] .status-led { background: #e9b400; box-shadow: 0 0 8px #e9b400; }
html[data-admin="false"][data-branch="red-protocol"] .lab-statusline,
html[data-admin="false"][data-branch="s26-solar-protocol"] .lab-statusline { display: none; }

.lab-statusline {
  align-items: center;
  background: var(--lab-ink);
  color: var(--lab-vivid);
  display: grid;
  font: 9px var(--font-code);
  grid-template-columns: 240px 1fr auto auto;
  height: var(--status-h);
  left: 0;
  letter-spacing: 0.04em;
  position: fixed;
  right: 0;
  text-transform: uppercase;
  top: var(--shell-h);
  z-index: 295;
}
.lab-statusline > * { border-right: 1px solid rgba(255,255,255,.14); height: 100%; align-items: center; display: flex; padding: 0 14px; }
.lab-statusline > *:last-child { border: 0; }
.lab-statusline a { color: #bcbcb6; text-decoration: none; }
.lab-statusline a:hover { color: var(--lab-flow); }
.status-led { background: var(--lab-flow); border-radius: 50%; display: inline-block; height: 6px; margin-right: 8px; box-shadow: 0 0 8px var(--lab-flow); width: 6px; }
#statusRevision { color: #aaa9a3; }

#labCanvas { min-height: 100vh; padding-top: calc(var(--shell-h) + var(--status-h)); }

.lab-boot { align-items: center; display: flex; gap: 12px; justify-content: center; min-height: calc(100vh - var(--shell-h) - var(--status-h)); font: 10px var(--font-code); text-transform: uppercase; }
.lab-boot i { animation: pulse 1.2s infinite; background: var(--lab-flow); border-radius: 50%; height: 10px; width: 10px; }
@keyframes pulse { 50% { opacity: .28; transform: scale(.7); } }

.section-rail {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: fixed;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 210;
}
.section-rail a { color: #999; height: 18px; overflow: hidden; position: relative; text-indent: 100%; transition: transform 160ms ease, color 160ms ease; white-space: nowrap; width: 18px; }
.section-rail a::after { background: currentColor; border-radius: 50%; content: ""; height: 5px; left: 50%; position: absolute; top: 50%; transform: translate(-50%,-50%); width: 5px; }
.section-rail a:hover, .section-rail a[aria-current="true"] { color: var(--lab-red); transform: scale(1.35); }
.section-rail a:focus-visible { outline: 2px solid var(--lab-flow); outline-offset: 1px; }

.lab-link-lens {
  --lens-accent: var(--lab-flow);
  background: rgba(7, 7, 7, .96);
  border: 1px solid var(--lens-accent);
  box-shadow: 8px 8px 0 rgba(0, 0, 0, .18);
  color: #f4f2eb;
  display: grid;
  gap: 8px;
  left: 0;
  max-width: min(330px, calc(100vw - 24px));
  min-width: 260px;
  padding: 15px 42px 15px 16px;
  pointer-events: none;
  position: fixed;
  top: 0;
  z-index: 680;
}
.lab-link-lens[hidden] { display: none; }
.lab-link-lens small { color: var(--lens-accent); font: 600 9px/1.25 var(--font-code); letter-spacing: .12em; text-transform: uppercase; }
.lab-link-lens b { font: 600 19px/1.08 var(--font-interface); }
.lab-link-lens p { color: #aaa8a1; font: 12px/1.45 var(--font-interface); margin: 0; }
.lab-link-lens i { height: 22px; position: absolute; right: 13px; top: 13px; width: 22px; }
.lab-link-lens i::before,
.lab-link-lens i::after { background: var(--lens-accent); content: ""; left: 50%; position: absolute; top: 50%; transform: translate(-50%, -50%); }
.lab-link-lens i::before { height: 1px; width: 22px; }
.lab-link-lens i::after { height: 22px; width: 1px; }

.lab-drawer {
  background: var(--lab-vivid);
  border-left: 1px solid var(--lab-ink);
  bottom: 0;
  color: var(--lab-ink);
  max-width: 100%;
  overflow: auto;
  padding-top: calc(var(--shell-h) + var(--status-h));
  position: fixed;
  right: 0;
  top: 0;
  width: min(640px, 100vw);
  z-index: 280;
  box-shadow: -24px 0 80px rgba(0,0,0,.16);
}
.lab-drawer > header { align-items: flex-start; border-bottom: 1px solid var(--lab-line); display: flex; justify-content: space-between; padding: 28px; }
.lab-drawer header small, .lab-dialog header small { color: var(--lab-red); font: 12px var(--font-code); letter-spacing: .08em; }
.lab-drawer h2, .lab-dialog h2 { font: 500 clamp(24px, 3vw, 38px)/1.1 var(--font-reading); margin: 8px 0 0; }
.lab-drawer header button { background: transparent; border: 1px solid var(--lab-line); font: 24px/1 var(--font-interface); height: 38px; width: 38px; }
#drawerContent { padding: 0 28px 40px; }

.memory-summary { border-bottom: 1px solid var(--lab-line); display: grid; grid-template-columns: repeat(3, 1fr); margin-bottom: 26px; }
.memory-summary div { border-right: 1px solid var(--lab-line); padding: 18px 8px; }
.memory-summary div:last-child { border: 0; }
.memory-summary b { display: block; font: 500 26px var(--font-reading); }
.memory-summary small { color: var(--lab-muted); font: 12px var(--font-code); text-transform: uppercase; }
.memory-list { display: grid; gap: 0; margin: 0; padding: 0; }
.memory-item { border-bottom: 1px solid var(--lab-line); display: grid; gap: 7px; padding: 18px 0; }
.memory-item > small { color: var(--lab-red); font: 12px var(--font-code); text-transform: uppercase; }
.memory-item h3 { font: 500 20px var(--font-interface); margin: 0; }
.memory-item p { color: var(--lab-muted); font: 16px/1.58 var(--font-interface); margin: 0; }
.memory-item footer { color: #8d8c86; display: flex; font: 12px var(--font-code); gap: 10px; justify-content: space-between; }
.empty-state { color: var(--lab-muted); font: 17px/1.6 var(--font-reading); padding: 42px 0; }

.research-card { border-bottom: 1px solid var(--lab-line); display: grid; gap: 12px; padding: 26px 0; }
.research-card .research-meta { align-items: center; display: flex; gap: 8px; }
.research-card .research-meta span { border: 1px solid var(--lab-red); color: var(--lab-red); font: 12px var(--font-code); padding: 4px 6px; text-transform: uppercase; }
.research-card .research-meta small { color: var(--lab-muted); font: 13px var(--font-interface); }
.research-card a { font: 500 22px/1.28 var(--font-interface); text-underline-offset: 5px; }
.research-card p { color: var(--lab-muted); font: 17px/1.55 var(--font-interface); margin: 0; }
.research-card ul { color: var(--lab-muted); font: 14px/1.6 var(--font-code); margin: 0; padding-left: 22px; }

.lab-dialog { background: var(--lab-vivid); border: 1px solid var(--lab-ink); color: var(--lab-ink); padding: 0; width: min(570px, calc(100vw - 32px)); }
.lab-dialog::backdrop { background: rgba(5,5,5,.64); backdrop-filter: blur(4px); }
.lab-dialog form { display: grid; gap: 18px; padding: 28px; }
.lab-dialog header { border-bottom: 1px solid var(--lab-line); margin: -28px -28px 4px; padding: 28px; }
.lab-dialog label, .lab-dialog legend { color: var(--lab-muted); display: grid; font: 9px var(--font-code); gap: 7px; letter-spacing: .05em; text-transform: uppercase; }
.lab-dialog input, .lab-dialog textarea, .lab-dialog select { background: transparent; border: 1px solid var(--lab-line); border-radius: 0; color: var(--lab-ink); font: 14px/1.45 var(--font-interface); min-height: 44px; padding: 10px; text-transform: none; }
.lab-dialog textarea { min-height: 90px; resize: vertical; }
.lab-dialog fieldset { border: 0; margin: 0; padding: 0; }
.score-grid { display: grid; grid-template-columns: repeat(5, 1fr); margin-top: 7px; }
.score-grid label { display: block; }
.score-grid input { clip: rect(0 0 0 0); clip-path: inset(50%); height: 1px; overflow: hidden; position: absolute; white-space: nowrap; width: 1px; }
.score-grid span { align-items: center; border: 1px solid var(--lab-line); display: flex; font: 14px var(--font-code); height: 44px; justify-content: center; }
.score-grid input:checked + span { background: var(--lab-ink); color: var(--lab-vivid); }
.dialog-actions { display: flex; justify-content: flex-end; margin-top: 8px; }
.dialog-actions button { background: transparent; border: 1px solid var(--lab-line); min-height: 44px; padding: 0 16px; font: 9px var(--font-code); text-transform: uppercase; }

.lab-toast { background: var(--lab-ink); bottom: 18px; color: var(--lab-vivid); font: 10px/1.4 var(--font-code); left: 50%; max-width: min(460px, calc(100vw - 32px)); padding: 12px 16px; position: fixed; transform: translateX(-50%); z-index: 500; }

/* Atlas */
.atlas-view { background: var(--lab-paper); min-height: calc(100vh - var(--shell-h) - var(--status-h)); overflow: hidden; }
.atlas-hero { border-bottom: 1px solid var(--lab-ink); display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(380px, .75fr); min-height: 590px; }
.atlas-copy { display: flex; flex-direction: column; justify-content: space-between; padding: clamp(42px, 6vw, 90px); }
.atlas-kicker { align-items: center; display: flex; gap: 10px; font: 9px var(--font-code); letter-spacing: .1em; text-transform: uppercase; }
.atlas-kicker i { background: var(--lab-red); display: inline-block; height: 1px; width: 46px; }
.atlas-copy h1 { font: 400 clamp(54px, 7.3vw, 118px)/.88 var(--font-reading); letter-spacing: -.06em; margin: 40px 0 28px; max-width: 920px; }
.atlas-copy h1 em { color: var(--lab-red); font-weight: 400; }
.atlas-copy > div > p { font: 20px/1.5 var(--font-reading); margin: 0; max-width: 650px; }
.atlas-copy footer { align-items: flex-end; color: var(--lab-muted); display: flex; font: 9px/1.5 var(--font-code); gap: 20px; justify-content: space-between; text-transform: uppercase; }
.atlas-copy footer strong { color: var(--lab-ink); font-weight: 500; }

.lineage-field { background: var(--lab-ink); color: var(--lab-vivid); min-height: 590px; overflow: hidden; position: relative; }
.lineage-field svg { height: 100%; inset: 0; position: absolute; width: 100%; }
.lineage-field .lineage-label { font: 9px var(--font-code); left: 24px; letter-spacing: .08em; position: absolute; top: 24px; text-transform: uppercase; z-index: 2; }
.lineage-field .lineage-count { bottom: 24px; font: 72px/.8 var(--font-reading); position: absolute; right: 24px; z-index: 2; }
.lineage-field .lineage-count small { color: #898983; display: block; font: 8px var(--font-code); letter-spacing: .08em; margin-top: 12px; text-align: right; text-transform: uppercase; }
.lineage-path { animation: lineage-dash 10s linear infinite; fill: none; stroke: var(--lab-flow); stroke-dasharray: 3 7; stroke-width: 1.5; }
.lineage-path.red { animation-direction: reverse; stroke: var(--lab-red); }
.lineage-node { fill: var(--lab-paper); stroke: var(--lab-night); stroke-width: 1; }
.lineage-node.active { fill: var(--lab-flow); filter: drop-shadow(0 0 9px rgba(54,203,208,.7)); }
@keyframes lineage-dash { to { stroke-dashoffset: -200; } }

.atlas-branches { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.branch-poster { border-right: 1px solid var(--lab-ink); color: inherit; display: grid; grid-template-rows: 220px auto; min-height: 480px; position: relative; text-decoration: none; }
.branch-poster:last-child { border-right: 0; }
.branch-poster:hover .poster-enter { transform: translateX(6px); }
.poster-preview { border-bottom: 1px solid var(--lab-ink); overflow: hidden; position: relative; }
.poster-copy { display: flex; flex-direction: column; gap: 18px; justify-content: space-between; padding: 28px; }
.poster-copy header { align-items: center; display: flex; font: 9px var(--font-code); justify-content: space-between; text-transform: uppercase; }
.poster-copy h2 { font: 500 clamp(25px, 2.4vw, 40px)/1.05 var(--font-reading); margin: 0; }
.poster-copy p { color: var(--lab-muted); font: 13px/1.55 var(--font-interface); margin: 0; max-width: 40ch; }
.poster-copy footer { align-items: center; display: flex; font: 9px var(--font-code); justify-content: space-between; text-transform: uppercase; }
.poster-enter { color: var(--lab-red); transition: transform 180ms ease; }
.poster-status { align-items: center; display: flex; gap: 6px; }
.poster-status i { background: currentColor; border-radius: 50%; height: 5px; width: 5px; }

.preview-field { background: #fffaf2; }
.preview-field::before { background: repeating-linear-gradient(90deg, transparent 0 74px, rgba(20,20,19,.15) 75px 76px); content: ""; inset: 0; position: absolute; }
.preview-field .sun { background: var(--lab-star); border-radius: 50%; height: 78px; left: 18%; position: absolute; top: 26%; width: 78px; }
.preview-field .note { background: #fffaf2; border: 1px solid var(--lab-ink); bottom: 22px; font: 10px/1.4 var(--font-code); padding: 12px; position: absolute; right: 12%; transform: rotate(-2deg); width: 46%; }
.preview-field .stem { border-left: 1px solid var(--lab-ink); bottom: 0; height: 80px; left: 30%; position: absolute; transform: rotate(12deg); }

.preview-report { background: var(--lab-vivid); display: grid; grid-template-columns: 55% 45%; }
.preview-report .tiny-copy { background: repeating-linear-gradient(180deg, var(--lab-ink) 0 1px, transparent 1px 13px); height: 96px; left: 18px; opacity: .5; position: absolute; top: 36px; width: calc(55% - 36px); }
.preview-report .plate { background: radial-gradient(circle, var(--lab-oxblood) 0 1.4px, transparent 1.7px) 0 0/7px 7px; border: 1px solid var(--lab-oxblood); height: 118px; position: absolute; right: 18px; top: 26px; width: 34%; }
.preview-report .curve { border-bottom: 2px dashed var(--lab-oxblood); border-radius: 50%; bottom: 28px; height: 60px; position: absolute; right: 22px; width: 42%; }

.preview-runtime { background: var(--lab-night); color: white; }
.preview-runtime::before { background: var(--lab-red); content: ""; height: 2px; left: 0; position: absolute; right: 40%; top: 0; }
.preview-runtime .runtime-title { font: 30px var(--font-code); left: 28px; position: absolute; top: 50px; }
.preview-runtime .runtime-title b { color: var(--lab-red); font-weight: 400; }
.preview-runtime .runtime-code { border-left: 2px solid #333; bottom: 24px; color: #898989; font: 8px/1.6 var(--font-code); padding-left: 12px; position: absolute; right: 22px; white-space: pre; }

.preview-minimal { background: #fffaf2; color: var(--lab-ink); }
.preview-minimal::before { background: var(--lab-star); border-radius: 50%; content: ""; height: 150px; position: absolute; right: -25px; top: -42px; width: 150px; }
.preview-minimal span { font: 600 clamp(25px, 2.8vw, 42px)/.92 var(--font-code); left: 22px; letter-spacing: -.08em; position: absolute; top: 34px; }
.preview-minimal i { background: var(--lab-ink); bottom: 34px; height: 1px; left: 22px; position: absolute; right: 22px; }
.preview-minimal b { bottom: 8px; font: 400 26px var(--font-code); position: absolute; right: 22px; }

.preview-red { background: #070707; color: #f2f0e9; }
.preview-red .fig { color: rgba(242, 240, 233, .55); font: 8px var(--font-code); left: 22px; letter-spacing: .18em; position: absolute; top: 20px; }
.preview-red b { font: 700 clamp(24px, 2.6vw, 38px)/.9 var(--font-interface); left: 22px; letter-spacing: -.05em; position: absolute; top: 44px; }
.preview-red i { border: 1px solid #ff4b43; height: 74px; position: absolute; right: 24px; top: 44px; transform: rotate(45deg); width: 74px; }
.preview-red::after { background: #ff4b43; bottom: 26px; content: ""; height: 2px; left: 22px; position: absolute; width: 58px; }

.preview-focus { background: #fff; color: #050505; }
.preview-focus span { font: 8px var(--font-code); left: 20px; letter-spacing: .05em; position: absolute; top: 18px; }
.preview-focus b { font: 700 clamp(23px, 2.3vw, 34px)/.9 "JetBrains Mono", var(--font-code); left: 20px; letter-spacing: -.06em; position: absolute; top: 58px; }
.preview-focus i { border-bottom: 1px solid #050505; border-top: 1px solid #050505; bottom: 38px; left: 20px; position: absolute; right: 20px; top: 142px; }
.preview-focus i::after { background: #050505; content: ""; height: 100%; left: 42%; position: absolute; width: 38%; }
.preview-focus em { bottom: 14px; color: #8b8b8b; font: normal 8px var(--font-code); position: absolute; right: 20px; }

.atlas-kernel { border-top: 1px solid var(--lab-ink); display: grid; grid-template-columns: 1fr 1.5fr; }
.kernel-thesis { border-right: 1px solid var(--lab-ink); padding: 44px; }
.kernel-thesis small { color: var(--lab-red); font: 9px var(--font-code); text-transform: uppercase; }
.kernel-thesis h2 { font: 400 clamp(32px, 4vw, 60px)/1.06 var(--font-reading); letter-spacing: -.03em; margin: 18px 0 28px; }
.kernel-thesis p { color: var(--lab-muted); font: 15px/1.6 var(--font-interface); max-width: 52ch; }
.kernel-tokens { display: grid; grid-template-columns: repeat(3, 1fr); }
.kernel-token { border-bottom: 1px solid var(--lab-line); border-right: 1px solid var(--lab-line); display: flex; flex-direction: column; justify-content: space-between; min-height: 150px; padding: 20px; }
.kernel-token:nth-child(3n) { border-right: 0; }
.kernel-token b { font: 24px var(--font-reading); }
.kernel-token small { font: 8px var(--font-code); text-transform: uppercase; }
.token-swatch { border: 1px solid rgba(0,0,0,.16); height: 28px; width: 28px; }

.atlas-pipeline { background: var(--lab-ink); color: var(--lab-vivid); padding: clamp(52px, 7vw, 100px); }
.atlas-pipeline > header { display: grid; gap: 22px; grid-template-columns: .7fr 1.6fr .7fr; margin-bottom: 70px; }
.atlas-pipeline > header small { color: var(--lab-flow); font: 8px var(--font-code); letter-spacing: .08em; text-transform: uppercase; }
.atlas-pipeline > header h2 { font: 400 clamp(36px, 4.6vw, 70px)/1.05 var(--font-reading); letter-spacing: -.035em; margin: 0; }
.atlas-pipeline > header p { color: #8d8d88; font: 12px/1.6 var(--font-interface); margin: 0; }
.atlas-pipeline ol { border-left: 1px solid #363633; border-top: 1px solid #363633; display: grid; grid-template-columns: repeat(3, 1fr); list-style: none; margin: 0; padding: 0; }
.atlas-pipeline li { border-bottom: 1px solid #363633; border-right: 1px solid #363633; display: grid; gap: 14px; grid-template-columns: 30px 1fr; min-height: 240px; padding: 20px; }
.atlas-pipeline li > span { color: var(--lab-flow); font: 8px var(--font-code); }
.atlas-pipeline li small { color: var(--lab-red); font: 7px var(--font-code); text-transform: uppercase; }
.atlas-pipeline li h3 { font: 500 20px var(--font-code); margin: 30px 0 13px; }
.atlas-pipeline li p { color: #aaa9a3; font: 11px/1.55 var(--font-interface); }
.atlas-pipeline li footer { color: #666660; font: 7px/1.55 var(--font-code); margin-top: 24px; text-transform: uppercase; }
.atlas-pipeline > footer { border-top: 1px solid #363633; color: #777772; display: flex; font: 7px var(--font-code); gap: 28px; justify-content: flex-end; padding-top: 15px; text-transform: uppercase; }

/* Compare */
.compare-view { background: #d4d2cc; min-height: calc(100vh - var(--shell-h) - var(--status-h)); padding: 18px; }
.compare-head { align-items: end; display: flex; gap: 20px; justify-content: space-between; padding: 10px 0 18px; }
.compare-head h1 { font: 500 30px var(--font-reading); margin: 0; }
.compare-head p { color: var(--lab-muted); font: 11px var(--font-code); margin: 6px 0 0; }
.compare-controls { display: flex; gap: 7px; }
.compare-controls label { color: var(--lab-muted); display: grid; font: 8px var(--font-code); gap: 4px; text-transform: uppercase; }
.compare-controls select { background: var(--lab-vivid); border: 1px solid var(--lab-ink); color: var(--lab-ink); font: 9px var(--font-code); min-height: 36px; padding: 0 10px; }
.compare-grid { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.compare-frame { background: var(--lab-vivid); border: 1px solid var(--lab-ink); height: calc(100vh - 176px); overflow: hidden; position: relative; }
.compare-frame iframe { border: 0; height: 100%; width: 100%; }
.compare-frame > span { background: var(--lab-ink); color: white; font: 8px var(--font-code); left: 8px; padding: 5px 7px; position: absolute; top: 8px; z-index: 2; }

html[data-embed="true"] .lab-shell,
html[data-embed="true"] .lab-statusline,
html[data-embed="true"] .section-rail { display: none !important; }
html[data-embed="true"] #labCanvas { padding-top: 0; }
html[data-embed="true"] .renderer-feedback { display: none; }

.renderer-feedback {
  align-items: center;
  background: var(--lab-flow);
  border: 1px solid var(--lab-ink);
  border-radius: 50%;
  bottom: 24px;
  display: flex;
  font: 600 9px var(--font-code);
  height: 54px;
  justify-content: center;
  position: fixed;
  right: 24px;
  text-transform: uppercase;
  width: 54px;
  z-index: 220;
  box-shadow: 4px 4px 0 var(--lab-ink);
}

@media (max-width: 1240px) {
  .atlas-branches { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .branch-poster:nth-child(2n) { border-right: 0; }
  .branch-poster { border-bottom: 1px solid var(--lab-ink); }
}

@media (max-width: 1080px) {
  .lab-shell { grid-template-columns: 190px 1fr auto; }
  html[data-admin="false"] .lab-shell { grid-template-columns: 190px 1fr; }
  html[data-admin="false"] .lab-statusline { grid-template-columns: 190px 1fr auto; }
  .lab-wordmark { padding-left: 10px; }
  .branch-switcher a { min-width: auto; padding: 0 10px; }
  .lab-actions button { min-width: 56px; padding: 0 9px; }
  .lab-statusline { grid-template-columns: 190px 1fr auto; }
  #statusRevision { display: none; }
  .atlas-hero { grid-template-columns: 1fr 380px; }
}

@media (max-width: 820px) {
  :root { --shell-h: 104px; --status-h: 25px; }
  .lab-shell { grid-template-columns: 1fr auto; grid-template-rows: 54px 50px; height: var(--shell-h); }
  html[data-admin="false"] .lab-shell { grid-template-columns: 1fr; }
  .lab-wordmark { border-bottom: 1px solid var(--lab-line); border-right: 0; }
  .lab-actions { border-bottom: 1px solid var(--lab-line); grid-column: 2; grid-row: 1; }
  .lab-actions button { display: none; }
  .lab-actions button[data-action="memory"], .lab-actions .lab-primary { display: block; min-width: 62px; }
  .branch-switcher { grid-column: 1 / -1; grid-row: 2; overflow-x: auto; justify-content: flex-start; }
  .branch-switcher a { flex: 1; justify-content: center; min-width: 78px; }
  html[data-admin="false"] .branch-switcher a { flex: 1 0 78px; min-width: 78px; padding: 0 7px; }
  html[data-admin="false"] .branch-switcher span { font-size: 8px; letter-spacing: .025em; }
  .lab-statusline { grid-template-columns: auto 1fr auto; }
  #statusHypothesis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .lab-statusline a { display: none; }
  .section-rail { display: none !important; }
  .atlas-hero { display: block; }
  .atlas-copy { min-height: 560px; padding: 38px 22px; }
  .atlas-copy h1 { font-size: clamp(52px, 18vw, 78px); }
  .atlas-copy > div > p { font-size: 17px; }
  .lineage-field { min-height: 380px; }
  .atlas-branches { display: block; }
  .branch-poster { border-bottom: 1px solid var(--lab-ink); border-right: 0; grid-template-rows: 210px auto; min-height: 420px; }
  .atlas-kernel { display: block; }
  .kernel-thesis { border-bottom: 1px solid var(--lab-ink); border-right: 0; padding: 32px 22px; }
  .kernel-tokens { grid-template-columns: repeat(2, 1fr); }
  .kernel-token:nth-child(3n) { border-right: 1px solid var(--lab-line); }
  .kernel-token:nth-child(2n) { border-right: 0; }
  .atlas-pipeline { padding: 55px 20px; }
  .atlas-pipeline > header { grid-template-columns: 1fr; }
  .atlas-pipeline ol { grid-template-columns: 1fr; }
  .atlas-pipeline > footer { align-items: flex-start; flex-direction: column; gap: 7px; }
  .compare-view { padding: 8px; }
  .compare-head { align-items: flex-start; flex-direction: column; }
  .compare-controls { width: 100%; }
  .compare-controls label { flex: 1; }
  .compare-controls select { width: 100%; }
  .compare-grid { grid-template-columns: 1fr; }
  .compare-frame { height: 68vh; }
  .lab-drawer { padding-top: var(--shell-h); }
  .lab-link-lens { display: none !important; }
}

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