:root {
  color-scheme: dark;
  font-family: "DM Sans", "Segoe UI", sans-serif;
  background: #101210;
  color: #eeeee7;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  --background: #101210;
  --panel: #171a17;
  --panel-raised: #1c1f1b;
  --border: #2a2d28;
  --border-soft: #252823;
  --text: #eeeee7;
  --subtle: #a4a69b;
  --muted: #767a6e;
  --mint: #bcdf9c;
  --mint-dark: #253525;
  --coral: #e6a18a;
  --mono: "DM Mono", Consolas, monospace;
  --serif: "Fraunces", Georgia, serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
button, select, textarea, input { font: inherit; }
button { color: inherit; }
button:focus-visible, a:focus-visible, select:focus-visible, textarea:focus-visible, input:focus-visible { outline: 2px solid var(--mint); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

body { margin: 0; min-width: 360px; min-height: 100vh; background: var(--background); }
.app { min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 4;
  display: flex;
  width: 234px;
  flex-direction: column;
  padding: 27px 15px 16px;
  border-right: 1px solid var(--border-soft);
  background: #141613;
}
.brand { display: flex; align-items: center; gap: 11px; margin: 0 0 34px 8px; color: var(--text); text-decoration: none; font-size: 19px; font-weight: 700; letter-spacing: -.06em; }
.brand-dot { color: var(--mint); }
.brand-mark { display: flex; width: 28px; height: 28px; align-items: center; justify-content: center; gap: 3px; overflow: hidden; border: 1px solid #495a3e; border-radius: 9px; background: linear-gradient(145deg, #313d2c, #1d281e); transform: rotate(-8deg); }
.brand-mark span { width: 3px; border-radius: 3px; background: var(--mint); }
.brand-mark span:nth-child(1) { height: 8px; opacity: .65; }
.brand-mark span:nth-child(2) { height: 15px; }
.brand-mark span:nth-child(3) { height: 10px; opacity: .8; }
.back-link { display: flex; align-items: center; gap: 10px; height: 39px; margin: 0 0 30px 5px; color: #a6a99f; font-size: 12px; font-weight: 600; text-decoration: none; }
.back-link:hover { color: var(--text); }
.back-link svg { width: 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.5; }
.side-section { display: grid; gap: 6px; }
.side-label, .section-kicker { color: var(--muted); font: 500 9px/1.3 var(--mono); letter-spacing: .14em; }
.side-label { margin: 0 0 7px 10px; }
.side-link { display: flex; min-height: 39px; align-items: center; gap: 10px; padding: 0 10px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: #a7aaa0; text-align: left; font-size: 12px; cursor: pointer; }
.side-link:hover, .side-link.active { border-color: #292d26; background: #1c1f1b; color: #e8ebdf; }
.side-link.active { color: var(--mint); }
.side-link svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.45; }
.side-count { display: grid; width: 18px; height: 18px; place-items: center; margin-left: auto; border-radius: 6px; background: #293326; color: var(--mint); font-size: 10px; }
.sidebar-project { display: grid; gap: 10px; margin-top: 33px; }
.project-item { display: flex; align-items: center; gap: 9px; padding: 7px 6px; border: 0; border-radius: 8px; background: transparent; text-align: left; cursor: pointer; }
.project-item:hover { background: #1d201b; }
.project-thumb { display: grid; width: 36px; height: 36px; flex: 0 0 36px; place-items: center; overflow: hidden; border: 1px solid #414a37; border-radius: 7px; background: linear-gradient(155deg, #819566, #344637 55%, #c0936e); }
.project-thumb span { width: 12px; height: 16px; border: 1.5px solid #edd0a1; border-radius: 50% 50% 42% 42%; background: #e1b688; box-shadow: 0 13px 0 5px #c7704e; }
.project-copy { display: grid; min-width: 0; gap: 4px; }
.project-copy strong { overflow: hidden; color: #e0e1d8; font-size: 11px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.project-copy small { color: var(--muted); font-size: 10px; }
.project-menu { margin-left: auto; color: #777a70; letter-spacing: 1px; }
.sidebar-bottom { display: grid; gap: 12px; margin-top: auto; }
.privacy-card { display: grid; grid-template-columns: 22px 1fr; gap: 6px 9px; padding: 12px 10px; border: 1px solid #2d342a; border-radius: 9px; background: linear-gradient(145deg, #1c211a, #171a16); }
.privacy-icon { display: grid; width: 22px; height: 22px; place-items: center; border-radius: 7px; background: #2c3829; color: var(--mint); }
.privacy-icon svg { width: 15px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.4; }
.privacy-card strong { align-self: center; color: #d7ddcb; font-size: 10px; }
.privacy-card > span:last-child { grid-column: 2; color: #979a8d; font-size: 9px; line-height: 1.5; }
.connection-link { margin: 0 0 0 0; font-size: 10px; }
.connection-link svg { width: 15px; height: 15px; }

.main { min-height: 100vh; margin-left: 234px; }
.topbar { position: sticky; top: 0; z-index: 3; display: flex; height: 62px; align-items: center; justify-content: space-between; gap: 15px; padding: 0 32px; border-bottom: 1px solid var(--border-soft); background: #101210ed; backdrop-filter: blur(14px); }
.breadcrumbs { display: flex; align-items: center; gap: 10px; color: #85897e; font-size: 11px; }
.breadcrumbs strong { color: #d8d9d0; font-weight: 500; }
.crumb-slash { color: #484b44; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.save-state { display: inline-flex; align-items: center; gap: 7px; margin-right: 4px; color: #92978a; font-size: 10px; }
.save-dot { width: 6px; height: 6px; border-radius: 50%; background: #9cbe80; box-shadow: 0 0 8px #9cbe804d; }
.save-state.saving .save-dot { background: #dfab79; }
.button { display: inline-flex; min-height: 34px; align-items: center; justify-content: center; gap: 7px; padding: 0 11px; border: 1px solid #373a33; border-radius: 7px; font-size: 10px; font-weight: 600; cursor: pointer; transition: background .16s ease, transform .16s ease, border-color .16s ease; }
.button:hover { transform: translateY(-1px); }
.button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.5; }
.button-quiet { background: #1a1d19; color: #c1c4b8; }
.button-quiet:hover { background: #232720; border-color: #4a5042; }
.button-primary { border-color: #d7e9be; background: var(--mint); color: #22281d; }
.button-primary:hover { background: #cde7ad; }
.content { width: min(1510px, 100%); margin: 0 auto; padding: 28px 32px 18px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 0 0 23px; }
.eyebrow { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; color: #9da08f; font: 500 9px/1.4 var(--mono); letter-spacing: .1em; }
.eyebrow-mark { width: 6px; height: 6px; border-radius: 50%; background: #c6dc9f; box-shadow: 0 0 8px #bbde9e77; }
h1 { margin: 0; font-family: var(--serif); font-size: clamp(29px, 3.2vw, 40px); font-weight: 500; letter-spacing: -.045em; }
h1 em { color: var(--mint); font-weight: 500; }
.page-heading p { margin: 7px 0 0; color: #a0a297; font-size: 11px; }
.format-chip { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; padding: 8px 11px; border: 1px solid #30342e; border-radius: 7px; background: #191c18; color: #c5c6bd; font: 10px var(--mono); }
.format-chip label { color: #92958a; font: 9px "DM Sans", "Segoe UI", sans-serif; }
.format-chip select { max-width: 154px; padding: 3px 5px; border: 1px solid #383d34; border-radius: 4px; background: #111410; color: #e4e5db; font: 9px "DM Sans", "Segoe UI", sans-serif; }
.format-chip > span:last-child { color: #92958a; font: 8px var(--mono); white-space: nowrap; }
.format-icon { color: #bbd79f; font-size: 14px; }
.chip-divider { height: 14px; border-left: 1px solid #42443c; }

.workbench { display: grid; grid-template-columns: minmax(0, 1.57fr) minmax(305px, .75fr); align-items: start; gap: 19px; }
.stage-column { min-width: 0; }
.section-top, .timeline-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-top { margin: 0 0 10px; }
.section-top h2, .timeline-heading h2, .panel-heading h2 { margin: 4px 0 0; color: #e4e5db; font-size: 13px; font-weight: 600; letter-spacing: -.01em; }
.rolling-pill { display: inline-flex; align-items: center; gap: 7px; padding: 6px 9px; border: 1px solid #343a30; border-radius: 99px; background: #1b2019; color: #bad1a6; font-size: 9px; }
.rolling-dot, .live-dot { width: 6px; height: 6px; border-radius: 50%; background: #b7db91; box-shadow: 0 0 9px #b7db9180; }
.stage-frame { position: relative; overflow: hidden; width: min(100%, var(--stage-max-width, 128vh)); max-height: 72vh; aspect-ratio: 16 / 9; margin-right: auto; margin-left: auto; border: 1px solid #30342e; border-radius: 9px; background: #3a4d3e; box-shadow: 0 17px 36px #0003, 0 0 0 4px #ffffff03; }
.stage-frame::after { position: absolute; z-index: 1; inset: 0; border: 1px solid #ffffff0b; border-radius: inherit; content: ""; pointer-events: none; }
#film-canvas { display: block; width: 100%; height: 100%; object-fit: fill; }
.stage-overlay { position: absolute; top: 12px; z-index: 2; display: inline-flex; align-items: center; gap: 6px; padding: 5px 7px; border: 1px solid #dfe6c533; border-radius: 5px; background: #151a16a8; color: #e4e7da; font: 8px var(--mono); letter-spacing: .07em; backdrop-filter: blur(8px); }
.top-left { left: 12px; }
.top-left .live-dot { width: 5px; height: 5px; background: #eea084; box-shadow: 0 0 8px #eea084a6; }
.top-right { right: 12px; }
.top-right span { color: #9ba194; }
.stage-caption { position: absolute; z-index: 2; right: 16px; bottom: 56px; left: 16px; display: grid; gap: 4px; padding: 10px 12px; border: 1px solid #ffffff20; border-radius: 6px; background: #191a17bd; backdrop-filter: blur(10px); }
.caption-speaker { color: #c8dca8; font: 500 8px var(--mono); letter-spacing: .11em; }
.stage-caption #caption-text { overflow: hidden; color: #fffaf0; font-family: var(--serif); font-size: clamp(12px, 1.4vw, 17px); line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.stage-controls { position: absolute; right: 0; bottom: 0; left: 0; z-index: 2; display: flex; height: 45px; align-items: center; gap: 10px; padding: 0 11px; border-top: 1px solid #ffffff0c; background: #121511ad; backdrop-filter: blur(9px); }
.round-control { display: grid; width: 26px; height: 26px; flex: 0 0 26px; place-items: center; padding: 0; border: 1px solid #ffffff26; border-radius: 50%; background: #ffffff10; color: #eef0e5; cursor: pointer; }
.round-control:hover { background: #ffffff20; }
.round-control svg { width: 15px; height: 15px; fill: currentColor; }
.round-control .pause-icon { display: none; fill: none; stroke: currentColor; stroke-linecap: round; stroke-width: 2; }
.round-control.is-playing .play-icon { display: none; }
.round-control.is-playing .pause-icon { display: block; }
.voice-button { display: flex; align-items: center; gap: 5px; padding: 5px 8px; border: 1px solid #ffffff1a; border-radius: 5px; background: #ffffff08; color: #e1e2d9; font-size: 9px; cursor: pointer; }
.voice-button:hover, .voice-button.speaking { border-color: #b8d59666; background: #b8d59615; color: #d4e5bc; }
.voice-button svg { width: 14px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.45; }
.stage-time { margin-left: auto; color: #c6c7bd; font: 9px var(--mono); }
.stage-time span { color: #71766b; }
.camera-mark { display: flex; height: 18px; align-items: center; gap: 3px; margin-left: 2px; padding: 0 6px; border-left: 1px solid #ffffff18; }
.camera-mark span { width: 2px; border-radius: 4px; background: #c2dc9e; animation: camera-bars .8s ease-in-out infinite alternate; }
.camera-mark span:nth-child(1) { height: 5px; animation-delay: -.3s; }
.camera-mark span:nth-child(2) { height: 11px; }
.camera-mark span:nth-child(3) { height: 7px; animation-delay: -.55s; }
@keyframes camera-bars { to { height: 3px; opacity: .55; } }
.stage-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin: 9px 2px 0; color: #85897e; font-size: 9px; }
.stage-foot strong { color: #c7d7b4; font-weight: 600; }
.foot-spark { margin-right: 3px; color: var(--mint); }

.timeline-section { margin: 24px 0 0; }
.timeline-heading { margin-bottom: 10px; }
.timeline-heading h2 { display: flex; align-items: center; gap: 8px; }
.count-pill { padding: 4px 7px; border: 1px solid #34372e; border-radius: 5px; background: #1a1d19; color: #a3a697; font: 9px var(--mono); }
.text-button, .ai-text-button { display: inline-flex; align-items: center; gap: 6px; padding: 6px 8px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: #c9dcae; font-size: 10px; cursor: pointer; }
.text-button:hover, .ai-text-button:hover { border-color: #384132; background: #20261d; }
.text-button > span, .ai-text-button > span { color: #c6dc9f; }
.timeline { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.scene-card { min-width: 0; padding: 0; overflow: hidden; border: 1px solid #2b2f29; border-radius: 7px; background: #191c18; color: inherit; text-align: left; cursor: pointer; transition: border-color .15s ease, transform .15s ease; }
.scene-card:hover { transform: translateY(-2px); border-color: #657652; }
.scene-card.selected { border-color: #a9c987; box-shadow: 0 0 0 1px #a9c98726; }
.scene-thumb { position: relative; display: flex; height: 66px; align-items: center; justify-content: center; overflow: hidden; border-bottom: 1px solid #ffffff0c; background: linear-gradient(145deg, #617453, #243d35 68%, #d29d6f); }
.scene-card:nth-child(3n + 2) .scene-thumb { background: linear-gradient(145deg, #c18a64, #78514d 52%, #33423b); }
.scene-card:nth-child(3n) .scene-thumb { background: linear-gradient(145deg, #75866c, #405749 55%, #334844); }
.scene-thumb::before { position: absolute; right: 13%; bottom: -31px; width: 100px; height: 68px; border-radius: 50%; background: #c5a47560; content: ""; }
.scene-mini-puppet { position: relative; z-index: 1; width: 18px; height: 22px; margin-top: 14px; border-radius: 45% 45% 35% 35%; background: #d8ac79; box-shadow: 0 24px 0 8px #bf7654; }
.scene-mini-puppet::before { position: absolute; top: 7px; left: 4px; width: 2px; height: 2px; border-radius: 50%; background: #302d29; box-shadow: 7px 0 #302d29; content: ""; }
.scene-index { position: absolute; top: 7px; left: 8px; color: #ffffffc4; font: 9px var(--mono); }
.scene-info { display: grid; gap: 5px; padding: 8px; }
.scene-info strong { overflow: hidden; color: #d8dbd0; font-size: 9px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.scene-info span { overflow: hidden; color: #85897d; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.scene-add { display: flex; min-height: 110px; align-items: center; justify-content: center; gap: 7px; border: 1px dashed #343930; border-radius: 7px; background: transparent; color: #969a8e; font-size: 9px; cursor: pointer; }
.scene-add:hover { border-color: #83966e; color: #c7d7b4; }
.scene-add span { color: #c7d7b4; font-size: 14px; }

.inspector { display: grid; gap: 10px; min-width: 0; }
.inspector-panel { min-width: 0; padding: 13px; border: 1px solid #2b2f29; border-radius: 8px; background: var(--panel); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 10px; }
.panel-heading h2 { margin-top: 3px; }
.local-badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 6px; border: 1px solid #363d30; border-radius: 5px; color: #b9c9a8; font: 7px var(--mono); letter-spacing: .06em; white-space: nowrap; }
.local-badge > span { width: 5px; height: 5px; border-radius: 50%; background: #c4de9b; }
.script-panel textarea { display: block; width: 100%; min-height: 137px; resize: vertical; padding: 10px; border: 1px solid #30332d; border-radius: 6px; background: #121511; color: #e7e8df; font-size: 10px; line-height: 1.68; }
.script-panel textarea::placeholder { color: #71756a; }
.script-panel textarea:focus { border-color: #859b70; }
.script-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 5px 8px; margin: 7px 0 0; }
.script-footer > span { color: #888c80; font: 9px var(--mono); }
.ai-actions { display: flex; flex-wrap: wrap; gap: 2px; }
.ai-text-button { padding: 5px 6px; font-size: 8px; white-space: nowrap; }
.local-ai-button { border-color: #3b4932; background: #222b1e; color: #d3e4bf; }
.ai-text-button:disabled { cursor: wait; opacity: .7; }
.field-hint { margin: 5px 0 0; color: #85887d; font-size: 8px; line-height: 1.5; }
.character-panel { padding-bottom: 11px; }
.character-panel .panel-heading { margin-bottom: 7px; }
.avatar-emoji { display: grid; width: 25px; height: 25px; place-items: center; border: 1px solid #404636; border-radius: 7px; background: #252d21; color: #c5dba3; }
.character-row { display: flex; align-items: center; gap: 9px; padding: 8px; border: 1px solid #282c26; border-radius: 6px; background: #141613; }
.character-swatch { display: grid; width: 31px; height: 31px; flex: 0 0 31px; place-items: center; border-radius: 6px; background: linear-gradient(145deg, #596d4e, #273c35); }
.mini-puppet { position: relative; width: 12px; height: 14px; margin-top: 8px; border-radius: 48% 48% 40% 40%; background: #dfb487; box-shadow: 0 12px 0 5px #c87858; }
.mini-puppet i, .mini-puppet b { position: absolute; top: 5px; left: 3px; width: 2px; height: 2px; border-radius: 50%; background: #343229; }
.mini-puppet b { left: 8px; }
.character-row > div:nth-child(2) { display: grid; min-width: 0; gap: 4px; }
.character-row strong { color: #d8dbd0; font-size: 9px; font-weight: 600; }
.character-row > div:nth-child(2) > span { overflow: hidden; color: #878b80; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.edit-character { display: grid; width: 24px; height: 24px; flex: 0 0 24px; place-items: center; margin-left: auto; border: 1px solid #30352d; border-radius: 5px; background: #1e211c; color: #bdc5b2; cursor: pointer; }
.edit-character:hover { border-color: #798c68; color: var(--mint); }
.style-credit { color: #85897d; font: 7px var(--mono); letter-spacing: .07em; }
.style-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.style-option { display: grid; min-width: 0; gap: 5px; padding: 0; border: 1px solid transparent; border-radius: 6px; background: transparent; color: #9ea195; font-size: 8px; cursor: pointer; }
.style-option > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.style-option:hover { color: #e2e4d8; }
.style-option.selected { color: #d9e7c7; }
.style-option.selected .style-art { outline: 1px solid #b1cc91; outline-offset: 1px; }
.style-art { position: relative; display: block; height: 37px; overflow: hidden; border: 1px solid #393d34; border-radius: 5px; background: linear-gradient(145deg, #91a16f, #38453a 65%, #d5ab7d); }
.style-art::before { position: absolute; bottom: -14px; left: 18%; width: 45px; height: 35px; border-radius: 50%; background: #c7a375; content: ""; }
.style-art i { position: absolute; z-index: 1; top: 4px; right: 16%; width: 14px; height: 18px; border-radius: 50% 50% 45% 45%; background: #e2b991; box-shadow: 0 17px 0 7px #c67554; }
.style-noir { background: linear-gradient(145deg, #88887e, #30342e 60%, #bab9a4); filter: grayscale(1); }
.style-sunset { background: linear-gradient(145deg, #dd996b, #843f45 62%, #41483c); }
.style-sunset::before { background: #e1c277; }
.style-comic { background: radial-gradient(circle at 70% 30%, #e8c763 0 12%, transparent 13%), linear-gradient(145deg, #90bd7e, #35634f 55%, #e58559); }
.style-comic::after { position: absolute; inset: 0; background-image: radial-gradient(#272920a6 .6px, transparent .7px); background-size: 5px 5px; content: ""; }
.style-note { margin: 7px 0 0; color: #808479; font-size: 8px; }
.control-label { display: block; margin: 8px 0 5px; color: #c7c9be; font-size: 9px; font-weight: 600; }
.control-label span { color: #85897d; font-weight: 400; }
.select-wrap { position: relative; }
.select-wrap select { width: 100%; min-height: 31px; appearance: none; padding: 0 28px 0 9px; border: 1px solid #30342d; border-radius: 5px; background: #121511; color: #d0d2c7; font-size: 9px; cursor: pointer; }
.select-wrap > span { position: absolute; top: 50%; right: 9px; color: #9da192; font-size: 13px; transform: translateY(-50%); pointer-events: none; }
.motion-label { margin-top: 10px; }
.audio-label { margin-top: 11px; }
.audio-upload { display: flex; min-height: 31px; align-items: center; gap: 7px; overflow: hidden; padding: 0 7px; border: 1px dashed #41473a; border-radius: 5px; background: #151813; color: #b4b8aa; font-size: 8px; cursor: pointer; }
.audio-upload:hover { border-color: #82966d; color: #d9e3ce; }
.audio-upload input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
.upload-icon { display: grid; width: 17px; height: 17px; flex: 0 0 17px; place-items: center; border-radius: 4px; background: #2b3425; color: #c5dba3; }
.audio-upload #audio-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-browse { flex: 0 0 auto; margin-left: auto; color: #d2e3be; font-weight: 600; }
.audio-hint { margin-top: 5px; }
.tts-button { display: flex; width: 100%; min-height: 31px; align-items: center; justify-content: center; gap: 7px; margin-top: 9px; border: 1px solid #49573c; border-radius: 5px; background: linear-gradient(110deg, #303b29, #282c23); color: #d3e2be; font-size: 9px; font-weight: 600; cursor: pointer; }
.tts-button:hover { border-color: #83966d; background: #394631; }
.tts-button:disabled { opacity: .6; cursor: wait; }
.tts-button > span { color: #d5e7b6; }
.broll-card { position: relative; display: grid; grid-template-columns: 30px 1fr 27px; align-items: center; gap: 8px; overflow: hidden; padding: 10px; border: 1px solid #404337; border-radius: 8px; background: linear-gradient(110deg, #24281f, #1d211c 58%, #28231d); }
.broll-glow { position: absolute; top: -38px; right: 37px; width: 120px; height: 100px; border-radius: 50%; background: #9cac5866; filter: blur(28px); pointer-events: none; }
.broll-icon { position: relative; display: grid; width: 29px; height: 29px; place-items: center; border: 1px solid #4b503d; border-radius: 8px; background: linear-gradient(145deg, #3e4933, #242c22); color: #d0e0a9; font-size: 17px; }
.broll-card > div:nth-child(2) { position: relative; min-width: 0; }
.broll-card strong { color: #e2e3d8; font-size: 9px; font-weight: 600; }
.broll-card p { margin: 4px 0 0; color: #96998c; font-size: 8px; }
.broll-card > button { position: relative; display: grid; width: 27px; height: 27px; place-items: center; border: 1px solid #4e573f; border-radius: 6px; background: #333b2b; color: #d1e4b7; font-size: 14px; cursor: pointer; }
.broll-card > button:hover { background: #3c4932; }
.page-footer { display: flex; justify-content: space-between; gap: 15px; margin: 24px 0 0; padding: 12px 1px 0; border-top: 1px solid #242721; color: #73776c; font-size: 9px; }
.page-footer a { color: #aeb9a3; text-decoration: none; }
.page-footer a:hover { color: #d7e5c4; text-decoration: underline; }
.footer-divider { padding: 0 6px; color: #53574e; }
.app-toast { position: fixed; right: 24px; bottom: 20px; z-index: 8; max-width: min(440px, calc(100vw - 32px)); padding: 12px 15px; border: 1px solid #536746; border-radius: 8px; background: #22291f; box-shadow: 0 12px 32px #0008; color: #d8e6c8; font-size: 11px; line-height: 1.5; }
.app-toast.error { border-color: #704b43; background: #2a211e; color: #f0c1b4; }

.connections-dialog { position: relative; width: min(510px, calc(100vw - 32px)); max-height: min(90vh, 780px); padding: 23px; overflow-y: auto; border: 1px solid #394034; border-radius: 12px; background: #181b17; color: var(--text); box-shadow: 0 25px 100px #000a; }
.connections-dialog::backdrop { background: #090b09c9; backdrop-filter: blur(4px); }
.dialog-close-form { position: absolute; top: 12px; right: 13px; }
.dialog-close { display: grid; width: 27px; height: 27px; place-items: center; border: 1px solid #373b33; border-radius: 6px; background: #21241e; color: #bfc2b6; font-size: 19px; cursor: pointer; }
.dialog-close:hover { background: #2a2f26; }
.dialog-heading { display: flex; align-items: center; gap: 11px; margin: 0 0 9px; }
.dialog-spark { display: grid; width: 36px; height: 36px; place-items: center; border: 1px solid #46513a; border-radius: 10px; background: #273023; color: #c5dc9e; font-size: 20px; }
.dialog-heading h2 { margin: 4px 0 0; font-family: var(--serif); font-size: 23px; font-weight: 500; letter-spacing: -.025em; }
.dialog-intro { margin: 0 0 17px; color: #a0a397; font-size: 10px; line-height: 1.65; }
.connection-fields { display: grid; gap: 11px; }
.connection-fields label { display: grid; gap: 5px; color: #d1d3c8; font-size: 9px; font-weight: 600; }
.connection-fields input { width: 100%; height: 34px; padding: 0 10px; border: 1px solid #353a32; border-radius: 5px; background: #111410; color: #ebece1; font-size: 10px; }
.connection-fields input::placeholder { color: #6d7167; }
.connection-fields small { color: #909487; font-size: 9px; font-weight: 400; line-height: 1.5; }
.connection-fields small a { color: #c5dc9e; text-decoration: underline; text-underline-offset: 2px; }
.connection-fields small a:hover { color: #e0edcc; }
.privacy-callout { display: flex; gap: 8px; margin: 15px 0; padding: 10px; border: 1px solid #354032; border-radius: 7px; background: #20271d; color: #b9c7aa; }
.privacy-callout > span { padding-top: 1px; font-size: 12px; }
.privacy-callout p { margin: 0; font-size: 9px; line-height: 1.6; }
.privacy-callout strong { color: #d7e2c9; }
.dialog-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dialog-actions > span { color: #ca9183; font-size: 9px; }
.dialog-actions .button { min-height: 35px; padding: 0 13px; }
.export-details { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 18px 0; }
.export-details span { display: grid; gap: 5px; padding: 11px; border: 1px solid #33372f; border-radius: 7px; background: #131612; }
.export-details strong { color: #dce5d2; font-size: 11px; font-weight: 600; }
.export-details small { color: #85897d; font-size: 8px; }
.export-message { min-height: 15px; color: #a8c987; font-size: 9px; }
.export-message.error { color: #e9a596; }
.export-message.recording { color: #e4b584; }

@media (min-width: 1500px) {
  .content { padding-right: 42px; padding-left: 42px; }
  .workbench { grid-template-columns: minmax(0, 1.66fr) minmax(330px, .72fr); gap: 22px; }
}
@media (max-width: 1150px) {
  .content { padding-right: 23px; padding-left: 23px; }
  .topbar { padding-right: 23px; padding-left: 23px; }
  .workbench { grid-template-columns: minmax(0, 1.25fr) minmax(280px, .82fr); gap: 14px; }
  .inspector-panel { padding: 11px; }
  .stage-caption { bottom: 51px; }
}
@media (max-width: 900px) {
  .sidebar { width: 68px; align-items: center; padding-right: 8px; padding-left: 8px; }
  .brand { margin: 0 0 29px; }
  .brand > span:last-child, .back-link, .side-label, .side-link:not(.active), .side-link.active { font-size: 0; }
  .back-link { width: 40px; height: 40px; justify-content: center; margin: 0 0 23px; }
  .back-link svg { width: 19px; }
  .side-section { width: 100%; justify-items: center; }
  .side-link { width: 42px; height: 42px; min-height: 42px; justify-content: center; padding: 0; }
  .side-link svg { width: 19px; height: 19px; }
  .side-count, .sidebar-project, .privacy-card { display: none; }
  .sidebar-bottom { width: 100%; justify-items: center; }
  .connection-link { width: 42px; height: 42px; }
  .main { margin-left: 68px; }
  .workbench { grid-template-columns: minmax(0, 1fr); }
  .inspector { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .script-panel { grid-row: span 2; }
  .sound-panel { grid-row: span 2; }
  .stage-caption #caption-text { font-size: clamp(12px, 2vw, 17px); }
}
@media (max-width: 620px) {
  body { min-width: 360px; }
  .sidebar { width: 50px; padding-right: 5px; padding-left: 5px; }
  .brand-mark { width: 27px; height: 27px; }
  .side-link, .back-link, .connection-link { width: 37px; height: 37px; min-height: 37px; }
  .main { margin-left: 50px; }
  .topbar { height: 56px; padding: 0 11px; }
  .breadcrumbs { gap: 6px; font-size: 9px; }
  .topbar-actions { gap: 5px; }
  .save-state { display: none; }
  .button { min-height: 31px; gap: 4px; padding: 0 7px; font-size: 8px; }
  .button svg { width: 13px; height: 13px; }
  .content { padding: 23px 12px 14px; }
  .page-heading { align-items: flex-start; margin-bottom: 16px; }
  .page-heading p { max-width: 270px; font-size: 10px; line-height: 1.55; }
  .eyebrow { font-size: 8px; }
  h1 { font-size: 30px; }
  .format-chip { gap: 5px; margin-top: 2px; padding: 6px; font-size: 8px; white-space: nowrap; }
  .format-icon { font-size: 11px; }
  .workbench { gap: 18px; }
  .rolling-pill { gap: 5px; padding: 5px 7px; font-size: 8px; white-space: nowrap; }
  .stage-frame { border-radius: 7px; }
  .stage-overlay { top: 7px; padding: 4px 5px; font-size: 7px; }
  .top-left { left: 7px; }
  .top-right { right: 7px; }
  .stage-caption { right: 8px; bottom: 44px; left: 8px; padding: 6px 8px; }
  .stage-caption #caption-text { font-size: 11px; }
  .stage-controls { height: 38px; gap: 6px; padding: 0 7px; }
  .round-control { width: 23px; height: 23px; flex-basis: 23px; }
  .voice-button { gap: 3px; padding: 4px 5px; font-size: 8px; }
  .voice-button svg { width: 12px; }
  .stage-time { font-size: 8px; }
  .camera-mark { gap: 2px; padding-right: 3px; padding-left: 5px; }
  .stage-foot { font-size: 8px; }
  .timeline { gap: 6px; }
  .scene-thumb { height: 52px; }
  .scene-info { gap: 4px; padding: 6px; }
  .scene-info strong { font-size: 8px; }
  .scene-info span { font-size: 7px; }
  .inspector { gap: 8px; grid-template-columns: minmax(0, 1fr); }
  .script-panel, .sound-panel { grid-row: auto; }
  .script-panel textarea { min-height: 122px; }
  .inspector-panel { padding: 11px; }
  .page-footer { flex-direction: column; gap: 7px; margin-top: 17px; font-size: 8px; }
  .app-toast { right: 10px; bottom: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
