/* The editor: a bar on top, the scenes rail, the stage over the strip, and
   the inspector. Tokens and the shared controls are in studio.css. */

#editor {
  height: 100vh; padding: 12px; gap: 12px;
  grid-template-columns: 188px minmax(0, 1fr) 320px;
  grid-template-rows: 56px minmax(0, 1fr) 128px;
  grid-template-areas: 'top top top' 'rail stage panel' 'rail strip panel';
}
@media (max-width: 1180px) { #editor { grid-template-columns: 164px minmax(0, 1fr) 300px; } }

/* ----------------------------------------------------------- the bar */
.ed-top { grid-area: top; display: flex; align-items: center; gap: 12px; padding: 0 10px; border-radius: 14px; min-width: 0; }
.ed-name { font-size: 14px; font-weight: 700; border: 1px solid transparent; background: none; border-radius: 8px; padding: 4px 6px; margin-left: -4px; min-width: 60px; width: 22ch; max-width: 280px; text-overflow: ellipsis; color: var(--ink); }
.ed-name:hover { border-color: var(--line-2); }
.ed-name:focus { outline: none; border-color: var(--accent); background: #fff; }
.ed-top .pill { cursor: pointer; }
.ed-top .pill:hover { background: rgba(91, 77, 255, .16); }
.saved { display: flex; align-items: center; gap: 6px; color: var(--muted-2); font-size: 12px; white-space: nowrap; }
.saved .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); display: inline-block; flex: none; }
.saved.warn { color: var(--danger); }
.saved.warn .dot { background: var(--danger); }
.ed-history { margin: 0 auto; display: flex; gap: 6px; }
.tri { width: 0; height: 0; border-left: 8px solid currentColor; border-top: 5px solid transparent; border-bottom: 5px solid transparent; display: inline-block; }
@media (max-width: 1280px) { .saved span:last-child { display: none; } }

