:root {
  color-scheme: light;
  --bg: #eeeeee;
  --bg-soft: #e5e5e5;
  --surface: #fbfbfb;
  --surface-2: #f2f2f2;
  --ink: #171717;
  --muted: #5e5e5e;
  --dim: #7d7d7d;
  --line: #cfcfcf;
  --line-strong: #9a9a9a;
  --paper: #efefef;
  --paper-ink: #1b1b1b;
  --accent: #6f6f6f;
  --accent-strong: #111111;
  --accent-ink: #f5f5f5;
  --focus: #111111;
  --shadow: 0 24px 70px rgba(38, 38, 34, 0.18);
  --gallery-tray-bg: color-mix(in srgb, var(--surface) 92%, transparent);
  --gallery-card-bg: color-mix(in srgb, var(--surface-2) 92%, transparent);
  --gallery-card-active-bg: color-mix(in srgb, var(--surface) 96%, transparent);
  --gallery-thumb-shadow: 0 8px 18px rgba(35, 35, 31, 0.12);
  --gallery-active-shadow: inset 0 0 0 1px color-mix(in srgb, var(--line-strong) 34%, transparent), inset 0 -3px 0 currentColor;
  --radius: 8px;
  --dock-height: 70px;
  --mobile-rail: 0px;
  --app-block-start: 12px;
  --app-block-end: 20px;
  --workspace-gap: 12px;
  --layout-frame: calc(var(--dock-height) + var(--app-block-start) + var(--app-block-end) + var(--workspace-gap) + var(--mobile-rail) + 2px);
  interpolate-size: allow-keywords;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101010;
  --bg-soft: #171717;
  --surface: #202020;
  --surface-2: #292929;
  --ink: #f1f1f1;
  --muted: #c8c8c8;
  --dim: #a0a0a0;
  --line: #4c4c4c;
  --line-strong: #858585;
  --paper: #ececec;
  --paper-ink: #101010;
  --accent: #8a8a8a;
  --accent-strong: #dedede;
  --accent-ink: #111111;
  --focus: #f7f7f7;
  --shadow: 0 26px 82px rgba(0, 0, 0, 0.48);
  --gallery-tray-bg: color-mix(in srgb, var(--surface) 88%, transparent);
  --gallery-card-bg: color-mix(in srgb, var(--surface-2) 88%, transparent);
  --gallery-card-active-bg: color-mix(in srgb, var(--surface) 96%, var(--accent) 10%);
  --gallery-thumb-shadow: 0 10px 22px rgba(0, 0, 0, 0.28);
  --gallery-active-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent-strong) 42%, transparent), inset 0 -3px 0 var(--accent-strong);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.026) 1px, transparent 1px) 0 0 / 48px 48px,
    var(--bg);
  color: var(--ink);
  letter-spacing: 0;
}

[data-theme="dark"] body {
  background:
    radial-gradient(circle at 52% 0%, rgba(255, 255, 255, 0.055), transparent 34%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(180deg, #141414 0%, var(--bg) 58%, #0d0d0d 100%);
}

body.modal-open {
  overflow: hidden;
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
[tabindex]:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

img {
  max-width: 100%;
  display: block;
}

img,
video,
canvas,
.cover-art {
  filter: grayscale(1) saturate(0);
}

.cover-art {
  --cover-paper: #eeeeee !important;
  --cover-ink: #171717 !important;
  --cover-accent: #707070 !important;
  --cover-second: #d4d4d4 !important;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: 12px;
  z-index: 40;
  transform: translateY(-140%);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: var(--surface);
  color: var(--ink);
}

.skip-link:focus {
  transform: translateY(0);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.app {
  min-height: 100dvh;
  padding: var(--app-block-start) 18px calc(var(--mobile-rail) + var(--app-block-end));
  opacity: 1;
  transition:
    opacity 520ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 520ms cubic-bezier(0.22, 1, 0.36, 1);
}

body.intro-active .app {
  pointer-events: none;
  transform: translate3d(0, 10px, 0) scale(0.995);
  opacity: 0.9;
}

.app-dock {
  position: relative;
  z-index: 20;
  top: auto;
  width: 100%;
  max-width: 1500px;
  margin: 0 auto;
  min-height: 58px;
  display: grid;
  grid-template-columns: auto minmax(230px, max-content) minmax(260px, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px;
  background: color-mix(in srgb, var(--surface) 96%, var(--bg));
  box-shadow: var(--shadow);
  contain: layout paint;
  transition:
    border-color 180ms ease,
    background-color 220ms ease,
    box-shadow 220ms ease,
    transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

.brand-lockup {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 10px 0 2px;
}

.brand-lockup > div {
  min-width: 0;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--ink);
  text-decoration: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 16px;
  font-weight: 800;
  transition:
    border-color 220ms ease,
    background-color 220ms ease,
    color 220ms ease;
}

.wordmark {
  overflow: hidden;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 21px;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 220ms ease;
}

.wordmark-button {
  display: block;
  max-width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.wordmark-button:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

[data-theme="dark"] .wordmark,
[data-theme="dark"] .stage-copy h3,
[data-theme="dark"] .doc-card strong {
  color: var(--ink);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.24);
}

[data-theme="dark"] .dock-status,
[data-theme="dark"] .stage-copy p,
[data-theme="dark"] .doc-card span,
[data-theme="dark"] .detail-body {
  color: #d9d9d2;
}

.dock-status {
  margin-top: 5px;
  overflow: hidden;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-shell {
  min-width: 0;
  position: relative;
}

.search-shell input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 14px;
  background: var(--bg-soft);
  color: var(--ink);
}

.search-shell input::placeholder {
  color: var(--dim);
}

.filter-toggle {
  width: 44px;
  min-width: 44px;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0;
  background: var(--surface-2);
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
}

.filter-toggle > span:last-child {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.filter-toggle .tool-symbol,
.chip-symbol,
.row-symbols span {
  min-width: 30px;
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Apple Symbols", "Segoe UI Symbol", sans-serif;
  font-variant-emoji: text;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  filter: grayscale(1);
  padding: 0;
  transition:
    border-color 180ms ease,
    background-color 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 180ms ease;
}

.filter-toggle > .tool-symbol,
.publication-bottom-toggle > .tool-symbol,
.chip:has(> .chip-symbol) > .chip-symbol {
  align-self: stretch;
  min-width: 38px;
  width: 38px;
  height: auto;
  margin: -1px 0 -1px -1px;
  border-width: 0 1px 0 0;
  border-radius: 5px 0 0 5px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
}

.chip:has(> .chip-symbol) {
  padding-left: 0;
}

.tool-symbol {
  display: inline-grid;
  place-items: center;
  line-height: 1;
}

.tool-symbol svg {
  width: 22px;
  height: 22px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.chip-symbol svg {
  width: 22px;
  height: 22px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.filter-toggle[aria-expanded="true"],
.filter-toggle:hover,
.filter-toggle:focus-visible,
.icon-button:hover,
.icon-button:focus-visible,
.chip:hover,
.chip:focus-visible,
.meta-pill-button:hover,
.meta-pill-button:focus-visible {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  box-shadow: inset 0 -2px 0 currentColor;
}

.autosuggest-dropdown {
  position: absolute;
  z-index: 35;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: min(62vh, 420px);
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.autosuggest-dropdown button {
  width: 100%;
  display: block;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.autosuggest-dropdown button:hover,
.autosuggest-dropdown button:focus-visible,
.autosuggest-dropdown button.is-selected {
  background: var(--surface-2);
}

.autosuggest-dropdown button.is-selected {
  box-shadow: inset 3px 0 0 var(--focus);
}

.autosuggest-dropdown strong,
.autosuggest-dropdown span {
  display: block;
}

.autosuggest-dropdown span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.dock-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 7px;
}

.dock-tools .filter-toggle {
  flex: 0 0 auto;
}

.dock-tools .filter-toggle {
  height: 44px;
  min-height: 44px;
  gap: 0;
  overflow: hidden;
}

.dock-tools .filter-toggle > .tool-symbol {
  align-self: center;
  min-width: 24px;
  width: 24px;
  height: 24px;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: currentColor;
}

.dock-tools .filter-toggle > .tool-symbol svg,
.dock-tools .icon-button > .tool-symbol svg {
  width: 20px;
  height: 20px;
}

.icon-button,
.text-button,
.chip,
.filter-toggle,
.publication-bottom-toggle,
.mobile-rail button {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--ink);
  cursor: pointer;
  transition:
    border-color 180ms ease,
    background-color 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 180ms ease;
}

.icon-button {
  position: relative;
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
}

.dock-sidebar-toggle {
  overflow: hidden;
  transition:
    border-color 180ms ease,
    background-color 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.dock-sidebar-toggle::before {
  position: absolute;
  top: 7px;
  bottom: 7px;
  left: 6px;
  width: 3px;
  content: "";
  border-radius: 99px;
  background: currentColor;
  opacity: 0.38;
  transform: scaleY(0.58);
  transform-origin: center;
  transition: opacity 180ms ease, transform 180ms ease;
}

.dock-sidebar-toggle-inspector::before {
  right: 6px;
  left: auto;
}

.dock-bottom-toggle::before {
  top: auto;
  right: 7px;
  bottom: 6px;
  left: 7px;
  width: auto;
  height: 3px;
  transform: scaleX(0.58);
  transform-origin: center;
}

.dock-sidebar-toggle::after {
  content: none;
}

.dock-sidebar-toggle[data-state="open"]::before {
  opacity: 0.82;
  transform: scaleY(0.88);
}

.dock-sidebar-toggle[data-state="closed"] {
  color: var(--muted);
}

.icon-button[aria-pressed="true"],
.chip.is-active,
.text-button[aria-pressed="true"],
.mobile-rail button[aria-pressed="true"] {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--line-strong) 30%, transparent),
    inset 0 -3px 0 currentColor;
}

[data-theme="dark"] .icon-button[aria-pressed="true"],
[data-theme="dark"] .chip.is-active,
[data-theme="dark"] .text-button[aria-pressed="true"],
[data-theme="dark"] .mobile-rail button[aria-pressed="true"] {
  border-color: color-mix(in srgb, var(--accent-strong) 54%, var(--line-strong));
  background: color-mix(in srgb, var(--surface) 86%, var(--accent) 8%);
  color: var(--ink);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--accent-strong) 24%, transparent),
    inset 0 -3px 0 var(--accent-strong);
}

.text-button:hover,
.mobile-rail button:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
  color: var(--ink);
}

.dock-sidebar-toggle,
.dock-sidebar-toggle[aria-pressed="true"] {
  width: 38px;
  height: 38px;
  border-color: color-mix(in srgb, var(--line) 56%, transparent);
  background: color-mix(in srgb, var(--surface) 54%, transparent);
  color: var(--muted);
  box-shadow: none;
}

.dock-sidebar-toggle[data-state="open"],
.dock-sidebar-toggle[aria-pressed="true"] {
  border-color: color-mix(in srgb, var(--line-strong) 72%, transparent);
  background: var(--surface);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--line) 32%, transparent);
}

[data-theme="dark"] .dock-sidebar-toggle[data-state="open"],
[data-theme="dark"] .dock-sidebar-toggle[aria-pressed="true"] {
  border-color: color-mix(in srgb, var(--accent-strong) 42%, var(--line-strong));
  background: color-mix(in srgb, var(--surface) 90%, var(--accent) 6%);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent-strong) 18%, transparent);
}

.dock-sidebar-toggle:hover,
.dock-sidebar-toggle:focus-visible {
  border-color: var(--line-strong);
  background: var(--surface-2);
  color: var(--ink);
}

.dock-sidebar-toggle[data-state="open"]::before {
  opacity: 0.78;
  transform: scaleY(0.84);
}

.dock-bottom-toggle[data-state="open"]::before {
  opacity: 0.78;
  transform: scaleX(0.84);
}

