:root {
  color-scheme: dark;
  --background: #050708;
  --surface: #101416f5;
  --raised: #1a2023;
  --ink: #edf3f5;
  --muted: #9ca9af;
  --line: #ffffff1f;
  --accent: #c2e1ec;
  --accent-ink: #17272d;
  --radius: 12px;
  --mono: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--background); color: var(--ink); overflow: hidden; }
button, input, select { font: inherit; }
button, a, select, input[type='range'], input[type='checkbox'] { -webkit-tap-highlight-color: transparent; }
button, a, select { touch-action: manipulation; }
button, select { color: inherit; }
button, a { cursor: pointer; }
button { border: 0; }
button:disabled, input:disabled, select:disabled { opacity: .4; cursor: not-allowed; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
button, a { transition: background 160ms ease, color 160ms ease, border-color 160ms ease; }
[hidden] { display: none !important; }
svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
#canvas { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); display: block; }
.app-header::before { content: ''; position: fixed; inset: 0 0 auto; height: 100px; background: linear-gradient(#050708b3, transparent); pointer-events: none; }
.header-actions { position: fixed; top: max(18px, env(safe-area-inset-top)); right: max(22px, env(safe-area-inset-right)); display: flex; align-items: center; gap: 8px; }
.quiet-button, .icon-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: #101416c7; border: 1px solid var(--line); border-radius: 10px; min-height: 44px; color: #c6d0d5; font-size: 12px; }
.quiet-button { padding: 0 15px; }
.icon-button { width: 44px; flex-shrink: 0; }
.quiet-button:hover, .icon-button:hover { background: #242c30; color: #fff; }
.quiet-button[aria-expanded='true'] { color: var(--ink); background: var(--raised); border-color: #a0c4d054; }
.scene-caption { position: fixed; top: 110px; left: 34px; pointer-events: none; }
.eyebrow { font: 10px/1.5 var(--mono); color: var(--muted); letter-spacing: .14em; margin: 0; }
h1 { display: flex; align-items: baseline; gap: 16px; margin: 10px 0 8px; font-size: clamp(26px, 3vw, 40px); line-height: 1.2; font-weight: 300; letter-spacing: -.045em; }
#sceneNumber { font: 10px/1 var(--mono); letter-spacing: .02em; color: var(--muted); }
#sceneDescription { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.scene-tools { position: fixed; right: 22px; bottom: 28px; display: flex; gap: 8px; }
.bottom-dock { position: fixed; bottom: max(26px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); width: min(760px, calc(100% - 300px)); border: 1px solid var(--line); border-radius: 17px; padding: 14px 16px 4px; background: #0e1214de; backdrop-filter: blur(20px); }
.preset-heading { display: flex; justify-content: space-between; align-items: center; margin: 0 1px 10px; min-height: 36px; gap: 8px; }
.collection-tabs { display: flex; gap: 2px; }
.collection-tabs button { display: flex; align-items: center; gap: 7px; padding: 0 10px; min-height: 36px; border-radius: 6px; background: transparent; color: var(--muted); font-size: 11px; }
.collection-tabs button[aria-pressed='true'] { background: #ffffff0d; color: var(--ink); }
.collection-tabs small { font: 8px var(--mono); color: var(--muted); }
.live-tools { display: flex; align-items: center; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.live-tools > button { display: flex; align-items: center; justify-content: center; gap: 8px; flex: 1; min-height: 36px; padding: 0 8px; background: #ffffff05; border: 1px solid #ffffff0d; border-radius: 6px; color: #b9c8cf; font-size: 11px; }
.live-tools > button:hover, .live-tools > button.is-firing, .live-tools > button.is-holding { border-color: #c2e1ec66; background: #c2e1ec20; color: #fff; }
.live-tools kbd { font-size: 8px; color: var(--muted); border: 0; padding: 0; }
.transition-control { width: 120px; flex-shrink: 0; }
.transition-control select { min-height: 36px; padding: 5px 8px; font-size: 10px; background: transparent; border-color: #ffffff24; }
#autoBtn { display: inline-flex; align-items: center; min-height: 32px; gap: 7px; padding: 0 9px; background: transparent; border: 1px solid transparent; border-radius: 6px; color: var(--muted); font-size: 11px; }
#autoBtn:hover { background: var(--raised); }
#autoBtn[aria-pressed='true'] { color: var(--accent); border-color: #c2e1ec40; }
.auto-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.expression-tabs { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.expression-tabs button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 91px; padding: 10px 4px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: #a4b0b6; font-size: 11px; }
.expression-tabs button:hover { background: #ffffff08; color: var(--ink); }
.expression-tabs button[aria-selected='true'] { color: #e0f0f7; background: #c6e4f00d; border-color: #c6e4f03d; }
.expression-tabs svg { width: 33px; height: 33px; stroke-width: .8; opacity: .8; }
.expression-tabs small { display: block; margin-top: 5px; font: 8px/1.2 var(--mono); letter-spacing: .08em; color: var(--muted); }
.preset-icon { display: grid; place-items: center; width: 33px; height: 33px; }
.bloom-icon { font-size: 36px; line-height: 1; font-weight: 200; }
.audio-strip { display: flex; align-items: center; gap: 12px; border-top: 1px solid var(--line); margin-top: 13px; padding: 12px 0; }
.primary-button, .secondary-button, .stop-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 15px; border-radius: 8px; font-size: 12px; font-weight: 500; text-decoration: none; white-space: nowrap; }
.primary-button { background: var(--accent); color: var(--accent-ink); }
.primary-button:hover { background: #e2f2f8; }
.primary-button svg { width: 16px; height: 16px; }
.secondary-button { background: var(--raised); border: 1px solid var(--line); color: var(--ink); }
.secondary-button:hover, .secondary-button[aria-pressed='true'] { background: #2b363c; }
.text-button { padding: 0 4px; min-height: 44px; background: transparent; color: #bdc9cf; font-size: 12px; white-space: nowrap; }
.text-button:hover { color: #fff; }
.track-info { display: grid; gap: 5px; flex: 1; min-width: 0; margin-left: 3px; }
#songTitle { color: #c1cdd2; font-size: 11px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
#audioState { color: var(--muted); font-size: 10px; }
.play-button { width: 46px; min-height: 44px; flex-direction: column; gap: 2px; background: transparent; border-color: transparent; }
.play-button kbd { font: 8px/1 var(--mono); color: var(--muted); }
#player { display: flex; align-items: center; gap: 10px; padding: 0 0 10px; }
#player span { font: 10px/1 var(--mono); color: var(--muted); min-width: 32px; }
#player span:last-child { text-align: right; }
input[type='range'] { appearance: none; height: 24px; background: transparent; cursor: pointer; width: 100%; margin: 0; }
input[type='range']::-webkit-slider-runnable-track { height: 3px; background: #3d4b52; border-radius: 3px; }
input[type='range']::-moz-range-track { height: 3px; background: #3d4b52; border-radius: 3px; }
input[type='range']::-webkit-slider-thumb { appearance: none; width: 11px; height: 11px; margin-top: -4px; border-radius: 50%; background: var(--accent); }
input[type='range']::-moz-range-thumb { width: 11px; height: 11px; border: 0; border-radius: 50%; background: var(--accent); }
.floating-panel { position: fixed; top: 78px; right: 22px; width: 324px; max-width: calc(100% - 28px); max-height: calc(100dvh - 104px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; padding: 23px; background: var(--surface); border: 1px solid var(--line); border-radius: 15px; box-shadow: 0 12px 60px #0008; z-index: 18; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 22px; }
.panel-heading .eyebrow { font-size: 9px; }
.panel-heading h2 { margin: 7px 0 0; font-size: 17px; font-weight: 500; }
.panel-heading .icon-button { width: 32px; min-height: 32px; font-size: 25px; border: 0; background: transparent; align-self: flex-start; }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.slider-field { margin-bottom: 18px; }
.slider-field label { display: flex; justify-content: space-between; align-items: center; font-size: 12px; margin-bottom: 6px; }
.slider-field output { font: 10px/1 var(--mono); color: var(--muted); }
.slider-field p, .panel-note { color: var(--muted); font-size: 11px; line-height: 1.8; }
.slider-field p { margin: 3px 0 0; font-size: 10px; }
.field-group { margin: 20px 0; }
.field-label, .select-field { font-size: 12px; }
.palette-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; }
.palette-options button { display: flex; justify-content: center; align-items: center; gap: 7px; flex: 1; min-height: 40px; padding: 0 8px; border: 1px solid var(--line); border-radius: 7px; background: transparent; color: #c5ced2; font-size: 11px; }
.palette-options button[aria-pressed='true'] { border-color: #c2e1ec73; background: #c2e1ec0a; color: var(--ink); }
.swatch { display: block; width: 8px; height: 8px; border-radius: 50%; }
.ice { background: #bde5f4; }.white { background: #fff; }.violet { background: #b08cec; }
.crimson { background: #e64d69; }.amber { background: #edba72; }
.background-options { display: flex; gap: 7px; margin-top: 10px; }
.background-options button { min-height: 40px; flex: 1; border: 1px solid var(--line); border-radius: 7px; font-size: 11px; background: transparent; color: var(--muted); }
.background-options button[aria-pressed='true'] { border-color: #c2e1ec73; background: #c2e1ec0a; color: var(--ink); }
.advanced-settings { margin: 0 0 22px; padding: 12px 0 0; border-top: 1px solid var(--line); }
.advanced-settings summary { cursor: pointer; font-size: 12px; padding: 8px 0; color: #c4d1d7; }
.advanced-settings[open] summary { margin-bottom: 12px; }
.advanced-settings .slider-field:last-child { margin-bottom: 0; }
.recording-help { color: #cee4ed; background: #c2e1ec09; border-left: 2px solid #8da6b1; padding: 10px 12px; font-size: 11px; line-height: 1.8; margin: 18px 0 0; }
.paper-scene { background: #f4f2ee; }
.paper-scene .scene-caption { color: #16222a; }
.paper-scene .scene-caption .eyebrow, .paper-scene #sceneNumber, .paper-scene #sceneDescription { color: #536069; }
.paper-scene .app-header::before { background: linear-gradient(#f4f2ee88, transparent); }
.select-field { display: grid; gap: 9px; }
select { width: 100%; min-height: 40px; border: 1px solid #49565d; border-radius: 7px; padding: 8px 10px; background: #1a2023; font-size: 12px; }
.band-monitor { display: grid; gap: 9px; margin: 24px 0; border-top: 1px solid var(--line); padding-top: 20px; }
.band-monitor div { display: flex; align-items: center; gap: 15px; }
.band-monitor span { min-width: 29px; font: 8px/1 var(--mono); color: var(--muted); letter-spacing: .08em; }
.band-monitor i { height: 2px; flex: 1; background: #253036; overflow: hidden; }
.band-monitor b { display: block; height: 100%; background: var(--accent); width: 100%; transform: scaleX(0); transform-origin: left; }
#micBtn { width: 100%; }.reset-button { width: 100%; margin-top: 6px; font-size: 11px; }
.panel-note { margin: 12px 0 0; }
#exportStatus { overflow-wrap: anywhere; }
#downloadDiagnostic { margin-top: 12px; max-width: 100%; }
.export-options { display: grid; gap: 18px; margin-top: 22px; }
.check-field { display: flex; align-items: center; gap: 9px; font-size: 12px; min-height: 30px; }
input[type='checkbox'] { width: 16px; height: 16px; accent-color: var(--accent); }
#transparencyNote { margin: -15px 0 0; font-size: 10px; }
.export-actions { display: flex; margin-top: 22px; }
.export-actions button { width: 100%; }.stop-button { background: #873e46; color: #fff; }
#exportStatus.error { color: #ffb8bb; }
#exportResult { border-top: 1px solid var(--line); margin-top: 20px; padding-top: 16px; }
#exportPreview { width: 100%; max-height: 200px; border-radius: 7px; }
#downloadVideo { width: 100%; margin-top: 12px; }
#showUiBtn { position: fixed; bottom: 22px; right: 22px; z-index: 25; opacity: .55; }
#showUiBtn:hover, #showUiBtn:focus-visible { opacity: 1; }
kbd { padding: 2px 4px; border: 1px solid var(--line); border-radius: 3px; font: 9px var(--mono); }
.ui-hidden .chrome { display: none; }
#recordingBadge { position: fixed; left: 50%; top: 78px; transform: translateX(-50%); z-index: 30; display: flex; gap: 8px; align-items: center; padding: 7px 8px 7px 13px; border: 1px solid #bc687255; border-radius: 9px; background: #321a20f0; font-size: 11px; }
#recordingTime { font: 10px var(--mono); min-width: 32px; }
#quickStopBtn { min-height: 30px; padding: 0 10px; border: 1px solid #d6969e66; border-radius: 5px; background: #87414c; color: #fff; font-size: 11px; }
#quickStopBtn:hover { background: #a2505d; }
.record-dot { width: 6px; height: 6px; background: #ff9d9d; border-radius: 50%; }
#dropOverlay { position: fixed; inset: 12px; z-index: 50; display: grid; place-items: center; border: 1px dashed #b6d7e1; border-radius: 18px; background: #0b151bec; pointer-events: none; font-size: 18px; }
#notice { position: fixed; top: 82px; left: 50%; transform: translateX(-50%); z-index: 60; max-width: calc(100vw - 32px); padding: 13px 20px; background: #1f2c32f7; color: var(--ink); border: 1px solid #8daebb55; border-radius: 10px; font-size: 12px; line-height: 1.7; pointer-events: none; }
.is-recording #notice { top: 128px; }
.transparent-preview { background: repeating-conic-gradient(#192126 0% 25%, #293239 0% 50%) 0 / 24px 24px; }
.paper-scene.transparent-preview .scene-caption { color: var(--ink); }
.paper-scene.transparent-preview .scene-caption .eyebrow, .paper-scene.transparent-preview #sceneNumber, .paper-scene.transparent-preview #sceneDescription { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
@media (min-width: 1600px) { .scene-caption { top: 128px; left: 46px; } }
@media (max-width: 1000px) {
  .bottom-dock { width: min(680px, calc(100% - 36px)); bottom: 22px; }
  .scene-tools { bottom: 320px; right: 18px; }
  .scene-caption { top: 100px; left: 24px; }
}
@media (max-width: 600px) {
  .header-actions { top: max(12px, env(safe-area-inset-top)); right: 12px; gap: 5px; }
  .header-actions .quiet-button { width: 40px; min-height: 44px; padding: 0; }
  .header-actions .quiet-button span, #hideUiBtn { display: none; }
  .scene-caption { top: 92px; left: 22px; }
  .scene-caption .eyebrow { font-size: 8px; letter-spacing: .1em; }
  h1 { font-size: 29px; margin-top: 8px; }
  #sceneDescription { font-size: 11px; max-width: 250px; }
  .bottom-dock { width: calc(100% - 24px); bottom: max(12px, env(safe-area-inset-bottom)); padding: 10px 10px 0; border-radius: 13px; }
  .preset-heading { margin-bottom: 5px; }.preset-heading .eyebrow { font-size: 8px; }
  .collection-tabs button { gap: 4px; padding: 0 6px; min-height: 34px; font-size: 10px; }
  .collection-tabs small { font-size: 7px; }
  #autoBtn { padding: 0 4px; font-size: 10px; gap: 5px; }
  .live-tools { gap: 4px; margin-top: 8px; padding-top: 8px; }
  .live-tools > button { padding: 0 4px; min-height: 44px; min-width: 44px; font-size: 10px; }
  .live-tools kbd { display: none; }
  .transition-control { width: 88px; }.transition-control select { padding: 5px; font-size: 9px; min-height: 44px; }
  .expression-tabs { gap: 3px; }.expression-tabs button { min-height: 75px; padding: 7px 0; gap: 5px; font-size: 10px; }
  .expression-tabs svg, .preset-icon { width: 27px; height: 27px; }.bloom-icon { font-size: 30px; }
  .expression-tabs small { font-size: 6px; letter-spacing: .02em; margin-top: 4px; }
  .audio-strip { gap: 10px; margin-top: 9px; padding: 10px 0; flex-wrap: wrap; }
  .primary-button { padding: 0 12px; font-size: 11px; }
  .track-info { order: 4; flex-basis: 100%; display: flex; justify-content: space-between; margin: -1px 2px 1px; }
  #songTitle { max-width: 73%; font-size: 10px; }#audioState { font-size: 9px; white-space: nowrap; }
  .play-button { margin-left: auto; }.text-button { font-size: 11px; }
  .scene-tools { bottom: 325px; right: 14px; gap: 5px; }.scene-tools .icon-button { width: 36px; min-height: 36px; }
  body.has-audio .scene-tools { bottom: 350px; }
  .is-recording .scene-caption { top: 131px; }
  .floating-panel { top: 72px; right: 12px; max-height: calc(100dvh - 88px); width: 310px; padding: 21px; }
  #notice { top: 73px; width: max-content; }
}
@media (max-height: 600px) and (min-width: 601px) {
  .scene-caption { top: 85px; }.scene-caption h1 { font-size: 26px; }
  .bottom-dock { bottom: 14px; padding-top: 6px; }.expression-tabs button { min-height: 65px; flex-direction: row; gap: 6px; }
  .expression-tabs svg, .preset-icon { width: 24px; height: 24px; }.bloom-icon { font-size: 26px; }
  .preset-heading { margin-bottom: 3px; }.audio-strip { margin-top: 6px; padding: 8px 0; }
  .scene-tools { bottom: 272px; }.floating-panel { top: 72px; max-height: calc(100dvh - 86px); }
}
@media (max-height: 500px) and (orientation: landscape) {
  .scene-caption { top: 85px; }
  .scene-caption .eyebrow, .scene-caption #sceneDescription { display: none; }
  .scene-caption h1 { font-size: 20px; margin: 0; }
  .bottom-dock { max-height: calc(100dvh - 134px); overflow-y: auto; overscroll-behavior: contain; }
  .scene-tools, body.has-audio .scene-tools { top: 74px; bottom: auto; }
}
@media (prefers-reduced-motion: reduce) { button, a { transition: none; } }
