/* Pasta — scene blocking studio. A dark editor so the lit stage is the brightest thing on screen. */
:root {
  --bg: #0b0d12; --panel: #11141b; --panel2: #161a23; --line: #232937; --line2: #2d3445;
  --ink: #e8ecf4; --muted: #8b94a8; --dim: #5d667a;
  --blue: #2463ff; --blue2: #4f86ff; --blue-soft: rgba(36, 99, 255, .16);
  --red: #ff3b47; --ok: #3ad29f;
  --r: 10px; --r-sm: 7px;
  --top: 52px; --left: 268px; --right: 300px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg); color: var(--ink); font: 13px/1.45 var(--font);
  display: grid; grid-template-rows: var(--top) minmax(0, 1fr) auto; overflow: hidden;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
kbd {
  font: 600 10.5px var(--mono); padding: 1px 5px; border-radius: 5px; background: #1e2330;
  border: 1px solid var(--line2); border-bottom-width: 2px; color: var(--ink); white-space: nowrap;
}
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--muted); }
.spacer { flex: 1; }
:focus-visible { outline: 2px solid var(--blue2); outline-offset: 2px; }

/* ---------- buttons ---------- */
.primary, .ghost, .rec, .mini, .icon {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 32px; padding: 0 12px; border-radius: 8px; border: 1px solid transparent;
  font-weight: 600; white-space: nowrap; transition: background .15s, border-color .15s, color .15s;
}
.primary { background: var(--blue); color: #fff; }
.primary:hover { background: #3a74ff; }
.ghost { background: transparent; border-color: var(--line2); color: var(--ink); }
.ghost:hover { background: #1a1f2b; border-color: #3a4256; }
.icon { width: 32px; padding: 0; background: transparent; }
.icon:hover { background: #1a1f2b; }
.sm { height: 28px; font-size: 12px; }
.icon.sm { width: 28px; }
.mini { height: 26px; padding: 0 9px; font-size: 12px; background: var(--blue-soft); color: #9fbcff; border-radius: 7px; }
.mini:hover { background: rgba(36, 99, 255, .28); color: #fff; }
.rec { background: #2a1418; border-color: #4a2026; color: #ffb3b8; }
.rec i { width: 10px; height: 10px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 3px rgba(255, 59, 71, .18); }
.rec:hover { background: #3a181d; }
.rec.on { background: var(--red); border-color: var(--red); color: #fff; }
.rec.on i { background: #fff; border-radius: 2px; animation: none; box-shadow: none; }
button:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- top bar ---------- */
.top {
  display: flex; align-items: center; gap: 10px; padding: 0 12px; min-width: 0;
  background: var(--panel); border-bottom: 1px solid var(--line); z-index: 5;
}
.brand { display: flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; font-weight: 800; font-size: 17px; letter-spacing: -.02em; }
.brand .logo { width: 28px; height: 28px; stroke: none; }
.proj {
  min-width: 60px; width: 210px; height: 30px; padding: 0 9px; border-radius: 7px;
  background: transparent; border: 1px solid transparent; color: var(--ink); font-weight: 600;
}
.proj:hover { border-color: var(--line2); }
.proj:focus { border-color: var(--blue); background: #0d1017; outline: none; }
.save-state { color: var(--dim); font-size: 11.5px; white-space: nowrap; }
.save-state.dirty { color: var(--muted); }
.seg { display: inline-flex; padding: 3px; background: #0b0e14; border: 1px solid var(--line); border-radius: 9px; }
.seg button { height: 26px; padding: 0 12px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-weight: 600; }
.seg button.on { background: #222937; color: #fff; }
.aspect select {
  height: 32px; padding: 0 28px 0 10px; border-radius: 8px; border: 1px solid var(--line2);
  background: #0f1219 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5' fill='none' stroke='%238b94a8' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 7px center / 16px;
  appearance: none; font-weight: 600;
}
.menu-wrap { position: relative; }
.menu {
  position: absolute; right: 0; top: 38px; min-width: 210px; padding: 6px; z-index: 30;
  background: #171b25; border: 1px solid var(--line2); border-radius: 10px; box-shadow: 0 18px 50px rgba(0, 0, 0, .5);
}
.menu button { display: block; width: 100%; text-align: left; padding: 8px 10px; border: 0; border-radius: 6px; background: none; }
.menu button:hover { background: #222938; }
.only-m { display: none; }

/* ---------- workspace ---------- */
.work { display: grid; grid-template-columns: var(--left) minmax(0, 1fr) var(--right); min-height: 0; }
.panel { background: var(--panel); min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #2b3243 transparent; }
.panel.left { border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.panel.right { border-left: 1px solid var(--line); }
.block { padding: 12px; border-bottom: 1px solid var(--line); }
.block.grow { flex: 1; border-bottom: 0; }
.block-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.block-h h2, .insp h2 { margin: 0; font-size: 11px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); font-weight: 700; }

.scenes { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; max-height: 300px; overflow-y: auto; scrollbar-width: thin; }
.scene {
  display: grid; grid-template-columns: 74px 1fr auto; gap: 9px; align-items: center; padding: 6px;
  border-radius: 9px; border: 1px solid var(--line); background: var(--panel2); cursor: pointer;
}
.scene:hover { border-color: var(--line2); }
.scene.on { border-color: var(--blue); background: #121b33; }
.scene .thumb { width: 74px; aspect-ratio: 16 / 9; border-radius: 5px; background: #0a0c11 center / cover no-repeat; border: 1px solid #252c3b; position: relative; }
.scene .thumb span { position: absolute; left: 4px; top: 3px; font: 700 10px var(--mono); color: #fff; text-shadow: 0 1px 2px #000; }
.scene .meta { min-width: 0; }
.scene .meta b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scene .meta small { color: var(--muted); font-family: var(--mono); font-size: 10.5px; }
.scene .acts { display: flex; flex-direction: column; gap: 2px; opacity: 0; transition: opacity .15s; }
.scene:hover .acts, .scene.on .acts { opacity: 1; }
.scene .acts button { width: 22px; height: 20px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); padding: 0; display: grid; place-items: center; }
.scene .acts button:hover { background: #262d3d; color: #fff; }
.scene .acts svg { width: 13px; height: 13px; }

.adders { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 12px; }
.adders button {
  display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px; border-radius: 8px;
  border: 1px dashed #333b4f; background: transparent; color: #cbd3e3; font-weight: 600; font-size: 12.5px;
}
.adders button:hover { border-style: solid; border-color: var(--blue); background: var(--blue-soft); color: #fff; }
.adders svg { width: 17px; height: 17px; color: #7ea3ff; }
.objects { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.obj {
  display: flex; align-items: center; gap: 9px; height: 34px; padding: 0 9px; border-radius: 8px; cursor: pointer;
  border: 1px solid transparent;
}
.obj:hover { background: #181c26; }
.obj.on { background: #152040; border-color: #284a9e; }
.obj i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); flex: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 22%, transparent); }
.obj b { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.obj small { color: var(--dim); font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; }
.obj .dot-rec { width: 6px; height: 6px; border-radius: 50%; background: var(--c); opacity: .9; }
.obj .shot { font: 700 9.5px var(--mono); color: #9fbcff; background: var(--blue-soft); padding: 1px 5px; border-radius: 4px; }

/* ---------- viewport ---------- */
.viewport { position: relative; min-height: 0; overflow: hidden; background: #090b10; }
#glHost, #glHost canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#tags { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.tag {
  position: absolute; left: 0; top: 0; pointer-events: auto; display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 8px 3px 6px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(12, 14, 20, .78); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  color: #fff; font-size: 11px; white-space: nowrap; will-change: transform; cursor: pointer;
}
.tag i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.tag b { font-weight: 700; letter-spacing: .02em; }
.tag small { font: 600 9px var(--mono); color: #9aa3b6; letter-spacing: .05em; }
.tag.on { border-color: var(--c); box-shadow: 0 0 0 2px color-mix(in srgb, var(--c) 35%, transparent); }
.hud {
  position: absolute; pointer-events: none; padding: 5px 10px; border-radius: 8px; font-size: 11.5px;
  background: rgba(10, 12, 17, .72); border: 1px solid rgba(255, 255, 255, .08); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.hud-view { left: 12px; top: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; font-size: 10.5px; color: #cdd6e8; }
.hud-rec { left: 12px; top: 44px; color: #fff; background: rgba(255, 59, 71, .9); border-color: transparent; font: 700 12px var(--mono); display: flex; align-items: center; gap: 7px; }
.hud-rec i { width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: .2; } }
.hud-moved { left: 50%; top: 12px; transform: translateX(-50%); color: #ffe3a6; border-color: rgba(255, 200, 80, .3); white-space: nowrap; }
.hud-hint { left: 12px; bottom: 12px; color: #aeb7c9; max-width: calc(100% - 24px); }
.hud-hint b { color: #fff; }
.hud-pad { right: 12px; bottom: 12px; color: #9fe9c8; font-size: 11px; }
.viewport.recording { box-shadow: inset 0 0 0 3px var(--red); }
.countdown {
  position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none;
  font: 800 140px/1 var(--font); color: #fff; text-shadow: 0 6px 40px rgba(0, 0, 0, .55);
}
.countdown.pop { animation: pop .9s ease-out; }
@keyframes pop { from { transform: scale(1.35); opacity: 0; } 30% { opacity: 1; } to { transform: scale(1); opacity: .9; } }
.toast {
  position: absolute; left: 50%; bottom: 18px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: #1c2230; border: 1px solid var(--line2); padding: 8px 14px; border-radius: 9px; font-weight: 500;
  transition: opacity .2s, transform .2s; max-width: calc(100% - 32px); text-align: center; box-shadow: 0 12px 40px rgba(0, 0, 0, .45);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.touchpad { position: absolute; left: 0; right: 0; bottom: 44px; height: 150px; pointer-events: none; }
.stick { position: absolute; left: 18px; bottom: 0; width: 132px; height: 132px; border-radius: 50%; pointer-events: auto; touch-action: none;
  background: radial-gradient(circle, rgba(255, 255, 255, .08), rgba(255, 255, 255, .03)); border: 1px solid rgba(255, 255, 255, .16); }
.stick i { position: absolute; left: 50%; top: 50%; width: 54px; height: 54px; margin: -27px; border-radius: 50%; background: rgba(36, 99, 255, .85); box-shadow: 0 6px 18px rgba(0, 0, 0, .4); }
.tbtns { position: absolute; right: 18px; bottom: 6px; display: grid; grid-template-columns: 54px 54px; gap: 8px; pointer-events: auto; }
.tbtns button { width: 54px; height: 54px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, .16); background: rgba(14, 17, 24, .7); font-size: 20px; color: #fff; touch-action: none; }
.tbtns button:active { background: var(--blue); }

/* camera tracking card */
.mocap {
  position: absolute; right: 12px; bottom: 12px; width: 300px; z-index: 4; padding: 10px; border-radius: 12px;
  background: rgba(15, 18, 25, .94); border: 1px solid var(--line2); box-shadow: 0 18px 50px rgba(0, 0, 0, .5);
}
.mocap header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.mocap header span { color: var(--muted); font-size: 12px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mocap-video { position: relative; aspect-ratio: 4 / 3; border-radius: 8px; overflow: hidden; background: #000; }
.mocap-video video, .mocap-video canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mocap-video video.mirror { transform: scaleX(-1); }
.mocap-status { position: absolute; left: 6px; right: 6px; bottom: 6px; font-size: 11px; padding: 4px 8px; border-radius: 6px; background: rgba(0, 0, 0, .6); }
.mocap-status.tracking { color: #9fe9c8; } .mocap-status.lost { color: #ffd08a; } .mocap-status.error { color: #ffb3b8; }
.mocap-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.mocap-row .rec { flex: 1; }

/* ---------- inspector ---------- */
.insp { padding: 14px; display: grid; gap: 16px; }
.insp-head { display: flex; align-items: center; gap: 10px; }
.insp-head .sw { width: 34px; height: 34px; border-radius: 9px; background: var(--c); display: grid; place-items: center; color: #0b0d12; }
.insp-head .sw svg { width: 20px; height: 20px; stroke-width: 2; }
.insp-head .t { flex: 1; min-width: 0; }
.insp-head small { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.name-in {
  width: 100%; height: 32px; padding: 0 8px; margin-left: -8px; border-radius: 7px; border: 1px solid transparent;
  background: transparent; font-weight: 700; font-size: 16px; letter-spacing: .01em;
}
.name-in:hover { border-color: var(--line2); }
.name-in:focus { border-color: var(--blue); background: #0d1017; outline: none; }
.sec { display: grid; gap: 9px; }
.sec + .sec { padding-top: 14px; border-top: 1px solid var(--line); }
.field { display: grid; gap: 5px; }
.field > span, .lbl { font-size: 11.5px; color: var(--muted); font-weight: 500; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.in, .ta, select.in {
  width: 100%; height: 32px; padding: 0 9px; border-radius: 7px; border: 1px solid var(--line2); background: #0d1017;
}
.in:focus, .ta:focus { border-color: var(--blue); outline: none; }
.ta { height: auto; min-height: 64px; padding: 8px 9px; resize: vertical; line-height: 1.45; }
.num { position: relative; }
.num .in { padding-left: 24px; font-family: var(--mono); font-size: 12px; }
.num b { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); font: 700 10px var(--mono); color: var(--dim); pointer-events: none; }
.slider { display: grid; grid-template-columns: 1fr 64px; gap: 10px; align-items: center; }
.slider output { font: 600 12px var(--mono); text-align: right; color: #cfd7e6; }
input[type=range] { width: 100%; accent-color: var(--blue); }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.swatches button { width: 22px; height: 22px; border-radius: 6px; border: 2px solid transparent; background: var(--c); padding: 0; }
.swatches button.on { border-color: #fff; }
.swatches input[type=color] { width: 26px; height: 26px; padding: 0; border: 1px solid var(--line2); border-radius: 6px; background: none; cursor: pointer; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chips button { height: 26px; padding: 0 9px; border-radius: 6px; border: 1px solid var(--line2); background: transparent; color: #cbd3e3; font: 600 11.5px var(--mono); }
.chips button.on, .chips button:hover { border-color: var(--blue); background: var(--blue-soft); color: #fff; }
.motion-card { padding: 10px; border-radius: 9px; background: var(--panel2); border: 1px solid var(--line); display: grid; gap: 8px; }
.motion-card .stat { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.motion-card .stat b { color: var(--ink); font-weight: 600; font-family: var(--mono); font-size: 11.5px; }
.btns { display: flex; flex-wrap: wrap; gap: 6px; }
.btns > * { flex: 1; }
.cta-cam { width: 100%; height: 40px; border-radius: 9px; background: linear-gradient(180deg, #2a6bff, #1f56e0); color: #fff; border: 0; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 8px; }
.cta-cam:hover { filter: brightness(1.08); }
.ref { display: flex; align-items: center; gap: 10px; }
.ref img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line2); }
.danger { color: #ff9aa1 !important; }
.chk { display: inline-flex; align-items: center; gap: 6px; color: #c3cbdb; font-size: 12px; user-select: none; cursor: pointer; }
.chk input { accent-color: var(--blue); width: 14px; height: 14px; margin: 0; }
.hint-box { font-size: 12px; color: var(--muted); background: #0f131b; border: 1px dashed #2a3142; border-radius: 9px; padding: 10px; }

/* ---------- timeline ---------- */
.timeline { background: var(--panel); border-top: 1px solid var(--line); display: grid; grid-template-rows: 48px auto; min-width: 0; }
.transport { display: flex; align-items: center; gap: 8px; padding: 0 12px; min-width: 0; }
.play { width: 38px; height: 38px; border-radius: 50%; background: var(--blue); color: #fff; }
.play:hover { background: #3a74ff; }
.play svg { width: 16px; height: 16px; fill: currentColor; stroke: none; }
.play .i-pause, .playing .play .i-play { display: none; }
.playing .play .i-pause { display: block; }
.tc { display: flex; align-items: center; gap: 6px; font: 600 15px var(--mono); margin-left: 6px; }
.tc-sep { color: var(--dim); }
.dur { display: inline-flex; align-items: center; gap: 2px; color: var(--muted); }
.dur input { width: 58px; height: 28px; border-radius: 6px; border: 1px solid var(--line2); background: #0d1017; font: 600 13px var(--mono); padding: 0 6px; color: var(--muted); }
.tl-body { display: grid; grid-template-columns: 150px minmax(0, 1fr); max-height: 168px; overflow-y: auto; border-top: 1px solid var(--line); scrollbar-width: thin; }
.tl-names { border-right: 1px solid var(--line); background: #0f1218; }
.tl-rulerpad { height: 24px; padding: 0 12px; display: flex; align-items: center; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); border-bottom: 1px solid var(--line); }
.tl-name { display: flex; align-items: center; gap: 8px; width: 100%; height: 26px; padding: 0 12px; border: 0; background: none; text-align: left; font-weight: 600; font-size: 12px; color: #c6cede; white-space: nowrap; overflow: hidden; }
.tl-name i { width: 8px; height: 8px; border-radius: 2px; background: var(--c); flex: none; }
.tl-name.on { background: rgba(36, 99, 255, .12); color: #fff; }
.tl-lanes canvas { display: block; width: 100%; cursor: ew-resize; touch-action: none; }

/* ---------- dialogs ---------- */
.dlg { width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 40px); padding: 0; border: 1px solid var(--line2); border-radius: 14px; background: #12151d; color: var(--ink); box-shadow: 0 30px 90px rgba(0, 0, 0, .6); }
.dlg.wide { width: min(880px, calc(100vw - 32px)); }
.dlg::backdrop { background: rgba(4, 6, 10, .66); backdrop-filter: blur(3px); }
.dlg > form, .dlg > .dlg-in { padding: 20px 22px; }
.dlg h3 { margin: 0 0 6px; font-size: 18px; letter-spacing: -.01em; }
.dlg h4 { margin: 14px 0 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); }
.dlg-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.choice { display: grid; gap: 8px; margin-top: 14px; }
.card { text-align: left; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line2); background: var(--panel2); display: grid; gap: 3px; }
.card:hover { border-color: var(--blue); background: #131c34; }
.card span { color: var(--muted); font-size: 12.5px; }
.steps { margin: 10px 0 0; padding-left: 20px; display: grid; gap: 7px; color: #cfd6e4; }
.keys { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.keys dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 0; align-items: center; }
.keys dt { white-space: nowrap; color: #cfd6e4; font-size: 12px; }
.keys dd { margin: 0; color: var(--muted); font-size: 12px; }

/* export dialog */
.ex-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 18px; margin-top: 14px; }
.ex-prev { aspect-ratio: 16 / 9; border-radius: 10px; background: #000 center / contain no-repeat; border: 1px solid var(--line2); position: relative; overflow: hidden; }
.ex-prev canvas, .ex-prev video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.ex-opts { display: grid; gap: 12px; align-content: start; }
.ex-row { display: grid; gap: 6px; }
.ex-progress { height: 6px; border-radius: 3px; background: #1d2330; overflow: hidden; }
.ex-progress i { display: block; height: 100%; width: 0; background: var(--blue); transition: width .1s linear; }
.ex-prompt { width: 100%; min-height: 220px; font: 12px/1.55 var(--mono); padding: 12px; border-radius: 10px; border: 1px solid var(--line2); background: #0b0e14; color: #dfe6f3; resize: vertical; }
.ex-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-top: 12px; }
.ex-tabs button { height: 36px; padding: 0 14px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); font-weight: 600; }
.ex-tabs button.on { color: #fff; border-color: var(--blue); }
.ex-pane[hidden] { display: none !important; }
.ex-how { margin: 0; padding-left: 18px; color: #c3cbdb; display: grid; gap: 5px; font-size: 12.5px; }
.ex-files { display: grid; gap: 6px; }
.ex-file { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; background: var(--panel2); border: 1px solid var(--line); }
.ex-file b { flex: 1; font-weight: 600; }
.ex-file small { color: var(--muted); }

/* ---------- small screens ---------- */
@media (max-width: 1180px) { :root { --left: 236px; --right: 272px; } .proj { width: 150px; } }
@media (max-width: 920px) {
  :root { --top: 50px; }
  .only-m { display: inline-flex; }
  .work { grid-template-columns: minmax(0, 1fr); }
  .panel.left, .panel.right {
    position: fixed; top: var(--top); bottom: 0; width: min(320px, 86vw); z-index: 20;
    transition: transform .22s ease; box-shadow: 0 0 60px rgba(0, 0, 0, .6);
  }
  .panel.left { left: 0; transform: translateX(-105%); }
  .panel.right { right: 0; transform: translateX(105%); }
  body.show-left .panel.left, body.show-right .panel.right { transform: none; }
  .scrim { position: fixed; inset: var(--top) 0 0 0; background: rgba(0, 0, 0, .45); z-index: 15; }
  .proj, .save-state, .aspect { display: none; }
  .brand span { display: none; }
  #btnExport span { display: none; }
  #btnExport { width: 36px; padding: 0; }
  .top { gap: 6px; padding: 0 8px; }
  .seg button { padding: 0 9px; }
  .tl-body { grid-template-columns: 96px minmax(0, 1fr); max-height: 120px; }
  .tl-name { padding: 0 8px; font-size: 11px; }
  .transport { gap: 6px; padding: 0 8px; }
  #btnKey span, #btnRec span { display: none; }
  #btnRec { width: 36px; padding: 0; }
  #btnKey { width: 34px; padding: 0; }
  .tc { font-size: 13px; margin-left: 2px; }
  .transport .chk { font-size: 11px; }
  .ex-grid, .keys { grid-template-columns: 1fr; }
  .mocap { width: min(260px, calc(100% - 24px)); }
  .hud-moved { white-space: normal; width: max-content; max-width: calc(100% - 24px); }
}
@media (max-width: 520px) {
  .transport label[title="Loop playback"] { display: none; }
  .hud-hint { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
