/* zip-player.css — ZIP player.
 * Two modes: fullscreen (direct child of <body>, position:fixed) and inline
 * (mounted inside a canvas column, position:relative card). Blocking event
 * overlays are appended to <body> regardless of mode so they cover the page.
 * Direct child of <body> in fullscreen per CLAUDE.md §10.
 */

.zip-player {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: #0a0a14;
  color: rgba(255, 255, 255, 0.92);
  font-family: 'DM Sans', system-ui, sans-serif;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(0);
  transition: transform 280ms cubic-bezier(0.4, 0, 0.2, 1);
}
.zip-player.zp-minimized {
  transform: translateY(100%);
  pointer-events: none;
}

/* ── Modal mode (centered floating card over the column) ──
 * Backdrop is a sibling element with class .zip-player-backdrop appended
 * to body. The player itself is position:fixed, centered, sized to the
 * column. Click on backdrop closes. Expand promotes to fullscreen via
 * class swap on the same element (no reparent). */
.zip-player-backdrop {
  position: fixed;
  inset: 0;
  z-index: 8990;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease-out;
}
.zip-player-backdrop.zp-visible {
  opacity: 1;
  pointer-events: auto;
}

.zip-player--modal {
  position: fixed;
  inset: auto;  /* MUST precede top/left — inset is shorthand and overwrites them */
  top: 50%;
  left: 50%;
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 64px);
  height: auto;
  border-radius: 16px;
  overflow: hidden;
  z-index: 9000;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.96);
  transition: opacity 180ms ease-out, transform 180ms cubic-bezier(0.4, 0, 0.2, 1);
}
.zip-player--modal.zp-visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
/* Confine cover bg to the surface area in modal mode. */
.zip-player--modal .zp-bg-cover,
.zip-player--modal .zp-bg-tint {
  display: none;
}
.zip-player--modal .zp-surface {
  flex: none;
  height: 220px;
  background: #14141e;
  position: relative;
  overflow: hidden;
}
.zip-player--modal .zp-surface::before {
  content: '';
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-image: var(--zp-cover, none);
  filter: blur(40px) brightness(0.35);
  z-index: 0;
}
.zip-player--modal.zp-is-video .zp-surface {
  height: auto;
  /* Aspect ratio set dynamically from videoWidth/videoHeight (loadedmetadata).
   * Fallback is 16:9 until the real ratio lands. */
  aspect-ratio: var(--zp-video-aspect, 16 / 9);
  padding-bottom: 0;
}
.zip-player--modal.zp-is-video .zp-surface::before { display: none; }
.zip-player--modal.zp-is-video .zp-waveform { display: none; }
.zip-player--modal .zp-topbar { height: 36px; }
/* Modal mode shows expand button; minimize is fullscreen-only. */
.zip-player--modal [data-zp-minimize] { display: none; }
.zip-player [data-zp-expand] { display: none; }
.zip-player--modal [data-zp-expand],
.zip-player.zp-from-modal [data-zp-expand] { display: inline-flex; }

.zp-bg-cover {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  z-index: 0;
}
.zp-bg-cover--video { display: none; }

.zp-bg-tint {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    rgba(10, 10, 20, 0.4) 0%,
    rgba(10, 10, 20, 0.2) 30%,
    rgba(10, 10, 20, 0.6) 70%,
    rgba(10, 10, 20, 0.95) 100%);
  z-index: 1;
}

/* All foreground UI sits above bg layers. */
.zp-topbar,
.zp-surface,
.zp-echo-row,
.zp-transport,
.zp-progress,
.zp-chapter-strip,
.zp-tray,
.zp-error {
  position: relative;
  z-index: 2;
}

/* ── Top bar ── */
.zp-topbar {
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  flex-shrink: 0;
  transition: opacity 250ms ease;
}
.zp-title {
  flex: 1;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 12px;
  opacity: 0.9;
}

/* ── Surface (waveform / video) ── */
.zp-surface {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}
.zp-waveform {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  touch-action: manipulation;
}
.zp-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}
.zp-surface-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.zp-fallback-pulse {
  width: 60%;
  max-width: 280px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(123, 127, 196, 0.5) 0%,
    rgba(123, 127, 196, 0.1) 60%,
    transparent 100%);
  animation: zp-pulse 2.4s ease-in-out infinite;
}
@keyframes zp-pulse {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50%      { transform: scale(1.08); opacity: 1; }
}

