:root {
  color-scheme: dark;
  --paper: #100c19;
  --surface: #1a1426;
  --surface-raised: #221a30;
  --ink: #f7f1ff;
  --muted: #b5a8c7;
  --line: #392b4a;
  --accent: #c7a8ff;
  --palette-glow: 134, 75, 212;
  --palette-light: #c3a3ff;
}
html { scroll-behavior: smooth; }
.topbar { background: #150f20; border-color: #2e223e; }
.topbar-inner, .page { width: min(1184px, calc(100% - 64px)); }
.topbar-inner { height: 62px; }
.brand { color: var(--ink); text-decoration: none; }
.brand-mark { color: #271640; background: #c8aaff; box-shadow: 0 0 21px #ac7cf24a; }
.navigation { display: flex; gap: 25px; align-items: stretch; height: 100%; }
.navigation a { display: grid; place-items: center; color: var(--muted); text-decoration: none; font-size: 13px; position: relative; }
.navigation a:hover, .navigation a:focus-visible { color: var(--ink); }
.navigation a:first-child { color: #e1cbff; }
.navigation a:first-child::after { content: ""; position: absolute; bottom: 0; left: 0; right: 0; height: 2px; background: #b68ef7; }
.privacy { color: #b9aeca; }
.shield { border-color: #8875a0; }
.page { padding-top: 35px; }
.intro { margin-bottom: 24px; }
.eyebrow { color: #c2a3ee; }
.eyebrow > span { background: #b381ff; box-shadow: 0 0 9px #ab76ff75; }
h1 { margin-top: 11px; font-size: clamp(38px, 4.35vw, 62px); letter-spacing: -.06em; }
h1 span { color: #c9a6ff; }
.intro-copy { color: #b5a8c7; }
.workspace { grid-template-columns: minmax(0, 1fr) 325px; gap: 15px; align-items: stretch; }
.stage-card, .control-card, .session-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 10px 30px #08060e45; }
.stage-card { display: flex; flex-direction: column; }
.stage { height: auto; min-height: 408px; flex: 1; isolation: isolate; background: radial-gradient(ellipse at 50% 48%, rgba(var(--palette-glow), .48), transparent 54%), radial-gradient(ellipse at 51% 53%, #2f1e49, #1a122b 80%); }
.stage::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg,#b999e91a 1px,transparent 1px),linear-gradient(#b999e91a 1px,transparent 1px); background-size: 28px 28px; mask-image: radial-gradient(ellipse at center, #000, transparent 85%); }
.stage::after { content: ""; pointer-events: none; position: absolute; inset: 9px; border: 1px solid #d4bbf018; border-radius: 12px; }
.stage-top { inset: 19px 21px auto; }
.stage-top h2, .stage-state, .stage-caption { border-color: #c9acfb42; color: #efe2ff; background: #1c132de8; }
.stage-top h2 span { color: var(--palette-light); }
.stage-state i { box-shadow: 0 0 8px var(--state-color, #b48aff); }
.stage-bottom { bottom: 21px; }
.stage-caption { padding: 8px 15px; }
.progress-track { background: #45365a; }
.progress-track > div { background: var(--palette-light); }
.stage-meta { height: 57px; flex: 0 0 57px; color: var(--muted); border-top: 1px solid var(--line); }
.stage-meta-icon { color: var(--palette-light); }
.stage-meta > .palette { display: flex; align-items: center; gap: 9px; margin-left: auto; font-size: 11px; letter-spacing: 0; }
.save-avatar { background: #2a2039; border: 1px solid #4d3a64; border-radius: 7px; color: #eadbff; padding: 5px 8px; white-space: nowrap; }
.stage-meta > .save-avatar { font-size: 11px; letter-spacing: 0; }
.save-avatar:hover { border-color: #ba97ea; background: #38274e; }
.palette button { width: 19px; height: 19px; padding: 0; border-radius: 50%; background: var(--swatch); border: 2px solid #170f22; outline: 1px solid #675479; outline-offset: 0; }
.palette button:hover, .palette button[aria-pressed="true"] { outline-color: #f4e7ff; }
.palette button:focus-visible { outline: 2px solid #f4e7ff; outline-offset: 2px; }
.palette [data-palette="violet"] { --swatch: #b791fa; }
.palette [data-palette="mint"] { --swatch: #7bdec1; }
.palette [data-palette="sunset"] { --swatch: #ffb47d; }
.control-card { padding: 14px 15px 6px; min-height: 0; }
.panel-icon { display: inline-grid; place-items: center; vertical-align: 1px; margin-right: 3px; width: 24px; height: 24px; color: #d8bbff; background: #332449; border-radius: 7px; font-size: 15px; }
.camera-status { color: #d3c7e4; background: #30243f; border: 1px solid #473655; }
.camera-status i { background: #a194b1; }
.camera-status[data-status="running"] i { background: #7fe0ba; }
.camera-status[data-status="starting"] i { background: #c7a6fb; }
.camera-status[data-status="error"] i { background: #f493ae; }
.camera-view { height: 103px; margin-top: 11px; border-color: #4b3764; background: radial-gradient(ellipse at center, #322449, #211931); color: #c7b6de; }
.view-grid { background-image: linear-gradient(90deg,#b99de62c 1px,transparent 1px),linear-gradient(#b99de62c 1px,transparent 1px); }
.viewfinder b { border-color: #a381cb; }
.camera-toggle { background: #c4a3fa; border-color: #d1b4ff; color: #211332; margin-top: 8px; min-height: 35px; }
.camera-toggle:hover { background: #ddc5ff; }
.camera-help { color: var(--muted); margin: 5px 0 8px; }
.emotion-heading { border-color: var(--line); padding-top: 8px; margin-bottom: 6px; }
.emotion-heading h3, #emotion-score { color: var(--muted); }
.emotion-readout { background: #261b35; border-color: #49365d; color: #eee1ff; padding: 7px 10px; }
.distribution-heading { display: flex; justify-content: space-between; align-items: baseline; margin: 11px 0 5px; font-size: 10px; color: var(--muted); }
.distribution-heading h3 { font-size: 12px; color: #e4d7f4; }
.distribution { display: grid; gap: 3px; }
.distribution-row { display: grid; grid-template-columns: 26px 1fr 33px; align-items: center; gap: 7px; min-height: 14px; color: #c8bcd8; font-size: 10px; }
.distribution-row[data-leading="true"] { color: #fff2ff; font-weight: 750; }
.distribution-track { height: 4px; overflow: hidden; border-radius: 9px; background: #3a2c4c; }
.distribution-track > span { display: block; height: 100%; border-radius: inherit; background: var(--bar-color); transform: scaleX(0); transform-origin: left; transition: transform .15s ease-out; }
.distribution-value { text-align: right; font-variant-numeric: tabular-nums; }
.demo { margin-top: 5px; border-top: 1px solid var(--line); }
.demo summary { color: #d4b9ff; }
.demo summary:hover { color: #f2e6ff; }
.demo-options button { border-color: #554071; background: #2b1d3d; color: #eadbff; }
.demo-options button:hover, .demo-options button[aria-pressed="true"] { border-color: #c39bf7; background: #513874; }
.interactions { margin-top: 21px; }
.mode { border-color: var(--line); background: var(--surface); min-height: 69px; padding: 10px 13px; }
.mode:hover { background: #21182f; border-color: #8767ac; }
.mode[data-active="true"] { background: #38264d; border-color: #ad87da; }
.mode-icon { background: #233b3a; color: #8fe0ce; }
.mode-comfort .mode-icon { background: #41253c; color: #f0a0c9; }
.mode-cheer .mode-icon { background: #403029; color: #ffc47f; }
.mode-copy small, .mode-arrow { color: var(--muted); }
.session-card { margin-top: 20px; padding: 16px; scroll-margin-top: 16px; }
.session-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px 14px; flex-wrap: wrap; }
.session-heading h2 { font-size: 18px; }
.session-heading p { margin-top: 5px; font-size: 12px; color: var(--muted); }
.session-actions { display: flex; gap: 7px; }
.session-actions button { padding: 6px 10px; background: #2a2039; border: 1px solid #4d3a64; border-radius: 7px; color: #eadbff; font-size: 11px; }
.session-actions button:not(:disabled):hover { border-color: #ba97ea; background: #38274e; }
.session-actions button:disabled { opacity: .55; cursor: default; }
.session-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin: 12px 0; }
.session-stats > div { display: grid; gap: 5px; background: #22192e; border: 1px solid #3c2d4d; border-radius: 9px; padding: 8px 11px; }
.session-stats span { color: var(--muted); font-size: 11px; }
.session-stats strong { color: #f1e4ff; font-size: 16px; font-variant-numeric: tabular-nums; }
.session-empty { border: 1px dashed #4d3b60; border-radius: 8px; color: var(--muted); padding: 12px; font-size: 12px; text-align: center; }
.session-list { display: grid; margin: 0; padding: 0; list-style: none; max-height: 225px; overflow: auto; }
.session-list li { display: grid; grid-template-columns: 60px minmax(0, 1fr) auto; align-items: center; gap: 9px; border-top: 1px solid var(--line); padding: 8px 2px; font-size: 12px; }
.session-list time { color: var(--muted); font-variant-numeric: tabular-nums; }
.event-label { display: flex; align-items: center; gap: 7px; }
.event-label::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--event-color, #c5a4ff); flex-shrink: 0; }
.event-source { color: #c9badb; background: #30233f; border-radius: 20px; padding: 3px 7px; font-size: 10px; }
footer { border-color: #32253e; color: var(--muted); }
@media (min-width: 1500px) {
  .stage { min-height: 438px; }
  .camera-view { height: 114px; }
}
@media (max-width: 850px) {
  .topbar-inner, .page { width: calc(100% - 34px); }
  .workspace { grid-template-columns: minmax(0, 1fr) 280px; }
}
@media (max-width: 680px) {
  .topbar-inner, .page { width: calc(100% - 24px); }
  .topbar-inner { height: 53px; }
  .navigation { display: none; }
  .page { padding-top: 25px; }
  .intro { margin-bottom: 16px; }
  .workspace { grid-template-columns: 1fr; gap: 12px; }
  .stage { min-height: clamp(275px, 78vw, 365px); }
  .stage-top { inset: 14px 14px auto; }
  .stage-bottom { bottom: 15px; }
  .stage-meta { height: 47px; flex-basis: 47px; padding: 0 13px; }
  .palette > span { display: none; }
  .camera-view { height: 117px; }
  .distribution-row { min-height: 17px; }
  .mode { min-height: 57px; }
  .session-card { padding: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
