@font-face {
  font-family: "Deck Sans";
  src: url("../vendor/fonts/DeckSans-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: "Deck Sans";
  src: url("../vendor/fonts/DeckSans-Bold.ttf") format("truetype");
  font-weight: 700 900;
  font-style: normal;
  font-display: block;
}

:root {
  color-scheme: dark;
  --ink: #0b0f0c;
  --ink-2: #121812;
  --panel: #171d18;
  --panel-2: #202820;
  --paper: #f6f2e8;
  --muted: #aeb8ad;
  --line: rgba(246, 242, 232, 0.16);
  --line-strong: rgba(246, 242, 232, 0.28);
  --teal: #49d7c4;
  --coral: #ff6f61;
  --gold: #f1c453;
  --green: #8fe388;
  --violet: #b59cff;
  --electric: #59f6ff;
  --hot: #ff4fd8;
  --shadow: 0 34px 130px rgba(0, 0, 0, 0.52);
  --bg-start: #030706;
  --bg-mid: #091311;
  --bg-end: #17131d;
  --stage-bg: #07110e;
  --scene-paper: #f6f2e8;
  --scene-muted: rgba(246, 242, 232, 0.64);
  --scene-panel: rgba(14, 22, 18, 0.74);
  --scene-panel-strong: rgba(16, 24, 19, 0.9);
  --scene-line: rgba(246, 242, 232, 0.16);
  --scene-axis: rgba(246, 242, 232, 0.34);
  --scene-text-stroke: rgba(3, 7, 6, 0.7);
  --ambient-a: rgba(89, 246, 255, 0.16);
  --ambient-b: rgba(255, 79, 216, 0.1);
  --ambient-c: rgba(241, 196, 83, 0.09);
  --ui-glass: rgba(4, 8, 7, 0.58);
  --ui-border: rgba(89, 246, 255, 0.22);
  --active-fill: linear-gradient(135deg, rgba(89, 246, 255, 0.95), rgba(143, 227, 136, 0.9));
  --control-strip: rgba(5, 12, 11, 0.54);
  --button-bg: rgba(5, 12, 11, 0.74);
  --button-hover: rgba(246, 242, 232, 0.11);
  --brand-bg: rgba(4, 8, 7, 0.42);
  --brand-core: #07100e;
  --card-bg: linear-gradient(145deg, rgba(89, 246, 255, 0.055), rgba(255, 79, 216, 0.025)), rgba(8, 14, 13, 0.84);
  --card-inset: rgba(246, 242, 232, 0.04);
  --mode-bg: linear-gradient(135deg, rgba(3, 7, 6, 0.94), rgba(11, 10, 18, 0.92)), radial-gradient(circle at 20% 18%, rgba(89, 246, 255, 0.12), transparent 28%);
  --thumb-bg: #0a0f0d;
  --tag-color: rgba(246, 242, 232, 0.75);
  --tag-border: rgba(246, 242, 232, 0.18);
  --soft-text: rgba(246, 242, 232, 0.72);
  --toast-bg: rgba(18, 24, 18, 0.96);
  --ambient-line: rgba(89, 246, 255, 0.24);
  --ambient-fill: rgba(89, 246, 255, 0.055);
  font-family: "Deck Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html[data-theme="command"] {
  --paper: #eaf4f0;
  --muted: #9ab0a8;
  --teal: #32f0b8;
  --gold: #f5d15b;
  --electric: #32f0b8;
  --hot: #ff6f61;
  --bg-start: #020605;
  --bg-mid: #08110e;
  --bg-end: #0f1d16;
  --stage-bg: #06110e;
  --ambient-a: rgba(50, 240, 184, 0.14);
  --ambient-b: rgba(245, 209, 91, 0.08);
  --ambient-c: rgba(255, 111, 97, 0.07);
  --ui-glass: rgba(4, 13, 10, 0.66);
  --ui-border: rgba(50, 240, 184, 0.24);
  --active-fill: linear-gradient(135deg, rgba(50, 240, 184, 0.95), rgba(245, 209, 91, 0.88));
}

html[data-theme="editorial"] {
  color-scheme: light;
  --paper: #fbf8ef;
  --muted: #d9d0be;
  --teal: #42d8d0;
  --gold: #f0c55a;
  --coral: #ff6f61;
  --electric: #70e9df;
  --hot: #f2769b;
  --bg-start: #17130f;
  --bg-mid: #2a2119;
  --bg-end: #1b2430;
  --stage-bg: #161712;
  --ambient-a: rgba(240, 197, 90, 0.14);
  --ambient-b: rgba(112, 233, 223, 0.08);
  --ambient-c: rgba(242, 118, 155, 0.08);
  --ui-glass: rgba(26, 21, 16, 0.62);
  --ui-border: rgba(240, 197, 90, 0.24);
  --active-fill: linear-gradient(135deg, rgba(251, 248, 239, 0.96), rgba(240, 197, 90, 0.9));
}

html[data-theme="minimal"] {
  --paper: #f2f5f3;
  --muted: #b8c2bd;
  --teal: #9dd9cf;
  --gold: #d8d1a2;
  --coral: #e8988f;
  --electric: #cbd8d3;
  --hot: #d9a6c6;
  --bg-start: #050606;
  --bg-mid: #0d1010;
  --bg-end: #121313;
  --stage-bg: #090c0b;
  --ambient-a: rgba(255, 255, 255, 0.06);
  --ambient-b: rgba(157, 217, 207, 0.04);
  --ambient-c: rgba(216, 209, 162, 0.04);
  --ui-glass: rgba(9, 10, 10, 0.68);
  --ui-border: rgba(255, 255, 255, 0.16);
  --active-fill: linear-gradient(135deg, rgba(242, 245, 243, 0.96), rgba(203, 216, 211, 0.86));
}

html[data-scheme="dark"] {
  color-scheme: dark;
}

html[data-scheme="light"] {
  color-scheme: light;
  --ink: #f0f4ee;
  --ink-2: #e6ece7;
  --panel: #ffffff;
  --panel-2: #eef4ef;
  --paper: #17211c;
  --muted: #51625a;
  --line: rgba(21, 34, 28, 0.16);
  --line-strong: rgba(21, 34, 28, 0.3);
  --teal: #008f84;
  --coral: #d65349;
  --gold: #a17100;
  --green: #2f8d4f;
  --violet: #7458d8;
  --electric: #008f84;
  --hot: #b33e83;
  --stage-bg: #edf3ef;
  --scene-paper: #16231d;
  --scene-muted: rgba(22, 35, 29, 0.66);
  --scene-panel: rgba(255, 255, 255, 0.7);
  --scene-panel-strong: rgba(255, 255, 255, 0.9);
  --scene-line: rgba(22, 35, 29, 0.16);
  --scene-axis: rgba(22, 35, 29, 0.34);
  --scene-text-stroke: rgba(242, 247, 244, 0.86);
  --ui-glass: rgba(255, 255, 255, 0.72);
  --ui-border: rgba(0, 143, 132, 0.22);
  --active-fill: linear-gradient(135deg, rgba(0, 143, 132, 0.95), rgba(245, 198, 79, 0.86));
  --control-strip: rgba(255, 255, 255, 0.62);
  --button-bg: rgba(255, 255, 255, 0.82);
  --button-hover: rgba(0, 143, 132, 0.09);
  --brand-bg: rgba(255, 255, 255, 0.72);
  --brand-core: #edf5f1;
  --card-bg: linear-gradient(145deg, rgba(0, 143, 132, 0.065), rgba(179, 62, 131, 0.025)), rgba(255, 255, 255, 0.78);
  --card-inset: rgba(22, 35, 29, 0.035);
  --mode-bg: linear-gradient(135deg, rgba(237, 243, 239, 0.97), rgba(246, 250, 247, 0.94)), radial-gradient(circle at 20% 18%, rgba(0, 143, 132, 0.11), transparent 30%);
  --thumb-bg: #f7fbf8;
  --tag-color: rgba(22, 35, 29, 0.72);
  --tag-border: rgba(22, 35, 29, 0.16);
  --soft-text: rgba(22, 35, 29, 0.72);
  --toast-bg: rgba(255, 255, 255, 0.96);
  --ambient-line: rgba(0, 143, 132, 0.24);
  --ambient-fill: rgba(245, 198, 79, 0.065);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  min-height: 100%;
  overflow: hidden;
  background: var(--stage-bg);
  color: var(--paper);
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
}

body::before,
body::after {
  display: none;
}

button {
  font: inherit;
}

.app-shell {
  width: 100vw;
  height: 100dvh;
  min-height: 100dvh;
  position: relative;
  overflow: hidden;
  display: block;
  isolation: isolate;
}

.command-layer {
  position: fixed;
  left: 12px;
  top: 12px;
  width: min(620px, calc(100vw - 32px));
  min-height: 0;
  display: block;
  pointer-events: none;
  z-index: 40;
  transition: opacity 180ms ease, transform 180ms ease;
}

.app-shell[data-clean="true"] {
  cursor: none;
}

.app-shell[data-clean="true"] .command-layer,
.app-shell[data-clean="true"] .slide-hud,
.app-shell[data-clean="true"] .presenter-panel,
.app-shell[data-clean="true"] .toast {
  display: none !important;
}

.app-shell[data-mode="presentation"] .command-layer {
  opacity: 0.78;
}

.app-shell[data-chrome="open"] .command-layer,
.command-layer:focus-within {
  opacity: 1;
}

.deck-brand {
  appearance: none;
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 9px;
  background: var(--brand-bg);
  backdrop-filter: blur(10px) saturate(1.14);
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.24), 0 0 22px color-mix(in srgb, var(--electric) 12%, transparent);
  pointer-events: auto;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(89, 246, 255, 0.72);
  border-radius: 8px;
  display: inline-grid;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(89, 246, 255, 0.24), rgba(255, 79, 216, 0.12)),
    var(--brand-core);
  box-shadow: inset 0 0 28px rgba(89, 246, 255, 0.2), 0 0 26px rgba(89, 246, 255, 0.16);
  position: relative;
}

