/* The notebook is independent of the cinematic runtime. Shared fonts are copied locally. */
.notebook-body {
  --ink: #e8eaf0;
  --muted: #a1a9b9;
  --faint: #727d90;
  --surface: #111722;
  --surface-raised: #171f2d;
  --edge: #2a3445;
  --accent: #e7bd83;
  --accent-soft: #b79872;
  --font-body: "Manrope", system-ui, sans-serif;
  --font-display: "Michroma", "Manrope", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  margin: 0;
  background: #0b1019;
  color: var(--ink);
  font: 14px/1.65 var(--font-body);
  color-scheme: dark;
  -webkit-font-smoothing: antialiased;
}
.notebook-body *, .notebook-body *::before, .notebook-body *::after { box-sizing: border-box; }
.notebook-body a { color: inherit; text-decoration-color: #667082; text-underline-offset: 4px; }
.notebook-body button, .notebook-body select { font: inherit; }
.notebook-body button, .notebook-body select, .notebook-body summary { -webkit-tap-highlight-color: transparent; }
.notebook-body button { cursor: pointer; }
.notebook-body :focus-visible { outline: 2px solid #f1c88b; outline-offset: 4px; }
.notebook-body img { max-width: 100%; }
.notebook-body h1, .notebook-body h2, .notebook-body h3, .notebook-body h4, .notebook-body p { margin-top: 0; }
.notebook-body h2 { font-size: 22px; line-height: 1.3; letter-spacing: -.025em; }
.notebook-body h3 { font-size: 17px; line-height: 1.45; letter-spacing: -.015em; }
.notebook-body h4 { font-size: 14px; line-height: 1.5; }
.notebook-body p { margin-bottom: 14px; }
.notebook-body ul { padding-left: 20px; }
.notebook-body li::marker { color: var(--accent-soft); }
.notebook-body .skip-link { position: fixed; top: -100px; left: 18px; z-index: 100; padding: 12px 20px; background: var(--ink); color: #0b1019; border-radius: 4px; }
.notebook-body .skip-link:focus { top: 12px; }
.notebook-body .site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 76px;
  padding: 13px max(24px, calc((100vw - 1472px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--edge);
  background: #0b1019f5;
  backdrop-filter: blur(12px);
}
.notebook-body .brand { display: flex; align-items: center; min-height: 44px; gap: 12px; text-decoration: none; }
.notebook-body .brand img, .notebook-body .brand svg { width: 31px; height: 31px; object-fit: contain; flex: none; }
.notebook-body .brand strong, .notebook-body .brand-name { display: block; font-family: var(--font-display); font-size: 13px; font-weight: 400; letter-spacing: .06em; }
.notebook-body .brand small, .notebook-body .brand-description { display: block; margin-top: 2px; color: var(--faint); font-family: var(--font-mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.notebook-body .brand-diamond { color: var(--accent); font-size: 19px; line-height: 1; }
.notebook-body .brand-context { border-left: 1px solid var(--edge); padding-left: 12px; color: var(--faint); font: 10px var(--font-mono); white-space: nowrap; }
.notebook-body .source-link { color: var(--muted); min-height: 44px; display: inline-flex; align-items: center; font-size: 11px; white-space: nowrap; }
.notebook-body .page-tabs { display: flex; align-items: center; gap: 6px; }
.notebook-body .page-tabs a { display: inline-flex; align-items: center; min-height: 44px; padding: 9px 14px; border-radius: 5px; text-decoration: none; font-size: 12px; font-weight: 600; color: var(--muted); }
.notebook-body .page-tabs a[aria-current="page"] { background: #1c2635; color: #f4d0a0; }
.notebook-body .page-tabs a:hover { background: #17202e; color: var(--ink); }
.notebook-body .workspace { display: grid; grid-template-columns: 186px minmax(0, 1fr); gap: 34px; max-width: 1472px; margin: auto; padding: 32px 24px 80px; }
.notebook-body .world-rail { position: sticky; top: 108px; align-self: start; max-height: calc(100dvh - 128px); overflow-y: auto; scrollbar-width: thin; padding: 2px 12px 8px 0; }
.notebook-body .world-rail .eyebrow { margin-bottom: 12px; padding-left: 10px; color: var(--faint); }
.notebook-body .world-rail nav, .notebook-body .world-rail ul, .notebook-body .world-rail ol { list-style: none; padding: 0; margin: 0; display: grid; gap: 1px; }
.notebook-body .world-rail li { list-style: none; }
.notebook-body .world-rail a { display: flex; align-items: center; gap: 9px; min-height: 34px; padding: 5px 10px; border-left: 2px solid transparent; border-radius: 0 4px 4px 0; font-size: 12px; text-decoration: none; color: var(--muted); }
.notebook-body .world-rail a:hover { background: #151e2b; color: #e8eaf0; }
.notebook-body .world-rail a[aria-current="location"] { color: #edc997; background: #1c2635; border-left-color: var(--accent); }
.notebook-body .world-rail .rail-index { min-width: 20px; color: var(--faint); font: 10px var(--font-mono); }
.notebook-body .world-rail .nav-index { min-width: 20px; color: var(--faint); font: 10px var(--font-mono); }
.notebook-body .mobile-jump { display: none; }
.notebook-body .rail-note { color: var(--faint); margin: 20px 0 0 10px; font-size: 10px; line-height: 1.8; }
.notebook-body .world-rail select, .notebook-body select[data-world-jump] { display: none; }
.notebook-body .document { min-width: 0; }
.notebook-body .document-head { margin-bottom: 30px; }
.notebook-body h1, .notebook-body .document-title { font-size: clamp(28px, 3.3vw, 46px); line-height: 1.15; letter-spacing: -.05em; font-weight: 600; margin-bottom: 16px; }
.notebook-body .eyebrow { margin-bottom: 10px; font: 10px/1.5 var(--font-mono); letter-spacing: .15em; text-transform: uppercase; color: var(--accent); }
.notebook-body .lede { max-width: 740px; font-size: 15px; color: #b9c1cf; line-height: 1.75; }
.notebook-body .muted { color: var(--muted); }
.notebook-body .source-note { color: var(--muted); font-size: 11px; line-height: 1.7; overflow-wrap: anywhere; }
.notebook-body .source-note code { color: #c8d0dd; font: 10px var(--font-mono); }
.notebook-body .document-tools, .notebook-body .toolbar, .notebook-body .summary-strip { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.notebook-body .summary-strip { padding: 12px 0; border-top: 1px solid var(--edge); border-bottom: 1px solid var(--edge); gap: 12px 24px; }
.notebook-body .summary-strip strong { font-size: 17px; color: var(--ink); }
.notebook-body .summary-strip span { color: var(--muted); font-size: 11px; }
.notebook-body .document-stats { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; margin: 22px 0 0; padding: 14px 0; border-top: 1px solid var(--edge); border-bottom: 1px solid var(--edge); }
.notebook-body .document-stats span { color: var(--muted); font-size: 11px; }
.notebook-body .document-stats strong { margin-right: 5px; font: 18px var(--font-mono); color: #dbe2ed; }
.notebook-body:not(.notebook-enhanced) [data-expand-worlds], .notebook-body:not(.notebook-enhanced) [data-collapse-worlds] { display: none; }
.notebook-body .button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; gap: 7px; padding: 8px 14px; background: #17202d; border: 1px solid #344053; border-radius: 4px; color: #dbe0e9; font-size: 12px; text-decoration: none; }
.notebook-body .button:hover { background: #263143; border-color: #556276; }
.notebook-body .button:disabled { cursor: default; opacity: .4; }
.notebook-body .button-primary { color: #121925; background: var(--accent); border-color: var(--accent); font-weight: 700; }
.notebook-body .button-primary:hover { background: #f2cc95; border-color: #f2cc95; }
.notebook-body .badge { display: inline-flex; align-items: center; padding: 3px 7px; border: 1px solid #3c4657; border-radius: 3px; font: 9px/1.4 var(--font-mono); letter-spacing: .025em; text-transform: uppercase; color: #bac4d3; background: #192231; white-space: nowrap; }
.notebook-body .badge[data-status="PASS"], .notebook-body .badge.pass { color: #b5d4bb; border-color: #37553e; background: #15281c; }
.notebook-body .badge[data-status="FAIL"], .notebook-body .badge.fail { color: #f0b3ad; border-color: #714038; background: #361f1e; }
.notebook-body .badge[data-status="NOT RUN"], .notebook-body .badge.pending { color: #edcda2; border-color: #65543e; background: #30281c; }
.notebook-body .world-block { scroll-margin-top: 94px; margin-bottom: 16px; border: 1px solid var(--edge); border-radius: 6px; background: var(--surface); overflow: clip; }
.notebook-body .world-head { position: relative; display: flex; align-items: center; gap: 16px; min-height: 70px; padding: 16px 24px; cursor: pointer; list-style: none; }
.notebook-body .world-head::-webkit-details-marker { display: none; }
.notebook-body .world-head::after { content: "+"; margin-left: auto; padding: 0 0 0 12px; color: var(--accent); font: 22px/1 var(--font-mono); font-weight: 400; }
.notebook-body .world-block[open] > .world-head::after { content: "−"; }
.notebook-body .world-head:hover { background: #17202d; }
.notebook-body .world-head h2, .notebook-body .world-head h3 { margin: 0; }
.notebook-body .world-head > div { min-width: 0; flex: 1; }
.notebook-body .world-head p { margin: 3px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.notebook-body .world-status { color: var(--accent-soft); font: 9px/1.6 var(--font-mono); white-space: nowrap; }
.notebook-body .world-head .eyebrow { margin: 0; }
.notebook-body .world-number { width: 30px; flex: none; color: var(--faint); font: 12px var(--font-mono); }
.notebook-body .world-meta, .notebook-body .world-count { color: var(--muted); font: 10px/1.6 var(--font-mono); }
.notebook-body .section-body { padding: 6px 24px 24px; border-top: 1px solid var(--edge); }
.notebook-body .section-body > .source-note { padding-top: 14px; }
.notebook-body .scene-grid { list-style: none; margin: 18px 0 24px; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px 16px; }
.notebook-body .scene-card { min-width: 0; list-style: none; }
.notebook-body .card-heading { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 7px; }
.notebook-body .scene-card .card-heading .eyebrow { margin: 0; }
.notebook-body .scene-card > .muted { font-size: 11px; margin: 0 0 8px; }
.notebook-body details.source-note > summary { display: flex; align-items: center; gap: 7px; min-height: 44px; cursor: pointer; font-size: 10px; }
.notebook-body details.source-note > summary::before { content: "+"; color: var(--faint); font: 12px var(--font-mono); }
.notebook-body details.source-note[open] > summary::before { content: "−"; }
.notebook-body details.source-note > summary::-webkit-details-marker { display: none; }
.notebook-body .scene-card > a { display: block; text-decoration: none; }
.notebook-body .media-frame { width: 100%; height: 174px; display: grid; place-items: center; background: #070b11; border: 1px solid #263040; border-radius: 4px; overflow: hidden; }
.notebook-body .media-frame img { width: 100%; height: 100%; object-fit: contain; display: block; }
.notebook-body a[data-viewer]:hover .media-frame { border-color: #c3a175; }
.notebook-body .scene-card h3, .notebook-body .scene-card h4 { margin: 8px 0 4px; font-size: 12px; font-weight: 600; line-height: 1.5; }
.notebook-body .scene-card .eyebrow { margin-top: 10px; margin-bottom: 3px; font-size: 9px; letter-spacing: .04em; }
.notebook-body .scene-caption { color: var(--muted); font-size: 11px; line-height: 1.55; margin-top: 8px; }
.notebook-body .state-list { display: grid; gap: 5px; list-style: none; margin: 9px 0 0; padding: 0; }
.notebook-body .beat-state { display: flex; gap: 8px; font-size: 10px; line-height: 1.5; color: #aab5c6; }
.notebook-body .beat-index { display: inline-block; min-width: 27px; flex: none; color: #ddbd95; font: 9px/1.6 var(--font-mono); }
.notebook-body .asset-tray { margin: 16px 0; border: 1px solid #293445; border-radius: 4px; background: #0c131e; }
.notebook-body .asset-tray > summary { padding: 11px 14px; cursor: pointer; font-size: 11px; color: #b6c1d1; }
.notebook-body .asset-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; padding: 14px; }
.notebook-body .asset-card { min-width: 0; margin: 0; }
.notebook-body .asset-card figcaption { margin-top: 7px; line-height: 1.55; }
.notebook-body .asset-card figcaption strong { display: block; font-size: 10px; font-weight: 600; }
.notebook-body .asset-card figcaption span { display: block; font-size: 9px; }
.notebook-body .asset-card a { display: block; text-decoration: none; }
.notebook-body .asset-card .media-frame { height: 110px; border-color: #263244; }
.notebook-body .asset-card h3, .notebook-body .asset-card h4, .notebook-body .asset-card .asset-name { font-size: 10px; line-height: 1.5; margin: 7px 0 3px; overflow-wrap: anywhere; }
.notebook-body .asset-card .source-note { font-size: 9px; }
.notebook-body .checkerboard { background-color: #121c29; background-image: linear-gradient(45deg, #1b2939 25%, transparent 25%), linear-gradient(-45deg, #1b2939 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #1b2939 75%), linear-gradient(-45deg, transparent 75%, #1b2939 75%); background-size: 16px 16px; background-position: 0 0, 0 8px, 8px -8px, -8px 0; }
.notebook-body .flight-card { position: relative; margin: 0 0 16px; padding: 20px 24px; border: 1px solid #263347; border-radius: 6px; background: #101a29; }
.notebook-body .flight-card::before { position: absolute; content: ""; top: 22px; bottom: 22px; left: -19px; width: 1px; background: #41526a; }
.notebook-body .flight-card h3 { font-size: 14px; margin-bottom: 5px; }
.notebook-body .flight-heading .eyebrow { margin-bottom: 5px; }
.notebook-body .flight-heading h2 { font-size: 16px; margin-bottom: 6px; }
.notebook-body .flight-heading .muted { font-size: 11px; margin-bottom: 0; }
.notebook-body details.flight-card { padding-top: 10px; padding-bottom: 10px; }
.notebook-body details.flight-card[open] { padding-bottom: 20px; }
.notebook-body details.flight-card > summary.flight-heading { display: flex; align-items: center; flex-wrap: wrap; min-height: 44px; gap: 5px 15px; cursor: pointer; list-style: none; }
.notebook-body details.flight-card > summary.flight-heading::-webkit-details-marker { display: none; }
.notebook-body details.flight-card > summary.flight-heading::after { content: "+"; margin-left: auto; color: var(--accent); font: 20px var(--font-mono); }
.notebook-body details.flight-card[open] > summary.flight-heading::after { content: "−"; }
.notebook-body details.flight-card > summary.flight-heading h2, .notebook-body details.flight-card > summary.flight-heading .eyebrow { margin: 0; }
.notebook-body .flight-beats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; list-style: none; margin: 15px 0 0; padding: 0; }
.notebook-body .flight-beat { min-width: 0; }
.notebook-body .flight-beat .media-frame { height: 128px; }
.notebook-body .flight-beat h4 { margin: 7px 0 0; font-size: 11px; }
.notebook-body .flight-beat h3 { margin: 7px 0 0; font-size: 11px; }
.notebook-body .flight-beat .eyebrow { display: block; margin: 9px 0 4px; }
.notebook-body .expansion-placeholder { padding: 17px 18px; margin-top: 18px; border: 1px dashed #46515f; border-radius: 4px; background: #141b25; }
.notebook-body .expansion-placeholder h3 { font-size: 13px; margin-bottom: 5px; }
.notebook-body .expansion-placeholder p { font-size: 11px; color: var(--muted); margin-bottom: 8px; }
.notebook-body .expansion-placeholder p:last-child { margin-bottom: 0; }
.notebook-body .expansion-placeholder .badge { font-size: 9px; }
.notebook-body .document-section { scroll-margin-top: 98px; margin-bottom: 32px; }
.notebook-body .document-section > h2 { border-bottom: 1px solid var(--edge); padding-bottom: 14px; margin-bottom: 20px; }
.notebook-body .current-slice { padding: 24px; margin: 24px 0 30px; border: 1px solid #5b4c38; border-radius: 6px; background: linear-gradient(115deg, #272317, #15202d 80%); }
.notebook-body .current-slice h2 { font-size: 20px; margin-bottom: 10px; }
.notebook-body .current-slice p { font-size: 12px; max-width: 780px; }
.notebook-body .current-slice .workflow-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 12px; margin-bottom: 16px; }
.notebook-body .workflow-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 20px 0 30px; }
.notebook-body .workflow-step { position: relative; padding: 18px; border: 1px solid var(--edge); border-radius: 5px; background: #111a27; }
.notebook-body .workflow-step h3 { font-size: 12px; margin: 7px 0; }
.notebook-body .workflow-step h2 { font-size: 15px; line-height: 1.55; margin: 10px 0; }
.notebook-body .workflow-step a { display: inline-flex; align-items: center; min-height: 44px; margin-top: 8px; font-size: 11px; }
.notebook-body .workflow-step p { font-size: 11px; color: var(--muted); margin-bottom: 0; }
.notebook-body .workflow-step .step-number { color: var(--accent); font: 10px var(--font-mono); }
.notebook-body .table-wrap { overflow-x: auto; border: 1px solid var(--edge); border-radius: 5px; }
.notebook-body .status-table { width: 100%; border-collapse: collapse; margin: 18px 0 30px; font-size: 11px; text-align: left; }
.notebook-body .table-wrap .status-table { margin: 0; }
.notebook-body .status-table caption { text-align: left; color: var(--muted); padding: 0 0 10px; font-size: 11px; }
.notebook-body .status-table th, .notebook-body .status-table td { vertical-align: top; padding: 12px 13px; border-bottom: 1px solid #283243; }
.notebook-body .status-table th { font: 9px/1.5 var(--font-mono); color: #98a6b9; text-transform: uppercase; letter-spacing: .04em; background: #141e2c; }
.notebook-body .status-table tbody tr:hover { background: #121b28; }
.notebook-body .status-table tbody tr:last-child td { border-bottom: 0; }
.notebook-body .coverage-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 18px 0 30px; }
.notebook-body .coverage-package { min-width: 0; padding: 20px; border: 1px solid var(--edge); border-radius: 5px; background: var(--surface); }
.notebook-body .coverage-package h3 { font-size: 14px; margin-bottom: 8px; }
.notebook-body .coverage-package > summary { position: relative; cursor: pointer; list-style: none; display: grid; grid-template-columns: 1fr; gap: 8px; min-height: 44px; padding-right: 20px; }
.notebook-body .coverage-package > summary::-webkit-details-marker { display: none; }
.notebook-body .coverage-package > summary::after { content: "+"; position: absolute; right: 0; top: 0; font: 18px var(--font-mono); color: var(--accent); }
.notebook-body .coverage-package[open] > summary::after { content: "−"; }
.notebook-body .coverage-package > summary .badge { justify-self: start; white-space: normal; }
.notebook-body .coverage-package > summary small { font: 9px var(--font-mono); color: var(--faint); }
.notebook-body .coverage-package > p { margin-top: 14px; }
.notebook-body .coverage-package > a { display: inline-flex; align-items: center; min-height: 44px; font-size: 11px; }
.notebook-body .coverage-list > li { margin: 8px 0; }
.notebook-body .coverage-list > li > .muted { display: block; font-size: 10px; }
.notebook-body .coverage-package p { color: var(--muted); font-size: 11px; }
.notebook-body .coverage-list { margin: 12px 0; padding-left: 17px; font-size: 11px; color: #b4becd; }
.notebook-body .coverage-list li { padding: 2px 0; }
.notebook-body .decision-list { list-style: none; padding: 0; margin: 22px 0; }
.notebook-body .decision { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 18px; padding: 19px 0; border-top: 1px solid var(--edge); }
.notebook-body .decision time { grid-column: 1; grid-row: 1 / span 2; color: var(--accent-soft); font: 10px/1.7 var(--font-mono); }
.notebook-body .decision h3 { grid-column: 2; margin: 0; font-size: 13px; }
.notebook-body .decision p { grid-column: 2; font-size: 11px; color: var(--muted); margin-bottom: 0; }
.notebook-body .prompt-card { padding: 20px; border: 1px solid #465267; background: #121d2b; border-radius: 5px; }
.notebook-body .prompt-card blockquote { margin: 12px 0 0; padding-left: 16px; border-left: 2px solid var(--accent-soft); font-size: 12px; }
.notebook-body .planning-prompt { max-height: 440px; overflow: auto; padding: 18px; margin: 18px 0 0; border: 1px solid var(--edge); border-radius: 4px; background: #0a121f; white-space: pre-wrap; overflow-wrap: anywhere; color: #b8c6d8; font: 11px/1.8 var(--font-mono); scrollbar-width: thin; }
.notebook-body .document-footer, .notebook-body .site-footer { margin-top: 32px; border-top: 1px solid var(--edge); padding-top: 18px; color: var(--faint); font-size: 10px; }
.notebook-body .image-dialog { width: min(1200px, calc(100vw - 48px)); max-height: calc(100dvh - 48px); padding: 0; border: 1px solid #536079; border-radius: 6px; background: #0c121d; color: var(--ink); box-shadow: 0 24px 120px #000a; }
.notebook-body .image-dialog::backdrop { background: #03060dde; backdrop-filter: blur(7px); }
.notebook-body .image-dialog:not([open]) { display: none; }
.notebook-body .viewer-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 18px; border-bottom: 1px solid var(--edge); }
.notebook-body .viewer-heading { min-width: 0; }
.notebook-body .viewer-heading h2 { font-size: 14px; margin: 0; line-height: 1.5; }
.notebook-body .viewer-heading p { color: var(--muted); font: 10px/1.5 var(--font-mono); margin: 2px 0 0; }
.notebook-body .viewer-image-wrap { position: relative; display: grid; place-items: center; min-height: 100px; background: #060a10; }
.notebook-body .viewer-image { display: block; width: 100%; max-height: calc(100dvh - 240px); height: auto; object-fit: contain; }
.notebook-body .viewer-image[hidden] { display: none; }
.notebook-body .viewer-message { padding: 42px 20px; color: var(--muted); text-align: center; font-size: 12px; }
.notebook-body .viewer-message[hidden] { display: none; }
.notebook-body .viewer-footer { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 14px 18px; border-top: 1px solid var(--edge); }
.notebook-body .viewer-caption { flex: 1; margin: 0; font-size: 11px; color: var(--muted); max-width: 750px; overflow-wrap: anywhere; }
.notebook-body .viewer-controls { display: flex; align-items: center; gap: 8px; flex: none; }
.notebook-body .viewer-original { font-size: 11px; padding: 8px 0; }
.notebook-body .viewer-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
@media (min-width: 1560px) {
  .notebook-body .scene-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .notebook-body .media-frame { height: 150px; }
}
@media (max-width: 1100px) {
  .notebook-body .brand-context { display: none; }
  .notebook-body .workspace { grid-template-columns: 148px minmax(0, 1fr); gap: 20px; padding-inline: 20px; }
  .notebook-body .scene-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .notebook-body .asset-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .notebook-body .world-head, .notebook-body .section-body, .notebook-body .flight-card { padding-left: 18px; padding-right: 18px; }
  .notebook-body .world-head { gap: 10px; }
  .notebook-body .world-head h2 { font-size: 19px; }
  .notebook-body .world-head .world-meta { font-size: 9px; }
}
@media (max-width: 760px) {
  .notebook-body .site-header { padding: 12px 18px 8px; min-height: 112px; flex-wrap: wrap; gap: 8px; }
  .notebook-body .brand { order: 0; }
  .notebook-body .source-link { order: 1; margin-left: auto; min-height: 44px; font-size: 10px; }
  .notebook-body .brand strong, .notebook-body .brand-name { font-size: 12px; }
  .notebook-body .page-tabs { width: 100%; gap: 4px; order: 2; }
  .notebook-body .page-tabs a { min-height: 44px; padding: 8px 12px; }
  .notebook-body .workspace { display: block; padding: 18px 18px 48px; }
  .notebook-body .world-rail { position: static; max-height: none; padding: 0; overflow: visible; margin-bottom: 22px; }
  .notebook-body .world-rail nav, .notebook-body .world-rail ul, .notebook-body .world-rail ol { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; }
  .notebook-body .world-rail a { min-height: 44px; font-size: 10px; padding-inline: 7px; }
  .notebook-body.notebook-enhanced .world-rail nav, .notebook-body.notebook-enhanced .world-rail ul, .notebook-body.notebook-enhanced .world-rail ol { display: none; }
  .notebook-body .world-rail .eyebrow { padding: 0; margin-bottom: 8px; }
  .notebook-body.notebook-enhanced .mobile-jump { display: block; color: var(--muted); font-size: 10px; }
  .notebook-body .mobile-jump select { margin-top: 6px; }
  .notebook-body .rail-note { display: none; }
  .notebook-body.notebook-enhanced .world-rail select, .notebook-body.notebook-enhanced select[data-world-jump] { display: block; width: 100%; min-height: 44px; padding: 10px 12px; color: var(--ink); border: 1px solid #3b475b; border-radius: 4px; background: #151e2b; font-size: 12px; }
  .notebook-body .document-head { margin-bottom: 22px; }
  .notebook-body h1 { font-size: 32px; }
  .notebook-body .lede { font-size: 13px; }
  .notebook-body .world-block, .notebook-body .document-section { scroll-margin-top: 132px; }
  .notebook-body .world-head { min-height: 67px; padding: 13px 14px; flex-wrap: wrap; gap: 6px 10px; }
  .notebook-body .world-head::after { position: absolute; right: 14px; top: 20px; }
  .notebook-body .world-head > :last-child { margin-right: 22px; }
  .notebook-body .world-head h2 { font-size: 18px; }
  .notebook-body .world-number { width: 23px; font-size: 10px; }
  .notebook-body .world-meta { width: 100%; padding-left: 33px; }
  .notebook-body .world-status { width: 100%; margin-left: 33px; font-size: 8px; }
  .notebook-body .section-body { padding: 2px 14px 18px; }
  .notebook-body .scene-grid { gap: 18px 10px; margin-top: 15px; }
  .notebook-body .media-frame { height: 130px; }
  .notebook-body .scene-card h3 { font-size: 11px; }
  .notebook-body .beat-state { font-size: 9px; gap: 5px; }
  .notebook-body .beat-index { min-width: 23px; font-size: 8px; }
  .notebook-body .asset-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 11px; gap: 12px; }
  .notebook-body .asset-card .media-frame { height: 105px; }
  .notebook-body .flight-card { padding: 16px 14px; }
  .notebook-body .flight-card::before { display: none; }
  .notebook-body .flight-beats { gap: 8px; }
  .notebook-body .flight-beat .media-frame { height: 90px; }
  .notebook-body .flight-beat .eyebrow { font-size: 8px; letter-spacing: .025em; }
  .notebook-body .flight-beat h4 { font-size: 10px; }
  .notebook-body .coverage-grid { grid-template-columns: 1fr; }
  .notebook-body .workflow-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .notebook-body .current-slice, .notebook-body .coverage-package { padding: 18px; }
  .notebook-body .decision { grid-template-columns: 1fr; gap: 6px; padding: 16px 0; }
  .notebook-body .decision time, .notebook-body .decision h3, .notebook-body .decision p { grid-column: 1; grid-row: auto; }
  .notebook-body .document-stats { gap: 9px 18px; }
  .notebook-body .document-stats strong { font-size: 16px; }
  .notebook-body .image-dialog { width: calc(100vw - 20px); max-height: calc(100dvh - 20px); }
  .notebook-body .viewer-header { padding: 11px 12px; }
  .notebook-body .viewer-heading h2 { font-size: 12px; }
  .notebook-body .viewer-image { max-height: calc(100dvh - 260px); }
  .notebook-body .viewer-footer { align-items: flex-start; flex-direction: column; gap: 10px; padding: 12px; }
  .notebook-body .viewer-controls { width: 100%; justify-content: flex-end; }
}
@media (max-width: 400px) {
  .notebook-body .workspace { padding-inline: 12px; }
  .notebook-body .site-header { padding-inline: 12px; }
  .notebook-body .scene-grid { grid-template-columns: 1fr; }
  .notebook-body .media-frame { height: 170px; }
  .notebook-body .flight-beats { grid-template-columns: 1fr; }
  .notebook-body .flight-beat .media-frame { height: 140px; }
  .notebook-body .workflow-grid { grid-template-columns: 1fr; }
  .notebook-body .current-slice .workflow-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .notebook-body *, .notebook-body *::before, .notebook-body *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
@media print {
  .notebook-body { color: #111; background: white; }
  .notebook-body .site-header, .notebook-body .world-rail, .notebook-body .document-tools, .notebook-body .image-dialog { display: none; }
  .notebook-body .workspace { display: block; padding: 0; }
  .notebook-body .world-block, .notebook-body .flight-card, .notebook-body .coverage-package { color: #111; background: white; border-color: #999; break-inside: avoid; }
  .notebook-body .world-block > .section-body { display: block; }
  .notebook-body .muted, .notebook-body .source-note { color: #444; }
}

/* N01 progressive enhancement: native navigation remains visible without JavaScript. */
.notebook-body .sections-toggle, .notebook-body .rail-pin, .notebook-body .rail-edge { display: none; }
.notebook-body.rail-ready:not(.rail-compact) .sections-toggle,
.notebook-body.rail-ready:not(.rail-compact) .rail-pin { display: inline-flex; }
.notebook-body .rail-heading { display: grid; gap: 8px; margin-bottom: 14px; }
.notebook-body .rail-heading .eyebrow { margin-bottom: 0; }
.notebook-body.rail-ready:not(.rail-compact):not(.rail-pinned) .workspace { grid-template-columns: minmax(0, 1fr); }
.notebook-body.rail-ready:not(.rail-compact):not(.rail-pinned) .world-rail { position: fixed; top: var(--rail-top, 88px); left: 10px; width: 242px; z-index: 30; padding: 0; max-height: calc(100dvh - var(--rail-top, 88px) - 12px); overflow: visible; pointer-events: none; }
.notebook-body.rail-ready.rail-open:not(.rail-compact):not(.rail-pinned) .world-rail { pointer-events: auto; }
.notebook-body.rail-ready:not(.rail-compact):not(.rail-pinned) .rail-panel { padding: 16px 12px; border: 1px solid #465268; border-radius: 6px; box-shadow: 12px 10px 40px #0008; background: #101925fa; max-height: calc(100dvh - var(--rail-top, 88px) - 12px); overflow-y: auto; scrollbar-width: thin; visibility: hidden; opacity: 0; transform: translateX(-18px); transition: opacity 150ms ease, transform 150ms ease; pointer-events: none; }
.notebook-body.rail-ready.rail-open:not(.rail-compact):not(.rail-pinned) .rail-panel { visibility: visible; opacity: 1; transform: none; pointer-events: auto; }
.notebook-body.rail-ready:not(.rail-compact):not(.rail-pinned) .rail-edge { display: block; position: fixed; top: var(--rail-top, 88px); bottom: 0; left: 0; width: 16px; z-index: 29; }
.notebook-body.rail-ready.rail-pinned:not(.rail-compact) .workspace { grid-template-columns: 224px minmax(0, 1fr); }
.notebook-body.rail-ready.rail-pinned:not(.rail-compact) .world-rail { top: var(--rail-top, 88px); max-height: calc(100dvh - var(--rail-top, 88px) - 12px); padding-right: 6px; }
.notebook-body.rail-ready .world-rail a { min-height: 44px; }
.notebook-body.rail-ready.rail-compact .workspace { display: block; }
.notebook-body.rail-ready.rail-compact .world-rail { position: static; max-height: none; padding: 0; margin-bottom: 22px; }
.notebook-body.rail-ready.rail-compact .rail-panel { display: none; }
.notebook-body.rail-ready.rail-compact .mobile-jump { display: block; color: var(--muted); font-size: 11px; }
.notebook-body.rail-ready.rail-compact select[data-world-jump] { display: block; margin-top: 6px; width: 100%; min-height: 44px; padding: 10px 12px; color: var(--ink); border: 1px solid #3b475b; border-radius: 4px; background: #151e2b; font-size: 12px; }

@media (prefers-reduced-motion: reduce) {
  .notebook-body .rail-panel { transition: none !important; }
}
@media print {
  .notebook-body .rail-edge, .notebook-body .sections-toggle { display: none !important; }
}


.notebook-body .media-frame {grid-template-rows:minmax(0,1fr);grid-template-columns:minmax(0,1fr)}
.notebook-body .media-frame img {min-width:0;min-height:0}
