:root {
  --page-max-width: 1320px;
  --glass-blur: 18px;
  --panel-radius: 26px;
  --panel-rgb: 255, 251, 245;
  --panel-strong-rgb: 255, 250, 242;
  --surface-rgb: 255, 255, 255;
  --panel-alpha: 0.8;
  --panel-strong-alpha: 0.94;
  --surface-soft-alpha: 0.52;
  --surface-mid-alpha: 0.58;
  --surface-strong-alpha: 0.92;
  --status-alpha: 0.56;
  --ink: #1b2a32;
  --muted: #56646b;
  --teal: #1b7176;
  --amber: #c26a2c;
  --sand: #c5a56d;
  --rust: #8c3f19;
  --moss: #5f7445;
  --plum: #5d5878;
  --track: rgba(27, 42, 50, 0.09);
  --shadow: 0 22px 55px rgba(41, 32, 17, 0.14);
  --page-bg-1: radial-gradient(circle at top left, rgba(194, 106, 44, 0.18), transparent 28%);
  --page-bg-2: radial-gradient(circle at 84% 12%, rgba(27, 113, 118, 0.18), transparent 24%);
  --page-bg-3: linear-gradient(180deg, #fbf6ed 0%, #f2ead9 100%);
  --grid-opacity: 0.22;
  --canvas-bg-top: rgba(255, 255, 255, 0.78);
  --canvas-bg-bottom: rgba(250, 244, 235, 0.68);
  --demo-bg-top: rgba(255, 255, 255, 0.82);
  --demo-bg-bottom: rgba(255, 251, 245, 0.7);
  --demo-stage-fill: rgba(255, 255, 255, 0.65);
  --demo-stage-stroke: rgba(27, 42, 50, 0.08);
  --demo-barrel-inner-fill: rgba(255, 255, 255, 0.45);
  --demo-barrel-inner-stroke: rgba(255, 255, 255, 0.42);
  --preset-chip-bg-top: rgba(255, 255, 255, 0.94);
  --preset-chip-bg-bottom: rgba(231, 214, 184, 0.95);
  --preset-chip-border: rgba(27, 42, 50, 0.08);
  --preset-chip-shadow: 0 8px 16px rgba(41, 32, 17, 0.08);
  --preset-chip-hover-shadow: 0 12px 24px rgba(27, 42, 50, 0.12);
  --preset-chip-active-start: var(--teal);
  --preset-chip-active-end: #15575b;
  --preset-chip-active-shadow: 0 6px 12px rgba(27, 113, 118, 0.12);
  --preset-chip-active-highlight: rgba(255, 255, 255, 0.08);
  --scene-sky-top: #a9d6ef;
  --scene-sky-bottom: #f7d9ae;
  --scene-ground-top: #92b57a;
  --scene-ground-bottom: #4f633f;
  --scene-glow: rgba(255, 244, 208, 0.84);
  --scene-path: #f4e6d2;
  --scene-mountain-back: #5f7f9c;
  --scene-mountain-front: #3e586d;
  --scene-city: #334854;
  --scene-subject: #202a36;
  --scene-subject-accent: #e8f5ff;
  --scene-shadow-color: rgba(24, 32, 40, 0.22);
  --scene-foreground: #305332;
  --scene-foreground-alt: #607b46;
  --scene-haze: rgba(255, 255, 255, 0.18);
  --scene-zone-highlight: rgba(27, 42, 50, 0.06);
  --scene-zone-stroke: rgba(27, 42, 50, 0.12);
}

body[data-theme="slate"] {
  --panel-rgb: 243, 247, 252;
  --panel-strong-rgb: 248, 251, 255;
  --surface-rgb: 255, 255, 255;
  --ink: #182636;
  --muted: #5b6877;
  --teal: #256f88;
  --amber: #bf6c48;
  --sand: #8aa1bf;
  --rust: #935037;
  --moss: #5d738a;
  --plum: #67719f;
  --track: rgba(24, 38, 54, 0.11);
  --page-bg-1: radial-gradient(circle at top left, rgba(86, 116, 162, 0.18), transparent 30%);
  --page-bg-2: radial-gradient(circle at 84% 12%, rgba(37, 111, 136, 0.16), transparent 24%);
  --page-bg-3: linear-gradient(180deg, #f3f7fb 0%, #e7edf5 100%);
}

body[data-theme="forest"] {
  --panel-rgb: 247, 251, 244;
  --panel-strong-rgb: 252, 255, 250;
  --surface-rgb: 255, 255, 253;
  --ink: #1d2d24;
  --muted: #57695f;
  --teal: #236b67;
  --amber: #b56c34;
  --sand: #8aa26b;
  --rust: #8e4f22;
  --moss: #567347;
  --plum: #5f687b;
  --track: rgba(29, 45, 36, 0.09);
  --page-bg-1: radial-gradient(circle at top left, rgba(181, 108, 52, 0.16), transparent 28%);
  --page-bg-2: radial-gradient(circle at 84% 12%, rgba(35, 107, 103, 0.18), transparent 24%);
  --page-bg-3: linear-gradient(180deg, #f7fbf4 0%, #e8f0e5 100%);
}

body[data-theme="midnight"] {
  --panel-rgb: 16, 23, 35;
  --panel-strong-rgb: 21, 30, 45;
  --surface-rgb: 28, 39, 56;
  --ink: #e8f1ff;
  --muted: #98abc4;
  --teal: #67bfd1;
  --amber: #ea9151;
  --sand: #7c97c6;
  --rust: #cc7650;
  --moss: #7c9d74;
  --plum: #8e89c4;
  --track: rgba(232, 241, 255, 0.08);
  --shadow: 0 28px 68px rgba(3, 7, 16, 0.58);
  --page-bg-1: radial-gradient(circle at 14% 10%, rgba(91, 164, 202, 0.16), transparent 26%);
  --page-bg-2: radial-gradient(circle at 84% 18%, rgba(234, 145, 81, 0.16), transparent 24%);
  --page-bg-3: linear-gradient(180deg, #0b1220 0%, #111a2c 100%);
  --grid-opacity: 0.1;
  --canvas-bg-top: rgba(28, 39, 57, 0.92);
  --canvas-bg-bottom: rgba(16, 24, 37, 0.9);
  --demo-bg-top: rgba(24, 34, 51, 0.88);
  --demo-bg-bottom: rgba(12, 19, 30, 0.84);
  --demo-stage-fill: rgba(233, 241, 255, 0.06);
  --demo-stage-stroke: rgba(233, 241, 255, 0.08);
  --demo-barrel-inner-fill: rgba(233, 241, 255, 0.09);
  --demo-barrel-inner-stroke: rgba(233, 241, 255, 0.12);
  --preset-chip-bg-top: rgba(45, 61, 86, 0.96);
  --preset-chip-bg-bottom: rgba(19, 29, 44, 0.98);
  --preset-chip-border: rgba(232, 241, 255, 0.12);
  --preset-chip-shadow: 0 12px 24px rgba(2, 6, 16, 0.34);
  --preset-chip-hover-shadow: 0 16px 30px rgba(2, 6, 16, 0.42);
  --preset-chip-active-end: #2f5d84;
  --preset-chip-active-shadow: 0 8px 16px rgba(2, 6, 16, 0.36);
  --preset-chip-active-highlight: rgba(255, 255, 255, 0.12);
  --scene-sky-top: #12253f;
  --scene-sky-bottom: #223754;
  --scene-ground-top: #28404c;
  --scene-ground-bottom: #0f1b24;
  --scene-glow: rgba(103, 191, 209, 0.26);
  --scene-path: #8da6c0;
  --scene-mountain-back: #7e9ec2;
  --scene-mountain-front: #4d6a88;
  --scene-city: #b5d2e9;
  --scene-subject: #e5f0ff;
  --scene-subject-accent: #67bfd1;
  --scene-shadow-color: rgba(2, 8, 14, 0.48);
  --scene-foreground: #579691;
  --scene-foreground-alt: #947452;
  --scene-haze: rgba(232, 241, 255, 0.08);
  --scene-zone-highlight: rgba(232, 241, 255, 0.08);
  --scene-zone-stroke: rgba(232, 241, 255, 0.18);
}

body[data-theme="ember"] {
  --panel-rgb: 30, 18, 18;
  --panel-strong-rgb: 38, 24, 24;
  --surface-rgb: 52, 31, 30;
  --ink: #fff0e7;
  --muted: #d3aea2;
  --teal: #7fc0bb;
  --amber: #ff9d5a;
  --sand: #d8a05d;
  --rust: #f0724c;
  --moss: #94a86a;
  --plum: #b188a4;
  --track: rgba(255, 240, 231, 0.08);
  --shadow: 0 28px 68px rgba(13, 4, 4, 0.56);
  --page-bg-1: radial-gradient(circle at 16% 14%, rgba(240, 114, 76, 0.18), transparent 24%);
  --page-bg-2: radial-gradient(circle at 82% 12%, rgba(255, 157, 90, 0.14), transparent 22%);
  --page-bg-3: linear-gradient(180deg, #140c0d 0%, #241415 100%);
  --grid-opacity: 0.08;
  --canvas-bg-top: rgba(58, 33, 31, 0.9);
  --canvas-bg-bottom: rgba(28, 18, 18, 0.88);
  --demo-bg-top: rgba(48, 29, 28, 0.9);
  --demo-bg-bottom: rgba(24, 16, 16, 0.85);
  --demo-stage-fill: rgba(255, 240, 231, 0.05);
  --demo-stage-stroke: rgba(255, 240, 231, 0.08);
  --demo-barrel-inner-fill: rgba(255, 240, 231, 0.08);
  --demo-barrel-inner-stroke: rgba(255, 240, 231, 0.12);
  --scene-sky-top: #4a231d;
  --scene-sky-bottom: #8f4a2b;
  --scene-ground-top: #5c4428;
  --scene-ground-bottom: #201512;
  --scene-glow: rgba(255, 157, 90, 0.24);
  --scene-path: #ffdec0;
  --scene-mountain-back: #b46f50;
  --scene-mountain-front: #704031;
  --scene-city: #ffceb0;
  --scene-subject: #ffede3;
  --scene-subject-accent: #ff9d5a;
  --scene-shadow-color: rgba(10, 4, 4, 0.5);
  --scene-foreground: #a06a42;
  --scene-foreground-alt: #829153;
  --scene-haze: rgba(255, 240, 231, 0.08);
}

body[data-theme="aurora"] {
  --panel-rgb: 15, 25, 26;
  --panel-strong-rgb: 20, 33, 35;
  --surface-rgb: 28, 43, 46;
  --ink: #e8fffb;
  --muted: #9cbdb8;
  --teal: #59d2bb;
  --amber: #f4b15f;
  --sand: #9ec3a3;
  --rust: #dc8260;
  --moss: #7cbf88;
  --plum: #8ea7c7;
  --track: rgba(232, 255, 251, 0.08);
  --shadow: 0 28px 68px rgba(1, 8, 10, 0.58);
  --page-bg-1: radial-gradient(circle at 18% 12%, rgba(89, 210, 187, 0.16), transparent 26%);
  --page-bg-2: radial-gradient(circle at 82% 18%, rgba(244, 177, 95, 0.14), transparent 24%);
  --page-bg-3: linear-gradient(180deg, #091315 0%, #112024 100%);
  --grid-opacity: 0.09;
  --canvas-bg-top: rgba(27, 45, 47, 0.9);
  --canvas-bg-bottom: rgba(14, 27, 29, 0.88);
  --demo-bg-top: rgba(24, 39, 42, 0.9);
  --demo-bg-bottom: rgba(12, 23, 25, 0.85);
  --demo-stage-fill: rgba(232, 255, 251, 0.05);
  --demo-stage-stroke: rgba(232, 255, 251, 0.08);
  --demo-barrel-inner-fill: rgba(232, 255, 251, 0.08);
  --demo-barrel-inner-stroke: rgba(232, 255, 251, 0.12);
  --scene-sky-top: #153037;
  --scene-sky-bottom: #28525b;
  --scene-ground-top: #345946;
  --scene-ground-bottom: #0f1f20;
  --scene-glow: rgba(89, 210, 187, 0.22);
  --scene-path: #dcf6ec;
  --scene-mountain-back: #6da8ad;
  --scene-mountain-front: #3e6560;
  --scene-city: #ceefe8;
  --scene-subject: #e9fffa;
  --scene-subject-accent: #59d2bb;
  --scene-shadow-color: rgba(1, 8, 10, 0.46);
  --scene-foreground: #5eb489;
  --scene-foreground-alt: #cca462;
  --scene-haze: rgba(232, 255, 251, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Avenir Next", "Trebuchet MS", "Gill Sans", sans-serif;
  background: var(--page-bg-1), var(--page-bg-2), var(--page-bg-3);
}

body.menu-open {
  overflow: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.28) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.24) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at center, black 30%, transparent 100%);
  opacity: var(--grid-opacity);
}

.page-shell {
  width: min(var(--page-max-width), calc(100% - 2rem));
  margin: 0 auto;
  padding: 1rem 0 2.4rem;
}

.panel {
  position: relative;
  overflow: hidden;
  background: rgba(var(--panel-rgb), var(--panel-alpha));
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--panel-radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(var(--glass-blur));
}

.panel::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.26), transparent 42%);
}

.controls-panel,
.output-bars-card,
.zoom-demo-card,
.chart-card {
  animation: rise 620ms cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

h2,
h3 {
  margin: 0;
  font-family: "Segoe UI", sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 1.45rem;
  line-height: 1.02;
}

h3 {
  font-size: 1.18rem;
}

.eyebrow {
  margin: 0 0 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--teal);
}

.display-controls {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 80;
}

.menu-button,
.drawer-close,
.reset-display,
.theme-chip {
  font: inherit;
}

.menu-button {
  display: inline-grid;
  gap: 4px;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 0;
  border-radius: 18px;
  background: rgba(var(--panel-rgb), var(--panel-strong-alpha));
  box-shadow: var(--shadow);
  backdrop-filter: blur(var(--glass-blur));
  cursor: pointer;
}

.menu-button span {
  display: block;
  width: 22px;
  height: 2px;
  border-radius: 999px;
  background: var(--ink);
  transition:
    transform 180ms ease,
    opacity 180ms ease;
}

.menu-button.is-open span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.menu-button.is-open span:nth-child(2) {
  opacity: 0;
}

.menu-button.is-open span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.menu-scrim {
  position: fixed;
  inset: 0;
  background: rgba(18, 28, 34, 0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}

.menu-scrim.is-open {
  opacity: 1;
  pointer-events: auto;
}

.display-drawer {
  position: fixed;
  top: 1rem;
  right: 1rem;
  width: min(360px, calc(100vw - 1.25rem));
  max-height: calc(100vh - 2rem);
  overflow: auto;
  padding: 1rem;
  opacity: 0;
  transform: translateY(-10px) scale(0.98);
  pointer-events: none;
  transition:
    opacity 220ms ease,
    transform 220ms ease;
}

.display-drawer.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.drawer-head {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
}

.drawer-close,
.reset-display {
  border: 0;
  border-radius: 999px;
  padding: 0.58rem 0.82rem;
  color: var(--ink);
  background: rgba(var(--surface-rgb), var(--surface-mid-alpha));
  box-shadow: inset 0 0 0 1px rgba(27, 42, 50, 0.08);
  cursor: pointer;
}

.drawer-group {
  position: relative;
  z-index: 1;
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(27, 42, 50, 0.08);
}

.drawer-group-scene-break {
  margin-top: 1.2rem;
  padding-top: 1.15rem;
  border-top-color: rgba(27, 42, 50, 0.14);
}

.drawer-group-scene-break::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(27, 42, 50, 0.2), transparent);
}