/* ── Echo trigger (in transport row) ── */
.zp-echo-trigger {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 4px 8px;
  min-width: 40px;
}
.zp-echo-trigger-icon {
  font-size: 14px;
  line-height: 1;
  color: rgba(255, 255, 255, 0.9);
}
.zp-echo-trigger-count {
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  opacity: 0.7;
  letter-spacing: 0.04em;
  line-height: 1;
}
.zp-echo-trigger--empty .zp-echo-trigger-count { color: #c47f64; }

/* ── Echo sheet (modal) ── */
.zp-echo-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9050;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease-out;
}
.zp-echo-backdrop.zp-visible {
  opacity: 1;
  pointer-events: auto;
}
.zp-echo-sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%) translateY(100%);
  z-index: 9060;
  width: min(420px, 100vw);
  background: #14141e;
  color: rgba(255, 255, 255, 0.92);
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.5);
  padding: 20px 20px 28px;
  pointer-events: none;
  transition: transform 240ms cubic-bezier(0.4, 0, 0.2, 1);
  font-family: 'DM Sans', system-ui, sans-serif;
}
.zp-echo-sheet.zp-visible {
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
.zp-echo-sheet-header {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
}
.zp-echo-sheet-title {
  font-size: 15px;
  font-weight: 600;
  margin-right: 12px;
}
.zp-echo-sheet-allowance {
  flex: 1;
  font-size: 12px;
  opacity: 0.65;
  font-variant-numeric: tabular-nums;
}
.zp-echo-sheet-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
}
.zp-echo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.zp-echo-tile {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(123, 127, 196, 0.12);
  border: 1px solid rgba(123, 127, 196, 0.3);
  border-radius: 12px;
  padding: 14px 16px;
  cursor: pointer;
  font-family: inherit;
  color: rgba(255, 255, 255, 0.92);
  transition: background 120ms ease, transform 80ms ease;
}
.zp-echo-tile:hover { background: rgba(123, 127, 196, 0.22); }
.zp-echo-tile:active { transform: scale(0.96); }
.zp-echo-tile:disabled {
  opacity: 0.4;
  cursor: default;
  transform: none;
}
.zp-echo-tile-emoji {
  font-size: 22px;
  line-height: 1;
}
.zp-echo-tile-label {
  font-size: 14px;
}
.zp-echo-tile.zp-echo-flash { animation: zp-echo-pulse 220ms ease-out; }
@keyframes zp-echo-pulse {
  0%   { transform: scale(1);    filter: drop-shadow(0 0 0 rgba(196,127,100,0)); }
  40%  { transform: scale(1.06); filter: drop-shadow(0 0 8px rgba(196,127,100,0.7)); }
  100% { transform: scale(1);    filter: drop-shadow(0 0 0 rgba(196,127,100,0)); }
}

/* ── Transport ── */
/* Three-column layout: left bookend (transcript + speed), centered
 * transport (skip / play / skip), right bookend (echo + time). Each
 * outer column gets equal width so the play button stays exactly
 * centered regardless of how many secondary buttons each side has. */
.zp-transport {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 6px 16px 8px;
  flex-shrink: 0;
  gap: 8px;
}
.zp-transport-left {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-self: start;
}
.zp-transport-center {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-self: center;
}
.zp-transport-right {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-self: end;
}

/* Uniform sizing for all transport icon buttons (transcript, speed,
 * skip-back, skip-forward, echo trigger). The play button keeps its
 * own larger size. Echo trigger has stacked icon+count, so we still
 * give it the same outer dimensions. */
