:root {
  color-scheme: dark;
  --bg: #08131b;
  --panel: #0e1d27;
  --panel-2: #122631;
  --line: rgba(173, 198, 207, .13);
  --muted: #8196a1;
  --soft: #b8c8ce;
  --text: #edf4f4;
  --accent: #f0a35b;
  --accent-soft: rgba(240, 163, 91, .14);
  --cyan: #76c7c9;
  --green: #8bd0aa;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; background: var(--bg); color: var(--text); }
body { height: 100vh; height: 100dvh; overflow: hidden; display: grid; grid-template-rows: 66px minmax(0, 1fr); }
body.embed-mode { height: 100vh; height: 100dvh; overflow: hidden; }
button, input { font: inherit; }
button { color: inherit; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 0 24px; border-bottom: 1px solid var(--line); background: #091720; min-width: 0; }
.brand-lockup { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark { width: 28px; height: 28px; border: 1px solid rgba(240,163,91,.48); border-radius: 8px; display: flex; align-items: center; justify-content: center; gap: 3px; transform: rotate(-7deg); }
.brand-mark span { display: block; width: 3px; border-radius: 3px; background: var(--accent); }
.brand-mark span:nth-child(1) { height: 8px; opacity: .55; }
.brand-mark span:nth-child(2) { height: 15px; }
.brand-mark span:nth-child(3) { height: 11px; opacity: .75; }
.eyebrow { color: #92a8b1; font-size: 9px; font-weight: 750; letter-spacing: .16em; line-height: 1.4; }
.brand-sub { color: #6f858f; font-size: 10px; margin-top: 2px; letter-spacing: .02em; }
.top-meta { display: flex; align-items: center; gap: 10px; color: #80959e; font-size: 9px; font-weight: 700; letter-spacing: .13em; white-space: nowrap; }
.live-dot, .kicker-dot { width: 6px; height: 6px; display: inline-block; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px rgba(240,163,91,.65); }
.meta-divider { width: 1px; height: 13px; background: var(--line); }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 382px; gap: 14px; padding: 14px; min-width: 0; min-height: 0; }
.stage { position: relative; min-width: 0; min-height: 0; overflow: hidden; border: 1px solid rgba(161,190,200,.16); border-radius: 14px; background: #0b1b25; box-shadow: 0 18px 50px rgba(0,0,0,.22); }
#scene { display: block; width: 100%; height: 100%; }
.stage-topline { position: absolute; top: 18px; left: 20px; right: 20px; display: flex; align-items: center; justify-content: space-between; pointer-events: none; gap: 12px; }
.stage-kicker { display: inline-flex; align-items: center; gap: 8px; border: 1px solid rgba(173,198,207,.16); border-radius: 30px; padding: 8px 11px; color: #c4d1d5; background: rgba(8,19,27,.65); backdrop-filter: blur(10px); font-size: 9px; letter-spacing: .14em; font-weight: 750; }
.stage-tag { color: #8ca1a9; font-size: 10px; letter-spacing: .04em; text-shadow: 0 2px 8px #07131a; }
.stage-tag span { color: var(--accent); padding: 0 4px; }
.stage-bottomline { position: absolute; left: 20px; right: 20px; bottom: 18px; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; pointer-events: none; }
.scene-caption { max-width: 530px; padding: 11px 14px; border: 1px solid rgba(173,198,207,.13); border-radius: 9px; color: #c0cdd1; background: rgba(7,18,26,.74); backdrop-filter: blur(9px); font-size: 11px; line-height: 1.5; box-shadow: 0 8px 24px rgba(0,0,0,.15); }
.scene-scale { display: flex; align-items: center; gap: 8px; color: #6f858e; font-size: 8px; font-weight: 700; letter-spacing: .15em; white-space: nowrap; padding-bottom: 5px; }
.scale-line { width: 27px; height: 1px; background: var(--accent); }
.panel { min-width: 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); scrollbar-width: thin; scrollbar-color: #334b56 transparent; }
.panel-section { padding: 17px 18px; border-bottom: 1px solid var(--line); }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
h1 { font-size: 20px; line-height: 1.15; letter-spacing: -.045em; margin: 5px 0 0; font-weight: 720; }
.era-chip { border: 1px solid rgba(240,163,91,.28); border-radius: 5px; padding: 5px 7px; color: #f1b77e; font-size: 9px; letter-spacing: .08em; white-space: nowrap; }
.intro-copy { color: #8fa3ab; font-size: 11px; line-height: 1.5; margin: 9px 0 13px; }
.view-switch { display: grid; grid-template-columns: repeat(3,1fr); gap: 4px; padding: 4px; border: 1px solid rgba(173,198,207,.12); border-radius: 8px; background: #091821; }
.view-btn, .quality-btn { border: 0; border-radius: 5px; padding: 8px 4px; color: #8298a1; background: transparent; cursor: pointer; font-size: 10px; font-weight: 650; transition: background .18s ease, color .18s ease, transform .18s ease; }
.view-btn:hover, .quality-btn:hover { color: #e9f1f1; background: rgba(255,255,255,.045); }
.view-btn.active { color: #f5c28f; background: rgba(240,163,91,.14); box-shadow: inset 0 0 0 1px rgba(240,163,91,.18); }
button:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.section-title-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.unit-note, .input-note { color: #637a84; font-size: 8px; letter-spacing: .04em; }
.metrics-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
.metric-card { min-width: 0; padding: 11px 11px 9px; border: 1px solid rgba(173,198,207,.1); border-radius: 8px; background: linear-gradient(145deg, rgba(24,47,58,.62), rgba(12,29,39,.72)); }
.metric-label { color: #8da2aa; font-size: 9px; letter-spacing: .025em; }
.metric-value { margin-top: 5px; color: #f0f5f4; font-size: 23px; font-weight: 680; letter-spacing: -.05em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.metric-value small { color: #8fa5ad; font-size: 10px; font-weight: 600; letter-spacing: 0; }
.metric-foot { margin-top: 3px; color: #617985; font-size: 8px; }
.retention-row { display: grid; grid-template-columns: 1fr auto; gap: 8px 10px; align-items: center; margin-top: 13px; color: #8fa3ab; font-size: 9px; }
.retention-row strong { color: var(--cyan); font-size: 11px; font-variant-numeric: tabular-nums; }
.retention-track { grid-column: 1 / -1; height: 4px; overflow: hidden; border-radius: 6px; background: #233943; }
.retention-track span { display: block; width: 100%; height: 100%; border-radius: inherit; background: linear-gradient(90deg,#6cbab9,#a3d9c0); transition: width .2s ease; }
.control-list { display: grid; gap: 13px; }
.control { display: block; min-width: 0; }
.control-head { display: flex; justify-content: space-between; gap: 10px; color: #c3d0d3; font-size: 10px; }
.control-head output { color: #f3b77c; font-size: 10px; font-weight: 700; font-variant-numeric: tabular-nums; }
.control input[type="range"] { display: block; width: 100%; height: 15px; margin: 5px 0 1px; accent-color: var(--accent); cursor: pointer; background: transparent; }
.control input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 4px; background: #344d58; }
.control input[type="range"]::-webkit-slider-thumb { margin-top: -5px; width: 13px; height: 13px; border: 2px solid #f6c18c; border-radius: 50%; background: #182d37; box-shadow: 0 0 0 3px rgba(240,163,91,.12); -webkit-appearance: none; }
.control input[type="range"]::-moz-range-track { height: 3px; border-radius: 4px; background: #344d58; }
.control input[type="range"]::-moz-range-thumb { width: 10px; height: 10px; border: 2px solid #f6c18c; border-radius: 50%; background: #182d37; }
.control-range { display: flex; justify-content: space-between; color: #617983; font-size: 8px; font-variant-numeric: tabular-nums; }
.control-hint { display: block; margin-top: 3px; color: #647c85; font-size: 8px; line-height: 1.35; }
.preset-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 16px; }
.preset-label { color: #718792; font-size: 8px; font-weight: 750; letter-spacing: .12em; margin-right: auto; }
.preset-btn { border: 1px solid rgba(173,198,207,.14); border-radius: 5px; padding: 6px 8px; color: #aabcc1; background: #132832; font-size: 9px; cursor: pointer; transition: border .18s ease, color .18s ease, background .18s ease; }
.preset-btn:hover { color: #f4c08d; border-color: rgba(240,163,91,.4); background: #1b303a; }
.playback-section { padding-bottom: 15px; }
.time-readout { color: #f0b67c; font-size: 10px; font-variant-numeric: tabular-nums; }
.playback-row { display: grid; grid-template-columns: 1.25fr 1fr 36px 36px; gap: 6px; }
.action-btn { min-height: 34px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid rgba(173,198,207,.15); border-radius: 6px; padding: 0 8px; color: #a9bbc0; background: #142832; font-size: 10px; font-weight: 650; cursor: pointer; transition: background .18s ease, border .18s ease, color .18s ease, transform .18s ease; }
.action-btn:hover { color: #f3f6f4; border-color: rgba(240,163,91,.38); background: #1b333e; }
.action-btn:active, .preset-btn:active, .view-btn:active { transform: translateY(1px); }
.action-btn.primary { color: #1a211f; border-color: #f1b77e; background: linear-gradient(135deg,#f3bd87,#e89a54); }
.action-btn.primary:hover { background: #ffd09d; }
.play-icon { font-size: 12px; line-height: 1; }
.icon-action { font-size: 16px; padding: 0; }
.quality-row { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; color: #7f959e; font-size: 9px; }
.quality-switch { display: flex; gap: 3px; padding: 3px; border-radius: 6px; background: #091821; }
.quality-btn { min-width: 39px; padding: 5px 7px; font-size: 9px; }
.quality-btn.active { color: #a6d5d1; background: rgba(118,199,201,.13); }
.check-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 13px; padding: 10px 11px; border: 1px solid rgba(118,199,201,.17); border-radius: 7px; background: rgba(24,57,61,.23); }
.check-label { display: block; color: #b7c9ca; font-size: 9px; }
.check-sub { display: block; color: #6d858b; font-size: 8px; margin-top: 3px; }
.check-result { text-align: right; white-space: nowrap; }
.check-result strong { display: block; color: var(--green); font-size: 12px; font-variant-numeric: tabular-nums; }
.check-result span { display: block; color: #6f888e; font-size: 8px; margin-top: 3px; }
.science-panel { border-bottom: 1px solid var(--line); }
.science-panel summary { list-style: none; display: flex; align-items: center; justify-content: space-between; padding: 15px 18px; cursor: pointer; }
.science-panel summary::-webkit-details-marker { display: none; }
.science-panel summary strong { display: block; color: #dfe9e9; font-size: 13px; margin-top: 3px; }
.summary-plus { color: var(--accent); font-size: 19px; font-weight: 300; transition: transform .2s ease; }
.science-panel[open] .summary-plus { transform: rotate(45deg); }
.science-content { padding: 0 18px 18px; color: #91a6ad; font-size: 10px; line-height: 1.55; }
.science-content h2 { color: #d8e4e5; font-size: 11px; margin: 5px 0 7px; }
.science-content h3 { color: #b9c9cd; font-size: 9px; letter-spacing: .08em; text-transform: uppercase; margin: 14px 0 7px; }
.science-content p { margin: 0 0 9px; }
.science-content ul { padding-left: 16px; margin: 6px 0 10px; }
.science-content li { margin: 4px 0; }
.equation { overflow-x: auto; padding: 7px 9px; margin: 5px 0; border: 1px solid rgba(173,198,207,.1); border-radius: 5px; background: #0a1a23; color: #e7c49f; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 9px; white-space: nowrap; }
.history-note { padding-left: 9px; border-left: 2px solid var(--accent); color: #b3c2c5; }
.disclaimer { color: #7b929a; font-style: italic; }
.panel-foot { padding: 12px 18px 15px; color: #536d78; font-size: 7px; line-height: 1.5; letter-spacing: .11em; }
@media (max-width: 860px) {
  body { grid-template-rows: 58px minmax(0,1fr); }
  .topbar { padding: 0 14px; }
  .workspace { grid-template-columns: minmax(0,1fr) 340px; gap: 10px; padding: 10px; }
  .panel-section { padding-left: 14px; padding-right: 14px; }
}
@media (max-width: 700px) {
  body { grid-template-rows: 54px minmax(0,1fr); }
  .top-meta { font-size: 7px; gap: 6px; }
  .brand-sub { display: none; }
  .workspace { grid-template-columns: minmax(0,1fr); grid-template-rows: minmax(220px, 40%) minmax(0,1fr); gap: 9px; padding: 9px; }
  .stage { border-radius: 10px; }
  .stage-topline { top: 10px; left: 10px; right: 10px; }
  .stage-kicker { padding: 6px 8px; font-size: 8px; }
  .stage-tag { font-size: 8px; }
  .stage-bottomline { left: 10px; right: 10px; bottom: 10px; }
  .scene-caption { max-width: 100%; padding: 7px 9px; font-size: 9px; line-height: 1.35; }
  .scene-scale { display: none; }
  .panel { border-radius: 10px; }
  .panel-section { padding: 13px 14px; }
  h1 { font-size: 17px; }
  .intro-copy { margin: 6px 0 9px; }
  .view-btn { padding: 7px 3px; font-size: 9px; }
  .metric-card { padding: 8px 9px 7px; }
  .metric-value { font-size: 20px; margin-top: 3px; }
  .metric-foot { font-size: 7px; }
  .control-list { gap: 10px; }
  .control-hint { font-size: 7px; }
  .control input[type="range"] { margin-top: 3px; }
}
@media (max-width: 390px) {
  .top-meta { letter-spacing: .07em; }
  .stage-tag { display: none; }
  .metrics-grid { gap: 5px; }
  .metric-label { font-size: 8px; }
  .metric-value { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
