/* ==========================================================================
   Mobile Doc Viewer — full-screen PDF + audio scrubber for Library docs +
   Briefings.
   ========================================================================== */

@media (max-width: 767px) {
  body.mdv-no-scroll { overflow: hidden; }

  .mdv-overlay {
    position: fixed;
    inset: 0;
    background: #0a2e2e;
    z-index: 11500;          /* above tab-bar (11000); below drawer (12000) */
    display: flex;
    flex-direction: column;
  }

  .mdv-shell {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
  }

  .mdv-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: calc(env(safe-area-inset-top, 0px) + 8px) 12px 8px;
    background: #0f3636;
    border-bottom: 1px solid #1a5252;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }

  .mdv-close {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: #e0e0e8;
    cursor: pointer;
    border-radius: 22px;
    -webkit-tap-highlight-color: transparent;
    flex-shrink: 0;
  }
  .mdv-close:active { background: rgba(255, 255, 255, 0.08); }

  .mdv-header-titles {
    flex: 1;
    min-width: 0;
  }

  .mdv-header-cat {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #f0c270;
    margin-bottom: 2px;
  }

  .mdv-header-title {
    margin: 0;
    font-family: "Playfair Display", Georgia, serif;
    font-size: 16px;
    font-weight: 700;
    color: #e0e0e8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mdv-mode-toggle {
    display: inline-flex;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid #1a5252;
    border-radius: 22px;
    padding: 2px;
    flex-shrink: 0;
  }

  .mdv-mode-btn {
    appearance: none;
    background: transparent;
    border: none;
    color: #a8b0b8;
    font-size: 12px;
    font-weight: 600;
    padding: 8px 12px;
    min-height: 36px;
    border-radius: 20px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .mdv-mode-btn-active {
    background: #6DD4D4;
    color: #0a2e2e;
  }

  .mdv-mode-spacer {
    width: 8px;
    flex-shrink: 0;
  }

  .mdv-frame {
    flex: 1;
    width: 100%;
    border: 0;
    background: #fff; /* PDF host expects light backdrop */
  }

  /* ── Audio scrubber bar (Listen / Bio-State-3 echo) ── */
  .mdv-audio-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px calc(env(safe-area-inset-bottom, 0px) + 10px);
    background: #0f3636;
    border-top: 1px solid #1a5252;
    color: #e0e0e8;
  }

  .mdv-play {
    width: 44px;
    height: 44px;
    border-radius: 22px;
    border: none;
    background: #6DD4D4;
    color: #0a2e2e;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    flex-shrink: 0;
  }

  .mdv-play:active { transform: scale(0.96); }

  .mdv-time {
    font-feature-settings: "tnum";
    font-variant-numeric: tabular-nums;
    font-size: 12px;
    color: #a8b0b8;
    min-width: 36px;
    text-align: center;
  }

  .mdv-scrub {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    height: 28px;
  }

  .mdv-scrub::-webkit-slider-runnable-track {
    height: 4px;
    background: linear-gradient(to right, #6DD4D4 0%, #6DD4D4 var(--pct, 0%), #1a5252 var(--pct, 0%), #1a5252 100%);
    border-radius: 2px;
  }

  .mdv-scrub::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 12px;
    background: #fff;
    border: 2px solid #6DD4D4;
    margin-top: -10px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  }

  .mdv-scrub::-moz-range-track {
    height: 4px;
    background: #1a5252;
    border-radius: 2px;
  }

  .mdv-scrub::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 12px;
    background: #fff;
    border: 2px solid #6DD4D4;
  }
}