.drawer-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
}

.drawer-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.55rem;
}

.drawer-group output {
  color: var(--teal);
  font-size: 0.88rem;
  font-weight: 700;
}

.drawer-note {
  margin: 0.42rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.3;
}

.drawer-toggle {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: center;
  cursor: pointer;
}

.drawer-toggle input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--teal);
}

.drawer-toggle-stack {
  display: grid;
  gap: 0.4rem;
  margin-top: 0.55rem;
}

.chart-visibility-toggle {
  padding-block: 0.08rem;
}

.chart-visibility-toggle .drawer-label {
  font-size: 0.84rem;
  font-weight: 600;
}

.drawer-disclosure-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  list-style: none;
  cursor: pointer;
}

.drawer-disclosure-summary::-webkit-details-marker {
  display: none;
}

.drawer-disclosure-caret {
  width: 0.7rem;
  height: 0.7rem;
  border-right: 2px solid rgba(27, 42, 50, 0.55);
  border-bottom: 2px solid rgba(27, 42, 50, 0.55);
  transform: rotate(45deg) translateY(-1px);
  transition: transform 180ms ease;
}

.drawer-disclosure[open] .drawer-disclosure-caret {
  transform: rotate(225deg) translateY(-1px);
}

.drawer-disclosure-panel {
  margin-top: 0.65rem;
}

