:root {
  --font-mono: 'JetBrains Mono', 'IBM Plex Mono', 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  --font-serif: 'Iowan Old Style', 'Palatino Linotype', 'Book Antiqua', Palatino, 'EB Garamond', Georgia, serif;

  --ui-bg: #121211;
  --ui-panel: #191816;
  --ui-border: #2e2c28;
  --ui-text: #ebe7de;
  --ui-muted: #9e998e;
  --ui-accent: #c85232;

  --stage-paper: #f6f3ec;
  --stage-ink: #191816;
  --stage-accent: #8b261d;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--ui-bg);
  color: var(--ui-text);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

/* Top Masthead */
.app-shell {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
}

.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 18px;
  background: #0d0d0c;
  border-bottom: 1px solid var(--ui-border);
}

.brand-block {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}

.brand-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #f6f3ec;
  transition: letter-spacing 0.35s ease;
}

.brand-title:hover {
  letter-spacing: 0.25em;
}

.brand-tagline {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 13.5px;
  color: var(--ui-muted);
}

.masthead-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ui-btn {
  background: #201f1c;
  border: 1px solid var(--ui-border);
  color: var(--ui-text);
  padding: 6px 11px;
  cursor: pointer;
  font-size: 11.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: background 0.15s ease, border-color 0.15s ease, letter-spacing 0.2s ease;
}

.ui-btn:hover,
.ui-btn:focus-visible {
  background: #2b2925;
  border-color: #635e54;
}

.ui-btn.active-toggle {
  background: var(--ui-accent);
  border-color: var(--ui-accent);
  color: #fff;
}

.ui-btn.accent-btn {
  background: #2a1915;
  border-color: var(--ui-accent);
  color: #f7d6cc;
}

.ui-btn.accent-btn:hover {
  background: var(--ui-accent);
  color: #fff;
}

/* Main 3-Column Workspace */
.workspace-grid {
  display: grid;
  grid-template-columns: 295px 1fr 310px;
  min-height: calc(100vh - 84px);
}

/* Left Sidebar: 21 Style Registry */
.registry-sidebar {
  background: var(--ui-panel);
  border-right: 1px solid var(--ui-border);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 84px);
  overflow: hidden;
}

.wing-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--ui-border);
  background: #141311;
}

.wing-tab {
  background: transparent;
  border: 1px solid transparent;
  color: var(--ui-muted);
  padding: 3px 7px;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.wing-tab:hover {
  color: var(--ui-text);
}

.wing-tab.active {
  border-color: var(--ui-accent);
  color: #fff;
  background: rgba(200, 82, 50, 0.16);
}

.style-list {
  list-style: none;
  margin: 0;
  padding: 6px 0;
  overflow-y: auto;
  flex: 1;
}

.style-item-btn {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  border-left: 3px solid transparent;
  padding: 9px 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: background 0.15s ease, padding-left 0.2s ease;
}

.style-item-btn:hover {
  background: rgba(255, 255, 255, 0.04);
  padding-left: 17px;
}

.style-item-btn.selected {
  background: rgba(200, 82, 50, 0.14);
  border-left-color: var(--ui-accent);
}

.style-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  color: #f3efe6;
}

.style-num {
  color: var(--ui-muted);
  font-size: 10.5px;
  margin-right: 6px;
}

.featured-star {
  font-size: 9.5px;
  color: #e39b4b;
  border: 1px solid rgba(227, 155, 75, 0.4);
  padding: 0 4px;
  letter-spacing: 0.04em;
}