/* ---------------------------------------------------- the scenes rail */
.rail { grid-area: rail; padding: 12px; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.rail-head { display: flex; align-items: baseline; justify-content: space-between; padding: 0 2px 10px; }
.rail-head b { font-size: 13px; font-weight: 800; }
.rail-head span { font-size: 11.5px; color: var(--muted-2); font-variant-numeric: tabular-nums; }
.rail-list { overflow-y: auto; overflow-x: hidden; min-height: 0; margin: 0 -6px; padding: 2px 6px 6px; scrollbar-width: thin; }
.scene-card { border-radius: 12px; padding: 4px; cursor: pointer; position: relative; user-select: none; -webkit-user-select: none; }
.scene-card[aria-selected='true'] { background: var(--accent-soft); box-shadow: 0 0 0 1.5px var(--accent); }
.scene-card.dragging { opacity: .4; }
.scene-thumb { position: relative; aspect-ratio: 16 / 9; border-radius: 9px; overflow: hidden; background: linear-gradient(135deg, var(--a, #e9e7f4), var(--b, #d8d5ea)); }
.scene-thumb::after { content: ''; position: absolute; inset: 0; background: rgba(0, 0, 0, .18); }
.scene-thumb.cover::after { display: none; }
.scene-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; z-index: 1; }
.scene-thumb.cover img { object-fit: cover; }
.scene-n, .scene-d { z-index: 2; }
.scene-n { position: absolute; left: 6px; top: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 6px; background: rgba(255, 255, 255, .92); color: var(--ink); font-size: 10.5px; font-weight: 800; display: grid; place-items: center; }
.scene-d { position: absolute; right: 6px; bottom: 6px; height: 18px; padding: 0 6px; border-radius: 6px; background: rgba(0, 0, 0, .45); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.scene-cap { padding: 6px 4px 2px; font-size: 11px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scene-cap.none { color: var(--faint); font-weight: 500; }
.joint { display: flex; align-items: center; justify-content: center; height: 18px; position: relative; }
.joint::before { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: rgba(21, 23, 30, .14); }
.joint button { position: relative; height: 16px; padding: 0 7px; border-radius: 999px; background: #fff; border: 1px solid var(--line-2); font-size: 9.5px; font-weight: 700; color: var(--muted); }
.joint button:hover { border-color: rgba(21, 23, 30, .3); color: var(--ink); }
.joint button.on { color: var(--accent); border-color: rgba(91, 77, 255, .4); }
.drop-line { height: 3px; border-radius: 2px; background: var(--accent); margin: 2px 4px; }
.rail-add { margin-top: 10px; height: 46px; flex: none; border-radius: 12px; border: 1.5px dashed var(--line-3); background: none; display: grid; place-items: center; color: var(--muted); font-size: 12px; font-weight: 600; }
.rail-add:hover { border-color: rgba(91, 77, 255, .5); color: var(--accent); }

/* --------------------------------------------------------- the stage */
.stage { grid-area: stage; position: relative; display: grid; place-items: center; min-height: 0; min-width: 0; }
.stage-frame { position: relative; line-height: 0; flex: none; max-width: 100%; }
#view { display: block; max-width: 100%; border-radius: 14px; box-shadow: 0 30px 80px -24px rgba(7, 26, 58, .45), 0 0 0 1px rgba(21, 23, 30, .06); background: #0b0d14; }
.stage.drag #view { outline: 2px dashed var(--accent); outline-offset: 6px; }
.stage-chip { position: absolute; top: 2px; height: 24px; padding: 0 10px; border-radius: 999px; background: rgba(255, 255, 255, .78); border: 1px solid rgba(255, 255, 255, .9); font-size: 11px; font-weight: 700; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; z-index: 2; white-space: nowrap; }
.stage-chip b { color: var(--ink); font-weight: 700; }
.stage-chip.left { left: 4px; }
.stage-chip.right { right: 4px; }
.stage-chip .sep { color: rgba(21, 23, 30, .2); }
.cap-box { position: absolute; border: 1.5px solid rgba(91, 77, 255, .95); border-radius: 8px; box-shadow: 0 0 0 4px rgba(91, 77, 255, .18); pointer-events: none; z-index: 1; }
.cap-box.hover { border-color: rgba(91, 77, 255, .55); box-shadow: none; }
.cap-box.hover .cap-tag, .cap-box.hover i { display: none; }
.cap-tag { position: absolute; left: -1px; top: -24px; height: 18px; padding: 0 7px; border-radius: 5px; background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; display: flex; align-items: center; letter-spacing: .2px; white-space: nowrap; line-height: 1; }
.cap-box i { position: absolute; width: 8px; height: 8px; border-radius: 2px; background: #fff; border: 1.5px solid var(--accent); }
.cap-box i:nth-of-type(1) { left: -5px; top: -5px; }
.cap-box i:nth-of-type(2) { right: -5px; top: -5px; }
.cap-box i:nth-of-type(3) { left: -5px; bottom: -5px; }
.cap-box i:nth-of-type(4) { right: -5px; bottom: -5px; }
.stage-hint { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; z-index: 2; }
.stage-hint > div { pointer-events: auto; text-align: center; padding: 22px 26px; border-radius: 16px; background: rgba(255, 255, 255, .92); border: 1px solid #fff; box-shadow: var(--card-shadow); }
.stage-hint b { display: block; font-size: 14px; margin-bottom: 4px; }
.stage-hint p { margin: 0 0 12px; color: var(--muted); font-size: 12px; line-height: 1.4; }

/* --------------------------------------------------------- the strip */
.strip { grid-area: strip; padding: 10px 14px; user-select: none; -webkit-user-select: none; min-width: 0; }
.strip-bar { display: flex; align-items: center; gap: 12px; height: 32px; }
.play-btn { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); border: 0; display: grid; place-items: center; color: #fff; box-shadow: 0 1px 2px rgba(91, 77, 255, .35); flex: none; }
.play-btn:hover { background: var(--accent-hover); }
.play-btn .tri { border-left: 10px solid #fff; border-top-width: 6px; border-bottom-width: 6px; margin-left: 3px; }
.play-btn .bars { width: 10px; height: 12px; border-left: 3.5px solid #fff; border-right: 3.5px solid #fff; }
.clock { font-variant-numeric: tabular-nums; font-size: 13px; white-space: nowrap; }
.clock b { font-weight: 800; }
.clock span { color: var(--muted-2); }
.strip-tools { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.strip-tools .chip .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; display: inline-block; opacity: .45; }
.strip-tools .chip.on .dot { opacity: 1; }
.mute { width: 28px; height: 28px; border-radius: 8px; border: 0; background: none; color: var(--muted); display: grid; place-items: center; flex: none; }
.mute:hover { background: var(--fill); color: var(--ink); }
.sound-wait { font-size: 11px; color: #9a6a08; white-space: nowrap; }
.lanes { position: relative; margin-top: 8px; touch-action: none; }
.lane-scenes { position: relative; height: 36px; border-radius: 8px; background: var(--fill); cursor: pointer; }
.block { position: absolute; top: 3px; bottom: 3px; border-radius: 6px; background: #fff; border: 1px solid var(--line); padding: 0 8px; display: flex; align-items: center; gap: 6px; font-size: 11px; overflow: hidden; white-space: nowrap; }
.block b { font-weight: 800; }
.block span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.block.sel { background: rgba(91, 77, 255, .12); border-color: var(--accent); }
.block.sel b { color: var(--accent); }
.block::before, .block::after { content: ''; position: absolute; top: 0; bottom: 0; width: 7px; cursor: ew-resize; }
.block::before { left: 0; }
.block::after { right: 0; }
.marker { position: absolute; top: -3px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--marker); box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .9); z-index: 3; cursor: pointer; }
.marker::after { content: ''; position: absolute; inset: -5px; }
.lane-sound { position: relative; height: 22px; margin-top: 6px; border-radius: 6px; background: var(--fill); overflow: hidden; cursor: pointer; }
.lane-sound .wave { position: absolute; inset: 0; background-image: repeating-linear-gradient(90deg, rgba(21, 23, 30, .28) 0 1.5px, transparent 1.5px 4px); -webkit-mask-image: linear-gradient(to bottom, transparent 15%, #000 40%, #000 60%, transparent 85%); mask-image: linear-gradient(to bottom, transparent 15%, #000 40%, #000 60%, transparent 85%); }
.lane-sound .label { position: absolute; left: 8px; top: 0; bottom: 0; display: flex; align-items: center; font-size: 10px; font-weight: 700; color: var(--muted); background: linear-gradient(90deg, rgba(244, 245, 248, .92) 70%, transparent); padding-right: 14px; z-index: 1; }
.lane-sound .label.empty { background: none; color: var(--muted-2); font-weight: 600; }
.lane-sound .vo { position: absolute; top: 3px; bottom: 3px; border-radius: 4px; background: var(--accent); color: #fff; font-size: 9.5px; font-weight: 800; display: grid; place-items: center; overflow: hidden; white-space: nowrap; z-index: 1; }
.playhead { position: absolute; top: -6px; bottom: 0; width: 2px; margin-left: -1px; background: var(--accent); pointer-events: none; z-index: 4; }
.playhead::before { content: ''; position: absolute; top: -4px; left: -5px; width: 12px; height: 12px; border-radius: 4px; background: var(--accent); box-shadow: 0 1px 3px rgba(91, 77, 255, .5); }

/* ----------------------------------------------------- the inspector */
.panel { grid-area: panel; display: flex; flex-direction: column; overflow: hidden; position: relative; min-height: 0; }
.tabs { margin: 10px 10px 0; flex: none; }
.panel-body { padding: 14px 14px 48px; overflow-y: auto; flex: 1; min-height: 0; scrollbar-width: thin; }
.panel-fade { position: absolute; left: 1px; right: 1px; bottom: 1px; height: 44px; border-radius: 0 0 15px 15px; background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, .95)); pointer-events: none; }
.ins-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.ins-title { font-size: 15px; font-weight: 800; letter-spacing: -.2px; }
.ins-sub { font-size: 12px; color: var(--muted-2); margin-top: 2px; font-variant-numeric: tabular-nums; }
.sec { margin-top: 18px; }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 20px; }
.sec-head .label { white-space: nowrap; }
.sec-head .aside { font-size: 11px; color: var(--muted-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.sec-head .link { font-size: 11.5px; font-weight: 700; }
.sub-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.sub-row > .label { font-weight: 600; }
.ins-empty { padding: 26px 8px; text-align: center; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.ins-empty b { display: block; color: var(--ink); font-size: 13.5px; margin-bottom: 4px; }
.panel-body .field + .field { margin-top: 8px; }
.panel-body textarea.field { margin-top: 8px; font-weight: 600; }

/* A bar with a chosen stretch and a handle at each end: the part of a file
   a scene uses, or when a zoom happens inside its scene. */
.rangebar { position: relative; height: 46px; margin-top: 8px; border-radius: 10px; overflow: hidden; background: repeating-linear-gradient(90deg, #1a1d26 0 22px, #232734 22px 44px); touch-action: none; }
.rangebar.light { height: 26px; background: var(--fill); }
.rangebar .film { position: absolute; inset: 0; display: flex; }
.rangebar .film img { flex: 1; min-width: 0; height: 100%; object-fit: cover; }
.rangebar .out { position: absolute; top: 0; bottom: 0; background: rgba(244, 245, 248, .78); }
.rangebar.light .out { display: none; }
.rangebar .sel { position: absolute; top: 0; bottom: 0; border-top: 2px solid var(--accent); border-bottom: 2px solid var(--accent); cursor: grab; }
.rangebar.light .sel { background: rgba(91, 77, 255, .16); border: 0; }
.rangebar .grip { position: absolute; top: 0; bottom: 0; width: 10px; background: var(--accent); display: grid; place-items: center; cursor: ew-resize; z-index: 1; }
.rangebar .grip.l { border-radius: 5px 0 0 5px; }
.rangebar .grip.r { border-radius: 0 5px 5px 0; margin-left: -10px; }
.rangebar .grip i { width: 2px; height: 14px; border-radius: 1px; background: rgba(255, 255, 255, .8); display: block; }
.rangebar.light .grip i { height: 10px; }
.range-labels { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 6px; font-variant-numeric: tabular-nums; gap: 8px; }
.range-labels b { color: var(--ink); font-weight: 700; }

.stepper { display: flex; align-items: center; gap: 4px; }
.stepper input { width: 64px; height: 28px; text-align: center; border-radius: 8px; border: 1px solid var(--line-2); background: #fff; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.speed { width: 150px; }

.style-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.style-card { height: 58px; display: grid; place-items: center; position: relative; }
.style-card .aa { font-size: 20px; line-height: 1; margin-top: -8px; }
.style-card .nm { position: absolute; bottom: 6px; font-size: 10px; font-weight: 600; color: var(--muted); }
.style-card[aria-checked='true'] .nm { color: var(--accent); font-weight: 700; }
.chips { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.chips .chip { height: 24px; padding: 0 9px; border: 0; background: var(--fill); font-size: 11px; }
.chips .chip.on { background: rgba(91, 77, 255, .12); }
.more-caps { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; align-items: center; font-size: 11px; color: var(--muted-2); }
.note-box { margin-top: 8px; padding: 9px 10px; border-radius: 10px; background: var(--fill); font-size: 11.5px; color: var(--muted); line-height: 1.45; }

.camera { display: flex; gap: 14px; margin-top: 10px; align-items: stretch; }
.spots { width: 78px; flex: none; aspect-ratio: 9 / 16; border-radius: 10px; background: var(--ink); padding: 6px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.spots button { border-radius: 4px; background: rgba(255, 255, 255, .12); border: 0; padding: 0; }
.spots button:hover { background: rgba(255, 255, 255, .24); }
.spots button[aria-checked='true'] { background: var(--accent); box-shadow: 0 0 0 2px rgba(255, 255, 255, .35) inset; }
.camera-side { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: space-between; gap: 10px; }
.camera-side .desc { font-size: 11.5px; color: var(--muted); line-height: 1.45; }
.camera-side .desc b { color: var(--ink); font-weight: 700; }
.amount-row { display: flex; justify-content: space-between; font-size: 11.5px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.amount-row b { color: var(--ink); font-variant-numeric: tabular-nums; }
.zoom-tabs { display: flex; gap: 4px; margin-top: 10px; flex-wrap: wrap; }
.device-card { margin-top: 8px; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: #fff; border: 1px solid var(--line); }
.device-card .shape { width: 14px; height: 26px; border-radius: 4px; border: 2px solid var(--ink); flex: none; }
.device-card .shape.wide { width: 26px; height: 16px; }
.device-card .shape.none { border-style: dashed; border-color: var(--muted-2); }
.device-card .info { min-width: 0; flex: 1; }
.device-card .t { font-size: 12px; font-weight: 700; }
.device-card .s { font-size: 11px; color: var(--muted-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.device-card .link { font-size: 11.5px; font-weight: 700; }
.device-card.second { margin-top: 6px; border-style: dashed; }
.sub-row .seg.sm { flex: 0 1 auto; min-width: 0; }
.sub-row .seg.sm .seg-item { padding: 0 6px; font-size: 11px; }

/* -------------------------------------------------------- the Look tab */
.tiles { display: grid; gap: 8px; margin-top: 8px; }
.tiles.c3 { grid-template-columns: repeat(3, 1fr); }
.tiles.c4 { grid-template-columns: repeat(4, 1fr); }
.tiles.c5 { grid-template-columns: repeat(5, 1fr); }
.tile { border: 0; background: none; padding: 0; text-align: center; min-width: 0; }
.tile .sw { display: block; border-radius: 9px; box-shadow: 0 0 0 1px rgba(21, 23, 30, .06); }
.tile[aria-checked='true'] .sw { box-shadow: var(--ring); }
.tile .nm { display: block; margin-top: 4px; font-size: 10.5px; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile[aria-checked='true'] .nm { color: var(--accent); }
.tiles.c5 .tile .nm { font-size: 9.5px; }
.dev-tile { height: 62px; display: grid; place-items: center; align-content: center; gap: 5px; }
.dev-tile .glyph { width: 13px; height: 24px; border-radius: 4px; border: 2px solid var(--muted); box-sizing: border-box; }
.dev-tile .glyph.droid { border-radius: 3px; }
.dev-tile .glyph.tab { width: 20px; border-radius: 3px; }
.dev-tile .glyph.win { width: 24px; height: 18px; border-radius: 3px; border-top-width: 5px; }
.dev-tile .glyph.none { border-style: dashed; border-color: var(--muted-2); }
.dev-tile .glyph.auto { border-style: dotted; }
.dev-tile .nm { font-size: 10px; font-weight: 600; color: var(--muted); }
.dev-tile[aria-checked='true'] .glyph { border-color: var(--ink); }
.dev-tile[aria-checked='true'] .nm { color: var(--accent); font-weight: 700; }
.finishes { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 8px; }
.finish { height: 26px; padding: 0 9px 0 6px; border-radius: 999px; border: 0; background: var(--fill); color: var(--muted); font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.finish i { width: 14px; height: 14px; border-radius: 50%; display: block; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }
.finish[aria-pressed='true'] { background: rgba(91, 77, 255, .12); color: var(--accent); font-weight: 700; }
.colours { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.colours label { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 600; color: var(--muted); }
.colours input { width: 100%; height: 30px; padding: 2px; border-radius: 8px; border: 1px solid var(--line-2); background: #fff; cursor: pointer; }
.motions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.motions .chip { height: 28px; border: 0; background: var(--fill); font-size: 11.5px; }
.motions .chip.on { background: rgba(91, 77, 255, .12); }
.brand-card { margin-top: 8px; display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; background: #fff; border: 1px solid var(--line); }
.brand-card img, .brand-card .blank { width: 34px; height: 34px; border-radius: 9px; flex: none; object-fit: cover; }
.brand-card .blank { background: linear-gradient(135deg, #c9c3ff, #8f84ff); }
.brand-card .t { font-size: 12.5px; font-weight: 700; }
.brand-card .s { font-size: 11px; color: var(--muted-2); }
.brand-card .info { flex: 1; min-width: 0; }
.brand-card .info > div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ----------------------------------------------- Preview: the stage alone */
body.previewing #editor { grid-template-columns: 0 minmax(0, 1fr) 0; grid-template-rows: 0 minmax(0, 1fr) 0; gap: 0; padding: 24px; background: #0b0d14; }
body.previewing #editor > :not(.stage) { visibility: hidden; overflow: hidden; }
body.previewing .stage-chip, body.previewing .cap-box { display: none; }
body.previewing #view { box-shadow: none; }
.preview-exit { position: fixed; right: 16px; top: 14px; z-index: 50; display: none; }
body.previewing .preview-exit { display: inline-flex; }

/* ------------------------------------------------ store screenshot sets */
#editor[data-kind='shots'] { grid-template-rows: 56px minmax(0, 1fr) 60px; }
#editor[data-kind='shots'] #strip { display: none; }
#editor:not([data-kind='shots']) #shots-bar { display: none; }
.stage-row { display: flex; align-items: center; justify-content: center; gap: 20px; width: 100%; height: 100%; min-width: 0; min-height: 0; }
.shot-side { flex: 0 1 auto; min-width: 0; max-width: 28%; max-height: 82%; width: auto; height: auto; object-fit: contain; border-radius: 12px; opacity: .72; cursor: pointer; box-shadow: 0 20px 50px -20px rgba(21, 23, 30, .35), 0 0 0 1px rgba(21, 23, 30, .06); transition: opacity .15s; }
.shot-side:hover { opacity: .9; }
#editor[data-kind='shots'] #view { border-radius: 12px; }
.page-ring { position: absolute; inset: -7px; border: 1.5px solid rgba(91, 77, 255, .95); border-radius: 16px; box-shadow: 0 0 0 4px rgba(91, 77, 255, .16); pointer-events: none; z-index: 1; }
.page-ring i { position: absolute; width: 8px; height: 8px; border-radius: 2px; background: #fff; border: 1.5px solid var(--accent); }
.page-ring i:nth-of-type(1) { left: -5px; top: -5px; }
.page-ring i:nth-of-type(2) { right: -5px; top: -5px; }
.page-ring i:nth-of-type(3) { left: -5px; bottom: -5px; }
.page-ring i:nth-of-type(4) { right: -5px; bottom: -5px; }
.rail-list.pages { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-content: start; }
.page-card { border-radius: 10px; padding: 3px; }
.scene-thumb.page { border-radius: 8px; }
.scene-thumb.page::after { display: none; }
.scene-thumb.page img { object-fit: cover; }
.scene-thumb.page .scene-n { left: 5px; top: 5px; min-width: 16px; height: 16px; font-size: 9.5px; border-radius: 5px; padding: 0 4px; }
.drop-line.page { position: absolute; width: 3px; height: 60px; margin: 0; }
.rail-add:disabled { opacity: .45; cursor: default; }
.shots-bar { grid-area: strip; display: flex; align-items: center; gap: 12px; padding: 0 14px; min-width: 0; }
.page-count { font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.page-count span { color: var(--muted-2); font-weight: 600; }
.pano { margin-left: 14px; display: flex; align-items: center; gap: 10px; font-size: 12px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.sizes { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.sizes-label { font-size: 11.5px; color: var(--muted-2); font-weight: 600; margin-right: 4px; white-space: nowrap; }
@media (max-width: 1320px) { .pano span { display: none; } }
.layout-tile { height: 70px; display: grid; place-items: center; align-content: center; gap: 6px; }
.layout-tile .glyph { width: 22px; height: 40px; border-radius: 4px; background: rgba(21, 23, 30, .06); position: relative; overflow: hidden; }
.layout-tile .glyph i { position: absolute; left: 4px; right: 4px; height: 2px; border-radius: 1px; background: var(--muted); }
.layout-tile .glyph b { position: absolute; left: 5px; right: 5px; border: 1.5px solid var(--muted); }
.layout-tile .glyph.above i { top: 5px; }
.layout-tile .glyph.above b { top: 16px; bottom: -6px; border-radius: 4px 4px 0 0; border-bottom: 0; }
.layout-tile .glyph.below i { bottom: 5px; }
.layout-tile .glyph.below b { top: -6px; bottom: 14px; border-radius: 0 0 4px 4px; border-top: 0; }
.layout-tile .glyph.device i { display: none; }
.layout-tile .glyph.device b { top: 6px; bottom: 6px; border-radius: 4px; transform: rotate(-8deg); }
.layout-tile[aria-checked='true'] .glyph i { background: var(--ink); }
.layout-tile[aria-checked='true'] .glyph b { border-color: var(--ink); }
.layout-tile .nm { font-size: 10px; font-weight: 600; color: var(--muted); }
.layout-tile[aria-checked='true'] .nm { color: var(--accent); font-weight: 700; }
.shot-file { margin-top: 8px; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: #fff; border: 1px solid var(--line); }
.shot-file img { width: 28px; height: 52px; border-radius: 5px; object-fit: cover; background: var(--fill); flex: none; }
.shot-file .info { flex: 1; min-width: 0; }
.shot-file .t { font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shot-file .s { font-size: 11px; color: var(--muted-2); }
.size-list { margin-top: 8px; padding: 2px 12px; border-radius: 12px; background: #fff; border: 1px solid var(--line); }
.size-list .row-item { display: flex; align-items: center; justify-content: space-between; padding: 9px 0; }
.size-list .row-item + .row-item { border-top: 1px solid rgba(21, 23, 30, .06); }
.size-list .t { font-size: 12px; font-weight: 600; }
.size-list .s { font-size: 11px; color: var(--muted-2); }
.sheet-preview { width: min(1280px, calc(100vw - 48px)); }
.all-pages { display: flex; gap: 14px; margin-top: 18px; overflow-x: auto; padding-bottom: 8px; }
.all-pages.pano { gap: 0; }
.all-pages img { height: 480px; width: auto; border-radius: 10px; flex: none; background: var(--fill); box-shadow: 0 10px 30px -14px rgba(21, 23, 30, .4); }
.all-pages.pano img { border-radius: 0; box-shadow: none; }
.all-pages.pano img:first-child { border-radius: 10px 0 0 10px; }
.all-pages.pano img:last-child { border-radius: 0 10px 10px 0; }

/* ------------------------------------------------------ the Sound tab */
.add-music { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; border: 1.5px dashed rgba(91, 77, 255, .45); background: var(--accent-softer); text-align: left; color: var(--ink); }
.add-music:hover { background: rgba(91, 77, 255, .1); }
.add-music-icon { width: 40px; height: 40px; border-radius: 10px; background: #fff; border: 1px solid var(--line); display: grid; place-items: center; color: var(--accent); flex: none; }
.add-music b { display: block; font-size: 12.5px; }
.add-music span span { display: block; font-size: 11px; color: var(--muted-2); margin-top: 2px; }
.soon-row { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; padding: 8px 10px; border-radius: 10px; background: var(--fill); font-size: 11.5px; color: var(--muted); font-weight: 600; }
.music-card { padding: 10px; border-radius: 12px; background: #fff; border: 1px solid var(--line); }
.music-head { display: flex; gap: 10px; align-items: center; }
.music-head .info { flex: 1; min-width: 0; }
.music-head .t { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.music-head .s { font-size: 11px; color: var(--muted-2); }
.music-play { width: 44px; height: 44px; border-radius: 10px; border: 0; background: linear-gradient(135deg, var(--accent), #3fe0d0); flex: none; display: grid; place-items: center; }
.music-play .tri { border-left: 10px solid #fff; border-top-width: 6px; border-bottom-width: 6px; margin-left: 3px; }
.music-play.on { box-shadow: 0 0 0 3px rgba(91, 77, 255, .25); }
.rows.flat { border: 0; padding: 0; margin-top: 8px; border-top: 1px solid rgba(21, 23, 30, .06); border-radius: 0; }
.takes { display: flex; flex-direction: column; gap: 6px; }
.take { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: #fff; border: 1px solid var(--line); }
.take .info { flex: 1; min-width: 0; }
.take .t { font-size: 12px; font-weight: 700; }
.take .s { font-size: 11px; color: var(--muted-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.take-play { width: 26px; height: 26px; border-radius: 50%; border: 0; background: var(--accent-soft); display: grid; place-items: center; flex: none; }
.take-play .tri { border-left: 8px solid var(--accent); border-top-width: 5px; border-bottom-width: 5px; margin-left: 2px; }
.take-play.on { background: rgba(91, 77, 255, .25); }
.take-wave { width: 56px; height: 18px; display: flex; align-items: center; gap: 1px; flex: none; }
.take-wave i { flex: 1; background: rgba(91, 77, 255, .6); border-radius: 1px; display: block; }
.take .x { border: 0; background: none; color: var(--muted-2); padding: 2px; border-radius: 6px; display: none; }
.take:hover .x { display: grid; }
.rec-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); display: inline-block; flex: none; }
.rec-dot.on { animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .3; } }

.sheet-record { width: 620px; }
.prompter { margin-top: 18px; padding: 22px 24px; border-radius: 14px; background: var(--ink); color: #fff; max-height: 300px; overflow: auto; }
.prompter .p-title { font-size: 30px; font-weight: 800; line-height: 1.12; letter-spacing: -.5px; white-space: pre-line; }
.prompter .p-title + .p-sub { margin-top: 10px; }
.prompter .p-sub { font-size: 17px; color: rgba(255, 255, 255, .75); line-height: 1.4; }
.prompter .p-sub + .p-title { margin-top: 22px; }
.rec-bar { display: flex; align-items: center; gap: 14px; margin-top: 14px; }
.level { flex: 1; height: 8px; border-radius: 4px; background: rgba(21, 23, 30, .08); overflow: hidden; }
.level-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--ok), #e7b34a 80%, var(--danger)); transition: width .06s; }
.rec-clock { font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; min-width: 52px; text-align: right; }

/* ---------------------------------------------------------- Export */
.sheet-export { width: 760px; }
.ex-body { display: grid; grid-template-columns: 260px 1fr; gap: 28px; margin-top: 20px; }
.ex-body.center { align-items: center; }
.ex-preview { position: relative; border-radius: 12px; overflow: hidden; background: #0b0d14; box-shadow: 0 14px 30px -16px rgba(7, 26, 58, .5); max-height: 340px; width: 100%; }
.ex-preview img, .ex-preview canvas, .ex-preview video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; }
.ex-preview .badge { position: absolute; left: 8px; bottom: 8px; height: 20px; padding: 0 8px; border-radius: 999px; background: rgba(0, 0, 0, .45); color: #fff; font-size: 10.5px; font-weight: 700; display: inline-flex; align-items: center; font-variant-numeric: tabular-nums; z-index: 1; }
.ex-preview .badge:empty { display: none; }
.ex-name { margin-top: 12px; font-size: 13px; font-weight: 700; }
.ex-meta { font-size: 11.5px; color: var(--muted-2); margin-top: 2px; }
.ex-sound { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; font-size: 12px; }
.ex-sound > div { display: flex; align-items: center; gap: 8px; }
.tickmark { width: 16px; height: 16px; border-radius: 50%; background: var(--ok); color: #fff; display: grid; place-items: center; flex: none; }
.tickmark.off { background: rgba(21, 23, 30, .12); }
.ex-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.ex-grid .label { margin-bottom: 8px; }
.ex-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.ex-chips .chip { height: 30px; border: 0; background: var(--fill); font-size: 12px; }
.ex-chips .chip.on { background: rgba(91, 77, 255, .12); }
.ex-chips .chip:disabled { opacity: .5; cursor: default; }
.ex-fixed { height: 30px; display: flex; align-items: center; font-size: 12px; font-weight: 600; color: var(--ink); }
.ex-select { height: 30px; font-size: 12px; font-weight: 600; }
.note-box.warn { background: rgba(231, 179, 74, .14); color: #7a5306; margin-top: 12px; }
.ex-estimate { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.ex-estimate .pill { height: 26px; background: rgba(91, 77, 255, .08); }
.ex-free { color: var(--muted-2); font-size: 11.5px; }
.ex-free::before { content: '·'; margin-right: 8px; }
.ex-progress-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.ex-percent { font-size: 26px; font-weight: 800; letter-spacing: -.6px; font-variant-numeric: tabular-nums; }
.ex-progress-head .note { font-variant-numeric: tabular-nums; }
.progress { height: 8px; border-radius: 4px; background: rgba(21, 23, 30, .08); position: relative; margin-top: 10px; overflow: hidden; }
.progress-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 4px; background: linear-gradient(90deg, var(--accent), #7c6cff); transition: width .2s; }
.ex-specs { display: flex; gap: 14px; margin-top: 14px; font-size: 11.5px; color: var(--muted-2); flex-wrap: wrap; }
.ex-done { width: 36px; height: 36px; border-radius: 50%; background: var(--ok); display: grid; place-items: center; color: #fff; box-shadow: 0 4px 12px rgba(31, 157, 106, .35); flex: none; }
.ex-file { margin-top: 12px; font-size: 12.5px; font-weight: 700; word-break: break-all; }
.ex-actions { display: flex; gap: 8px; margin-top: 12px; }
.ex-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 40px; height: 40px; border-radius: 50%; background: rgba(255, 255, 255, .92); display: grid; place-items: center; box-shadow: 0 4px 14px rgba(0, 0, 0, .25); border: 0; z-index: 1; }
.ex-play .tri { border-left: 12px solid var(--ink); border-top-width: 7px; border-bottom-width: 7px; margin-left: 3px; }
.ex-link { display: flex; align-items: center; color: var(--muted-2); font-weight: 600; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: rgba(255, 255, 255, .6); }
.ex-share .toggle:disabled { opacity: .45; }
.ex-review { margin-top: 12px; border-radius: 12px; background: #fff; border: 1px solid var(--line); overflow: hidden; opacity: .75; }
.ex-review-bar { height: 26px; display: flex; align-items: center; gap: 5px; padding: 0 10px; background: rgba(21, 23, 30, .03); border-bottom: 1px solid rgba(21, 23, 30, .06); }
.ex-review-bar i { width: 7px; height: 7px; border-radius: 50%; background: rgba(21, 23, 30, .15); display: block; }
.ex-review-bar span { margin-left: 8px; font-size: 10px; color: var(--muted-2); font-weight: 600; }
.ex-review-body { display: flex; gap: 10px; padding: 10px; }
.ex-review-thumb { width: 150px; flex: none; aspect-ratio: 16 / 9; border-radius: 8px; background: linear-gradient(135deg, #071a3a, #0e5a7a); position: relative; }
.ex-review-pin { position: absolute; left: 46%; bottom: 3px; width: 14px; height: 14px; border-radius: 50%; background: #ffd166; border: 2px solid #fff; font-size: 8px; font-weight: 800; display: grid; place-items: center; color: var(--ink); transform: translateX(-50%); }
.ex-review-who { display: flex; align-items: center; gap: 6px; font-size: 11px; }
.ex-review-who span:last-child { color: var(--muted-2); font-size: 10.5px; }
.ex-review-avatar { width: 18px; height: 18px; border-radius: 50%; background: linear-gradient(135deg, #ffd166, #e8407a); color: #fff; font-size: 8px; font-weight: 800; display: grid; place-items: center; }
.ex-review-text { margin-top: 5px; font-size: 11.5px; line-height: 1.4; }
