:root {
  --paper: #f2efe7;
  --paper-deep: #e5dfd2;
  --white: #fffef9;
  --ink: #171713;
  --muted: #69665e;
  --rule: #bdb6a7;
  --orange: #d4512f;
  --orange-dark: #9f351d;
  --blue: #2149b6;
  --stage: #24231f;
  --stage-deep: #171713;
  --focus: #126bd6;
  --topbar-height: 76px;
  --deck-height: 94px;
  color-scheme: light;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial,
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
output,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

button:not(:disabled) {
  cursor: pointer;
}

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

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 500;
  padding: 10px 14px;
  border: 2px solid var(--ink);
  background: var(--white);
  color: var(--ink);
  font-weight: 800;
  transform: translateY(-160%);
}

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

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

.app-shell {
  width: 100%;
  height: 100%;
}

.topbar {
  position: relative;
  z-index: 100;
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(250px, 1fr) auto;
  align-items: center;
  gap: 24px;
  height: var(--topbar-height);
  padding: 0 18px;
  border-bottom: 1px solid var(--ink);
  background: rgba(242, 239, 231, 0.97);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 44px;
  min-height: 44px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--white);
  font: 850 13px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: -0.03em;
}

.brand-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.brand-copy strong {
  overflow: hidden;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-copy small,
.location-kicker,
.stage-eyebrow,
.detail-kicker,
.source-stack article > span,
.info-dialog header span {
  font: 750 9.5px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

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

.brand-copy small b {
  color: var(--orange-dark);
}

.location-block {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.location-kicker {
  color: var(--muted);
}

.breadcrumb {
  display: flex;
  align-items: center;
  min-width: 0;
  overflow: hidden;
}

.breadcrumb button,
.breadcrumb span {
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 12px;
  font-weight: 760;
  white-space: nowrap;
}

.breadcrumb button:hover {
  color: var(--orange-dark);
}

.breadcrumb .crumb-separator {
  margin: 0 8px;
  color: #9b968a;
  font-weight: 400;
}

.breadcrumb .crumb-current {
  overflow: hidden;
  color: var(--orange-dark);
  text-overflow: ellipsis;
}

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

.language-switch {
  display: flex;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--white);
  padding: 3px;
}

.language-switch button {
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-size: 11px;
  font-weight: 780;
}

.language-switch button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--white);
}

.square-button,
.annotation-button,
.source-button {
  min-height: 44px;
  border: 1px solid var(--ink);
  background: transparent;
}

.square-button {
  width: 44px;
  font-size: 18px;
  font-weight: 800;
}

.annotation-button {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 86px;
  padding: 0 9px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.annotation-button-icon {
  font-size: 15px;
}

.annotation-button b {
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  margin-left: auto;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--white);
  font: 800 8px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.annotation-button[aria-pressed="true"] {
  border-color: var(--orange-dark);
  background: var(--orange);
  color: var(--white);
  box-shadow: 3px 3px 0 var(--ink);
}

.annotation-button[aria-pressed="true"] b {
  background: var(--white);
  color: var(--ink);
}

.source-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 13px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.square-button:hover,
.annotation-button:hover,
.source-button:hover {
  background: var(--ink);
  color: var(--white);
}

.source-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--orange);
}

.workspace {
  height: calc(100% - var(--topbar-height));
}

.stage-shell {
  display: grid;
  grid-template-rows: 57px minmax(0, 1fr) var(--deck-height);
  height: 100%;
  min-height: 0;
}

.stage-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 8px 20px 7px;
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
  min-width: 0;
}

.stage-heading > div:first-child {
  display: flex;
  align-items: baseline;
  gap: 14px;
  min-width: 0;
}

.stage-eyebrow {
  color: var(--orange-dark);
  white-space: nowrap;
}

.stage-heading h1 {
  overflow: hidden;
  margin: 0;
  font-family: Georgia, "Songti SC", "SimSun", serif;
  font-size: clamp(18px, 2vw, 27px);
  font-weight: 500;
  letter-spacing: -0.025em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.stage-meta span {
  padding: 5px 9px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: var(--muted);
  font: 720 9px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stage-meta span:first-child {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--white);
}

.viewport {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-color: #777166 var(--stage-deep);
  scrollbar-width: thin;
  background:
    radial-gradient(circle at 40% 10%, rgba(255, 255, 255, 0.08), transparent 35%),
    linear-gradient(135deg, var(--stage), var(--stage-deep));
  touch-action: none;
  cursor: grab;
}

.viewport.is-dragging {
  cursor: grabbing;
  user-select: none;
}

.viewport::-webkit-scrollbar {
  height: 11px;
}

.viewport::-webkit-scrollbar-track {
  background: var(--stage-deep);
}

.viewport::-webkit-scrollbar-thumb {
  border: 3px solid var(--stage-deep);
  border-radius: 999px;
  background: #777166;
}

.surface-mount {
  min-width: 100%;
  min-height: 100%;
}

.loading-state {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-content: center;
  gap: 13px;
  color: var(--white);
  text-align: center;
}

.loading-state[hidden] {
  display: none;
}

.loading-state strong {
  font-size: 12px;
  letter-spacing: 0.08em;
}

.loading-rule {
  width: 130px;
  height: 2px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.18);
}

.loading-rule::after {
  content: "";
  display: block;
  width: 45%;
  height: 100%;
  background: var(--orange);
  animation: loading-slide 1.1s ease-in-out infinite alternate;
}

@keyframes loading-slide {
  from { transform: translateX(0); }
  to { transform: translateX(125%); }
}

.pan-surface {
  position: relative;
  display: grid;
  align-items: center;
  justify-items: center;
  min-width: 100%;
  min-height: 100%;
  padding: 30px 38px 34px;
}

.overview-canvas,
.scene-canvas {
  position: relative;
  isolation: isolate;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.32);
  background: var(--white);
  box-shadow: 0 24px 54px rgba(0, 0, 0, 0.32);
}

.overview-canvas {
  width: 100%;
  aspect-ratio: 15000 / 2518;
}

.overview-image,
.context-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.overview-image {
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
}

.overview-canvas.image-missing .overview-image,
.context-preview.image-missing img {
  display: none;
}

.image-fallback {
  position: absolute;
  inset: 0;
  z-index: -3;
  display: grid;
  place-content: center;
  background:
    linear-gradient(90deg, transparent calc(16.666% - 1px), var(--rule) 16.666%, transparent calc(16.666% + 1px)),
    repeating-linear-gradient(-45deg, #f6f3eb 0 12px, #ebe5d9 12px 13px);
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.scene-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-width: 44px;
  padding: 0 8px 15px;
  border: 0;
  border-left: 1px dashed rgba(23, 23, 19, 0.52);
  border-right: 1px dashed rgba(23, 23, 19, 0.52);
  background: linear-gradient(to bottom, transparent 60%, color-mix(in srgb, var(--scene-color) 19%, transparent));
  color: var(--ink);
  text-align: left;
  transition: background 180ms ease;
}

.scene-zone:hover,
.scene-zone:focus-visible {
  z-index: 4;
  background: color-mix(in srgb, var(--scene-color) 20%, rgba(255, 255, 255, 0.2));
}

.zone-label {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: min(100%, 270px);
  min-height: 58px;
  padding: 7px 9px 7px 7px;
  border: 1px solid var(--ink);
  background: rgba(255, 254, 249, 0.93);
  box-shadow: 4px 4px 0 color-mix(in srgb, var(--scene-color) 72%, var(--ink));
  backdrop-filter: blur(6px);
}

.zone-label > b {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  background: var(--scene-color);
  color: #fff;
  font: 820 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.zone-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.zone-copy strong {
  overflow: hidden;
  font-size: 11px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.zone-copy small {
  color: var(--muted);
  font: 700 8.5px/1.1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.04em;
}

.zone-arrow {
  font-size: 18px;
}

.asset-badge {
  position: absolute;
  top: 10px;
  left: 12px;
  z-index: 8;
  padding: 6px 9px;
  border: 1px solid var(--ink);
  background: rgba(255, 254, 249, 0.92);
  color: var(--ink);
  font: 760 8.5px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.scene-canvas {
  width: 100%;
  aspect-ratio: 3 / 2;
  background:
    linear-gradient(rgba(255, 254, 249, 0.82), rgba(255, 254, 249, 0.82)),
    repeating-linear-gradient(0deg, transparent 0 39px, rgba(23, 23, 19, 0.08) 39px 40px),
    repeating-linear-gradient(90deg, transparent 0 39px, rgba(23, 23, 19, 0.08) 39px 40px),
    var(--paper);
}

.scene-canvas::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(140deg, color-mix(in srgb, var(--scene-color) 9%, transparent), transparent 38%);
}

.scene-empty-label {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  padding: 100px 22%;
  color: var(--muted);
  text-align: center;
  pointer-events: none;
}

.scene-empty-label .empty-frame {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 1px solid var(--rule);
  border-radius: 50%;
  font-family: Georgia, serif;
  font-size: 29px;
  color: var(--scene-color);
}

.scene-empty-label strong {
  font-family: Georgia, "Songti SC", "SimSun", serif;
  font-size: clamp(18px, 2.1vw, 29px);
  font-weight: 500;
}

.scene-empty-label p {
  max-width: 34em;
  margin: 0;
  font-size: 12px;
  line-height: 1.65;
}

.context-preview {
  position: absolute;
  top: 18px;
  left: 18px;
  z-index: 5;
  width: clamp(150px, 17%, 240px);
  aspect-ratio: 16 / 7;
  overflow: hidden;
  border: 1px solid var(--ink);
  background: var(--paper-deep);
  box-shadow: 4px 4px 0 var(--ink);
}

.context-preview img {
  filter: grayscale(1) contrast(0.92);
}

.context-preview span {
  position: absolute;
  right: 4px;
  bottom: 4px;
  padding: 4px 6px;
  background: var(--ink);
  color: var(--white);
  font: 720 7.5px/1.1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.context-preview.image-missing::before {
  content: "L1 CONTEXT MISSING";
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  color: var(--muted);
  font: 700 8px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.hotspot-layer {
  position: absolute;
  inset: 0;
  z-index: 7;
}

.proverb-hotspot {
  position: absolute;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin: -26px 0 0 -26px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--scene-color) 34%, transparent), 3px 3px 0 var(--ink);
  color: var(--ink);
  font: 850 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.proverb-hotspot::after {
  content: attr(data-label);
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  width: max-content;
  max-width: 190px;
  padding: 6px 8px;
  border: 1px solid var(--ink);
  background: rgba(255, 254, 249, 0.95);
  color: var(--ink);
  font: 740 9.5px/1.3 ui-sans-serif, sans-serif;
  text-align: center;
  transform: translateX(-50%);
}

.proverb-hotspot:hover,
.proverb-hotspot:focus-visible,
.proverb-hotspot[aria-current="true"] {
  z-index: 10;
  transform: scale(1.12);
  box-shadow: 0 0 0 9px color-mix(in srgb, var(--scene-color) 42%, transparent), 3px 3px 0 var(--ink);
}

.proverb-hotspot.is-pending {
  border-style: dashed;
  color: var(--muted);
  box-shadow: 0 0 0 5px rgba(23, 23, 19, 0.08);
}

body[data-hotspots="subtle"] .proverb-hotspot {
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--scene-color) 28%, transparent);
}

body[data-hotspots="subtle"] .proverb-hotspot::after {
  opacity: 0;
  transform: translate(-50%, -4px);
}

body[data-hotspots="subtle"] .proverb-hotspot:hover::after,
body[data-hotspots="subtle"] .proverb-hotspot:focus-visible::after {
  opacity: 1;
  transform: translateX(-50%);
}

body[data-hotspots="explore"] .proverb-hotspot {
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  border-color: color-mix(in srgb, var(--ink) 55%, transparent);
  background: rgba(255, 254, 249, 0.65);
  box-shadow: none;
  color: transparent;
  opacity: 0.48;
}

body[data-hotspots="explore"] .proverb-hotspot::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--scene-color);
}