.theme-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.theme-chip {
  display: grid;
  gap: 0.35rem;
  justify-items: center;
  padding: 0.7rem 0.45rem;
  border: 0;
  border-radius: 16px;
  background: rgba(var(--surface-rgb), var(--surface-mid-alpha));
  box-shadow: inset 0 0 0 1px rgba(27, 42, 50, 0.08);
  cursor: pointer;
}

.theme-chip.is-active {
  box-shadow:
    inset 0 0 0 2px var(--teal),
    0 10px 18px rgba(27, 42, 50, 0.08);
}

.theme-swatch {
  display: block;
  width: 100%;
  height: 34px;
  border-radius: 10px;
}

.theme-swatch.sand {
  background:
    radial-gradient(circle at 16% 20%, rgba(194, 106, 44, 0.28), transparent 32%),
    linear-gradient(180deg, #fbf6ed 0%, #f2ead9 100%);
}

.theme-swatch.slate {
  background:
    radial-gradient(circle at 16% 20%, rgba(86, 116, 162, 0.3), transparent 32%),
    linear-gradient(180deg, #f3f7fb 0%, #e7edf5 100%);
}

.theme-swatch.forest {
  background:
    radial-gradient(circle at 16% 20%, rgba(181, 108, 52, 0.24), transparent 32%),
    linear-gradient(180deg, #f7fbf4 0%, #e8f0e5 100%);
}

.theme-swatch.midnight {
  background:
    radial-gradient(circle at 18% 18%, rgba(103, 191, 209, 0.34), transparent 34%),
    linear-gradient(180deg, #101a2c 0%, #0b1220 100%);
}

.theme-swatch.ember {
  background:
    radial-gradient(circle at 18% 18%, rgba(240, 114, 76, 0.34), transparent 34%),
    linear-gradient(180deg, #2d1716 0%, #140c0d 100%);
}

.theme-swatch.aurora {
  background:
    radial-gradient(circle at 18% 18%, rgba(89, 210, 187, 0.34), transparent 34%),
    linear-gradient(180deg, #173034 0%, #091315 100%);
}

.section-head p,
.chart-heading p,
.page-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.has-help {
  cursor: help;
}

.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.9rem;
}

.preset-sidebar {
  position: fixed;
  top: 1.85rem;
  left: max(0.7rem, calc((100vw - min(var(--page-max-width), calc(100vw - 2rem))) / 2 - 4.05rem));
  z-index: 50;
  display: flex;
  align-items: flex-start;
  gap: 0;
  max-width: min(310px, calc(100vw - 1.4rem));
}

.preset-sidebar-rail {
  display: grid;
  justify-items: center;
  gap: 0.55rem;
  flex: 0 0 auto;
}

.preset-sidebar-menu {
  position: relative;
  display: inline-flex;
  align-items: flex-start;
  gap: 0;
  width: 2.85rem;
}

.preset-sidebar-tab {
  position: relative;
  z-index: 2;
  width: 2.85rem;
  min-height: 8.4rem;
  border: 0;
  border-radius: 18px;
  padding: 0.9rem 0.45rem;
  background: linear-gradient(180deg, rgba(27, 113, 118, 0.18), rgba(27, 42, 50, 0.08));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.3),
    0 10px 24px rgba(27, 42, 50, 0.12);
  color: var(--teal);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  cursor: pointer;
  transition:
    background 180ms ease,
    box-shadow 180ms ease,
    color 180ms ease;
}

.preset-sidebar-toggle {
  display: grid;
  justify-items: center;
  gap: 0.35rem;
  width: 3.25rem;
  padding: 0.5rem 0.35rem 0.55rem;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(var(--surface-rgb), var(--surface-mid-alpha)), rgba(27, 42, 50, 0.06));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.26),
    0 8px 18px rgba(27, 42, 50, 0.1);
  color: var(--muted);
  cursor: pointer;
  transition:
    background 180ms ease,
    box-shadow 180ms ease,
    color 180ms ease;
}

.preset-sidebar-toggle-label {
  display: block;
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1.1;
  text-align: center;
}

.preset-sidebar-toggle input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--teal);
}