.style-item-sub {
  font-size: 11px;
  color: var(--ui-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Center Stage Area */
.stage-column {
  display: flex;
  flex-direction: column;
  background: #171614;
  max-height: calc(100vh - 84px);
  overflow-y: auto;
}

.input-composer-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 12px 20px;
  background: #141311;
  border-bottom: 1px solid var(--ui-border);
}

.input-field-wrap {
  flex: 1;
  min-width: 220px;
  display: flex;
  align-items: center;
  background: #0d0d0c;
  border: 1px solid var(--ui-border);
  padding: 2px 10px;
}

.input-field-wrap:focus-within {
  border-color: var(--ui-accent);
}

.input-prompt-label {
  font-size: 10.5px;
  color: var(--ui-muted);
  margin-right: 8px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.user-input-box {
  width: 100%;
  background: transparent;
  border: none;
  color: #f6f3ec;
  padding: 7px 0;
  outline: none;
  font-family: var(--font-serif);
  font-size: 14.5px;
}

.stage-viewport {
  flex: 1;
  padding: 26px 32px 48px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

/* The Paper Artwork Sheet */
.artwork-sheet {
  width: 100%;
  max-width: 820px;
  background-color: var(--stage-paper);
  color: var(--stage-ink);
  border: 1px solid rgba(25, 24, 22, 0.25);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.42);
  padding: 36px 44px;
  transition: background-color 0.35s ease, color 0.25s ease;
  position: relative;
}

/* Section 5: No gradients except where Dream Overload demands */
.artwork-sheet.dream-gradient-sheet {
  background-image: linear-gradient(155deg, #f6eef8 0%, #eae2f6 48%, #f8f1ea 100%);
}

.artwork-sheet.font-serif {
  font-family: var(--font-serif);
}

.artwork-sheet.font-mono {
  font-family: var(--font-mono);
}

.artwork-sheet.font-mixed {
  font-family: var(--font-serif);
}

.sheet-header {
  border-bottom: 1.5px solid var(--stage-ink);
  padding-bottom: 16px;
  margin-bottom: 22px;
}

.sheet-kicker {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  color: var(--stage-accent);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.sheet-title {
  margin: 0 0 8px 0;
  font-size: 30px;
  line-height: 1.15;
  letter-spacing: -0.01em;
  transition: letter-spacing 0.35s ease;
}

.sheet-epigraph {
  margin: 0 0 12px 0;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 15.5px;
  opacity: 0.82;
}

.sheet-reading-hint {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  background: rgba(0, 0, 0, 0.045);
  border-left: 3px solid var(--stage-accent);
  padding: 7px 10px;
  margin-bottom: 12px;
}

.hint-badge {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--stage-accent);
  white-space: nowrap;
}

.sheet-meta-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 10.5px;
}

.meta-pill {
  border: 1px solid rgba(0, 0, 0, 0.2);
  padding: 2px 8px;
  background: rgba(255, 255, 255, 0.35);
}

.meta-key {
  opacity: 0.65;
}

.meta-val {
  font-weight: 700;
  color: var(--stage-accent);
}

/* Stage Diagrams */
.stage-diagram-figure {
  margin: 0 0 22px 0;
  padding: 12px;
  border: 1px solid rgba(0, 0, 0, 0.16);
  background: rgba(255, 255, 255, 0.32);
}

.stage-svg-artwork {
  width: 100%;
  height: auto;
  display: block;
}

.stage-diagram-figure figcaption {
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-align: right;
  opacity: 0.7;
}

/* Render Blocks */
.sheet-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.block-card {
  padding: 14px 16px;
  border: 1px solid rgba(0, 0, 0, 0.14);
  background: rgba(255, 255, 255, 0.26);
  transition: transform 0.2s ease, letter-spacing 0.25s ease, border-color 0.2s ease;
}

.block-card.ritual-pulse {
  border-color: var(--stage-accent);
  letter-spacing: 0.03em;
}

.block-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--stage-accent);
  text-transform: uppercase;
  margin-bottom: 6px;
}

/* 1. Negation Pair */
.mirror-thesis {
  margin: 0 0 6px 0;
  font-size: 18px;
  font-weight: 600;
}

