/* Editor chrome only: quiet utilities, one primary action, distinct live status.
   Control sizes, layouts and recording/edit behaviour are unchanged. */
body.editor {
  --button-base: var(--stage-2);
  --button-hover: var(--stage-3);
  --button-text: var(--ink);
  --editor-button-edge: color-mix(in srgb, var(--ink) 18%, var(--stage-2));
  --editor-button-highlight: inset 0 1px 0 color-mix(in srgb, var(--ink) 4%, transparent);
  --editor-danger-ink: color-mix(in srgb, var(--danger) 70%, var(--ink));
  --editor-ok-ink: color-mix(in srgb, var(--ok) 75%, var(--ink));
}
body.editor :is(.ed-header, .pv-transport, .dock-toolbar, .editor-selection-bar,
  .editor-camera-picker, .editor-native-capture, .editor-saved-sources,
  .editor-preview-navigation, .editor-source-actions) button {
  box-sizing: border-box; background: var(--stage-2); color: var(--ink-dim);
  border: 1px solid var(--editor-button-edge); border-radius: 7px;
  box-shadow: var(--editor-button-highlight); font-family: inherit; font-weight: 600; filter: none;
  transition: background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
body.editor :is(.ed-header, .pv-transport, .dock-toolbar, .editor-selection-bar,
  .editor-camera-picker, .editor-native-capture, .editor-saved-sources,
  .editor-preview-navigation, .editor-source-actions)
  button:where(:not([aria-pressed="true"], .is-active, .is-on, .is-playing, .primary-btn)):hover:not(:disabled) {
  background: var(--stage-3); border-color: color-mix(in srgb, var(--ink) 32%, var(--stage-3)); color: var(--ink);
}
/* Matte brand fill, not a gradient/glow on every CTA. */
body.editor .primary-btn, body.editor #save-btn {
  background: var(--accent); color: var(--on-accent);
  border: 1px solid color-mix(in srgb, var(--accent) 65%, var(--ink)); border-radius: 7px;
  box-shadow: var(--editor-button-highlight); font-weight: 650; filter: none;
}
body.editor .primary-btn:hover:not(:disabled), body.editor #save-btn:hover:not(:disabled) {
  background: color-mix(in srgb, var(--accent) 88%, var(--ink)); filter: none;
}
/* Active tools stay visible on hover without looking like extra primary CTAs. */
body.editor :is(.pv-transport, .dock-toolbar, .editor-selection-bar)
  button:is([aria-pressed="true"], .is-active, .is-on, .is-playing) {
  background: var(--accent-soft); color: var(--ink); border-color: var(--accent-line);
}
body.editor .editor-selection-bar [aria-pressed="true"],
body.editor .editor-record-bar [data-testid="pickup-layout"][aria-pressed="true"] { outline: none; }
/* Camera/mic and chooser read as one split control. */
body.editor .capture-device-group { gap: 0; }
body.editor .capture-device-group button:first-child { border-radius: 7px 0 0 7px; }
body.editor .capture-device-group button:last-child { border-radius: 0 7px 7px 0; border-left: 0; color: var(--ink-dim); }
body.editor .pv-transport .capture-device-group button[aria-pressed="false"] {
  background: color-mix(in srgb, var(--danger) 10%, var(--stage-2)); color: var(--editor-danger-ink);
  border-color: color-mix(in srgb, var(--danger) 40%, var(--stage-2)); text-decoration: none;
}
/* Record/Stop are unmistakable; ordinary Share/Layout stay neutral. */
body.editor .ed-stage .pv-transport [data-testid="pickup-record"],
body.editor .ed-stage .pv-transport [data-testid="pickup-stop"] {
  background: color-mix(in srgb, var(--rec) 82%, #21252d);
  border-color: color-mix(in srgb, var(--rec) 68%, #ffffff); color: var(--on-record);
  box-shadow: inset 0 1px 0 #ffffff12; font-weight: 650;
}
body.editor .ed-stage .pv-transport :is([data-testid="pickup-record"], [data-testid="pickup-stop"]):hover:not(:disabled) {
  background: var(--rec); color: var(--on-record);
}
body.editor .editor-selection-bar #editor-delete-range:not(:disabled) { color: var(--editor-danger-ink); }
body.editor .editor-selection-bar #editor-delete-range:hover:not(:disabled) {
  background: color-mix(in srgb, var(--danger) 10%, var(--stage-2)); border-color: color-mix(in srgb, var(--danger) 45%, var(--stage-2));
}
/* Segmented navigation on one inset track. */
body.editor :is(.editor-source-tabs, .editor-source-scope) {
  margin-inline: 4px; padding: 3px; gap: 3px; border: 1px solid var(--line); border-radius: 8px; background: var(--stage-1);
}
body.editor :is(.editor-source-tabs, .editor-source-scope) button {
  color: var(--ink-dim); background: transparent; border: 1px solid transparent;
  border-radius: 5px; font-weight: 600; box-shadow: none;
}
body.editor :is(.editor-source-tabs, .editor-source-scope) button[aria-pressed="true"] {
  background: var(--stage-3); color: var(--ink); border-color: var(--editor-button-edge); box-shadow: var(--editor-button-highlight);
}
body.editor :is(.editor-source-tabs, .editor-source-scope) button:not([aria-pressed="true"]):hover:not(:disabled) { color: var(--ink); background: var(--stage-2); }
/* Small source actions: Preview and power have different states. */
body.editor .editor-source-actions button { border-radius: 5px; background: transparent; box-shadow: none; }
body.editor .editor-source-actions button[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent-line); color: var(--ink); }
body.editor .editor-source-actions [data-testid$="toggle"][aria-pressed="true"] { background: var(--stage-2); border-color: var(--editor-button-edge); color: var(--editor-ok-ink); }
body.editor .editor-source-actions [data-testid$="toggle"][aria-pressed="false"] {
  background: color-mix(in srgb, var(--danger) 10%, var(--stage-2));
  border-color: color-mix(in srgb, var(--danger) 40%, var(--stage-2)); color: var(--editor-danger-ink);
}
.editor-control-icon { display: block; width: 18px; height: 18px; flex: none; }
.pv-tbtn .editor-control-icon { width: 16px; height: 16px; }
.pv-play .editor-control-icon { width: 20px; height: 20px; }
body.editor .pv-tbtn { display: inline-flex; align-items: center; justify-content: center; }
body.editor .pv-tbtn.is-muted { color: var(--ink-dim); }
/* Keyboard/system contrast are explicit; never rely on hover alone. */
body.editor button:focus-visible { outline: 2px solid var(--accent) !important; outline-offset: 2px; box-shadow: 0 0 0 2px var(--stage-0); }
body.editor :is(.ed-header, .pv-transport, .dock-toolbar, .editor-selection-bar,
  .editor-camera-picker, .editor-native-capture, .editor-saved-sources,
  .editor-preview-navigation, .editor-source-actions, .editor-source-tabs, .editor-source-scope) button:disabled {
  opacity: .45; cursor: not-allowed; box-shadow: none;
}
@media (forced-colors: active) {
  body.editor button { background: ButtonFace !important; color: ButtonText !important; border-color: ButtonText !important; box-shadow: none !important; }
  body.editor button:is([aria-pressed="true"], .is-active, .is-on, .is-playing) { background: Highlight !important; color: HighlightText !important; border-color: Highlight !important; }
  body.editor button:focus-visible { outline: 2px solid Highlight !important; outline-offset: 2px !important; }
}