.brand-copy {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  border: 1px solid currentColor;
  color: var(--teal);
}

.brand-mark::before {
  width: 18px;
  height: 18px;
  transform: rotate(45deg);
  filter: drop-shadow(0 0 8px rgba(89, 246, 255, 0.8));
}

.brand-mark::after {
  width: 5px;
  height: 5px;
  background: var(--gold);
  border-color: var(--gold);
}

.control-tray {
  width: min(620px, calc(100vw - 32px));
  margin-top: 10px;
  padding: 10px;
  border: 1px solid var(--ui-border);
  border-radius: 12px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--electric) 12%, transparent), color-mix(in srgb, var(--hot) 5%, transparent)),
    var(--ui-glass);
  box-shadow:
    0 0 0 1px var(--card-inset) inset,
    0 18px 62px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(14px) saturate(1.22);
  pointer-events: auto;
  transform-origin: 26px -6px;
  transition: opacity 170ms ease, transform 170ms ease, visibility 170ms ease;
}

.app-shell[data-chrome="closed"] .control-tray {
  opacity: 0;
  transform: translateY(-8px) scale(0.985);
  visibility: hidden;
  pointer-events: none;
}

.app-shell[data-chrome="open"] .control-tray {
  opacity: 1;
  transform: translateY(0) scale(1);
  visibility: visible;
}

