:root {
  color-scheme: dark;
  --bg: #080b0f;
  --panel: rgba(12, 16, 22, 0.86);
  --panel-strong: rgba(16, 22, 30, 0.94);
  --line: rgba(231, 238, 247, 0.12);
  --text: #eef5ff;
  --muted: #9aa8b8;
  --accent: #19d3ff;
  --accent-2: #e1ff5b;
  --shadow: 0 22px 80px rgba(0, 0, 0, 0.38);
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    linear-gradient(120deg, rgba(25, 211, 255, 0.08), transparent 34%),
    radial-gradient(circle at 80% 18%, rgba(225, 255, 91, 0.09), transparent 28%),
    var(--bg);
  color: var(--text);
}

body {
  overflow: hidden;
}

.global-language-menu {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 30;
  display: grid;
  justify-items: end;
  gap: 8px;
}

.language-menu-button {
  min-width: 58px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(238, 245, 255, 0.18);
  border-radius: 8px;
  background: rgba(8, 11, 15, 0.76);
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  font-weight: 820;
  letter-spacing: 0;
  box-shadow: 0 14px 42px rgba(0, 0, 0, 0.26);
  backdrop-filter: blur(14px);
  transition:
    border-color 180ms ease,
    background 180ms ease,
    transform 180ms ease;
}

.language-menu-button:hover,
.language-menu-button:focus-visible {
  border-color: rgba(225, 255, 91, 0.72);
  outline: none;
}

.language-menu-button:active {
  transform: translateY(1px);
}

button,
input {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(232px, 17vw) minmax(0, 1fr) minmax(300px, 22vw);
  height: 100dvh;
  min-height: 0;
  transition: grid-template-columns 360ms ease;
}

.app-shell.insight-is-hidden {
  grid-template-columns: minmax(232px, 17vw) minmax(0, 1fr) 42px;
}

.left-panel,
.right-panel {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: 0;
  padding: 28px;
  background: var(--panel);
  border-color: var(--line);
  border-style: solid;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.left-panel {
  border-width: 0 1px 0 0;
}

.right-panel {
  border-width: 0 0 0 1px;
  min-width: 0;
  overflow-y: auto;
  transition:
    opacity 260ms ease,
    transform 320ms ease,
    padding 320ms ease,
    border-color 260ms ease;
}

.app-shell.insight-is-hidden .right-panel {
  justify-content: center;
  gap: 0;
  padding: 0;
  border-width: 0 0 0 1px;
  border-color: rgba(231, 238, 247, 0.08);
  opacity: 1;
  transform: translateX(0);
  overflow: hidden;
  pointer-events: auto;
}

.app-shell.insight-is-hidden .right-panel > :not(.insight-peek) {
  display: none;
}

.left-panel {
  overflow-y: auto;
}

.brand-row {
  display: block;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent-2);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(22px, 2vw, 34px);
  line-height: 1.06;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(26px, 2.2vw, 42px);
  line-height: 1.05;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.intro,
.detail-lede,
.text-block p,
.text-block li {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.layer-list {
  display: grid;
  justify-items: start;
  gap: 8px;
  min-width: 0;
}

.chapter-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: clamp(20px, 2.2vh, 32px);
}

.chapter-button,
.mode-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 720;
  line-height: 1.15;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    color 180ms ease;
}

.chapter-button:hover,
.chapter-button:focus-visible,
.mode-button:hover,
.mode-button:focus-visible {
  border-color: rgba(25, 211, 255, 0.58);
  color: var(--text);
  outline: none;
}

.chapter-button.is-active,
.mode-button.is-active {
  border-color: rgba(225, 255, 91, 0.72);
  background: rgba(225, 255, 91, 0.08);
  color: var(--text);
}

.mode-list {
  display: grid;
  gap: 8px;
}

.mode-button {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 8px 10px;
  text-align: left;
}