.mirror-antithesis {
  margin: 0;
  font-size: 17.5px;
  font-style: italic;
  transform: scaleY(1);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.artwork-sheet.polarity-inverted .mirror-antithesis {
  opacity: 1 !important;
  font-weight: 700;
  transform: scaleY(-1);
}

.artwork-sheet.polarity-inverted .mirror-thesis {
  opacity: 0.35;
}

.mirror-echoes {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed rgba(0, 0, 0, 0.18);
  font-size: 13.5px;
  opacity: 0.78;
}

/* 2. Counterfactual */
.cascade-antecedent {
  margin: 0;
  font-size: 16px;
}

.cascade-consequence {
  margin: 4px 0 0 0;
  font-size: 16.5px;
  font-weight: 600;
  color: var(--stage-accent);
}

/* 3. Pathetic Fallacy */
.emoting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.emoting-prose p {
  margin: 0 0 4px 0;
  font-size: 15.5px;
}

.emoting-sub {
  font-style: italic;
  opacity: 0.75;
}

.emoting-control {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 6px 10px;
  border: 1px solid var(--stage-ink);
  background: var(--stage-paper);
  color: var(--stage-ink);
  cursor: pointer;
  transition: transform 0.25s ease;
}

.emoting-btn:hover {
  transform: translateX(-6px) rotate(-1.5deg);
}

.widget-sulking {
  opacity: 0.65;
  transform: rotate(-0.8deg);
}

/* 4. Meta-Recursion */
.recursive-frame {
  border-left: 2px solid var(--stage-accent);
  padding: 6px 10px;
  margin-bottom: 6px;
  background: rgba(0, 0, 0, 0.03);
  transition: font-size 0.25s ease;
}

.rec-badge {
  font-weight: 700;
  color: var(--stage-accent);
  margin-right: 6px;
}

/* 5. Custodial Duty Roster */
.roster-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 12px;
}

.roster-item {
  padding: 6px 8px;
  border-bottom: 1px dashed rgba(0, 0, 0, 0.16);
  cursor: pointer;
}

.roster-item.active-shift {
  background: rgba(91, 110, 70, 0.18);
  font-weight: 700;
}

/* 6. Hallucinated Revelation */
.revelation-breadcrumbs {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed rgba(0, 0, 0, 0.2);
  font-family: var(--font-mono);
  font-size: 11px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.crumb-btn {
  background: rgba(158, 59, 36, 0.12);
  border: 1px solid var(--stage-accent);
  color: var(--stage-ink);
  padding: 2px 6px;
  cursor: pointer;
  font-size: 10.5px;
}

.citation-ul {
  list-style: none;
  margin: 8px 0 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.citation-link-btn {
  width: 100%;
  text-align: left;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(0, 0, 0, 0.2);
  padding: 8px 10px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  color: var(--stage-ink);
  font-family: var(--font-serif);
  font-size: 14px;
}

.citation-link-btn:hover {
  border-color: var(--stage-accent);
  background: rgba(158, 59, 36, 0.08);
}

.cit-marker {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--stage-accent);
}

.cit-action {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--stage-accent);
  white-space: nowrap;
}

/* 7. Pure Structure */
.prosody-scansion {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.22em;
  color: var(--stage-accent);
  margin-bottom: 3px;
}

.prosody-verse {
  margin: 0;
  font-size: 19px;
  letter-spacing: 0.03em;
}

/* 8. Overture Withheld */
.stillness-meter-wrap {
  margin: 14px 0;
  font-family: var(--font-mono);
  font-size: 11px;
}

.stillness-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.stillness-bar-track,
.catharsis-track {
  height: 10px;
  background: rgba(0, 0, 0, 0.12);
  border: 1px solid rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.stillness-bar-fill,
.catharsis-fill {
  height: 100%;
  background: var(--stage-accent);
  transition: width 0.2s linear;
}

.overture-revelation-box {
  padding: 18px;
  border: 1px dashed var(--stage-accent);
  text-align: center;
}

.overture-revelation-box.bloomed .withheld-placeholder {
  display: none;
}

.overture-final-line {
  margin: 0;
  font-size: 20px;
  font-style: italic;
  color: var(--stage-accent);
}

/* 9. Domestic Miniature */
.vignette-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.vignette-domestic,
.vignette-cosmic {
  padding: 10px;
  border: 1px solid rgba(0, 0, 0, 0.12);
}

.vignette-cosmic {
  background: #1a1917;
  color: #f4efe6;
}

.scale-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  opacity: 0.7;
  margin-bottom: 4px;
}

/* 10. Forensic Farce */
.forensic-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.exhibit-stamp {
  background: #e5c138;
  color: #111;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 11px;
  padding: 2px 8px;
  border: 1px solid #111;
}

.custody-chain {
  font-size: 10.5px;
  opacity: 0.72;
}

.redaction-bar {
  background: #141413;
  color: #141413;
  border: 1px solid #141413;
  padding: 3px 8px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 11.5px;
}