.sound-toggle[aria-pressed="true"] {
  border-color: color-mix(in srgb, var(--line-strong) 74%, transparent);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  color: var(--ink);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--line) 34%, transparent),
    inset 0 -2px 0 currentColor;
}

.sound-toggle[aria-pressed="true"] .tool-symbol {
  background: transparent;
}

[data-theme="dark"] .sound-toggle[aria-pressed="true"] .tool-symbol {
  background: transparent;
}

.chip.is-active .chip-symbol {
  border-color: var(--line-strong);
  background: var(--surface-2);
  color: currentColor;
}

[data-theme="dark"] .chip.is-active .chip-symbol {
  border-color: color-mix(in srgb, var(--accent-strong) 46%, var(--line));
  background: color-mix(in srgb, var(--surface-2) 82%, var(--accent) 10%);
}

.icon-button:disabled,
.text-button:disabled,
.chip:disabled {
  cursor: not-allowed;
  opacity: 0.54;
}

.workspace {
  max-width: 1500px;
  margin: var(--workspace-gap) auto 0;
}

.control-deck,
.archive-layout {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  contain: layout paint;
}

.control-deck {
  display: grid;
  gap: 10px;
  padding: 10px;
}

.control-deck.is-collapsed {
  display: none;
}

.publication-gallery {
  display: block;
  min-width: 0;
  max-width: 100%;
  min-height: 0;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
  background: var(--gallery-tray-bg);
  box-shadow: 0 6px 18px color-mix(in srgb, #000 6%, transparent);
  scroll-padding-inline: 2px;
  scrollbar-width: thin;
  touch-action: pan-x;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  contain: layout paint;
}

.publication-tile-grid {
  width: max-content;
  min-width: 100%;
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 8px;
}

.publication-tile {
  position: relative;
  width: clamp(126px, 10.5vw, 148px);
  flex: 0 0 clamp(126px, 10.5vw, 148px);
  min-width: 0;
  height: 72px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 6px;
  background: var(--gallery-card-bg);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  contain: layout paint;
  transition:
    border-color 180ms ease,
    background-color 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.publication-tile.is-active,
.publication-tile:hover,
.publication-tile:focus-visible {
  border-color: var(--line-strong);
  background: var(--gallery-card-active-bg);
  box-shadow: var(--gallery-active-shadow);
  transform: translateY(-1px);
  z-index: 2;
}

.publication-tile .cover-art {
  width: 38px;
  height: 52px;
  min-width: 38px;
  box-shadow: var(--gallery-thumb-shadow);
}

.publication-tile .cover-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.publication-tile > span:last-child {
  min-width: 0;
}

.publication-tile strong,
.publication-tile span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.publication-tile strong {
  font-size: 12px;
  line-height: 1.15;
}

.publication-tile span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.publication-profile-mount:not(:empty) {
  margin-top: 0;
}

.publication-bottom-bar {
  position: sticky;
  z-index: 18;
  bottom: calc(var(--mobile-rail) + 8px);
  width: min(1500px, 100%);
  margin: 10px auto 0;
  max-width: 1500px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px;
  background: var(--gallery-tray-bg);
  box-shadow: var(--shadow);
  contain: layout;
  transform: translate3d(0, 0, 0);
  transition:
    width 260ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 260ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 180ms ease,
    border-color 180ms ease;
}

.publication-bottom-bar.is-collapsed {
  position: fixed;
  right: auto;
  bottom: calc(var(--mobile-rail) + env(safe-area-inset-bottom) + 8px);
  left: 50%;
  z-index: 24;
  width: max-content;
  max-width: calc(100vw - 36px);
  margin: 0;
  padding: 6px;
  transform: translate3d(-50%, 0, 0);
}

.publication-bottom-toggle {
  display: none;
  min-height: 42px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  background: var(--surface-2);
  color: var(--ink);
  cursor: pointer;
}

.publication-bottom-toggle:hover,
.publication-bottom-toggle:focus-visible {
  border-color: var(--line-strong);
  background: var(--ink);
  color: var(--bg);
}

.publication-bottom-bar.is-collapsed .publication-bottom-toggle {
  display: inline-flex;
}

.publication-bottom-bar:not(.is-collapsed) .publication-bottom-toggle {
  display: none;
}

.publication-bottom-bar.is-collapsed .publication-bottom-scroll {
  display: none;
}

.publication-bottom-tooltip {
  position: absolute;
  right: 12px;
  bottom: calc(100% + 8px);
  z-index: 6;
  max-width: min(680px, calc(100vw - 48px));
  transform: translateY(5px);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 7px 10px;
  background: color-mix(in srgb, var(--ink) 92%, transparent);
  color: var(--bg);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.2;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 140ms ease,
    transform 160ms cubic-bezier(0.22, 1, 0.36, 1);
}

.publication-bottom-tooltip.is-visible {
  transform: translateY(0);
  opacity: 1;
}

.publication-bottom-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 1px 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) color-mix(in srgb, var(--surface-2) 70%, transparent);
  overscroll-behavior-x: contain;
  touch-action: pan-x;
  -webkit-overflow-scrolling: touch;
}

.publication-bottom-card {
  position: relative;
  width: 58px;
  min-width: 58px;
  height: 88px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 4px;
  background: var(--gallery-card-bg);
  color: var(--ink);
  text-align: center;
  cursor: pointer;
  overflow: hidden;
  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.publication-bottom-card.is-active,
.publication-bottom-card:hover,
.publication-bottom-card:focus-visible {
  border-color: var(--line-strong);
  background: var(--gallery-card-active-bg);
  color: var(--ink);
  transform: translateY(-2px);
  z-index: 3;
}

.publication-bottom-card.is-active {
  box-shadow: var(--gallery-active-shadow);
}

.publication-bottom-card .cover-art {
  width: 100%;
  height: 100%;
  max-width: 48px;
  max-height: 76px;
  box-shadow: var(--gallery-thumb-shadow);
}

.publication-bottom-card .cover-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.publication-bottom-label {
  position: absolute;
  left: 5px;
  right: 5px;
  bottom: 5px;
  z-index: 4;
  min-width: 0;
  transform: translateY(5px);
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  padding: 5px 6px;
  background: color-mix(in srgb, var(--ink) 92%, transparent);
  color: var(--bg);
  box-shadow: 0 8px 18px rgba(35, 35, 31, 0.22);
  opacity: 0;
  pointer-events: none;
  text-align: left;
  transition:
    opacity 140ms ease,
    transform 160ms cubic-bezier(0.22, 1, 0.36, 1);
}

.publication-bottom-label strong,
.publication-bottom-label small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.publication-bottom-label strong {
  font-size: 10px;
  line-height: 1.15;
}

.publication-bottom-label small {
  margin-top: 2px;
  color: currentColor;
  font-size: 9px;
  opacity: 0.72;
}

.publication-bottom-card.is-active .publication-bottom-label,
.publication-bottom-card:hover .publication-bottom-label,
.publication-bottom-card:focus-visible .publication-bottom-label {
  opacity: 1;
  transform: translateY(0);
}

.publication-profile {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(70px, 92px) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  background: color-mix(in srgb, var(--surface) 76%, transparent);
}

.publication-profile .cover-art {
  width: 100%;
  max-width: 92px;
}

.publication-profile-copy {
  min-width: 0;
}

.publication-profile-copy h3,
.publication-profile-copy p {
  margin: 0;
}

.publication-profile-copy h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
}

.publication-profile-copy > p:not(.eyebrow):not(.source-note) {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.45;
}

