:root { color-scheme: dark; font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: #eff1f5; background: #080b11; --accent: #c4ed19; }
* { box-sizing: border-box; }
body { margin: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; background: #141924; border: 1px solid #303745; border-radius: 8px; min-height: 42px; min-width: 42px; padding: 8px 13px; }
button:hover { background: #252d3b; border-color: #657042; }
button:disabled { opacity: .3; cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
a { color: var(--accent); }
#viewer { height: 100vh; height: 100dvh; display: flex; flex-direction: column; background: #080b11; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
header { height: 56px; flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; border-bottom: 1px solid #1c2230; }
.brand { text-decoration: none; font-size: 13px; font-weight: 800; letter-spacing: .18em; }
.brand span { color: #8e97a8; font-size: 10px; font-weight: 500; letter-spacing: .12em; }
#help-button { min-width: 30px; min-height: 30px; padding: 3px 8px; border-radius: 50%; color: #aeb6c4; background: transparent; }
#stage { flex: 1; min-height: 0; display: grid; place-items: center; overflow: hidden; background: #000; padding: 12px 16px; touch-action: pan-y pinch-zoom; }
.slide { position: relative; flex-shrink: 0; background: #000; }
.slide[hidden] { display: none; }
.slide-image { display: block; width: 100%; height: 100%; object-fit: contain; }
#stage { position: relative; }
/* The cover is visible before JavaScript, history, or resize observers initialize. */
.slide.cover-initial { position: absolute; inset: 0; }
.media { position: absolute; background: #000; }
.media video { width: 100%; height: 100%; display: block; object-fit: fill; }
.media-error { position: absolute; inset: 0; padding: 8px; background: #0c111b; font-size: clamp(10px, 1.3vw, 18px); }
.media-error[hidden] { display: none; }
.slide-link { position: absolute; border-radius: 2px; }
.slide-link:hover, .slide-link:focus-visible { background: #c4ed1920; outline: 2px solid var(--accent); }
footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 12px 24px; min-height: 78px; flex-shrink: 0; }
.slide-info { flex: 1; min-width: 0; }
#slide-title { display: block; font-size: 13px; font-weight: 600; }
.hint { display: block; margin-top: 5px; font-size: 11px; color: #8e97a8; }
nav, .actions { display: flex; gap: 8px; align-items: center; }
.actions { flex: 1; justify-content: flex-end; }
#counter { font-variant-numeric: tabular-nums; font-size: 13px; }
.grid-icon { color: #a4b17a; margin-left: 8px; }
#previous, #next, #fullscreen { font-size: 20px; }
.progress { height: 2px; flex-shrink: 0; background: #1c2230; }
#progress-fill { height: 100%; background: var(--accent); }
dialog { width: min(1040px, calc(100% - 32px)); max-height: calc(100dvh - 40px); padding: 24px; background: #101620; color: #eff1f5; border: 1px solid #343e50; border-radius: 14px; box-shadow: 0 24px 100px #000b; }
dialog::backdrop { background: #000c; }
.dialog-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 22px; }
h1 { font-size: 19px; margin: 0; }
#thumbnails { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.thumbnail { display: block; text-align: left; padding: 6px; min-width: 0; }
.thumbnail[aria-current="true"] { border-color: var(--accent); background: #c4ed1912; }
.thumbnail img { width: 100%; aspect-ratio: 33.858 / 19.05; display: block; border-radius: 3px; }
.thumbnail span { display: block; font-size: 12px; padding: 10px 4px 4px; }
#transcript, #help { max-width: 720px; }
#transcript-body p, #help p { line-height: 1.65; font-size: 16px; color: #ccd3df; white-space: pre-wrap; }
dl { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; line-height: 1.5; font-size: 14px; }
dt { color: var(--accent); } dd { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.no-script { position: fixed; inset: 20%; padding: 30px; background: #101620; }
@media (max-width: 700px) {
 header { padding: 0 14px; height: 46px; }
 #stage { padding: 0; }
 footer { flex-wrap: wrap; gap: 10px; padding: 10px 12px; }
 .slide-info { flex-basis: 100%; text-align: center; }
 .hint { display: none; }
 nav { flex: 1; }
 .actions { flex: 0; }
 #thumbnails { grid-template-columns: repeat(2, 1fr); gap: 10px; }
 dialog { padding: 16px; }
 .brand span { font-size: 8px; }
}
@media (max-height: 500px) {
 header, .slide-info { display: none; }
 footer { min-height: 52px; padding: 5px 14px; flex-wrap: nowrap; }
 nav { flex: 1; justify-content: center; }
 .actions { flex: 0; }
 #stage { padding: 0; }
}
@media print {
 #viewer { height: auto; display: block; } header, footer, .progress, dialog { display: none; }
 #stage { display: block; padding: 0; overflow: visible; }
 .slide, .slide[hidden] { display: block; width: 100% !important; height: auto !important; break-after: page; }
 .media { display: none; }
 @page { size: landscape; margin: 0; }
}