.zp-transport .zp-btn-icon {
  width: 48px;
  height: 36px;
  min-width: 48px;
  min-height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.zp-transport .zp-echo-trigger {
  flex-direction: column;
  gap: 0;
}
.zp-btn-icon {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.85);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  min-height: 32px;
}
.zp-btn-icon:disabled { opacity: 0.4; cursor: default; }
.zp-btn-play {
  background: #7B7FC4;
  border: none;
  color: #fff;
  font-size: 16px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.zp-btn-play:disabled { opacity: 0.5; cursor: default; }
.zp-time {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  opacity: 0.65;
}
.zp-speed {
  min-width: 36px;
}

/* ── Link-progress caption ──
 * Sits directly below the progress bar. Visible only when the episode
 * has at least one link event in its timeline (gated in JS). Reads
 * "X% listened — link unlocks at 80%" until threshold; then
 * "X% listened — link unlocked". */
.zp-link-progress {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  padding: 4px 16px 0;
  color: rgba(255, 255, 255, 0.6);
  flex-shrink: 0;
}
.zp-link-progress--unlocked {
  color: #7B7FC4;
}

/* ── Progress bar ──
 * Layered: a canvas underneath paints per-second coverage tints
 * (heard / skipped / unheard) so video viewers (no waveform) still see
 * how much they've actually watched. The fill div on top becomes a
 * thin moving playhead marker — anchored to the right edge of the
 * played span so you can see "you are here" against the coverage map. */
.zp-progress {
  height: 10px;
  background: rgba(255, 255, 255, 0.06);
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  overflow: hidden;
}
.zp-progress-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* ── Chapter strip ── */
.zp-chapter-strip {
  height: 36px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  overflow-x: auto;
  flex-shrink: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  scrollbar-width: none;
}
.zp-chapter-strip::-webkit-scrollbar { display: none; }
.zp-chapter-pill {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 999px;
  white-space: nowrap;
  cursor: pointer;
  font-family: inherit;
  flex-shrink: 0;
}
.zp-chapter-pill.active {
  background: #7B7FC4;
  color: #fff;
  border-color: #7B7FC4;
}

/* ── Tray ── */
.zp-tray {
  height: 80px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  position: relative;
  flex-shrink: 0;
}
.zp-tray-badge {
  position: absolute;
  top: 8px;
  left: 12px;
  z-index: 1;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(228, 174, 76, 0.8);
  color: #1a1409;
  font-weight: 600;
}
.zp-tray-cards {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  height: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.zp-tray-cards::-webkit-scrollbar { display: none; }

/* ── Error state ── */
.zp-error {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
}
.zp-error-close {
  position: absolute;
  top: 12px;
  right: 12px;
}
.zp-error-msg {
  font-size: 16px;
  margin-bottom: 8px;
}
.zp-error-detail {
  font-size: 12px;
  opacity: 0.5;
  font-family: ui-monospace, SFMono-Regular, monospace;
}

/* ── Transcript sheet ──
 * Bottom-anchored sheet that slides up over everything (player + backdrop).
 * Z-index sits between the player (9000) and event overlays (9100) so
 * interactive events still take precedence if they fire while the sheet
 * is open. Tap a segment to seek; the active segment auto-scrolls into
 * view unless the user has scrolled in the last 4s. */
.zp-transcript-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9050;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease-out;
}
.zp-transcript-backdrop.zp-visible {
  opacity: 1;
  pointer-events: auto;
}

.zp-transcript-sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%) translateY(100%);
  z-index: 9060;
  width: min(640px, 100vw);
  height: 70vh;
  max-height: 720px;
  background: #14141e;
  color: rgba(255, 255, 255, 0.92);
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 240ms cubic-bezier(0.4, 0, 0.2, 1);
  font-family: 'DM Sans', system-ui, sans-serif;
  pointer-events: none;
}
.zp-transcript-sheet.zp-visible {
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
.zp-transcript-header {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}
.zp-transcript-header-grip {
  width: 36px;
  height: 4px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 2px;
  margin: 0 auto;
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
}
.zp-transcript-title {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  opacity: 0.9;
}
.zp-transcript-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
}
.zp-transcript-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px 32px;
  -webkit-overflow-scrolling: touch;
}
.zp-transcript-body::-webkit-scrollbar { width: 4px; }
.zp-transcript-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
}
.zp-transcript-segment {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 1px solid transparent;
  color: rgba(255, 255, 255, 0.7);
  padding: 10px 12px;
  margin: 0 0 4px;
  border-radius: 8px;
  font-size: 15px;
  line-height: 1.45;
  font-family: inherit;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}
.zp-transcript-segment:hover {
  background: rgba(123, 127, 196, 0.08);
  color: rgba(255, 255, 255, 0.9);
}
.zp-transcript-segment.active {
  background: rgba(123, 127, 196, 0.22);
  border-color: rgba(123, 127, 196, 0.5);
  color: #fff;
}
.zp-transcript-state {
  text-align: center;
  padding: 40px 16px;
  opacity: 0.6;
  font-size: 14px;
}

/* Show transcript button only when episode has a transcript. */
.zip-player [data-zp-transcript] { display: none; }
.zip-player.zp-has-transcript [data-zp-transcript] { display: inline-flex; }

