/* Waveframe Studio — the editor shell. Core canvas and editing behavior stay in their modules. */
:root {
  color-scheme: dark;
  --bg: #0c0e11;
  --panel: #14171b;
  --panel2: #1b1e24;
  --line: #282d35;
  --line2: #363d47;
  --txt: #eef0f4;
  --mut: #949ca9;
  --dim: #717b8b;
  --acc: #cefa42;
  --acc-dim: #a6ca35;
  --danger: #ff6f86;
  --sans: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --mono: 'Cascadia Code', Consolas, monospace;
  --rail-width: 80px;
  --library-width: 280px;
  --inspector-width: 290px;
  --timeline-height: 226px;
}
html, body { min-width: 320px; height: 100%; }
body { background: var(--bg); font-size: 13px; line-height: 1.5; letter-spacing: .005em; }
button, input, select, textarea { font: inherit; }
button, label.dh-btn, .mod-card { -webkit-tap-highlight-color: transparent; }
button { touch-action: manipulation; }
button, input, select, textarea, [tabindex] { outline-offset: 3px; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible,
[tabindex]:focus-visible, label:has(input:focus-visible) {
  outline: 2px solid var(--acc); outline-offset: 3px;
}
button:disabled { cursor: not-allowed; }
button svg, .tool-tab svg, .empty-icon svg, .dh-mark svg {
  display: block; width: 20px; height: 20px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round;
}
button svg { pointer-events: none; }
* { scrollbar-width: thin; scrollbar-color: #39414b transparent; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: #39414b; border-radius: 8px; }
::selection { background: #cefa4238; color: white; }
#app { display: grid; grid-template-rows: 64px minmax(0, 1fr) var(--timeline-height); height: 100vh; height: 100dvh; overflow: hidden; }
#topbar {
  display: flex; align-items: center; gap: 24px; padding: 0 22px;
  background: #111418; border-bottom: 1px solid var(--line); position: relative; z-index: 15;
}
.brand { display: flex; align-items: center; gap: 11px; flex: none; }
.brand-mark { display: flex; align-items: center; justify-content: center; gap: 3px; width: 28px; height: 30px; color: var(--acc); }
.brand-mark i { display: block; width: 3px; height: 13px; border-radius: 2px; background: currentColor; }
.brand-mark i:nth-child(2) { height: 27px; }
.brand-mark i:nth-child(3) { height: 20px; }
.brand-mark i:nth-child(4) { height: 10px; }
.logo { font: 730 15px/1 var(--sans); letter-spacing: .135em; white-space: nowrap; color: var(--txt); }
.logo span { color: inherit; }
.studio-badge { color: #a5afbd; border: 1px solid #36404b; border-radius: 4px; padding: 3px 5px; font-size: 11px; font-weight: 700; line-height: 1; letter-spacing: .1em; }
.project-name { display: flex; align-items: center; gap: 9px; min-width: 0; margin: 0 auto; color: var(--dim); }
#projName { width: 205px; min-width: 80px; border: 1px solid transparent; background: transparent; padding: 8px 10px; color: var(--txt); border-radius: 6px; font-weight: 500; text-align: center; }
#projName::placeholder { color: #c2c8d1; opacity: 1; }
#projName:hover { border-color: var(--line); background: #1b1e2455; }
#projName:focus { background: var(--panel2); border-color: var(--line2); text-align: left; }
.project-status, .save-status { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--mut); white-space: nowrap; }
.project-status::before, .save-status::before { content: ''; width: 5px; height: 5px; background: #83955a; border-radius: 50%; }
.top-right { display: flex; align-items: center; gap: 8px; flex: none; }
.ctl { background: #1a1e24; color: #cbd0d9; border: 1px solid var(--line2); border-radius: 6px; padding: 7px 12px; font-size: 12px; font-weight: 500; transition: background .15s, border-color .15s, color .15s; }
.ctl:hover { background: #252b32; border-color: #55606e; color: #fff; }
button.ctl { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.ctl svg { width: 16px; height: 16px; }
.ctl:disabled { opacity: .4; }
#topbar .ctl { height: 36px; background: transparent; }
#topbar .ctl:hover { background: #22272e; }
.btn-acc { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 9px 19px; border-radius: 7px; background: var(--acc); color: #182006; font-size: 12px; font-weight: 700; letter-spacing: .01em; box-shadow: 0 0 24px #cefa4207; transition: background .15s, transform .15s; }
.btn-acc:hover { background: #defe75; }
.btn-acc:active:not(:disabled) { transform: translateY(1px); }
.btn-acc:disabled { background: #283022; color: #a1b974; box-shadow: none; opacity: .7; }
#btnExport { min-width: 114px; }
#btnExport svg { width: 16px; height: 16px; }
.history-actions { display: flex; gap: 2px; align-items: center; padding-right: 14px; margin-right: 5px; border-right: 1px solid var(--line2); }
.t-btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 1px solid transparent; border-radius: 6px; color: #b9c0ca; background: transparent; font-size: 17px; transition: background .15s, color .15s; }
.t-btn:hover { background: #282e36; color: var(--txt); border-color: transparent; }
.t-btn:disabled { opacity: .3; }
.t-btn:disabled:hover { border-color: transparent; color: var(--mut); background: transparent; }
#workspace {
  display: grid; grid-template-columns: var(--rail-width) var(--library-width) minmax(0, 1fr) var(--inspector-width);
  min-width: 0; min-height: 0; position: relative; background: var(--bg);
}
#toolRail { display: flex; flex-direction: column; gap: 7px; min-width: 0; min-height: 0; padding: 15px 7px 10px; background: #101317; border-right: 1px solid var(--line); overflow-y: auto; scrollbar-width: none; }
.tool-tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; width: 100%; min-height: 65px; padding: 10px 2px; position: relative; border: 1px solid transparent; border-radius: 7px; background: transparent; color: #9ca5b1; font-size: 11px; font-weight: 500; line-height: 1.25; cursor: pointer; transition: color .15s, background .15s; }
.tool-tab svg { width: 22px; height: 22px; }
.tool-tab:hover { background: #1d232b; color: #e0e6ee; }
.tool-tab[aria-selected="true"] { color: var(--acc); background: #cffa420d; border-color: #cefa4212; }
.tool-tab[aria-selected="true"]::before { content: ''; position: absolute; left: -8px; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: var(--acc); }
.rail-bottom { margin-top: auto; }
#library { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 0; overflow: hidden; background: var(--panel); border-right: 1px solid var(--line); }
.library-heading { display: flex; align-items: center; gap: 9px; min-height: 58px; padding: 18px 18px 15px; }
.library-heading h1 { font-size: 15px; font-weight: 650; letter-spacing: -.025em; line-height: 1.35; }
.library-count { display: inline-flex; align-items: center; justify-content: center; min-width: 23px; height: 19px; border: 1px solid #363e49; border-radius: 5px; color: #98a4b4; font: 11px var(--mono); padding: 1px 5px; }
.library-content { flex: 1; min-height: 0; overflow-y: auto; padding: 0 14px 18px; }
#modulePanel, #mediaPanel, #templatePanel { min-width: 0; }
#libTabs { position: relative; top: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 5px; background: transparent; padding: 0 0 12px; margin: 0; overflow: visible; }
.lib-tab { flex: none; border: 1px solid var(--line); border-radius: 5px; background: #1b2027; color: #9ba5b3; padding: 5px 9px; font-size: 11px; line-height: 1.35; }
.lib-tab:hover { background: #272e37; border-color: #434e5e; color: #fff; }
.lib-tab.on { color: #dce8c0; background: #2b3421; border-color: #536438; font-weight: 600; }
.lib-tab .lt-n { font-size: 11px; margin-left: 5px; color: inherit; }
#libSearchWrap { position: relative; top: auto; z-index: 2; padding: 0 0 15px; background: transparent; }
#libSearch { width: 100%; height: 37px; padding: 8px 11px; border: 1px solid #353d48; border-radius: 6px; background: #101419; font-size: 11px; color: var(--txt); }
#libSearch::placeholder { color: #7e8999; opacity: 1; }
#libSearch:focus { border-color: #8dab3d; }
#libList { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; gap: 9px; }
.mod-sep { grid-column: 1 / -1; margin: 10px 0 2px; color: #8591a1; font: 600 11px/1.5 var(--sans); text-transform: uppercase; letter-spacing: .12em; }
.mod-sep:first-child { margin-top: 0; }
.mod-card { position: relative; display: block; min-width: 0; padding: 0; overflow: hidden; background: #101316; border: 1px solid #303741; border-radius: 7px; cursor: pointer; transition: border-color .15s, background .15s, transform .15s; }
.mod-card:hover { background: #1b2127; border-color: #94ab4d; transform: translateY(-1px); }
.mod-card:focus-visible, .mod-card.selected { border-color: var(--acc); }
.mod-card canvas { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; border-radius: 0; background: #080b0d; }
.mod-card .mc-name { margin: 0; padding: 8px 8px 9px; color: #d4dae4; font-size: 11px; font-weight: 500; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mod-card .mc-fav { position: absolute; right: 5px; top: 5px; display: inline-flex; justify-content: center; align-items: center; width: 23px; height: 23px; background: #141920c9; border: 1px solid #ffffff15; border-radius: 5px; color: #bac3cf; font-size: 14px; opacity: 0; transition: opacity .15s, color .15s; }
.mod-card:hover .mc-fav, .mod-card:focus-within .mc-fav, .mod-card .mc-fav.on { opacity: 1; }
.mod-card .mc-fav.on { color: var(--acc); }
#libEmpty { border: 1px dashed var(--line2); border-radius: 8px; padding: 22px 12px; text-align: center; color: var(--mut); }
#libSplit { width: 6px; margin-left: -3px; background: transparent; z-index: 12; }
#libSplit:hover, #libSplit.drag { background: var(--acc); opacity: .35; }
.panel-intro { margin: 0 0 15px; color: #929dab; font-size: 11px; line-height: 1.7; }
.panel-action { display: flex; justify-content: center; align-items: center; gap: 7px; width: 100%; padding: 9px 10px; margin: 0 0 17px; border: 1px solid #3f4b34; border-radius: 6px; background: #242d1c; color: #d3e5b3; font-size: 11px; font-weight: 600; cursor: pointer; }
.panel-action:hover { background: #303c23; border-color: #819a4a; }
.panel-action svg { width: 16px; height: 16px; }
.template-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.template-card { display: block; min-width: 0; width: 100%; padding: 0; text-align: left; border: 1px solid #333d49; border-radius: 8px; background: #11161b; overflow: hidden; cursor: pointer; transition: border-color .15s, transform .15s; }
.template-card:hover { border-color: #91aa45; transform: translateY(-1px); }
.template-card canvas { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; background: #070a0b; }
.template-card strong { display: block; color: #e3e8ee; padding: 10px 11px 2px; font-size: 12px; font-weight: 600; }
.template-card small { display: block; padding: 0 11px 12px; color: #8d99a9; font-size: 11px; line-height: 1.6; }
.media-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; min-height: 149px; padding: 20px 13px; margin-bottom: 19px; border: 1px dashed #52613e; border-radius: 9px; background: linear-gradient(140deg, #cffa4207, #cffa4202); color: #dce8cd; text-align: center; cursor: pointer; }
.media-drop:hover { border-color: var(--acc); background: #cffa4209; }
.media-drop svg { width: 26px; height: 26px; color: var(--acc); fill: none; stroke: currentColor; stroke-width: 1.5; }
.media-drop strong { font-size: 12px; font-weight: 600; }
.media-drop span, .media-drop small { font-size: 11px; line-height: 1.7; color: #909d8a; }
.media-list { display: flex; flex-direction: column; gap: 8px; }
.media-item { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 7px; background: #1b2027; }
.media-item > svg { width: 20px; height: 20px; flex: none; fill: none; stroke: #b39be9; stroke-width: 1.5; }
.media-item > div { min-width: 0; flex: 1; }
.media-item strong, .media-item b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 500; }
.media-item small, .media-item span { display: block; color: #8a98aa; font-size: 11px; }
.media-item img { width: 44px; height: 32px; object-fit: cover; border-radius: 4px; }
.media-empty { color: #8593a4; font-size: 11px; line-height: 1.75; text-align: center; padding: 10px; }
#stage { display: grid; grid-template-rows: 48px minmax(0, 1fr) 52px; position: relative; min-width: 0; min-height: 0; overflow: hidden; align-items: stretch; justify-content: stretch; background: #101318; }
.stage-heading { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 0 18px; color: #d8dee7; border-bottom: 1px solid #202630; }
.stage-heading b { font-size: 12px; font-weight: 600; }
.preview-meta { display: inline-flex; align-items: center; gap: 7px; margin-left: auto; color: #7d8a9c; font-size: 11px; white-space: nowrap; }
.preview-meta span, .preview-meta button { border: 1px solid #313b49; border-radius: 5px; padding: 3px 8px; background: #171d25; }
.inspector-toggle { display: none; align-items: center; justify-content: center; width: 30px; height: 29px; border: 1px solid #3a4553; border-radius: 5px; background: #1b232d; color: #c3cedc; cursor: pointer; }
.inspector-toggle svg { width: 16px; height: 16px; }
.stage-canvas { display: flex; align-items: center; justify-content: center; min-width: 0; min-height: 0; position: relative; overflow: hidden; padding: 18px; background: radial-gradient(ellipse at 50% 44%, #1c222b, #11151b 72%); }
#viewportWrap { position: relative; max-width: 100%; max-height: 100%; flex: none; }
#viewport { display: block; max-width: 100%; max-height: 100%; background: #020504; border-radius: 5px; box-shadow: 0 0 0 1px #313b43, 0 16px 38px #0005; }
#dropHint { inset: 0; justify-content: center; gap: 10px; padding: 20px; background: radial-gradient(ellipse at 50% 25%, #293821b0, #0b1013ed 74%); border-radius: 5px; text-align: center; }
.dh-mark { display: flex; align-items: center; justify-content: center; width: 58px; height: 58px; margin-bottom: 5px; border: 1px solid #a0c44336; border-radius: 17px; background: #cffa420b; color: var(--acc); animation: none; }
.dh-mark svg { width: 29px; height: 29px; stroke-width: 1.4; }
.dh-title { max-width: 100%; color: #f1f3ed; font-size: clamp(14px, 1.55vw, 23px); font-weight: 650; line-height: 1.35; letter-spacing: -.035em; overflow-wrap: anywhere; }
.dh-sub { max-width: 350px; color: #9fa99d; font-size: 11px; line-height: 1.75; }
.dh-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 36px; padding: 9px 15px; margin-top: 8px; border-radius: 6px; background: var(--acc); color: #182006; font-weight: 650; font-size: 11px; cursor: pointer; box-shadow: 0 4px 20px #cffa4211; }
.dh-btn:hover { background: #defe75; }
.dh-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.dh-formats { color: #697566; font: 11px var(--mono); letter-spacing: .04em; }
#dropHint.drag { background: #18200fed; outline: 2px dashed var(--acc); outline-offset: -9px; }
.player-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; padding: 0 14px; background: #14191f; border-top: 1px solid #262f39; }
.transport { display: flex; align-items: center; gap: 4px; min-width: 0; }
#btnPlay { width: 33px; height: 33px; color: #f0f5e8; font-size: 19px; }
#btnStop { width: 27px; font-size: 14px; }
.timecode { min-width: 0; padding-left: 8px; color: #a2adbd; font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }
#monitor { gap: 3px; padding-left: 10px; }
#btnMon { width: 27px; font-size: 13px; }
#monitor input[type=range] { width: 52px; height: 3px; }
#vzBar { position: static; display: flex; align-items: center; gap: 1px; flex: none; padding: 0 0 0 9px; border: 0; border-left: 1px solid #36404c; border-radius: 0; background: transparent; }
#vzBar button { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 28px; padding: 0; color: #a8b6c7; font-size: 16px; }
#vzBar button:hover { color: var(--txt); background: #252e39; }
#vzLabel { min-width: 37px; color: #95a5b9; font-size: 11px; }
#vzKeys { margin-left: 4px; }
#inspector { display: flex; flex-direction: column; min-height: 0; min-width: 0; padding: 0; overflow: hidden; background: #151a20; border-left: 1px solid var(--line); }
.inspector-tabs { display: flex; align-items: stretch; flex: none; height: 48px; padding: 0 15px; gap: 20px; border-bottom: 1px solid #2a323d; }
.inspector-tab { position: relative; padding: 0 0 1px; border: 0; background: transparent; color: #8290a3; font-size: 11px; font-weight: 600; cursor: pointer; }
.inspector-tab:hover { color: #ced7e4; }
.inspector-tab[aria-selected="true"] { color: #e2e9f1; }
.inspector-tab[aria-selected="true"]::after { content: ''; height: 2px; position: absolute; left: 0; right: 0; bottom: -1px; background: var(--acc); }
#layerPanel, #outputPanel { min-height: 0; overflow-y: auto; padding: 18px 17px 24px; }
#layerPanel { flex: 1; }
#inspEmpty { padding: 30px 7px 0; color: #8a98ab; text-align: center; }
.empty-icon { display: flex; align-items: center; justify-content: center; width: 53px; height: 53px; margin: 0 auto 19px; border: 1px solid #3a4656; border-radius: 13px; color: #8293ac; background: #1b2330; }
.empty-icon svg { width: 24px; height: 24px; }
#inspEmpty h2 { color: #d6dfe9; font-size: 13px; font-weight: 600; margin-bottom: 9px; }
#inspEmpty p { font-size: 11px; line-height: 1.9; color: #8695a9; margin-bottom: 15px; }
.empty-tip { margin-top: 24px; padding: 12px; border: 1px solid #323e4c; border-radius: 7px; background: #1a2330; color: #9caabf; font-size: 11px; line-height: 1.85; text-align: left; }
.empty-tip b, .empty-tip strong { color: #cbd7e8; font-weight: 500; }
#inspBody { min-width: 0; }
.insp-title { gap: 5px; flex-wrap: wrap; margin-bottom: 19px; padding-bottom: 13px; border-bottom: 1px solid #303a48; }
.insp-title b { flex: 1 1 100%; font-size: 13px; line-height: 1.6; color: #e1e7ef; overflow-wrap: anywhere; }
.insp-title .icon { width: 28px; height: 27px; border-radius: 5px; background: #1c2632; border-color: #3b4859; color: #a8b5c9; }
.f { margin-bottom: 16px; }
.f > label { margin-bottom: 7px; color: #a9b5c7; font-size: 11px; }
.f > label .val { color: #ced7e4; font-size: 11px; }
.f input[type=range] { height: 16px; accent-color: var(--acc); cursor: pointer; }
.f select, .f input[type=text], .f input[type=number], .f textarea { width: 100%; padding: 7px 8px; border: 1px solid #3b4859; border-radius: 5px; background: #111a25; color: #c8d3e4; font-size: 11px; }
.f input[type=color] { height: 30px; padding: 3px; border-radius: 5px; border-color: #39485c; background: #172232; }
.insp-sec { margin-top: 21px; padding-top: 14px; color: #8295af; border-color: #334155; font: 600 11px/1.5 var(--sans); letter-spacing: .12em; }
.modbtn { width: 24px; height: 22px; border-color: #425269; background: #1d2b3d; border-radius: 4px; }
.modrow { gap: 5px; border-radius: 6px; background: #17222f; border-color: #43516a; }
.modrow input { min-width: 0; }
.modrow select { min-width: 67px; }
.output-title { font-size: 14px; font-weight: 600; color: #e2eaf3; margin: 2px 0 7px; }
.output-copy { font-size: 11px; line-height: 1.85; color: #8b9bb1; margin-bottom: 24px; }
.output-field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 19px; font-size: 11px; color: #aebacf; }
.output-field select { display: block; width: 100%; background: #142030; border: 1px solid #3c4b62; color: #d0dbee; padding: 8px 9px; border-radius: 6px; }
.output-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 25px; padding-top: 18px; border-top: 1px solid #344359; }
.output-actions button { flex: 1; min-width: 60px; padding: 9px 7px; font-size: 11px; }
.output-note { margin-top: 15px; padding: 12px; background: #1a2738; border: 1px solid #35445b; border-radius: 6px; color: #879bb8; font-size: 11px; line-height: 1.9; }
#timeline { display: flex; flex-direction: column; min-height: 0; position: relative; overflow: hidden; border-top: 1px solid #364150; background: #11171f; }
#tlBar { display: flex; align-items: center; gap: 6px; height: 46px; min-height: 46px; padding: 0 17px; background: #151c25; border-bottom: 1px solid #303c4d; }
.timeline-title { color: #d7e0ec; font-size: 11px; font-weight: 600; margin-right: 13px; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.timeline-title svg { width: 15px; height: 15px; fill: none; stroke: #9aaac1; stroke-width: 1.5; }
.timeline-spacer { flex: 1; min-width: 2px; }
#tlBar button { display: inline-flex; align-items: center; justify-content: center; width: 29px; height: 28px; border: 1px solid transparent; border-radius: 5px; background: transparent; color: #9fafc5; font-size: 15px; }
#tlBar button:hover { background: #243247; border-color: transparent; color: #e6edf7; }
#tlBar button.ctl { width: auto; padding: 0 9px; font-size: 11px; border-color: #3b4a61; background: #1d293a; }
#tlBar button.ctl:hover { border-color: #6e8651; }
#tlBar button.ctl svg { width: 14px; height: 14px; }
#tlZoomLab { min-width: 62px; font-size: 11px; color: #8e9eb7; }
#tlBar .hint { color: #7084a0; font-size: 11px; max-width: 430px; margin-left: 12px; }
#tlMap { flex: none; background: #101823; border-color: #34445d; }
#tlScroll { flex: 1; min-height: 0; overflow: auto; background: repeating-linear-gradient(90deg, transparent 0, transparent 99px, #26374b32 99px, #26374b32 100px); }
#tlInner { min-height: 100%; }
#tlRuler { height: 25px; background: #151e2a; border-color: #31415a; color: #8699b6; font-size: 11px; }
.tl-tick { top: 6px; height: 18px; padding-left: 7px; border-color: #435974; }
#tlAudio { height: 44px; border-color: #2c3c53; }
#tlAudio .track-label { height: 44px; }
.track { height: 36px; border-color: #27374d; }
.track-label { width: 132px; gap: 6px; padding: 0 11px; background: #182334; border-right-color: #3a4e6b; color: #a9bbd5; font-size: 11px; }
.track-lane { left: 132px; }
.track.sel .track-label { background: #25332c; color: #d6eac5; }
.track-label .dot { width: 6px; height: 6px; }
.clip { top: 5px; bottom: 5px; border: 1px solid #546248; border-radius: 5px; background: linear-gradient(180deg, #38462b, #2a3725); color: #cdddbf; padding: 0 9px; font-size: 11px; }
.clip.sel { border-color: #b4d255; background: linear-gradient(180deg, #4b5d2c, #394825); box-shadow: 0 0 0 1px #cffa4226 inset; color: #eff6df; }
.clip:hover { border-color: #b4ce7f; }
.aclip { top: 5px; bottom: 5px; border-radius: 5px; background: linear-gradient(180deg, #443162, #302547); border-color: #75569e; }
.aclip.sel { border-color: #b991ee; box-shadow: 0 0 0 1px #b991ee44 inset; }
.aclip .anm { left: 9px; top: 3px; color: #e4d8f7; font-size: 11px; }
#tlPlayhead { background: #d6ef8a; z-index: 7; box-shadow: 0 0 5px #d6ef8a22; }
#tlPlayhead::before { border-top-color: var(--acc); }
#timelineEmpty { position: absolute; left: 150px; right: 18px; top: 92px; bottom: 14px; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 6px; border: 1px dashed #3e506a; border-radius: 7px; background: #15213155; color: #768da9; text-align: center; pointer-events: none; }
#timelineEmpty strong, #timelineEmpty b { color: #a8bdd8; font-size: 11px; font-weight: 500; }
#timelineEmpty span, #timelineEmpty p { font-size: 11px; color: #748eae; }
#modal { padding: 24px; background: #070b12bb; backdrop-filter: blur(8px); z-index: 100; }
#modalCard { background: #171f2a; border: 1px solid #41506a; border-radius: 12px; padding: 25px; box-shadow: 0 30px 100px #0008; color: #d5dfef; }
#modalCard h3 { color: #e5edf7; font-weight: 600; }
#modalCard input, #modalCard select, #modalCard textarea { color: #d6e1f2; background-color: #101926; border-color: #42526d; border-radius: 5px; }
#modalCard .hint { color: #8da2c1; }
#modalCard .scene-card { border-color: #364963; background: #121d2c; border-radius: 7px; padding: 9px; }
#modalCard .scene-card:hover { border-color: #9eb956; background: #192536; }
#modalCard .scene-card span { color: #8ca2c1; }
#toast { max-width: min(460px, calc(100vw - 30px)); border: 1px solid #526348; border-radius: 8px; background: #202b1f; box-shadow: 0 8px 30px #0006; color: #dcebd0; padding: 11px 18px; font-size: 12px; z-index: 150; }
#exportOverlay { border-radius: 5px; background: #0b121dea; backdrop-filter: blur(8px); }
.eo-card { border: 1px solid #40516a; border-radius: 11px; background: #172334; }
.wf-menu { border-color: #40516a; border-radius: 8px; background: #1a273a; box-shadow: 0 16px 40px #0006; }
@media (min-width: 1600px) {
  :root { --library-width: 304px; --inspector-width: 306px; --timeline-height: 248px; }
  .library-heading { padding-top: 20px; padding-bottom: 18px; }
  .library-content { padding-left: 17px; padding-right: 17px; }
  .mod-card .mc-name { font-size: 12px; }
  .stage-canvas { padding: 22px; }
  #monitor input[type=range] { width: 70px; }
  .timecode { font-size: 11px; padding-left: 12px; }
}
@media (max-width: 1200px) {
  :root { --rail-width: 68px; --library-width: 238px; --inspector-width: 250px; --timeline-height: 210px; }
  #topbar { gap: 15px; padding: 0 15px; }
  .brand { gap: 8px; }
  .logo { font-size: 13px; letter-spacing: .10em; }
  .studio-badge { display: none; }
  #projName { width: 166px; font-size: 12px; }
  .project-status, .save-status { display: none; }
  .tool-tab { min-height: 59px; font-size: 11px; }
  #toolRail { gap: 5px; padding-left: 5px; padding-right: 5px; }
  .tool-tab[aria-selected="true"]::before { left: -6px; }
  .library-heading { padding: 17px 13px 13px; }
  .library-heading h1 { font-size: 14px; }
  .library-content { padding-left: 10px; padding-right: 10px; }
  #libList { gap: 7px; }
  .lib-tab { padding: 4px 7px; font-size: 11px; }
  #libSearch { font-size: 11px; }
  .stage-heading { padding: 0 12px; gap: 8px; }
  .stage-canvas { padding: 13px; }
  .player-bar { padding: 0 8px; gap: 5px; }
  #monitor { padding-left: 3px; }
  #monitor input[type=range] { display: none; }
  .timecode { padding-left: 4px; font-size: 11px; }
  #vzBar { padding-left: 5px; }
  #vzBar button { width: 21px; }
  #vzLabel { min-width: 32px; font-size: 11px; }
  #vzKeys { display: none; }
  .dh-mark { width: 44px; height: 44px; margin: 0; border-radius: 13px; }
  .dh-mark svg { width: 23px; height: 23px; }
  #dropHint { gap: 7px; padding: 13px; }
  .dh-sub { font-size: 11px; line-height: 1.65; }
  .dh-btn { margin-top: 4px; min-height: 32px; padding: 7px 11px; font-size: 11px; }
  .dh-formats { font-size: 11px; }
  #layerPanel, #outputPanel { padding: 16px 13px 20px; }
  #tlBar .hint { display: none; }
  #btnRenders { padding-left: 8px; padding-right: 8px; }
}
@media (max-width: 1000px) and (min-width: 821px) {
  :root { --rail-width: 62px; --library-width: 204px; --inspector-width: 220px; }
  #monitor { display: none; }
  .history-actions { margin-right: 0; padding-right: 8px; }
  #projName { width: 140px; }
  .top-right { gap: 5px; }
  #topbar .ctl { padding: 7px 9px; }
  #btnExport { min-width: 94px; padding: 8px 11px; }
  .preview-meta { font-size: 11px; gap: 4px; }
  .preview-meta span { padding: 3px 5px; }
  .stage-heading { padding: 0 9px; }
  .stage-heading b { font-size: 11px; }
  .dh-sub, .dh-formats { display: none; }
  .dh-title { font-size: 14px; }
  #dropHint { gap: 9px; }
  #vzOut, #vzIn { display: none !important; }
}
@media (max-width: 820px) {
  :root { --rail-width: 62px; --library-width: 230px; --timeline-height: 212px; }
  #topbar { gap: 12px; padding: 0 12px; }
  .logo { font-size: 12px; }
  .brand-mark { width: 23px; }
  #projName { width: 144px; }
  #btnRenders { font-size: 0; width: 34px; padding: 7px !important; }
  #btnRenders svg { width: 16px; height: 16px; }
  #btnExport { min-width: 97px; padding: 8px 12px; }
  #workspace { grid-template-columns: var(--rail-width) var(--library-width) minmax(0, 1fr); }
  #inspector { display: none; position: absolute; z-index: 30; top: 0; right: 0; bottom: 0; width: min(300px, calc(100% - 40px)); box-shadow: -25px 0 60px #0008; border-left: 1px solid #54647b; }
  #inspector.is-open { display: flex; }
  .inspector-toggle { display: inline-flex; }
  .preview-meta { font-size: 11px; gap: 5px; }
  .preview-meta span { padding: 3px 6px; }
  #monitor { display: none; }
  #vzOut, #vzIn { display: none !important; }
  .dh-sub { max-width: 235px; }
  .dh-formats { display: none; }
  .history-actions { padding-right: 8px; margin-right: 0; }
  .t-btn { width: 29px; }
  .timeline-title { margin-right: 5px; font-size: 11px; }
  #tlBar { padding: 0 10px; gap: 3px; }
  .timeline-import { max-width: 125px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #timelineEmpty { left: 145px; }
  #scList { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  :root { --timeline-height: 215px; }
  html, body { height: auto; min-height: 100%; overflow-x: hidden; }
  body { overflow-y: auto; }
  #app { height: auto; min-height: 100vh; min-height: 100dvh; overflow: visible; grid-template-rows: 60px auto var(--timeline-height); }
  #topbar { gap: 8px; padding: 0 10px; flex-wrap: nowrap; }
  .brand { gap: 5px; }
  .brand-mark { width: 23px; }
  .logo { font-size: 11px; letter-spacing: .065em; }
  .project-name { flex: 1; margin: 0; min-width: 40px; }
  #projName { width: 100%; font-size: 11px; min-width: 35px; padding: 8px 4px; }
  .top-right { gap: 5px; }
  #topbar .ctl { height: 31px; padding: 6px 8px; font-size: 11px; }
  #btnRenders { display: none; }
  #btnExport { min-width: 72px; min-height: 32px; height: 32px; padding: 7px 9px; font-size: 11px; gap: 5px; }
  #btnExport svg { width: 13px; height: 13px; }
  #btnProjects svg { display: none; }
  #workspace { display: grid; grid-template-columns: minmax(0, 1fr) !important; grid-template-rows: 74px 342px 345px; min-height: 0; overflow: visible; }
  #toolRail { grid-column: 1; grid-row: 1; display: flex; flex-direction: row; align-items: stretch; gap: 4px; overflow-x: auto; overflow-y: hidden; padding: 5px 7px; border-right: 0; border-bottom: 1px solid #313d4e; }
  .tool-tab { flex: 1 0 49px; min-width: 49px; min-height: 59px; width: auto; padding: 8px 3px; gap: 5px; font-size: 11px; }
  .tool-tab svg { width: 20px; height: 20px; }
  .tool-tab[aria-selected="true"]::before { left: 12px; right: 12px; top: auto; bottom: -6px; width: auto; height: 2px; border-radius: 2px 2px 0 0; }
  .rail-bottom { margin: 0; }
  #stage { grid-row: 2; grid-column: 1; grid-template-rows: 42px minmax(0, 1fr) 45px; border-bottom: 1px solid #334257; }
  .stage-heading { padding: 0 13px; }
  .stage-heading b { font-size: 11px; }
  .stage-canvas { padding: 12px 15px; }
  .player-bar { padding: 0 12px; gap: 10px; }
  #monitor { display: flex; }
  #monitor input[type=range] { display: block; width: 40px; }
  .timecode { font-size: 11px; padding-left: 8px; }
  #vzOut, #vzIn { display: inline-flex !important; }
  #vzBar { gap: 1px; padding-left: 7px; }
  #vzBar button { width: 23px; }
  #vzLabel { min-width: 35px; }
  #dropHint { gap: 6px; padding: 12px; }
  .dh-mark { width: 40px; height: 40px; border-radius: 11px; margin: 0; }
  .dh-title { font-size: 16px; }
  .dh-sub { display: block; font-size: 11px; max-width: 280px; line-height: 1.5; }
  .dh-btn { min-height: 30px; padding: 7px 11px; margin-top: 4px; }
  #library { grid-row: 3; grid-column: 1; border-right: 0; border-bottom: 1px solid #354861; }
  .library-heading { min-height: 45px; padding: 11px 15px 8px; }
  .library-heading h1 { font-size: 13px; }
  .library-count { height: 17px; font-size: 11px; }
  .library-content { padding: 0 14px 13px; }
  #libTabs { gap: 5px; padding-bottom: 8px; }
  #libSearchWrap { padding-bottom: 10px; }
  #libSearch { height: 33px; font-size: 11px; }
  #libList { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .mod-card .mc-name { font-size: 11px; padding: 6px 7px 7px; }
  .mod-card .mc-fav { opacity: 1; width: 21px; height: 21px; font-size: 12px; }
  .mod-sep { margin-top: 6px; font-size: 11px; }
  .template-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .template-card strong { padding: 7px 8px 2px; font-size: 11px; }
  .template-card small { padding: 0 8px 9px; font-size: 11px; }
  .panel-intro { font-size: 11px; margin-bottom: 9px; }
  .panel-action { margin-bottom: 11px; padding: 7px 9px; font-size: 11px; }
  .media-drop { min-height: 112px; padding: 12px; gap: 6px; margin-bottom: 11px; }
  .media-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .media-item { padding: 8px; gap: 7px; }
  .media-item strong { font-size: 11px; }
  #libSplit { display: none; }
  #inspector { position: fixed; top: 60px; right: 0; bottom: 0; width: min(320px, calc(100vw - 30px)); z-index: 70; }
  .inspector-tabs { height: 47px; }
  #inspEmpty { padding-top: 30px; }
  #timeline { height: var(--timeline-height); }
  #tlBar { min-height: 43px; height: 43px; padding: 0 8px; gap: 2px; flex-wrap: nowrap; }
  .timeline-title { display: none; }
  .history-actions { padding-right: 5px; margin-right: 0; gap: 0; }
  #tlBar button { width: 25px; height: 26px; font-size: 14px; }
  #tlBar button.ctl { padding: 0 7px; font-size: 11px; gap: 4px; }
  #tlArrange { display: none !important; }
  #tlZoomLab { min-width: 50px; font-size: 11px; }
  .timeline-import { max-width: 95px; }
  #timelineEmpty { left: 142px; top: 91px; right: 10px; bottom: 12px; padding: 10px; }
  #timelineEmpty strong, #timelineEmpty b { font-size: 11px; }
  #timelineEmpty span, #timelineEmpty p { font-size: 11px; }
  #modal { padding: 12px; align-items: center; }
  #modalCard { max-width: 100%; padding: 17px; border-radius: 9px; overflow-x: auto; }
  #scList { grid-template-columns: 1fr; }
  #toast { font-size: 11px; padding: 10px 14px; }
}
@media (max-width: 390px) {
  .logo { font-size: 11px; }
  .brand-mark { width: 20px; gap: 2px; }
  .project-name { display: none; }
  .top-right { margin-left: auto; }
  #workspace { grid-template-rows: 73px 313px 339px; }
  .player-bar { padding: 0 8px; gap: 6px; }
  #monitor { display: none; }
  .timecode { padding-left: 4px; font-size: 11px; }
  #libList { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .mod-card .mc-name { font-size: 11px; padding-left: 5px; }
  .timeline-import { max-width: 76px; }
  #tlZoomLab { min-width: 43px; }
  #tlBar button { width: 23px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* Keep the actual text-button contracts readable and all mobile controls reachable. */
button.inspector-toggle { display: none; width: auto; min-width: 30px; padding: 5px 8px; font-size: 11px; line-height: 1.2; }
#mediaList { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.media-drop p { margin: 0; color: #8f9d8a; font-size: 11px; line-height: 1.9; }
.media-drop > .btn-acc { min-height: 34px; padding: 8px 13px; font-size: 11px; }
.empty-icon { font-size: 23px; }
#tlBar .timeline-import { width: auto; padding: 0 9px; white-space: nowrap; font-size: 11px; }
.output-actions { flex-direction: column; }
.output-actions button { width: 100%; flex: none; }
@media (max-width: 820px) {
  button.inspector-toggle { display: inline-flex; }
  #btnRenders { font-size: 11px; width: auto; padding: 7px 9px !important; }
  #topbar .history-actions { gap: 0; padding-right: 5px; }
}
@media (max-width: 600px) {
  #app { grid-template-rows: 100px auto var(--timeline-height); }
  #topbar { flex-wrap: wrap; align-content: center; column-gap: 12px; row-gap: 6px; padding: 8px 12px; }
  .brand { min-width: 105px; gap: 7px; }
  .logo { display: block; font-size: 11px; letter-spacing: .09em; }
  .project-name { display: flex; flex: 1; min-width: 0; }
  #projName { height: 30px; font-size: 11px; text-align: right; }
  .top-right { flex: 1 0 100%; width: 100%; gap: 7px; margin: 0; }
  #topbar .history-actions { margin-right: auto; padding-right: 8px; }
  #topbar .ctl { padding: 6px 10px; }
  #btnRenders { display: inline-flex; width: auto; font-size: 11px; }
  #btnExport { min-width: 79px; }
  #inspector { top: 100px; }
  #tlBar { overflow-x: auto; scrollbar-width: none; }
  #tlBar > button, #tlBar .history-actions, #tlZoomLab { flex-shrink: 0; }
  #tlArrange { display: inline-flex !important; }
  #tlBar .timeline-import { max-width: none; font-size: 11px; padding: 0 7px; }
  #mediaList { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
}
@media (max-width: 390px) {
  .logo { font-size: 11px; }
  .project-name { display: flex; }
  #topbar .ctl { padding: 6px 8px; }
  .top-right { gap: 5px; }
}

/* Readable type and a neutral graphite palette, matching the visual direction. */
#btnInspector { display: none; width: auto; min-width: 30px; padding: 5px 8px; font-size: 12px; line-height: 1.2; }
:root { --panel: #17191d; --panel2: #202228; --line: #2d3037; --line2: #3b3f48; --mut: #9ca2ad; --dim: #7e8693; }
#topbar { background: #121417; }
#stage { background: #14161a; }
.stage-heading { border-color: #292c32; }
.stage-canvas { background: radial-gradient(ellipse at 50% 44%, #202329, #14161a 72%); }
.player-bar { background: #181a1f; border-color: #30343b; }
.preview-meta { color: #939ba8; font-size: 11px; }
.stage-heading b { font-size: 14px; }
.library-heading h1 { font-size: 16px; }
.library-count { font-size: 11px; }
.tool-tab { font-size: 12px; }
.tool-tab svg { width: 23px; height: 23px; }
.tool-tab span { max-width: 100%; }
.lib-tab { font-size: 12px; padding: 5px 9px; }
.lib-tab .lt-n { font-size: 11px; }
#libSearch { font-size: 12px; height: 39px; }
.mod-card .mc-name { font-size: 13px; padding: 9px 9px 10px; }
.mod-sep { color: #929ba8; font-size: 11px; letter-spacing: .08em; }
.ctl { font-size: 13px; }
.btn-acc { font-size: 13px; }
#btnExport { font-size: 13px; }
.panel-intro { font-size: 12px; line-height: 1.8; color: #a0a7b2; }
.panel-action { font-size: 12px; }
.media-drop p { font-size: 12px; color: #a1ab9b; }
.media-drop > .btn-acc { font-size: 12px; }
.template-card strong { font-size: 13px; }
.template-card small { font-size: 11px; color: #969eab; }
.media-item strong, .media-item b { font-size: 12px; }
.media-item small, .media-item span { font-size: 11px; }
#inspector { background: #181a1f; border-color: #2e3239; }
.inspector-tabs { border-color: #32363e; }
.inspector-tab { color: #989faa; font-size: 13px; }
#inspEmpty h2 { font-size: 14px; color: #d8dde5; }
#inspEmpty p { color: #949ba7; font-size: 12px; line-height: 1.9; }
.empty-icon { color: #a1a8b3; background: #22262d; border-color: #3a414d; }
.empty-tip { color: #a1a9b6; background: #20242b; border-color: #353d49; font-size: 12px; line-height: 1.8; }
.empty-tip b, .empty-tip strong { color: #d0d7e1; }
.insp-title { border-color: #353b46; }
.insp-title b { color: #dfe4ec; font-size: 14px; }
.insp-title .icon { background: #242932; border-color: #3f4753; color: #adb7c6; }
.f > label { color: #aab1bd; font-size: 12px; }
.f > label .val { color: #d0d6e0; font-size: 12px; }
.f select, .f input[type=text], .f input[type=number], .f textarea { background: #14171c; border-color: #414753; color: #d2d9e3; font-size: 12px; }
.f input[type=color] { background: #1d222a; border-color: #414957; }
.insp-sec { color: #929ba9; border-color: #363d47; font-size: 11px; letter-spacing: .07em; }
.modbtn { background: #242b34; border-color: #46515f; }
.modrow { background: #1c222b; border-color: #46515f; }
.output-title { font-size: 15px; }
.output-copy { color: #9ca4b1; font-size: 12px; }
.output-field { color: #acb5c3; font-size: 13px; }
.output-field select { background: #15191f; border-color: #414957; color: #d4dce7; font-size: 12px; }
.output-actions { border-color: #3a424e; }
.output-actions button { font-size: 12px; padding: 10px 8px; }
.output-note { background: #20252d; border-color: #3b4452; color: #a0aabb; font-size: 12px; }
.timecode { color: #a8b0bd; font-size: 11px; }
#vzLabel { color: #a7b1bf; font-size: 11px; min-width: 40px; }
#timeline { background: #14161a; border-color: #363b44; }
#tlBar { background: #1a1c21; border-color: #343943; }
.timeline-title { font-size: 13px; color: #dce1e9; }
#tlBar button { color: #abb4c1; }
#tlBar button:hover { background: #2b313a; color: #eff2f7; }
#tlBar button.ctl { background: #232830; border-color: #424b59; font-size: 12px; }
#tlBar .timeline-import { width: auto; font-size: 12px; padding: 0 10px; }
#tlBar .hint { font-size: 11px; color: #8590a1; }
#tlZoomLab { font-size: 11px; color: #a0acbc; min-width: 72px; }
#tlMap { background: #14181e; border-color: #38434f; }
#tlScroll { background: repeating-linear-gradient(90deg, transparent 0, transparent 99px, #ffffff04 99px, #ffffff04 100px); }
#tlRuler { background: #1a1d23; color: #94a1b5; border-color: #343e4b; font-size: 11px; }
.tl-tick { color: #94a0b1; border-color: #455263; font-size: 11px; }
#tlAudio, .track { border-color: #2d3641; }
.track-label { background: #1e242c; border-color: #3b4655; color: #b0bdcf; font-size: 11px; }
.clip { font-size: 11px; }
.aclip .anm { color: #e8dff8; font-size: 11px; }
#timelineEmpty { border-color: #3e4958; background: #ffffff02; color: #8592a6; font-size: 12px; }
#timelineEmpty strong, #timelineEmpty b, #timelineEmpty span, #timelineEmpty p { color: #9daabd; font-size: 12px; }
#modalCard { background: #1b1f26; border-color: #424c5c; }
#modalCard .scene-card { background: #161b22; border-color: #374352; }
#modalCard input, #modalCard select, #modalCard textarea { background-color: #12171e; }
@media (max-width: 1200px) {
  .library-heading h1 { font-size: 15px; }
  .tool-tab { font-size: 11px; }
  .lib-tab { font-size: 11px; padding: 5px 7px; }
  .mod-card .mc-name { font-size: 12px; }
  .stage-heading b { font-size: 13px; }
  .timecode { font-size: 11px; }
  #vzLabel { min-width: 38px; }
  .dh-sub { font-size: 11px; }
  .dh-btn { font-size: 12px; }
}
@media (max-width: 1000px) and (min-width: 821px) {
  .stage-heading { flex-wrap: wrap; align-content: center; row-gap: 1px; }
  .preview-meta { font-size: 11px; }
  .stage-heading b { font-size: 12px; }
  #vzLabel { min-width: 34px; }
}
@media (max-width: 820px) {
  #btnInspector { display: inline-flex; }
  #btnRenders { font-size: 12px; }
  .preview-meta { font-size: 11px; }
  #topbar .ctl { font-size: 12px; }
}
@media (max-width: 600px) {
  .library-heading h1 { font-size: 15px; }
  .tool-tab { font-size: 11px; flex-basis: 57px; min-width: 57px; }
  #topbar .ctl, #btnRenders { font-size: 12px; }
  #btnExport { font-size: 12px; }
  #projName { font-size: 12px; }
  .mod-card .mc-name { font-size: 12px; padding: 7px; }
  .mod-sep { font-size: 11px; }
  #libSearch { font-size: 12px; }
  .stage-heading b { font-size: 13px; }
  .dh-sub { font-size: 11px; }
  .dh-btn { font-size: 12px; }
  .panel-intro { font-size: 12px; }
  .template-card strong { font-size: 12px; }
  .template-card small { font-size: 11px; }
  .media-item strong { font-size: 12px; }
  .timecode { font-size: 11px; }
  #tlBar .timeline-import, #tlBar button.ctl { font-size: 11px; }
  #tlZoomLab { min-width: 63px; font-size: 11px; }
  #timelineEmpty strong, #timelineEmpty b, #timelineEmpty span, #timelineEmpty p { font-size: 11px; }
  .top-right { gap: 6px; }
}
@media (max-width: 390px) {
  .mod-card .mc-name { font-size: 11px; }
  .timecode { font-size: 11px; }
  #tlZoomLab { min-width: 58px; }
  #topbar { padding-left: 8px; padding-right: 8px; }
  #topbar .ctl { padding-left: 7px; padding-right: 7px; }
}

#libSplit { left: calc(var(--rail-width) + var(--library-width)); }

.inspector-close{display:none;margin-left:auto;width:32px;height:32px;align-self:center;border:1px solid var(--line2);border-radius:6px;background:var(--panel2);color:var(--txt);font-size:22px;cursor:pointer}
@media(max-width:820px){.inspector-close{display:block}}

/* Video controls stay in the header; the inspector is dedicated to layers. */
#app { grid-template-rows: auto minmax(0, 1fr) var(--timeline-height); }
#topbar { display: flex; flex-direction: column; align-items: stretch; gap: 0; padding: 0; min-width: 0; }
.header-main { display: grid; grid-template-columns: auto minmax(80px, 1fr) auto auto; align-items: center; gap: 14px; min-width: 0; padding: 11px 18px; }
.header-main .brand { grid-column: 1; grid-row: 1; }
.header-main .project-name { grid-column: 2; grid-row: 1; display: flex; min-width: 0; margin: 0; }
.header-main #projName { width: 100%; max-width: 205px; min-width: 0; height: 34px; text-align: left; padding: 7px 8px; }
.header-main .top-right { grid-column: 3; grid-row: 1; display: flex; width: auto; min-width: 0; margin: 0; gap: 7px; }
.header-main #btnRenders { display: inline-flex; }
.gornich-nav { grid-column: 4; grid-row: 1; display: flex; align-items: center; justify-content: flex-end; gap: 12px; min-width: 0; white-space: nowrap; }
.gornich-home { color: #a9b2c0; font-size: 12px; text-decoration: none; }
.gornich-home:hover { color: var(--acc); }
#gsso-slot, #gsso-slot .gsso { position: relative; top: auto; right: auto; }
.header-tools { display: flex; align-items: flex-end; gap: 10px; min-width: 0; padding: 9px 18px 11px; border-top: 1px solid #252a31; background: #15181d; overflow-x: auto; scrollbar-width: thin; }
#topbar #outputPanel { padding: 9px 18px 11px; overflow-y: hidden; }
.header-field { display: flex; flex-direction: column; flex: none; gap: 4px; color: #949ead; font-size: 10px; line-height: 1.2; }
#topbar .header-field .ctl { height: 32px; background: #1c2128; padding: 5px 8px; font-size: 12px; }
#topbar #aspect { width: 164px; }
#topbar #resolution { width: 129px; }
#topbar #quality { width: 169px; }
#topbar #fps { width: 88px; }
.header-output-actions { display: flex; flex: none; align-items: center; gap: 7px; padding-left: 8px; border-left: 1px solid var(--line2); }
#topbar .header-output-actions .ctl { height: 32px; padding: 5px 10px; white-space: nowrap; }
#topbar .header-tools .history-actions { flex: none; gap: 2px; border: 0; padding: 0 0 0 5px; margin: 0 0 0 auto; }
.inspector-heading { align-self: center; font-size: 13px; font-weight: 600; margin: 0; color: #c9d0db; }
.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; }
@media (max-width: 1100px) {
  .header-main { grid-template-columns: auto minmax(80px, 1fr) auto; column-gap: 12px; row-gap: 7px; padding: 9px 12px; }
  .header-main .gornich-nav { grid-column: 3; grid-row: 1; }
  .header-main .top-right { grid-column: 1 / -1; grid-row: 2; justify-content: flex-end; }
  #topbar .header-tools, #topbar #outputPanel { padding-left: 12px; padding-right: 12px; }
}
@media (max-width: 820px) {
  #inspector { top: 0; }
}
@media (max-width: 600px) {
  #app { grid-template-rows: auto auto var(--timeline-height); }
  .header-main { grid-template-columns: minmax(0, 1fr) auto; gap: 7px 8px; padding: 9px 10px; }
  .header-main .brand { min-width: 0; gap: 5px; }
  .header-main .logo { display: block; font-size: 11px; letter-spacing: .05em; }
  .header-main .brand-mark { width: 19px; gap: 2px; }
  .header-main .studio-badge { display: none; }
  .header-main .gornich-nav { grid-column: 2; grid-row: 1; gap: 8px; }
  .gornich-home { font-size: 11px; }
  .header-main .project-name { grid-column: 1; grid-row: 2; }
  .header-main #projName { height: 32px; padding: 5px 2px; font-size: 11px; }
  .header-main .top-right { grid-column: 2; grid-row: 2; justify-content: flex-end; gap: 5px; }
  #topbar .header-main .ctl { height: 32px; padding: 6px 7px; font-size: 11px; }
  #topbar .header-main #btnRenders { padding: 6px 7px !important; font-size: 11px; }
  .header-main #btnExport { min-width: 69px; height: 32px; min-height: 32px; padding: 6px 8px; font-size: 11px; }
  #topbar .header-tools, #topbar #outputPanel { gap: 8px; padding: 8px 10px 10px; }
  #topbar #aspect { width: 155px; }
  #topbar #resolution { width: 123px; }
  #topbar #quality { width: 161px; }
  #topbar #fps { width: 86px; }
  #topbar .header-tools .history-actions { margin-left: 0; }
}

/* Gornich header fit and shared account theme. */
#topbar { flex-wrap: nowrap; align-content: stretch; }
.header-main { width: 100%; max-width: 100%; }
#gsso-slot .gsso { gap: 6px; z-index: 100; }
#gsso-slot .gsso-btn, #gsso-slot .gsso-chip { height: 34px; border-radius: 7px; font-size: 12px; background: #1c2128; border: 1px solid #343c47; color: #d8e0eb; box-shadow: none; backdrop-filter: none; }
#gsso-slot .gsso-btn { padding: 0 12px; }
#gsso-slot .gsso-primary { background: #252f16; color: #d4ff3f; border-color: #465629; }
#gsso-slot .gsso-btn:hover, #gsso-slot .gsso-chip:hover { border-color: #91ad3b; transform: none; }
#gsso-slot .gsso-av { background: #d4ff3f; color: #161b0f; width: 25px; height: 25px; border-radius: 5px; }
#gsso-slot .gsso-name { font-size: 12px; }
#gsso-slot .gsso-menu { top: 42px; background: #1b2027; border-color: #3a434e; border-radius: 9px; backdrop-filter: none; }
#gsso-slot .gsso-mhead { border-color: #343c47; color: #9ca8b7; }
#gsso-slot .gsso-mi:hover { background: #303922; }
@media(max-width:600px) {
  .header-main { grid-template-columns: minmax(0, 1fr) auto; }
  .header-main .gornich-nav { gap: 6px; }
  #gsso-slot .gsso { gap: 4px; }
  #gsso-slot .gsso-btn { padding: 0 7px; font-size: 11px; height: 30px; }
  #gsso-slot .gsso-chip { height: 30px; gap: 5px; padding-right: 7px; }
  #gsso-slot .gsso-name { max-width: 80px; font-size: 11px; }
  #gsso-slot .gsso-av { width: 22px; height: 22px; }
}

/* Expanded catalog: searchable collections and sections. */
.lib-filters{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin-top:8px}
.lib-filters select{min-width:0;width:100%;height:32px;border:1px solid #353d48;border-radius:5px;background:#101419;color:#d4dae4;padding:4px 6px;font-size:11px}
.lib-results{font-size:10px;color:#8997a8;padding:8px 1px 0}
.mc-new{position:absolute;left:5px;top:5px;padding:3px 5px;border-radius:4px;background:#c8ff00;color:#101508;font-size:8px;line-height:1;font-weight:800;letter-spacing:.06em;pointer-events:none}
.mod-card .mc-name{white-space:normal;min-height:43px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}

/* Audio binding: explicit silent/peak values, separate rise and return. */
.mod-peak-label{color:var(--acc);font-size:10px;margin:2px 0}
.modrow.modpanel{display:grid;gap:10px;padding:10px;margin-top:7px;border:1px solid #45502f;background:#1c2219;border-radius:8px;min-width:0}
.modpanel .mod-source{display:flex;align-items:center;gap:12px;font-size:11px;color:var(--muted)}
.modpanel .mod-source select{min-width:0;flex:1;padding:5px}
.modpanel .mod-control{min-width:0}
.modpanel .mod-control label{display:flex;justify-content:space-between;gap:4px;font-size:10px;margin:0 0 4px}
.modpanel .mod-control label span{color:var(--text);font-variant-numeric:tabular-nums}
.modpanel input[type=range]{width:100%;min-width:0;margin:0;display:block}
.modpanel .mod-timing{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.modpanel .mod-extra{display:grid;gap:10px;margin-top:10px}
.modpanel .mod-advanced summary{font-size:10px;color:var(--muted);cursor:pointer}
.modpanel .mod-live{display:flex;align-items:center;gap:9px;font-size:10px;color:var(--muted)}
.modpanel meter{width:100%;min-width:0;flex:1;height:8px;accent-color:var(--acc)}
.modpanel .mod-current{font-variant-numeric:tabular-nums;color:var(--text)}
.modpanel .mod-actions{display:flex;gap:6px}
.modpanel .mod-actions button{flex:1;min-width:0;font-size:10px;padding:5px 2px}
.modpanel .mod-range-hint{font-size:10px;line-height:1.45;margin:0;color:#aab89c}
.modpanel .mod-warning{color:#ffcb77}
.mod-policy{font-size:10px;margin-top:3px;color:var(--muted);line-height:1.4}

/* w82 — per-setting defaults, including audio response and zone controls */
.setting-heading{display:flex;align-items:center;gap:6px;min-width:0;margin-bottom:4px}
#inspBody .setting-heading>label{display:flex;align-items:center;flex:1;gap:6px;min-width:0;margin:0}
.setting-heading .val,.setting-heading label>span:last-child{margin-left:auto}
.setting-reset{flex:0 0 24px;width:24px;height:24px;padding:0;border:1px solid transparent;border-radius:6px;background:transparent;color:var(--muted,#89929f);font:18px/1 sans-serif;cursor:pointer}
.setting-reset:hover{color:var(--acc);background:rgba(212,255,63,.09);border-color:rgba(212,255,63,.2)}
.setting-reset:focus-visible{outline:2px solid var(--acc);outline-offset:2px}
.reset-look{width:100%;margin:0 0 14px;font-size:11px;color:var(--muted,#89929f)}
.modpanel .setting-heading{gap:2px;margin-bottom:2px}
.modpanel .setting-reset{flex-basis:21px;width:21px;height:21px;font-size:16px}
.modpanel .setting-heading label{font-size:10px}
.mod-source>select{width:100%}
.animation-duration{margin-top:8px}
.zone-setting{min-width:0}
.zone-setting[hidden]{display:none}
.zone-setting>input[type=range],.zone-setting>select{width:100%;min-width:0}
.zone-setting .setting-heading{gap:2px}
.zone-setting .setting-reset,.zone-color .setting-reset{flex-basis:20px;width:20px;height:20px;font-size:15px}
.zone-color{display:flex;align-items:center;gap:1px}
.zone-color input[type=color]{width:24px!important}

#inspBody .f>.setting-heading>label{color:#aab1bd;font-size:12px}
#inspBody .setting-heading .val{font:12px var(--mono);color:#d0d6e0}
.modpanel .mod-source{display:block}
.zone-setting-check{grid-column:1/-1}