.source-note {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.chip-row {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0;
  background: var(--gallery-tray-bg);
}

.chip-row:last-child {
  border-bottom: 1px solid var(--line);
}

.chip-row summary {
  min-width: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
  padding: 4px 6px 4px 10px;
  cursor: pointer;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  list-style: none;
}

.chip-row summary > span:first-child {
  flex: 0 1 auto;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-symbols {
  flex: 1 1 auto;
  min-width: 52px;
  max-width: min(68%, 480px);
  overflow-x: auto;
  overflow-y: hidden;
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 5px;
  margin-left: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
  touch-action: pan-x;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

.chip-row summary::-webkit-details-marker {
  display: none;
}

.chip-row summary::after {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  content: "+";
  border: 1px solid var(--line);
  border-radius: 5px;
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  color: var(--dim);
  font-size: 14px;
  line-height: 1;
  text-transform: uppercase;
}

.chip-row[open] summary::after {
  content: "-";
}

.chip-strip {
  min-width: 0;
  max-width: 100%;
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  border-top: 1px solid var(--line);
  padding: 7px;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  scrollbar-width: thin;
  touch-action: pan-x;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

.chip {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  padding: 0 12px;
  font-size: 14px;
  line-height: 1;
  white-space: nowrap;
}

.chip-label {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
}

.chip-label small {
  color: currentColor;
  font-size: 11px;
  opacity: 0.68;
}

.reader-control-chiprow,
.reader-control-group .variant-strip,
.inspector-meta-row,
.lightbox-control-strip,
.reader-lightbox .detail-body .variant-strip,
.reader-lightbox .detail-body .segmented-controls,
.reader-lightbox .lightbox-chiprow {
  flex-wrap: nowrap;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: auto;
  scrollbar-color: var(--line-strong) color-mix(in srgb, var(--surface-2) 72%, transparent);
  overscroll-behavior-x: contain;
  touch-action: pan-x;
  -webkit-overflow-scrolling: touch;
}

.modal-chiprow {
  min-width: 0;
  max-width: 100%;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px;
  background: var(--gallery-tray-bg);
  scrollbar-width: none;
}

.modal-chiprow::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.modal-chiprow .lightbox-nav-chip {
  width: 42px;
  min-width: 42px;
  min-height: 40px;
  justify-content: center;
  padding: 0 6px;
  background: var(--gallery-card-bg);
}

.modal-chiprow .lightbox-nav-chip .chip-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.inspector-meta-row .meta-pill,
.reader-lightbox .detail-body .meta-pill {
  flex: 0 0 auto;
  white-space: nowrap;
}

.reader-control-chiprow .chip,
.reader-control-group .variant-strip .chip,
.lightbox-control-strip .chip,
.reader-lightbox .detail-body .variant-strip .chip,
.reader-lightbox .detail-body .segmented-controls .chip,
.reader-lightbox .lightbox-nav-chip {
  width: 46px;
  min-width: 46px;
  min-height: 44px;
  justify-content: flex-start;
  gap: 7px;
  padding: 0 7px 0 0;
  overflow: hidden;
  transition:
    width 180ms cubic-bezier(0.22, 1, 0.36, 1),
    min-width 180ms cubic-bezier(0.22, 1, 0.36, 1),
    padding 180ms ease,
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    box-shadow 180ms ease,
    transform 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.reader-control-chiprow .chip .chip-symbol,
.reader-control-group .variant-strip .chip .chip-symbol,
.lightbox-control-strip .chip .chip-symbol,
.reader-lightbox .detail-body .variant-strip .chip .chip-symbol,
.reader-lightbox .detail-body .segmented-controls .chip .chip-symbol,
.reader-lightbox .lightbox-nav-chip .chip-symbol,
.row-symbols span {
  min-width: 34px;
  width: 38px;
  height: auto;
  font-size: 21px;
}

.row-symbols span {
  align-self: center;
  min-width: 34px;
  width: 34px;
  height: 34px;
  margin: 0;
  border-width: 1px;
  border-radius: 5px;
}

.reader-control-chiprow .chip .chip-label,
.reader-control-group .variant-strip .chip .chip-label,
.lightbox-control-strip .chip .chip-label,
.reader-lightbox .detail-body .variant-strip .chip .chip-label,
.reader-lightbox .detail-body .segmented-controls .chip .chip-label,
.reader-lightbox .lightbox-nav-chip .chip-label,
.reader-lightbox .lightbox-page-chip .chip-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.reader-control-chiprow .chip:hover,
.reader-control-chiprow .chip:focus-visible,
.reader-control-group .variant-strip .chip:hover,
.reader-control-group .variant-strip .chip:focus-visible,
.lightbox-control-strip .chip:hover,
.lightbox-control-strip .chip:focus-visible,
.reader-lightbox .detail-body .variant-strip .chip:hover,
.reader-lightbox .detail-body .variant-strip .chip:focus-visible,
.reader-lightbox .detail-body .segmented-controls .chip:hover,
.reader-lightbox .detail-body .segmented-controls .chip:focus-visible,
.reader-lightbox .lightbox-nav-chip:hover,
.reader-lightbox .lightbox-nav-chip:focus-visible {
  width: auto;
  min-width: 46px;
  justify-content: flex-start;
  padding: 0 11px;
  overflow: visible;
  z-index: 4;
}

.reader-control-chiprow .chip:hover .chip-symbol,
.reader-control-chiprow .chip:focus-visible .chip-symbol,
.reader-control-group .variant-strip .chip:hover .chip-symbol,
.reader-control-group .variant-strip .chip:focus-visible .chip-symbol,
.lightbox-control-strip .chip:hover .chip-symbol,
.lightbox-control-strip .chip:focus-visible .chip-symbol,
.reader-lightbox .detail-body .variant-strip .chip:hover .chip-symbol,
.reader-lightbox .detail-body .variant-strip .chip:focus-visible .chip-symbol,
.reader-lightbox .detail-body .segmented-controls .chip:hover .chip-symbol,
.reader-lightbox .detail-body .segmented-controls .chip:focus-visible .chip-symbol,
.reader-lightbox .lightbox-nav-chip:hover .chip-symbol,
.reader-lightbox .lightbox-nav-chip:focus-visible .chip-symbol {
  align-self: center;
  min-width: 34px;
  width: 34px;
  height: 34px;
  margin: 0;
  border-width: 1px;
  border-radius: 5px;
}

.reader-control-chiprow .chip:hover .chip-label,
.reader-control-chiprow .chip:focus-visible .chip-label,
.reader-control-group .variant-strip .chip:hover .chip-label,
.reader-control-group .variant-strip .chip:focus-visible .chip-label,
.lightbox-control-strip .chip:hover .chip-label,
.lightbox-control-strip .chip:focus-visible .chip-label,
.reader-lightbox .detail-body .variant-strip .chip:hover .chip-label,
.reader-lightbox .detail-body .variant-strip .chip:focus-visible .chip-label,
.reader-lightbox .detail-body .segmented-controls .chip:hover .chip-label,
.reader-lightbox .detail-body .segmented-controls .chip:focus-visible .chip-label,
.reader-lightbox .lightbox-nav-chip:hover .chip-label,
.reader-lightbox .lightbox-nav-chip:focus-visible .chip-label {
  position: static;
  width: auto;
  height: auto;
  overflow: visible;
  clip: auto;
  white-space: nowrap;
}

.reader-lightbox .lightbox-nav-chip[data-command="toggleLightboxInfo"],
.reader-lightbox .lightbox-nav-chip[data-command="toggleLightboxInfo"].is-active {
  border-color: var(--line);
  background: color-mix(in srgb, var(--surface-2) 74%, transparent);
  color: var(--muted);
}

.reader-lightbox .lightbox-nav-chip {
  justify-content: center;
  padding: 0 6px;
}

.reader-lightbox .lightbox-nav-chip .chip-symbol {
  align-self: center;
  min-width: 34px;
  width: 34px;
  height: 34px;
  margin: 0;
  border-width: 1px;
  border-radius: 5px;
}

.reader-lightbox .lightbox-nav-chip[data-command="toggleLightboxInfo"].is-active {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--line-strong) 30%, transparent),
    inset 0 -3px 0 currentColor;
}

.reader-lightbox .lightbox-nav-chip[data-command="toggleLightboxInfo"]:hover,
.reader-lightbox .lightbox-nav-chip[data-command="toggleLightboxInfo"]:focus-visible {
  border-color: var(--line-strong);
  background: var(--surface-2);
  color: var(--ink);
}

.reader-lightbox .lightbox-nav-chip[data-command="toggleLightboxInfo"].is-active .chip-symbol {
  border-color: var(--line-strong);
  background: var(--surface-2);
  color: currentColor;
}

.reader-control-group .variant-strip .chip > span:not(.chip-symbol),
.reader-lightbox .detail-body .variant-strip .chip > span:not(.chip-symbol) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.reader-control-group .variant-strip .chip:hover > span:not(.chip-symbol),
.reader-control-group .variant-strip .chip:focus-visible > span:not(.chip-symbol),
.reader-lightbox .detail-body .variant-strip .chip:hover > span:not(.chip-symbol),
.reader-lightbox .detail-body .variant-strip .chip:focus-visible > span:not(.chip-symbol) {
  position: static;
  width: auto;
  height: auto;
  overflow: visible;
  clip: auto;
  white-space: nowrap;
}

.chip-row:not([open]) .chip-strip {
  display: none;
}

.chip-row[open] .row-symbols {
  display: none;
}

@media (max-width: 720px) {
  .chip .chip-label,
  .filter-toggle > span:last-child {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .chip {
    width: 44px;
    justify-content: center;
    padding: 0;
  }
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  text-transform: uppercase;
}

#hubMeter,
.hub-meter {
  display: none !important;
}

.archive-layout {
  --document-rail-expanded: clamp(220px, 24vw, 310px);
  --inspector-expanded: clamp(250px, 28vw, 360px);
  --document-rail-width: var(--document-rail-expanded);
  --inspector-width: var(--inspector-expanded);
  min-height: calc(100dvh - var(--layout-frame));
  display: grid;
  grid-template-columns: var(--document-rail-width) minmax(0, 1fr) var(--inspector-width);
  gap: 0;
  margin-top: var(--workspace-gap);
  overflow: hidden;
  transition: grid-template-columns 240ms cubic-bezier(0.2, 0, 0.15, 1);
  will-change: grid-template-columns;
}

.archive-layout.is-documents-collapsed {
  --document-rail-width: 52px;
}

.archive-layout.is-inspector-collapsed {
  --inspector-width: 52px;
}

.archive-layout[data-hub="welcome"] {
  grid-template-columns: minmax(0, 1fr);
}

.archive-layout[data-hub="welcome"] .document-rail,
.archive-layout[data-hub="welcome"] .inspector {
  display: none;
}

.document-rail,
.inspector {
  position: relative;
  min-width: 0;
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-2) 58%, transparent);
}

.document-rail,
.inspector {
  overflow: hidden;
  transition:
    opacity 220ms ease,
    transform 260ms cubic-bezier(0.22, 1, 0.36, 1),
    background-color 180ms ease,
    border-color 180ms ease;
}

.inspector {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  border-right: 0;
  border-left: 1px solid var(--line);
}

.rail-head {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding: 8px 10px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  text-transform: uppercase;
  transition:
    opacity 150ms ease,
    padding 220ms cubic-bezier(0.2, 0, 0.15, 1),
    border-color 180ms ease;
}

.sidebar-head {
  justify-content: start;
}

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

.sidebar-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-toggle {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 22px;
  line-height: 1;
}

.sidebar-toggle:hover,
.sidebar-toggle:focus-visible {
  border-color: var(--line-strong);
  background: var(--ink);
  color: var(--bg);
}

[data-theme="dark"] .sidebar-toggle:hover,
[data-theme="dark"] .sidebar-toggle:focus-visible,
[data-theme="dark"] .publication-bottom-toggle:hover,
[data-theme="dark"] .publication-bottom-toggle:focus-visible {
  border-color: var(--line-strong);
  background: color-mix(in srgb, var(--surface-2) 84%, var(--surface) 16%);
  color: var(--ink);
}

.document-rail.is-collapsed .rail-head,
.inspector.is-collapsed .rail-head {
  height: 100%;
  justify-content: center;
  border-bottom: 0;
  padding: 7px 5px;
  opacity: 0;
}

.document-rail.is-collapsed .sidebar-title,
.document-rail.is-collapsed .sidebar-body-action,
.inspector.is-collapsed .sidebar-title {
  visibility: hidden;
  opacity: 0;
}

.document-rail.is-collapsed,
.inspector.is-collapsed {
  background: transparent;
  cursor: ew-resize;
  opacity: 0.74;
}

.document-rail.is-collapsed {
  transform: translateX(-3px);
}

.inspector.is-collapsed {
  transform: translateX(3px);
}

.text-button {
  min-height: 44px;
  padding: 0 10px;
  font-size: 12px;
}

.document-list {
  --document-scrollbar-lane: 18px;
  position: relative;
  max-height: calc(100dvh - var(--layout-frame) - 12px);
  overflow: auto;
  padding: 8px calc(8px + var(--document-scrollbar-lane)) 8px 8px;
  contain: layout paint;
  scrollbar-gutter: auto;
  scrollbar-width: none;
  scrollbar-color: transparent transparent;
  overscroll-behavior: contain;
  opacity: 1;
  transform: translateX(0);
  visibility: visible;
  transition:
    opacity 170ms ease,
    transform 220ms cubic-bezier(0.2, 0, 0.15, 1),
    visibility 0s linear 0s;
}

.document-list::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.document-list::-webkit-scrollbar,
.inspector-body::-webkit-scrollbar,
.lightbox-info-body::-webkit-scrollbar,
.lightbox-image-frame::-webkit-scrollbar,
.publication-bottom-scroll::-webkit-scrollbar,
.chip-strip::-webkit-scrollbar,
.variant-strip::-webkit-scrollbar,
.segmented-controls::-webkit-scrollbar,
.stage-actions::-webkit-scrollbar,
.stage-meta::-webkit-scrollbar,
.lightbox-filmstrip::-webkit-scrollbar {
  width: 14px;
  height: 14px;
}

.document-list::-webkit-scrollbar-track,
.inspector-body::-webkit-scrollbar-track,
.lightbox-info-body::-webkit-scrollbar-track,
.lightbox-image-frame::-webkit-scrollbar-track,
.publication-bottom-scroll::-webkit-scrollbar-track,
.chip-strip::-webkit-scrollbar-track,
.variant-strip::-webkit-scrollbar-track,
.segmented-controls::-webkit-scrollbar-track,
.stage-actions::-webkit-scrollbar-track,
.stage-meta::-webkit-scrollbar-track,
.lightbox-filmstrip::-webkit-scrollbar-track {
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-2) 70%, transparent);
}

.document-list::-webkit-scrollbar-thumb,
.inspector-body::-webkit-scrollbar-thumb,
.lightbox-info-body::-webkit-scrollbar-thumb,
.lightbox-image-frame::-webkit-scrollbar-thumb,
.publication-bottom-scroll::-webkit-scrollbar-thumb,
.chip-strip::-webkit-scrollbar-thumb,
.variant-strip::-webkit-scrollbar-thumb,
.segmented-controls::-webkit-scrollbar-thumb,
.stage-actions::-webkit-scrollbar-thumb,
.stage-meta::-webkit-scrollbar-thumb,
.lightbox-filmstrip::-webkit-scrollbar-thumb {
  min-height: 56px;
  border: 3px solid color-mix(in srgb, var(--surface-2) 70%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--line-strong) 82%, var(--ink));
}

.document-list::-webkit-scrollbar,
.document-list::-webkit-scrollbar-track,
.document-list::-webkit-scrollbar-thumb {
  width: 0;
  height: 0;
  border: 0;
  background: transparent;
}

.document-list-scrollbar {
  --document-scrollbar-thumb-height: 48px;
  --document-scrollbar-thumb-top: 0px;
  position: absolute;
  top: 54px;
  right: 5px;
  bottom: 10px;
  z-index: 6;
  width: 12px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 160ms ease,
    right 160ms ease,
    width 160ms ease;
}

