/* RDx Decks V2 — presenter chrome (the .viewer vocabulary).
 *
 * Extracted from the prototype workspace.css so the SELF-CONTAINED artifact can
 * present without the app bundle: slide-stage.js Present() emits this exact DOM.
 * The SPA presenter route (Phase 4) loads the same file + runtime. Tokens come
 * from tokens.css (loaded alongside). British spelling, no emoji, tokens only. */

@keyframes deck-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes deck-rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

.viewer { position: fixed; inset: 0 0 auto 0; height: 100vh; height: 100dvh; z-index: 200; background: #0b0d10; display: flex; flex-direction: column; animation: deck-fade var(--motion, 280ms) var(--ease, cubic-bezier(.4,0,.2,1)) both; }
.viewer.has-notes .viewer-stage { padding-bottom: 264px; }

.viewer-top { position: absolute; top: 0; left: 0; right: 0; z-index: 3; display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px; color: rgba(255,255,255,0.86);
  background: linear-gradient(to bottom, rgba(0,0,0,0.45), transparent); transition: opacity var(--motion, 280ms) var(--ease, ease); }
.viewer-top.is-hidden { opacity: 0; pointer-events: none; }
.vt-left { display: flex; align-items: center; gap: 10px; }
.vt-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand-primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand-primary) 25%, transparent); }
.vt-title { font-size: var(--fs-label, 15px); font-weight: var(--fw-medium, 500); letter-spacing: -0.01em; }
.vt-right { display: flex; align-items: center; gap: 10px; }
.vt-timer { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-body-sm, 14px); color: rgba(255,255,255,0.7); padding-right: 4px; }
.vt-timer svg { width: 14px; height: 14px; }
.vt-btn { width: 34px; height: 34px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.16); background: rgba(255,255,255,0.06); color: #fff; cursor: pointer; display: grid; place-items: center; transition: background var(--motion-fast, 140ms) var(--ease, ease); }
.vt-btn:hover { background: rgba(255,255,255,0.18); }
.vt-btn.is-on { background: var(--brand-primary); border-color: var(--brand-primary); }
.vt-btn svg { width: 16px; height: 16px; }
.vt-exit { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: var(--radius-pill, 999px);
  border: 1px solid rgba(255,255,255,0.2); background: rgba(255,255,255,0.08); color: #fff; font: inherit; font-size: var(--fs-body-sm, 14px); font-weight: var(--fw-medium, 500); cursor: pointer; }
.vt-exit:hover { background: rgba(255,255,255,0.16); }
.vt-exit svg { width: 14px; height: 14px; }

/* The slide is fit-contain'd into this stage, so any padding here is extra
   inset ON TOP of the unavoidable one-axis 16:9 letterbox. The old clamp left
   up to 70px/84px of dead margin around the slide; a slim symmetric inset lets
   the slide fill the viewport (the absolutely-positioned, auto-hiding top
   toolbar + bottom nav pill float over it). Kept in step with web/src/styles/
   workspace.css's .viewer-stage. */
.viewer-stage { flex: 1 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 8px; position: relative; }
.viewer-slide { box-shadow: 0 30px 90px -20px rgba(0,0,0,0.7); border-radius: 6px; }
.viewer-hit { position: absolute; top: 0; bottom: 0; width: 30%; z-index: 2; cursor: pointer; }
.viewer-hit.prev { left: 0; } .viewer-hit.next { right: 0; }

.viewer-ctl { position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%); z-index: 3; display: flex; align-items: center; gap: 14px;
  padding: 7px 10px; border-radius: var(--radius-pill, 999px); background: rgba(20,22,26,0.74); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.12); transition: opacity var(--motion, 280ms) var(--ease, ease); }
