/* mobile-story-scrub.css — Scrub popup overlay for Story Modal (S3, nhc).
 *
 * The scrub icon in the Mobile Control Panel opens a chapter-timeline overlay
 * that floats above the tab bar. Each chapter is a proportional segment
 * (width ∝ chapter duration or max cue.end); the current chapter is
 * highlighted; tapping any segment jumps to that chapter.
 *
 * Z-index stack (mobile):
 *   .mobile-tab-bar              11000
 *   .mobile-stop-talking         11001
 *   .story-scrub-overlay         11050  ← above tab bar + modals, below MST prompt
 *   .msp-root                    9000–9500
 *
 * Desktop (>=768px) never mounts this overlay. Scoped defensively regardless.
 */

@media (max-width: 767px) {

  .story-scrub-overlay {
    position: fixed;
    left: 0;
    right: 0;
    /* PRE-PAINT DEFAULT ONLY. Fallback corrected 56px → 48px to match the
       single source of truth (mobile.css:78 `--mobile-tab-bar-height: 48px`,
       since the 2026-05-14 bottom-panel tightening). The AUTHORITATIVE value
       is pinned JS-side at open time by PresentationPlayer.measureTransportClearance()
       (inline `bottom`) — the overlay floats above whatever transport is
       actually mounted (the scaffold's 140px State-2 band OR the standalone
       MobilePlayerController transport), which this static var cannot know.
       Root-cause fix for the 56→48px cascade-default desync flagged by the
       excavating-mobile-bookends SR (mobile-shell.js Cell P+R registry note). */
    bottom: calc(var(--mobile-tab-bar-height, 48px) + env(safe-area-inset-bottom, 0px));
    top: 0;
    z-index: 11050;
    background: rgba(0, 0, 0, 0.25);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0 10px 14px;
    opacity: 0;
    transition: opacity 160ms ease;
    pointer-events: none;
  }
  .story-scrub-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
  }

  .story-scrub-strip {
    width: 100%;
    max-width: 560px;
    display: flex;
    align-items: stretch;
    gap: 4px;
    padding: 8px;
    background: rgba(18, 18, 22, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.55);
    transform: translateY(12px);
    transition: transform 200ms cubic-bezier(0.2, 0.7, 0.3, 1);
    min-height: 62px;
  }
  .story-scrub-overlay.is-open .story-scrub-strip {
    transform: translateY(0);
  }

  .story-scrub-segment {
    /* flex-grow is set inline per-segment (∝ duration). flex-basis: 0 lets
       growth dominate so short chapters don't stretch past their proportion. */
    flex: 1 1 0;
    min-width: 38px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 6px 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.78);
    font: inherit;
    cursor: pointer;
    overflow: hidden;
    transition: background 140ms ease, border-color 140ms ease;
  }
  .story-scrub-segment:active {
    transform: scale(0.97);
  }
  .story-scrub-segment.is-current {
    background: rgba(255, 204, 0, 0.18);
    border-color: rgba(255, 204, 0, 0.7);
    color: #ffcc00;
  }
  .story-scrub-segment.is-current .story-scrub-num {
    background: #ffcc00;
    color: #1a1a1f;
  }

  .story-scrub-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    flex-shrink: 0;
  }

  .story-scrub-title {
    font-size: 10px;
    line-height: 1.15;
    text-align: center;
    max-width: 100%;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    opacity: 0.85;
  }

  /* When the popup is open, the tab bar's scrub slot stays lit so the user can
     see the dismiss affordance (tap the same slot to close). Consumer toggles
     a body class if future visual state is needed; for now the popup handles
     its own outside-tap dismissal. */

}