body[data-hotspots="explore"] .proverb-hotspot::after {
  opacity: 0;
}

body[data-hotspots="explore"] .proverb-hotspot:hover,
body[data-hotspots="explore"] .proverb-hotspot:focus-visible {
  color: var(--ink);
  opacity: 1;
}

body[data-hotspots="explore"] .proverb-hotspot:hover::before,
body[data-hotspots="explore"] .proverb-hotspot:focus-visible::before {
  display: none;
}

body[data-hotspots="explore"] .proverb-hotspot:hover::after,
body[data-hotspots="explore"] .proverb-hotspot:focus-visible::after {
  opacity: 1;
}

.scene-id-flag {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  border: 1px solid var(--ink);
  background: rgba(255, 254, 249, 0.91);
  font: 750 9px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.06em;
}

.scene-id-flag::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--scene-color);
}

.drag-hint {
  position: sticky;
  left: 50%;
  bottom: 17px;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: max-content;
  margin: -51px auto 17px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  background: rgba(23, 23, 19, 0.82);
  color: var(--white);
  backdrop-filter: blur(8px);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  pointer-events: none;
}

.onboarding {
  position: sticky;
  left: 24px;
  bottom: 24px;
  z-index: 30;
  width: min(390px, calc(100vw - 48px));
  margin-top: calc(-1 * min(430px, 65vh));
  margin-bottom: 24px;
  padding: 22px;
  border: 1px solid var(--ink);
  background: rgba(255, 254, 249, 0.96);
  box-shadow: 9px 9px 0 var(--orange);
  backdrop-filter: blur(14px);
  transition: opacity 200ms ease, transform 200ms ease;
}

.onboarding[hidden] {
  display: none;
}

.onboarding-close {
  position: absolute;
  top: 9px;
  right: 9px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  font-size: 22px;
}

.onboarding-index {
  color: var(--orange-dark);
  font: 780 9px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.14em;
}

.onboarding h2 {
  margin: 13px 36px 9px 0;
  font-family: Georgia, "Songti SC", "SimSun", serif;
  font-size: 29px;
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.03em;
}

.onboarding > p {
  margin: 0;
  color: #45433d;
  font-size: 13px;
  line-height: 1.65;
}

.onboarding ol {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin: 18px 0;
  padding: 0;
  border: 1px solid var(--rule);
  background: var(--rule);
  list-style: none;
}

.onboarding li {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 9px;
  background: var(--white);
}

.onboarding li b {
  font-size: 10px;
}

.onboarding li span {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.35;
}

.onboarding > small {
  display: block;
  margin-top: 11px;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.45;
}

.dialog-replay {
  display: flex;
  justify-content: flex-end;
  padding: 0 18px 18px;
}

body.onboarding-open[data-annotation-mode="on"] .annotation-panel {
  z-index: 1120;
}

body.onboarding-open[data-annotation-mode="on"] .annotation-overlay {
  z-index: 1160;
}

.primary-button {
  min-height: 44px;
  padding: 0 17px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--white);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.primary-button:hover {
  border-color: var(--orange-dark);
  background: var(--orange-dark);
}

.control-deck {
  position: relative;
  z-index: 60;
  display: grid;
  grid-template-columns: minmax(210px, 0.8fr) minmax(320px, 1.5fr) minmax(340px, 1fr);
  align-items: center;
  gap: 22px;
  min-height: var(--deck-height);
  padding: 12px 18px;
  border-top: 1px solid var(--ink);
  background: var(--paper);
  min-width: 0;
}

.view-actions,
.display-controls {
  display: flex;
  align-items: center;
  gap: 7px;
}

.back-button,
.overview-button,
.mode-button,
.zoom-control button {
  min-height: 44px;
  border: 1px solid var(--ink);
  background: var(--white);
  font-size: 10px;
  font-weight: 780;
}

.back-button,
.overview-button {
  padding: 0 12px;
}

.back-button {
  display: flex;
  align-items: center;
  gap: 8px;
}

.back-button:not(:disabled):hover,
.overview-button:not(:disabled):hover,
.mode-button:hover,
.zoom-control button:hover {
  background: var(--ink);
  color: var(--white);
}

