body.video-editor:has(#work:not([hidden])) { display: block; height: auto; }
.mode-tabs { display: flex; gap: .25rem; flex: none; }
.mode-tabs button, .video-editor :is(#video-pick, #video-compare, .video-save) {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
}
.icon-film-strip { --icon: url("./icon-film-strip.1.0.0.svg"); }
.icon-folder-open { --icon: url("./icon-folder-open.1.0.0.svg"); }
.icon-caret-left { --icon: url("./icon-caret-left.1.0.0.svg"); }
.icon-caret-right { --icon: url("./icon-caret-right.1.0.0.svg"); }
.icon-image { --icon: url("./icon-image.1.0.0.svg"); }
.icon-columns { --icon: url("./icon-columns.1.0.0.svg"); }
.mode-tabs [aria-selected="true"], .mode-tabs [aria-selected="true"]:hover {
  background: var(--accent); color: var(--on-accent); border-color: var(--accent); font-weight: 700;
}
.app-header:has(.mode-tabs) { flex-wrap: wrap; }
.video-editor main { width: min(100%, 76rem); margin: 0 auto; padding-block: .75rem; }
.video-editor #source-picker { background: none; border: 0; }
.video-editor #source-summary { cursor: pointer; padding-block: .35rem; overflow-wrap: anywhere; }
.video-editor #video-name { font-weight: 650; margin-inline-end: .65rem; }
.video-editor #queue.drop {
  min-height: min(51dvh, 25rem); max-width: 58rem; min-width: 0; margin: clamp(1rem, 7dvh, 4rem) auto 0;
  padding: 1.25rem; gap: .62rem;
}
.video-editor #queue[data-dragging] { outline: 2px solid var(--accent); outline-offset: -3px; }
.video-editor #queue .video-drop-icon { width: 3.15rem; height: 3.15rem; margin-bottom: .4rem; }
.video-editor #video-pick { min-width: min(14rem, 100%); min-height: 46px; }
.video-editor .video-privacy { text-align: center; color: var(--muted); font-size: .85rem; margin-block: .65rem; }
.video-editor .video-samples { background: none; border: 0; max-width: 100%; }
.video-editor .video-sample-link { background: none; border: 0; text-decoration: underline; color: var(--accent); }
.video-editor .video-samples > summary { list-style: none; text-decoration: underline; color: var(--accent); }
.video-editor .video-samples > summary::-webkit-details-marker { display: none; }
.video-editor .video-samples .buttons { justify-content: center; }
.video-editor #job #status { margin: .35rem 0; }
.video-editor #job #status:empty { display: none; }
.video-editor #job progress { width: 100%; }
.video-editor #work { display: block; }
.video-editor .frame-controls { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; margin-block: .5rem; }
.video-editor .frame-controls button { display: grid; place-items: center; min-width: 44px; min-height: 44px; }
.video-editor #frame { width: 100%; min-width: 0; margin: 0; }
.video-editor #frame-position { min-width: 8.75rem; font-variant-numeric: tabular-nums; }
.video-editor #work { --video-preview-height: min(55dvh, 36rem); }
.video-editor #work .viewport {
  width: min(100%, calc(var(--video-aspect, 1.7778) * var(--video-preview-height) + 2px));
  max-height: var(--video-preview-height); margin: 0 auto .5rem;
}
.video-editor #result-layer { background-color: #204a62; }
.video-editor .stage[data-view="result"] .after-label { display: none; }
.video-editor #viewport:has([data-zoomed]):not(:has([data-brushing])) { touch-action: none; }
.video-editor #edit {
  position: static; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center;
  background: none; border: 0; padding-inline: 0;
}
.video-editor #edit .edit-toolbar { grid-row: auto; grid-column: auto; }
.video-editor #edit .icon-button { border-color: var(--line); }
.video-editor #brush-controls { grid-column: auto; border: 0; }
.video-editor #brush-controls output { order: -1; }
.video-editor #brush-controls label { order: -2; }
.video-editor #tools .tool-bar { display: flex; justify-content: flex-start; background: none; border: 0; padding: 0; margin-block: .4rem; }
.video-editor #video-compare[aria-pressed="true"] { color: var(--on-accent); background: var(--accent); }
.video-editor .video-options { position: relative; margin-inline-start: auto; }
.video-editor .video-options > summary { padding: .25rem .6rem; white-space: nowrap; }
.video-editor #view-slot {
  position: absolute; z-index: 12; inset-inline-end: 0; width: min(18rem, 82vw); display: grid;
  gap: .3rem; padding: .65rem; border: 1px solid var(--line); border-radius: .65rem; background: var(--panel);
}
.video-editor #view-slot .zoom-tools { display: flex; flex-wrap: wrap; }
.video-editor #view-slot input[type="range"] { flex: 1; min-width: 5rem; }
.video-editor #download { min-height: 44px; }
.video-editor .video-notices { margin-block: .4rem; font-size: .8rem; text-align: center; }
@media (max-width: 600px) {
  .video-editor .video-drop-caption { display: none; }
  .video-editor main:has(#work:not([hidden])) { padding-bottom: calc(4.25rem + env(safe-area-inset-bottom)); }
  .video-editor #work { --video-preview-height: max(108px, min(36dvh, calc(100dvh - 24rem))); }
  .video-editor #edit { grid-template-columns: 1fr; }
  .video-editor #edit .edit-toolbar { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 2fr); padding: 0; }
  .video-editor #edit .history-tools { display: grid; grid-template-columns: 1fr 1fr; border: 0; padding: 0; margin: 0; }
  .video-editor .frame-controls { grid-template-columns: auto minmax(0, 1fr) auto; row-gap: 0; }
  .video-editor #frame-position { grid-column: 1 / -1; grid-row: 2; text-align: center; }
  .video-editor .video-save {
    position: fixed; z-index: 15; inset-inline: .8rem; bottom: calc(.5rem + env(safe-area-inset-bottom));
    box-shadow: 0 0 0 .4rem var(--page);
  }
}
@media (max-width: 600px) and (max-height: 440px) {
  .video-editor .video-save { position: static; box-shadow: none; }
}
@media (max-width: 600px) and (max-height: 650px) {
  .video-editor .frame-controls { grid-template-columns: auto minmax(0, 1fr) auto auto; }
  .video-editor #frame-position { grid-column: auto; grid-row: auto; min-width: 0; font-size: .8rem; }
}