.preset-sidebar-panel {
  position: absolute;
  top: 0;
  left: calc(100% + 0.65rem);
  width: 240px;
  opacity: 0;
  overflow: hidden;
  visibility: hidden;
  transform: translateX(-0.35rem);
  padding: 0.72rem;
  border-radius: 22px;
  background: rgba(var(--surface-rgb), var(--surface-soft-alpha));
  border: 1px solid rgba(27, 42, 50, 0.08);
  box-shadow: 0 16px 36px rgba(27, 42, 50, 0.14);
  pointer-events: none;
  transition:
    opacity 160ms ease,
    transform 220ms ease,
    visibility 0s linear 220ms;
}

.preset-sidebar-panel::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -0.75rem;
  width: 0.75rem;
}

.preset-sidebar .preset-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.55rem;
  margin: 0;
  min-width: 190px;
}

.preset-sidebar .preset-chip {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
}

.preset-sidebar-menu.is-open .preset-sidebar-panel {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
  pointer-events: auto;
  transition-delay: 0s;
}

.preset-sidebar-menu.is-open .preset-sidebar-tab {
  background: linear-gradient(180deg, rgba(27, 113, 118, 0.24), rgba(27, 42, 50, 0.12));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.36),
    0 12px 28px rgba(27, 42, 50, 0.16);
  color: var(--teal);
}

.preset-sidebar-toggle:hover,
.preset-sidebar-toggle:focus-within {
  background: linear-gradient(180deg, rgba(27, 113, 118, 0.16), rgba(27, 42, 50, 0.08));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.32),
    0 10px 22px rgba(27, 42, 50, 0.14);
  color: var(--ink);
}

.preset-chip {
  position: relative;
  z-index: 1;
  border: 0;
  border-radius: 999px;
  padding: 0.68rem 0.95rem;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  background: linear-gradient(135deg, var(--preset-chip-bg-top), var(--preset-chip-bg-bottom));
  box-shadow:
    inset 0 0 0 1px var(--preset-chip-border),
    var(--preset-chip-shadow);
  cursor: pointer;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease;
}

.preset-chip:hover,
.preset-chip:focus-visible {
  transform: translateY(-2px);
  box-shadow:
    inset 0 0 0 1px var(--preset-chip-border),
    var(--preset-chip-hover-shadow);
}

.preset-chip.is-active {
  color: #fff8ef;
  background: linear-gradient(135deg, var(--preset-chip-active-start), var(--preset-chip-active-end));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.14),
    inset 0 10px 18px var(--preset-chip-active-highlight),
    var(--preset-chip-active-shadow);
  transform: translateY(1px);
}

.preset-chip.is-active:hover,
.preset-chip.is-active:focus-visible {
  transform: translateY(1px);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.14),
    inset 0 10px 18px var(--preset-chip-active-highlight),
    var(--preset-chip-active-shadow);
}

.status-line {
  position: relative;
  z-index: 1;
  margin: 0.9rem 0 0;
  padding: 0.78rem 0.95rem;
  border-radius: 18px;
  background: rgba(var(--surface-rgb), var(--status-alpha));
  border: 1px solid rgba(27, 42, 50, 0.08);
  color: var(--ink);
  font-size: 0.96rem;
  font-weight: 600;
}

.workspace {
  display: grid;
  gap: 1rem;
}

.controls-panel,
.output-bars-card,
.zoom-demo-card,
.chart-card {
  padding: 1rem 1.1rem 1.12rem;
}