.mode-switch,
.theme-switch,
.scheme-switch,
.background-switch {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  padding: 3px;
  background: var(--control-strip);
  border: 1px solid color-mix(in srgb, var(--electric) 18%, transparent);
  border-radius: 8px;
}

.mode-switch button,
.theme-switch button,
.scheme-switch button,
.background-switch button,
.icon-button,
.explain-button,
.clean-toggle {
  border: 0;
  color: var(--paper);
  background: transparent;
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease, color 180ms ease, border-color 180ms ease;
}

.mode-switch button,
.theme-switch button,
.scheme-switch button,
.background-switch button {
  min-height: 38px;
  padding: 0 11px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
}

.theme-switch button,
.scheme-switch button {
  min-height: 32px;
  padding: 0 9px;
  font-size: 11px;
  color: var(--muted);
}

.theme-switch,
.scheme-switch,
.background-switch {
  margin-top: 8px;
}

.mode-switch button[aria-selected="true"],
.theme-switch button[aria-selected="true"],
.scheme-switch button[aria-selected="true"],
.background-switch button[aria-selected="true"] {
  background: var(--active-fill);
  color: #06100d;
  box-shadow: 0 0 22px rgba(89, 246, 255, 0.25);
}

.mode-icon {
  font-size: 15px;
  line-height: 1;
}

.transport {
  display: flex;
  justify-content: flex-start;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin-top: 9px;
}

.icon-button,
.explain-button,
.clean-toggle {
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid var(--ui-border);
  background: var(--button-bg);
  box-shadow: inset 0 0 18px rgba(89, 246, 255, 0.035);
}

.icon-button {
  width: 42px;
  font-size: 24px;
  line-height: 1;
}

.build-button {
  color: var(--teal);
}

.explain-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border-color: rgba(241, 196, 83, 0.42);
  color: var(--gold);
  background: linear-gradient(135deg, rgba(241, 196, 83, 0.14), rgba(255, 79, 216, 0.08));
  box-shadow: 0 0 24px rgba(241, 196, 83, 0.11);
}