.back-button:disabled,
.overview-button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.minimap-wrap {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.minimap-label {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font: 700 8.5px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.minimap-label b {
  color: var(--ink);
}

.minimap {
  position: relative;
  display: flex;
  height: 46px;
  overflow: hidden;
  border: 1px solid var(--ink);
  background: var(--white);
}

.minimap-segment {
  position: relative;
  z-index: 2;
  min-width: 44px;
  height: 100%;
  padding: 0;
  border: 0;
  border-left: 1px solid rgba(23, 23, 19, 0.22);
  background: color-mix(in srgb, var(--scene-color) 14%, var(--white));
  font: 800 8.5px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.minimap-segment:first-of-type {
  border-left: 0;
}

.minimap-segment:hover,
.minimap-segment[aria-current="true"] {
  background: var(--scene-color);
  color: #fff;
}

.minimap-viewport {
  position: absolute;
  top: 2px;
  bottom: 2px;
  left: 0;
  z-index: 4;
  border: 2px solid var(--ink);
  background: rgba(255, 255, 255, 0.18);
  pointer-events: none;
  transition: left 100ms linear, width 100ms linear;
}

.display-controls {
  justify-content: flex-end;
}

.mode-button {
  display: grid;
  gap: 3px;
  min-width: 76px;
  padding: 5px 10px;
  text-align: left;
}

.mode-button span {
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.mode-button:hover span {
  color: #c5c1b6;
}

.mode-button b {
  font-size: 10px;
}

.zoom-control {
  display: grid;
  grid-template-columns: 44px 58px 44px;
  height: 46px;
  border: 1px solid var(--ink);
  background: var(--white);
}

.zoom-control button {
  min-height: 44px;
  border: 0;
  font-size: 18px;
}

.zoom-control output {
  display: grid;
  place-items: center;
  border-right: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
  font: 750 9px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.detail-scrim {
  position: fixed;
  inset: var(--topbar-height) 0 var(--deck-height) 0;
  z-index: 70;
  display: block;
  border: 0;
  background: rgba(23, 23, 19, 0.42);
  opacity: 0;
  pointer-events: none;
  transition: opacity 260ms ease;
}

.detail-scrim[hidden] {
  display: none;
}

.detail-panel {
  position: fixed;
  top: var(--topbar-height);
  right: 0;
  bottom: var(--deck-height);
  z-index: 80;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(590px, 48vw);
  border-left: 1px solid var(--ink);
  background: var(--white);
  box-shadow: -22px 0 50px rgba(0, 0, 0, 0.18);
  transform: translateX(105%);
  transition: transform 300ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

body.detail-open .detail-panel {
  transform: translateX(0);
}

body.detail-open .detail-scrim {
  opacity: 1;
  pointer-events: auto;
}

.detail-rail {
  grid-row: 1 / -1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 20px;
  border-right: 1px solid var(--ink);
  background: var(--ink);
  color: var(--white);
}

.detail-rail span {
  writing-mode: vertical-rl;
  font: 780 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.2em;
}

.detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 15px 17px;
  border-bottom: 1px solid var(--ink);
}

.detail-header > div {
  min-width: 0;
}

.detail-kicker {
  color: var(--orange-dark);
}

.detail-header h2 {
  overflow: hidden;
  margin: 5px 0 0;
  font-family: Georgia, "Songti SC", "SimSun", serif;
  font-size: 21px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-close {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border: 1px solid var(--ink);
  background: var(--white);
  font-size: 22px;
}

.detail-close:hover {
  background: var(--ink);
  color: var(--white);
}

.detail-body {
  min-height: 0;
  overflow-y: auto;
  padding: 17px;
  scrollbar-color: var(--rule) transparent;
  scrollbar-width: thin;
}

.detail-media {
  position: relative;
  display: grid;
  place-content: center;
  min-height: 230px;
  margin-bottom: 19px;
  overflow: hidden;
  border: 1px dashed #7f7a6f;
  background:
    repeating-linear-gradient(-45deg, transparent 0 16px, rgba(23, 23, 19, 0.045) 16px 17px),
    var(--paper);
  color: var(--muted);
  text-align: center;
}

.detail-media::before,
.detail-media::after {
  content: "";
  position: absolute;
  background: rgba(23, 23, 19, 0.16);
}

.detail-media::before {
  top: 50%;
  left: 0;
  width: 100%;
  height: 1px;
}

.detail-media::after {
  top: 0;
  left: 50%;
  width: 1px;
  height: 100%;
}

.detail-media > div {
  position: relative;
  z-index: 2;
  max-width: 280px;
  padding: 14px;
  background: rgba(242, 239, 231, 0.9);
}

.detail-media strong {
  display: block;
  margin-bottom: 5px;
  color: var(--ink);
  font-family: Georgia, "Songti SC", "SimSun", serif;
  font-size: 19px;
  font-weight: 500;
}

.detail-media span {
  font-size: 10px;
  line-height: 1.45;
}

.detail-quote {
  margin-bottom: 18px;
  padding-bottom: 17px;
  border-bottom: 1px solid var(--ink);
}

.content-role {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 9px;
  color: var(--orange-dark);
  font: 780 8.5px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.content-role::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.detail-quote blockquote {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(23px, 2.4vw, 35px);
  font-weight: 500;
  line-height: 1.18;
  letter-spacing: -0.025em;
}

.detail-quote .source-english {
  margin: 10px 0 0;
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 13px;
  line-height: 1.45;
}

.detail-section {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
}

.detail-section:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.detail-section h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 7px;
  font: 790 9px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.detail-section h3 span {
  color: var(--muted);
  font-size: 8px;
  font-weight: 650;
}

.detail-section p {
  margin: 0;
  color: #3f3d37;
  font-size: 12.5px;
  line-height: 1.7;
}

.citation-card,
.near-equivalent,
.pending-card {
  padding: 12px;
  border: 1px solid var(--rule);
  background: #f8f5ee;
}

.citation-card dl {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 6px 12px;
  margin: 0;
}

.citation-card dt {
  color: var(--muted);
  font: 700 8px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.citation-card dd {
  margin: 0;
  font-size: 11px;
  line-height: 1.45;
}

.citation-card .verified {
  color: #22653c;
  font-weight: 800;
}

.near-equivalent-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.near-equivalent {
  min-height: 105px;
  border-style: dashed;
}

.near-equivalent b {
  display: block;
  margin-bottom: 6px;
  font: 770 9px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.near-equivalent p,
.pending-card p {
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.55;
}

.unreviewed-badge {
  display: inline-flex;
  margin-top: 9px;
  padding: 4px 6px;
  border: 1px solid var(--orange-dark);
  color: var(--orange-dark);
  font: 760 7.5px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.detail-footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 7px;
  padding: 12px 14px;
  border-top: 1px solid var(--ink);
  background: var(--paper);
}

.detail-footer > button {
  min-height: 44px;
  border: 1px solid var(--ink);
  background: var(--white);
  font-size: 9.5px;
  font-weight: 780;
}

.detail-footer > button:first-child,
.detail-footer > button:last-child {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
}

.detail-footer > button:last-child {
  justify-content: flex-end;
}

.detail-footer > button:hover:not(:disabled) {
  background: var(--ink);
  color: var(--white);
}

.detail-footer > button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.detail-footer .primary-button {
  background: var(--ink);
  color: var(--white);
}

.info-dialog {
  width: min(820px, calc(100vw - 32px));
  max-height: min(720px, calc(100vh - 32px));
  padding: 0;
  overflow: auto;
  border: 1px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 18px 18px 0 rgba(23, 23, 19, 0.38);
}

.info-dialog::backdrop {
  background: rgba(23, 23, 19, 0.68);
  backdrop-filter: blur(3px);
}

.info-dialog header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 17px 18px;
  border-bottom: 1px solid var(--ink);
  background: var(--paper);
}

.info-dialog header span {
  color: var(--orange-dark);
}

.info-dialog header h2 {
  margin: 5px 0 0;
  font-family: Georgia, "Songti SC", "SimSun", serif;
  font-size: 25px;
  font-weight: 500;
}

.info-dialog header button {
  width: 44px;
  height: 44px;
  border: 1px solid var(--ink);
  background: var(--white);
  font-size: 22px;
}

.dialog-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  padding: 1px;
  background: var(--ink);
}

.dialog-grid section {
  min-height: 170px;
  padding: 18px;
  background: var(--white);
}

.dialog-grid section > b {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--orange);
  color: var(--white);
  font: 800 9px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.dialog-grid h3 {
  margin: 24px 0 7px;
  font-size: 14px;
}

.dialog-grid p,
.dialog-note p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.dialog-note {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 18px;
  padding: 18px;
  border-top: 1px solid var(--ink);
  background: var(--paper-deep);
}

.dialog-note strong {
  font-size: 11px;
  text-transform: uppercase;
}

.dialog-note.warning {
  border-top: 3px solid var(--orange);
}

.source-stack {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  padding: 1px;
  background: var(--ink);
}

.source-stack article {
  min-height: 170px;
  padding: 18px;
  background: var(--white);
}

.source-stack article > span {
  color: var(--orange-dark);
}

.source-stack h3 {
  overflow-wrap: anywhere;
  margin: 22px 0 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.25;
}

.source-stack p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
}

/* V002 annotation review layer */

[data-annotation-ui][hidden],
.annotation-hover-box[hidden],
.annotation-hover-label[hidden] {
  display: none !important;
}

body[data-annotation-mode="on"] .topbar,
body[data-annotation-mode="on"] .workspace,
body[data-annotation-mode="on"] .detail-panel {
  cursor: crosshair;
}

body[data-annotation-mode="on"] [data-annotation-ui],
body[data-annotation-mode="on"] [data-annotation-ui] * {
  cursor: default;
}

body[data-annotation-mode="on"] [data-annotation-ui] button,
body[data-annotation-mode="on"] [data-annotation-ui] a,
body[data-annotation-mode="on"] [data-annotation-ui] label {
  cursor: pointer;
}

.annotation-overlay {
  position: fixed;
  inset: 0;
  z-index: 170;
  pointer-events: none;
}

.annotation-hover-box {
  position: fixed;
  top: 0;
  left: 0;
  border: 2px solid var(--blue);
  background: rgba(33, 73, 182, 0.09);
  box-shadow: 0 0 0 3px rgba(255, 254, 249, 0.88), 0 0 0 4px var(--blue);
  transform-origin: top left;
}

.annotation-hover-box.is-blank {
  width: 22px !important;
  height: 22px !important;
  border-style: dashed;
  border-radius: 50%;
  background: rgba(212, 81, 47, 0.18);
  box-shadow: 0 0 0 2px rgba(255, 254, 249, 0.92), 0 0 0 3px var(--orange-dark);
}

.annotation-hover-box.is-blank::before,
.annotation-hover-box.is-blank::after {
  content: "";
  position: absolute;
  background: var(--orange-dark);
}

.annotation-hover-box.is-blank::before {
  top: 9px;
  left: -6px;
  width: 30px;
  height: 1px;
}

.annotation-hover-box.is-blank::after {
  top: -6px;
  left: 9px;
  width: 1px;
  height: 30px;
}

.annotation-hover-label {
  position: fixed;
  max-width: min(360px, calc(100vw - 24px));
  padding: 7px 9px;
  border: 1px solid var(--ink);
  background: var(--blue);
  box-shadow: 3px 3px 0 var(--ink);
  color: var(--white);
  font: 750 10px/1.35 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.02em;
}

.annotation-hover-label.is-blank {
  background: var(--orange-dark);
}

.annotation-pins {
  position: fixed;
  inset: 0;
}

.annotation-pin {
  position: fixed;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 2px solid var(--white);
  border-radius: 50% 50% 50% 4px;
  background: var(--blue);
  box-shadow: 2px 2px 0 var(--ink);
  color: var(--white);
  font: 850 8px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  pointer-events: auto;
  transform: translate(-50%, -100%) rotate(-45deg);
}

.annotation-pin > span {
  transform: rotate(45deg);
}

.annotation-pin[data-kind="blank"] {
  background: var(--orange-dark);
}

.annotation-pin:hover,
.annotation-pin:focus-visible {
  z-index: 3;
  transform: translate(-50%, -100%) rotate(-45deg) scale(1.16);
}

.annotation-panel {
  position: fixed;
  top: calc(var(--topbar-height) + 12px);
  right: 12px;
  bottom: calc(var(--deck-height) + 12px);
  z-index: 220;
  display: grid;
  grid-template-rows: auto auto auto auto minmax(0, 1fr) auto;
  width: min(354px, calc(100vw - 24px));
  overflow: hidden;
  border: 1px solid var(--ink);
  background: rgba(255, 254, 249, 0.98);
  box-shadow: 10px 10px 0 rgba(23, 23, 19, 0.45);
  backdrop-filter: blur(14px);
}

body.detail-open .annotation-panel {
  right: auto;
  left: 12px;
}

.annotation-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--ink);
  background: var(--paper);
}

.annotation-panel-header span,
.annotation-target-card > span {
  color: var(--orange-dark);
  font: 760 8px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.annotation-panel-header h2 {
  margin: 4px 0 0;
  font-family: Georgia, "Songti SC", "SimSun", serif;
  font-size: 19px;
  font-weight: 500;
}

.annotation-panel-header button {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border: 1px solid var(--ink);
  background: var(--white);
  font-size: 19px;
}

.annotation-panel-intro {
  padding: 11px 13px;
  border-bottom: 1px solid var(--rule);
}

.annotation-panel-intro > p,
.annotation-empty p {
  margin: 0;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.55;
}

.annotation-warning {
  margin-top: 9px;
  padding: 8px 9px;
  border-left: 3px solid var(--orange);
  background: #fff0e8;
  color: var(--orange-dark);
  font-size: 9.5px;
  line-height: 1.45;
}

.annotation-actions {
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr;
  gap: 1px;
  padding: 1px;
  border-bottom: 1px solid var(--ink);
  background: var(--ink);
}

.annotation-actions button,
.annotation-actions a {
  display: grid;
  place-content: center;
  gap: 3px;
  min-height: 52px;
  padding: 6px;
  border: 0;
  background: var(--white);
  font-size: 8.5px;
  font-weight: 780;
  text-align: center;
  color: inherit;
  text-decoration: none;
}

.annotation-actions button span:first-child,
.annotation-actions a span:first-child {
  font-size: 15px;
}

.annotation-actions button:hover,
.annotation-actions a:hover {
  background: var(--ink);
  color: var(--white);
}

.annotation-actions #annotationSubmit {
  background: var(--blue);
  color: var(--white);
}

.annotation-actions #annotationSubmit:hover,
.annotation-actions #annotationSubmit:focus-visible {
  background: var(--ink);
}

.annotation-export-state {
  min-height: 28px;
  padding: 8px 13px 6px;
  color: var(--muted);
  font: 720 8px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.annotation-export-state.is-dirty {
  color: var(--orange-dark);
}

.annotation-export-state::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: currentColor;
}

.annotation-list {
  min-height: 0;
  margin: 0;
  padding: 0 10px 12px;
  overflow-y: auto;
  list-style: none;
  scrollbar-color: var(--rule) transparent;
  scrollbar-width: thin;
}

.annotation-list li + li {
  margin-top: 7px;
}

.annotation-list-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 9px;
  width: 100%;
  padding: 9px;
  border: 1px solid var(--rule);
  background: var(--white);
  text-align: left;
}

.annotation-list-item:hover,
.annotation-list-item:focus-visible {
  border-color: var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
}

.annotation-list-index {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--blue);
  color: var(--white);
  font: 820 8px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.annotation-list-item[data-kind="blank"] .annotation-list-index {
  background: var(--orange-dark);
}

.annotation-list-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.annotation-list-copy strong,
.annotation-list-copy small,
.annotation-list-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.annotation-list-copy strong {
  font-size: 10.5px;
}

.annotation-list-copy span {
  color: #45423c;
  font-size: 10px;
}

.annotation-list-copy small {
  color: var(--muted);
  font: 680 7.5px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.annotation-empty {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 7px;
  min-height: 150px;
  padding: 22px;
  color: var(--muted);
  text-align: center;
}

.annotation-empty[hidden] {
  display: none;
}

.annotation-empty > span {
  display: grid;
  place-items: center;
  width: 45px;
  height: 45px;
  border: 1px dashed var(--rule);
  border-radius: 50%;
  color: var(--orange-dark);
  font-size: 18px;
}

.annotation-empty strong {
  color: var(--ink);
  font-size: 11px;
}

.annotation-dialog {
  width: min(590px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  padding: 0;
  overflow: auto;
  border: 1px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 14px 14px 0 rgba(23, 23, 19, 0.46);
}

.annotation-dialog::backdrop {
  background: rgba(23, 23, 19, 0.7);
  backdrop-filter: blur(3px);
}

.annotation-dialog form {
  margin: 0;
}

.annotation-dialog header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 15px 16px;
  border-bottom: 1px solid var(--ink);
}

.annotation-dialog header span {
  color: var(--orange-dark);
  font: 760 8px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.12em;
}

.annotation-dialog header h2 {
  margin: 4px 0 0;
  font-family: Georgia, "Songti SC", "SimSun", serif;
  font-size: 22px;
  font-weight: 500;
}

.annotation-dialog header button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--ink);
  background: var(--white);
  font-size: 21px;
}

.annotation-editor-body {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.annotation-target-card {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--ink);
  background: var(--white);
  box-shadow: 4px 4px 0 var(--blue);
}

.annotation-target-card strong {
  font-family: Georgia, "Songti SC", "SimSun", serif;
  font-size: 18px;
  font-weight: 500;
}

.annotation-target-card small {
  color: var(--muted);
  font: 680 8px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.annotation-editor-body > label {
  margin-top: 7px;
  font-size: 10px;
  font-weight: 800;
}

.annotation-editor-body textarea {
  width: 100%;
  min-height: 154px;
  resize: vertical;
  padding: 12px;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--white);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.6;
}

.annotation-submit-body > p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.annotation-submit-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px;
  border: 1px solid var(--ink);
  background: var(--white);
  box-shadow: 4px 4px 0 var(--blue);
}

.annotation-submit-summary span {
  color: var(--muted);
  font: 700 8px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.annotation-submit-summary strong {
  font-family: Georgia, "Songti SC", "SimSun", serif;
  font-size: 17px;
  font-weight: 500;
  white-space: nowrap;
}

.annotation-submit-body > label {
  margin-top: 8px;
  font-size: 10px;
  font-weight: 800;
}

.annotation-submit-body > input[type="email"] {
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--white);
  color: var(--ink);
  font: 12px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.annotation-submit-body > input[type="email"]:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--blue) 55%, transparent);
  outline-offset: 2px;
}

.annotation-submit-status {
  min-height: 34px;
  padding: 9px 10px;
  border-left: 3px solid transparent;
  background: transparent;
}

