:root {
  --deck-width: 1920px;
  --deck-height: 1080px;
  --canvas: #fff;
  --letterbox: #e8edf3;
  --ink: #14243b;
  --accent: #2563a8;
  --chrome: #243d78;
  --chrome-text: #fff;
  --font: system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; }
body { background: var(--letterbox); color: var(--ink); font-family: var(--font); overflow: hidden; }
[hidden] { display: none !important; }
#deck {
  position: absolute; left: 50%; top: 50%;
  width: var(--deck-width); height: var(--deck-height);
  transform: translate(-50%,-50%) scale(var(--scale,1)); transform-origin: center;
  background: var(--canvas);
}
.slide { display: none; width: var(--deck-width); height: var(--deck-height); position: relative; overflow: hidden; background: var(--canvas); }
.slide.is-active { display: block; }
#progress { position: fixed; inset: 0 0 auto; height: 5px; z-index: 20; background: rgba(0,0,0,.09); pointer-events: none; }
#progress-fill { height: 100%; width: 0; background: var(--accent); transition: width .18s ease; }
#controls {
  position: fixed; right: 18px; bottom: 14px; z-index: 30;
  display: flex; align-items: center; gap: 4px; padding: 5px;
  max-width: calc(100vw - 20px); border-radius: 999px; background: var(--chrome); color: var(--chrome-text);
  box-shadow: 0 6px 20px #0003; transition: opacity .2s ease;
}
#controls.idle:not(:focus-within):not(:hover) { opacity: 0; pointer-events: none; }
#controls button { background: transparent; color: inherit; border: 0; min-height: 40px; font: 600 14px var(--font); cursor: pointer; padding: 6px 12px; border-radius: 999px; white-space: nowrap; }
#controls button:hover, #controls button:focus-visible { background: #ffffff25; outline: 2px solid currentColor; outline-offset: -2px; }
#controls button:disabled { opacity: .45; cursor: default; }
#slide-count { padding: 0 8px; text-align: center; min-width: 62px; font: 600 14px var(--font); font-variant-numeric: tabular-nums; white-space: nowrap; }
#contents {
  position: fixed; inset: 0; z-index: 40; background: #14243b99;
  display: grid; place-items: center; padding: 20px;
}
#contents-panel { width: min(760px,100%); max-height: 86vh; overflow: auto; background: var(--canvas); color: var(--ink); border-radius: 16px; padding: 24px; box-shadow: 0 20px 65px #0004; }
#contents-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
#contents-head h2 { margin: 0; font-size: 24px; }
#contents-close { font: inherit; background: transparent; border: 1px solid currentColor; border-radius: 8px; padding: 8px 12px; cursor: pointer; color: inherit; }
#contents-list h3 { margin: 22px 0 7px; font-size: 14px; color: var(--accent); }
#contents-list ol { list-style: none; padding: 0; margin: 0; }
#contents-list a { display: flex; gap: 12px; align-items: baseline; padding: 8px 10px; border: 1px solid transparent; border-radius: 6px; color: inherit; text-decoration: none; }
#contents-list a:hover, #contents-list a:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
#contents-list a[aria-current="page"] { border-color: var(--accent); font-weight: 700; }
#contents-list .number { min-width: 2ch; color: var(--accent); font-variant-numeric: tabular-nums; }
@media (max-width: 520px) {
  #controls { right: 10px; bottom: 10px; gap: 0; }
  #controls button { font-size: 12px; padding: 5px 7px; }
  #slide-count { font-size: 12px; min-width: 44px; padding: 0 3px; }
}
@media (prefers-reduced-motion: reduce) { #controls, #progress-fill { transition: none; } }
@page { size: 20in 11.25in; margin: 0; }
@media print {
  html, body { width: auto; height: auto; overflow: visible; background: #fff; }
  #deck { position: static; transform: none; width: var(--deck-width); height: auto; }
  .slide, .slide.is-active { display: block !important; width: var(--deck-width); height: var(--deck-height); break-after: page; page-break-after: always; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .slide:last-child { break-after: auto; page-break-after: auto; }
  #controls, #progress, #contents { display: none !important; }
}