.document-rail.has-scrollbar .document-list-scrollbar {
  opacity: 1;
  pointer-events: auto;
}

.document-rail.is-collapsed .document-list-scrollbar {
  opacity: 0;
  pointer-events: none;
}

.document-list-scrollbar::before,
.document-list-scrollbar-thumb {
  position: absolute;
  left: 50%;
  border-radius: 999px;
  transform: translateX(-50%);
  transition:
    width 160ms ease,
    background-color 160ms ease,
    box-shadow 160ms ease,
    opacity 160ms ease;
}

.document-list-scrollbar::before {
  content: "";
  top: 0;
  bottom: 0;
  width: 4px;
  background: color-mix(in srgb, var(--line-strong) 42%, transparent);
  opacity: 0.42;
}

.document-list-scrollbar-thumb {
  top: 0;
  width: 4px;
  height: var(--document-scrollbar-thumb-height);
  min-height: 44px;
  background: color-mix(in srgb, var(--line-strong) 68%, var(--muted));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--surface) 74%, transparent);
  cursor: grab;
  transform: translate(-50%, var(--document-scrollbar-thumb-top));
}

.document-rail:hover .document-list-scrollbar,
.document-rail.is-scrollbar-active .document-list-scrollbar,
.document-rail.is-scrollbar-dragging .document-list-scrollbar {
  right: 3px;
  width: 16px;
}

.document-rail:hover .document-list-scrollbar::before,
.document-rail.is-scrollbar-active .document-list-scrollbar::before,
.document-rail.is-scrollbar-dragging .document-list-scrollbar::before {
  width: 10px;
  background: color-mix(in srgb, var(--surface-2) 72%, var(--line-strong));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--line-strong) 45%, transparent);
  opacity: 0.82;
}

.document-rail:hover .document-list-scrollbar-thumb,
.document-rail.is-scrollbar-active .document-list-scrollbar-thumb,
.document-rail.is-scrollbar-dragging .document-list-scrollbar-thumb {
  width: 10px;
  background: color-mix(in srgb, var(--line-strong) 86%, var(--ink));
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--bg) 60%, transparent),
    0 4px 12px color-mix(in srgb, #000 18%, transparent);
}

.document-rail.is-scrollbar-dragging .document-list-scrollbar-thumb {
  cursor: grabbing;
}

.chip-scroll-row,
.reader-control-chiprow,
.reader-control-group .stage-actions,
.lightbox-control-strip,
.reader-lightbox .lightbox-chiprow {
  scrollbar-width: none;
}

.chip-scroll-row::-webkit-scrollbar,
.reader-control-chiprow::-webkit-scrollbar,
.reader-control-group .stage-actions::-webkit-scrollbar,
.lightbox-control-strip::-webkit-scrollbar,
.reader-lightbox .lightbox-chiprow::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.doc-category {
  border-bottom: 1px solid var(--line);
  padding-bottom: 4px;
  margin-bottom: 4px;
}

.doc-category:last-child {
  border-bottom: 0;
}

.doc-category-head {
  position: sticky;
  top: 0;
  z-index: 8;
  width: calc(100% + var(--document-scrollbar-lane) + 8px);
  min-height: 38px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 5px calc(15px + var(--document-scrollbar-lane)) 5px 7px;
  background: color-mix(in srgb, var(--surface-2) 92%, var(--bg));
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition:
    border-color 180ms ease,
    background-color 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.doc-category-head:hover,
.doc-category-head:focus-visible,
.doc-category.has-selected > .doc-category-head {
  border-color: var(--line-strong);
  background: var(--surface);
}

.doc-category-icon {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  border-radius: 5px;
  color: var(--muted);
  background: color-mix(in srgb, var(--surface) 62%, transparent);
  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease;
}

.doc-category-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.doc-category-head:hover .doc-category-icon,
.doc-category-head:focus-visible .doc-category-icon,
.doc-category-head[aria-expanded="true"] .doc-category-icon,
.doc-category.has-selected > .doc-category-head .doc-category-icon {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  box-shadow: inset 0 -2px 0 color-mix(in srgb, currentColor 72%, transparent);
}

.doc-category-head > span:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.doc-category-head small {
  color: color-mix(in srgb, var(--muted) 68%, transparent);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0;
}

.doc-category-body {
  padding-top: 5px;
}

.document-list.is-mouse-scrubbing,
.document-list.is-mouse-scrubbing * {
  cursor: grabbing !important;
  user-select: none;
}

.document-rail.is-collapsed .document-list {
  pointer-events: none;
  opacity: 0;
  transform: translateX(-12px);
  visibility: hidden;
  transition:
    opacity 120ms ease,
    transform 180ms cubic-bezier(0.2, 0, 0.15, 1),
    visibility 0s linear 180ms;
}

.doc-card-shell {
  margin-bottom: 8px;
}

.doc-card {
  width: 100%;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 6px;
  margin-bottom: 0;
  padding: 8px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  contain: layout paint;
  content-visibility: auto;
  contain-intrinsic-size: 66px;
  transition:
    border-color 180ms ease,
    background-color 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.doc-card-shell.is-selected {
  border-radius: 6px;
}

.doc-card.is-selected,
.doc-card:hover {
  border-color: var(--line-strong);
  background: var(--surface);
}

[data-theme="dark"] .doc-card.is-selected,
[data-theme="dark"] .doc-card:hover {
  background: color-mix(in srgb, var(--surface-2) 72%, transparent);
}

.myron-index {
  margin-top: 6px;
  border: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  border-radius: 6px;
  padding: 8px;
  background: color-mix(in srgb, var(--surface) 78%, transparent);
}

.myron-index-head {
  min-width: 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.myron-index-head small {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  text-transform: none;
}

.myron-index p {
  margin: 7px 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.myron-index-rail .myron-page-jump-strip {
  max-height: 82px;
}

.myron-index-rail .myron-article-jump-list {
  max-height: 178px;
}

.myron-index-rail .article-preview-row {
  padding: 7px 0;
}

.doc-thumb {
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper);
}

[data-theme="dark"] .doc-thumb,
[data-theme="dark"] .publication-tile .cover-art,
[data-theme="dark"] .publication-bottom-card .cover-art {
  border-color: color-mix(in srgb, var(--line) 72%, transparent);
  background: color-mix(in srgb, var(--surface-2) 84%, transparent);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
}

[data-theme="dark"] .doc-card.is-selected .doc-thumb,
[data-theme="dark"] .doc-card:hover .doc-thumb {
  border-color: color-mix(in srgb, var(--line-strong) 76%, transparent);
}

.doc-thumb .cover-art {
  width: 100%;
  height: 100%;
}

.doc-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.doc-card strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.2;
}

.doc-card span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.reader-stage {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(260px, 1fr);
  gap: 24px;
  align-items: center;
  padding: 28px;
  contain: layout paint;
}

.reader-stage[data-view="page"]:not([data-hub="pipeline"]):not([data-hub="constellation"]):not([data-hub="welcome"]) {
  position: relative;
  min-height: calc(100dvh - var(--layout-frame) - 16px);
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: 18px;
}

.reader-stage[data-view="page"]:not([data-hub="pipeline"]):not([data-hub="constellation"]):not([data-hub="welcome"]) .reader-page-main {
  width: min(100%, 820px);
  max-width: min(100%, 820px);
}

.reader-stage[data-view="page"]:not([data-hub="pipeline"]):not([data-hub="constellation"]):not([data-hub="welcome"]) .page-plate img {
  max-height: max(320px, min(calc(100dvh - var(--layout-frame) - 72px), 1060px));
}

.reader-stage[data-view="page"]:not([data-hub="pipeline"]):not([data-hub="constellation"]):not([data-hub="welcome"]) .reader-page-copy {
  position: absolute;
  left: clamp(24px, 7vw, 86px);
  bottom: clamp(42px, 7vh, 86px);
  z-index: 2;
  width: min(640px, calc(100% - 112px));
  max-width: calc(100% - 48px);
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 7px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 14px;
  background: color-mix(in srgb, var(--surface) 96%, var(--bg));
  box-shadow: 0 16px 42px rgba(35, 35, 31, 0.14);
}

[data-theme="dark"] .reader-stage[data-view="page"]:not([data-hub="pipeline"]):not([data-hub="constellation"]):not([data-hub="welcome"]) .reader-page-copy {
  border-color: color-mix(in srgb, var(--line-strong) 28%, var(--line));
  background: color-mix(in srgb, var(--surface) 92%, #000 8%);
  box-shadow:
    0 18px 48px rgba(0, 0, 0, 0.48),
    inset 0 1px 0 color-mix(in srgb, var(--line-strong) 16%, transparent);
}

.reader-page-copy .eyebrow {
  max-width: 100%;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage-copy.reader-page-copy h3 {
  grid-column: 1 / -1;
  min-width: 0;
  margin: 0;
  display: -webkit-box;
  overflow: hidden;
  font-size: 30px;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: normal;
  overflow-wrap: anywhere;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.reader-page-copy > p,
.reader-page-copy p:last-child {
  grid-column: 1 / -1;
  margin: 0;
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}

.reader-page-copy .search-hit-strip {
  grid-column: 1 / -1;
  width: 100%;
  padding-bottom: 0;
}

.reader-page-copy .search-hit-chip {
  flex-basis: min(240px, 78vw);
}

.stage-cover-float {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1;
  width: 58px;
  pointer-events: none;
  opacity: 0.9;
}

.archive-layout.is-documents-collapsed .stage-cover-float {
  display: none;
}

.reader-stage[data-hub="constellation"] {
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  padding: 22px;
}

.archive-layout.is-documents-collapsed.is-inspector-collapsed .reader-stage[data-hub="constellation"] {
  grid-template-columns: minmax(0, 1fr);
}

.reader-stage[data-hub="welcome"] {
  min-height: calc(100dvh - var(--layout-frame) - 16px);
  display: block;
  padding: 0;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--surface) 82%, transparent) 0%, color-mix(in srgb, var(--bg-soft) 92%, transparent) 100%);
  overflow: auto;
}

.welcome-page {
  min-height: calc(100dvh - var(--layout-frame) - 16px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 110px 40px 54px;
  text-align: center;
}

.welcome-content {
  width: min(100%, 780px);
  margin: 0 auto;
  opacity: 0;
  animation: welcomeFadeIn 800ms ease 180ms forwards;
}

.welcome-title {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: clamp(2rem, 4vw, 2.65rem);
  font-weight: 760;
  line-height: 1.12;
}

.welcome-features {
  width: min(100%, 760px);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 34px auto 48px;
}

.feature-card {
  min-height: 148px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  border: 1px solid color-mix(in srgb, var(--line) 74%, transparent);
  border-radius: 8px;
  padding: 15px 14px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  color: var(--ink);
  box-shadow: 0 12px 26px rgba(35, 35, 31, 0.08);
  text-align: left;
  cursor: pointer;
  opacity: 0;
  animation: featureSlideIn 600ms ease forwards;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
  contain: layout paint;
}

.feature-card:nth-child(1) {
  animation-delay: 360ms;
}

.feature-card:nth-child(2) {
  animation-delay: 460ms;
}

.feature-card:nth-child(3) {
  animation-delay: 560ms;
}

.feature-card:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  background: var(--surface);
  box-shadow: 0 16px 34px rgba(35, 35, 31, 0.13);
}

.feature-card:active {
  transform: translateY(-1px);
}

.feature-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: 8px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 96%, transparent), color-mix(in srgb, var(--surface-2) 96%, transparent));
  color: var(--ink);
}

.feature-icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.feature-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.feature-title {
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
}

.feature-description {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.42;
}