.redaction-bar.declassified {
  background: rgba(181, 137, 0, 0.18);
  color: var(--stage-ink);
  border-style: dashed;
}

/* 11. Gravity Fumble */
.gravity-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.gravity-actions {
  display: flex;
  gap: 6px;
}

.mini-stage-btn {
  background: var(--stage-paper);
  border: 1px solid var(--stage-ink);
  color: var(--stage-ink);
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 4px 8px;
  cursor: pointer;
}

.mini-stage-btn.primary-mini-btn {
  background: var(--stage-accent);
  border-color: var(--stage-accent);
  color: #fff;
}

.gravity-canvas-arena {
  position: relative;
  height: 340px;
  border: 1.5px solid var(--stage-ink);
  background: rgba(255, 255, 255, 0.45);
  overflow: hidden;
  user-select: none;
  touch-action: none;
}

.physics-word-chip {
  position: absolute;
  display: inline-block;
  padding: 4px 9px;
  background: var(--stage-paper);
  border: 1px solid var(--stage-ink);
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.25);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  cursor: grab;
  transition: top 0.45s cubic-bezier(0.32, 1.35, 0.56, 1), left 0.3s ease, transform 0.35s ease;
}

.physics-word-chip.dragging {
  cursor: grabbing;
  transition: none;
  z-index: 20;
  border-color: var(--stage-accent);
}

.mass-sub {
  font-size: 8.5px;
  color: var(--stage-accent);
  margin-left: 2px;
}

.gravity-floor-line {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--stage-ink);
  color: var(--stage-paper);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-align: center;
  padding: 3px 0;
}

/* 12. Dream Overload */
.dream-prose {
  margin: 0;
  font-size: 17.5px;
  line-height: 1.65;
}

.density-5 .dream-prose {
  letter-spacing: -0.02em;
  line-height: 1.35;
}

.waking-gap-box {
  background: #ffffff;
  color: #111111;
  border: 1px solid rgba(0, 0, 0, 0.15);
  padding: 28px 20px;
  margin: 8px 0;
  text-align: center;
}

.waking-ordinary-sentence {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.04em;
}

/* 13. Machine Dream */
.memory-hex-line {
  display: block;
  font-size: 12px;
  margin-bottom: 6px;
}

.memory-elegy-overlay {
  margin: 0;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 14.5px;
  opacity: 0.78;
}

.swept-memory {
  opacity: 0.25;
  filter: blur(0.6px);
}

/* 15. Machine Parliament */
.hansard-speaker {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--stage-accent);
  margin-bottom: 4px;
}

.bell-ringing {
  border: 2px solid var(--stage-accent);
  background: rgba(30, 86, 49, 0.12);
}

/* 16. Nanoscopic Reflux */
.scale-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.reflux-stream {
  font-size: 10.5px;
  color: var(--stage-accent);
}

.focal-scale-layer {
  border: 2px solid var(--stage-accent);
  background: rgba(30, 122, 104, 0.1);
  transform: scale(1.015);
}

/* 17. Vegetable Epic */
.illuminated-dropcap {
  float: left;
  font-size: 44px;
  line-height: 0.85;
  padding: 4px 10px 4px 4px;
  margin-right: 6px;
  color: var(--stage-accent);
  border: 1px solid var(--stage-accent);
  font-weight: 700;
}

.manuscript-verse {
  margin: 0;
  font-size: 17.5px;
  line-height: 1.65;
}

/* 18. Tragic Farce */
.tragic-mishap {
  margin: 8px 0 0 0;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--stage-accent);
}

/* 20. Concordat Signature Panel */
.interactive-ritual-panel {
  margin-top: 20px;
  padding: 16px;
  border: 1.5px solid var(--stage-ink);
  background: rgba(255, 255, 255, 0.45);
  font-family: var(--font-mono);
  position: relative;
}

.ritual-header {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--stage-accent);
}

.signature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: center;
}

.sig-label {
  font-size: 10px;
  margin-bottom: 6px;
  opacity: 0.75;
}

.machine-autogenerated-sig {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 20px;
  padding: 18px 12px;
  border-bottom: 1px solid var(--stage-ink);
}

