/* ==========================================================================
   TIFF Explorer — styles
   Single stylesheet, no build step. Theme via [data-theme] on <html>.
   ========================================================================== */

/* ------------------------------------------------------------- tokens --- */
:root {
  --bg:            #0d1117;
  --bg-elev:       #151b24;
  --bg-elev-2:     #1c2431;
  --bg-inset:      #0a0e14;
  --line:          #263041;
  --line-soft:     #1d2634;
  --text:          #e6edf3;
  --text-dim:      #9aa7b6;
  --text-faint:    #6b7888;
  --accent:        #4c9aff;
  --accent-strong: #2f7ff0;
  --accent-weak:   rgba(76, 154, 255, .14);
  --danger:        #f0616d;
  --danger-weak:   rgba(240, 97, 109, .13);
  --ok:            #46c68a;
  --warn:          #e2a03f;

  --checker-a: #171d26;
  --checker-b: #1c232e;

  --radius:    12px;
  --radius-sm: 8px;
  --radius-lg: 18px;
  --shadow:    0 8px 28px rgba(0, 0, 0, .45);
  --shadow-lg: 0 22px 60px rgba(0, 0, 0, .6);

  --topbar-h: 60px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

html[data-theme="light"] {
  --bg:            #f5f7fa;
  --bg-elev:       #ffffff;
  --bg-elev-2:     #f0f3f7;
  --bg-inset:      #e8ecf2;
  --line:          #d8dfe8;
  --line-soft:     #e6ebf1;
  --text:          #17202b;
  --text-dim:      #556373;
  --text-faint:    #8492a3;
  --accent:        #1c6ee0;
  --accent-strong: #1559bd;
  --accent-weak:   rgba(28, 110, 224, .1);
  --danger:        #d33a48;
  --danger-weak:   rgba(211, 58, 72, .1);
  --ok:            #1a9c63;

  --checker-a: #eef1f5;
  --checker-b: #e3e8ee;

  --shadow:    0 6px 22px rgba(23, 32, 43, .1);
  --shadow-lg: 0 22px 60px rgba(23, 32, 43, .22);
}

/* --------------------------------------------------------------- base --- */
*, *::before, *::after { box-sizing: border-box; }

/* The UA sheet's `[hidden] { display: none }` loses to any author rule that
   sets display (our .viewer/.stage/.workspace are flex/grid). Without this,
   "hidden" panels stay laid out and keep swallowing pointer events. */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Ambient glow — purely decorative, sits behind everything. */
body::before {
  content: "";
  position: fixed;
  inset: -30% -10% auto -10%;
  height: 60vh;
  background:
    radial-gradient(58% 60% at 22% 0%, rgba(76, 154, 255, .16), transparent 70%),
    radial-gradient(48% 55% at 82% 8%, rgba(150, 108, 255, .12), transparent 70%);
  pointer-events: none;
  z-index: 0;
}
html[data-theme="light"] body::before { opacity: .65; }

svg { display: block; }

button, select, input { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 10px 16px;
  z-index: 100;
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }

/* ------------------------------------------------------------ buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-weight: 550;
  cursor: pointer;
  white-space: nowrap;
  transition: background .16s, border-color .16s, color .16s, transform .1s;
}
.btn:active { transform: translateY(1px); }

.btn .icon { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 2px 10px rgba(47, 127, 240, .3);
}
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }

.btn-ghost { border-color: var(--line); background: var(--bg-elev); color: var(--text-dim); }
.btn-ghost:hover { color: var(--text); border-color: var(--text-faint); background: var(--bg-elev-2); }

.btn-danger-ghost { border-color: transparent; background: var(--danger-weak); color: var(--danger); }
.btn-danger-ghost:hover { border-color: var(--danger); }

.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:disabled:active { transform: none; }

/* ------------------------------------------------------------- topbar --- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 clamp(14px, 3vw, 28px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}

.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }

.brand-mark {
  width: 30px; height: 30px; flex: none;
  fill: none; stroke: var(--accent); stroke-width: 1.9;
}
.brand-mark .sheet-2 { stroke: var(--text-faint); }

.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-name { font-weight: 680; font-size: 15.5px; letter-spacing: -.01em; }
.brand-sub { font-size: 11.5px; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.topbar-actions { display: flex; align-items: center; gap: 9px; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px;
  font-size: 12px; font-weight: 560;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.pill-icon { width: 13px; height: 13px; fill: currentColor; }
.pill-privacy { background: rgba(70, 198, 138, .12); color: var(--ok); border-color: rgba(70, 198, 138, .28); }
.pill-privacy.is-server { background: rgba(226, 160, 63, .13); color: var(--warn); border-color: rgba(226, 160, 63, .3); }

#themeBtn { padding: 8px; }
#themeBtn .icon { width: 18px; height: 18px; }
html[data-theme="dark"]  .icon-sun  { display: none; }
html[data-theme="light"] .icon-moon { display: none; }

/* ---------------------------------------------------------- dropzone --- */
main { flex: 1; position: relative; z-index: 1; display: flex; flex-direction: column; }

.stage {
  flex: 1;
  display: grid;
  place-items: center;
  padding: clamp(24px, 6vh, 64px) 20px;
}

.dropzone {
  width: min(660px, 100%);
  text-align: center;
  padding: clamp(30px, 6vw, 52px) clamp(22px, 5vw, 48px);
  border: 1.5px dashed var(--line);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--bg-elev) 72%, transparent);
  backdrop-filter: blur(8px);
  cursor: pointer;
  transition: border-color .18s, background .18s, transform .18s;
}
.dropzone:hover, .dropzone:focus-visible {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--bg-elev) 92%, transparent);
  transform: translateY(-2px);
}

