.slides-page { min-height: 100vh; background: var(--bg); }
.deck-header { position: sticky; top: 0; z-index: 30; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(18px); }
.deck-header-inner { min-height: 82px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.deck-header-actions { display: flex; align-items: center; gap: 14px; }
.deck-back { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: .78rem; font-weight: 720; transition: color .2s ease; }
.deck-back:hover { color: var(--text); }
.deck-main { padding-top: 54px; padding-bottom: 70px; }
.deck-intro { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 38px; align-items: end; margin-bottom: 30px; }
.deck-intro-copy { min-width: 0; }
.deck-intro h1 { max-width: 980px; margin: 0; font-family: ui-serif, Georgia, serif; font-size: clamp(2.25rem, 4.4vw, 4.65rem); font-weight: 520; line-height: 1.01; letter-spacing: -.048em; }
.deck-context { max-width: 900px; margin-top: 22px; padding: 15px 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: start; border-block: 1px solid var(--line); }
.deck-kind { width: fit-content; padding: 6px 9px; border: 1px solid color-mix(in srgb, var(--accent) 42%, var(--line)); border-radius: 999px; color: var(--accent); background: color-mix(in srgb, var(--accent) 9%, transparent); font-size: .63rem; font-weight: 800; letter-spacing: .09em; line-height: 1.25; text-transform: uppercase; white-space: nowrap; }
.deck-context-copy { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.deck-context-copy strong { color: var(--text); font-size: .91rem; font-weight: 740; line-height: 1.42; }
.deck-context-copy span { color: var(--faint); font-size: .74rem; line-height: 1.45; }
.deck-intro p { max-width: 880px; margin: 17px 0 0; color: var(--muted); font-size: .94rem; }
.deck-intro-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: flex-end; }
.deck-related, .deck-download { white-space: nowrap; }
.deck-viewer { overflow: hidden; border: 1px solid var(--line); border-radius: calc(var(--radius) + 4px); background: var(--surface); box-shadow: 0 28px 90px rgba(0,0,0,.18); }
.deck-stage { position: relative; min-height: 0; display: grid; grid-template-columns: 68px minmax(0, 1fr) 68px; align-items: center; gap: 0; padding: 22px; background: #05080d; outline: none; }
.deck-stage:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.deck-frame { width: 100%; margin: 0; display: grid; place-items: center; overflow: hidden; border-radius: 12px; background: #fff; box-shadow: 0 18px 55px rgba(0,0,0,.32); }
.deck-frame img { width: 100%; height: auto; display: block; user-select: none; -webkit-user-drag: none; }
.deck-arrow { width: 46px; height: 46px; justify-self: center; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.16); border-radius: 50%; background: rgba(255,255,255,.07); color: #fff; font-size: 1.15rem; cursor: pointer; transition: background .2s ease, transform .2s ease, opacity .2s ease; }
.deck-arrow:hover:not(:disabled) { background: rgba(255,255,255,.14); transform: scale(1.04); }
.deck-arrow:disabled { opacity: .24; cursor: default; }
.deck-toolbar { min-height: 70px; display: grid; grid-template-columns: auto minmax(120px, 1fr) auto; gap: 22px; align-items: center; padding: 13px 22px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.deck-position { min-width: 64px; color: var(--text); font-size: .8rem; font-variant-numeric: tabular-nums; font-weight: 760; }
.deck-position span:not(:first-child) { color: var(--faint); }
.deck-progress { height: 4px; overflow: hidden; border-radius: 999px; background: var(--line); }
.deck-progress span { width: 0; height: 100%; display: block; border-radius: inherit; background: linear-gradient(90deg, var(--accent), #9f8cff); transition: width .2s ease; }
.deck-toolbar-actions { display: flex; align-items: center; gap: 14px; }
.deck-hint { color: var(--faint); font-size: .68rem; }
.deck-tool { min-height: 38px; padding: 0 12px; display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 10px; background: transparent; color: var(--muted); font-size: .72rem; font-weight: 720; cursor: pointer; }
.deck-tool:hover { color: var(--text); border-color: var(--line-strong); }
.deck-tool svg { width: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.deck-filmstrip { display: flex; gap: 10px; overflow-x: auto; padding: 16px 18px 18px; scrollbar-width: thin; scroll-behavior: smooth; }
.deck-thumb { position: relative; flex: 0 0 148px; overflow: hidden; padding: 0; border: 1px solid var(--line); border-radius: 9px; background: #fff; cursor: pointer; opacity: .58; transition: opacity .2s ease, border-color .2s ease, transform .2s ease; }
.deck-thumb:hover { opacity: .9; transform: translateY(-1px); }
.deck-thumb.active { opacity: 1; border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent); }
.deck-thumb img { width: 100%; height: auto; display: block; }
.deck-thumb span { position: absolute; right: 5px; bottom: 5px; min-width: 23px; padding: 2px 5px; border-radius: 5px; background: rgba(3,8,13,.76); color: #fff; font-size: .61rem; font-variant-numeric: tabular-nums; }
.deck-fullscreen-chrome { display: none; }
html.deck-fullscreen-lock, body.deck-fullscreen-lock { overflow: hidden; overscroll-behavior: none; }
.deck-stage.is-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  width: 100vw;
  width: 100dvw;
  height: 100vh;
  height: 100dvh;
  grid-template-columns: 72px minmax(0, 1fr) 72px;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
  background: #020407;
}
.deck-stage.is-fullscreen .deck-frame {
  width: min(100%, calc(177.5vh - 64px));
  width: min(100%, calc(177.5dvh - 64px));
  aspect-ratio: 1440 / 811;
  max-width: none;
  max-height: calc(100dvh - 36px);
  justify-self: center;
  border-radius: 10px;
}
.deck-stage.is-fullscreen .deck-frame img { width: 100%; height: 100%; max-height: none; object-fit: contain; }
.deck-stage.is-fullscreen .deck-arrow { z-index: 8; }
.deck-stage.is-fullscreen .deck-fullscreen-chrome {
  position: absolute;
  z-index: 12;
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  left: max(12px, env(safe-area-inset-left));
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}
.deck-fullscreen-position,
.deck-fullscreen-exit {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  color: #fff;
  background: rgba(3,8,13,.72);
  box-shadow: 0 10px 28px rgba(0,0,0,.24);
  backdrop-filter: blur(12px);
}
.deck-fullscreen-position { padding: 0 13px; font-size: .72rem; font-weight: 780; font-variant-numeric: tabular-nums; }
.deck-fullscreen-position span:not(:first-child) { color: rgba(255,255,255,.62); }
.deck-fullscreen-exit { gap: 7px; padding: 0 13px; font-size: .72rem; font-weight: 760; cursor: pointer; pointer-events: auto; }
.deck-fullscreen-exit svg { width: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.deck-fullscreen-exit:hover { background: rgba(255,255,255,.12); }

.deck-error { max-width: 760px; padding: 70px 0; }
.deck-error h1 { margin: 12px 0; font-family: ui-serif, Georgia, serif; font-size: clamp(2rem, 5vw, 4rem); font-weight: 520; line-height: 1.05; }
.deck-error p, .deck-noscript { color: var(--muted); }
@media (max-width: 820px) {
  .deck-intro { grid-template-columns: 1fr; gap: 20px; }
  .deck-intro-actions { justify-content: flex-start; }
  .deck-context { grid-template-columns: 1fr; gap: 10px; }
  .deck-related, .deck-download { width: fit-content; }
  .deck-stage { grid-template-columns: 46px minmax(0, 1fr) 46px; padding: 12px 4px; }
  .deck-arrow { width: 38px; height: 38px; }
  .deck-toolbar { grid-template-columns: auto 1fr auto; gap: 12px; padding-inline: 14px; }
  .deck-hint { display: none; }
  .deck-thumb { flex-basis: 118px; }
}
@media (max-width: 820px) {
  .deck-stage.is-fullscreen { grid-template-columns: 52px minmax(0, 1fr) 52px; padding: 10px; }
  .deck-stage.is-fullscreen .deck-frame { width: min(100%, calc(177.5vh - 36px)); width: min(100%, calc(177.5dvh - 36px)); max-height: calc(100dvh - 20px); }
  .deck-stage.is-fullscreen .deck-arrow { width: 42px; height: 42px; background: rgba(3,8,13,.76); }
}
@media (max-width: 820px) and (orientation: portrait) {
  .deck-stage.is-fullscreen { display: flex; align-items: center; justify-content: center; padding: 0; }
  .deck-stage.is-fullscreen .deck-frame {
    position: absolute;
    width: min(calc(100vh - 76px), 174vw);
    width: min(calc(100dvh - 76px), 174dvw);
    height: auto;
    max-height: none;
    transform: rotate(90deg);
    transform-origin: center;
    border-radius: 8px;
  }
  .deck-stage.is-fullscreen .deck-arrow {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
  }
  .deck-stage.is-fullscreen .deck-arrow:hover:not(:disabled) { transform: translateY(-50%) scale(1.03); }
  .deck-stage.is-fullscreen .deck-arrow-prev { left: max(8px, env(safe-area-inset-left)); }
  .deck-stage.is-fullscreen .deck-arrow-next { right: max(8px, env(safe-area-inset-right)); }
}

@media (max-width: 560px) {
  .deck-header-inner { min-height: 68px; }
  .deck-header .brand-copy small, .deck-back { display: none; }
  .deck-main { width: min(100% - 18px, var(--shell)); padding-top: 28px; }
  .deck-intro h1 { font-size: 2.1rem; }
  .deck-intro p { font-size: .84rem; }
  .deck-stage { grid-template-columns: 1fr; padding: 8px; }
  .deck-arrow { position: absolute; z-index: 3; top: 50%; transform: translateY(-50%); background: rgba(3,8,13,.72); }
  .deck-arrow:hover:not(:disabled) { transform: translateY(-50%) scale(1.03); }
  .deck-arrow-prev { left: 14px; }
  .deck-arrow-next { right: 14px; }
  .deck-toolbar { grid-template-columns: auto 1fr auto; min-height: 58px; }
  .deck-tool span { display: none; }
  .deck-filmstrip { padding: 12px; }
  .deck-thumb { flex-basis: 92px; }
}
