/* Enhanced phone editing only. Desktop and the no-JS flat rail remain unchanged. */
.phone-workspace-tabs, .phone-editor-menu { display: none; }
body.editor[data-phone-workspace='true'][data-screen='editor'] {
  height: 100dvh; min-height: 0; overflow: hidden; display: flex; flex-direction: column;
}
body[data-phone-workspace='true'] #ed-header {
  flex: none; min-height: 52px; height: auto; padding: 4px 6px; gap: 4px; flex-wrap: nowrap;
}
body[data-phone-workspace='true'] #ed-header .header-spacer { display: none; }
body[data-phone-workspace='true'] #ed-header .ed-title { flex: 1 1 40px; min-width: 32px; font-size: 13px; }
body[data-phone-workspace='true'] #ed-header :is(.hbtn-back, .ed-undo, .ed-redo) { flex: 0 0 44px; width: 44px; padding: 0; }
body[data-phone-workspace='true'] #ed-header .hbtn-back .hb-lbl { display: none; }
body[data-phone-workspace='true'] #save-btn { flex: none; padding: 8px 10px; margin: 0; min-height: 44px; font-size: 12px; }
body[data-phone-workspace='true'] #editor-screen {
  order: 2; flex: 1 1 auto; min-height: 0; height: auto; width: 100%; overflow: hidden; margin: 0;
  padding: 0 0 var(--phone-tools-h, 49px);
}
body[data-phone-workspace='true'] #edit-view { height: 100%; min-height: 0; }
body[data-phone-workspace='true'] .ed-workspace {
  height: 100%; min-height: 0; overflow: hidden; box-sizing: border-box;
  display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(150px, 44%) 44px minmax(0, 1fr);
  grid-template-areas: 'preview' 'panes' 'surface'; padding: 4px; gap: 4px;
}
body[data-phone-workspace='true'] .ed-stage { grid-area: preview; min-width: 0; min-height: 0; overflow: hidden; }
body[data-phone-workspace='true'] .ed-preview { height: 100%; min-height: 0; }
body[data-phone-workspace='true'] .pv-monitor { container-type: size; flex: 1 1 0; min-height: 0; padding: 0; }
body[data-phone-workspace='true'] .pv-monitor .pv-stage { width: min(100cqw, calc(100cqh * 16 / 9)); height: auto; max-height: 100%; }
body[data-phone-workspace='true'] .pv-transport { flex: none; min-height: 48px; padding: 2px 4px; gap: 3px; overflow: visible; }
body[data-phone-workspace='true'] .pv-transport > .pv-tbtn { min-width: 44px; height: 44px; padding: 4px; }
body[data-phone-workspace='true'] .pv-time { flex: 1 1 auto; min-width: 0; padding: 0 2px; font-size: 11px; text-align: center; }
body[data-phone-workspace='true'] .pv-bar { min-height: 36px; padding: 2px 6px; gap: 4px; }
body[data-phone-workspace='true'] .pv-bar .pv-change { min-height: 32px; padding: 4px 8px; }
body[data-phone-workspace='true'] .pv-bar .pv-status { font-size: 10px; }
body[data-phone-workspace='true'] .phone-workspace-tabs { grid-area: panes; display: flex; min-width: 0; gap: 4px; }
body[data-phone-workspace='true'] .phone-workspace-tabs button { flex: 1; min-width: 0; min-height: 44px; margin: 0; padding: 6px; font-size: 12px; color: var(--ink-dim); background: var(--stage-1); border: 1px solid var(--line); }
body[data-phone-workspace='true'] .phone-workspace-tabs button[aria-pressed='true'] { color: var(--accent); background: var(--accent-soft); border-color: var(--accent-line); }
body[data-phone-workspace='true'] :is(.ed-dock, .ed-rail-l, .ed-rail-r) {
  grid-area: surface; display: none; width: auto; min-width: 0; min-height: 0; height: 100%; overflow: hidden;
}
body[data-phone-workspace='true'][data-phone-pane='timeline'] .ed-dock,
body[data-phone-workspace='true']:is([data-phone-pane='transcript'], [data-phone-pane='tool']) .ed-rail-l,
body[data-phone-workspace='true'][data-phone-pane='inspector'] .ed-rail-r { display: flex; flex-direction: column; }
/* Outrank the desktop sizing controller's late-injected mobile pixel height. */
body.editor[data-phone-workspace='true'] .ed-dock { height: 100%; min-height: 0; }
body[data-phone-workspace='true'] :is(.ed-rail-scroll, .ed-transcript, .editor-tool-context-scroll) { min-height: 0; overflow: auto; overscroll-behavior: contain; }
body[data-phone-workspace='true'] .editor-tool-context:not([hidden]) { flex: 1; display: flex; flex-direction: column; min-height: 0; }
body[data-phone-workspace='true'] .editor-context-head { flex: none; min-height: 44px; padding: 2px 8px; }
body[data-phone-workspace='true'] .inspector-tool-close { min-width: 44px; min-height: 44px; }
body[data-phone-workspace='true'] .editor-context-kicker { display: none; }
body[data-phone-workspace='true'] .ed-dock :is(.timeline-dock-resizer, .timeline-dock-size-controls) { display: none; }
body[data-phone-workspace='true'] .ed-dock .ed-timeline-wrap { flex: 1 1 0; min-height: 0; padding: 2px; }
body[data-phone-workspace='true'] .dock-toolbar { flex: none; padding: 2px; display: block; }
body[data-phone-workspace='true'] #dock-tools { display: flex; flex-wrap: nowrap; gap: 3px; overflow-x: auto; min-width: 0; width: 100%; }
body[data-phone-workspace='true'] #dock-tools > :is(.dock-sep, [data-testid='undo-btn'], [data-testid='redo-btn']) { display: none; }
body[data-phone-workspace='true'] #dock-tools > .dock-tool { min-width: 62px; min-height: 46px; flex: 1 0 auto; flex-direction: column; gap: 2px; padding: 3px; font-size: 11px; }
body[data-phone-workspace='true'] .phone-control-label { font-size: 10px; }
body[data-phone-workspace='true'] .phone-editor-menu { display: block; flex: none; margin: 0; padding: 0; border: 0; }
body[data-phone-workspace='true'] .phone-editor-menu > summary { display: grid; place-items: center; list-style: none; width: 44px; min-height: 44px; padding: 0; box-sizing: border-box; cursor: pointer; margin: 0; border-radius: var(--r-control); background: var(--stage-2); font-size: 11px; }
body[data-phone-workspace='true'] .phone-editor-menu > summary::-webkit-details-marker { display: none; }
body[data-phone-workspace='true'] .phone-editor-menu-panel {
  position: fixed; z-index: 120; left: 8px; right: 8px; overflow: auto; padding: 10px;
  border: 1px solid var(--line-strong); border-radius: var(--r-card); background: var(--stage-1); box-shadow: var(--shadow-card);
  display: flex; flex-wrap: wrap; gap: 8px;
}
body[data-phone-workspace='true'] .phone-editor-menu:not([open]) > .phone-editor-menu-panel { display: none; }
body[data-phone-workspace='true'] .phone-editor-menu-panel :is(button, .dock-tool) { min-height: 44px; min-width: 44px; margin: 0; }
body[data-phone-workspace='true'] .phone-editor-menu-panel .pv-vol { width: 130px; }
body[data-phone-workspace='true'] #editor-tool-rail[data-phone-group='edit'] > .editor-rail-group-edit { display: none; }
body[data-phone-workspace='true'] .build-stamp { display: none; }
/* Notices occupy their own scrollable space, never cover editing controls, and
   retain their original text, live announcements and expiry behavior. */