/* Stacked-sheets illustration */
.dz-visual { position: relative; height: 92px; margin-bottom: 22px; }
.dz-sheet {
  position: absolute; left: 50%; top: 50%;
  width: 62px; height: 76px;
  border-radius: 9px;
  border: 1.5px solid var(--line);
  background: var(--bg-elev-2);
  display: grid; place-items: center;
  transition: transform .35s cubic-bezier(.2, .9, .3, 1.2);
}
.dz-sheet-1 { transform: translate(-50%, -50%); border-color: var(--accent); background: var(--bg-elev); z-index: 3; }
.dz-sheet-2 { transform: translate(-64%, -54%) rotate(-8deg); z-index: 2; }
.dz-sheet-3 { transform: translate(-36%, -46%) rotate(8deg); z-index: 1; }
.dropzone:hover .dz-sheet-2 { transform: translate(-82%, -56%) rotate(-13deg); }
.dropzone:hover .dz-sheet-3 { transform: translate(-18%, -44%) rotate(13deg); }
.dz-sheet-1 svg { width: 26px; height: 26px; fill: none; stroke: var(--accent); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

.dz-title { margin: 0 0 8px; font-size: clamp(21px, 3.4vw, 27px); font-weight: 680; letter-spacing: -.02em; }
.dz-sub { margin: 0 auto 24px; max-width: 46ch; color: var(--text-dim); font-size: 14.5px; }

.dz-cta { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.dz-cta .btn-primary { padding: 11px 26px; font-size: 15px; }
.dz-or { font-size: 13px; color: var(--text-faint); }

.dz-facts {
  list-style: none;
  margin: 26px 0 0;
  padding: 18px 0 0;
  border-top: 1px solid var(--line-soft);
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px;
  font-size: 12.5px; color: var(--text-faint);
}
.dz-facts strong { color: var(--text-dim); font-weight: 600; }

/* --------------------------------------------------------- workspace --- */
.workspace { display: flex; flex-direction: column; flex: 1; padding: 0 clamp(14px, 3vw, 28px) 40px; }

.toolbar {
  position: sticky;
  top: var(--topbar-h);
  z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
  padding: 14px 0;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
}
.toolbar-left  { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; min-width: 0; }
.toolbar-right { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }

.field { display: flex; align-items: center; gap: 8px; min-width: 0; }
.field-label { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint); font-weight: 600; }

.select {
  max-width: min(340px, 48vw);
  padding: 7px 30px 7px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: right 13px center, right 8px center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  text-overflow: ellipsis;
}

.summary { font-size: 13px; color: var(--text-dim); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.summary b { color: var(--text); font-weight: 620; }
.summary .sep { color: var(--line); }
.summary .warn { color: var(--warn); }

.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--bg-elev); }
.segmented button {
  border: 0; background: transparent; padding: 7px 10px; cursor: pointer;
  color: var(--text-faint); display: grid; place-items: center;
  transition: background .15s, color .15s;
}
.segmented button svg { width: 15px; height: 15px; fill: currentColor; }
.segmented button:hover { color: var(--text); background: var(--bg-elev-2); }
.segmented button.is-active { color: #fff; background: var(--accent); }

/* ---------------------------------------------------------- progress --- */
.progress { display: flex; align-items: center; gap: 12px; padding: 0 0 14px; }
.progress-bar { flex: 1; height: 4px; border-radius: 3px; background: var(--bg-inset); overflow: hidden; }
.progress-bar span { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, var(--accent), #8b6bff); transition: width .18s ease; }
.progress-text { font-size: 12.5px; color: var(--text-dim); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* -------------------------------------------------------------- grid --- */
.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(var(--card-w, 210px), 1fr));
}
.grid[data-size="sm"] { --card-w: 140px; gap: 12px; }
.grid[data-size="md"] { --card-w: 210px; }
.grid[data-size="lg"] { --card-w: 320px; gap: 20px; }

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elev);
  overflow: hidden;
  cursor: pointer;
  display: flex; flex-direction: column;
  transition: border-color .16s, transform .16s, box-shadow .16s;
  animation: cardIn .28s ease both;
}
@keyframes cardIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.card:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: var(--shadow); }
.card:focus-visible { border-color: var(--accent); }

