/* Media-only controls; retain the original layouts, figures and video edits. */
.hero-video-wrap,.recording-screen,.episode-grid article,.wall-window { position:relative; }
.source-speed-badge {
  position:absolute; top:12px; right:12px; z-index:3;
  padding:5px 9px; border:1px solid #ffffff45; border-radius:5px;
  background:#17221fe8; color:#fff; font:600 12px/1.4 system-ui,sans-serif;
  font-variant-numeric:tabular-nums; box-shadow:0 1px 5px #0002;
  pointer-events:auto; white-space:nowrap;
}
.source-speed-badge[data-region="left"] { right:calc(50% + 12px); }
.source-speed-badge[hidden] { display:none; }
.source-speed-strip {
  display:flex; justify-content:flex-end; align-items:center; flex-wrap:wrap;
  flex:none; gap:6px 14px; padding:6px 12px; background:#17221f; color:#fff;
}
.source-speed-strip[hidden] { display:none; }
.source-speed-badge.is-docked {
  position:static; padding:0; border:0; border-radius:0; box-shadow:none;
  background:none; font-size:12px !important; line-height:1.5;
}
.episode-grid .source-speed-badge { top:8px; right:8px; padding:4px 7px; font-size:11px; }
.viewer-toolbar[hidden] { display:none !important; }
.recording-screen .recording-loading {
  position:absolute; left:12px; bottom:52px; z-index:3;
  padding:5px 9px; border-radius:5px; background:#17221fe8; color:white;
  font:500 12px/1.5 system-ui,sans-serif; pointer-events:none;
}
.recording-loading[hidden] { display:none !important; }
/* Keep the current configuration legible in the existing dark theme. */
[data-theme="dark"] #gallery-panel .config-panel,
[data-theme="dark"] #gallery-panel .platform-switch button {
  background:var(--panel); color:var(--theme-ink); border-color:var(--line);
}
[data-theme="dark"] #gallery-panel :is(.config-grid,.platform-switch) button[aria-pressed="true"] {
  background:#39324f; color:#ecdcfa; border-color:#b9a5dd;
  box-shadow:inset 3px 0 0 #b9a5dd;
}
[data-theme="dark"] #gallery-panel :is(.config-panel>p,.config-details b,#config-count) { color:var(--theme-muted); }
[data-theme="dark"] #gallery-panel #recording-kind { background:var(--panel-alt); color:var(--theme-muted); }
[data-theme="dark"] .gallery-footer :is(#next-recording,#copy-recording) {
  background:var(--panel-alt); color:var(--theme-ink); border:1px solid var(--line);
}
@media(max-width:600px) {
  .source-speed-badge { top:6px; right:6px; padding:3px 6px; font-size:11px; }
  .source-speed-badge[data-region="left"] { right:calc(50% + 6px); }
}