.viewer-ctl.is-hidden { opacity: 0; pointer-events: none; }
.vbtn { width: 36px; height: 36px; border-radius: 50%; border: none; background: rgba(255,255,255,0.1); color: #fff; cursor: pointer; display: grid; place-items: center; transition: background var(--motion-fast, 140ms) var(--ease, ease); }
.vbtn:hover { background: rgba(255,255,255,0.2); }
.vbtn[disabled] { opacity: 0.3; pointer-events: none; }
.vbtn svg { width: 18px; height: 18px; }
.viewer-pos { display: inline-flex; align-items: center; gap: 12px; color: #fff; font-size: var(--fs-body-sm, 14px); font-weight: var(--fw-medium, 500); min-width: 64px; justify-content: center; }
.viewer-buildpips { display: inline-flex; gap: 4px; }
.bpip { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,0.3); transition: background var(--motion-fast, 140ms) var(--ease, ease); }
.bpip.on { background: var(--brand-primary); }

.viewer-progress { position: absolute; bottom: 0; left: 0; right: 0; height: 3px; background: rgba(255,255,255,0.08); z-index: 3; }
.viewer-progress i { display: block; height: 100%; background: var(--brand-primary); transition: width var(--motion-page, 420ms) var(--ease, ease); }

/* presenter notes */
.viewer-notes { position: absolute; left: 0; right: 0; bottom: 0; z-index: 4; height: 248px; display: grid; grid-template-columns: 1fr 340px; gap: 0;
  background: rgba(14,16,20,0.96); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid rgba(255,255,255,0.12);
  animation: deck-rise var(--motion, 280ms) var(--ease, ease) both; }
.vn-main { padding: 20px 28px; min-width: 0; display: flex; flex-direction: column; }
.vn-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.vn-label { font-size: var(--fs-tag, 12px); font-weight: var(--fw-semibold, 600); text-transform: uppercase; letter-spacing: var(--tracking-tag, 0.06em); color: rgba(255,255,255,0.55); }
.vn-pos { font-size: var(--fs-body-sm, 14px); color: rgba(255,255,255,0.55); }
.vn-note { font-size: 20px; line-height: 1.6; color: rgba(255,255,255,0.94); overflow-y: auto; flex: 1; padding-right: 8px; }
.vn-empty { color: rgba(255,255,255,0.4); }
.vn-next { border-left: 1px solid rgba(255,255,255,0.12); padding: 20px 22px; display: flex; flex-direction: column; gap: 10px; }
.vn-next-label { font-size: var(--fs-tag, 12px); font-weight: var(--fw-semibold, 600); text-transform: uppercase; letter-spacing: var(--tracking-tag, 0.06em); color: rgba(255,255,255,0.55); }
.vn-next-frame { border-radius: 8px; overflow: hidden; border: 1px solid rgba(255,255,255,0.16); }
.vn-next-note { font-size: var(--fs-body-sm, 14px); line-height: 1.5; color: rgba(255,255,255,0.6); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }

/* overview grid */
.viewer-overview { position: absolute; inset: 0; z-index: 5; background: rgba(8,10,13,0.92); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  padding: 70px 56px 40px; overflow-y: auto; animation: deck-fade var(--motion-fast, 140ms) var(--ease, ease) both; }
.vo-head { display: flex; align-items: baseline; justify-content: space-between; color: rgba(255,255,255,0.9); font-size: var(--fs-display, 22px); font-weight: var(--fw-semibold, 600); margin-bottom: 22px; }
.vo-head .faint { color: rgba(255,255,255,0.5); font-size: var(--fs-body-sm, 14px); font-weight: 400; }
.vo-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.vo-cell { padding: 0; border: none; background: none; cursor: pointer; text-align: left; }
.vo-num { display: block; color: rgba(255,255,255,0.55); font-size: var(--fs-body-sm, 14px); margin-bottom: 7px; }
.vo-frame { border-radius: 8px; overflow: hidden; border: 2px solid transparent; box-shadow: 0 8px 24px -8px rgba(0,0,0,0.6); transition: border-color var(--motion-fast, 140ms) var(--ease, ease), transform var(--motion-fast, 140ms) var(--ease, ease); }
.vo-cell:hover .vo-frame { border-color: rgba(255,255,255,0.4); transform: translateY(-2px); }
.vo-cell.is-current .vo-frame { border-color: var(--brand-primary); }
@media (max-width: 900px) { .vo-grid { grid-template-columns: repeat(2, 1fr); } }

/* Touch / coarse-pointer: ≥44px tap targets, safe-area insets for iOS. The
   side hit-zones stay generous; a centre tap now wakes the chrome (slide-stage
   binds wake to touchstart), and a horizontal swipe navigates. */
@media (pointer: coarse) {
  .vt-btn { width: 44px; height: 44px; }
  .vt-btn svg { width: 18px; height: 18px; }
  .vt-exit { height: 44px; padding: 0 18px; }
  .vbtn { width: 44px; height: 44px; }
  .vbtn svg { width: 20px; height: 20px; }
  .viewer-top { padding-top: calc(14px + env(safe-area-inset-top, 0px)); }
  .viewer-ctl { bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
}

/* Short landscape (phones held sideways for live viewing): drop the heavy
   presenter notes panel so the slide keeps the viewport. */
@media (orientation: landscape) and (max-height: 480px) {
  .viewer.has-notes .viewer-stage { padding-bottom: 0; }
  .viewer-notes { display: none; }
}