.card-thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  display: grid; place-items: center;
  background-color: var(--checker-a);
  background-image:
    linear-gradient(45deg, var(--checker-b) 25%, transparent 25%, transparent 75%, var(--checker-b) 75%),
    linear-gradient(45deg, var(--checker-b) 25%, transparent 25%, transparent 75%, var(--checker-b) 75%);
  background-size: 16px 16px;
  background-position: 0 0, 8px 8px;
  overflow: hidden;
}
.card-thumb canvas, .card-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }

.card-badge {
  position: absolute; top: 8px; left: 8px;
  padding: 2px 8px;
  font-size: 11px; font-weight: 640;
  border-radius: 999px;
  background: rgba(0, 0, 0, .68);
  color: #fff;
  backdrop-filter: blur(4px);
  font-variant-numeric: tabular-nums;
}

.card-meta { padding: 9px 11px 11px; border-top: 1px solid var(--line-soft); }
.card-dims { font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.card-tags { margin-top: 3px; font-size: 11.5px; color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.card.is-failed { border-color: var(--danger); }
.card.is-failed .card-thumb { background: var(--danger-weak); background-image: none; }
.card-fail { text-align: center; padding: 14px; color: var(--danger); font-size: 12px; }
.card-fail-why { margin-top: 4px; color: var(--text-faint); font-size: 10.5px; line-height: 1.35; }
.card-fail svg { width: 24px; height: 24px; margin: 0 auto 6px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }

.card-skeleton { background: var(--bg-elev-2); animation: pulse 1.3s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: .45; } 50% { opacity: .85; } }

/* ------------------------------------------------------------ viewer --- */
.viewer {
  position: fixed; inset: 0; z-index: 60;
  display: flex; flex-direction: column;
  background: color-mix(in srgb, var(--bg) 96%, #000);
  animation: fade .18s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.viewer-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 10px clamp(12px, 2.5vw, 20px);
  border-bottom: 1px solid var(--line-soft);
  background: var(--bg-elev);
  flex-wrap: wrap;
}
.viewer-title { min-width: 0; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.viewer-title strong { font-size: 15px; font-weight: 650; }
.viewer-sub { font-size: 12.5px; color: var(--text-faint); font-variant-numeric: tabular-nums; }

.viewer-tools { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.viewer-tools .btn { padding: 7px 9px; }
.btn-zoom { min-width: 62px; justify-content: center; font-variant-numeric: tabular-nums; font-size: 13px; }
.tool-sep { width: 1px; height: 20px; background: var(--line); margin: 0 3px; }
.btn.is-on { background: var(--accent-weak); border-color: var(--accent); color: var(--accent); }

.viewer-body { flex: 1; position: relative; display: flex; min-height: 0; }

/* The canvas is absolutely positioned rather than centred by the layout.
   Layout centring (grid/flex) only centres within the *track*, and the track
   grows to fit an oversized item — so any page larger than this box would be
   "centred" around a point outside the visible area and scale off-screen.
   Anchoring to 50%/50% and letting the transform do the rest is size-agnostic. */
.canvas-wrap {
  flex: 1;
  position: relative;
  overflow: hidden;
  background-color: var(--checker-a);
  background-image:
    linear-gradient(45deg, var(--checker-b) 25%, transparent 25%, transparent 75%, var(--checker-b) 75%),
    linear-gradient(45deg, var(--checker-b) 25%, transparent 25%, transparent 75%, var(--checker-b) 75%);
  background-size: 22px 22px;
  background-position: 0 0, 11px 11px;
  cursor: grab;
  touch-action: none;
}
.canvas-wrap.is-panning { cursor: grabbing; }
/* left/top 50% puts the canvas's top-left at the centre of the wrap; the
   translate(-50%,-50%) in applyTransform() pulls its own centre onto that
   point. See app.js — the two must stay in sync. */
#viewerCanvas {
  position: absolute;
  left: 50%;
  top: 50%;
  transform-origin: center center;
  image-rendering: auto;
  will-change: transform;
}
#viewerCanvas.is-pixelated { image-rendering: pixelated; }

.viewer-loading {
  position: absolute; inset: auto auto 20px 50%;
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 9px;
  padding: 8px 15px; border-radius: 999px;
  background: var(--bg-elev); border: 1px solid var(--line);
  font-size: 13px; color: var(--text-dim);
  box-shadow: var(--shadow);
}
.spinner {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--line); border-top-color: var(--accent);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.nav-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  z-index: 5;
  width: 42px; height: 62px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-elev) 88%, transparent);
  backdrop-filter: blur(6px);
  color: var(--text-dim);
  border-radius: var(--radius);
  cursor: pointer;
  display: grid; place-items: center;
  transition: color .15s, border-color .15s, opacity .15s;
}
.nav-arrow svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.nav-arrow:hover { color: var(--text); border-color: var(--accent); }
.nav-arrow:disabled { opacity: .25; cursor: default; }
.nav-prev { left: 14px; }
.nav-next { right: 14px; }