.zoom-demo-card {
  padding-left: 0.78rem;
  padding-right: 0.78rem;
}

.controls-panel {
  position: sticky;
  top: 0.85rem;
  z-index: 30;
}

.controls-intro {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(270px, 340px);
  gap: 1rem;
  align-items: center;
}

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

.controls-brief,
.controls-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.controls-brief {
  grid-column: 1;
}

.exposure-triangle-card {
  grid-column: 2;
  justify-self: end;
  width: 100%;
  max-width: 320px;
  padding: 0.75rem 0.9rem 0.82rem;
  border-radius: 20px;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.22), transparent 46%),
    rgba(var(--surface-rgb), var(--surface-soft-alpha));
  border: 1px solid rgba(27, 42, 50, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.exposure-triangle {
  display: block;
  width: 100%;
  height: 156px;
}

.exposure-triangle-shape {
  fill: none;
  stroke: url(#exposureTriangleStroke);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.exposure-triangle-label {
  fill: var(--muted);
  font-family: "Segoe UI", "Avenir Next", "Trebuchet MS", sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.exposure-triangle-subtext {
  fill: var(--muted);
  font-family: "Segoe UI", "Avenir Next", "Trebuchet MS", sans-serif;
  font-size: 9.5px;
  font-weight: 600;
  opacity: 0.84;
}

.exposure-triangle-value {
  fill: var(--ink);
  font-family: "Segoe UI", "Avenir Next", "Trebuchet MS", sans-serif;
  font-size: 16px;
  font-weight: 700;
}

.controls-brief {
  font-size: 0.96rem;
}

.controls-note {
  position: relative;
  z-index: 1;
  margin-top: 0.7rem;
  font-size: 0.9rem;
}

body[data-verbose="false"] .controls-brief,
body[data-verbose="false"] .controls-note,
body[data-verbose="false"] .section-head p,
body[data-verbose="false"] .chart-heading p,
body[data-verbose="false"] .page-note {
  display: none;
}

body[data-verbose="false"] .exposure-triangle-subtext {
  display: none;
}

body[data-verbose="false"] .bar-note {
  visibility: hidden;
}

body[data-verbose="false"] .controls-intro,
body[data-verbose="false"] .section-head {
  align-items: center;
}

body[data-verbose="false"] .status-line {
  font-size: 0.9rem;
  letter-spacing: 0.01em;
}

.section-head {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
}

.section-head p {
  max-width: 34ch;
  font-size: 0.92rem;
}

.outputs-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 540px);
  gap: 1.15rem;
  align-items: stretch;
}

.outputs-main {
  min-width: 0;
}

.outputs-exposure-card {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 540px;
  justify-self: end;
  align-self: stretch;
  margin-top: 0;
  padding: 0.82rem 0.9rem;
}

.outputs-exposure-card .exposure-triangle {
  width: 100%;
  height: auto;
  aspect-ratio: 14 / 9;
}

.controls-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 0.85rem;
}

.controls-group-label {
  display: block;
  margin-bottom: 0.45rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
  opacity: 0.7;
}

.controls-group-inner {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.control {
  padding: 0.85rem 0.95rem 0.95rem;
  border-radius: 20px;
  background: rgba(var(--surface-rgb), var(--surface-soft-alpha));
  border: 1px solid rgba(27, 42, 50, 0.08);
}

.control.is-hidden {
  display: none;
}

.control-top {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: baseline;
}

.control-top label {
  font-size: 0.92rem;
  font-weight: 700;
}

body[data-verbose="true"] .control-top {
  align-items: flex-start;
}

body[data-verbose="true"] .control-top label {
  max-width: 14ch;
  line-height: 1.2;
}

body[data-verbose="true"] .zoom-controls-column .control-top label {
  max-width: 18ch;
  white-space: nowrap;
}

.control-top output {
  font-variant-numeric: tabular-nums;
  color: var(--teal);
  font-size: 0.92rem;
  font-weight: 700;
}

.control-inputs {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  align-items: center;
  margin-top: 0.7rem;
}

.range-input-shell {
  position: relative;
}

.range-input-shell-ticked {
  padding-block: 0.12rem 0.44rem;
}

.range-input-shell-ticked input[type="range"] {
  display: block;
  margin: 0;
  position: relative;
  z-index: 2;
  background: transparent;
}

.range-ticks {
  position: absolute;
  inset: auto 0 0;
  height: 0.42rem;
  pointer-events: none;
  z-index: 3;
}

.range-tick {
  position: absolute;
  left: calc(var(--tick-position, 0) * 1%);
  top: 0;
  width: 2px;
  height: 0.42rem;
  border-radius: 999px;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 1);
  box-shadow:
    0 0 0 1px rgba(27, 42, 50, 0.44),
    0 1px 2px rgba(27, 42, 50, 0.24);
}

.control-inputs input[type="number"] {
  display: none;
}

.control-meta {
  margin: 0.5rem 0 0;
  font-size: 0.74rem;
  line-height: 1.35;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--amber);
}

input[type="number"] {
  width: 100%;
  border: 1px solid rgba(27, 42, 50, 0.16);
  border-radius: 14px;
  padding: 0.64rem 0.72rem;
  font: inherit;
  color: var(--ink);
  background: rgba(var(--surface-rgb), var(--surface-strong-alpha));
}

.overview-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.overview-grid .zoom-demo-card {
  order: 1;
}

.overview-grid .scene-card {
  order: 2;
}

.quick-pills {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  margin-top: 0;
}

.quick-pill {
  padding: 0.8rem 0.9rem;
  border-radius: 18px;
  background: rgba(var(--surface-rgb), var(--surface-mid-alpha));
  border: 1px solid rgba(27, 42, 50, 0.08);
  text-align: center;
}

.quick-pill-range {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 6.5rem minmax(0, 1fr);
  gap: 0.25rem;
  align-items: center;
  padding-inline: 1.15rem;
}

.quick-pill-pair {
  display: grid;
  justify-items: center;
  min-width: 0;
  text-align: center;
}

.quick-pill span {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.quick-pill-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 6.5rem;
  color: var(--muted);
  font-size: 4.35rem;
  font-weight: 700;
  line-height: 1;
  text-align: center;
}