.clean-toggle {
  min-width: 66px;
  padding: 0 11px;
  color: var(--soft-text);
  font-size: 13px;
}

.clean-toggle[aria-pressed="true"] {
  color: #06100d;
  border-color: rgba(143, 227, 136, 0.7);
  background: linear-gradient(135deg, rgba(143, 227, 136, 0.96), rgba(89, 246, 255, 0.88));
  box-shadow: 0 0 26px rgba(143, 227, 136, 0.18);
}

.ambient-toggle[aria-pressed="true"] {
  border-color: color-mix(in srgb, var(--electric) 66%, transparent);
  background: linear-gradient(135deg, color-mix(in srgb, var(--electric) 88%, white 8%), color-mix(in srgb, var(--gold) 74%, white 8%));
  box-shadow: 0 0 24px color-mix(in srgb, var(--electric) 18%, transparent);
}

.bundle-toggle[aria-pressed="true"] {
  color: #06100d;
  border-color: color-mix(in srgb, var(--hot) 48%, transparent);
  background: linear-gradient(135deg, color-mix(in srgb, var(--hot) 70%, white 18%), color-mix(in srgb, var(--electric) 72%, white 12%));
  box-shadow: 0 0 24px color-mix(in srgb, var(--hot) 18%, transparent);
}

.export-toggle {
  border-color: color-mix(in srgb, var(--gold) 46%, transparent);
  color: var(--gold);
}

.mode-switch button:hover,
.theme-switch button:hover,
.scheme-switch button:hover,
.background-switch button:hover,
.icon-button:hover,
.explain-button:hover,
.clean-toggle:hover {
  transform: translateY(-1px);
  background: var(--button-hover);
}

.workspace {
  width: 100vw;
  height: 100dvh;
  min-height: 100dvh;
  position: fixed;
  inset: 0;
  display: block;
  padding: 0;
  z-index: 1;
}

.stage-shell {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  transition: width 220ms ease, height 220ms ease, transform 220ms ease, filter 220ms ease;
}

.stage-ratio {
  position: relative;
  width: 100%;
  height: 100%;
  background: transparent;
  overflow: hidden;
}

.stage-ratio::before,
.stage-ratio::after {
  display: none;
}

.ambient-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 240ms ease;
}

.app-shell[data-ambient="on"] .ambient-canvas {
  opacity: 0.92;
}

html[data-scheme="dark"] .ambient-canvas {
  mix-blend-mode: screen;
}

html[data-scheme="light"] .ambient-canvas {
  mix-blend-mode: multiply;
}

.app-shell[data-background="orbits"] .ambient-canvas {
  opacity: 0.84;
}

.app-shell[data-background="field"] .ambient-canvas {
  opacity: 0.78;
}

.app-shell[data-scheme="light"][data-background="mesh"] .ambient-canvas {
  opacity: 0.72;
}

.app-shell[data-scheme="light"][data-background="orbits"] .ambient-canvas {
  opacity: 0.66;
}

.app-shell[data-scheme="light"][data-background="field"] .ambient-canvas {
  opacity: 0.62;
}

#deckSvg {
  display: block;
  position: relative;
  z-index: 1;
  width: 100vw;
  height: 100dvh;
  background: var(--stage-bg);
  font-family: "Deck Sans", ui-sans-serif, system-ui, sans-serif;
  overflow: hidden;
  contain: paint;
}

#deckSvg .scene-bg {
  fill: var(--stage-bg);
}

.app-shell[data-ambient="on"] #deckSvg {
  background: transparent;
}

.app-shell[data-ambient="on"] #deckSvg .scene-bg {
  opacity: 0.78;
}

#deckSvg .chart-panel {
  fill: var(--scene-panel);
  stroke: var(--scene-line);
  stroke-width: 1.8px;
}

#deckSvg .chart-panel-depth {
  fill: color-mix(in srgb, var(--stage-bg) 58%, transparent);
  stroke: color-mix(in srgb, var(--electric) 38%, transparent);
  stroke-width: 1px;
  opacity: 0.66;
}

#deckSvg .chart-axis text,
#deckSvg .chart-axis-title,
#deckSvg .chart-legend text {
  fill: var(--scene-muted);
  font-weight: 620;
  paint-order: stroke;
  stroke: var(--scene-text-stroke);
  stroke-width: 2px;
}

#deckSvg .chart-axis line,
#deckSvg .chart-axis path {
  stroke: var(--scene-axis);
}

#deckSvg .chart-axis-title {
  font-weight: 700;
}