.mode-title {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mode-role {
  display: block;
  overflow: hidden;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mode-index {
  color: rgba(238, 245, 255, 0.5);
  font-size: 11px;
  font-weight: 800;
}

.mode-nav-button {
  grid-template-columns: auto auto minmax(0, 1fr);
  width: 74px;
  max-width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  transition:
    width 220ms ease,
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease;
}

.mode-nav-button:hover,
.mode-nav-button:focus-visible {
  width: 100%;
  background: rgba(25, 211, 255, 0.08);
}

.mode-nav-button.is-active {
  width: 100%;
  border-color: rgba(225, 255, 91, 0.72);
  background: rgba(225, 255, 91, 0.08);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.18);
}

.mode-glyph {
  display: grid;
  place-items: center;
  width: 20px;
  color: var(--layer-color);
  font-size: 15px;
  line-height: 1;
}

.mode-copy {
  min-width: 0;
  opacity: 0;
  transform: translateX(-4px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.mode-nav-button.is-active .mode-copy,
.mode-nav-button:hover .mode-copy,
.mode-nav-button:focus-visible .mode-copy {
  opacity: 1;
  transform: translateX(0);
}

.layer-button {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 74px;
  max-width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition:
    width 220ms ease,
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease;
}

.layer-button:hover,
.layer-button:focus-visible {
  border-color: rgba(25, 211, 255, 0.65);
  background: rgba(25, 211, 255, 0.08);
  outline: none;
  width: 100%;
}

.layer-button:active {
  transform: translateY(1px);
}

.layer-button.is-active {
  border-color: rgba(225, 255, 91, 0.72);
  background: rgba(225, 255, 91, 0.08);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.18);
  width: 100%;
}

.layer-glyph {
  display: grid;
  place-items: center;
  width: 20px;
  color: var(--layer-color);
  font-size: 15px;
  line-height: 1;
}

.layer-copy {
  min-width: 0;
  opacity: 0;
  transform: translateX(-4px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.layer-title {
  display: block;
  overflow: hidden;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.layer-role {
  display: block;
  overflow: hidden;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.layer-button.is-active .layer-copy,
.layer-button:hover .layer-copy,
.layer-button:focus-visible .layer-copy {
  opacity: 1;
  transform: translateX(0);
}

.layer-index {
  color: rgba(238, 245, 255, 0.56);
  font-size: 11px;
  font-weight: 800;
}

.language-panel {
  display: grid;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.global-language-menu .language-panel {
  min-width: 260px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 11, 15, 0.82);
  box-shadow: 0 18px 56px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(16px);
}

.global-language-menu .language-panel[hidden] {
  display: none;
}

.global-language-menu #languageLabel {
  display: none;
}

.language-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.language-tabs[hidden] {
  display: none;
}

.language-button {
  min-height: 36px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  line-height: 1.15;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    color 180ms ease;
}

.language-button:hover,
.language-button:focus-visible {
  border-color: rgba(25, 211, 255, 0.58);
  color: var(--text);
  outline: none;
}

.language-button:active {
  transform: translateY(1px);
}

.language-button.is-active {
  border-color: rgba(225, 255, 91, 0.72);
  background: rgba(225, 255, 91, 0.08);
  color: var(--text);
}

.control-bank {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: auto;
}

.switch {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.switch {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  color: var(--muted);
  font-size: 13px;
}

.switch input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.slider-row {
  display: grid;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.slider-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
}

.explode-link {
  appearance: none;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: default;
  font: inherit;
  font-size: 13px;
  line-height: 1.4;
  text-align: left;
}

.reset-link {
  appearance: none;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(154, 168, 184, 0.78);
  cursor: pointer;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.4;
  text-decoration: none;
  transition:
    color 180ms ease,
    text-decoration-color 180ms ease,
    transform 180ms ease;
}

.reset-link:hover,
.reset-link:focus-visible {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: rgba(25, 211, 255, 0.76);
  text-underline-offset: 3px;
  outline: none;
}

.reset-link:active {
  transform: translateY(1px);
}

.about-link {
  align-self: flex-start;
  margin-top: 4px;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(154, 168, 184, 0.78);
  cursor: pointer;
  font: inherit;
  font-size: 11.5px;
  line-height: 1.4;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.meta-links {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.meta-links .about-link {
  margin-top: 0;
}

@media (max-width: 1120px) {
  .about-link {
    margin-top: 0;
  }
}

.about-link:hover,
.about-link:focus-visible {
  color: var(--accent);
  outline: none;
}

.slider-row input {
  width: 100%;
  accent-color: var(--accent);
}

.stage {
  position: relative;
  min-width: 0;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

#sceneCanvas {
  display: block;
  width: 100%;
  height: 100%;
}

.hud {
  position: absolute;
  z-index: 3;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 11, 15, 0.62);
  backdrop-filter: blur(14px);
}

.file-warning {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 4;
  display: none;
  width: min(420px, calc(100% - 32px));
  padding: 18px;
  border: 1px solid rgba(225, 255, 91, 0.42);
  border-radius: 8px;
  background: rgba(8, 11, 15, 0.84);
  box-shadow: var(--shadow);
  transform: translate(-50%, -50%);
  backdrop-filter: blur(16px);
}

.file-warning strong,
.file-warning span {
  display: block;
}

.file-warning strong {
  margin-bottom: 8px;
  color: var(--accent-2);
  font-size: 16px;
}

.file-warning span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.file-warning a {
  color: var(--accent);
  text-decoration: none;
}

.file-warning a:hover,
.file-warning a:focus-visible {
  text-decoration: underline;
  outline: none;
}

body.is-file-protocol .file-warning {
  display: block;
}

.hud.top-left {
  top: 24px;
  left: 24px;
  display: grid;
  gap: 5px;
  max-width: min(320px, calc(100% - 48px));
  padding: 12px 14px;
}

.hud.top-left span,
.hud.bottom-left span {
  color: var(--muted);
  font-size: 11px;
}

.hud.top-left strong {
  font-size: clamp(12px, 1.05vw, 15px);
  line-height: 1.45;
}

.mobile-layer-summary {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 84px;
  z-index: 4;
  display: none;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid rgba(231, 238, 247, 0.12);
  border-radius: 12px;
  background: rgba(8, 11, 15, 0.78);
  backdrop-filter: blur(16px);
}

.mobile-layer-summary span {
  color: var(--text);
  font-size: 13px;
  font-weight: 760;
  line-height: 1.2;
}

.mobile-layer-summary strong {
  color: var(--muted);
  font-size: 12px;
  font-weight: 560;
  line-height: 1.4;
}

.hud.bottom-left {
  bottom: 22px;
  left: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
}

.hud.bottom-left span {
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.audio-dock {
  position: absolute;
  right: 24px;
  bottom: 22px;
  z-index: 4;
  display: grid;
  grid-template-columns: auto minmax(180px, 300px) auto;
  align-items: center;
  gap: 10px;
  max-width: min(560px, calc(100% - 48px));
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 11, 15, 0.72);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(14px);
}

.mobile-layer-dock {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 16px;
  z-index: 5;
  display: none;
  grid-template-columns: repeat(var(--mobile-dock-columns, 6), minmax(0, 1fr));
  gap: 6px;
  padding: 8px;
  border: 1px solid rgba(231, 238, 247, 0.12);
  border-radius: 14px;
  background: rgba(8, 11, 15, 0.88);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.26);
  backdrop-filter: blur(18px);
}

.mobile-layer-dock[hidden] {
  display: none;
}

.mobile-stage-controls[hidden],
.mobile-stage-sheet[hidden],
.mobile-hero-header[hidden] {
  display: none !important;
}

.mobile-hero-header {
  position: absolute;
  top: 10px;
  left: 14px;
  right: 132px;
  z-index: 5;
  display: none;
  max-width: min(460px, calc(100% - 146px));
  pointer-events: none;
}

.mobile-hero-header .eyebrow {
  margin-bottom: 8px;
}

.mobile-page-title {
  max-width: 16ch;
  font-size: clamp(26px, 7vw, 38px);
  line-height: 1.02;
  text-wrap: balance;
}

.mobile-stage-controls {
  position: absolute;
  top: 14px;
  right: 84px;
  z-index: 6;
  display: none;
  width: max-content;
  justify-items: end;
  gap: 8px;
}

.mobile-stage-chip {
  min-width: 52px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(238, 245, 255, 0.18);
  border-radius: 8px;
  background: rgba(8, 11, 15, 0.76);
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  font-weight: 820;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(14px);
  transition:
    border-color 180ms ease,
    background 180ms ease,
    transform 180ms ease;
}

.mobile-stage-chip:hover,
.mobile-stage-chip:focus-visible {
  border-color: rgba(225, 255, 91, 0.72);
  outline: none;
}

.mobile-stage-chip:active {
  transform: translateY(1px);
}

.mobile-stage-sheet {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  gap: 10px;
  width: min(290px, calc(100vw - 28px));
  padding: 12px;
  border: 1px solid rgba(231, 238, 247, 0.1);
  border-radius: 16px;
  background: rgba(10, 14, 20, 0.9);
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(18px);
}

.mobile-stage-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.mobile-stage-button {
  min-height: 34px;
  padding: 0 8px;
  border: 1px solid rgba(231, 238, 247, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(238, 245, 255, 0.76);
  cursor: pointer;
  font-size: 11px;
  font-weight: 720;
  transition:
    border-color 180ms ease,
    background 180ms ease,
    color 180ms ease;
}

.mobile-stage-button:hover,
.mobile-stage-button:focus-visible {
  border-color: rgba(25, 211, 255, 0.42);
  color: var(--text);
  outline: none;
}

.mobile-stage-button.is-active {
  border-color: rgba(25, 211, 255, 0.56);
  background: rgba(25, 211, 255, 0.14);
  color: var(--text);
}

.mobile-stage-tools {
  display: grid;
  gap: 8px;
}

.mobile-stage-link {
  appearance: none;
  justify-self: start;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(154, 168, 184, 0.88);
  cursor: pointer;
  font-size: 12px;
  line-height: 1.35;
  text-decoration: underline;
  text-decoration-color: rgba(25, 211, 255, 0.38);
  text-underline-offset: 3px;
}

.mobile-stage-link:hover,
.mobile-stage-link:focus-visible {
  color: var(--text);
  text-decoration-color: rgba(25, 211, 255, 0.78);
  outline: none;
}

.mobile-stage-tools input {
  width: 100%;
  accent-color: var(--accent);
}

.mobile-layer-button {
  display: grid;
  justify-items: center;
  gap: 4px;
  min-height: 52px;
  padding: 8px 2px 6px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition:
    border-color 180ms ease,
    background 180ms ease,
    color 180ms ease,
    transform 180ms ease;
}

.mobile-layer-button:focus-visible,
.mobile-layer-button:hover {
  border-color: rgba(25, 211, 255, 0.28);
  color: var(--text);
  outline: none;
}

.mobile-layer-button:active {
  transform: translateY(1px);
}

.mobile-layer-button.is-active {
  border-color: rgba(225, 255, 91, 0.38);
  background: rgba(225, 255, 91, 0.08);
  color: var(--text);
}

.mobile-layer-glyph {
  color: var(--layer-color);
  font-size: 16px;
  line-height: 1;
}

.mobile-layer-index {
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.04em;
}

.mobile-layer-label {
  display: none;
  overflow: hidden;
  max-width: 100%;
  font-size: 10px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-layer-button.is-active .mobile-layer-label {
  display: block;
}

.audio-play,
.transcript-toggle {
  min-height: 34px;
  border: 1px solid rgba(238, 245, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
}

.audio-play {
  min-width: 54px;
  color: var(--accent-2);
  font-weight: 800;
}

.audio-play.is-active {
  border-color: rgba(225, 255, 91, 0.54);
  background: rgba(225, 255, 91, 0.1);
}

.transcript-toggle {
  min-width: 86px;
  color: var(--muted);
}

.transcript-toggle.is-active {
  border-color: rgba(25, 211, 255, 0.58);
  background: rgba(25, 211, 255, 0.1);
  color: var(--text);
}

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

.audio-copy span {
  color: var(--muted);
  font-size: 11px;
}

.audio-copy strong {
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.transcript-panel {
  position: absolute;
  right: 24px;
  bottom: 82px;
  z-index: 6;
  width: min(420px, calc(100% - 48px));
  max-height: 220px;
  overflow: auto;
  padding: 14px;
  border: 1px solid rgba(25, 211, 255, 0.46);
  border-radius: 8px;
  background: rgba(8, 11, 15, 0.9);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.36);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  backdrop-filter: blur(14px);
}

.label-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.scene-label {
  position: absolute;
  max-width: 170px;
  padding: 7px 9px;
  border: 1px solid rgba(238, 245, 255, 0.18);
  border-left: 3px solid var(--layer-color);
  border-radius: 6px;
  background: rgba(8, 11, 15, 0.72);
  color: var(--text);
  font-size: 12px;
  line-height: 1.3;
  transform: translate(-50%, -50%);
  backdrop-filter: blur(10px);
}

.scene-label.detail-label {
  max-width: 154px;
  padding: 5px 8px;
  border-color: rgba(238, 245, 255, 0.14);
  background: rgba(8, 11, 15, 0.56);
  color: rgba(236, 243, 255, 0.9);
  font-size: 11px;
}

.scene-label.lane-label,
.scene-label.region-label {
  max-width: 220px;
  padding: 8px 12px;
  border-color: rgba(238, 245, 255, 0.24);
  background: rgba(8, 11, 15, 0.82);
  color: var(--text);
  font-size: 14px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: none;
}

.scene-label.region-label {
  min-width: 148px;
  text-align: center;
}

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

.mobile-insight-close {
  display: none;
  min-width: 30px;
  min-height: 30px;
  padding: 0;
  border: 1px solid rgba(231, 238, 247, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(238, 245, 255, 0.86);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  flex: 0 0 auto;
}

.mobile-insight-close:hover,
.mobile-insight-close:focus-visible {
  border-color: rgba(25, 211, 255, 0.48);
  color: var(--text);
  outline: none;
}

.insight-peek {
  display: none;
  align-self: stretch;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: linear-gradient(180deg, rgba(25, 211, 255, 0.08), rgba(225, 255, 91, 0.04));
  color: rgba(238, 245, 255, 0.74);
  cursor: pointer;
  font-size: 11px;
  font-weight: 780;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

.app-shell.insight-is-hidden .insight-peek {
  display: block;
}

.insight-reveal-prompt {
  display: grid;
  min-height: 132px;
  max-height: 180px;
  align-content: center;
  padding: 18px;
  border: 1px solid rgba(25, 211, 255, 0.2);
  border-radius: 8px;
  background: rgba(25, 211, 255, 0.045);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  transition:
    opacity 260ms ease,
    transform 260ms ease,
    max-height 260ms ease,
    min-height 260ms ease,
    padding 260ms ease,
    margin 260ms ease,
    border-color 260ms ease;
}

.insight-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-height: 0;
  opacity: 0;
  transform: translateY(10px);
  transition:
    max-height 360ms ease,
    opacity 320ms ease,
    transform 320ms ease;
  overflow: hidden;
  pointer-events: none;
}

.right-panel.is-revealed .insight-reveal-prompt {
  min-height: 0;
  max-height: 0;
  margin: -20px 0 0;
  padding-top: 0;
  padding-bottom: 0;
  border-color: transparent;
  opacity: 0;
  transform: translateY(-6px);
  overflow: hidden;
}

.right-panel.is-revealed .insight-content {
  max-height: 720px;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-content: start;
  grid-auto-rows: max-content;
}

.metric {
  min-width: 0;
  min-height: 92px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.metric strong {
  display: block;
  margin-bottom: 8px;
  color: var(--accent);
  font-size: clamp(18px, 1.45vw, 24px);
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.metric span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.text-block {
  padding-top: 4px;
}

.text-block ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.text-block li {
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.text-block h3 {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 12px;
  line-height: 1.2;
  text-transform: uppercase;
}

.text-block p,
.text-block li {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.text-block li span {
  display: block;
}

.text-block a {
  color: var(--text);
  text-decoration-color: rgba(143, 183, 255, 0.45);
  text-underline-offset: 3px;
}

.text-block a:hover,
.text-block a:focus-visible {
  text-decoration-color: rgba(143, 183, 255, 0.9);
}

.summary-finding p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
}

.analysis-link {
  align-self: flex-start;
  margin-top: -2px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 12px;
  line-height: 1.4;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}

.analysis-link:hover,
.analysis-link:focus-visible {
  color: var(--accent-2);
}

.analysis-scrim {
  position: fixed;
  inset: 0;
  z-index: 31;
  background: rgba(2, 6, 12, 0.46);
  backdrop-filter: blur(4px);
}

.analysis-drawer {
  position: fixed;
  z-index: 32;
  top: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  width: min(520px, 42vw);
  height: 100dvh;
  padding: 28px;
  border-left: 1px solid var(--line);
  background: rgba(10, 14, 20, 0.96);
  box-shadow: -28px 0 80px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(22px);
}

.analysis-drawer[hidden],
.analysis-scrim[hidden] {
  display: none;
}

.about-scrim {
  position: fixed;
  inset: 0;
  z-index: 33;
  background: rgba(2, 6, 12, 0.34);
  backdrop-filter: blur(3px);
}

.about-drawer {
  position: fixed;
  z-index: 34;
  top: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  width: min(420px, 36vw);
  height: 100dvh;
  padding: 28px;
  border-left: 1px solid var(--line);
  background: rgba(10, 14, 20, 0.97);
  box-shadow: -22px 0 70px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(22px);
}

.about-drawer[hidden],
.about-scrim[hidden] {
  display: none;
}

.about-drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.about-identity {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-width: 0;
}

.about-avatar {
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  border: 1px solid rgba(255, 183, 35, 0.24);
  border-radius: 14px;
  background: #050607;
  object-fit: cover;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
}

.about-drawer-header h2 {
  margin: 0;
  color: var(--text);
  font-size: clamp(22px, 1.75vw, 30px);
  line-height: 1.08;
  white-space: pre-line;
}

.about-close,
.about-contact {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  line-height: 1.4;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.about-close:hover,
.about-close:focus-visible,
.about-contact:hover,
.about-contact:focus-visible {
  color: var(--accent);
}

.about-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
  padding-top: 22px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.62;
}

.about-body p {
  margin: 0;
}

.about-updated {
  color: rgba(154, 168, 184, 0.72);
  font-size: 12px;
}

.updates-body ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.updates-body li {
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
}

.analysis-drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.analysis-drawer-header h2 {
  margin: 0;
  color: var(--text);
  font-size: clamp(24px, 2vw, 34px);
  line-height: 1.04;
}

.analysis-close {
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  line-height: 1.4;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}

.analysis-close:hover,
.analysis-close:focus-visible {
  color: var(--text);
}

.analysis-body {
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-height: 0;
  padding-top: 22px;
  overflow-y: auto;
}

.analysis-body .detail-lede {
  margin: 0;
}

.analysis-metric-grid .metric {
  min-height: 96px;
}

.analysis-body .text-block li strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
  font-size: 13px;
}

.seo-index-content {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: normal;
}

@media (min-width: 1121px) {
  .left-panel {
    gap: 10px;
    padding: 20px 22px 18px;
    scrollbar-width: none;
  }

  .left-panel::-webkit-scrollbar {
    width: 0;
    height: 0;
  }

  .left-panel h1 {
    font-size: clamp(19px, 1.55vw, 28px);
    line-height: 1.04;
  }

  .left-panel .intro {
    margin-bottom: 0;
    font-size: 12px;
    line-height: 1.4;
  }

  .right-panel {
    gap: 16px;
    padding: 22px;
  }

  .right-panel .detail-lede {
    font-size: 13px;
    line-height: 1.45;
  }

  .right-panel .metric {
    min-height: 78px;
    padding: 11px;
  }

  .right-panel .metric strong {
    margin-bottom: 6px;
    font-size: 18px;
  }

  .right-panel .metric span {
    font-size: 11.5px;
  }

  .summary-finding p {
    -webkit-line-clamp: 4;
  }

  .language-panel {
    gap: 6px;
    margin-bottom: 6px;
  }

  .chapter-button {
    min-height: 30px;
  }

  .chapter-tabs {
    margin-top: 24px;
  }

  .language-button {
    min-height: 30px;
  }

  .layer-list {
    gap: 5px;
    margin-top: 10px;
  }

  .layer-button {
    min-height: 44px;
    gap: 10px;
    padding: 8px 10px;
  }

  .mode-list {
    gap: 5px;
    margin-top: 10px;
  }

  .mode-button {
    min-height: 42px;
    padding: 6px 10px;
  }

  .layer-title {
    font-size: 13px;
  }

  .layer-role {
    margin-top: 2px;
    font-size: 10.5px;
  }

  .slider-row {
    gap: 6px;
  }

  .switch {
    min-height: 38px;
  }
}

@media (max-width: 1120px) {
  body {
    overflow: auto;
  }

  .app-shell {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100dvh;
  }

  .app-shell.insight-is-hidden {
    grid-template-columns: 1fr;
  }

  .left-panel,
  .right-panel {
    border-width: 0 0 1px;
  }

  .stage {
    order: 1;
    height: 100dvh;
    min-height: 100dvh;
  }

  .left-panel {
    position: fixed;
    right: 18px;
    bottom: 8px;
    left: 18px;
    z-index: 7;
    order: 2;
    gap: 0;
    min-height: 0;
    padding: 0;
    border-width: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    pointer-events: none;
  }

  .left-panel .brand-row,
  .left-panel .intro {
    display: none;
  }

  .right-panel {
    order: 3;
  }

  .layer-list {
    display: none;
  }

  .mode-list {
    display: none;
  }

  .chapter-tabs,
  .control-bank {
    display: none;
  }

  .app-shell.insight-is-hidden .right-panel {
    display: none;
  }

  .right-panel {
    position: fixed;
    right: 14px;
    left: 14px;
    bottom: 126px;
    z-index: 12;
    gap: 10px;
    max-height: 138px;
    padding: 14px 14px 12px;
    border-width: 1px;
    border-radius: 16px;
    background: rgba(10, 14, 20, 0.94);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
    backdrop-filter: blur(22px);
    overflow: hidden;
    cursor: pointer;
    transition:
      max-height 260ms ease,
      padding 220ms ease,
      border-color 220ms ease,
      background 220ms ease;
  }

  .right-panel.mobile-expanded {
    max-height: 80dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    cursor: default;
  }

  .right-panel.mobile-expanded .mobile-insight-close {
    display: inline-grid;
    place-items: center;
  }

  .right-panel:not(.mobile-expanded) .detail-lede {
    display: -webkit-box;
    overflow: hidden;
    text-decoration: underline;
    text-decoration-color: rgba(25, 211, 255, 0.32);
    text-underline-offset: 4px;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .right-panel:not(.mobile-expanded) .metric-grid,
  .right-panel:not(.mobile-expanded) .summary-finding,
  .right-panel:not(.mobile-expanded) .analysis-link {
    display: none;
  }

  .insight-peek {
    display: none !important;
  }

  .insight-header {
    padding-bottom: 4px;
  }

  .insight-header h2 {
    display: none;
  }

  .insight-content {
    gap: 8px;
  }

  .right-panel.mobile-expanded .insight-content {
    max-height: none;
    overflow: visible;
  }

  .right-panel .detail-lede {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
  }

  .insight-reveal-prompt {
    display: none;
  }

  .mobile-layer-dock,
  .mobile-layer-summary,
  .mobile-hero-header,
  .mobile-stage-controls {
    display: grid;
  }

  .meta-links {
    position: fixed;
    left: 18px;
    bottom: 8px;
    display: flex;
    flex-direction: row;
    align-items: center;
    z-index: 8;
    gap: 6px;
    pointer-events: auto;
  }

  .about-link {
    align-self: flex-start;
    position: static;
    margin-top: 0;
  }

  .audio-dock {
    position: fixed;
    right: 18px;
    bottom: 8px;
    z-index: 8;
    display: flex !important;
    align-items: center;
    gap: 0;
    width: auto;
    max-width: calc(100vw - 192px);
    min-height: 24px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    pointer-events: auto;
  }

  .audio-copy {
    display: none;
  }

  .audio-play,
  .transcript-toggle {
    min-width: 0;
    min-height: 24px;
    padding: 3px 10px 4px;
    border: 1px solid rgba(238, 245, 255, 0.14);
    border-radius: 999px;
    background: rgba(8, 11, 15, 0.78);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
    color: rgba(154, 168, 184, 0.82);
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none;
  }

  .audio-play {
    color: rgba(225, 255, 91, 0.88);
    font-weight: 700;
  }

  .audio-play:hover,
  .audio-play:focus-visible,
  .transcript-toggle:hover,
  .transcript-toggle:focus-visible {
    color: var(--text);
    border-color: rgba(225, 255, 91, 0.28);
    background: rgba(8, 11, 15, 0.88);
    outline: none;
  }

  .audio-play.is-active,
  .transcript-toggle.is-active {
    border-color: rgba(225, 255, 91, 0.28);
    background: rgba(225, 255, 91, 0.12);
  }

  .transcript-toggle,
  .transcript-panel {
    display: none !important;
  }

  .analysis-drawer,
  .about-drawer {
    top: auto;
    bottom: 0;
    width: 100%;
    height: min(78dvh, 720px);
    padding: 22px;
    border-top: 1px solid var(--line);
    border-left: 0;
    box-shadow: 0 -28px 80px rgba(0, 0, 0, 0.38);
  }

  .control-bank {
    margin-top: 0;
    gap: 4px;
  }

  .chapter-tabs {
    margin-top: 8px;
  }

  .slider-row {
    gap: 6px;
  }

  .slider-row input {
    display: none;
  }

  .slider-row.is-expanded input {
    display: block;
  }

  .explode-link {
    cursor: pointer;
    color: rgba(154, 168, 184, 0.82);
    text-decoration: underline;
    text-decoration-color: rgba(25, 211, 255, 0.38);
    text-underline-offset: 3px;
  }

  .explode-link:hover,
  .explode-link:focus-visible {
    color: var(--text);
    text-decoration-color: rgba(25, 211, 255, 0.76);
    outline: none;
  }

  .explode-link[disabled] {
    opacity: 0.55;
    cursor: default;
    text-decoration: none;
  }

  .language-tabs {
    grid-template-columns: repeat(4, minmax(82px, 1fr));
  }

  .mobile-layer-summary {
    bottom: 122px;
  }

  .mobile-layer-dock {
    bottom: 44px;
  }
}

@media (max-width: 680px) {
  .global-language-menu {
    top: 10px;
    right: 10px;
  }

  .language-menu-button {
    min-width: 52px;
    min-height: 36px;
  }

  .global-language-menu .language-panel {
    min-width: min(300px, calc(100vw - 20px));
  }

  .left-panel,
  .right-panel {
    padding: 18px;
  }

  .left-panel {
    right: 18px;
    bottom: 8px;
    left: 18px;
    gap: 0;
    padding: 0;
  }

  .language-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .stage {
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
  }

  #sceneCanvas {
    height: 100%;
    min-height: 0;
  }

  .scene-label {
    display: none;
  }

  .scene-label.chapter2-region-label,
  .scene-label.chapter2-detail-label {
    display: block;
  }

  .scene-label.chapter2-region-label {
    max-width: 132px;
    min-width: 112px;
    padding: 6px 8px;
    font-size: 11px;
    line-height: 1.2;
  }

  .scene-label.chapter2-detail-label {
    max-width: 126px;
    padding: 5px 7px;
    font-size: 10px;
    line-height: 1.2;
  }

  .hud.top-left,
  .hud.bottom-left {
    display: none;
  }

  .analysis-drawer,
  .about-drawer {
    height: min(82dvh, 680px);
    padding: 18px;
  }

  .right-panel {
    right: 12px;
    left: 12px;
    bottom: 84px;
    max-height: 126px;
    padding: 12px 12px 10px;
    border-radius: 14px;
  }

  .mobile-layer-summary {
    left: 10px;
    right: 10px;
    bottom: 82px;
    padding: 11px 12px;
  }

  .mobile-stage-controls {
    top: 10px;
    right: 72px;
  }

  .mobile-hero-header {
    top: 10px;
    left: 10px;
    right: 118px;
  }

  .mobile-page-title {
    max-width: 14ch;
    font-size: clamp(24px, 8vw, 34px);
  }

  .mobile-stage-sheet {
    width: min(266px, calc(100vw - 20px));
    padding: 10px;
    border-radius: 14px;
  }

  .mobile-layer-dock {
    left: 10px;
    right: 10px;
    bottom: 42px;
    gap: 4px;
    padding: 7px;
  }

  .mobile-layer-button {
    min-height: 48px;
    padding: 7px 1px 6px;
  }

  .mobile-layer-label {
    font-size: 9.5px;
  }

  .analysis-drawer-header h2,
  .about-drawer-header h2 {
    font-size: 24px;
  }

  .about-avatar {
    width: 52px;
    height: 52px;
    flex-basis: 52px;
    border-radius: 12px;
  }

  .analysis-body,
  .about-body {
    gap: 18px;
  }
}

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