.quick-pill strong {
  display: block;
  margin-top: 0.3rem;
  font-size: 1.15rem;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.bar-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.8rem;
  margin-top: 0.85rem;
  align-items: stretch;
}

.output-bars-card .quick-pill {
  flex: 0 0 auto;
  padding: 0.68rem 0.75rem;
}

.output-bars-card .quick-pill strong {
  font-size: 1.02rem;
}

.output-bars-card .quick-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: stretch;
}

.output-bars-card .bar-grid {
  gap: 0.62rem;
}

.output-bars-card .bar-column {
  --output-bar-plot-height: 150px;
  grid-template-rows: 1.45rem var(--output-bar-plot-height) 2.5rem 2.2rem;
  align-content: start;
  height: 100%;
  padding: 0.68rem 0.5rem;
}

.output-bars-card .bar-value {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  font-size: 0.84rem;
  white-space: nowrap;
}

.output-bars-card .bar-plot {
  align-self: stretch;
  height: auto;
  min-height: 0;
}

.bar-column {
  display: grid;
  gap: 0.45rem;
  align-items: stretch;
  justify-items: center;
  padding: 0.8rem 0.65rem;
  border-radius: 18px;
  background: rgba(var(--panel-strong-rgb), var(--panel-strong-alpha));
  border: 1px solid rgba(255, 255, 255, 0.52);
}

.bar-value {
  display: block;
  text-align: center;
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
}

.bar-plot {
  position: relative;
  display: flex;
  align-items: end;
  width: 100%;
  height: 190px;
  border-radius: 18px;
  background: var(--track);
  overflow: hidden;
}

.bar-plot::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.24) 1px, transparent 1px);
  background-size: 100% 25%;
  opacity: 0.45;
}

.bar-fill {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 0%;
  border-radius: 14px 14px 0 0;
  transition: height 130ms ease;
}

.bar-fill.amber {
  background: linear-gradient(90deg, #efcaa2, var(--amber));
}

.bar-fill.teal {
  background: linear-gradient(90deg, #b7e2de, var(--teal));
}

.bar-fill.sand {
  background: linear-gradient(90deg, #f2dfba, var(--sand));
}

.bar-fill.rust {
  background: linear-gradient(90deg, #f0c2a7, var(--rust));
}

.bar-fill.moss {
  background: linear-gradient(90deg, #d8e7bf, var(--moss));
}

.bar-fill.plum {
  background: linear-gradient(90deg, #d8d2ef, var(--plum));
}

.bar-threshold {
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: 10%;
  height: 2px;
  border-radius: 2px;
  background: rgba(27, 42, 50, 0.75);
}

.bar-label {
  display: grid;
  align-content: center;
  width: 100%;
  text-align: center;
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.2;
}

body[data-verbose="true"] .bar-label {
  max-width: 11ch;
  font-size: 0.78rem;
}

.bar-note {
  display: grid;
  align-content: start;
  width: 100%;
  text-align: center;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.zoom-meta {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.85rem;
}

.zoom-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.52rem 0.78rem;
  border-radius: 999px;
  background: rgba(27, 113, 118, 0.12);
  color: var(--teal);
  font-size: 0.86rem;
  font-weight: 700;
}

.zoom-pill.muted {
  background: rgba(var(--surface-rgb), var(--surface-mid-alpha));
  color: var(--ink);
}

.zoom-demo-card .zoom-meta {
  display: none;
}

.zoom-demo-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(0, 2fr);
  gap: 1.05rem;
  align-items: start;
}

.zoom-controls-column,
.zoom-diagram-column {
  min-width: 0;
}

.zoom-controls-column {
  display: flex;
}

.zoom-control-stack {
  display: grid;
  gap: 0.7rem;
  width: 100%;
  align-content: start;
}

.zoom-control-divider {
  height: 2px;
  margin: 0.2rem 0 0.12rem;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(27, 42, 50, 0.42), transparent);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 1px 3px rgba(27, 42, 50, 0.12);
}

.zoom-control-stack .control {
  height: 100%;
}

.zoom-diagram-column {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

#zoomLensDemo {
  display: block;
  width: 100%;
  height: 396px;
  margin: 0.15rem 0 0;
  border-radius: 20px;
  background: linear-gradient(180deg, var(--demo-bg-top), var(--demo-bg-bottom));
}

#zoomLensDemo.is-interpolating * {
  transition: all 130ms ease;
}

.zoom-scale-track.is-live .zoom-scale-fill {
  transition: none;
}

.zoom-scale-track.is-live .zoom-scale-thumb {
  transition: none;
}

.zoom-scale-track.is-interpolating .zoom-scale-fill {
  transition: width 130ms ease;
}

.zoom-scale-track.is-interpolating .zoom-scale-thumb {
  transition: left 130ms ease;
}

#zoomLensDemo .demo-stage {
  fill: var(--demo-stage-fill);
  stroke: var(--demo-stage-stroke);
}

#zoomLensDemo .demo-axis {
  stroke: rgba(27, 42, 50, 0.16);
  stroke-width: 2;
  stroke-dasharray: 6 7;
}

#zoomLensDemo .object-arrow line,
#zoomLensDemo .object-arrow polygon {
  fill: rgba(194, 106, 44, 0.92);
  stroke: rgba(194, 106, 44, 0.92);
  stroke-width: 4;
}

#zoomLensDemo .object-arrow text,
#zoomLensDemo .demo-label {
  fill: var(--muted);
  font-family: "Avenir Next", "Trebuchet MS", sans-serif;
  font-size: 14px;
  font-weight: 600;
}

#zoomLensDemo .field-cone {
  fill: url(#fieldGradient);
  stroke: hsla(184, 86%, 59%, 0.4);
  stroke-width: 1.5;
}

#zoomLensDemo .ray {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#zoomLensDemo .ray-top,
#zoomLensDemo .ray-bottom {
  stroke: rgba(194, 106, 44, 0.9);
}

#zoomLensDemo .ray-mid {
  stroke: rgba(109, 229, 236, 0.98);
  stroke-width: 4.8;
}

#zoomLensDemo .lens-barrel {
  fill: rgba(27, 42, 50, 0.08);
  stroke: rgba(27, 42, 50, 0.18);
  stroke-width: 2;
}