#deckSvg .chart-control-rail {
  fill: var(--scene-panel-strong);
  stroke: var(--scene-line);
}

#deckSvg .hover-card-bg,
#deckSvg .callout rect {
  fill: var(--scene-panel-strong);
  stroke: var(--scene-line);
}

html[data-scheme="light"] #deckSvg .chart-panel,
html[data-scheme="light"] #deckSvg .metric-card-bg,
html[data-scheme="light"] #deckSvg .legend-panel,
html[data-scheme="light"] #deckSvg .detail-panel,
html[data-scheme="light"] #deckSvg .hover-card-bg,
html[data-scheme="light"] #deckSvg .callout rect {
  fill: var(--scene-panel);
  stroke: var(--scene-line);
}

.stage-shell.is-transitioning #deckSvg {
  animation: slide-enter-forward 560ms cubic-bezier(0.2, 0.8, 0.18, 1) both;
}

.stage-shell[data-transition="back"].is-transitioning #deckSvg {
  animation-name: slide-enter-back;
}

.slide-hud {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: block;
  height: 5px;
  pointer-events: none;
  color: rgba(246, 242, 232, 0.88);
  z-index: 5;
}

@keyframes slide-enter-forward {
  0% {
    opacity: 0;
    transform: translateX(34px) scale(0.992);
    filter: blur(8px) saturate(1.2);
  }
  58% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
    filter: blur(0) saturate(1);
  }
}

@keyframes slide-enter-back {
  0% {
    opacity: 0;
    transform: translateX(-34px) scale(0.992);
    filter: blur(8px) saturate(1.2);
  }
  58% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
    filter: blur(0) saturate(1);
  }
}

.slide-hud div:first-child {
  display: none;
}

.slide-hud div:last-child {
  display: block;
  width: 100%;
}

.progress-track {
  height: 3px;
  border-radius: 0;
  background: rgba(89, 246, 255, 0.08);
  overflow: hidden;
}

.build-progress {
  margin-top: 0;
  height: 2px;
  background: rgba(73, 215, 196, 0.13);
}

.progress-track span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--gold), var(--coral));
  transform-origin: left center;
  transform: scaleX(0.16);
}

.build-progress span {
  background: linear-gradient(90deg, var(--teal), var(--green));
  transform: scaleX(0);
}

.mode-panel {
  display: none;
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  overflow: auto;
  overflow-x: hidden;
  padding: 82px 28px 28px;
  background: var(--mode-bg);
  backdrop-filter: blur(9px);
  scrollbar-color: var(--line-strong) transparent;
  z-index: 25;
}

.app-shell[data-mode="preview"] .stage-shell {
  display: none;
}

.app-shell[data-mode="preview"] .preview-panel {
  display: block;
}

.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1760px;
  margin: 0 auto 18px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--card-bg);
  box-shadow: inset 0 0 0 1px var(--card-inset);
}

.preview-toolbar small {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.preview-toolbar strong,
.preview-toolbar span {
  color: var(--paper);
  font-weight: 760;
}

.preview-toolbar span {
  color: var(--gold);
  font-size: 13px;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
  max-width: 1760px;
  margin: 0 auto;
  padding: 2px;
}

.preview-card,
.structure-card,
.presenter-card {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--card-bg);
  box-shadow: 0 14px 48px rgba(0, 0, 0, 0.2), inset 0 0 0 1px var(--card-inset);
  contain: paint;
}

.preview-card {
  text-align: left;
  color: var(--paper);
  cursor: pointer;
  padding: 0;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr;
}

.preview-card[aria-current="true"] {
  border-color: rgba(89, 246, 255, 0.72);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--electric) 34%, transparent), 0 18px 58px rgba(0, 0, 0, 0.22), 0 0 34px color-mix(in srgb, var(--electric) 12%, transparent);
}

.preview-card:focus-visible,
.structure-card:focus-visible,
.mode-switch button:focus-visible,
.theme-switch button:focus-visible,
.scheme-switch button:focus-visible,
.background-switch button:focus-visible,
.icon-button:focus-visible,
.explain-button:focus-visible,
.clean-toggle:focus-visible,
.chrome-toggle:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.preview-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--thumb-bg);
  display: block;
  border-bottom: 1px solid rgba(89, 246, 255, 0.12);
}

.preview-status {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 9px;
}

.preview-status span {
  border: 1px solid var(--tag-border);
  border-radius: 999px;
  color: var(--tag-color);
  padding: 3px 7px;
  font-size: 10px;
}

