/* ============================================================
   Guided tour — instrument-style status bar, focus ring, end card.
   Built from the app's own tokens so it reads as the product
   annotating itself, not an onboarding overlay. No dimming.
   ============================================================ */

.tour-bar {
    position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%) translateY(0);
    z-index: 100000; width: min(92vw, 560px);
    display: flex; flex-direction: column;
    background: var(--bg-card, #151b23);
    border: 1px solid var(--border-light, #30363d);
    border-radius: 12px; overflow: hidden;
    box-shadow: 0 16px 44px -14px rgba(0, 0, 0, .72);
    animation: tourBarIn .4s cubic-bezier(.2, 1, .4, 1) both;
    font-family: var(--font, "Segoe UI", system-ui, sans-serif);
}
@keyframes tourBarIn { from { opacity: 0; transform: translateX(-50%) translateY(16px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

.tour-bar-progress { height: 3px; background: rgba(255, 255, 255, .06); flex: none; }
.tour-bar-progress-fill { height: 100%; width: 0; background: var(--accent, #4a9eff); border-radius: 0 2px 2px 0; }

.tour-bar-row { display: flex; align-items: center; gap: 14px; padding: 11px 13px 12px 15px; }
.tour-bar-text { flex: 1; min-width: 0; }
.tour-bar-kicker {
    font-size: 10px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
    color: var(--text-faint, #6e7681); line-height: 1.1;
}
.tour-bar-caption {
    font-size: 13.5px; line-height: 1.42; color: var(--text, #e6edf3); margin-top: 3px;
    text-wrap: pretty;
}
.tour-bar.loading .tour-bar-caption { color: var(--text-muted, #8b98ab); animation: tourPulse 1.1s ease-in-out infinite; }
@keyframes tourPulse { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }

.tour-bar-step { font-size: 11px; color: var(--text-faint, #6e7681); font-variant-numeric: tabular-nums; white-space: nowrap; }

.tour-bar-controls { display: flex; align-items: center; gap: 6px; }
.tour-bar-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; padding: 0;
    background: transparent; border: 1px solid var(--border-light, #30363d); border-radius: 8px;
    color: var(--text-muted, #8b98ab); cursor: pointer; transition: all .16s ease;
}
.tour-bar-btn:hover { background: var(--bg-hover, rgba(255, 255, 255, .06)); color: var(--text-bright, #e6edf3); }
.tour-bar-btn:focus-visible { outline: 2px solid var(--accent, #4a9eff); outline-offset: 1px; }
.tour-bar-btn.stop:hover { color: var(--accent-red, #f85149); border-color: rgba(248, 81, 73, .5); }
.tour-bar-btn svg { width: 15px; height: 15px; display: block; }

/* while the tour picker is open, hide the empty-state's default prompt (icon + two
   text lines) so all the mission options have room without scrolling */
#empty-state.tour-picking > svg,
#empty-state.tour-picking > div:not(#tour-picker) { display: none; }

/* focus ring on the element the tour is acting on — a ring, never a mask */
.tour-focus {
    box-shadow: 0 0 0 2px var(--accent, #4a9eff), 0 0 0 7px rgba(74, 158, 255, .18) !important;
    border-radius: 8px; transition: box-shadow .22s ease; position: relative; z-index: 3;
}

/* end card — the bar's calmer, larger sibling */
.tour-endcard {
    position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%);
    z-index: 100000; width: min(92vw, 460px);
    background: var(--bg-card, #151b23); border: 1px solid var(--border-light, #30363d);
    border-radius: 14px; padding: 18px 20px 16px;
    box-shadow: 0 18px 50px -14px rgba(0, 0, 0, .74);
    animation: tourBarIn .4s cubic-bezier(.2, 1, .4, 1) both;
    font-family: var(--font, "Segoe UI", system-ui, sans-serif);
}
.tour-endcard-title { font-size: 16px; font-weight: 700; color: var(--text-bright, #e6edf3); margin: 0 0 10px; }
.tour-endcard-label { font-size: 10px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--text-faint, #6e7681); margin: 0 0 6px; }
.tour-endcard-list { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.tour-endcard-list li { font-size: 13px; color: var(--text-muted, #8b98ab); line-height: 1.4; display: flex; gap: 8px; align-items: flex-start; }
.tour-endcard-list li::before { content: ""; flex: none; width: 6px; height: 6px; margin-top: 6px; border-radius: 50%; background: var(--accent, #4a9eff); opacity: .8; }
.tour-endcard-next {
    font-size: 12.5px; color: var(--text-faint, #6e7681); margin: 0 0 14px;
    padding: 8px 10px; border-radius: 8px; border: 1px dashed var(--border-light, #30363d);
    display: flex; align-items: center; gap: 8px;
}
.tour-endcard-next::before { content: ""; flex: none; width: 0; height: 0; border-left: 6px solid var(--accent, #4a9eff); border-top: 4px solid transparent; border-bottom: 4px solid transparent; }
.tour-endcard-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tour-endcard-btn {
    flex: 1 1 auto; text-align: center; padding: 9px 14px; border-radius: 8px; cursor: pointer;
    font-size: 13px; font-weight: 600; text-decoration: none; transition: all .16s ease;
    border: 1px solid var(--border-light, #30363d); background: transparent; color: var(--text, #e6edf3);
}
.tour-endcard-btn:hover { background: var(--bg-hover, rgba(255, 255, 255, .06)); }
.tour-endcard-btn.primary { background: var(--accent, #4a9eff); border-color: var(--accent, #4a9eff); color: #0a0e15; }
.tour-endcard-btn.primary:hover { filter: brightness(1.08); background: var(--accent, #4a9eff); }
.tour-endcard-dismiss { flex: 0 0 100%; text-align: center; margin-top: 10px; background: none; border: none; color: var(--text-faint, #6e7681); font-size: 12px; cursor: pointer; }
.tour-endcard-dismiss:hover { color: var(--text-muted, #8b98ab); }

/* ---- Paid-preview treatment: dashed = sample, solid = real data ---- */
.forecast-day-sample { position: relative; border: 1px dashed var(--border-light, #30363d) !important; }
.tour-sample-tag {
    position: absolute; top: 6px; right: 6px; z-index: 2;
    font-size: 9px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
    padding: 2px 6px; border-radius: 5px;
    background: rgba(74, 158, 255, .14); color: var(--accent, #4a9eff);
    border: 1px solid rgba(74, 158, 255, .32); white-space: nowrap;
}
.tour-sample-tag.tier-specialist {
    background: rgba(210, 153, 34, .14); color: var(--accent-orange, #d29922); border-color: rgba(210, 153, 34, .34);
}

/* bar preview state — a tier chip before the kicker */
.tour-bar-tier {
    display: inline-block; font-size: 9px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
    padding: 2px 6px; border-radius: 5px; margin-right: 8px;
    background: rgba(74, 158, 255, .16); color: var(--accent, #4a9eff); border: 1px solid rgba(74, 158, 255, .34);
}
.tour-bar-tier.tier-specialist {
    background: rgba(210, 153, 34, .16); color: var(--accent-orange, #d29922); border-color: rgba(210, 153, 34, .34);
}
.tour-bar.preview .tour-bar-kicker { display: inline-flex; align-items: center; }

/* ---- Sentence-level annotation highlight (highlighter underline, no dimming) ---- */
.tour-annotate {
    background: linear-gradient(transparent 58%, rgba(74, 158, 255, .26) 58%);
    box-shadow: inset 0 -2px 0 var(--accent, #4a9eff);
    border-radius: 2px; padding: 0 1px;
    transition: background .4s ease, box-shadow .4s ease;
}

/* ---- Sample overlays for genuinely-locked features (labelled + dated) ---- */
.tour-sample-overlay {
    position: absolute; z-index: 1200;
    left: 50%; top: 50%; transform: translate(-50%, -50%);
    width: min(88%, 360px); max-height: 84%;
    background: var(--bg-card, #151b23); border: 1px dashed var(--border-light, #30363d);
    border-radius: 12px; box-shadow: 0 18px 50px -14px rgba(0, 0, 0, .72);
    overflow: hidden; animation: annoIn .3s ease both;
}
/* floating labelled aside — a sample fragment about ANOTHER species/feature, never over real data */
.tour-sample-aside {
    position: fixed; top: 72px; left: 50%; transform: translateX(-50%); z-index: 100001;
    width: min(90vw, 380px);
    background: var(--bg-card, #151b23); border: 1px dashed var(--border-light, #30363d);
    border-radius: 12px; box-shadow: 0 18px 50px -14px rgba(0, 0, 0, .72); overflow: hidden;
    animation: annoIn .3s ease both;
}
.tour-sample-inner { display: flex; flex-direction: column; }
.tour-sample-aerial { width: 100%; height: auto; display: block; }
.tour-sample-excerpt { padding: 14px 16px 4px; font-size: 13px; line-height: 1.5; color: var(--text, #e6edf3); }
.tour-sample-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; border-top: 1px solid var(--border, #21262d); }
.tour-sample-src { font-size: 10px; color: var(--text-faint, #6e7681); text-align: right; }
.tour-sample-cta { margin: 4px 14px 14px; padding: 8px 12px; border-radius: 8px; border: none; background: var(--accent, #4a9eff); color: #0a0e15; font-size: 12px; font-weight: 600; cursor: pointer; }
.tour-sample-cta:hover { filter: brightness(1.08); }

/* ---- Synthesis card body (R4 capstone close) ---- */
.tour-synthesis { width: min(92vw, 480px); }
.tour-synthesis-body { font-size: 14px; line-height: 1.55; color: var(--text, #e6edf3); margin: 0 0 16px; text-wrap: pretty; }

@media (max-width: 480px) {
    .tour-bar, .tour-endcard { bottom: 12px; }
    .tour-bar-caption { font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
    .tour-annotate { transition: none; }
    .tour-sample-overlay { animation: none; }
}

@media (prefers-reduced-motion: reduce) {
    .tour-bar, .tour-endcard { animation: none; }
    .tour-bar.loading .tour-bar-caption { animation: none; opacity: .8; }
    .tour-focus { transition: none; }
}