.welcome-description {
  max-width: 42rem;
  margin: 0 auto 20px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.82;
  text-wrap: pretty;
}

@keyframes welcomeFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes featureSlideIn {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reader-visual {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(130px, 0.48fr) minmax(180px, 0.74fr);
  gap: 16px;
  align-items: center;
}

.metadata-visual {
  grid-template-columns: minmax(160px, 320px);
  justify-content: center;
}

.cover-stage {
  min-width: 0;
}

.page-plate {
  position: relative;
  max-width: 560px;
  margin: 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  padding: 10px;
  background: var(--paper);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.32);
}

.page-plate-button {
  width: 100%;
  cursor: zoom-in;
}

.page-plate::before,
.page-plate::after {
  content: "";
  position: absolute;
  inset: 12px;
  z-index: -1;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-2);
  transform: rotate(-2.6deg) translate(-12px, 8px);
}

.page-plate::after {
  transform: rotate(2deg) translate(10px, 12px);
}

.page-plate img {
  width: 100%;
  max-height: min(70dvh, 780px);
  object-fit: contain;
  transform: translateZ(0);
  transition:
    filter 220ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 180ms ease,
    transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.page-plate img,
.cover-image img,
.doc-thumb img,
.stage-cover-float img,
.lightbox-image-frame img,
.filmstrip-page img,
.publication-bottom-card img {
  filter: grayscale(1);
}

.reader-page-main.is-variant-swapping img,
.lightbox-image-frame.is-variant-swapping img {
  filter: grayscale(1) blur(5px) contrast(0.94);
  opacity: 0.74;
  transform: translateZ(0) scale(0.996);
}

.reader-page-main.is-variant-settling img,
.lightbox-image-frame.is-variant-settling img {
  animation: variantSharpen 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes variantSharpen {
  from {
    filter: grayscale(1) blur(4px) contrast(0.95);
    opacity: 0.78;
    transform: translateZ(0) scale(0.997);
  }

  to {
    filter: grayscale(1);
    opacity: 1;
    transform: translateZ(0) scale(1);
  }
}

.cover-art {
  position: relative;
  isolation: isolate;
  display: grid;
  align-content: space-between;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  border: 1px solid color-mix(in srgb, var(--cover-ink) 26%, transparent);
  border-radius: 5px;
  padding: 9%;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--cover-paper) 88%, white), var(--cover-paper) 44%, color-mix(in srgb, var(--cover-second) 22%, var(--cover-paper))),
    var(--cover-paper);
  color: var(--cover-ink);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.22);
  filter: grayscale(1);
  contain: layout paint;
}

.cover-generated,
.cover-image {
  padding: 0;
  background: var(--cover-paper);
}

.cover-generated img,
.cover-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cover-image img {
  transform: scale(1.012);
}

.cover-archive-page img,
.cover-seed-preview img {
  opacity: 0.96;
}

.cover-thumb {
  box-shadow: none;
}

.cover-image::before {
  z-index: 1;
  inset: 0;
  border: 1px solid color-mix(in srgb, var(--cover-paper) 72%, white);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cover-ink) 18%, transparent);
}

.cover-image::after {
  z-index: 1;
  inset: 0;
  width: auto;
  height: auto;
  left: 0;
  bottom: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 32%, rgba(0, 0, 0, 0.18)),
    linear-gradient(90deg, rgba(255, 255, 255, 0.10), transparent 28%, rgba(0, 0, 0, 0.12));
  opacity: 0.58;
  transform: none;
}

.cover-art::before,
.cover-art::after {
  content: "";
  position: absolute;
  z-index: -1;
  pointer-events: none;
}

.cover-art::before {
  inset: 12%;
  border: 1px solid color-mix(in srgb, var(--cover-ink) 22%, transparent);
}

.cover-art::after {
  width: 130%;
  height: 36%;
  left: -14%;
  bottom: 15%;
  background:
    repeating-linear-gradient(90deg, color-mix(in srgb, var(--cover-ink) 28%, transparent) 0 1px, transparent 1px 12px),
    linear-gradient(90deg, transparent, color-mix(in srgb, var(--cover-accent) 48%, transparent), transparent);
  transform: rotate(-9deg);
}

.cover-glow {
  position: absolute;
  inset: -20% -18% auto auto;
  z-index: -1;
  width: 68%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: color-mix(in srgb, var(--cover-accent) 36%, transparent);
  opacity: 0.34;
}

.cover-thumb .cover-glow {
  display: none;
}

.cover-kicker,
.cover-meta {
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: clamp(8px, 1.5cqw, 11px);
  line-height: 1.25;
  text-transform: uppercase;
}

.cover-art strong {
  display: block;
  max-width: 100%;
  margin: 12px 0;
  overflow-wrap: anywhere;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(15px, 4cqw, 34px);
  line-height: 0.95;
}

.cover-rule {
  display: block;
  width: 54%;
  height: 5px;
  background: var(--cover-accent);
}

.cover-mark {
  display: grid;
  place-items: center;
  width: 46%;
  aspect-ratio: 1;
  border: 1px solid color-mix(in srgb, var(--cover-ink) 44%, transparent);
  background: color-mix(in srgb, var(--cover-paper) 78%, transparent);
  color: var(--cover-ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: clamp(14px, 5cqw, 30px);
  font-weight: 800;
}

.cover-thumb {
  padding: 8%;
}

.cover-thumb strong,
.cover-thumb .cover-meta {
  font-size: 8px;
}

.cover-thumb .cover-kicker,
.cover-thumb .cover-rule {
  display: none;
}

.cover-panel {
  width: 88px;
  flex: 0 0 88px;
}

.cover-chicago-reader::after,
.cover-los-angeles-reader::after {
  height: 28%;
  transform: rotate(-4deg);
}

.cover-hollywood-reporter::after {
  background: repeating-linear-gradient(90deg, color-mix(in srgb, var(--cover-ink) 24%, transparent) 0 1px, transparent 1px 8px);
  transform: rotate(0deg);
}

.cover-stage-raw::after {
  background:
    linear-gradient(90deg, transparent, color-mix(in srgb, var(--cover-accent) 58%, transparent), transparent),
    repeating-linear-gradient(0deg, color-mix(in srgb, var(--cover-ink) 18%, transparent) 0 1px, transparent 1px 16px);
}

.stage-copy {
  min-width: 0;
}

.stage-copy h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 44px;
  line-height: 0.98;
}

.title-hotspot {
  display: block;
  width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: zoom-in;
}

.tap-copy {
  cursor: zoom-in;
}

mark {
  border-radius: 3px;
  padding: 0 2px;
  background: color-mix(in srgb, var(--line-strong) 34%, transparent);
  color: inherit;
}

.stage-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}

.meta-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 9px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
}

.meta-pill-button {
  background: color-mix(in srgb, var(--surface) 74%, transparent);
  cursor: pointer;
}

.meta-pill-button:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.stage-copy p {
  color: var(--muted);
  line-height: 1.65;
}