.preview-meta {
  padding: 12px 13px 14px;
  min-height: 116px;
  display: grid;
  align-content: start;
}

.preview-kicker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.preview-meta small {
  color: var(--muted);
  display: block;
  margin-bottom: 0;
}

.preview-kind {
  border: 1px solid color-mix(in srgb, var(--electric) 35%, transparent);
  border-radius: 999px;
  color: var(--electric);
  padding: 3px 7px;
  font-size: 10px;
  font-weight: 780;
  text-transform: uppercase;
}

.preview-meta strong {
  display: block;
  font-size: 15px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.structure-layout {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(560px, 1fr);
  gap: 18px;
  min-height: calc(100dvh - 112px);
  max-width: 1680px;
  margin: 0 auto;
}

.structure-map,
.structure-list {
  min-height: 0;
}

.structure-map {
  border: 1px solid var(--ui-border);
  border-radius: 6px;
  overflow: hidden;
  background: var(--thumb-bg);
  box-shadow: 0 0 38px color-mix(in srgb, var(--electric) 8%, transparent);
  position: sticky;
  top: 0;
  height: calc(100dvh - 112px);
}

.structure-map svg {
  width: 100%;
  height: 100%;
  min-height: 680px;
  display: block;
}

.structure-list {
  display: grid;
  gap: 12px;
  align-content: start;
  padding-bottom: 20px;
}

.structure-card {
  padding: 15px;
  text-align: left;
  color: var(--paper);
  cursor: pointer;
  font: inherit;
}

.structure-card[aria-current="true"] {
  border-color: rgba(89, 246, 255, 0.72);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--electric) 34%, transparent), 0 18px 58px rgba(0, 0, 0, 0.22);
}

.structure-card small,
.presenter-card span {
  color: var(--muted);
  font-size: 12px;
  display: block;
  margin-bottom: 6px;
}

.structure-card strong {
  display: block;
  font-size: 17px;
  margin-bottom: 7px;
}

.structure-card p,
.presenter-card p {
  color: var(--soft-text);
  line-height: 1.45;
  margin: 0;
  overflow-wrap: anywhere;
}

.tag-row,
.signal-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.tag {
  border: 1px solid var(--tag-border);
  color: var(--tag-color);
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
}

.presenter-panel {
  display: none;
}

.app-shell[data-mode="presenter"] .workspace {
  display: block;
}

.app-shell[data-mode="presenter"] .stage-shell {
  width: 100vw;
  height: 100dvh;
}

.app-shell[data-mode="presenter"] .presenter-panel {
  display: grid;
  position: fixed;
  top: 84px;
  right: 18px;
  width: min(380px, calc(100vw - 36px));
  gap: 12px;
  align-content: start;
  max-height: calc(100dvh - 112px);
  overflow: auto;
  overflow-x: hidden;
  z-index: 32;
  pointer-events: auto;
}

.presenter-card {
  padding: 15px;
  border-color: var(--ui-border);
  backdrop-filter: blur(10px);
}

.presenter-card strong {
  display: block;
  font-size: 18px;
  line-height: 1.25;
  margin-bottom: 8px;
}

.timer-card strong {
  font-size: 42px;
  color: var(--electric);
  text-shadow: 0 0 24px rgba(89, 246, 255, 0.28);
  margin: 0;
}

.signal-row {
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding-top: 9px;
}

.signal-row b {
  font-size: 13px;
}

.signal-row i {
  color: var(--electric);
  font-style: normal;
}

.toast,
.dependency-error {
  position: fixed;
  z-index: 60;
  right: 18px;
  bottom: 18px;
  max-width: min(420px, calc(100vw - 36px));
  padding: 12px 14px;
  border: 1px solid rgba(241, 196, 83, 0.38);
  border-radius: 6px;
  background: var(--toast-bg);
  box-shadow: var(--shadow);
  color: var(--paper);
}

.dependency-error {
  left: 18px;
  right: 18px;
  bottom: 18px;
  max-width: none;
  text-align: center;
}

.svg-label {
  font-family: inherit;
  letter-spacing: 0;
}

#deckSvg text {
  paint-order: stroke fill;
  stroke: var(--scene-text-stroke);
  stroke-width: 1.15px;
  stroke-linejoin: round;
}