.annotation-submit-status:empty {
  min-height: 0;
  padding: 0;
}

.annotation-submit-status[data-state="pending"],
.annotation-submit-status[data-state="warning"] {
  border-left-color: var(--orange);
  background: #fff0e8;
  color: var(--orange-dark);
}

.annotation-submit-status[data-state="success"] {
  border-left-color: #39784d;
  background: #e8f4eb;
  color: #245b35;
}

.annotation-submit-status[data-state="error"] {
  border-left-color: #a32920;
  background: #f9e9e6;
  color: #862219;
}

.netlify-honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.annotation-editor-hint {
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.5;
}

.annotation-dialog footer {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--ink);
  background: var(--paper-deep);
}

.annotation-dialog footer button {
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid var(--ink);
  background: var(--white);
  font-size: 10px;
  font-weight: 780;
}

.annotation-dialog footer .primary-button {
  background: var(--ink);
  color: var(--white);
}

.annotation-dialog footer .primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.annotation-dialog footer .danger-button {
  border-color: #a32920;
  color: #a32920;
}

.annotation-dialog footer .danger-button:hover {
  background: #a32920;
  color: var(--white);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--deck-height) + 18px);
  z-index: 300;
  max-width: min(460px, calc(100vw - 32px));
  padding: 10px 14px;
  border: 1px solid var(--ink);
  background: var(--white);
  box-shadow: 4px 4px 0 var(--ink);
  font-size: 11px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

body[data-motion="reduced"] *,
body[data-motion="reduced"] *::before,
body[data-motion="reduced"] *::after {
  scroll-behavior: auto !important;
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
}

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

@media (max-width: 1080px) {
  :root {
    --topbar-height: 70px;
    --deck-height: 105px;
  }

  .topbar {
    grid-template-columns: auto minmax(190px, 1fr) auto;
    gap: 13px;
    padding: 0 12px;
  }

  .brand-copy {
    display: none;
  }

  .source-button span:last-child {
    display: none;
  }

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

  .annotation-button {
    min-width: 50px;
    justify-content: center;
    padding: 0 5px;
  }

  .annotation-button > span:not(.annotation-button-icon) {
    display: none;
  }

  .annotation-button b {
    position: absolute;
    top: -7px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    border: 1px solid var(--paper);
  }

  .control-deck {
    grid-template-columns: auto minmax(260px, 1fr) auto;
    gap: 12px;
    padding: 10px 12px;
  }

  .overview-button,
  .mode-button span {
    display: none;
  }

  .mode-button {
    min-width: 59px;
    place-items: center;
  }

  .detail-panel {
    width: min(610px, 66vw);
  }
}

