/* ── Tour mode (screen time-lapse + narration) — Record page ── */

.tour-banner {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin: var(--space-2) auto var(--space-1);
    padding: 8px 12px;
    max-width: 640px;
    border: 1px solid var(--color-border);
    border-left: 3px solid var(--color-primary);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    line-height: 1.35;
}
.tour-banner-step {
    flex: 0 0 auto;
    font-weight: 700;
    color: var(--color-primary);
    white-space: nowrap;
}
.tour-banner-text { flex: 1 1 auto; }
.tour-banner-btn { flex: 0 0 auto; }
.recording-active .tour-banner { display: none; }

/* Overlay covers the record area (#segment-recorder-main gets .tour-overlay-host while mounted) */
.tour-overlay-host { position: relative; }
.tour-overlay {
    position: absolute;
    inset: 0;
    z-index: 30;
    display: flex;
    flex-direction: column;
    background: #0b0b12;
    color: #fff;
    padding: 10px;
    gap: 8px;
    box-sizing: border-box;
}
.tour-overlay-title {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.02em;
    opacity: 0.85;
    flex: 0 0 auto;
}
.tour-stage {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    background: #000;
    border-radius: 6px;
    overflow: hidden;
}
.tour-stage .tour-screen {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
    transform: none;
}
.tour-stage .tour-head {
    position: absolute;
    right: 4.5%;
    bottom: 4.5%;
    width: 24%;
    aspect-ratio: 1 / 1;
    height: auto;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
    background: #222;
    transform: none;
}
.tour-clock {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.04em;
    pointer-events: none;
}
.tour-badge {
    position: absolute;
    left: 8px;
    bottom: 8px;
    padding: 4px 10px;
    border-radius: 6px;
    background: rgba(99, 102, 241, 0.9);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    pointer-events: none;
    white-space: nowrap;
}
.tour-badge:empty { display: none; }

.tour-scrub {
    flex: 0 0 auto;
    padding: 6px 8px 2px;
    user-select: none;
}
.tour-scrub-track {
    position: relative;
    height: 22px;
    border-radius: 6px;
    background: #2a2a3a;
    cursor: pointer;
    touch-action: none;
}
.tour-scrub-dim {
    position: absolute;
    top: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.55);
    pointer-events: none;
}
.tour-scrub-dim.left { left: 0; border-radius: 6px 0 0 6px; }
.tour-scrub-dim.right { right: 0; border-radius: 0 6px 6px 0; }
.tour-scrub-range {
    position: absolute;
    top: 0;
    bottom: 0;
    background: rgba(99, 102, 241, 0.45);
    pointer-events: none;
}
.tour-scrub-playhead {
    position: absolute;
    top: -3px;
    bottom: -3px;
    width: 2px;
    margin-left: -1px;
    background: #fff;
    pointer-events: none;
}
.tour-handle {
    position: absolute;
    top: -6px;
    bottom: -6px;
    width: 18px;
    margin-left: -9px;
    border-radius: 4px;
    background: var(--color-primary);
    cursor: ew-resize;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}
.tour-handle span {
    width: 2px;
    height: 10px;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 1px;
}
.tour-readout {
    flex: 0 0 auto;
    font-size: 12px;
    opacity: 0.8;
    text-align: center;
    min-height: 15px;
}
.tour-actions {
    flex: 0 0 auto;
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}
.tour-hint {
    flex: 0 0 auto;
    font-size: 11px;
    opacity: 0.6;
    text-align: center;
}
.tour-btn {
    padding: 7px 14px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}
.tour-btn:hover { background: rgba(255, 255, 255, 0.16); }
.tour-btn.primary {
    background: var(--color-primary);
    border-color: var(--color-primary);
}
.tour-btn.primary:hover { filter: brightness(1.1); }
.tour-btn.secondary { opacity: 0.85; }
.tour-banner .tour-btn.primary { color: #fff; }

/* Portrait viewports are narrow — tighten */
.recorder-viewport:not(.movie-mode):not(.square-mode) .tour-overlay { padding: 8px; }
.recorder-viewport:not(.movie-mode):not(.square-mode) .tour-btn { padding: 6px 10px; font-size: 12px; }

/* Capture step: the walkthrough is talked through freely — no teleprompter, no pace meter */
.recorder.tour-capture .recorder-teleprompter,
.recorder.tour-capture .recorder-pace-meter { display: none !important; }

/* Wide (landscape) overlays: keep the stage a sensible size and centre the controls */
.tour-overlay .tour-stage { max-width: 1100px; width: 100%; margin: 0 auto; }
.tour-overlay .tour-scrub, .tour-overlay .tour-readout, .tour-overlay .tour-actions, .tour-overlay .tour-hint { max-width: 1100px; width: 100%; margin-left: auto; margin-right: auto; box-sizing: border-box; }

.tour-handle.dragging { background: #fff; }
.tour-handle.dragging span { background: var(--color-primary); }
/* Detected activity window: ticks with labels above the track */
.tour-scrub-activity {
    position: absolute;
    top: -14px;
    bottom: -4px;
    width: 2px;
    margin-left: -1px;
    background: #3fd37a;
    pointer-events: none;
    z-index: 1;
}
.tour-scrub-activity span {
    position: absolute;
    top: -14px;
    left: 4px;
    font-size: 10px;
    line-height: 12px;
    color: #3fd37a;
    white-space: nowrap;
}
.tour-scrub-activity.end span { left: auto; right: 4px; }
.tour-scrub { padding-top: 30px; }
.tour-btn:disabled { opacity: 0.4; cursor: default; }
