.ed-stage { position: relative; display: flex; flex-direction: column; }
.ed-stage #preview { height: auto; flex: 1 1 0; min-height: 0; }
#editor-record-controls { flex: 0 0 auto; min-width: 0; }
/* Informational toasts must not eat a Record/Pause click underneath them. */
body.editor .toasts { pointer-events: none; }
body.editor .toasts :is(button, a) { pointer-events: auto; }
#editor-record-controls[hidden], .editor-record-live[hidden], .editor-record-bar button[hidden] { display: none; }
.ed-stage[data-capture="live"] #preview .pv-monitor { visibility: hidden; }
.ed-stage[data-capture="live"] #editor-record-controls { position: absolute; inset: 0 0 auto; display: flex; min-height: 0; flex-direction: column; pointer-events: none; }
.editor-record-live { flex: 1; position: relative; min-height: 100px; overflow: hidden; background: #080b10; border-radius: 12px; }
.editor-record-live video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.editor-record-live .editor-record-camera { inset: auto 12px 12px auto; width: 24%; height: 28%; border-radius: 8px; background: #10131a; border: 2px solid #677187; }
.editor-record-camera[hidden] { display: none; }
.editor-record-secondary[hidden] { display: none; }
.editor-record-live.has-solo-layout { display:block; }
.editor-record-live.has-solo-layout > video { visibility:hidden; }
.solo-layout-stage { position:absolute; left:50%; top:50%; transform:translate(-50%,-50%); pointer-events:none; }
.solo-layout-stage[hidden] { display:none; }
/* The live overlay is pointer-transparent; its explicit Join card is interactive. */
.editor-call-entry { position:absolute; z-index:5; pointer-events:auto; bottom:20px; left:50%; transform:translateX(-50%); display:grid; gap:8px; width:min(420px,calc(100% - 40px)); padding:18px; box-sizing:border-box; border:1px solid #526478; border-radius:12px; background:#17202df2; color:#f3f6fa; box-shadow:0 8px 28px #0007; }
.editor-call-entry[hidden], .editor-live-roster[hidden] { display:none; }
.editor-call-entry button { min-height:42px; font-weight:700; background:#ffad16; color:#101318; border:0; border-radius:7px; }
.editor-call-entry span { font-size:13px; color:#bbc8d6; }
.editor-live-roster { margin-bottom:10px; border-bottom:1px solid #343b47; padding-bottom:8px; }
.editor-live-roster > strong { display:block; font-size:12px; padding:4px 0; }
.editor-live-roster > div { padding:6px 8px; margin:4px 0; border-left:3px solid #d9a755; background:#181d25; border-radius:4px; }
.editor-live-roster > div[data-tone="ready"] { border-color:#56c195; }
.editor-live-roster > div[data-tone="recording"] { border-color:#ff6b66; }
.editor-live-roster span, .editor-live-roster small { display:block; }
.editor-live-roster small { font-size:11px; color:#b7c1ce; }
.solo-layout-stage[data-editing="true"] { pointer-events:auto; touch-action:none; }
.solo-layout-source { position:absolute; overflow:visible; background:#080b10; }
.solo-layout-source video { width:100%; height:100%; pointer-events:none; }
.solo-layout-stage[data-editing="true"] .solo-layout-source { cursor:move; outline:1px solid #8dbce5; outline-offset:-1px; }
.solo-layout-stage[data-editing="true"] .solo-layout-source[data-selected="true"] { outline:2px solid #69dcff; }
.solo-layout-label { display:none; position:absolute; top:3px; left:3px; max-width:90%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; background:#112c48d9; color:white; padding:3px 6px; font-size:11px; pointer-events:none; }
.solo-layout-stage[data-editing="true"] .solo-layout-label { display:block; }
.solo-layout-resize { position:absolute; bottom:-7px; right:-7px; z-index:4; width:20px; height:20px; min-height:20px; padding:0; border:1px solid #d0f2ff; background:#1474a1; color:white; cursor:nwse-resize; }
.solo-layout-resize[hidden], .editor-record-bar select[hidden] { display:none; }
.editor-record-bar select { width:155px; margin:0; font-size:12px; padding:6px; }
.editor-record-bar [data-testid="pickup-layout"][aria-pressed="true"] { outline:2px solid #69dcff; }
.editor-record-live.has-multi-shares { display: grid; grid-template-columns: 1fr 1fr; align-items: center; background: #080b10; }
.editor-record-live.has-multi-shares > video:not(.editor-record-camera) { position: static; width: 100%; height: 100%; object-fit: contain; min-width: 0; }
.editor-record-devices { order: 10; flex: 1 1 100%; max-width: 520px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; color: var(--text-muted, #aab7cb); }
.editor-record-badge { position: absolute; top: 12px; left: 12px; padding: 5px 10px; background: #951d29; color: white; border-radius: 7px; font-size: 12px; font-weight: 700; }
.editor-record-badge[data-warning="true"] { background:#653d10; color:#ffe0a6; }
.editor-preview-navigation { position:absolute; top:12px; right:12px; display:flex; gap:6px; pointer-events:auto; }
.editor-preview-navigation button { margin:0; padding:6px 9px; font-size:12px; background:#172e43; color:#e0f0ff; border:1px solid #74b7e4; }
.editor-preview-navigation button[hidden] { display:none; }
.editor-record-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 4px; }
.editor-record-bar[hidden] { display: none; }
.editor-record-status { order: 9; flex: 1 1 100%; font-size: 11px; color: var(--text-muted, #aab7cb); }
.pv-transport:has(.editor-record-bar) { flex-wrap: wrap; }
.pv-transport .editor-record-bar:not([hidden]) { display: contents; }
.pv-transport .editor-record-bar button { min-height: 36px; }
.pv-transport .editor-record-bar [data-testid="pickup-record"] { font-weight: 750; padding: 9px 16px; border: 1px solid #ff7185; }
body.editor .ed-stage .pv-transport [data-testid="pickup-record"] { background: #ad273b; color: white; }
.editor-record-clock { font-variant-numeric: tabular-nums; font-size: 15px; }
.editor-record-level { width: 65px; height: 20px; accent-color: #6ae4b2; }
.editor-record-level[hidden] { display: none; }
.editor-record-source-hint { order: 11; flex: 1 1 100%; font-size: 11px; color: var(--text-muted, #aab7cb); }
.editor-record-sources { order: 12; display: flex; flex: 1 1 100%; gap: 8px; flex-wrap: wrap; min-width: 0; }
.editor-record-sources[hidden], .editor-record-source-hint[hidden] { display: none; }
.editor-capture-source { position:relative; display: flex; gap: 8px; min-width: 0; flex: 1 1 235px; max-width: 380px; padding: 6px; border: 1px solid var(--border, #343b4d); border-radius: 8px; }
.editor-capture-source[data-selected="true"] { border-color: #5ebcf4; }
.editor-capture-source video { width: 92px; height: 58px; object-fit: contain; background: #080b10; border-radius: 4px; }
.editor-capture-source > div { min-width: 0; }
.editor-capture-source strong { display: block; max-width: 210px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; margin-bottom: 5px; }
.editor-capture-source button { padding: 3px 6px; min-height: 28px !important; font-size: 11px; margin-right: 3px; }
.editor-record-bar button { margin: 0; padding: 7px 11px; font-size: 12px; }
.editor-record-bar [data-testid="pickup-record"] { background: #9f2637; color: white; }
.editor-record-bar button { display: inline-flex; align-items: center; justify-content: center; gap: 5px; }
.capture-icon { width: 19px; height: 19px; flex-shrink: 0; }
.capture-record-icon { width: 26px; height: 26px; }
.capture-device-group { display: inline-flex; align-items: stretch; gap: 1px; }
.capture-device-group button[aria-pressed="false"] { color: #ffadba; background: #48212a; text-decoration: line-through; }
.capture-device-group button:last-child { padding-inline: 5px; }
.editor-record-bar button[data-testid="pickup-deck"] { padding-inline: 8px; }
.editor-capture-panel { padding: 4px; border-bottom: 1px solid var(--border, #343b4d); }
.editor-capture-panel[hidden] { display: none; }
.editor-capture-panel h3 { display: none; }
.editor-record-cameras h4 { font-size: 12px; margin: 10px 0 7px; }
.editor-record-cameras .editor-capture-source { margin-bottom: 7px; }
.editor-camera-source { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 26px; align-items: center; gap: 4px; padding: 4px; border: 1px solid var(--border, #343b4d); border-radius: 7px; margin-bottom: 5px; }
.editor-camera-source[data-selected="true"] { border-color: #5ebcf4; }
.editor-camera-source video { width: 100%; height: 112px; object-fit: contain; background: #080b10; border-radius: 4px; }
.editor-camera-source strong, .editor-camera-source > small { display: none; }
.editor-camera-source[data-signal="false"] > small { display: block; position: absolute; bottom: 7px; left: 7px; padding: 2px 5px; background: #48212a; color: #ffadba; border-radius: 4px; }
.editor-camera-source button, .editor-capture-source [data-testid] { padding: 3px 8px; min-height: 28px; font-size: 16px; margin-right: 3px; }
.editor-record-cameras > small { font-size: 11px; color: var(--text-muted, #aab7cb); margin: 4px 0; }
.editor-record-cameras small[data-warning="true"] { color: #ffbe72; }
.editor-camera-picker { display: flex; gap: 5px; align-items: center; }
.editor-camera-picker select { flex: 1; min-width: 0; font-size: 11px; padding: 5px; }
.editor-camera-picker button { font-size: 11px; padding: 4px 7px; white-space: nowrap; }
.editor-native-capture { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; }
.editor-native-capture[hidden] { display: none; }
.editor-native-capture button { padding: 5px 8px; font-size: 11px; }
.editor-native-capture small { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.editor-capture-panel .editor-record-sources { display: flex; flex-direction: column; }
.editor-capture-panel .editor-record-sources[hidden] { display: none; }
.editor-capture-panel .editor-capture-source { flex: 0 0 auto; max-width: none; }
.editor-capture-panel .editor-capture-source { display: grid; grid-template-columns: minmax(0, 1fr) 26px; align-items: center; gap: 4px; padding: 4px; }
.editor-capture-panel .editor-capture-source video { width: 100%; height: 112px; }
.editor-capture-source > strong { display: none; }
.editor-capture-source > .editor-source-file-status,
.editor-camera-source > small { display: block; grid-column: 1; font-size: 10px; line-height: 1.25; color: #b5c1d2; overflow-wrap: anywhere; }
.editor-source-file-status[data-warning="true"], .editor-camera-source > small[data-warning="true"] { color: #ffc082; }
.editor-source-actions { display: flex; flex-direction: column; gap: 2px; width: 26px; grid-column: 2; grid-row: 1 / span 2; }
body.editor .editor-source-actions button, .editor-source-actions button { display: grid; place-items: center; width: 26px; height: 24px; min-height: 24px !important; padding: 2px; margin: 0; border-radius: 4px; background: #242f41; border: 1px solid #465571; color: #d3e2f8; }
.editor-source-actions button:hover { background: #345272; }
.editor-source-actions button:focus-visible { outline: 2px solid #93ceff; outline-offset: 1px; }
.editor-source-actions button[aria-pressed="true"] { background: #193f55; border-color: #5ebcf4; color: #aee5ff; }
.editor-source-actions button[aria-pressed="false"][data-testid$="toggle"] { background: #48212a; color: #ffadba; border-color: #a05764; }
body.editor .editor-source-actions button[hidden], .editor-source-actions button[hidden] { display: none; }
.source-action-icon { width: 17px; height: 17px; }
.editor-source-badge { position:absolute; top:7px; left:7px; padding:2px 4px; border-radius:3px; background:#091522cc; color:#d8ebfc; font-size:9px; font-weight:700; pointer-events:none; }
[data-enabled="false"] > .editor-source-badge { background:#59232c; color:#ffced5; }
.editor-source-scope { display:flex; gap:4px; padding:4px; }
.editor-source-scope button { flex:1; margin:0; padding:6px 3px; font-size:12px; background:#242a35; color:#d2dbe8; }
.editor-source-scope button[aria-pressed="true"] { border-color:#5ebcf4; background:#193c54; color:#b8e5ff; }
.editor-source-scope-hint { margin:2px 6px 6px; font-size:11px; line-height:1.35; color:var(--text-muted,#aab7cb); }
#editor-layout-sources[hidden], #editor-capture-sources[hidden] { display:none; }
.editor-capture-setup { margin:7px 0 0; font-size:11px; }
.editor-capture-setup > summary { padding:7px; cursor:pointer; color:var(--text-muted,#aab7cb); }
.editor-capture-setup .editor-native-capture { padding:5px; }
.editor-capture-panel > small { display:block; margin:4px 0; font-size:11px; color:#ffbe72; }
.editor-capture-panel > small[hidden] { display:none; }
.editor-source-tabs { display: flex; position: sticky; top: 0; z-index: 3; background: var(--background, #171d29); padding: 6px; gap: 5px; }
.editor-source-tabs button { flex: 1; font-size: 12px; padding: 6px 4px; background: #242a35; color: #d2dbe8; }
.editor-source-tabs [aria-pressed="true"] { background: #193c54; border-color: #5ebcf4; color: #b8e5ff; }
#editor-speakers-sources[hidden], #editor-adjust-tools[hidden] { display: none; }
#editor-layout-sources { padding: 10px; }
#editor-layout-sources:empty { display: none; }
#editor-layout-sources .lp-source-chips { display: flex; flex-direction: column; }
.editor-capture-panel .editor-record-source-hint { display: none; }
.editor-capture-panel .editor-record-source-hint[hidden] { display: none; }
.editor-capture-source button[aria-pressed="false"][data-testid="pickup-source-toggle"] { background: #48212a; color: #ffadba; }
.editor-saved-sources { margin-top: 5px; font-size: 11px; }
.editor-saved-sources:has(> small:only-child) { display: none; }
.editor-saved-sources small { display: block; color: var(--text-muted, #aab7cb); }
.editor-saved-source { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; padding: 7px 0; }
.editor-saved-source strong { flex-basis: 100%; overflow-wrap: anywhere; }
.editor-saved-source button { padding: 3px 7px; font-size: 11px; }
.editor-source-preset-dialog { width: min(440px, 90vw); padding: 22px; border-radius: 12px; }
.editor-source-preset-dialog { max-height:85vh; overflow:auto; box-sizing:border-box; }
.editor-source-preset-dialog label { display: block; margin: 12px 0; }
.editor-source-preset-dialog input { display: block; width: 100%; box-sizing: border-box; }
.editor-setup-button { margin:5px 0; width:100%; font-size:12px; padding:5px; }
.editor-source-preset-dialog select { width:100%; }
.editor-source-preset-dialog p { font-size: 13px; }
.editor-source-preset-dialog::backdrop { background: #0009; }
@media(min-width: 901px) {
  /* Sources can use the space beside the timeline without shrinking their previews. */
  body:not([data-recording-spectate="true"]) .ed-workspace:has(#editor-speakers-sources:not([hidden])) { grid-template-areas: "transcript stage inspector" "transcript timeline inspector"; }
  .ed-rail-r:has(#editor-speakers-sources:not([hidden])) .ed-rail-scroll { padding: 4px; gap: 4px; }
}
.editor-selection-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 5px 10px; font-size: 12px; border-bottom: 1px solid var(--border, #343b4d); }
.editor-selection-bar button { margin: 0; padding: 4px 8px; font-size: 12px; }
.editor-selection-bar [aria-pressed="true"] { outline: 2px solid #5ebcf4; }
#editor-selection-label { flex: 1 1 170px; color: var(--text-muted, #aab7cb); }
@media(max-width: 760px) {
  .editor-record-bar { padding: 5px; gap: 5px; }
  .editor-record-status { flex-basis: 100%; font-size: 11px; }
  .editor-selection-bar { gap: 4px; padding: 4px; }
  #editor-selection-label { flex-basis: 100%; }
}

/* Primary controls are one line; device/file detail is available on hover and in
   Sources. Errors remain visible. Less common edit tools open above the timeline. */
.editor-more-tools { position:relative; flex:none; overflow:visible; }
.dock-toolbar:has(.editor-more-tools) { position:relative; z-index:20; }
.editor-more-tools > summary { cursor:pointer; list-style:none; padding:4px 10px; border:1px solid var(--line,#343b4d); border-radius:6px; font-size:12px; }
.editor-more-tools > summary:focus-visible { outline:2px solid #93ceff; }
.editor-more-panel { position:absolute; bottom:calc(100% + 8px); left:0; z-index:30; display:flex; flex-wrap:wrap; align-items:center; gap:6px; padding:12px; width:min(520px,70vw); max-height:60vh; overflow:auto; background:var(--stage-2,#171d29); border:1px solid var(--line,#465571); border-radius:10px; box-shadow:0 8px 30px #0009; }
.editor-more-tools:not([open]) > .editor-more-panel { display:none; }
.editor-more-panel .dock-sep { display:none; }
.editor-more-panel .dock-split, .editor-more-panel .dock-frames { flex-wrap:wrap; }
@media(min-width:900px) {
  body.editor { --ed-header-h:38px; }
  body.editor .ed-header { min-height:38px; height:38px; padding:3px 8px; gap:5px; }
  body.editor .ed-header button { min-height:28px; margin:0; padding:3px 8px; font-size:11px; }
  body.editor .ed-header :is(#ed-share-btn,#ed-fx-btn) .hb-lbl { display:none; }
  body.editor .ed-title { font-size:13px; }
  body.editor .pv-transport:has(.editor-record-bar) { flex-wrap:nowrap; padding:5px 6px; gap:4px; min-height:42px; box-sizing:border-box; }
  .pv-transport .editor-record-bar button { box-sizing:border-box; }
  .pv-transport .editor-record-bar button { height:32px; min-height:32px; padding:4px 8px; white-space:nowrap; }
  .pv-transport .editor-record-bar [data-testid="pickup-record"] { padding:4px 10px; }
  .pv-transport .editor-record-bar :is(.editor-record-status,.editor-record-devices) { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
  .pv-transport .editor-record-bar[data-warning="true"] .editor-record-status { position:static; width:auto; height:auto; clip-path:none; flex:1; color:#ffbe72; }
  .pv-transport .editor-record-bar .capture-device-group :is([data-testid="pickup-camera"],[data-testid="pickup-mic"]) > span { display:none; }
  .pv-transport .editor-record-bar [data-testid="pickup-layout"] { font-size:0; width:32px; padding:4px; }
  .pv-transport .editor-record-bar [data-testid="pickup-layout"] svg { font-size:12px; }
  .pv-transport .editor-record-level { width:34px; }
  .pv-transport .pv-tbtn { min-width:28px; width:28px; padding:4px; }
  .pv-transport .pv-tbtn { height:32px; min-height:32px; box-sizing:border-box; }
  .pv-transport .pv-play { width:36px; }
  .pv-transport .pv-time { padding:0 2px; font-size:11px; }
  .pv-transport .pv-vol { width:42px; }
  /* Water's form-control margins otherwise add an invisible 16–20px row. */
  .pv-transport :is(input, select, meter) { margin-block:0; }
  .pv-monitor { padding:2px; }
  .pv-bar { padding:2px 6px; height:25px; box-sizing:border-box; }
  .pv-bar .pv-status { font-size:10px; }
  body.editor .dock-toolbar { flex-wrap:nowrap; padding:3px 6px; gap:4px; height:36px; box-sizing:border-box; }
  body.editor .ed-dock { overflow:visible; }
  .dock-toolbar .dock-tools { flex-wrap:nowrap; gap:4px; flex:1; min-width:0; }
  .dock-toolbar .dock-tool { padding:4px 8px; min-height:26px; font-size:11px; }
  .editor-selection-bar { flex-wrap:nowrap; padding:3px 6px; gap:4px; height:30px; box-sizing:border-box; }
  .editor-selection-bar button { padding:3px 6px; white-space:nowrap; font-size:11px; }
  #editor-selection-label { flex:1; font-size:10px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .editor-source-scope-hint { margin:2px 4px 4px; font-size:11px; }
  .editor-source-scope { padding:2px; }
  .editor-source-scope button { padding:4px; font-size:11px; }
  .ed-rail-r .rail-head { min-height:28px; padding:3px 7px; box-sizing:border-box; }
  .editor-source-tabs { padding:2px; }
  .editor-source-tabs button { margin:0; padding:3px 5px; }
  #editor-layout-sources { padding:3px; }
  #editor-layout-sources .lp-source-strip-head { display:none; }
  #editor-layout-sources .lp-source-state { color:#9aa4b2; }
  #editor-layout-sources .lp-source-chip:not(.is-on) { background:#191d25; border-color:#3c424c; }
}
@media(min-width:900px) and (max-width:1250px) {
  body.editor { --rail-r-base:210px; --rail-l:235px; }
  .pv-transport .pv-vol, .pv-transport .editor-record-level { display:none; }
  .pv-transport .editor-record-bar [data-testid="pickup-share"] { width:32px; font-size:0; padding:4px; }
  .pv-transport .pv-tbtn:not(.pv-play):not(.pv-max) { width:24px; min-width:24px; }
  .editor-selection-bar #editor-selection-label { display:none; }
}