#zoomLensDemo .lens-barrel-inner {
  fill: var(--demo-barrel-inner-fill);
  stroke: var(--demo-barrel-inner-stroke);
  stroke-width: 2;
}

#zoomLensDemo .lens-group {
  fill: url(#glassGradient);
  stroke: rgba(27, 42, 50, 0.24);
  stroke-width: 2;
}

#zoomLensDemo .zoom-iris {
  fill: rgba(27, 42, 50, 0.78);
  stroke: rgba(255, 255, 255, 0.75);
  stroke-width: 2;
}

#zoomLensDemo .lens-plane {
  stroke: rgba(27, 42, 50, 0.28);
  stroke-width: 2;
  stroke-dasharray: 6 6;
}

#zoomLensDemo .sensor-outline {
  stroke: rgba(255, 255, 255, 0.92);
  stroke-width: 9;
  stroke-linecap: round;
}

#zoomLensDemo .sensor-plane {
  stroke: rgba(93, 88, 120, 0.9);
  stroke-width: 5;
  stroke-linecap: round;
}

#zoomLensDemo .projection-slice {
  stroke: rgba(27, 113, 118, 0.78);
  stroke-width: 8;
  stroke-linecap: round;
}

#zoomLensDemo .dimension-guide {
  stroke: rgba(27, 42, 50, 0.18);
  stroke-width: 1.6;
  stroke-dasharray: 4 5;
}

#zoomLensDemo .dimension-line,
#zoomLensDemo .dimension-tick {
  stroke: rgba(140, 63, 25, 0.86);
  stroke-width: 2.5;
  stroke-linecap: round;
}

#zoomLensDemo .probe-blur-disc {
  fill: rgba(140, 63, 25, 0.28);
  stroke: rgba(140, 63, 25, 0.62);
  stroke-width: 2;
}

#zoomLensDemo .coc-ring {
  fill: none;
  stroke: rgba(194, 106, 44, 0.96);
  stroke-width: 3;
  stroke-dasharray: 6 5;
}

.scene-compare-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.scene-pane {
  margin: 0;
  display: grid;
  justify-items: center;
  padding-top: 0.38rem;
}

.scene-pane figcaption {
  margin: 0 0 0.48rem;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
}

.scene-preview {
  display: block;
  width: calc(100% - 0.8rem);
  height: 274px;
  margin-top: 0;
  border-radius: 20px;
  overflow: hidden;
}

#scenePreview,
#scenePreviewReference {
  touch-action: none;
}

#scenePreview,
#scenePreviewReference {
  transition: filter 160ms ease;
}

.scene-preview .scene-frame {
  fill: rgba(var(--surface-rgb), 0.08);
  stroke: rgba(27, 42, 50, 0.08);
}

.scene-preview .scene-haze {
  fill: var(--scene-haze);
}

.scene-preview .scene-path {
  fill: var(--scene-path);
}

.scene-preview .scene-depth-layer {
  --layer-blur: 0px;
  --layer-opacity: 1;
  --layer-scale: 1;
  filter: blur(var(--layer-blur));
  opacity: var(--layer-opacity);
  transform: scale(var(--layer-scale));
  transform-box: fill-box;
  transform-origin: center center;
  transition:
    filter 120ms ease,
    opacity 120ms ease,
    transform 120ms ease;
}

.scene-preview [data-scene-distance-drag] {
  cursor: grab;
}

.scene-preview [data-scene-distance-drag].is-dragging {
  cursor: grabbing;
}

.scene-preview .scene-interaction-zone {
  fill: transparent;
  stroke: transparent;
  stroke-width: 1.5;
  transition:
    fill 140ms ease,
    stroke 140ms ease;
}

.scene-preview .scene-interaction-zone.is-active {
  fill: var(--scene-zone-highlight);
  stroke: var(--scene-zone-stroke);
}

#scenePreviewReference .scene-interaction-zone[data-scene-distance-drag] {
  cursor: ns-resize;
}

#scenePreviewReference .scene-interaction-zone[data-scene-distance-drag].is-dragging {
  cursor: ns-resize;
}

.scene-preview .scene-zone-arrows {
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease;
}

.scene-preview .scene-zone-arrows.is-active {
  opacity: 1;
}

.scene-preview .scene-zone-arrow-line,
.scene-preview .scene-zone-arrow-head {
  fill: none;
  stroke: var(--teal);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 1px 2px rgba(27, 42, 50, 0.24));
}

.scene-preview .scene-mountain-back {
  fill: var(--scene-mountain-back);
}

.scene-preview .scene-mountain-front {
  fill: var(--scene-mountain-front);
}

.scene-preview .scene-distant-tree-canopy {
  fill: var(--scene-city);
  opacity: 0.96;
}

.scene-preview .scene-distant-tree-trunk {
  fill: var(--scene-mountain-front);
  opacity: 0.84;
}

.scene-preview .scene-subject-shadow {
  fill: var(--scene-shadow-color);
}

.scene-preview .scene-subject-head,
.scene-preview .scene-subject-body {
  fill: var(--scene-subject);
}

.scene-preview .scene-subject-accent {
  fill: var(--scene-subject-accent);
}

.scene-preview .scene-branch {
  fill: none;
  stroke: var(--scene-foreground);
  stroke-width: 10;
  stroke-linecap: round;
}

.scene-preview .scene-branch.alt {
  stroke: var(--scene-foreground-alt);
}

.scene-preview .scene-leaf {
  fill: var(--scene-foreground);
}

.scene-preview .scene-leaf.alt,
.scene-preview .scene-grass.alt {
  fill: var(--scene-foreground-alt);
}

.scene-preview .scene-grass {
  fill: var(--scene-foreground);
}

.scene-preview .scene-flower-petal {
  fill: var(--amber);
  stroke: rgba(var(--surface-rgb), 0.92);
  stroke-width: 1.8;
}

.scene-preview .scene-flower-petal.alt {
  fill: var(--sand);
}

.scene-preview .scene-flower-center {
  fill: rgba(var(--panel-rgb), 1);
  stroke: var(--amber);
  stroke-width: 1.6;
}