.info-panel {
  width: 300px; flex: none;
  border-left: 1px solid var(--line);
  background: var(--bg-elev);
  padding: 18px;
  overflow-y: auto;
}
.info-panel h2 { margin: 0 0 14px; font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--text-faint); font-weight: 650; }
.info-panel dl { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 9px 12px; font-size: 12.5px; }
.info-panel dt { color: var(--text-faint); }
.info-panel dd { margin: 0; font-family: var(--mono); font-size: 11.5px; overflow-wrap: anywhere; color: var(--text); }

.filmstrip {
  flex: none;
  display: flex; gap: 8px;
  padding: 10px clamp(12px, 2.5vw, 20px);
  overflow-x: auto;
  border-top: 1px solid var(--line-soft);
  background: var(--bg-elev);
  scrollbar-width: thin;
}
.filmstrip-item {
  flex: none;
  width: 58px; height: 58px;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  background: var(--bg-inset);
  cursor: pointer;
  overflow: hidden;
  display: grid; place-items: center;
  position: relative;
  transition: border-color .15s, transform .15s;
  padding: 0;
}
.filmstrip-item canvas { max-width: 100%; max-height: 100%; object-fit: contain; }
.filmstrip-item:hover { transform: translateY(-2px); }
.filmstrip-item.is-active { border-color: var(--accent); }
.filmstrip-item .fs-num {
  position: absolute; bottom: 0; right: 0;
  font-size: 9.5px; font-weight: 650;
  padding: 0 4px;
  background: rgba(0, 0, 0, .72); color: #fff;
  border-radius: 4px 0 0 0;
}

/* ----------------------------------------------------- drag overlay --- */
.drag-overlay {
  position: fixed; inset: 0; z-index: 80;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(6px);
  pointer-events: none;
}
.drag-card {
  padding: 40px 56px;
  border: 2px dashed var(--accent);
  border-radius: var(--radius-lg);
  background: var(--bg-elev);
  text-align: center;
  box-shadow: var(--shadow-lg);
}
.drag-card svg { width: 40px; height: 40px; margin: 0 auto 12px; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.drag-card p { margin: 0; font-weight: 650; font-size: 17px; }

/* ------------------------------------------------------------ toasts --- */
.toasts {
  position: fixed; z-index: 90;
  right: 16px; bottom: 16px;
  display: flex; flex-direction: column; gap: 9px;
  max-width: min(400px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--bg-elev);
  box-shadow: var(--shadow);
  font-size: 13.5px;
  animation: toastIn .22s cubic-bezier(.2, .9, .3, 1.1);
  pointer-events: auto;
}
@keyframes toastIn { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }
.toast.is-error { border-color: var(--danger); }
.toast.is-error .toast-dot { background: var(--danger); }
.toast.is-warn  { border-color: var(--warn); }
.toast.is-warn  .toast-dot { background: var(--warn); }
.toast-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); margin-top: 7px; flex: none; }
.toast-body { min-width: 0; }
.toast-title { font-weight: 620; }
.toast-msg { color: var(--text-dim); font-size: 12.5px; }

/* ------------------------------------------------------------ footer --- */
.footer {
  position: relative; z-index: 1;
  padding: 20px clamp(14px, 3vw, 28px) 28px;
  border-top: 1px solid var(--line-soft);
  color: var(--text-faint);
  font-size: 12.5px;
}
.footer p { margin: 0; max-width: 90ch; }
.footer-note { color: var(--text-dim); }

/* ----------------------------------------------------------- mobile --- */
@media (max-width: 760px) {
  .brand-sub { display: none; }
  .pill-privacy span { display: none; }
  .pill-privacy { padding: 6px; }
  .info-panel {
    position: absolute; inset: 0 0 0 auto;
    width: min(300px, 84vw);
    box-shadow: var(--shadow-lg);
    z-index: 6;
  }
  .nav-arrow { width: 34px; height: 52px; }
  .nav-prev { left: 6px; }
  .nav-next { right: 6px; }
  .toolbar { top: var(--topbar-h); }
  .summary { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