.stage-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.chip-scroll-row {
  min-width: 0;
  max-width: 100%;
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 2px;
  scrollbar-width: thin;
  touch-action: pan-x;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

.chip-scroll-row > * {
  flex: 0 0 auto;
}

.variant-strip {
  min-width: 0;
  max-width: 100%;
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  margin: 14px 0 0;
  padding: 2px 0 5px;
  scrollbar-width: thin;
  touch-action: pan-x;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

.segmented-controls {
  min-width: 0;
  max-width: 100%;
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  margin: 12px 0 0;
  padding: 2px 0 5px;
  scrollbar-width: thin;
  touch-action: pan-x;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

.variant-strip .chip .chip-label span {
  margin-left: 5px;
  color: currentColor;
  opacity: 0.72;
}

.variant-strip .chip:disabled {
  cursor: not-allowed;
  opacity: 0.54;
}

.inspector-body {
  min-height: 0;
  overflow: auto;
  padding: 12px;
  contain: layout paint;
  scrollbar-gutter: stable;
  scrollbar-width: auto;
  scrollbar-color: var(--line-strong) color-mix(in srgb, var(--surface-2) 72%, transparent);
  opacity: 1;
  transform: translateX(0);
  visibility: visible;
  transition:
    opacity 170ms ease,
    transform 220ms cubic-bezier(0.2, 0, 0.15, 1),
    visibility 0s linear 0s;
}

.inspector.is-collapsed .inspector-body {
  pointer-events: none;
  opacity: 0;
  transform: translateX(12px);
  visibility: hidden;
  transition:
    opacity 120ms ease,
    transform 180ms cubic-bezier(0.2, 0, 0.15, 1),
    visibility 0s linear 180ms;
}

.detail-group {
  border-bottom: 1px solid var(--line);
  padding: 8px 0;
}

.detail-group:last-child {
  border-bottom: 0;
}

.detail-group > summary {
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  text-transform: uppercase;
  list-style: none;
}

.detail-group > summary::-webkit-details-marker {
  display: none;
}

.detail-group > summary::after {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  content: "+";
  border: 1px solid var(--line);
  border-radius: 5px;
  background: color-mix(in srgb, var(--surface) 84%, transparent);
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
  transition:
    width 180ms ease,
    height 180ms ease,
    border-color 160ms ease,
    background-color 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease,
    opacity 160ms ease;
}

.detail-group > summary:hover::after,
.detail-group > summary:focus-visible::after,
.detail-group[open] > summary::after {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  box-shadow: inset 0 -2px 0 currentColor;
}

.detail-group[open] > summary::after {
  content: "-";
}

.detail-group::details-content {
  block-size: 0;
  opacity: 0;
  overflow: clip;
  transition:
    block-size 220ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 160ms ease;
}

.detail-group[open]::details-content {
  block-size: auto;
  opacity: 1;
}

.detail-body {
  padding: 10px 0 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.inspector-details-stack > .detail-group > summary::after {
  width: 18px;
  height: 18px;
  border-color: color-mix(in srgb, var(--line) 48%, transparent);
  background: transparent;
  color: color-mix(in srgb, var(--muted) 76%, transparent);
  font-size: 12px;
  opacity: 0.72;
  box-shadow: none;
}

.inspector-details-stack > .detail-group > summary:hover::after,
.inspector-details-stack > .detail-group > summary:focus-visible::after,
.inspector-details-stack > .detail-group[open] > summary::after {
  border-color: color-mix(in srgb, var(--line-strong) 58%, transparent);
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  color: var(--ink);
  opacity: 0.86;
  box-shadow: none;
}

.inspector-details-group > .detail-body {
  padding-top: 6px;
}

.inspector-details-stack {
  display: grid;
  gap: 0;
}

.inspector-details-stack > .detail-group {
  padding-left: 0;
  padding-right: 0;
}

.inspector-title {
  margin: 0;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
  line-height: 1.02;
}

.reader-control-group .stage-meta,
.reader-control-group .stage-actions,
.reader-control-group .variant-strip {
  margin-top: 10px;
}

.reader-control-group .stage-actions,
.reader-control-group .variant-strip {
  gap: 6px;
}

.detail-body code {
  overflow-wrap: anywhere;
  color: var(--ink);
}

.tag-list,
.pipeline-list,
.registry-grid,
.stat-grid,
.entity-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.entity-cloud.chip-scroll-row {
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
}

.reader-stage[data-hub="constellation"] .constellation-chiprow {
  margin-top: 14px;
}

.constellation-inspector-copy {
  display: block;
  border-bottom: 1px solid var(--line);
  padding: 8px 0 14px;
  margin-bottom: 4px;
}

.constellation-inspector-copy h3 {
  margin: 0 0 12px;
  overflow-wrap: anywhere;
  font-size: clamp(29px, 3.8vw, 42px);
  line-height: 0.98;
}

.constellation-inspector-copy .tap-copy {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.constellation-inspector-copy .stage-meta {
  margin: 13px 0 0;
}

.constellation-inspector-copy .stage-actions {
  margin-top: 12px;
}

.tag-list span,
.entity-cloud span,
.entity-pill,
.stat-card,
.pipeline-card,
.registry-card {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
  background: color-mix(in srgb, var(--surface) 74%, transparent);
  contain: layout paint;
}

.entity-pill {
  color: var(--ink);
  cursor: pointer;
}

.entity-pill:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
}

.mini-chip {
  min-height: 34px;
  padding: 0 9px;
}

.muted-copy {
  color: var(--muted);
}

.text-link-button {
  width: 100%;
  display: block;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 8px 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.text-link-button span {
  color: var(--muted);
  font-size: 12px;
}

.article-list {
  display: grid;
  gap: 4px;
  margin-top: 10px;
}

.myron-page-jump-strip {
  max-height: 132px;
  overflow: auto;
  padding-right: 2px;
}

.myron-article-jump-list {
  max-height: 320px;
  overflow: auto;
  padding-right: 2px;
}

.myron-article-jump-list .text-link-button {
  min-width: 0;
}

.myron-article-jump-list .article-preview-row strong,
.myron-article-jump-list .article-preview-row span {
  overflow-wrap: anywhere;
}

.modal-filter {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  background: var(--bg-soft);
  color: var(--ink);
}

.article-sort-strip {
  margin: 12px 0;
}

.article-index-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.article-index-row {
  width: 100%;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  contain: layout paint;
  content-visibility: auto;
  contain-intrinsic-size: 76px;
}

.article-index-row:hover,
.article-index-row:focus-visible {
  border-color: var(--line-strong);
  background: var(--surface-2);
}

.article-index-row strong,
.article-index-row span {
  display: block;
}

.article-index-row span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.article-preview-row strong {
  display: block;
  margin-bottom: 3px;
}

.article-evidence {
  margin: 7px 0 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.panel-subhead {
  margin: 14px 0 8px;
  color: var(--ink);
  font-size: 13px;
  letter-spacing: 0;
}

.citation-list {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.citation-card {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px;
  background: color-mix(in srgb, var(--surface) 76%, transparent);
}

.citation-card-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 8px;
}

.citation-card-head span {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
}

.citation-exact,
.citation-context {
  margin: 7px 0 0;
  font-size: 12px;
  line-height: 1.45;
}

.citation-exact {
  color: var(--ink);
}

.citation-context {
  color: var(--muted);
}

.stat-card,
.pipeline-card,
.registry-card {
  min-width: min(100%, 150px);
  flex: 1 1 150px;
  content-visibility: auto;
  contain-intrinsic-size: 132px;
}

.stat-card strong,
.pipeline-card strong,
.registry-card strong {
  display: block;
  margin-bottom: 5px;
  font-size: 14px;
}

.stat-card span,
.pipeline-card span,
.registry-card span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.pipeline-card[data-status="prototype"],
.pipeline-card[data-status="complete"] {
  border-color: var(--line-strong);
}

.reader-stage[data-hub="pipeline"] {
  grid-template-columns: minmax(280px, 620px);
  justify-content: center;
  align-items: center;
}

.pipeline-source-overview {
  min-width: 0;
  display: grid;
  gap: 12px;
}

.pipeline-focus {
  min-width: 0;
  display: flex;
  gap: 13px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  background: color-mix(in srgb, var(--surface) 76%, transparent);
}

.pipeline-focus strong,
.pipeline-focus span,
.pipeline-focus code {
  display: block;
}

.pipeline-focus strong {
  overflow-wrap: anywhere;
  font-size: 16px;
  line-height: 1.2;
}

.pipeline-focus span,
.pipeline-focus code {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.pipeline-focus code {
  overflow-wrap: anywhere;
}

.pipeline-variant-list {
  display: grid;
  gap: 6px;
}

.pipeline-variant-row {
  width: 100%;
  min-height: 42px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition:
    border-color 180ms ease,
    background-color 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 180ms ease;
}

.pipeline-variant-row span {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  text-transform: uppercase;
}

.pipeline-variant-row strong {
  font-size: 13px;
  font-weight: 650;
}

.pipeline-variant-row:hover,
.pipeline-variant-row:focus-visible,
.pipeline-variant-row.is-active {
  border-color: var(--line-strong);
  background: var(--surface-2);
}

.pipeline-variant-row:disabled {
  cursor: default;
  opacity: 0.6;
}

.magic-panel {
  min-width: 0;
  align-self: stretch;
  height: min(72vh, 680px);
  min-height: 420px;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  overflow: hidden;
  border-right: 1px solid var(--line);
  background:
    radial-gradient(circle at 50% 28%, color-mix(in srgb, var(--line-strong) 18%, transparent), transparent 34%),
    linear-gradient(180deg, color-mix(in srgb, var(--surface-2) 72%, transparent), color-mix(in srgb, var(--bg) 86%, transparent));
}

[data-theme="dark"] .magic-panel {
  background:
    radial-gradient(circle at 50% 20%, color-mix(in srgb, var(--accent-strong) 22%, transparent), transparent 32%),
    radial-gradient(circle at 18% 86%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 34%),
    linear-gradient(180deg, color-mix(in srgb, var(--surface-2) 74%, #000 8%), color-mix(in srgb, var(--bg) 88%, #000 12%));
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, var(--accent-strong) 10%, transparent),
    inset 0 -48px 82px rgba(0, 0, 0, 0.22);
}

.reader-stage[data-hub="constellation"] .magic-panel {
  height: min(78vh, 760px);
  min-height: 520px;
  border-right: 0;
}

.magic-scene {
  position: relative;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  outline: none;
}

.magic-scene:focus-visible {
  box-shadow: inset 0 0 0 3px var(--focus);
}

.magic-scene canvas {
  width: 100%;
  height: 100%;
  display: block;
  filter: grayscale(1);
}

.magic-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  perspective: 800px;
}

.magic-fallback > span {
  position: absolute;
  width: min(36%, 150px);
  transform: rotate(calc((var(--i) - 3) * 8deg)) translateX(calc((var(--i) - 3) * 22px)) translateY(calc(var(--i) * 4px));
  animation: cardDrift 4800ms ease-in-out infinite alternate;
  animation-delay: calc(var(--i) * -340ms);
}

.search-grid {
  margin-top: 18px;
}

.search-refinement {
  min-width: 0;
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.search-result-group {
  min-width: 0;
}

.search-result-group h4 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 13px;
}

.search-result-group .search-grid {
  margin-top: 0;
}

.result-card {
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.result-card p {
  margin: 7px 0 0;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.45;
}

.result-card small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.search-hit-strip {
  display: flex;
  gap: 8px;
  max-width: 100%;
  overflow-x: auto;
  padding: 2px 0 8px;
  scrollbar-width: thin;
}

.search-hit-chip {
  flex: 0 0 min(260px, 82vw);
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 10px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.search-hit-chip:hover,
.search-hit-chip:focus-visible {
  border-color: var(--line-strong);
  background: var(--surface);
}

.search-hit-chip strong,
.search-hit-chip span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-hit-chip span {
  color: var(--muted);
  font-size: 12px;
}

.publication-profile-page {
  display: grid;
  gap: 14px;
}

.publication-hero {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(150px, 220px) minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}

.publication-hero .cover-art {
  width: 100%;
  max-width: 220px;
  box-shadow: var(--shadow);
}

.publication-hero p {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.55;
}

.provenance-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.provenance-list a {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  background: var(--surface-2);
  color: var(--ink);
  text-decoration: none;
  font-size: 12px;
}

.publication-document-grid {
  margin-top: 8px;
}

@keyframes cardDrift {
  to {
    transform: rotate(calc((var(--i) - 3) * 11deg)) translateX(calc((var(--i) - 3) * 28px)) translateY(calc(var(--i) * -3px));
  }
}

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.66);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 180ms cubic-bezier(0.22, 1, 0.36, 1),
    background-color 180ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity;
}

.modal-layer.is-open {
  opacity: 1;
  pointer-events: auto;
}

.modal-layer.is-closing {
  opacity: 0;
  pointer-events: none;
}

.modal-layer[hidden] {
  display: none !important;
  pointer-events: none;
}

.modal {
  width: min(1100px, 100%);
  max-height: min(860px, 92dvh);
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  contain: layout paint;
  backface-visibility: hidden;
  transform: translate3d(0, 12px, 0) scale(0.985);
  transform-origin: center;
  opacity: 0;
  transition:
    opacity 190ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform, opacity;
}

.modal-layer.is-open .modal {
  transform: translate3d(0, 0, 0) scale(1);
  opacity: 1;
}

.modal-layer.is-closing .modal {
  transform: translate3d(0, 8px, 0) scale(0.99);
  opacity: 0;
}

.reader-lightbox {
  overflow: hidden;
}

.modal-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding: 12px;
  background: var(--surface);
}

.modal-head .stage-actions {
  margin-top: 0;
  justify-content: flex-end;
}

.modal-head h2 {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
  line-height: 1.05;
}

.reader-lightbox .modal-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.lightbox-title-block {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.lightbox-title-block .eyebrow {
  margin: 0;
}

.lightbox-title-block h2 {
  display: -webkit-box;
  max-width: 46rem;
  overflow: hidden;
  text-wrap: balance;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.reader-lightbox .lightbox-chiprow {
  min-width: 0;
  max-width: 100%;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px;
  background: var(--gallery-tray-bg);
  scrollbar-width: none;
  scrollbar-color: var(--line-strong) color-mix(in srgb, var(--surface-2) 72%, transparent);
}

.reader-lightbox .lightbox-nav-chip {
  width: 42px;
  min-width: 42px;
  min-height: 42px;
  justify-content: center;
  padding: 0 6px;
  background: var(--gallery-card-bg);
}

.reader-lightbox .lightbox-nav-chip .chip-label,
.reader-lightbox .lightbox-page-chip .chip-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.reader-lightbox .lightbox-page-chip {
  min-height: 40px;
  gap: 5px;
  padding: 0 6px;
  flex: 0 0 auto;
  background: var(--gallery-card-bg);
}

.reader-lightbox .lightbox-nav-chip:hover,
.reader-lightbox .lightbox-nav-chip:focus-visible {
  width: auto;
  min-width: 46px;
  padding: 0 11px;
  overflow: visible;
  z-index: 4;
}

.reader-lightbox .lightbox-nav-chip:hover .chip-label,
.reader-lightbox .lightbox-nav-chip:focus-visible .chip-label {
  position: static;
  width: auto;
  height: auto;
  overflow: visible;
  clip: auto;
  white-space: nowrap;
}

.reader-lightbox .lightbox-page-chip input {
  width: 48px;
  min-height: 30px;
}

.reader-lightbox .lightbox-close-chip {
  margin-left: 4px;
}

.modal-body {
  padding: 14px;
}

.entity-explorer {
  display: grid;
  gap: 14px;
}

.entity-summary {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.entity-summary p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.entity-profile-grid {
  margin-top: 0;
}

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

.entity-result-card {
  display: block;
  min-height: 154px;
  color: inherit;
  text-align: left;
  cursor: pointer;
  contain: layout paint;
  content-visibility: auto;
  contain-intrinsic-size: 172px;
}

.entity-result-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.lightbox-page {
  display: grid;
  grid-template-columns: minmax(300px, 0.82fr) minmax(260px, 0.38fr);
  gap: 18px;
  align-items: stretch;
}

.reader-lightbox .lightbox-page {
  box-sizing: border-box;
  height: calc(min(860px, 92dvh) - 65px);
  max-height: none;
  min-height: 0;
  overflow: hidden;
}

.reader-lightbox.is-info-collapsed .lightbox-page {
  grid-template-columns: minmax(0, 1fr);
}

.reader-lightbox.is-info-open .lightbox-page {
  grid-template-columns: minmax(300px, 0.82fr) minmax(260px, 0.38fr);
}

.lightbox-main {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 10px;
}

.lightbox-info-panel {
  min-width: 0;
  align-self: stretch;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  overflow: hidden;
  border-left: 1px solid var(--line);
  padding-left: 14px;
}

.reader-lightbox.is-info-collapsed .lightbox-info-panel {
  display: none;
}

.lightbox-info-rail {
  width: 40px;
  min-height: 160px;
  display: none;
  align-content: start;
  justify-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 0;
  background: var(--surface-2);
  color: var(--muted);
  cursor: pointer;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  text-transform: uppercase;
  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    color 160ms ease;
}

.lightbox-info-rail:hover,
.lightbox-info-rail:focus-visible,
.lightbox-info-rail[aria-expanded="true"] {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--ink);
}

.lightbox-info-rail .chip-symbol {
  min-width: 34px;
  width: 34px;
  height: 34px;
  padding: 0;
}

.lightbox-info-rail .chip-symbol svg {
  width: 24px;
  height: 24px;
}

.lightbox-info-rail span:last-child {
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

.reader-lightbox.is-info-collapsed .lightbox-info-rail {
  display: none;
}

.reader-lightbox.is-info-collapsed .lightbox-info-body {
  display: none;
}

.lightbox-info-body {
  min-width: 0;
  max-height: 78vh;
  overflow: auto;
  padding-right: 2px;
}

.lightbox-meta-row {
  flex-wrap: nowrap;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 4px;
  scrollbar-width: thin;
  touch-action: pan-x;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

.lightbox-meta-row .meta-pill {
  flex: 0 0 auto;
  white-space: nowrap;
}

.reader-lightbox .stage-copy {
  min-width: 0;
  min-height: 0;
  max-height: 100%;
  overflow: auto;
  padding-right: 4px;
}

.lightbox-sidebar-groups {
  display: grid;
  gap: 0;
  margin-top: 14px;
}

.reader-lightbox .detail-body .variant-strip,
.reader-lightbox .detail-body .segmented-controls,
.reader-lightbox .detail-body .stage-meta,
.reader-lightbox .detail-body .stage-actions {
  margin-top: 0;
}

.reader-lightbox .detail-body .variant-strip,
.reader-lightbox .detail-body .segmented-controls {
  margin-bottom: 0;
}

.reader-lightbox .detail-body .stage-meta {
  flex-wrap: nowrap;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 4px;
  scrollbar-width: thin;
  touch-action: pan-x;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

.reader-lightbox .detail-body .meta-pill {
  flex: 0 0 auto;
  white-space: nowrap;
}

.lightbox-control-strip {
  min-width: 0;
  max-width: 100%;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 4px;
  scrollbar-width: thin;
  touch-action: pan-x;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

.lightbox-image-frame {
  min-height: 0;
  max-height: none;
  overflow: auto;
  display: grid;
  place-items: start center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  contain: layout paint;
}

.lightbox-image-frame.has-myron {
  border-color: var(--line-strong);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--line-strong) 34%, transparent);
}

.lightbox-image-frame.is-ads-only {
  opacity: 0.72;
}

.lightbox-image-frame img {
  width: 100%;
  max-height: none;
  object-fit: contain;
  transform: translateZ(0);
  transition:
    filter 220ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 180ms ease,
    transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.ocr-page-layer {
  position: relative;
  width: 100%;
  max-width: 100%;
  line-height: 0;
}

.ocr-page-layer > img {
  display: block;
}

.ocr-hit-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.ocr-hit-box {
  position: absolute;
  min-height: 12px;
  border: 2px solid color-mix(in srgb, var(--line-strong) 74%, white);
  border-radius: 4px;
  background: color-mix(in srgb, var(--line-strong) 24%, transparent);
  box-shadow:
    0 0 0 1px color-mix(in srgb, #000 16%, transparent),
    0 0 22px color-mix(in srgb, var(--line-strong) 42%, transparent);
  animation: ocr-hit-pulse 1400ms ease-out 1;
}

@keyframes ocr-hit-pulse {
  0% {
    opacity: 0;
    transform: scale(0.96);
  }
  32% {
    opacity: 1;
    transform: scale(1.018);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.lightbox-image-frame[data-reader-zoom="fit-height"] {
  place-items: center;
}

.lightbox-image-frame[data-reader-zoom="fit-height"] .ocr-page-layer {
  width: auto;
  max-width: 100%;
}

.lightbox-image-frame[data-reader-zoom="fit-height"] img {
  width: auto;
  max-width: 100%;
  max-height: 100%;
}

.lightbox-image-frame[data-reader-zoom="actual"] {
  place-items: start center;
}

.lightbox-image-frame[data-reader-zoom="actual"] .ocr-page-layer {
  width: var(--image-width);
  max-width: none;
}

.lightbox-image-frame[data-reader-zoom="actual"] img {
  width: auto;
  max-width: none;
  max-height: none;
}

.page-jump {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 9px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
}

.page-jump input {
  width: 68px;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 6px;
  background: var(--bg-soft);
  color: var(--ink);
}

.lightbox-filmstrip {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
  background: var(--gallery-tray-bg);
  box-shadow: 0 -6px 18px color-mix(in srgb, #000 10%, transparent);
  cursor: grab;
  scrollbar-width: thin;
  scroll-padding-inline: 8px;
  touch-action: pan-x;
  user-select: none;
}

.lightbox-filmstrip.is-scrubbing {
  cursor: grabbing;
}

.filmstrip-page {
  position: relative;
  width: 64px;
  flex: 0 0 64px;
  aspect-ratio: 3 / 4;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0;
  background: var(--gallery-card-bg);
  color: var(--ink);
  cursor: pointer;
  overflow: hidden;
  transition:
    border-color 180ms ease,
    background-color 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 180ms ease;
}

.filmstrip-page.is-active {
  border-color: var(--line-strong);
  background: var(--gallery-card-active-bg);
  color: var(--ink);
  box-shadow: var(--gallery-active-shadow);
}

.filmstrip-page.has-myron {
  box-shadow: inset 0 -3px 0 color-mix(in srgb, var(--line-strong) 84%, transparent);
}

.filmstrip-page.is-active.has-myron {
  box-shadow: var(--gallery-active-shadow);
}

.filmstrip-page.is-ads-only {
  opacity: 0.58;
}

.filmstrip-page:hover,
.filmstrip-page:focus-visible {
  border-color: var(--line-strong);
  background: var(--gallery-card-active-bg);
  transform: translateY(-1px);
}

.filmstrip-page img {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  object-fit: cover;
  border: 0;
  background: var(--paper);
}

.filmstrip-page span,
.filmstrip-page b {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
}

.filmstrip-page span {
  position: absolute;
  left: 50%;
  bottom: 4px;
  z-index: 2;
  min-width: 20px;
  border: 1px solid color-mix(in srgb, var(--surface) 68%, var(--line-strong));
  border-radius: 999px;
  padding: 2px 6px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  color: var(--ink);
  opacity: 0;
  pointer-events: none;
  text-align: center;
  transform: translate(-50%, 4px);
  transition:
    opacity 120ms ease,
    transform 120ms ease;
}

.filmstrip-page:hover span,
.filmstrip-page:focus-visible span,
.lightbox-filmstrip.is-scrubbing .filmstrip-page.is-active span {
  opacity: 1;
  transform: translate(-50%, 0);
}

.filmstrip-page b {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 16px;
  padding: 2px 4px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  text-align: center;
}

.filmstrip-gap {
  display: grid;
  place-items: center;
  min-width: 22px;
  color: var(--muted);
}

.annotation-panel {
  margin-top: 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 8px 0;
  background: transparent;
}

.annotation-panel summary .annotation-count {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  text-transform: none;
  white-space: nowrap;
}

.annotation-body {
  padding-top: 10px;
}

.annotation-panel label {
  display: grid;
  gap: 5px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.annotation-panel input,
.annotation-panel textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 9px;
  background: var(--bg-soft);
  color: var(--ink);
}

.annotation-panel textarea {
  resize: vertical;
}

.annotation-tag-chips {
  min-width: 0;
  max-width: 100%;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  margin-top: 9px;
  padding-bottom: 4px;
  scrollbar-width: thin;
  touch-action: pan-x;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

.annotation-tag-chips .mini-chip {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 9px;
  background: color-mix(in srgb, var(--surface) 74%, transparent);
  color: var(--ink);
  cursor: pointer;
}

.annotation-tag-chips .mini-chip:hover,
.annotation-tag-chips .mini-chip:focus-visible {
  border-color: var(--line-strong);
  background: var(--surface-2);
}

.annotation-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.annotation-card {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px;
  background: var(--surface);
}

.annotation-card.is-editing {
  border-color: var(--line-strong);
  background: color-mix(in srgb, var(--surface-2) 72%, transparent);
}

.annotation-card-head,
.annotation-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.annotation-card-head span {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
}

.annotation-card p {
  margin: 7px 0;
}

.annotation-card .tag-list {
  margin-bottom: 8px;
}

.document-text-view {
  display: grid;
  gap: 12px;
}

.transcript-markdown {
  max-height: 68vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: clamp(16px, 2vw, 24px);
  background: color-mix(in srgb, var(--surface) 88%, var(--paper));
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  line-height: 1.68;
}

.transcript-markdown h3 {
  margin: 1.25rem 0 0.45rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.3rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  letter-spacing: 0.04em;
  line-height: 1.25;
  text-transform: uppercase;
}

.transcript-markdown h3:first-child {
  margin-top: 0;
}

.transcript-markdown p {
  max-width: 94ch;
  margin: 0 0 0.9rem;
}

.transcript-audit-corner {
  width: min(560px, 100%);
  margin-left: auto;
  opacity: 0.78;
}

.transcript-audit-corner[open] {
  opacity: 1;
}

.intro-gate {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #080808;
  color: #f4f4f1;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 560ms cubic-bezier(0.22, 1, 0.36, 1),
    background-color 560ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity;
}

.intro-gate.is-open {
  opacity: 1;
  pointer-events: auto;
}

.intro-gate.is-exiting {
  background: rgba(8, 8, 8, 0);
  opacity: 0;
  pointer-events: none;
}

.intro-gate[hidden] {
  display: none;
}

.intro-frame {
  width: min(760px, 100%);
  min-height: min(540px, 78vh);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 18px;
  border: 1px solid color-mix(in srgb, var(--accent-strong) 24%, var(--line));
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--accent-strong) 16%, transparent), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 40%),
    var(--bg);
  cursor: pointer;
  overflow: hidden;
  backface-visibility: hidden;
  transform: translate3d(0, 10px, 0) scale(0.985);
  transform-origin: center;
  opacity: 0;
  transition:
    opacity 520ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 560ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform, opacity;
}

.intro-gate.is-open .intro-frame {
  transform: translate3d(0, 0, 0) scale(1);
  opacity: 1;
}

.intro-gate.is-exiting .intro-frame {
  transform: translate3d(0, -8px, 0) scale(0.985);
  opacity: 0;
}

.leader-line {
  width: min(440px, 68%);
  height: 1px;
  background: #f4f4f1;
  transform-origin: center;
  animation: leader 1300ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.intro-mark {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border: 1px solid #f4f4f1;
  border-radius: 7px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 26px;
  font-weight: 800;
  animation: introRise 700ms 280ms both;
}

.intro-stack {
  position: relative;
  width: 210px;
  height: 116px;
  margin: -8px 0;
}

.intro-stack span {
  position: absolute;
  inset: 16px 44px;
  border: 1px solid #888882;
  background: #efefeb;
  transform: rotate(-7deg) translateX(-34px);
  animation: stackIn 900ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.intro-stack span:nth-child(2) {
  transform: rotate(0deg);
  animation-delay: 120ms;
}

.intro-stack span:nth-child(3) {
  transform: rotate(7deg) translateX(34px);
  animation-delay: 220ms;
}

.intro-frame h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 64px;
  line-height: 0.9;
  text-align: center;
  animation: introRise 700ms 650ms both;
}

.intro-words {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  color: #c9c9c3;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  text-transform: uppercase;
  animation: introRise 700ms 900ms both;
}

.mobile-rail {
  display: none;
}

.noscript {
  position: fixed;
  inset: auto 20px 20px;
  z-index: 60;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--surface);
}

@keyframes leader {
  from {
    opacity: 0;
    transform: scaleX(0.05);
  }
  to {
    opacity: 1;
    transform: scaleX(1);
  }
}

@keyframes introRise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes stackIn {
  from {
    opacity: 0;
    transform: rotate(0deg) translateY(30px) scale(0.92);
  }
}

@media (max-width: 1080px) {
  .app-dock {
    grid-template-columns: auto minmax(160px, max-content) minmax(180px, 1fr) auto;
    gap: 8px;
  }

  .search-shell {
    grid-column: auto;
    grid-row: auto;
  }

  .archive-layout {
    grid-template-columns: minmax(200px, 280px) minmax(0, 1fr);
  }

  .archive-layout.is-documents-collapsed {
    grid-template-columns: 52px minmax(0, 1fr);
  }

  .archive-layout[data-hub="welcome"],
  .archive-layout.is-documents-collapsed[data-hub="welcome"],
  .archive-layout.is-inspector-collapsed[data-hub="welcome"] {
    grid-template-columns: minmax(0, 1fr);
  }

  .inspector {
    grid-column: 1 / -1;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .reader-stage {
    grid-template-columns: 1fr;
  }

  .reader-stage[data-hub="constellation"],
  .archive-layout.is-documents-collapsed.is-inspector-collapsed .reader-stage[data-hub="constellation"] {
    grid-template-columns: 1fr;
  }

  .reader-stage[data-hub="constellation"] .magic-panel {
    height: min(70vh, 620px);
    min-height: 420px;
  }

  .reader-visual {
    grid-template-columns: minmax(120px, 0.42fr) minmax(180px, 0.72fr);
  }

  .magic-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 760px) {
  :root {
    --dock-height: 164px;
    --mobile-rail: 74px;
    --app-block-end: 16px;
  }

  .app {
    padding-left: 8px;
    padding-right: 8px;
    padding-bottom: calc(var(--mobile-rail) + env(safe-area-inset-bottom) + 16px);
  }

  .app-dock {
    position: sticky;
    top: max(8px, env(safe-area-inset-top));
    z-index: 30;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 8px;
    padding: 8px;
    box-shadow: 0 12px 32px rgba(38, 38, 34, 0.16);
    transition:
      border-color 180ms ease,
      background-color 220ms ease,
      box-shadow 220ms ease,
      opacity 180ms ease,
      transform 240ms cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
  }

  .app.is-dock-hidden .app-dock {
    pointer-events: none;
    opacity: 0.06;
    transform: translate3d(0, calc(-100% - 16px), 0);
  }

  .brand-lockup {
    align-items: center;
    gap: 8px;
    padding: 0;
  }

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

  .dock-sidebar-toggle,
  .dock-sidebar-toggle[aria-pressed="true"],
  .icon-button,
  .filter-toggle {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
  }

  .dock-tools {
    position: static;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    justify-content: flex-end;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
  }

  .dock-tools::-webkit-scrollbar {
    display: none;
  }

  .search-shell {
    grid-column: 1 / -1;
  }

  .search-shell,
  .control-deck,
  .publication-gallery,
  .publication-profile,
  .publication-hero,
  .chip-row,
  .chip-strip,
  .archive-layout,
  .document-list,
  .reader-stage {
    max-width: 100%;
    min-width: 0;
  }

  .brand-lockup > div {
    padding-right: 0;
  }

  .publication-profile,
  .publication-hero {
    grid-template-columns: 1fr;
  }

  .publication-profile .cover-art,
  .publication-hero .cover-art {
    width: min(180px, 56vw);
    max-width: 180px;
  }

  .archive-layout {
    display: block;
  }

  .document-rail {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    overflow: hidden;
  }

  .document-list {
    --document-scrollbar-lane: 0px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    max-height: none;
    overflow-x: auto;
    padding: 8px 8px 10px;
    scroll-snap-type: x proximity;
    scrollbar-width: auto;
    scrollbar-color: var(--line-strong) color-mix(in srgb, var(--surface-2) 72%, transparent);
    touch-action: pan-x;
  }

  .document-list::-webkit-scrollbar {
    width: 14px;
    height: 14px;
  }

  .document-list::-webkit-scrollbar-track {
    border-radius: 999px;
    background: color-mix(in srgb, var(--surface-2) 70%, transparent);
  }

  .document-list::-webkit-scrollbar-thumb {
    min-height: 56px;
    border: 3px solid color-mix(in srgb, var(--surface-2) 70%, transparent);
    border-radius: 999px;
    background: color-mix(in srgb, var(--line-strong) 82%, var(--ink));
  }

  .document-list-scrollbar {
    display: none;
  }

  .doc-category {
    flex: 0 0 min(282px, 84vw);
    max-height: 238px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 6px;
    margin-bottom: 0;
    padding: 6px;
    scroll-snap-align: start;
    scrollbar-width: auto;
  }

  .doc-category.is-collapsed {
    flex-basis: 174px;
    max-height: 54px;
    overflow: hidden;
  }

  .doc-category-head {
    top: 0;
    width: 100%;
    min-height: 40px;
    padding: 5px 7px;
  }

  .doc-category.is-collapsed .doc-category-body {
    display: none;
  }

  .doc-card {
    width: 100%;
    flex: 0 0 auto;
  }

  .publication-bottom-bar {
    bottom: calc(var(--mobile-rail) + env(safe-area-inset-bottom) + 10px);
    max-width: calc(100vw - 16px);
    max-height: min(46vh, 360px);
    overflow: hidden;
  }

  .publication-bottom-bar.is-collapsed {
    display: none;
  }

  .publication-bottom-scroll {
    max-width: calc(100vw - 38px);
    scroll-snap-type: x proximity;
  }

  .publication-bottom-card {
    width: 64px;
    min-width: 64px;
    scroll-snap-align: start;
  }

  .reader-stage {
    padding: 14px;
  }

  .reader-stage[data-hub="welcome"] {
    padding: 0;
  }

  .welcome-page {
    padding: 58px 18px 32px;
  }

  .welcome-features {
    grid-template-columns: 1fr;
    gap: 10px;
    margin: 24px auto 32px;
  }

  .feature-card {
    min-height: 0;
    grid-template-columns: 38px minmax(0, 1fr);
    padding: 13px;
  }

  .feature-icon {
    width: 38px;
    height: 38px;
  }

  .feature-title {
    font-size: 14px;
  }

  .feature-description {
    font-size: 12px;
  }

  .welcome-description {
    max-width: none;
    margin-bottom: 16px;
    font-size: 14px;
    line-height: 1.64;
  }

  .reader-visual {
    grid-template-columns: 1fr;
  }

  .cover-stage {
    width: min(240px, 70vw);
    margin: 0 auto;
  }

  .page-plate img {
    max-height: 58vh;
  }

  .reader-stage[data-view="page"]:not([data-hub="pipeline"]):not([data-hub="constellation"]):not([data-hub="welcome"]) .reader-page-copy {
    position: static;
    width: 100%;
    margin-top: 12px;
    transform: none;
    grid-template-columns: minmax(0, 1fr);
  }

  .reader-page-copy h3 {
    white-space: normal;
  }

  .magic-panel {
    height: min(62vh, 520px);
    min-height: 340px;
  }

  .reader-stage[data-hub="constellation"] .magic-panel {
    height: min(62vh, 520px);
    min-height: 340px;
  }

  .magic-scene {
    min-height: 0;
  }

  .lightbox-page {
    grid-template-columns: 1fr;
  }

  .modal-layer {
    align-items: stretch;
    padding: 8px;
  }

  .modal {
    width: 100%;
    max-height: calc(100dvh - 16px);
  }

  .reader-lightbox {
    height: calc(100dvh - 16px);
    max-height: calc(100dvh - 16px);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .reader-lightbox .modal-head {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 8px;
    padding: 10px;
  }

  .reader-lightbox .modal-head h2 {
    display: -webkit-box;
    overflow: hidden;
    font-size: 18px;
    line-height: 1.12;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .reader-lightbox .modal-head .stage-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .reader-lightbox .lightbox-chiprow {
    scroll-snap-type: x proximity;
  }

  .reader-lightbox .lightbox-nav-chip,
  .reader-lightbox .lightbox-close-chip,
  .reader-lightbox .lightbox-page-chip {
    min-width: 44px;
    min-height: 44px;
  }

  .reader-lightbox .modal-body {
    min-height: 0;
    padding: 10px;
    overflow: hidden;
  }

  .reader-lightbox .lightbox-page {
    height: auto;
    max-height: none;
    min-height: 0;
    overflow: hidden;
    align-items: start;
    gap: 10px;
  }

  .reader-lightbox.is-info-collapsed .lightbox-page {
    grid-template-columns: 1fr;
  }

  .reader-lightbox.is-info-open .lightbox-page {
    grid-template-columns: 1fr;
  }

  .lightbox-main {
    gap: 8px;
  }

  .lightbox-image-frame {
    max-height: 48dvh;
  }

  .reader-lightbox.is-info-collapsed .lightbox-image-frame {
    max-height: calc(100dvh - 230px);
  }

  .lightbox-filmstrip {
    scroll-snap-type: x proximity;
  }

  .filmstrip-page {
    scroll-snap-align: start;
  }

  .lightbox-info-panel {
    align-self: start;
    border-top: 1px solid var(--line);
    border-left: 0;
    padding-top: 10px;
    padding-left: 0;
  }

  .reader-lightbox.is-info-collapsed .lightbox-info-panel {
    display: none;
  }

  .reader-lightbox.is-info-collapsed .lightbox-info-rail {
    display: none;
  }

  .reader-lightbox.is-info-collapsed .lightbox-info-rail span:last-child {
    writing-mode: horizontal-tb;
  }

  .lightbox-info-body {
    max-height: 30dvh;
    padding-right: 0;
  }

  .entity-summary {
    display: grid;
  }

  .entity-result-grid {
    grid-template-columns: 1fr;
  }

  .modal-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .modal-head .stage-actions {
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 3px;
  }

  .reader-lightbox .stage-copy {
    max-height: none;
    overflow: auto;
    padding-right: 0;
  }

  .annotation-panel summary .annotation-count {
    display: none;
  }

  .mobile-rail {
    position: fixed;
    z-index: 32;
    left: 8px;
    right: 8px;
    bottom: max(8px, env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 7px;
    background: color-mix(in srgb, var(--surface) 93%, transparent);
    box-shadow: 0 -10px 30px rgba(38, 38, 34, 0.18);
    backdrop-filter: blur(14px);
    contain: layout paint;
  }

  .mobile-rail button {
    min-width: 0;
    min-height: 52px;
    display: grid;
    grid-template-rows: 24px auto;
    place-items: center;
    gap: 2px;
    padding: 5px 4px;
    color: var(--ink);
    font-size: 11px;
    font-weight: 750;
    letter-spacing: 0;
  }

  .mobile-rail .tool-symbol {
    width: 24px;
    height: 24px;
  }

  .mobile-rail .tool-symbol svg {
    width: 22px;
    height: 22px;
  }

  .mobile-rail-label {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media (max-width: 520px) {
  .dock-tools {
    gap: 5px;
  }

  .icon-button {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
  }

  .brand-lockup > div {
    padding-right: 0;
  }

  .wordmark {
    display: none;
  }

  .stage-copy h3 {
    font-size: 34px;
  }
}

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