/* Reserve a bottom strip so the persistent dock never covers editable content. */
:root{--history-dock-height:80px;--history-dock-space:calc(var(--history-dock-height) + 24px + env(safe-area-inset-bottom))}
#editor{padding-bottom:var(--history-dock-space)}
#editor #timeline-history-controls{
  position:fixed;left:max(12px,env(safe-area-inset-left));bottom:max(12px,env(safe-area-inset-bottom));z-index:25;
  display:flex;align-items:center;gap:8px;width:min(400px,calc(100% - 24px - env(safe-area-inset-left) - env(safe-area-inset-right)));
  min-width:0;margin:0;padding:8px;background:var(--panel);border:1px solid var(--color-control-border);
  border-radius:var(--radius-10);box-shadow:var(--shadow-notice)
}
.edit-history-buttons{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;flex:1;min-width:0}
#editor #timeline-history-controls .button{display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:2px;min-width:0;min-height:64px;padding:6px 8px;text-align:left;white-space:normal;border:1px solid var(--color-control-border);font-size:12px}
#editor #timeline-history-controls .button:enabled{background:var(--color-action-soft);border-color:var(--color-action-border);color:var(--text)}
#editor #timeline-history-controls .button:enabled:hover{background:var(--color-action-soft-hover)}
#editor #timeline-history-controls .button:disabled{background:var(--color-field);color:var(--muted);opacity:1;border-style:dashed;cursor:default}
.edit-history-name{font-weight:650}
.edit-history-controls kbd{font-family:inherit;font-size:10px;line-height:1.4;color:var(--muted);white-space:nowrap}
.edit-history-controls [data-history-next]{display:block;max-width:100%;font-size:11px;font-weight:400;line-height:1.35;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.edit-history-help{flex:none;font-size:12px;line-height:1.5;color:var(--muted)}
.edit-history-help summary{display:grid;place-items:center;cursor:pointer;list-style:none;width:44px;min-height:44px;border:1px solid var(--color-control-border);border-radius:var(--radius-6);font-weight:650;font-size:16px}
.edit-history-help summary::-webkit-details-marker{display:none}
.edit-history-help-content{position:absolute;left:0;bottom:calc(100% + 8px);width:100%;max-height:50dvh;overflow:auto;overflow-wrap:anywhere;padding:12px;background:var(--panel);border:1px solid var(--color-control-border);border-radius:var(--radius-10);box-shadow:var(--shadow-notice)}
.edit-history-help-content p{margin:0 0 8px}
.edit-history-help-content p:last-child{margin-bottom:0}
.edit-history-feedback:empty{display:none}
.edit-history-announcement{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
#timeline-history-controls :is(button,summary):focus-visible{outline:2px solid var(--color-focus);outline-offset:2px}
#editor .video-slot>.video-stage.is-floating{bottom:var(--history-dock-space)}
body:has(#editor:not([hidden])) #toast{bottom:calc(var(--history-dock-space) + 8px)}
/* Fullscreen belongs to the player shell. Reuse the same dock in its own row. */
#editor #player-shell:fullscreen #timeline-history-controls{position:relative;inset:auto;flex:0 0 auto;order:3;align-self:flex-start;margin:8px max(12px,env(safe-area-inset-left)) max(8px,env(safe-area-inset-bottom));box-shadow:none}
@media(max-width:420px),(max-height:550px){#editor #timeline-history-controls{gap:4px;padding:6px}.edit-history-controls kbd{display:none}#editor #timeline-history-controls .button{min-height:52px}}
@media(forced-colors:active){#editor #timeline-history-controls .button:enabled{border:2px solid Highlight}#editor #timeline-history-controls .button:disabled{color:GrayText;border-color:GrayText}}