#concordat-sig-canvas {
  display: block;
  width: 100%;
  max-width: 320px;
  height: 88px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px dashed var(--stage-ink);
  cursor: crosshair;
  touch-action: none;
}

.sig-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.wax-seal-stamp {
  display: none;
  position: absolute;
  right: 24px;
  top: -18px;
  border: 2.5px double var(--stage-accent);
  color: var(--stage-accent);
  background: var(--stage-paper);
  padding: 6px 12px;
  transform: rotate(-8deg);
  text-align: center;
  font-weight: 700;
  font-size: 11px;
}

.wax-seal-stamp.stamped {
  display: flex;
  flex-direction: column;
}

/* 21. Lethal Jest */
.jest-punchline-slot {
  width: 100%;
  margin-top: 8px;
  padding: 10px;
  background: transparent;
  border: 1.5px dashed var(--stage-accent);
  color: var(--stage-accent);
  font-family: var(--font-mono);
  font-size: 12px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
}

.jest-punchline-slot:hover {
  background: rgba(166, 38, 38, 0.1);
}

.jest-tombstone {
  margin-top: 6px;
  padding: 8px;
  background: #191716;
  color: #f4efea;
  font-family: var(--font-mono);
  font-size: 11.5px;
}

.sheet-colophon {
  margin-top: 28px;
  padding-top: 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.25);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  opacity: 0.7;
}

.transcript-pre {
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.65;
  padding: 16px;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.2);
}

/* Right Sidebar: Controls, Export & Gallery */
.inspector-sidebar {
  background: var(--ui-panel);
  border-left: 1px solid var(--ui-border);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-height: calc(100vh - 84px);
  overflow-y: auto;
}

.panel-section {
  border-bottom: 1px solid var(--ui-border);
  padding-bottom: 16px;
}

.panel-heading {
  margin: 0 0 10px 0;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ui-muted);
}

.seed-row {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}

.seed-input {
  flex: 1;
  background: #0d0d0c;
  border: 1px solid var(--ui-border);
  padding: 6px 8px;
  color: #fff;
}

.param-control {
  margin-bottom: 10px;
}

.param-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  margin-bottom: 3px;
}

.param-slider {
  width: 100%;
  accent-color: var(--ui-accent);
  cursor: pointer;
}