body[data-phone-workspace='true'] .phone-editor-notices { order: 1; flex: 0 0 auto; margin: 0 4px; max-height: 96px; overflow: auto; overscroll-behavior: contain; }
body[data-phone-workspace='true'] #editor-notice-strip { padding: 0; }
body[data-phone-workspace='true'] .unread-audio-notice { margin: 0; padding: 8px 10px; }
body[data-phone-workspace='true'] .toasts { position: static; margin: 0; max-height: none; max-width: none; pointer-events: auto; }
body[data-phone-workspace='true'] .toasts .toast { padding: 8px 10px; font-size: 11px; }
body[data-phone-workspace='true'] .toasts :is(button, a) { pointer-events: auto; }
body[data-phone-workspace='true'] #shorts-view:not([hidden]) { height: 100%; overflow: auto; }
body[data-phone-workspace='true'] #ed-people-tab { display: none; }
body[data-phone-workspace='true'][data-max='1'] .ed-workspace { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) 44px; grid-template-areas: 'preview' 'panes'; }
body[data-phone-workspace='true'][data-max='1'] :is(.ed-dock, .ed-rail-l, .ed-rail-r) { display: none; }
@media (min-width: 701px) and (max-height: 600px) {
  body[data-phone-workspace='true'] .phone-editor-notices { max-height: 56px; }
  body[data-phone-workspace='true']:not([data-max='1']) .ed-workspace {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: 44px minmax(0, 1fr);
    grid-template-areas: 'preview panes' 'preview surface';
  }
}
body[data-phone-workspace='true'][data-phone-panel-focus='true'] .ed-workspace { grid-template-columns: minmax(0, 1fr); grid-template-rows: 44px minmax(0, 1fr); grid-template-areas: 'panes' 'surface'; }
body[data-phone-workspace='true'][data-phone-panel-focus='true'] .ed-stage { display: none; }