@media (max-width: 760px) {
  :root {
    --topbar-height: 128px;
    --deck-height: 146px;
  }

  .topbar {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: 58px 54px;
    align-content: center;
    gap: 0 10px;
    padding: 7px 10px;
  }

  .brand {
    grid-row: 1;
  }

  .location-block {
    grid-column: 2;
    grid-row: 1;
  }

  .top-actions {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: space-between;
  }

  .language-switch {
    flex: 1;
  }

  .language-switch button {
    flex: 1;
    padding: 0 7px;
  }

  .stage-shell {
    grid-template-rows: 49px minmax(0, 1fr) var(--deck-height);
  }

  .stage-heading {
    padding: 7px 12px;
  }

  .stage-heading > div:first-child {
    gap: 8px;
  }

  .stage-heading h1 {
    font-size: 17px;
  }

  .stage-meta span:last-child {
    display: none;
  }

  .pan-surface {
    padding: 20px 18px 30px;
  }

  .onboarding {
    left: 14px;
    bottom: 14px;
    width: calc(100vw - 28px);
    margin-bottom: 14px;
    padding: 18px;
  }

  .onboarding h2 {
    font-size: 24px;
  }

  .control-deck {
    grid-template-columns: 1fr auto;
    grid-template-rows: 62px 52px;
    gap: 7px 10px;
    padding: 9px 10px;
  }

  .view-actions {
    grid-column: 1;
    grid-row: 2;
  }

  .minimap-wrap {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .display-controls {
    grid-column: 2;
    grid-row: 2;
  }

  .mode-button {
    min-width: 50px;
  }

  #hotspotModeButton {
    display: none;
  }

  .zoom-control {
    grid-template-columns: 44px 52px 44px;
  }

  .detail-scrim {
    inset: var(--topbar-height) 0 var(--deck-height) 0;
  }

  .detail-panel {
    top: var(--topbar-height);
    bottom: var(--deck-height);
    width: 100vw;
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .detail-body {
    padding: 13px;
  }

  .detail-media {
    min-height: 190px;
  }

  .detail-quote blockquote {
    font-size: 25px;
  }

  .near-equivalent-grid,
  .dialog-grid,
  .source-stack {
    grid-template-columns: 1fr;
  }

  .detail-footer {
    grid-template-columns: 48px minmax(0, 1fr) 48px;
  }

  .detail-footer > button:first-child span:last-child,
  .detail-footer > button:last-child span:first-child {
    display: none;
  }

  .detail-footer > button:first-child,
  .detail-footer > button:last-child {
    justify-content: center;
  }

  .dialog-note {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .info-dialog {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
  }

  .annotation-panel {
    top: auto;
    right: 10px;
    bottom: calc(var(--deck-height) + 10px);
    left: 10px;
    width: auto;
    height: min(42vh, 350px);
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
    grid-template-rows: auto auto minmax(0, 1fr);
  }

  body.detail-open .annotation-panel {
    right: 10px;
    left: 10px;
  }

  .annotation-panel-header {
    grid-column: 1 / -1;
    grid-row: 1;
    padding: 8px 10px;
  }

  .annotation-panel-header h2 {
    font-size: 16px;
  }

  .annotation-panel-intro {
    grid-column: 1;
    grid-row: 2;
    padding: 8px 10px;
  }

  .annotation-actions {
    grid-column: 1;
    grid-row: 3;
    align-self: start;
  }

  .annotation-export-state {
    grid-column: 2;
    grid-row: 2;
    align-self: end;
  }

  .annotation-list,
  .annotation-empty {
    grid-column: 2;
    grid-row: 3;
  }

  .annotation-actions button,
  .annotation-actions a {
    min-height: 46px;
  }

  .annotation-dialog footer {
    grid-template-columns: 1fr 1fr;
  }

  .annotation-dialog footer > span {
    display: none;
  }

  .annotation-dialog footer .danger-button {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) and (max-height: 500px) {
  :root {
    --topbar-height: 70px;
    --deck-height: 78px;
  }

  .topbar {
    grid-template-columns: auto minmax(100px, 1fr) auto;
    grid-template-rows: 1fr;
    gap: 10px;
    padding: 7px 10px;
  }

  .brand {
    grid-column: 1;
    grid-row: 1;
  }

  .location-block {
    grid-column: 2;
    grid-row: 1;
  }

  .top-actions {
    grid-column: 3;
    grid-row: 1;
  }

  .language-switch button {
    min-width: 0;
    padding: 0 6px;
  }

  .stage-shell {
    grid-template-rows: 46px minmax(0, 1fr) var(--deck-height);
  }

  .control-deck {
    grid-template-columns: auto minmax(120px, 1fr) auto;
    grid-template-rows: 1fr;
    gap: 10px;
    padding: 8px 10px;
  }

  .view-actions {
    grid-column: 1;
    grid-row: 1;
  }

  .minimap-wrap {
    grid-column: 2;
    grid-row: 1;
  }

  .minimap-label {
    display: none;
  }

  .display-controls {
    grid-column: 3;
    grid-row: 1;
  }

  .onboarding {
    max-height: calc(100% - 20px);
    overflow-y: auto;
  }

  .detail-scrim {
    inset: var(--topbar-height) 0 var(--deck-height) 0;
  }

  .detail-panel {
    top: var(--topbar-height);
    bottom: var(--deck-height);
  }

  .annotation-panel {
    top: calc(var(--topbar-height) + 8px);
    right: 8px;
    bottom: calc(var(--deck-height) + 8px);
    left: auto;
    width: min(310px, 47vw);
    height: auto;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto auto minmax(0, 1fr) auto;
  }

  body.detail-open .annotation-panel {
    right: 8px;
    left: auto;
  }

  .annotation-panel-header,
  .annotation-panel-intro,
  .annotation-actions,
  .annotation-export-state,
  .annotation-list,
  .annotation-empty {
    grid-column: 1;
  }

  .annotation-panel-header { grid-row: 1; }
  .annotation-panel-intro { grid-row: 2; }
  .annotation-actions { grid-row: 3; }
  .annotation-export-state { grid-row: 4; }
  .annotation-list,
  .annotation-empty { grid-row: 5; }

  .detail-header {
    padding: 5px 10px;
  }

  .detail-header h2 {
    font-size: 18px;
  }

  .detail-media {
    min-height: 150px;
  }
}

@media (max-height: 650px) and (min-width: 761px) {
  :root {
    --topbar-height: 64px;
    --deck-height: 78px;
  }

  .stage-shell {
    grid-template-rows: 46px minmax(0, 1fr) var(--deck-height);
  }

  .topbar {
    height: var(--topbar-height);
  }

  .control-deck {
    padding-top: 7px;
    padding-bottom: 7px;
  }

  .onboarding {
    transform: scale(0.88);
    transform-origin: left bottom;
  }
}

/* V004 — self-contained home, qualified colour assets and dashed navigation */
.home-page {
  position: fixed;
  inset: 0;
  z-index: 600;
  min-height: 100dvh;
  overflow: auto;
  background: #f5f2e9;
  color: var(--ink);
}

.home-page[hidden] {
  display: none;
}

.home-utility {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding: 8px clamp(18px, 3vw, 44px);
  border-bottom: 1px solid rgba(23, 23, 19, 0.42);
  background: rgba(245, 242, 233, 0.9);
  backdrop-filter: blur(12px);
}

.home-utility > span,
.home-kicker,
.home-author > span {
  font: 780 9px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.home-utility-actions,
.home-language-control {
  display: flex;
  align-items: center;
}

.home-utility-actions {
  gap: 10px;
}

.home-language-control {
  gap: 8px;
}

.home-language-control > span {
  color: var(--muted);
  font: 760 8px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.home-language-switch {
  flex: 0 1 auto;
}

.home-language-switch button {
  min-height: 36px;
  padding: 0 10px;
  font-size: 10px;
}

.home-annotation-button {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--ink);
  background: var(--white);
  font-size: 10px;
  font-weight: 780;
}

.home-annotation-button b {
  display: grid;
  place-items: center;
  min-width: 21px;
  height: 21px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--white);
  font-size: 8px;
}

.home-annotation-button[aria-pressed="true"] {
  background: var(--orange);
  color: var(--white);
  box-shadow: 3px 3px 0 var(--ink);
}

.home-hero {
  position: relative;
  min-height: clamp(300px, 47vh, 520px);
  margin-top: 58px;
  overflow: hidden;
  border-bottom: 1px solid var(--ink);
  background: #d9d6cf;
}

.home-lineart,
.home-lineart-fallback,
.home-hero-shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.home-lineart {
  z-index: 1;
  object-fit: cover;
  object-position: center 52%;
  filter: grayscale(1) contrast(1.08);
}

.home-lineart-fallback {
  display: grid;
  place-content: center;
  background: repeating-linear-gradient(-45deg, #ebe8e0 0 16px, #d8d4cc 16px 17px);
  color: var(--muted);
  font: 760 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.14em;
}

.home-hero-shade {
  z-index: 2;
  background: linear-gradient(to bottom, rgba(245, 242, 233, 0.04), rgba(245, 242, 233, 0.28));
  pointer-events: none;
}

.home-hero.image-missing .home-lineart {
  display: none;
}

.home-content {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: clamp(30px, 6vw, 100px);
  padding: clamp(30px, 5vw, 76px) clamp(20px, 5vw, 80px) clamp(38px, 6vw, 90px);
}

.home-intro h1 {
  max-width: 12em;
  margin: 14px 0 22px;
  font-family: Georgia, "Songti SC", "SimSun", serif;
  font-size: clamp(42px, 5.2vw, 86px);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -0.055em;
  text-wrap: balance;
}

.home-intro p {
  max-width: 50em;
  margin: 0 0 10px;
  color: #45423b;
  font-size: clamp(13px, 1.2vw, 17px);
  line-height: 1.75;
}

.home-intro p[lang="en"] {
  max-width: 47em;
  color: var(--muted);
  font-size: clamp(11px, 1vw, 14px);
}

.home-kicker {
  color: var(--orange-dark);
}

.home-meta {
  display: grid;
  align-content: start;
  gap: 18px;
}

.home-enter {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  gap: 3px 14px;
  min-height: 84px;
  padding: 16px 18px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--white);
  text-align: left;
}

.home-enter span {
  font-family: Georgia, "Songti SC", "SimSun", serif;
  font-size: 24px;
}

.home-enter small {
  color: #bbb7ad;
  font: 760 8px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.13em;
}

.home-enter b {
  grid-column: 2;
  grid-row: 1 / -1;
  align-self: center;
  font-size: 28px;
}

.home-enter:hover,
.home-enter:focus-visible {
  background: var(--orange-dark);
}

.home-author,
.home-school,
.home-copyright {
  padding-top: 16px;
  border-top: 1px solid var(--rule);
}

.home-author strong {
  display: block;
  margin: 7px 0 4px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 25px;
  font-weight: 500;
}

.home-author p,
.home-copyright p {
  margin: 0;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.55;
}

.home-school img {
  display: block;
  width: min(280px, 100%);
  height: auto;
}

.home-copyright strong {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
}

body[data-page="home"] .skip-link {
  display: none;
}

body[data-page="home"][data-annotation-mode="on"] .home-page {
  cursor: crosshair;
}

body[data-page="home"][data-annotation-mode="on"] .annotation-panel,
body[data-page="home"][data-annotation-mode="on"] .annotation-overlay {
  z-index: 820;
}

.viewport-frame {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.viewport-frame > .viewport {
  width: 100%;
  height: 100%;
}

.scene-pager {
  position: absolute;
  top: 50%;
  z-index: 24;
  display: grid;
  align-items: center;
  justify-items: center;
  gap: 6px;
  width: 62px;
  min-height: 112px;
  padding: 12px 7px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  background: rgba(10, 10, 8, 0.9);
  color: var(--white);
  transform: translateY(-50%);
  backdrop-filter: blur(7px);
}

.scene-pager[hidden] {
  display: none;
}

.scene-pager-previous { left: 0; border-left: 0; }
.scene-pager-next { right: 0; border-right: 0; }

.scene-pager small {
  overflow: hidden;
  max-width: 48px;
  font-size: 8px;
  line-height: 1.3;
  text-overflow: ellipsis;
}

.scene-pager span {
  font-size: 22px;
}

.scene-pager:hover:not(:disabled),
.scene-pager:focus-visible:not(:disabled) {
  background: var(--orange-dark);
}

.scene-pager:disabled {
  opacity: 0.28;
  cursor: not-allowed;
}

.overview-canvas {
  aspect-ratio: 20224 / 3392;
}

.proverb-hotspot.proverb-mask-hit,
.proverb-hotspot.proverb-mask-hit.is-pending,
body[data-hotspots="subtle"] .proverb-hotspot.proverb-mask-hit,
body[data-hotspots="explore"] .proverb-hotspot.proverb-mask-hit {
  width: var(--marker-width, 9%);
  height: var(--marker-height, 12%);
  min-width: 44px;
  min-height: 44px;
  margin: 0;
  border: 2px dashed rgba(255, 255, 247, 0.88);
  border-radius: 50%;
  background: rgba(255, 247, 207, 0.035);
  box-shadow: 0 0 0 1px rgba(23, 23, 19, 0.34), 0 1px 5px rgba(0, 0, 0, 0.44);
  opacity: 1;
  transform: translate(-50%, -50%);
}

.proverb-hotspot.proverb-mask-hit::after {
  inset: -13%;
  border-radius: 50%;
  background: rgba(255, 235, 154, 0.28);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 0 35%, rgba(0, 0, 0, 0.88) 58%, transparent 82%);
  mask-image: radial-gradient(ellipse at center, #000 0 35%, rgba(0, 0, 0, 0.88) 58%, transparent 82%);
}

.proverb-hotspot.proverb-mask-hit:hover,
.proverb-hotspot.proverb-mask-hit:focus-visible,
.proverb-hotspot.proverb-mask-hit[aria-current="true"] {
  border: 2px dashed #fff2ad;
  border-radius: 50%;
  background: rgba(255, 238, 157, 0.12);
  box-shadow: 0 0 18px rgba(255, 221, 109, 0.58);
}

.display-controls[hidden] {
  display: none;
}

.detail-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 310px) 44px 44px;
  align-items: center;
}

.detail-header > div:first-child {
  min-width: 0;
  margin-right: 0;
}

.detail-language-switch {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%;
  min-width: 0;
  max-width: 310px;
  padding: 3px;
  border-radius: 24px;
  flex: none;
}

.detail-language-switch button {
  min-width: 0;
  padding: 0 7px;
  overflow-wrap: anywhere;
}

@media (max-width: 900px) {
  .home-content {
    grid-template-columns: 1fr;
  }

  .home-meta {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .home-enter,
  .home-copyright {
    grid-column: 1 / -1;
  }

  .detail-header {
    grid-template-columns: minmax(0, 1fr) 44px 44px;
    gap: 8px;
  }

  .detail-language-switch {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: stretch;
    max-width: none;
  }
}

@media (max-width: 620px) {
  .home-utility {
    align-items: center;
    gap: 8px;
  }

  .home-utility > span {
    max-width: 8em;
  }

  .home-utility-actions {
    gap: 6px;
  }

  .home-language-control > span {
    display: none;
  }

  .home-language-switch button {
    min-height: 36px;
    padding: 0 7px;
    font-size: 9.5px;
  }

  .home-annotation-button > span:nth-child(2) {
    display: none;
  }

  .home-hero {
    min-height: 250px;
  }

  .home-content {
    padding-top: 26px;
  }

  .home-intro h1 {
    font-size: clamp(36px, 12vw, 56px);
  }

  .home-meta {
    grid-template-columns: 1fr;
  }

  .home-enter,
  .home-copyright {
    grid-column: 1;
  }

  .scene-pager {
    width: 48px;
    min-height: 88px;
  }

  .scene-pager small {
    display: none;
  }

  .detail-header {
    padding: 8px;
  }

  .detail-header h2 {
    font-size: 16px;
  }
}

/* V005 — annotation-led audience copy, calibrated regions and larger artwork. */
:root {
  --topbar-height: 66px;
  --deck-height: 76px;
  --dragbar-height: 34px;
}

.stage-shell,
body:not([data-level="overview"]) .stage-shell {
  grid-template-rows: 46px minmax(0, 1fr) var(--dragbar-height) var(--deck-height);
}

body:not([data-level="overview"]) .stage-shell {
  grid-template-rows: 46px minmax(0, 1fr) 0 var(--deck-height);
}

.stage-heading {
  padding: 5px 16px;
}

.control-deck {
  grid-template-columns: minmax(190px, 0.8fr) minmax(360px, 1.55fr) minmax(300px, 1fr);
  gap: 14px;
  min-height: var(--deck-height);
  padding: 8px 14px;
}

.drag-bar-wrap {
  padding: 3px 16px;
}

.overview-surface {
  grid-template-rows: auto;
  padding: 8px 0;
}

.home-enter {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 78px;
  text-align: center;
}

.home-enter span {
  text-align: center;
}

.home-enter b {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
}

.home-contact {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  font-style: normal;
}

.home-contact a {
  width: fit-content;
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  text-decoration-color: var(--rule);
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

.home-contact a:hover {
  color: var(--orange-dark);
}

.brand-mark {
  border-radius: 12px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 26px;
  font-weight: 500;
}

.asset-badge,
#assetState[hidden] {
  display: none;
}

.minimap {
  display: block;
  height: 42px;
  background-color: #b9ad87;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 100% 100%;
}

.minimap::after {
  position: absolute;
  inset: 0;
  z-index: 1;
  content: "";
  background: rgba(255, 254, 249, 0.12);
  pointer-events: none;
}

.minimap-segment {
  position: absolute;
  z-index: 2;
  min-width: 24px;
  min-height: 18px;
  border: 1px solid rgba(255, 254, 249, 0.56);
  background: rgba(23, 23, 19, 0.08);
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.92);
}

.minimap-segment:first-of-type {
  border-left: 1px solid rgba(255, 254, 249, 0.56);
}

.minimap-segment:hover,
.minimap-segment:focus-visible,
.minimap-segment[aria-current="true"] {
  background: color-mix(in srgb, var(--scene-color) 68%, transparent);
}

.minimap-viewport {
  z-index: 5;
  border-color: #fff;
  box-shadow: 0 0 0 1px rgba(23, 23, 19, 0.88), 0 0 8px rgba(0, 0, 0, 0.6);
}

@media (max-width: 900px) {
  :root {
    --topbar-height: 58px;
    --deck-height: 72px;
  }

  .stage-shell,
  body:not([data-level="overview"]) .stage-shell {
    grid-template-rows: 43px minmax(0, 1fr) var(--dragbar-height) var(--deck-height);
  }

  body:not([data-level="overview"]) .stage-shell {
    grid-template-rows: 43px minmax(0, 1fr) 0 var(--deck-height);
  }
}

@media (max-width: 360px) {
  .home-utility > span {
    display: none;
  }

  .home-utility-actions {
    width: 100%;
    justify-content: space-between;
  }
}

/* V003 interaction increment — image-aligned mask navigation */
.scene-mask-map {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.scene-mask-highlight {
  fill: rgba(255, 232, 150, 0.62);
  opacity: 0;
  pointer-events: none;
  mix-blend-mode: screen;
  transition: opacity 170ms ease, filter 170ms ease;
}

.scene-mask-hit {
  fill: transparent;
  outline: none;
  cursor: pointer;
  pointer-events: all;
  touch-action: pan-x pan-y;
}

.scene-mask-target:hover .scene-mask-highlight,
.scene-mask-target:has(.scene-mask-hit:focus-visible) .scene-mask-highlight {
  opacity: 0.52;
  filter: drop-shadow(0 0 34px rgba(255, 222, 126, 0.82));
}

.scene-mask-target:has(.scene-mask-hit:focus-visible) .scene-mask-highlight {
  opacity: 0.68;
  filter: drop-shadow(0 0 46px rgba(255, 214, 96, 0.96));
}

.scene-mask-target.is-nested:hover .scene-mask-highlight,
.scene-mask-target.is-nested:has(.scene-mask-hit:focus-visible) .scene-mask-highlight {
  opacity: 0.74;
}

.scene-mask-hit:focus-visible {
  stroke: rgba(23, 23, 19, 0.94);
  stroke-width: 3px;
  vector-effect: non-scaling-stroke;
}

.proverb-hotspot.proverb-mask-hit,
.proverb-hotspot.proverb-mask-hit.is-pending {
  width: clamp(52px, 7.5%, 78px);
  height: clamp(52px, 7.5%, 78px);
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: transparent;
  font-size: 0;
  opacity: 1;
  transform: translate(-50%, -50%);
  cursor: pointer;
  touch-action: pan-x pan-y;
}

.proverb-hotspot.proverb-mask-hit::after {
  content: "";
  position: absolute;
  inset: -18%;
  width: auto;
  max-width: none;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: rgba(255, 235, 154, 0.36);
  box-shadow: 0 0 32px rgba(255, 220, 112, 0.72);
  color: transparent;
  opacity: 0;
  transform: none;
  pointer-events: none;
  -webkit-backdrop-filter: brightness(1.18) contrast(1.035);
  backdrop-filter: brightness(1.18) contrast(1.035);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 0 24%, rgba(0, 0, 0, 0.92) 48%, transparent 78%);
  mask-image: radial-gradient(ellipse at center, #000 0 24%, rgba(0, 0, 0, 0.92) 48%, transparent 78%);
  transition: opacity 150ms ease, filter 150ms ease;
}

.proverb-hotspot.proverb-mask-hit:hover,
.proverb-hotspot.proverb-mask-hit:focus-visible,
.proverb-hotspot.proverb-mask-hit[aria-current="true"] {
  z-index: 10;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: transparent;
  transform: translate(-50%, -50%);
}

.proverb-hotspot.proverb-mask-hit:hover::after {
  opacity: 0.38;
}

.proverb-hotspot.proverb-mask-hit:focus-visible::after {
  opacity: 0.68;
  filter: drop-shadow(0 0 13px color-mix(in srgb, var(--scene-color) 72%, #ffe39a));
}

.proverb-hotspot.proverb-mask-hit[aria-current="true"]::after {
  opacity: 0.26;
}

.viewport.is-dragging .scene-mask-highlight,
.viewport.is-dragging .proverb-mask-hit::after {
  opacity: 0 !important;
}

@media (hover: none) {
  .proverb-hotspot.proverb-mask-hit::after {
    opacity: 0.1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .scene-mask-highlight,
  .proverb-hotspot.proverb-mask-hit::after {
    transition: none;
  }
}

/* V003 — final-asset interaction and annotation iteration */
:root {
  --dragbar-height: 42px;
}

.stage-shell {
  grid-template-rows: 57px minmax(0, 1fr) var(--dragbar-height) var(--deck-height);
}

body:not([data-level="overview"]) .stage-shell {
  grid-template-rows: 57px minmax(0, 1fr) 0 var(--deck-height);
}

.drag-bar-wrap {
  position: relative;
  z-index: 62;
  display: grid;
  grid-template-columns: auto minmax(120px, 1fr);
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 7px 20px;
  border-top: 1px solid var(--rule);
  background: var(--paper-deep);
}

.drag-bar-wrap[hidden] {
  display: none;
}

.drag-bar-wrap label {
  color: var(--muted);
  font: 760 8.5px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.drag-bar-wrap input {
  width: 100%;
  min-height: 28px;
  accent-color: var(--orange-dark);
  cursor: ew-resize;
}

.overview-surface {
  grid-template-rows: auto;
  align-content: center;
  gap: 0;
  padding-top: 18px;
  padding-bottom: 18px;
}

.scene-canvas {
  aspect-ratio: 5056 / 3392;
  background: var(--paper);
}

.scene-canvas::after {
  display: none;
}

.scene-image,
.scene-image-fallback {
  position: absolute;
  inset: 0;
}

.scene-image {
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.scene-image-fallback {
  z-index: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 9px;
  padding: 15%;
  background: repeating-linear-gradient(-45deg, #f6f3eb 0 12px, #ebe5d9 12px 13px);
  color: var(--muted);
  text-align: center;
}

.scene-image-fallback p {
  max-width: 34em;
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
}

.scene-canvas.image-missing .scene-image {
  display: none;
}

.scene-canvas:not(.image-missing) .scene-image-fallback {
  visibility: hidden;
}

.scene-canvas .asset-badge {
  z-index: 8;
}

.zoom-control.zoom-presets {
  grid-template-columns: repeat(3, minmax(48px, 1fr));
  width: min(250px, 100%);
  height: 46px;
}

.zoom-control.zoom-presets button {
  padding: 0 13px;
  border-left: 1px solid var(--rule);
  font: 780 10px/1 ui-sans-serif, system-ui, sans-serif;
}

.zoom-control.zoom-presets button:first-child {
  border-left: 0;
}

.zoom-control.zoom-presets button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--white);
}

body.onboarding-open::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(23, 23, 19, 0.48);
  backdrop-filter: blur(7px);
}

body.onboarding-open .topbar,
body.onboarding-open .workspace {
  filter: blur(8px);
  pointer-events: none;
  user-select: none;
}

.onboarding {
  position: fixed;
  top: 50%;
  left: 50%;
  bottom: auto;
  z-index: 1000;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px 24px;
  width: min(620px, calc(100vw - 36px));
  margin: 0;
  padding: 25px;
  border: 1px solid var(--ink);
  background: rgba(255, 254, 249, 0.98);
  box-shadow: 13px 13px 0 var(--orange);
  transform: translate(-50%, -50%);
}

.onboarding-language {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule);
}

.onboarding-language > span {
  color: var(--muted);
  font: 760 8.5px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.onboarding .language-switch {
  flex: 0 1 280px;
}

.onboarding-index {
  grid-column: 1;
}

.onboarding-visual {
  grid-column: 2;
  grid-row: 2 / span 3;
  display: grid;
  place-items: center;
  min-width: 160px;
  min-height: 150px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--white);
  font: 780 20px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.06em;
}

.onboarding h2,
.onboarding > p {
  grid-column: 1;
  margin-right: 0;
}

.onboarding-progress {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.onboarding-progress i {
  height: 4px;
  background: var(--rule);
}

.onboarding[data-step="1"] .onboarding-progress i:nth-child(1),
.onboarding[data-step="2"] .onboarding-progress i:nth-child(-n+2),
.onboarding[data-step="3"] .onboarding-progress i {
  background: var(--orange-dark);
}

.onboarding-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.onboarding-actions > button {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--ink);
  background: var(--white);
  font-size: 10px;
  font-weight: 780;
}

.onboarding-actions > button:disabled {
  opacity: 0.35;
}

.onboarding-actions > .primary-button {
  min-width: 150px;
  background: var(--ink);
  color: var(--white);
}

.onboarding > small {
  grid-column: 1 / -1;
  margin-top: 0;
}

.detail-scrim {
  display: none !important;
}

.detail-panel {
  inset: 0;
  z-index: 500;
  grid-template-columns: 36px minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: 100vw;
  height: 100dvh;
  border: 0;
  box-shadow: none;
  transform: translateY(102%);
}

body.detail-open .detail-panel {
  transform: translateY(0);
}

.detail-header {
  grid-column: 2;
  grid-row: 1;
}

.detail-header > div {
  margin-right: 0;
}

.detail-header > div:first-child {
  margin-right: auto;
}

.detail-language-switch {
  flex: 0 1 310px;
}

.detail-annotation-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border: 1px solid var(--ink);
  background: var(--white);
  font-size: 18px;
}

.detail-annotation-button:hover {
  background: var(--orange-dark);
  color: var(--white);
}

.detail-body {
  grid-column: 2;
  grid-row: 2;
  overflow: hidden;
  padding: 0;
}

.detail-footer {
  grid-column: 2;
  grid-row: 3;
}

.detail-split {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.85fr);
  width: 100%;
  height: 100%;
  min-height: 0;
}

.detail-media {
  position: relative;
  min-height: 0;
  height: 100%;
  margin: 0;
  border: 0;
  border-right: 1px solid var(--ink);
  background: #171713;
}

.detail-media::before,
.detail-media::after {
  display: none;
}

.detail-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.detail-media-fallback {
  display: none;
  place-content: center;
  gap: 7px;
  width: 100%;
  height: 100%;
  padding: 28px;
  background: repeating-linear-gradient(-45deg, #f6f3eb 0 14px, #e7e1d5 14px 15px);
  color: var(--muted);
  text-align: center;
}

.detail-media > .detail-media-fallback {
  position: absolute;
  inset: 0;
  z-index: 1;
  max-width: none;
  padding: 28px;
  background: repeating-linear-gradient(-45deg, #f6f3eb 0 14px, #e7e1d5 14px 15px);
}

.detail-media.image-missing img {
  display: none;
}

.detail-media.image-missing .detail-media-fallback,
.detail-media:not(:has(img)) .detail-media-fallback {
  display: grid;
}

.detail-media figcaption {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  padding: 6px 8px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  background: rgba(23, 23, 19, 0.82);
  color: var(--white);
  font: 720 8px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.06em;
}

.detail-information {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  padding: clamp(18px, 2.4vw, 34px);
  scrollbar-color: var(--rule) transparent;
}

.detail-information .detail-quote blockquote {
  font-size: clamp(25px, 3vw, 48px);
}

body.detail-open .annotation-panel {
  top: 12px;
  bottom: 12px;
  z-index: 800;
}

body.detail-open .annotation-overlay {
  z-index: 760;
}

@media (max-width: 900px) {
  .stage-shell {
    grid-template-rows: 49px minmax(0, 1fr) var(--dragbar-height) var(--deck-height);
  }

  .drag-bar-wrap {
    padding-right: 11px;
    padding-left: 11px;
  }

  .onboarding {
    grid-template-columns: 1fr;
    max-height: calc(100dvh - 28px);
    overflow-y: auto;
    padding: 19px;
  }

  .onboarding-language {
    align-items: stretch;
    flex-direction: column;
  }

  .onboarding .language-switch {
    flex-basis: auto;
  }

  .onboarding-visual {
    grid-column: 1;
    grid-row: auto;
    min-height: 88px;
  }

  .onboarding h2,
  .onboarding > p {
    grid-column: 1;
  }

  .detail-panel {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .detail-split {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(260px, 44vh) auto;
    overflow-y: auto;
  }

  .detail-media {
    min-height: 260px;
    border-right: 0;
    border-bottom: 1px solid var(--ink);
  }

  .detail-information {
    min-height: auto;
    overflow: visible;
  }
}

@media (max-height: 650px) and (min-width: 761px) {
  .stage-shell {
    grid-template-rows: 46px minmax(0, 1fr) var(--dragbar-height) var(--deck-height);
  }

  .onboarding {
    transform: translate(-50%, -50%);
  }
}

/* V004 final cascade: these overrides must follow the inherited V003 layer. */
.overview-canvas {
  aspect-ratio: 20224 / 3392;
}

.scene-mask-highlight {
  fill: rgba(255, 232, 150, 0.46);
  opacity: 0;
  stroke: none;
  pointer-events: none;
  mix-blend-mode: screen;
  transition: opacity 170ms ease, filter 170ms ease;
}

.scene-mask-hit {
  fill: rgba(0, 0, 0, 0.001);
  stroke: none;
  outline: none;
  /* Emoji cursor for the seven L1 puzzle regions: 🔍 */
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Ctext x='1' y='27' font-size='27'%3E%F0%9F%94%8D%3C/text%3E%3C/svg%3E") 13 13, zoom-in;
  pointer-events: all;
  touch-action: pan-x pan-y;
}

.scene-mask-target:hover .scene-mask-highlight,
.scene-mask-target:focus-within .scene-mask-highlight,
.scene-mask-target:has(.scene-mask-hit:focus-visible) .scene-mask-highlight {
  opacity: 0.34;
  filter: drop-shadow(0 0 28px rgba(255, 222, 126, 0.68));
}

.scene-mask-target:has(.scene-mask-hit:focus-visible) .scene-mask-highlight {
  opacity: 0.5;
  filter: drop-shadow(0 0 38px rgba(255, 214, 96, 0.86));
}

.scene-mask-hit:focus-visible {
  stroke: none;
}

body[data-annotation-mode="on"] .scene-mask-hit {
  cursor: crosshair;
}

.proverb-hotspot.proverb-mask-hit,
.proverb-hotspot.proverb-mask-hit.is-pending,
body[data-hotspots="subtle"] .proverb-hotspot.proverb-mask-hit,
body[data-hotspots="explore"] .proverb-hotspot.proverb-mask-hit {
  width: var(--marker-width, 9%);
  height: var(--marker-height, 13.4%);
  min-width: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 2px dashed rgba(255, 255, 247, 0.88);
  border-radius: 50%;
  background: rgba(255, 247, 207, 0.035);
  box-shadow: 0 0 0 1px rgba(23, 23, 19, 0.34), 0 1px 5px rgba(0, 0, 0, 0.44);
  color: transparent;
  font-size: 0;
  opacity: 1;
  transform: translate(-50%, -50%);
}

.proverb-hotspot.proverb-mask-hit::after {
  inset: -13%;
  border-radius: 50%;
  background: rgba(255, 235, 154, 0.28);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 0 35%, rgba(0, 0, 0, 0.88) 58%, transparent 82%);
  mask-image: radial-gradient(ellipse at center, #000 0 35%, rgba(0, 0, 0, 0.88) 58%, transparent 82%);
}

.proverb-hotspot.proverb-mask-hit:hover,
.proverb-hotspot.proverb-mask-hit:focus-visible,
.proverb-hotspot.proverb-mask-hit[aria-current="true"] {
  border: 2px dashed #fff2ad;
  border-radius: 50%;
  background: rgba(255, 238, 157, 0.12);
  box-shadow: 0 0 18px rgba(255, 221, 109, 0.58);
  transform: translate(-50%, -50%);
}

.display-controls[hidden] {
  display: none;
}

.detail-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 310px) 44px 44px;
  align-items: center;
}

.detail-header > div:first-child {
  min-width: 0;
  margin-right: 0;
}

.detail-language-switch {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%;
  min-width: 0;
  max-width: 310px;
  padding: 3px;
  border-radius: 24px;
  flex: none;
}

.detail-language-switch button {
  min-width: 0;
  padding: 0 7px;
  overflow-wrap: anywhere;
}

.detail-narrative > p {
  margin-bottom: 14px;
}

.parallel-citation {
  display: grid;
  gap: 5px;
}

.parallel-citation q {
  font-weight: 750;
}

.parallel-citation small {
  color: var(--muted);
  line-height: 1.45;
}

@media (max-width: 900px) {
  .detail-header {
    grid-template-columns: minmax(0, 1fr) 44px 44px;
    gap: 8px;
  }

  .detail-language-switch {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: stretch;
    max-width: none;
  }
}

@media (max-width: 620px) {
  .detail-header {
    padding: 8px;
  }

  .detail-header h2 {
    font-size: 16px;
  }
}

/* V005 final cascade: public-view sizing and invisible image-aligned targets. */
:root {
  --topbar-height: 66px;
  --deck-height: 76px;
  --dragbar-height: 34px;
}

.stage-shell,
body:not([data-level="overview"]) .stage-shell {
  grid-template-rows: 46px minmax(0, 1fr) var(--dragbar-height) var(--deck-height);
}

body:not([data-level="overview"]) .stage-shell {
  grid-template-rows: 46px minmax(0, 1fr) 0 var(--deck-height);
}

.stage-heading {
  padding: 5px 16px;
}

.control-deck {
  grid-template-columns: minmax(190px, 0.8fr) minmax(360px, 1.55fr) minmax(300px, 1fr);
  gap: 14px;
  min-height: var(--deck-height);
  padding: 8px 14px;
}

.drag-bar-wrap {
  padding: 3px 16px;
}

.overview-surface {
  grid-template-rows: auto;
  padding: 8px 0;
}

.home-enter {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 78px;
  text-align: center;
}

.home-enter span {
  text-align: center;
}

.home-enter b {
  position: absolute;
  top: 50%;
  right: 18px;
  transform: translateY(-50%);
}

.home-contact {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  font-style: normal;
}

.home-contact a {
  width: fit-content;
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  text-decoration-color: var(--rule);
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

.home-contact a:hover {
  color: var(--orange-dark);
}

.brand-mark {
  border-radius: 12px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 26px;
  font-weight: 500;
}

.asset-badge,
#assetState[hidden] {
  display: none;
}

.minimap {
  position: relative;
  display: block;
  height: 42px;
  background-color: #b9ad87;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 100% 100%;
}

.minimap::after {
  position: absolute;
  inset: 0;
  z-index: 1;
  content: "";
  background: rgba(255, 254, 249, 0.12);
  pointer-events: none;
}

.minimap-segment {
  position: absolute;
  z-index: 2;
  min-width: 24px;
  min-height: 18px;
  border: 1px solid rgba(255, 254, 249, 0.56);
  background: rgba(23, 23, 19, 0.08);
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.92);
}

.minimap-segment:first-of-type {
  border-left: 1px solid rgba(255, 254, 249, 0.56);
}

.minimap-segment:hover,
.minimap-segment:focus-visible,
.minimap-segment[aria-current="true"] {
  background: color-mix(in srgb, var(--scene-color) 68%, transparent);
}

.minimap-viewport {
  z-index: 5;
  border-color: #fff;
  box-shadow: 0 0 0 1px rgba(23, 23, 19, 0.88), 0 0 8px rgba(0, 0, 0, 0.6);
}

.proverb-hotspot.proverb-mask-hit,
.proverb-hotspot.proverb-mask-hit.is-pending,
body[data-hotspots="subtle"] .proverb-hotspot.proverb-mask-hit,
body[data-hotspots="explore"] .proverb-hotspot.proverb-mask-hit {
  width: var(--marker-width, 9%);
  height: var(--marker-height, 13.4%);
  min-width: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: transparent;
  font-size: 0;
  opacity: 1;
  transform: translate(-50%, -50%);
}

.proverb-hotspot.proverb-mask-hit::after {
  inset: -16%;
  border-radius: 32%;
  background: radial-gradient(ellipse at center, rgba(255, 238, 164, 0.74) 0 22%, rgba(255, 229, 132, 0.34) 44%, transparent 76%);
  opacity: 0;
  filter: blur(4px) drop-shadow(0 0 8px rgba(255, 221, 109, 0.54));
}

.proverb-hotspot.proverb-mask-hit:hover,
.proverb-hotspot.proverb-mask-hit:focus-visible,
.proverb-hotspot.proverb-mask-hit[aria-current="true"] {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  transform: translate(-50%, -50%);
}

.proverb-hotspot.proverb-mask-hit:hover::after,
.proverb-hotspot.proverb-mask-hit:focus-visible::after {
  opacity: 0.44;
}

.proverb-hotspot.proverb-mask-hit[aria-current="true"]::after {
  opacity: 0.2;
}

@media (max-width: 1120px) {
  :root {
    --topbar-height: 58px;
    --deck-height: 70px;
  }

  .stage-shell,
  body:not([data-level="overview"]) .stage-shell {
    grid-template-rows: 43px minmax(0, 1fr) var(--dragbar-height) var(--deck-height);
  }

  body:not([data-level="overview"]) .stage-shell {
    grid-template-rows: 43px minmax(0, 1fr) 0 var(--deck-height);
  }

  .control-deck {
    grid-template-columns: minmax(170px, 0.75fr) minmax(300px, 1.4fr) minmax(230px, 0.8fr);
    gap: 9px;
    padding: 6px 9px;
  }
}

@media (max-width: 760px) {
  .stage-shell,
  body:not([data-level="overview"]) .stage-shell {
    grid-template-rows: 46px minmax(0, 1fr) var(--dragbar-height) var(--deck-height);
  }

  body:not([data-level="overview"]) .stage-shell {
    grid-template-rows: 46px minmax(0, 1fr) 0 var(--deck-height);
  }

  .overview-surface {
    padding: 5px 0;
  }
}

/* V006 final cascade */

/* Keep the home glyph optically centred instead of relying on a font glyph's
   uneven baseline metrics. */
.brand-mark {
  display: flex;
  align-self: center;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 0;
}

.brand-home-icon {
  display: block;
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.onboarding[data-step="3"] .onboarding-progress i:nth-child(4) {
  background: var(--paper-deep);
}

.onboarding[data-step="4"] .onboarding-progress i {
  background: var(--orange);
}

.onboarding-progress {
  grid-template-columns: repeat(4, 1fr);
}

.onboarding-inline-language {
  display: grid;
  grid-template-columns: 1fr;
  width: 138px;
  height: auto;
  padding: 3px;
  border-color: rgba(255, 255, 255, 0.64);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.onboarding-inline-language button {
  min-height: 38px;
  color: var(--white);
}

.onboarding-inline-language button[aria-pressed="true"] {
  background: var(--white);
  color: var(--ink);
}
:root {
  --topbar-height: 66px;
  --deck-height: 74px;
  --dragbar-height: 34px;
}

body[data-level="scene"] {
  --topbar-height: 58px;
  --deck-height: 96px;
  --scene-pager-safe-inset: 66px;
  --scene-art-gutter: 10px;
}

/* The former visible stage heading remains available to assistive technology
   and as a focus target without taking a row from the image stage. */
.stage-heading-semantic {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.stage-shell,
body:not([data-level="overview"]) .stage-shell {
  grid-template-rows: minmax(0, 1fr) var(--dragbar-height) var(--deck-height);
}

body[data-level="scene"] .stage-shell,
body[data-level="proverb"] .stage-shell {
  grid-template-rows: minmax(0, 1fr) var(--deck-height);
}

.viewport {
  scrollbar-width: none;
  -ms-overflow-style: none;
  background: var(--paper-deep);
}

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

.surface-mount,
.pan-surface {
  min-height: 100%;
}

body[data-level="overview"] .surface-mount,
body[data-level="scene"] .surface-mount {
  height: 100%;
}

body[data-level="overview"] .overview-surface,
body[data-level="scene"] .pan-surface {
  display: flex;
  align-items: center;
  justify-content: center;
  width: max-content !important;
  min-width: 100%;
  height: 100%;
  padding: 0;
}

body[data-level="overview"] .overview-canvas {
  width: var(--canvas-width) !important;
  min-width: 100%;
  height: auto;
  flex: 0 0 auto;
  aspect-ratio: 20224 / 3392;
  border: 0;
  box-shadow: none;
}

body[data-level="scene"] .scene-canvas {
  width: var(--canvas-width) !important;
  height: auto;
  flex: 0 0 auto;
  aspect-ratio: 5056 / 3392;
  border: 0;
  box-shadow: none;
}

body[data-level="scene"] .scene-image {
  object-fit: contain;
}

/* L2 places return and the current scene title at the left of the top bar;
   audience utilities remain compact at the right. */
body[data-level="scene"] .topbar {
  display: flex;
  justify-content: flex-start;
  gap: 10px;
  height: var(--topbar-height);
  padding: 7px 12px;
}

body[data-level="scene"] .topbar .brand,
body[data-level="scene"] .topbar .top-actions > .language-switch,
body[data-level="scene"] .topbar .source-button {
  display: none;
}

body[data-level="scene"] .topbar .location-block {
  display: block;
  min-width: 0;
  flex: 1 1 auto;
  align-self: stretch;
}

body[data-level="scene"] .topbar .location-kicker {
  display: none;
}

body[data-level="scene"] .topbar .breadcrumb {
  width: 100%;
  height: 100%;
}

body[data-level="scene"] .scene-location-title {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  min-width: 0;
  flex: 1 1 auto;
}

body[data-level="scene"] .scene-location-title em {
  color: var(--orange-dark);
  font: 800 9px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  font-style: normal;
  letter-spacing: 0.1em;
  white-space: nowrap;
}

body[data-level="scene"] .scene-location-title strong {
  overflow: hidden;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(14px, 1.7vw, 19px);
  font-weight: 600;
  letter-spacing: -0.015em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-level="scene"] .topbar .top-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
}

body[data-level="scene"] .annotation-button {
  width: 44px;
  min-width: 44px;
  padding: 0;
}

body[data-level="scene"] .annotation-button > span:not(.annotation-button-icon) {
  display: none;
}

body[data-level="overview"] .location-kicker {
  display: none;
}

body[data-level="overview"] .location-block {
  align-content: center;
}

/* L2 return action occupies the first square of the top bar. */
.scene-back-button {
  position: static;
  z-index: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  min-width: 44px;
  flex: 0 0 44px;
  min-height: 44px;
  padding: 0;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--white);
  box-shadow: none;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.scene-back-button > span:last-child {
  display: none;
}

.scene-back-button[hidden] {
  display: none;
}

.scene-back-button:hover,
.scene-back-button:focus-visible {
  border-color: var(--white);
  background: var(--orange-dark);
}

.view-actions,
.display-controls,
.drag-hint,
body[data-level="scene"] .scene-id-flag,
body[data-level="scene"] .minimap-label,
body[data-level="scene"] #positionReadout {
  display: none !important;
}

.scene-pager {
  width: 54px;
  min-height: 54px;
  padding: 0;
  border-color: rgba(255, 255, 255, 0.48);
  background: rgba(23, 23, 19, 0.78);
}

.scene-pager small {
  display: none;
}

.scene-pager span {
  font-size: 25px;
}

/* L1's deck contains only its panorama map. */
.control-deck,
body[data-level="overview"] .control-deck,
body[data-level="scene"] .control-deck {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  padding: 8px 14px;
}

body[data-level="overview"] .minimap-wrap {
  width: 100%;
}

body[data-level="overview"] .minimap {
  height: 42px;
}

/* On L2 the same control becomes a geographical chapter-card strip. JS can
   centre the active card; scroll-snap preserves that treatment for touch. */
body[data-level="scene"] .minimap-wrap {
  display: block;
  width: 100%;
  overflow: hidden;
}

body[data-level="scene"] .minimap {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 78px;
  padding: 8px max(14px, calc(50% - 70px));
  overflow-x: auto;
  overflow-y: hidden;
  border: 0;
  background: transparent !important;
  scroll-behavior: smooth;
  scroll-padding-inline: 50%;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

body[data-level="scene"] .minimap::after,
body[data-level="scene"] .minimap-viewport {
  display: none;
}

body[data-level="scene"] .minimap::-webkit-scrollbar {
  display: none;
}

body[data-level="scene"] .chapter-track {
  display: flex;
  align-items: center;
  gap: 8px;
  width: max-content;
  min-width: max-content;
}

body[data-level="scene"] .minimap-segment,
body[data-level="scene"] .chapter-card {
  position: relative !important;
  inset: auto !important;
  width: clamp(74px, 10vw, 116px) !important;
  height: 52px !important;
  min-width: clamp(74px, 10vw, 116px);
  flex: 0 0 clamp(74px, 10vw, 116px);
  padding: 0 12px;
  border: 1px solid var(--rule);
  background-color: var(--scene-color);
  background-image: linear-gradient(rgba(23, 23, 19, 0.42), rgba(23, 23, 19, 0.42)), var(--chapter-image);
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  color: var(--white);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.92);
  scroll-snap-align: center;
  transition: min-width 180ms ease, flex-basis 180ms ease, height 180ms ease, background 180ms ease, color 180ms ease;
}

body[data-level="scene"] .chapter-card {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  text-align: left;
}

body[data-level="scene"] .chapter-card b {
  font: 850 13px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}

body[data-level="scene"] .chapter-card span {
  overflow: hidden;
  font-size: 9px;
  font-weight: 750;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-level="scene"] .minimap-segment:hover,
body[data-level="scene"] .minimap-segment:focus-visible,
body[data-level="scene"] .chapter-card:hover,
body[data-level="scene"] .chapter-card:focus-visible {
  background-image: linear-gradient(rgba(23, 23, 19, 0.24), rgba(23, 23, 19, 0.34)), var(--chapter-image);
  color: var(--white);
}

body[data-level="scene"] .minimap-segment[aria-current="true"],
body[data-level="scene"] .chapter-card[aria-current="true"] {
  width: clamp(112px, 15vw, 166px) !important;
  height: 64px !important;
  min-width: clamp(112px, 15vw, 166px);
  flex-basis: clamp(112px, 15vw, 166px);
  border-color: var(--ink);
  background-color: var(--scene-color);
  background-image: linear-gradient(rgba(23, 23, 19, 0.16), rgba(23, 23, 19, 0.38)), var(--chapter-image);
  color: var(--white);
  box-shadow: 5px 5px 0 var(--ink);
  font-size: 12px;
}

/* L3 is a full-page reading surface: back at upper left, image and card split,
   and previous/next as the only footer actions. */
.detail-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 44px;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
}

.detail-header > div:first-of-type {
  margin: 0;
}

.detail-return-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid var(--ink);
  background: var(--white);
  font-size: 10px;
  font-weight: 800;
}

.detail-return-button:hover,
.detail-return-button:focus-visible {
  background: var(--ink);
  color: var(--white);
}

.detail-language-switch,
.detail-close,
.detail-media figcaption,
.detail-quote > .content-role {
  display: none !important;
}

.detail-footer {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.detail-media {
  background: var(--paper-deep);
}

.detail-media img {
  object-fit: cover;
}

/* Native-speaker recording control injected into the L3 information card. */
.gaelic-audio-control {
  display: grid;
  gap: 7px;
  margin: 0 0 18px;
}

.gaelic-audio-button {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 58px;
  padding: 7px 12px 7px 7px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--white);
  text-align: left;
}

.gaelic-audio-button::before {
  content: "▶";
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 50%;
  font-size: 13px;
}

.gaelic-audio-button:hover:not(:disabled),
.gaelic-audio-button:focus-visible:not(:disabled),
.gaelic-audio-button[aria-pressed="true"],
.gaelic-audio-button[data-state="playing"] {
  background: var(--orange-dark);
}

.gaelic-audio-button[aria-pressed="true"]::before,
.gaelic-audio-button[data-state="playing"]::before {
  content: "❚❚";
  letter-spacing: -0.12em;
}

.gaelic-audio-button:disabled,
.gaelic-audio-button[data-state="unavailable"] {
  border-color: var(--rule);
  background: var(--paper-deep);
  color: var(--muted);
  cursor: not-allowed;
}

.gaelic-audio-button-label,
.gaelic-audio-button strong {
  display: block;
  min-width: 0;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.3;
}

.gaelic-audio-button-state,
.gaelic-audio-button small,
.gaelic-audio-status {
  font: 700 8.5px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.gaelic-audio-control > small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

.gaelic-audio-control > small a {
  color: inherit;
  text-underline-offset: 2px;
}

.gaelic-audio-status {
  min-height: 1.4em;
  margin: 0;
  color: var(--muted);
}

@media (max-width: 900px) {
  body[data-level="scene"] {
    --deck-height: 88px;
  }

  body[data-level="overview"] .topbar {
    gap: 10px;
  }

  .detail-header {
    grid-template-columns: auto minmax(0, 1fr) 44px;
  }

  .detail-return-button > span:last-child {
    display: none;
  }

  .detail-media img {
    object-position: center;
  }
}

@media (max-width: 760px) {
  :root {
    --topbar-height: 116px;
    --deck-height: 72px;
  }

  body[data-level="scene"] {
    --topbar-height: 54px;
    --deck-height: 82px;
    --scene-pager-safe-inset: 52px;
    --scene-art-gutter: 8px;
  }

  .stage-shell,
  body:not([data-level="overview"]) .stage-shell {
    grid-template-rows: minmax(0, 1fr) var(--dragbar-height) var(--deck-height);
  }

  body[data-level="scene"] .stage-shell,
  body[data-level="proverb"] .stage-shell {
    grid-template-rows: minmax(0, 1fr) var(--deck-height);
  }

  body[data-level="scene"] .topbar {
    display: flex;
    height: var(--topbar-height);
    padding: 5px 8px;
  }

  .control-deck,
  body[data-level="overview"] .control-deck,
  body[data-level="scene"] .control-deck {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 1fr;
    padding: 6px 8px;
  }

  body[data-level="overview"] .minimap-label {
    display: none;
  }

  body[data-level="overview"] .minimap,
  body[data-level="scene"] .minimap {
    height: 60px;
  }

  body[data-level="scene"] .minimap {
    padding-block: 5px;
  }

  body[data-level="scene"] .minimap-segment,
  body[data-level="scene"] .chapter-card {
    width: 68px !important;
    min-width: 68px;
    height: 44px !important;
    flex-basis: 68px;
  }

  body[data-level="scene"] .minimap-segment[aria-current="true"],
  body[data-level="scene"] .chapter-card[aria-current="true"] {
    width: 104px !important;
    min-width: 104px;
    height: 54px !important;
    flex-basis: 104px;
  }

  .scene-back-button {
    position: static;
    width: 44px;
    padding: 0;
    justify-content: center;
  }

  .scene-back-button > span:last-child {
    display: none;
  }

  .scene-pager {
    width: 44px;
    min-height: 48px;
  }

  .detail-panel {
    grid-template-columns: 24px minmax(0, 1fr);
  }

  .detail-header {
    gap: 7px;
    padding: 7px;
  }

  .detail-header h2 {
    font-size: 15px;
  }

  .detail-split {
    grid-template-rows: minmax(220px, 42vh) auto;
  }

  .detail-media {
    min-height: 220px;
  }

  .detail-information {
    padding: 17px;
  }

  .detail-footer {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 8px;
  }

  .detail-footer > button:first-child span:last-child,
  .detail-footer > button:last-child span:first-child {
    display: inline;
  }

  .gaelic-audio-button {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .gaelic-audio-button::before {
    width: 38px;
    height: 38px;
  }

  .gaelic-audio-button-state,
  .gaelic-audio-button > small {
    grid-column: 2;
  }
}

@media (max-height: 560px) and (min-width: 761px) {
  body[data-level="scene"] {
    --topbar-height: 50px;
    --deck-height: 76px;
  }

  body[data-level="scene"] .minimap {
    height: 60px;
    padding-block: 4px;
  }

  body[data-level="scene"] .minimap-segment,
  body[data-level="scene"] .chapter-card {
    height: 44px !important;
  }

  body[data-level="scene"] .minimap-segment[aria-current="true"],
  body[data-level="scene"] .chapter-card[aria-current="true"] {
    height: 52px !important;
  }
}

/* V008 performance cascade: direct geometry highlights avoid seven full-size
   masked rectangles and their expensive screen/drop-shadow repaint layers. */
.overview-canvas,
.scene-mask-map {
  contain: paint;
}

.scene-mask-highlight {
  fill: rgba(255, 224, 126, 0.42);
  opacity: 0;
  filter: none;
  mix-blend-mode: normal;
  transition: opacity 130ms ease;
}

.scene-mask-target:hover .scene-mask-highlight,
.scene-mask-target:focus-within .scene-mask-highlight,
.scene-mask-target:has(.scene-mask-hit:focus-visible) .scene-mask-highlight {
  opacity: 0.18;
  filter: none;
}

.scene-mask-target:has(.scene-mask-hit:focus-visible) .scene-mask-highlight {
  opacity: 0.28;
  filter: none;
}

@media (prefers-reduced-motion: reduce) {
  .scene-mask-highlight {
    transition: none;
  }
}