html[data-scheme="light"] #deckSvg text[fill="#f6f2e8"],
html[data-scheme="light"] #deckSvg text[fill="rgba(246,242,232,0.78)"],
html[data-scheme="light"] #deckSvg text[fill="rgba(246,242,232,0.75)"],
html[data-scheme="light"] #deckSvg text[fill="rgba(246,242,232,0.74)"],
html[data-scheme="light"] #deckSvg text[fill="rgba(246,242,232,0.72)"],
html[data-scheme="light"] #deckSvg text[fill="rgba(246,242,232,0.68)"],
html[data-scheme="light"] #deckSvg text[fill="rgba(246,242,232,0.66)"],
html[data-scheme="light"] #deckSvg text[fill="rgba(246,242,232,0.64)"],
html[data-scheme="light"] #deckSvg text[fill="rgba(246,242,232,0.62)"],
html[data-scheme="light"] #deckSvg text[fill="rgba(246,242,232,0.56)"],
html[data-scheme="light"] #deckSvg text[fill="rgba(246,242,232,0.52)"],
html[data-scheme="light"] #deckSvg text[fill="rgba(246,242,232,0.58)"] {
  fill: var(--scene-paper);
}

html[data-scheme="light"] #deckSvg rect[fill="rgba(18,24,18,0.96)"],
html[data-scheme="light"] #deckSvg rect[fill="rgba(18,24,18,0.94)"],
html[data-scheme="light"] #deckSvg rect[fill="rgba(18,24,18,0.93)"],
html[data-scheme="light"] #deckSvg rect[fill="rgba(18,24,18,0.9)"],
html[data-scheme="light"] #deckSvg rect[fill="rgba(18,24,18,0.86)"],
html[data-scheme="light"] #deckSvg rect[fill="rgba(18,24,18,0.84)"],
html[data-scheme="light"] #deckSvg rect[fill="rgba(18,24,18,0.82)"],
html[data-scheme="light"] #deckSvg rect[fill="rgba(18,24,18,0.78)"],
html[data-scheme="light"] #deckSvg rect[fill="rgba(18,24,18,0.75)"],
html[data-scheme="light"] #deckSvg rect[fill="rgba(18,24,18,0.72)"] {
  fill: var(--scene-panel-strong);
}

html[data-scheme="light"] #deckSvg rect[fill="rgba(246,242,232,0.08)"],
html[data-scheme="light"] #deckSvg rect[fill="rgba(246,242,232,0.07)"],
html[data-scheme="light"] #deckSvg rect[fill="rgba(246,242,232,0.06)"],
html[data-scheme="light"] #deckSvg rect[fill="rgba(246,242,232,0.045)"],
html[data-scheme="light"] #deckSvg rect[fill="rgba(246,242,232,0.04)"] {
  fill: rgba(255, 255, 255, 0.58);
}

html[data-scheme="light"] #deckSvg circle[fill="rgba(246,242,232,0.035)"] {
  fill: rgba(22, 35, 29, 0.035);
}

html[data-scheme="light"] #deckSvg [stroke="rgba(246,242,232,0.28)"],
html[data-scheme="light"] #deckSvg [stroke="rgba(246,242,232,0.24)"],
html[data-scheme="light"] #deckSvg [stroke="rgba(246,242,232,0.22)"],
html[data-scheme="light"] #deckSvg [stroke="rgba(246,242,232,0.2)"],
html[data-scheme="light"] #deckSvg [stroke="rgba(246,242,232,0.18)"],
html[data-scheme="light"] #deckSvg [stroke="rgba(246,242,232,0.16)"],
html[data-scheme="light"] #deckSvg [stroke="rgba(246,242,232,0.15)"],
html[data-scheme="light"] #deckSvg [stroke="rgba(246,242,232,0.14)"],
html[data-scheme="light"] #deckSvg [stroke="rgba(246,242,232,0.12)"] {
  stroke: var(--scene-line);
}

html[data-scheme="light"] #deckSvg [stroke="rgba(246,242,232,0.36)"] {
  stroke: rgba(22, 35, 29, 0.24);
}

#deckSvg .callout text {
  stroke: transparent;
  stroke-width: 0;
  paint-order: normal;
}

.svg-button {
  cursor: pointer;
}

.svg-button:focus-visible {
  outline: none;
}

.svg-button:focus-visible rect,
.svg-button:focus-visible circle,
.svg-button:focus-visible path {
  stroke: #f1c453 !important;
  stroke-width: 4px;
}

.svg-button rect,
.svg-button path,
.svg-button circle {
  transition: opacity 160ms ease, stroke 160ms ease, fill 160ms ease;
}

.svg-button:hover rect {
  stroke: color-mix(in srgb, var(--electric) 44%, var(--scene-paper) 24%);
}