.scene-preview .scene-distance-line {
  fill: none;
  stroke: var(--muted);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 8 6;
  opacity: 0.78;
}

.scene-preview .scene-distance-dot {
  fill: var(--teal);
  stroke: rgba(var(--surface-rgb), 0.88);
  stroke-width: 3;
}

.scene-preview .scene-distance-chip rect {
  fill: rgba(var(--panel-rgb), 0.84);
  stroke: rgba(var(--surface-rgb), 0.32);
  stroke-width: 2;
  transition:
    fill 140ms ease,
    stroke 140ms ease,
    stroke-width 140ms ease;
}

.scene-preview .scene-distance-chip {
  --scene-distance-color: var(--ink);
  pointer-events: none;
}

.scene-preview .scene-distance-text {
  fill: var(--scene-distance-color);
  font-family: "Avenir Next", "Trebuchet MS", sans-serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: fill 140ms ease;
}

.scene-preview .scene-distance-chip.is-active rect {
  fill: rgba(var(--panel-rgb), 0.95);
  stroke: var(--teal);
  stroke-width: 2.6;
}

.scene-preview .scene-distance-chip.is-active .scene-distance-text {
  fill: var(--scene-distance-color);
}

.scene-preview .scene-grain-overlay {
  opacity: 0;
  pointer-events: none;
  mix-blend-mode: overlay;
  transition: opacity 160ms ease;
}

.zoom-scale {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.8rem;
  align-items: center;
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.zoom-scale-track {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: rgba(27, 42, 50, 0.12);
}

.zoom-scale-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(194, 106, 44, 0.88), rgba(27, 113, 118, 0.88));
  transition: width 130ms ease;
  will-change: width;
}

.zoom-scale-thumb {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: #fff8ef;
  border: 2px solid rgba(27, 42, 50, 0.18);
  box-shadow: 0 6px 14px rgba(27, 42, 50, 0.18);
  transition: left 130ms ease;
  will-change: left;
}

.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.charts-grid[data-visible-charts="0"] .output-bars-card,
.charts-grid[data-visible-charts="1"] .output-bars-card,
.charts-grid[data-visible-charts="2"] .output-bars-card {
  grid-column: 1 / -1;
}

.charts-grid[data-visible-charts="1"] .chart-card:not([hidden]) {
  grid-column: 1 / -1;
}

.chart-heading {
  position: relative;
  z-index: 1;
}

.chart-heading p {
  margin-top: 0.38rem;
  font-size: 0.9rem;
}

canvas {
  display: block;
  width: 100%;
  height: 240px;
  margin-top: 0.78rem;
  border-radius: 18px;
  background: linear-gradient(180deg, var(--canvas-bg-top), var(--canvas-bg-bottom));
}

.page-note {
  margin-top: 1rem;
  padding: 0 0.2rem;
  font-size: 0.92rem;
}

.noscript-banner {
  margin: 1rem auto 2rem;
  width: min(1320px, calc(100% - 2rem));
  padding: 1rem;
  border-radius: 18px;
  background: #fff2d5;
  color: #5a3d12;
  border: 1px solid rgba(90, 61, 18, 0.16);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1180px) {
  .controls-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bar-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .controls-panel {
    position: static;
    padding-left: 1.1rem;
  }

  .zoom-demo-layout {
    grid-template-columns: 1fr;
  }

  .preset-sidebar {
    position: static;
    display: block;
    max-width: none;
    margin: 0 0 0.9rem;
  }

  .preset-sidebar-rail {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.7rem;
    margin-bottom: 0.75rem;
  }

  .preset-sidebar-menu {
    display: block;
    width: auto;
  }

  .preset-sidebar-tab {
    display: none;
  }

  .preset-sidebar-toggle {
    width: auto;
    padding: 0.58rem 0.8rem;
    border-radius: 999px;
    grid-auto-flow: column;
    align-items: center;
    gap: 0.55rem;
  }

  .preset-sidebar-toggle-label {
    font-size: 0.68rem;
    line-height: 1;
  }

  .preset-sidebar-panel {
    position: static;
    width: auto;
    max-width: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    overflow: visible;
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
    pointer-events: auto;
  }

  .preset-sidebar .preset-row {
    display: flex;
    grid-template-columns: none;
    gap: 0.65rem;
    margin: 0;
    min-width: 0;
    flex-wrap: wrap;
  }

  .preset-sidebar .preset-chip {
    width: auto;
    text-align: center;
  }

  .controls-intro,
  .section-head {
    grid-template-columns: 1fr;
    display: grid;
    align-items: start;
  }

  .exposure-triangle-card,
  .controls-brief {
    grid-column: auto;
  }

  .exposure-triangle-card {
    justify-self: stretch;
    max-width: none;
  }

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

  .outputs-layout {
    grid-template-columns: 1fr;
  }

  .outputs-exposure-card {
    justify-self: stretch;
    max-width: none;
  }

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

  .scene-compare-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .page-shell {
    width: min(calc(100% - 1rem), var(--page-max-width));
    padding-top: 0.7rem;
  }

  .display-controls {
    top: 0.75rem;
    right: 0.75rem;
  }

  .display-drawer {
    top: 0.75rem;
    right: 0.75rem;
    width: min(360px, calc(100vw - 1rem));
  }

  .controls-panel,
  .output-bars-card,
  .zoom-demo-card,
  .chart-card {
    padding: 0.92rem;
  }

  .controls-panel {
    padding-left: 0.92rem;
  }

  .zoom-demo-layout {
    gap: 0.85rem;
  }

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

  .controls-group-inner {
    grid-template-columns: 1fr;
  }

  .quick-pills {
    grid-template-columns: 1fr;
  }

  .bar-plot {
    height: 160px;
  }

  .output-bars-card .bar-column {
    --output-bar-plot-height: 160px;
  }

  .control-inputs {
    grid-template-columns: 1fr;
  }

  canvas {
    height: 228px;
  }

  #zoomLensDemo {
    height: 312px;
  }

  .scene-preview {
    height: 268px;
  }
}

@media (max-width: 560px) {
  .controls-grid {
    grid-template-columns: 1fr;
  }

  .controls-group-inner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .controls-brief,
  .section-head p,
  .chart-heading p {
    font-size: 0.88rem;
  }
}
