/* The video and controls size themselves independently; no guessed footer heights. */
.viewer-modal.animations-viewer { height:100dvh; padding:12px 20px max(12px,env(safe-area-inset-bottom)); overflow:hidden; }
.animations-viewer .viewer-topbar { flex-shrink:0; min-height:52px; padding-bottom:8px; }
.animations-viewer .viewer-title { min-width:0; font-size:13px; }
.animations-viewer .viewer-action-button { min-height:44px; }
.animations-viewer .viewer-stage { display:grid; grid-template-rows:minmax(0,1fr) auto; width:100%; }
.viewer-media { position:relative; min-width:0; min-height:0; height:100%; overflow:hidden; background:#080808; }
.viewer-media .main-video { width:100%; height:100%; object-fit:contain; }
body:has(#viewerModal:not(.hidden)) { overflow:hidden; }
.viewer-modal.animations-viewer .viewer-section-badge.animations { display:none; }
.viewer-modal.animations-viewer .animation-player-controls { display:grid; align-items:center; justify-content:stretch; grid-template-columns:minmax(0,1fr) auto minmax(100px,1fr); gap:4px 24px; padding:4px 18px 12px; border-top:1px solid var(--line); background:var(--panel); min-width:0; }
.animation-track-info { grid-column:1; grid-row:2; display:flex; align-items:center; gap:10px; min-width:0; }
.animation-track-info img { width:64px; height:40px; flex-shrink:0; object-fit:contain; background:#090909; border-radius:4px; }
.animation-track-info > div { display:grid; gap:5px; min-width:0; }
.animation-track-info small { font:9px var(--font-mono); letter-spacing:.12em; color:var(--muted); }
.animation-now-playing { white-space:nowrap; text-overflow:ellipsis; overflow:hidden; font-size:13px; font-weight:600; }
.animation-timeline { grid-column:1/-1; grid-row:1; display:grid; grid-template-columns:42px minmax(0,1fr) 42px; gap:10px; align-items:center; font:11px var(--font-mono); font-variant-numeric:tabular-nums; color:var(--muted); }
.animation-timeline span:last-child { text-align:right; }
.animation-timeline input,.animation-setting-row input { min-width:0; width:100%; height:44px; margin:0; accent-color:#eee; cursor:pointer; }
.animation-timeline input:disabled { opacity:.35; cursor:default; }
.animation-transport { grid-column:2; grid-row:2; display:flex; align-items:center; justify-content:center; gap:8px; }
.animation-tools { grid-column:3; grid-row:2; display:flex; justify-content:flex-end; gap:4px; }
.animation-control-button { position:relative; display:inline-flex; align-items:center; justify-content:center; flex-shrink:0; gap:6px; min-width:44px; min-height:44px; padding:0 10px; border:1px solid transparent; border-radius:8px; background:transparent; color:var(--text); cursor:pointer; font:600 12px var(--font-body); touch-action:manipulation; }
.animation-control-button:hover { background:var(--surface-2); }
.animation-control-button[hidden] { display:none; }
.animation-control-button:focus-visible,.animation-speed-select:focus-visible,.animation-timeline input:focus-visible,.animation-setting-row input:focus-visible { outline:2px solid #eee; outline-offset:3px; }
.animation-control-button svg,.animation-center-play svg { width:22px; height:22px; flex-shrink:0; }
.animation-control-button.primary { width:52px; height:52px; min-width:52px; border-radius:50%; color:#111; background:#eee; }
.animation-control-button.primary:hover { background:#ccc; }
.animation-control-button.next { margin-left:12px; padding:0 12px; background:var(--surface-2); border-color:var(--line); }
.animation-jump svg { width:32px; height:32px; }
.animation-jump span { position:absolute; top:20px; font:600 9px var(--font-mono); }
.animation-control-button .play-symbol,.animation-center-play .play-symbol { display:none; }
.video-paused .play-symbol { display:block; }
.video-paused .pause-symbol { display:none; }
.viewer-modal.animations-viewer .animation-center-play { display:none; position:absolute; inset:50% auto auto 50%; translate:-50% -50%; width:64px; height:64px; border-radius:50%; border:1px solid #ffffff50; background:#111c; color:#fff; cursor:pointer; }
.viewer-modal.animations-viewer.video-paused .animation-center-play { display:inline-flex; }
.viewer-loading-screen:not(.hidden) ~ .animation-center-play { display:none !important; }
.viewer-media .viewer-loading-screen { inset:0; background:transparent; pointer-events:none; }
.viewer-loading-screen .loading-card { max-width:calc(100% - 24px); max-height:100%; overflow:auto; background:#181818ed; padding:20px; border:1px solid var(--line); border-radius:8px; pointer-events:auto; }
.viewer-loading-screen .loading-card h2 { font-size:20px; }
.viewer-loading-screen .loading-card button { margin-top:12px; min-height:44px; }
.viewer-loading-screen.load-failed .loading-spinner { display:none; }
.animation-settings { position:absolute; z-index:10; bottom:84px; right:12px; width:320px; max-width:calc(100% - 24px); max-height:calc(100% - 96px); overflow:auto; overscroll-behavior:contain; padding:8px 16px 16px; border:1px solid var(--line-strong); border-radius:12px; background:#202020; box-shadow:0 12px 40px #0008; }
.animation-settings[hidden] { display:none; }
.animation-settings-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; font-size:14px; }
.animation-setting-row { display:grid; grid-template-columns:70px minmax(0,1fr); gap:16px; align-items:center; min-height:52px; font-size:13px; color:var(--muted); }
.animation-setting-row .animation-control-button,.animation-speed-select { width:100%; min-height:44px; border:1px solid var(--line-strong); border-radius:8px; background:var(--panel); color:var(--text); font-size:13px; }
.animation-speed-select { padding:0 12px; }
.viewer-modal:fullscreen { padding-top:env(safe-area-inset-top); padding-left:env(safe-area-inset-left); padding-right:env(safe-area-inset-right); }
.viewer-modal:fullscreen .viewer-topbar { padding:8px 16px; }
.viewer-modal:fullscreen .viewer-stage { border:0; border-radius:0; }
.animation-library { padding:24px; border:1px solid var(--line); border-radius:10px; background:var(--panel); }
.animation-tag-preferences button { min-height:44px; }
@media(max-width:700px) {
  .viewer-modal.animations-viewer { padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom); }
  .animations-viewer .viewer-topbar { padding:6px 12px; }
  .animations-viewer .viewer-stage { border-left:0; border-right:0; border-bottom:0; border-radius:0; }
  .viewer-modal.animations-viewer .animation-player-controls { grid-template-columns:minmax(0,1fr) auto; gap:0 10px; padding:12px 14px 10px; }
  .animation-track-info { grid-row:1; }.animation-tools { grid-column:2; grid-row:1; }
  .animation-track-info img { width:52px; height:34px; }.animation-now-playing { font-size:12px; }
  .animation-timeline { grid-row:2; gap:6px; }.animation-transport { grid-row:3; grid-column:1/-1; gap:12px; }
  .animation-settings { bottom:72px; max-height:calc(100% - 84px); }
  .animation-library { padding:18px; }.animation-library .section-heading { gap:12px; flex-wrap:wrap; }
}
@media(max-height:500px) and (orientation:landscape) {
  .viewer-modal.animations-viewer { padding:0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
  .animations-viewer .viewer-topbar { min-height:44px; padding:0 10px; }
  .viewer-modal.animations-viewer .animation-player-controls { grid-template-columns:minmax(0,1fr) auto auto; gap:0 12px; padding:0 12px 4px; }
  .animation-timeline { grid-row:1; }.animation-track-info { grid-row:2; }
  .animation-transport { grid-row:2; grid-column:2; gap:4px; }.animation-tools { grid-row:2; grid-column:3; }
  .animation-control-button.primary { width:44px; height:44px; min-width:44px; }
  .animation-track-info img { width:48px; height:30px; }.animation-track-info small { display:none; }
  .animation-control-button.next { margin-left:4px; }.animation-settings { bottom:56px; max-height:calc(100% - 64px); }
}