.app-shell[data-pdf-export="true"] .command-layer,
.app-shell[data-pdf-export="true"] .workspace,
.app-shell[data-pdf-export="true"] .toast,
.app-shell[data-pdf-export="true"] .dependency-error {
  display: none !important;
}

.pdf-export-root {
  position: fixed;
  inset: 0;
  z-index: 200;
  overflow: auto;
  background: var(--stage-bg);
  color: var(--paper);
  font-family: "Deck Sans", ui-sans-serif, system-ui, sans-serif;
  padding: 82px 28px 36px;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

.pdf-export-toolbar {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100vw - 32px);
  min-height: 48px;
  padding: 8px 10px 8px 14px;
  border: 1px solid var(--ui-border);
  border-radius: 12px;
  background: var(--ui-glass);
  color: var(--paper);
  box-shadow: 0 18px 62px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(14px) saturate(1.18);
}

.pdf-export-toolbar strong {
  font-size: 14px;
  font-weight: 860;
  color: var(--gold);
  white-space: nowrap;
}

.pdf-export-toolbar span {
  color: var(--soft-text);
  font-size: 12px;
  white-space: nowrap;
}

.pdf-export-toolbar button {
  border: 1px solid var(--ui-border);
  border-radius: 8px;
  min-height: 32px;
  padding: 0 11px;
  color: var(--paper);
  background: var(--button-bg);
  cursor: pointer;
}

.pdf-export-pages {
  display: grid;
  gap: 28px;
  justify-items: center;
}

.pdf-export-page {
  width: min(100%, 1440px);
  aspect-ratio: 16 / 9;
  background: var(--stage-bg);
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.38);
  overflow: hidden;
  break-after: page;
  page-break-after: always;
}

.pdf-export-page:last-child {
  break-after: auto;
  page-break-after: auto;
}

.pdf-export-page svg {
  display: block;
  width: 100%;
  height: 100%;
  font-family: "Deck Sans", ui-sans-serif, system-ui, sans-serif;
  background: var(--stage-bg);
  overflow: hidden;
}

@page {
  size: 16in 9in;
  margin: 0;
}

@media print {
  html,
  body {
    width: 16in;
    height: auto;
    min-height: 0;
    overflow: visible !important;
    background: var(--stage-bg) !important;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .app-shell,
  .command-layer,
  .workspace,
  .toast,
  .dependency-error,
  .pdf-export-toolbar {
    display: none !important;
  }

  .pdf-export-root {
    display: block !important;
    position: static !important;
    inset: auto !important;
    z-index: auto !important;
    width: 16in;
    height: auto;
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
    background: var(--stage-bg) !important;
  }

  .pdf-export-pages {
    display: block !important;
    gap: 0 !important;
  }

  .pdf-export-page {
    width: 16in !important;
    height: 9in !important;
    aspect-ratio: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    overflow: hidden !important;
    break-after: page;
    page-break-after: always;
    background: var(--stage-bg) !important;
  }

  .pdf-export-page:last-child {
    break-after: auto;
    page-break-after: auto;
  }

  .pdf-export-page svg {
    width: 16in !important;
    height: 9in !important;
  }
}

@media (max-width: 980px) {
  body {
    overflow: hidden;
  }

  .app-shell {
    min-height: 100vh;
  }

  .command-layer {
    position: fixed;
    left: 10px;
    top: 8px;
    width: min(560px, calc(100vw - 20px));
    min-height: 0;
    opacity: 1 !important;
    transform: none !important;
  }

  .control-tray {
    width: min(560px, calc(100vw - 20px));
  }

  .transport,
  .mode-switch,
  .theme-switch,
  .scheme-switch,
  .background-switch {
    justify-content: stretch;
    width: 100%;
  }

  .mode-switch button,
  .theme-switch button,
  .scheme-switch button,
  .background-switch button,
  .explain-button,
  .icon-button,
  .clean-toggle {
    flex: 1;
  }

  .workspace {
    min-height: 100dvh;
    height: 100dvh;
    padding: 0;
  }

  .stage-shell {
    width: 100vw;
    height: 100dvh;
  }

  .mode-panel {
    width: 100vw;
    height: 100dvh;
    padding: 78px 12px 20px;
  }

  .structure-layout,
  .app-shell[data-mode="presenter"] .workspace {
    grid-template-columns: 1fr;
  }

  .app-shell[data-mode="presenter"] .presenter-panel {
    top: auto;
    left: 12px;
    right: 12px;
    bottom: 12px;
    width: auto;
    max-height: 42dvh;
  }
}

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