/* ── Event overlays ──
 * Blocking overlays are appended to <body> so they cover the page
 * regardless of whether the player is inline or fullscreen (option B —
 * the player stays put when an interactive event fires).
 * Corner overlays stay attached to the player root. */
.zp-overlay {
  font-family: 'DM Sans', system-ui, sans-serif;
  color: rgba(255, 255, 255, 0.92);
}
.zp-overlay--blocking {
  position: fixed;
  inset: 0;
  z-index: 9100;
  background: rgba(10, 10, 20, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.zp-overlay--corner {
  position: absolute;
  z-index: 5;
}
.zp-overlay--corner {
  bottom: 200px;
  right: 16px;
  width: 240px;
  background: rgba(20, 20, 32, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
}

.zp-overlay-card {
  width: 100%;
  max-width: 360px;
  background: rgba(20, 20, 32, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 20px;
}
.zp-overlay-question {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 14px;
  line-height: 1.4;
}
.zp-overlay-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}
.zp-overlay-option {
  background: rgba(123, 127, 196, 0.18);
  border: 1px solid rgba(123, 127, 196, 0.4);
  color: rgba(255, 255, 255, 0.92);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}
.zp-overlay-option:hover { background: rgba(123, 127, 196, 0.3); }
.zp-overlay-option.selected {
  background: #7B7FC4;
  border-color: #7B7FC4;
}
.zp-overlay-textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.92);
  padding: 10px;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  margin-bottom: 14px;
}
.zp-overlay-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.zp-overlay-skip,
.zp-overlay-submit {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: none;
  color: rgba(255, 255, 255, 0.7);
}
.zp-overlay-submit {
  background: #7B7FC4;
  border-color: #7B7FC4;
  color: #fff;
}

/* ── Slide overlays ── */
.zp-slide-pause {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.zp-slide-pause img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
}
.zp-slide-caption {
  font-size: 14px;
  margin-top: 12px;
  text-align: center;
  opacity: 0.8;
}
.zp-slide-hint {
  font-size: 12px;
  margin-top: 16px;
  opacity: 0.6;
  transition: opacity 600ms ease;
}
.zp-fade-out { opacity: 0 !important; }

/* Augment-mode slide (audio keeps playing). Big centered card, page-level. */
.zp-overlay--corner:has(.zp-slide-augment),
.zp-overlay--corner.zp-overlay--augment {
  position: fixed;
  inset: 0;
  bottom: auto;
  right: auto;
  width: auto;
  background: none;
  border: none;
  padding: 0;
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 9080;
}
.zp-slide-augment {
  position: relative;
  width: min(640px, calc(100vw - 32px));
  max-height: calc(100vh - 64px);
  padding: 16px;
  background: rgba(20, 20, 32, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.zp-slide-augment img {
  width: 100%;
  max-height: 60vh;
  object-fit: contain;
  border-radius: 8px;
  display: block;
}
.zp-slide-augment .zp-slide-caption {
  margin-top: 10px;
}
.zp-slide-augment-close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.55);
  border: none;
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 13px;
  z-index: 1;
}

.zp-slide-corner img {
  width: 100%;
  border-radius: 8px;
  display: block;
  margin-bottom: 8px;
}
.zp-slide-corner-close {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  color: #fff;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 12px;
}
.zp-slide-corner { position: relative; }

/* ── Link card ── */
.zp-link-card .zp-link-desc {
  font-size: 13px;
  opacity: 0.7;
  margin-bottom: 10px;
  line-height: 1.4;
}
.zp-link-card .zp-link-url {
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, monospace;
  color: rgba(123, 127, 196, 0.9);
  margin-bottom: 14px;
  word-break: break-all;
}

/* Save-to-Stash secondary action — sits between the URL and the
 * primary Visit / Maybe-later actions. Non-blocking: tapping saves
 * without closing the overlay. Four states via [data-state]. */
.zp-link-stash {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.85);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  margin-bottom: 14px;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}
.zp-link-stash:hover:not(:disabled) {
  background: rgba(123, 127, 196, 0.18);
  border-color: rgba(123, 127, 196, 0.5);
}
.zp-link-stash:disabled { cursor: default; }
.zp-link-stash[data-state="saving"] { opacity: 0.7; }
.zp-link-stash[data-state="saved"] {
  background: rgba(123, 127, 196, 0.22);
  border-color: rgba(123, 127, 196, 0.55);
  color: #fff;
  opacity: 0.95;
}
.zp-link-stash[data-state="failed"] {
  background: rgba(196, 98, 45, 0.12);
  border-color: rgba(196, 98, 45, 0.45);
  color: #f0b598;
}
.zp-link-stash-icon { font-size: 14px; line-height: 1; }
.zp-link-stash-label { font-weight: 500; }