.export-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.gallery-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gallery-card {
  background: #141311;
  border: 1px solid var(--ui-border);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gallery-card-top {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 700;
  color: #f3efe6;
}

.gallery-excerpt {
  font-family: var(--font-serif);
  font-size: 12px;
  color: var(--ui-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.gallery-card-actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

.toast-banner {
  position: fixed;
  bottom: 18px;
  right: 18px;
  background: #111;
  color: #f6f3ec;
  border: 1px solid var(--ui-accent);
  padding: 9px 14px;
  font-size: 11.5px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.toast-banner.visible {
  opacity: 1;
}

/* Beta Additions: X-Ray Drawer, Triptych Polyptych Mode, Typewriter Cadence & Reproducibility Badge */
.repro-honesty-badge {
  padding: 2px 7px;
  border: 1px solid rgba(0, 0, 0, 0.25);
  background: rgba(255, 255, 255, 0.4);
  font-weight: 700;
}

.repro-honesty-badge.user-modulated {
  border-color: var(--stage-accent);
  background: var(--stage-accent);
  color: #fff;
}

.xray-anatomy-drawer {
  margin-top: 12px;
  padding: 10px 12px;
  background: #141311;
  color: #ebe7de;
  border: 1px solid var(--stage-accent);
  font-family: var(--font-mono);
  font-size: 11px;
}

.xray-title {
  color: #e39b4b;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

.xray-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 14px;
}

.xray-grid code {
  color: #8fd1b8;
}

.cadence-pending {
  opacity: 0;
  transform: translateY(4px);
}

.cadence-revealed {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.gc-surfaced-dreams {
  margin-top: 8px;
  font-size: 11.5px;
  color: var(--stage-accent);
}

.surfaced-dream-line {
  padding: 6px 8px;
  background: rgba(72, 90, 140, 0.12);
  border-left: 3px solid var(--stage-accent);
}

.triptych-comparison-grid {
  width: 100%;
  max-width: 1160px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.triptych-banner {
  background: #111;
  color: #f6f3ec;
  border: 1px solid var(--ui-accent);
  padding: 8px 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-align: center;
}

.triptych-columns-wrap {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.triptych-column {
  padding: 20px;
  border: 1px solid rgba(0, 0, 0, 0.25);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.triptych-title {
  margin: 4px 0;
  font-size: 20px;
}

.triptych-epigraph {
  margin: 0;
  font-style: italic;
  font-size: 12.5px;
  opacity: 0.78;
}

.triptych-svg {
  border: 1px solid rgba(0, 0, 0, 0.15);
  padding: 6px;
  background: rgba(255, 255, 255, 0.35);
}

.triptych-excerpt {
  white-space: pre-wrap;
  font-size: 12.5px;
  line-height: 1.5;
  flex: 1;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 4px;
}

.triptych-focus-btn {
  width: 100%;
  padding: 7px;
  font-weight: 700;
}

.shortcut-hint-box {
  font-size: 10.5px;
  color: var(--ui-muted);
  background: #141311;
  border: 1px solid var(--ui-border);
  padding: 8px 10px;
  line-height: 1.6;
}

.shortcut-hint-box kbd {
  background: #252320;
  border: 1px solid #45413a;
  padding: 1px 5px;
  font-size: 10px;
  color: #f6f3ec;
}

/* Release 1.0: Domestic Miniature Icons, Parallax Swap, Gilded Drop-Caps, Launch Essay Modal & Bottom-Center Copyright */
.vignette-dom-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.mini-domestic-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.vignette-split.parallax-swapped .vignette-domestic {
  order: 2;
  opacity: 0.72;
}

.vignette-split.parallax-swapped .vignette-cosmic {
  order: 1;
  border: 1.5px solid var(--stage-accent);
}

.illuminated-dropcap.gilded-dropcap {
  background: #d4af37;
  color: #191612;
  border-color: #8b6914;
}

.site-copyright-footer {
  width: 100%;
  text-align: center;
  padding: 8px 16px;
  background: #0d0d0c;
  border-top: 1px solid var(--ui-border);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--ui-muted);
}

.site-copyright-footer a {
  color: var(--ui-text);
  text-decoration: none;
  border-bottom: 1px dotted var(--ui-accent);
  transition: color 0.15s ease, border-color 0.15s ease;
}

.site-copyright-footer a:hover,
.site-copyright-footer a:focus-visible {
  color: var(--ui-accent);
  border-bottom-style: solid;
}

.essay-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 9, 0.78);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px;
  z-index: 200;
}

.essay-modal-backdrop[hidden] {
  display: none;
}

.essay-modal-dialog {
  max-width: 720px;
  width: 100%;
  max-height: 86vh;
  overflow-y: auto;
  background: #f6f3ec;
  color: #191816;
  border: 2px solid #191816;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.65);
  padding: 32px 38px;
  font-family: var(--font-serif);
}

.essay-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1.5px solid #191816;
  padding-bottom: 12px;
  margin-bottom: 18px;
}

.essay-modal-header h2 {
  margin: 0;
  font-size: 24px;
}

.essay-modal-body p {
  font-size: 15.5px;
  line-height: 1.68;
  margin: 0 0 14px 0;
}

.essay-modal-body h3 {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #8b261d;
  margin: 20px 0 8px 0;
}

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

body.reduced-motion *,
body.reduced-motion *::before,
body.reduced-motion *::after {
  animation-duration: 0.01ms !important;
  transition-duration: 0.01ms !important;
}

@media (max-width: 1100px) {
  .workspace-grid {
    grid-template-columns: 240px 1fr;
  }
  .inspector-sidebar {
    grid-column: 1 / -1;
    max-height: none;
    border-left: none;
    border-top: 1px solid var(--ui-border);
  }
}

@media (max-width: 760px) {
  .workspace-grid {
    grid-template-columns: 1fr;
  }
  .registry-sidebar,
  .stage-column {
    max-height: none;
  }
  .vignette-split,
  .signature-grid {
    grid-template-columns: 1fr;
  }
  .artwork-sheet {
    padding: 22px 18px;
  }
}
