/* Playback mode ========================================================== */

body.pb {
  background: #0c0d10;
  color: #e5e5e5;
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-rows: 1fr;
}
.pb-app {
  display: grid;
  grid-template-rows: 56px 1fr 64px;
  height: 100vh;
}

/* Topbar — dark variant for projection ================================= */
.pb-topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 0 20px;
  background: #14161a;
  border-bottom: 1px solid color-mix(in oklab, #fff, transparent 92%);
  color: #d6d6d6;
}
.pb-topbar .brand { color: #f0f0f0; }
.pb-topbar .brand-mark { background: var(--accent); color: white; }
.pb-topbar .brand-name { font-weight: 500; }
.pb-doc { display: flex; flex-direction: column; line-height: 1.2; }
.pb-doc strong { color: #f0f0f0; font-weight: 500; }
.pb-topbar-r { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.pb-topbar-r .btn-ghost { color: #cfcfcf; }
.pb-topbar-r .btn-ghost:hover { background: color-mix(in oklab, #fff, transparent 88%); color: white; }
.pb-divider { width: 1px; height: 16px; background: color-mix(in oklab, #fff, transparent 88%); margin: 0 4px; }

/* Stage ================================================================ */
.pb-stage {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  overflow: hidden;
}
.pb-deck {
  display: grid;
  place-items: center;
  padding: 16px;
  overflow: auto;
}
.pb-slide {
  /* Fit by height too: never taller than the stage, so nothing is clipped.
     152px = 56 topbar + 64 controls + 32 deck padding. */
  width: min(1600px, 100%, clamp(320px, (100vh - 152px) * 16 / 9, 1600px));
  aspect-ratio: 16 / 9;
  background: white;
  color: #111;
  border-radius: 12px;
  padding: 56px 64px;
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  gap: 18px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}
.pb-slide-head { display: flex; justify-content: space-between; font-size: 12px; color: #6b6b6b; letter-spacing: 0.08em; text-transform: uppercase; font-family: var(--font-mono); }
.pb-title { font-size: clamp(28px, 4vw, 48px); margin: 0; font-weight: 600; letter-spacing: -0.01em; }
.pb-rule { height: 1px; background: #e5e5e5; }
.pb-body p { margin: 0 0 14px; font-size: 18px; line-height: 1.55; }
.pb-body ul { padding-left: 24px; margin: 0 0 18px; }
.pb-body li { margin-bottom: 8px; font-size: 18px; line-height: 1.55; }
.pb-callout {
  background: #f0f5ff;
  border: 1px solid #c7dafa;
  border-radius: 8px;
  padding: 16px 20px;
  display: grid; gap: 4px;
}
.pb-callout strong { color: var(--accent); font-weight: 600; }

/* Notes drawer ========================================================== */
.pb-notes {
  position: absolute;
  top: 12px; right: 12px; bottom: 12px;
  width: 380px;
  background: #14161a;
  border: 1px solid color-mix(in oklab, #fff, transparent 92%);
  border-radius: 12px;
  padding: 18px 20px;
  overflow-y: auto;
  color: #d6d6d6;
}
.pb-notes .badge { background: color-mix(in oklab, var(--accent), transparent 70%); color: white; border-color: transparent; }
.pb-notes-head h3 { margin: 8px 0 12px; font-size: 18px; color: white; font-weight: 500; }
.pb-notes-body h4 { margin: 16px 0 6px; font-size: 12px; color: #cfcfcf; text-transform: uppercase; letter-spacing: 0.08em; }
.pb-notes-body p { font-size: 14px; line-height: 1.6; margin: 0 0 10px; color: #d6d6d6; }
.pb-notes-body ol, .pb-notes-body ul { padding-left: 20px; font-size: 14px; line-height: 1.7; }
.pb-notes-body blockquote {
  margin: 12px 0;
  padding: 10px 14px;
  border-left: 3px solid var(--accent);
  background: color-mix(in oklab, var(--accent), transparent 88%);
  border-radius: 4px;
  font-style: italic;
  font-size: 14px;
}

/* Thumbnail drawer ====================================================== */
.pb-jump {
  position: absolute;
  top: 12px; left: 12px; bottom: 12px;
  width: 420px;
  background: #14161a;
  border: 1px solid color-mix(in oklab, #fff, transparent 92%);
  border-radius: 12px;
  padding: 18px 20px;
  overflow-y: auto;
  color: #d6d6d6;
}
.pb-jump-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.pb-jump-head strong { color: white; font-weight: 500; font-size: 16px; }
.pb-jump-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.jt {
  display: grid;
  grid-template-rows: 64px auto auto;
  gap: 4px;
  padding: 6px;
  border: 1px solid color-mix(in oklab, #fff, transparent 90%);
  border-radius: 6px;
  background: #0c0d10;
  text-align: left;
  cursor: pointer;
  color: #cfcfcf;
}
.jt:hover { border-color: color-mix(in oklab, var(--accent), white 30%); }
.jt.is-active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.jt-canvas {
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 8px;
  background: white;
  border-radius: 4px;
  height: 64px;
}
.jt-bar { display: block; height: 4px; background: #d6d6d6; border-radius: 2px; width: 80%; }
.jt-bar.short { width: 50%; background: color-mix(in oklab, var(--accent), white 50%); }
.jt-num { font-family: var(--font-mono); font-size: 11px; color: #8a8a8a; }
.jt-title { font-size: 12px; color: #d6d6d6; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Bottom controls ======================================================= */
.pb-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  background: #14161a;
  border-top: 1px solid color-mix(in oklab, #fff, transparent 92%);
  color: #d6d6d6;
}
.pb-controls .btn-ghost { color: #cfcfcf; }
.pb-controls .btn-ghost:hover { background: color-mix(in oklab, #fff, transparent 88%); color: white; }
.pb-counter { font-family: var(--font-mono); font-size: 14px; }
.pb-counter strong { color: white; font-weight: 500; margin-right: 4px; }
.pb-progress {
  flex: 1;
  height: 4px;
  background: color-mix(in oklab, #fff, transparent 90%);
  border-radius: 999px;
  overflow: hidden;
}
.pb-progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 200ms var(--ease-standard);
}

@media (max-width: 920px) {
  .pb-notes, .pb-jump { width: 90vw; }
  .pb-slide { padding: 32px 28px; }
}

/* Fullscreen: hide chrome, slide fills the screen ======================= */
body.pb-fs .pb-app { display: block; height: 100vh; }
body.pb-fs .topnav, body.pb-fs .pb-controls { display: none; }
body.pb-fs .pb-stage { position: fixed; inset: 0; }
body.pb-fs .pb-deck { padding: 0; overflow: hidden; }
body.pb-fs .pb-slide {
  width: 100%;
  height: 100%;
  max-width: none;
  aspect-ratio: auto;
  border-radius: 0;
  box-shadow: none;
}
body.pb-fs .pb-slide-frame { border-radius: 0; }