/* ── Chapter toast ── */
.zp-chapter-toast {
  position: absolute;
  top: 48px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  background: rgba(20, 20, 32, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.92);
  font-size: 13px;
  padding: 8px 16px;
  border-radius: 999px;
  transition: opacity 600ms ease;
  pointer-events: none;
}

/* ── Tray cards ── */
.zp-tray-card {
  flex-shrink: 0;
  width: 120px;
  height: 72px;
  background: rgba(20, 20, 32, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  display: flex;
  overflow: hidden;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
  padding: 0;
  text-align: left;
  appearance: none;
  -webkit-appearance: none;
  transition: transform 100ms ease, border-color 100ms ease;
}
.zp-tray-card:hover { border-color: rgba(255, 255, 255, 0.18); }
.zp-tray-card:active { transform: scale(0.97); }
.zp-tray-state--missed,
.zp-tray-state--skipped {
  border-color: rgba(228, 174, 76, 0.45);
}
.zp-tray-card-strip {
  width: 4px;
  background: rgba(123, 127, 196, 0.6);
  flex-shrink: 0;
}
.zp-tray-card--poll          .zp-tray-card-strip,
.zp-tray-card--open_question .zp-tray-card-strip { background: #7B7FC4; }
.zp-tray-card--slide         .zp-tray-card-strip { background: #6FA4C7; }
.zp-tray-card--link          .zp-tray-card-strip { background: #C4622D; }
.zp-tray-state--missed       .zp-tray-card-strip,
.zp-tray-state--unmet        .zp-tray-card-strip { background: rgba(255, 255, 255, 0.2); }
.zp-tray-state--maybe_later  .zp-tray-card-strip { background: #C4622D; }

.zp-tray-card-body {
  flex: 1;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
}
.zp-tray-card-state {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.55;
}
.zp-tray-card-label {
  font-size: 11px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* ── View-only ── */
.zp-view-only-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.55;
  margin-bottom: 6px;
}
.zp-view-only-value {
  font-size: 14px;
  padding: 10px 14px;
  background: rgba(123, 127, 196, 0.18);
  border: 1px solid rgba(123, 127, 196, 0.4);
  border-radius: 8px;
  margin-bottom: 14px;
  word-break: break-word;
}
.zp-view-only-visited {
  color: rgba(196, 127, 100, 0.85);
}

/* ── Mini-player bar ── */
.zp-mini {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 8800; /* below the full-screen player; above page content */
  background: rgba(15, 15, 24, 0.96);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-family: 'DM Sans', system-ui, sans-serif;
  color: rgba(255, 255, 255, 0.9);
  transform: translateY(100%);
  transition: transform 280ms cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  cursor: pointer;
}
.zp-mini.zp-mini--visible {
  transform: translateY(0);
  pointer-events: auto;
}
.zp-mini-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  height: 54px;
}
.zp-mini-art {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 6px;
  background-size: cover;
  background-position: center;
  background-color: rgba(255, 255, 255, 0.06);
}
.zp-mini-title {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.zp-mini-btn {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: rgba(255, 255, 255, 0.85);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.zp-mini-play { background: #7B7FC4; color: #fff; }
.zp-mini-progress {
  height: 2px;
  background: rgba(255, 255, 255, 0.06);
}
.zp-mini-progress-fill {
  height: 100%;
  width: 0%;
  background: #7B7FC4;
}

/* ── Event banner (shown over the vault page while minimized) ── */
.zp-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 8900;
  background: rgba(123, 127, 196, 0.95);
  color: #fff;
  font-family: 'DM Sans', system-ui, sans-serif;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  animation: zp-banner-slide 240ms ease-out;
}
@keyframes zp-banner-slide {
  from { transform: translateY(-100%); }
  to   { transform: translateY(0); }
}
.zp-banner-text {
  font-size: 13px;
  flex: 1;
  font-weight: 500;
}
.zp-banner-tap {
  background: rgba(255, 255, 255, 0.18);
  border: none;
  color: #fff;
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
}
