/* ============================================================
   LIVE TOUR VIEW — Brand-Redesign (Discover-DNA, OFFENES Konzept)
   Karte = full-bleed Star. Alles schwebt offen darüber.
   - Top: Stopp-Zähler · Mute · Tour beenden, darunter Turn-by-Turn-Card
   - Unten: Untertitel + Audio-Wave (offen auf Scrim) + Kamera·Mic·Tastatur
   ============================================================ */

/* Unterer Scrim: macht Untertitel + Controls über bewegter Karte lesbar.
   Dezenter als zuvor — Karte soll durchscheinen. */
.tour-bottom-scrim {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 250px;
    z-index: 1000;
    pointer-events: none;
    background: linear-gradient(
        to top,
        rgba(8, 9, 15, 0.78) 0%,
        rgba(8, 9, 15, 0.42) 45%,
        rgba(8, 9, 15, 0) 100%
    );
}

/* Oberer Scrim: macht Top-Bar + Turn-Card lesbar, reicht bis ganz an den
   Bildschirmrand (deckt Notch/Statusbar mit ab). */
.tour-top-scrim {
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    height: calc(env(safe-area-inset-top, 0px) + 170px);
    z-index: 1000;
    pointer-events: none;
    background: linear-gradient(
        to bottom,
        rgba(8, 9, 15, 0.80) 0%,
        rgba(8, 9, 15, 0.45) 45%,
        rgba(8, 9, 15, 0) 100%
    );
}

/* ---- Top-Bar: Stopp-Zähler (links) · Mute + Tour beenden (rechts) ---- */
.tour-top-bar {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 12px);
    left: 12px;
    right: 12px;
    z-index: 1004;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    pointer-events: none;
}
.tour-top-bar > * { pointer-events: auto; }

.tour-stop-counter {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 13px;
    border-radius: 18px;
    background: rgba(10, 11, 18, 0.72);
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    border: 1px solid var(--dsc-bd);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.2px;
}
.tour-stop-counter svg { color: var(--brand-light); flex-shrink: 0; }

.tour-top-bar-right {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.tour-top-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 11, 18, 0.72);
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    border: 1px solid var(--dsc-bd);
    color: #fff;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.2s ease;
}
.tour-top-icon-btn:active { background: rgba(20, 22, 34, 0.85); }
/* Mute-Zustand: Lautsprecher-aus-Icon zeigen, Button dezent eingefärbt */
.tour-top-icon-btn .icon-sound-off { display: none; }
.tour-top-icon-btn.muted .icon-sound-on { display: none; }
.tour-top-icon-btn.muted .icon-sound-off { display: inline; }
.tour-top-icon-btn.muted { color: var(--dsc-mut); border-color: rgba(255, 255, 255, 0.10); }

.tour-top-end-btn {
    height: 36px;
    padding: 0 16px;
    border-radius: 18px;
    background: rgba(10, 11, 18, 0.72);
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    border: 1px solid var(--dsc-bd);
    color: rgba(255, 255, 255, 0.92);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.2s ease;
}
.tour-top-end-btn:active { background: rgba(20, 22, 34, 0.85); }

/* Upgrade-Pille im kostenlosen Modus „Nur Navigation" (dynamisch von
   tourAIGuide._ensureUpgradePill erzeugt, in der Guide-Session nie vorhanden).
   .ready = Kauf bestätigt, Label wechselt auf „AI-Guide starten". */
.tour-upgrade-pill {
    height: 36px;
    padding: 0 14px;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    background: rgba(10, 11, 18, 0.72);
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    border: 1px solid var(--dsc-bd);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: -0.1px;
    white-space: nowrap;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.2s ease;
}
.tour-upgrade-pill:active { background: rgba(20, 22, 34, 0.85); }
.tour-upgrade-pill.ready {
    background: linear-gradient(135deg, var(--brand-mid, #6B7FE8) 0%, #4F46E5 100%);
    border-color: transparent;
}

/* ---- Turn-by-Turn-Card (schwebend, unter der Top-Bar) ---- */
.tour-nav-panel {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 60px);
    left: 12px;
    right: 12px;
    background: rgba(10, 11, 18, 0.74);
    backdrop-filter: blur(22px) saturate(160%);
    -webkit-backdrop-filter: blur(22px) saturate(160%);
    padding: 12px 14px;
    z-index: 1003;
    border: 1px solid var(--dsc-bd);
    border-radius: 18px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

/* Aufgeklappt (Tap aufs Panel): langer Ziel-/Instruktionstext wird vollständig
   statt mit Ellipsis abgeschnitten. Prev/Next (.tour-nav-skip) triggern nicht. */
.tour-nav-panel.expanded .tour-nav-waypoint-name,
.tour-nav-panel.expanded .tour-nav-instructions {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
}

/* Kompakte Turn-by-Turn-Card: Manöver-Icon · Metrics+Ziel · Prev/Next */
.tour-nav-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Manöver-Icon: Periwinkle gefülltes Quadrat (Richtung) */
.tour-nav-maneuver {
    flex-shrink: 0;
    width: 46px;
    height: 46px;
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--brand-cta);
    color: #fff;
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.4);
}

.tour-nav-left {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Distanz · Dauer in einer Zeile */
.tour-nav-metrics {
    display: flex;
    align-items: baseline;
    gap: 6px;
    line-height: 1;
}
.tour-nav-distance {
    font-size: 19px;
    font-weight: 800;
    color: var(--brand-light);
    font-family: Verdana, -apple-system, sans-serif;
    letter-spacing: -0.3px;
}
.tour-nav-dot { color: var(--dsc-mut2); font-size: 13px; }
.tour-nav-duration {
    font-size: 13px;
    font-weight: 500;
    color: var(--dsc-mut);
}

.tour-nav-waypoint-name {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tour-nav-instructions {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--dsc-mut);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Prev/Next: kleine Ghost-Pfeile rechts */
.tour-nav-skip {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}
.tour-nav-skip .tour-panel-btn {
    width: 34px;
    height: 34px;
    border-radius: 10px;
}

@media (max-width: 768px) {
    .tour-nav-distance { font-size: 18px; }
    .tour-nav-waypoint-name { font-size: 14px; }
}

/* (Alte .tour-control-buttons / End+Chat-Zeile entfernt — End ist jetzt in der
   Top-Bar, Chat entfällt. Tastatur blendet die Eingabe inline ein.) */

/* ============================================================
   CONTINUE QUICK ACTION (Above Chat Bar)
   Eigene Klasse! .tour-quick-action-btn kollidiert mit modern.css
   (dort 32x32-Icon-Button für Tour-Karten) — deshalb -guide-continue-.
   Rechtsbündig in derselben Zeile wie End/Chat (bottom: 160px).
   ============================================================ */

.tour-quick-actions {
    position: fixed;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 78px + var(--tour-kb, 0px));
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 0 16%;
    z-index: 1002;
    pointer-events: none;
}

/* Dezente Pille: Periwinkle-Outline, Glas, kein dominanter Button */
.tour-guide-continue-btn {
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid rgba(107, 127, 232, 0.55);
    border-radius: 18px;
    background: rgba(10, 11, 18, 0.86);
    backdrop-filter: blur(16px) saturate(150%);
    -webkit-backdrop-filter: blur(16px) saturate(150%);
    color: var(--brand-light);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}

.tour-guide-continue-btn svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
}

.tour-guide-continue-btn:active {
    background: rgba(107, 127, 232, 0.18);
}

.tour-guide-continue-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* „Geschichte" ⇄ „Bild analysieren": Icon-Tausch je nach Modus.
   Default = Geschichte-Icon sichtbar, Bild-Icon versteckt. Mit .image-mode
   (gesetzt sobald ein Bild vorgemerkt ist) genau umgekehrt. */
#askHistoryBtn .ah-icon-image { display: none; }
#askHistoryBtn.image-mode .ah-icon-history { display: none; }
#askHistoryBtn.image-mode .ah-icon-image { display: inline-flex; }
/* Im Bild-Modus den Akzent betonen (gleiches Periwinkle, etwas kräftiger) */
#askHistoryBtn.image-mode {
    border-color: rgba(107, 127, 232, 0.85);
    background: rgba(107, 127, 232, 0.16);
}

/* ============================================================
   TOUR SUBTITLES
   Zeigt den gerade gesprochenen Satz synchron zur TTS-Wiedergabe.
   Sitzt wie Film-Untertitel unten-mittig über der Button-Zeile,
   pointer-events: none — Karte bleibt voll bedienbar.
   ============================================================ */

/* Offener Untertitel-Bereich: Audio-Wave + Satz, OHNE Box, auf dem Scrim.
   Sichtbar nur wenn der Guide spricht (.speaking). */
.tour-subtitle-wrap {
    position: fixed;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 152px + var(--tour-kb, 0px));
    left: 0;
    right: 0;
    margin: 0 auto;
    width: fit-content;
    max-width: min(560px, calc(100vw - 36px));
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    z-index: 1001;
    pointer-events: none;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.28s ease, transform 0.28s ease;
}
.tour-subtitle-wrap.speaking {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================================
   USER-TRANSCRIPT (Stufe A Voice-Feedback)
   Transkribierter Text wird typewriter-mäßig "geschrieben",
   sobald Whisper fertig ist (während das LLM bereits arbeitet).
   Gleiche Position wie der Guide-Untertitel, aber als "Dein
   Text" markiert: weiß statt Periwinkle + Mic-Icon davor.
   ============================================================ */
.tour-user-transcript {
    position: fixed;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 152px + var(--tour-kb, 0px));
    left: 0;
    right: 0;
    margin: 0 auto;
    width: fit-content;
    max-width: min(560px, calc(100vw - 36px));
    display: none;
    align-items: center;
    gap: 8px;
    z-index: 1001;
    pointer-events: none;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.24s ease, transform 0.24s ease;
}
.tour-user-transcript.visible {
    opacity: 1;
    transform: translateY(0);
}
.tour-user-transcript-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.9);
    opacity: 0.8;
    flex-shrink: 0;
}
.tour-user-transcript-text {
    color: rgba(255, 255, 255, 0.96);
    font-size: 15px;
    line-height: 1.4;
    text-align: center;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

/* Audio-Wave: symmetrische Equalizer-Balken um die Mitte, organisch variierende
   Amplituden — sieht aus wie eine echte Stimm-Wellenform. Animiert nur beim Sprechen. */
.tour-guide-wave {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    height: 22px;
}
.tour-guide-wave i {
    width: 3px;
    height: 22px;
    border-radius: 3px;
    background: var(--brand-light);
    transform: scaleY(0.22);
    transform-origin: center;
    opacity: 0.75;
}
.tour-subtitle-wrap.speaking .tour-guide-wave i {
    animation: tourGuideWave 1s ease-in-out infinite;
}
/* unterschiedliche Amplitude (--amp) + Phase pro Balken = lebendiges Profil */
.tour-guide-wave i:nth-child(1) { animation-delay: 0s;    --amp: 0.42; }
.tour-guide-wave i:nth-child(2) { animation-delay: 0.18s; --amp: 0.72; }
.tour-guide-wave i:nth-child(3) { animation-delay: 0.34s; --amp: 1;    }
.tour-guide-wave i:nth-child(4) { animation-delay: 0.10s; --amp: 0.85; }
.tour-guide-wave i:nth-child(5) { animation-delay: 0.42s; --amp: 1;    }
.tour-guide-wave i:nth-child(6) { animation-delay: 0.24s; --amp: 0.68; }
.tour-guide-wave i:nth-child(7) { animation-delay: 0.06s; --amp: 0.38; }
@keyframes tourGuideWave {
    0%, 100% { transform: scaleY(0.22); opacity: 0.7; }
    50%      { transform: scaleY(var(--amp, 1)); opacity: 1; }
}

/* Der gesprochene Satz: Netflix-artig, mit Karaoke-Sweep über die TTS-Dauer */
.tour-subtitles {
    position: relative;
    text-align: center;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.4;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
    color: #fff;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.75);
}
/* Karaoke (Wort für Wort): gesprochene Wörter weiß, kommende gedimmt.
   .spoken wird in showSubtitle proportional zur TTS-Dauer gesetzt. */
.tour-subtitles .kw {
    color: rgba(255, 255, 255, 0.32);
    transition: color 0.18s ease;
}
.tour-subtitles .kw.spoken {
    color: #fff;
}
@media (prefers-reduced-motion: reduce) {
    .tour-subtitles .kw { color: #fff; transition: none; }
}

@media (prefers-reduced-motion: reduce) {
    .tour-subtitle-wrap.speaking .tour-guide-wave i { animation: none; transform: scaleY(0.6); }
}

@media (max-width: 768px) {
    .tour-subtitles { font-size: 16px; }
}

/* ============================================================
   TOUR AI GUIDE CHAT BAR
   Simple chat input at bottom during navigation
   ============================================================ */

/* Standard: 3 runde Buttons zentriert (Kamera · großer Mic · Tastatur),
   transparent — der Scrim liefert die Lesbarkeit. */
.tour-chat-bar {
    position: fixed;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 10px + var(--tour-kb, 0px));
    left: 0;
    right: 0;
    padding: 0 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 26px;
    z-index: 1002;
    background: transparent;
}
/* Tippen-Modus: Eingabezeile (Textfeld + Kamera + Mic + Senden) statt 3 Buttons.
   POSITION: Visual-Viewport-Anchoring statt fragiler bottom:var(--tour-kb)-Rechnung.
   iOS Safari (untere Adressleiste) liefert window.innerHeight inkonsistent und schiebt
   fokussierte fixed/bottom-Elemente selbst hoch → Bar landete verdeckt hinter der
   Safari-Adressleiste. Lösung: top:0 verankert stur am Layout-Viewport-Nullpunkt,
   translateY(vv.offsetTop + vv.height − 100%) setzt die Unterkante exakt auf die
   sichtbare Viewport-Unterkante (= direkt über Accessory-Bar/Adressleiste). */
.tour-chat-bar.typing {
    top: 0;
    bottom: auto;
    transform: translateY(calc(var(--vv-top, 0px) + var(--app-vh, 100dvh) - 100%));
    will-change: transform;
    justify-content: flex-end;
    gap: 8px;
    padding: 10px 14px 12px;
    background: rgba(8, 9, 15, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--dsc-bd);
}

/* Aufmerksamkeits-Puls nach der ersten zu Ende gesprochenen Guide-Nachricht:
   Eingabefeld + Mikro pulsieren 3×, damit klar wird, dass man antworten kann.
   Klasse wird von tourAIGuide.maybePulseChatBar() gesetzt und wieder entfernt. */
@keyframes chatInputAttentionPulse {
    0%, 100% {
        border-color: rgba(255, 255, 255, 0.1);
        box-shadow: 0 0 0 0 rgba(79, 70, 229, 0);
    }
    50% {
        border-color: rgba(107, 127, 232, 0.9);
        box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.3), 0 0 16px rgba(79, 70, 229, 0.4);
    }
}

/* .tour-icon-btn hat border:none — beim Mikro nur Glow, keine Border */
@keyframes chatMicAttentionPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(79, 70, 229, 0);
    }
    50% {
        box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.35), 0 0 14px rgba(79, 70, 229, 0.45);
    }
}

.tour-chat-bar.chat-bar-attention .tour-message-input {
    animation: chatInputAttentionPulse 1.6s ease-in-out 3;
}

.tour-chat-bar.chat-bar-attention .tour-mic-btn {
    animation: chatMicAttentionPulse 1.6s ease-in-out 3;
}

@media (prefers-reduced-motion: reduce) {
    .tour-chat-bar.chat-bar-attention .tour-message-input,
    .tour-chat-bar.chat-bar-attention .tour-mic-btn {
        animation: none;
        box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.3);
    }
}

/* Textfeld: nur im Tippen-Modus sichtbar */
.tour-message-input {
    order: 1;
    display: none;
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--dsc-bd);
    border-radius: 18px;
    padding: 11px 16px;
    color: white;
    font-size: 16px; /* P2: ≥16px verhindert iOS-Safari Auto-Zoom beim Fokus */
    resize: none;
    max-height: 100px;
    overflow-y: auto;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.tour-chat-bar.typing .tour-message-input { display: block; }

.tour-message-input::placeholder {
    color: rgba(255, 255, 255, 0.38);
}

.tour-message-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--brand-mid);
    box-shadow: 0 0 0 3px rgba(107, 127, 232, 0.18);
}

/* Runde Glas-Buttons */
.tour-icon-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 1px solid var(--dsc-bd);
    background: rgba(10, 11, 18, 0.72);
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.2s ease;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}
.tour-icon-btn:active { transform: scale(0.93); }

/* Button-Reihenfolge: Textfeld(1) · Kamera(2) · Mic(3) · Tastatur(4) · Senden(5) */
.tour-camera-btn { order: 2; }
.tour-mic-btn { order: 3; }
.tour-keyboard-btn { order: 4; }
.tour-send-btn { order: 5; display: none; }

/* Großer Mic-Button = Hero, Brand-CTA */
.tour-mic-btn {
    width: 66px;
    height: 66px;
    background: var(--brand-cta);
    border: none;
    color: #fff;
    box-shadow: 0 6px 18px rgba(79, 70, 229, 0.34);
}
.tour-mic-btn.recording {
    background: linear-gradient(135deg, #FF6B6B 0%, #ff3b30 100%);
    box-shadow: 0 8px 24px rgba(255, 59, 48, 0.5);
}

/* Tippen-Modus: alles auf Eingabezeilen-Größe, Tastatur weicht, Senden erscheint */
.tour-chat-bar.typing .tour-icon-btn { width: 42px; height: 42px; }
.tour-chat-bar.typing .tour-mic-btn { box-shadow: none; }
.tour-chat-bar.typing .tour-keyboard-btn { display: none; }
.tour-chat-bar.typing .tour-send-btn { display: flex; }

/* Tour Image Preview */
.tour-image-preview {
    position: absolute;
    bottom: 60px;
    left: 12px;
    width: 56px;
    height: 56px;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeInUp 0.2s ease;
    z-index: 10;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tour-image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tour-remove-image-btn {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.tour-remove-image-btn:hover {
    background: rgba(255, 59, 48, 0.9);
}

.tour-send-btn {
    background: var(--brand-cta);
}

.tour-send-btn:hover {
    background: var(--brand-cta);
}

/* Messages Container (Optional Overlay) */
.tour-messages-container {
    position: fixed;
    bottom: 180px; /* Above chat bar and control buttons */
    left: 10px;
    right: 10px;
    max-height: 300px;
    background: linear-gradient(180deg, rgba(10, 10, 12, 0.98) 0%, rgba(0, 0, 0, 0.95) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 12px;
    overflow-y: auto;
    z-index: 1000;
}

.tour-messages-container::-webkit-scrollbar {
    width: 6px;
}

.tour-messages-container::-webkit-scrollbar-track {
    background: transparent;
}

.tour-messages-container::-webkit-scrollbar-thumb {
    background: rgba(107, 127, 232, 0.3);
    border-radius: 3px;
}

.tour-messages-container::-webkit-scrollbar-thumb:hover {
    background: rgba(107, 127, 232, 0.5);
}

.message {
    margin-bottom: 12px;
    animation: tourChatFadeIn 0.3s;
}

@keyframes tourChatFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.user-message {
    text-align: right;
}

.ai-message {
    text-align: left;
}

.message-content {
    display: inline-block;
    padding: 10px 14px;
    border-radius: 16px;
    max-width: 80%;
    word-wrap: break-word;
}

.user-message .message-content {
    background: var(--brand-cta);
    color: white;
}

.ai-message .message-content {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* („Ton anmachen"-Toast .sound-reminder entfernt — Hinweis lebt jetzt im
   Tour-Start-Banner, siehe .tour-start-* unten.) */

/* ============================================================
   TOUR-START-LOCK + PHASEN-BANNER (Spec TOURSTART)
   Während des Kaltstarts (show → erste Audio-Subtitle) ALLE Eingaben
   sperren. EIGENE Klasse .tour-starting (NICHT recording-mode): letztere
   blendet den Mülleimer ein und lässt den Mic offen — beides hier falsch.
   .tour-starting dimmt + blockt die gesamte Eingabefläche (Mic, Kamera,
   Tastatur, Senden, Text, Weiter/Geschichte) via pointer-events:none —
   kein Layout-Sprung, kein Aufnahme-Mülleimer. Gleiche Applikator-Stelle
   wie recording-mode (updateActionButtons) → eine SSOT.
   ============================================================ */
.tour-chat-bar.tour-starting,
.tour-chat-input-area.tour-starting,
.tour-quick-actions.tour-starting {
    opacity: 0.45;
    pointer-events: none;
}

/* Button-Send-Lock (Spec TOURSTART / Fix 2+3): während die Antwort auf einen
   Aktions-Button (Weiter/Geschichte/Bild) noch nicht hörbar ist, NUR die Quick-
   Actions sperren. Mic/Text/Senden (in .tour-chat-bar) bleiben bewusst frei —
   Unterbrechen per Stimme/Text ist erlaubt. Reiner Button-Lock, kein Layout-Sprung.
   Entsperrt via updateActionButtons, sobald der Guide hörbar wird / bei Error/Timeout. */
.tour-quick-actions.reply-loading {
    opacity: 0.45;
    pointer-events: none;
}

/* Phasen-Banner im Untertitel-Bereich (#tourSubtitles) während des Starts. */
.tour-subtitles .tour-start-phase {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    opacity: 0.92;
}
.tour-subtitles .tour-start-phase .tour-start-spinner {
    width: 15px;
    height: 15px;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-top-color: var(--brand-mid, #6B7FE8);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex: 0 0 auto;
}
.tour-subtitles .tour-start-sound {
    margin-top: 4px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.62);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    /* (Früher: .tour-chat-bar { bottom: 60px } — Relikt für die alte Navbar, die
       im Tour-Modus ausgeblendet ist. Überschrieb die Hauptregel und ließ die
       Controls auf dem Handy zu hoch schweben. Entfernt — Hauptregel gilt jetzt.) */
    .tour-messages-container {
        bottom: 160px; /* Above chat bar + control buttons */
        left: 8px;
        right: 8px;
    }
}

/* ============================================================
   TOUR CHAT OVERLAY (Full Screen) - iOS App Style
   Shows all messages in a modal overlay
   ============================================================ */

.tour-chat-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    display: none;
}

.tour-chat-overlay.active {
    display: flex;
}

.tour-chat-overlay-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
}

.tour-chat-overlay-content {
    position: relative;
    margin: 60px 16px 100px 16px;
    background: linear-gradient(180deg, rgba(10, 10, 12, 0.98) 0%, rgba(0, 0, 0, 0.95) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header */
.tour-chat-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px;
    background: linear-gradient(180deg, rgba(10, 10, 12, 0.98) 0%, rgba(0, 0, 0, 0.95) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.tour-chat-header-left {
    flex: 1;
}

.tour-chat-title {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, #ffffff 0%, rgba(255, 255, 255, 0.85) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 4px;
}

.tour-chat-progress {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    gap: 8px;
}

.tour-chat-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tour-chat-quality-badge {
    padding: 6px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    font-weight: 500;
    cursor: default;
}

.tour-chat-close-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.2s;
}

.tour-chat-close-btn svg {
    width: 28px;
    height: 28px;
}

.tour-chat-close-btn:hover {
    color: white;
}

/* Messages */
.tour-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.tour-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.tour-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.tour-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(107, 127, 232, 0.3);
    border-radius: 3px;
}

.tour-chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(107, 127, 232, 0.5);
}

.tour-message-bubble {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 16px;
    word-wrap: break-word;
    animation: tourChatFadeIn 0.3s;
}

.tour-message-bubble.user {
    align-self: flex-end;
    background: var(--brand-cta);
    color: white;
}

.tour-message-bubble.ai {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* Input Area */
.tour-chat-input-area {
    padding: 12px 16px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.95) 0%, rgba(10, 10, 12, 0.98) 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ============================================================
   AUFNAHME-MODUS — modaler Lock während Sprachaufnahme
   (Spec _RECLOCK_SPEC). EINE deklarative Klasse (.recording-mode)
   auf beiden Composer-Containern + Quick-Actions, kann nicht
   "halb" hängen. Garantierte Ausgänge: Mic-Stop (Beenden/Senden)
   + Mülleimer (Verwerfen). Sperrt NUR während isRecording.
   ============================================================ */

/* Mülleimer-Button belegt den Kamera-Slot (gleiche Position/Größe,
   kein Layout-Sprung). Standard ausgeblendet, nur im Modus sichtbar. */
.tour-cancel-rec-btn {
    order: 2;
    display: none;
    background: rgba(60, 14, 18, 0.72);
    border: 1px solid rgba(255, 90, 90, 0.42);
    color: #ff8a85;
}

/* Inline-Composer (#tourChatBar) im Aufnahme-Modus:
   Kamera, Tastatur, Senden, Bild-Vorschau ausblenden. */
.tour-chat-bar.recording-mode .tour-camera-btn,
.tour-chat-bar.recording-mode .tour-keyboard-btn,
.tour-chat-bar.recording-mode .tour-send-btn,
.tour-chat-bar.recording-mode .tour-image-preview {
    display: none !important;
}
.tour-chat-bar.recording-mode .tour-cancel-rec-btn { display: flex; }

/* Quick-Actions (Weiter/Geschichte, nur inline) im Modus ausblenden. */
.tour-quick-actions.recording-mode { display: none !important; }

/* Overlay-Composer im Aufnahme-Modus: Kamera + Senden ausblenden
   (Overlay hat keinen Keyboard-/Preview-Slot). */
.tour-chat-input-area.recording-mode .tour-camera-btn,
.tour-chat-input-area.recording-mode .tour-send-btn {
    display: none !important;
}
.tour-chat-input-area.recording-mode .tour-cancel-rec-btn { display: flex; }

/* Textfeld optisch gedimmt (Inhalt bleibt erhalten, nur optisch). */
.tour-chat-bar.recording-mode .tour-message-input,
.tour-chat-input-area.recording-mode .tour-message-input {
    opacity: 0.45;
}

/* ============================================================
   UPGRADE BUTTON - Navigation Controls
   ============================================================ */

.tour-upgrade-btn {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.25), rgba(245, 158, 11, 0.2));
    border: 1px solid rgba(251, 191, 36, 0.4);
    color: #fbbf24;
}

.tour-upgrade-btn:hover {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.35), rgba(245, 158, 11, 0.3));
    border-color: rgba(251, 191, 36, 0.6);
}

.tour-upgrade-btn svg {
    width: 16px;
    height: 16px;
}

/* ============================================================
   UPGRADE MODAL
   ============================================================ */

.upgrade-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 16px;
    opacity: 0;
    transition: opacity 0.3s ease;
    overflow-y: auto;
}

.upgrade-modal-overlay.active {
    opacity: 1;
}

.upgrade-modal-overlay.closing {
    opacity: 0;
}

.upgrade-modal {
    background: #0c0d14;
    border-radius: 20px;
    max-width: 400px;
    width: 100%;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    border: 1px solid var(--dsc-bd, rgba(165, 178, 255, 0.16));
    max-height: 90vh;
    overflow-y: auto;
}

.upgrade-modal-overlay.active .upgrade-modal {
    transform: scale(1);
}

.upgrade-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 1;
}

.upgrade-modal-close svg {
    width: 16px;
    height: 16px;
    color: rgba(255, 255, 255, 0.6);
}

.upgrade-modal-close:hover {
    background: rgba(255, 255, 255, 0.15);
}

.upgrade-modal-content {
    padding: 24px 20px;
}

.upgrade-modal h2 {
    color: white;
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 4px 0;
    text-align: center;
}

/* Kontinuitäts-Zeile direkt unter dem Titel (Task A.2): dezent, halbtransparent */
.upgrade-modal-subtitle {
    color: rgba(255, 255, 255, 0.55);
    font-size: 13.5px;
    line-height: 1.45;
    margin: 0 0 16px 0;
    text-align: center;
}

.upgrade-tour-name {
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    margin: 0 0 20px 0;
    text-align: center;
}

/* Upgrade-Sektionen: flach/offen (Discover-DNA, kein Box-in-Box).
   Trennung durch Hairline statt graue Karten. Die premium-box weiter unten
   überschreibt das und ist die EINE Hero-Karte. */
.upgrade-box {
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 0;
    padding: 18px 2px;
    margin-bottom: 0;
    position: relative;
}

.upgrade-box-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.upgrade-box-icon {
    font-size: 18px;
}

.upgrade-box-header h4 {
    color: white;
    font-size: 15px;
    font-weight: 600;
    margin: 0;
}

.upgrade-box-text {
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
    line-height: 1.5;
    margin: 0 0 12px 0;
}

/* Credits Math Display */
.credits-math {
    display: flex;
    gap: 16px;
    justify-content: center;
    padding: 10px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
}

.credits-math span {
    color: rgba(255, 255, 255, 0.9);
    font-size: 12px;
    font-weight: 500;
}

/* Credits Options Grid */
.credits-options {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.credit-option {
    flex: 1;
    background: rgba(130, 141, 242, 0.08);
    border: 1px solid var(--dsc-bd, rgba(165, 178, 255, 0.16));
    border-radius: 12px;
    padding: 10px 8px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.credit-option.clickable {
    cursor: pointer;
    transition: all 0.2s ease;
}

.credit-option.clickable:hover {
    background: rgba(107, 127, 232, 0.15);
    border-color: var(--brand-mid, #6B7FE8);
    transform: translateY(-2px);
}

.credit-option.clickable:active {
    transform: translateY(0);
}

.credit-amount {
    color: var(--brand-gold, #FFD60A);
    font-size: 16px;
    font-weight: 700;
}

.credit-label {
    color: rgba(255, 255, 255, 0.6);
    font-size: 11px;
}

.credit-price {
    color: white;
    font-size: 14px;
    font-weight: 600;
}

/* Premium Box: die EINE Hero-Karte (Discover-DNA: Periwinkle-Tint + Glow) */
.premium-box {
    background: rgba(107, 127, 232, 0.1);
    border: 1px solid rgba(165, 178, 255, 0.28);
    border-radius: 16px;
    padding: 18px 16px;
    margin-top: 24px;
    box-shadow: 0 8px 30px rgba(79, 70, 229, 0.18);
}

.premium-box .upgrade-box-header h4 {
    flex: 1;
}

.premium-price {
    color: var(--brand-gold, #FFD60A);
    font-weight: 700;
}

.premium-features {
    list-style: none;
    padding: 0;
    margin: 0 0 14px 0;
}

.premium-features li {
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    padding: 5px 0;
}

.premium-features li.money-back {
    color: #4ade80;
    font-weight: 500;
}

.recommended-badge {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #FFD60A, #f59e0b);
    color: #000;
    font-size: 10px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Buttons */
.upgrade-btn-credits {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.upgrade-btn-credits:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.25);
}

.upgrade-btn-primary {
    width: 100%;
    padding: 14px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    background: var(--brand-cta, linear-gradient(135deg, #6B7FE8 0%, #4F46E5 100%));
    color: #ffffff;
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.45);
}

.upgrade-btn-primary:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
}

/* ============================================================
   CHECKOUT MODAL
   ============================================================ */

.checkout-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.checkout-modal-overlay.active {
    opacity: 1;
}

.checkout-modal-overlay.closing {
    opacity: 0;
}

.checkout-modal {
    background: #0c0d14;
    border: 1px solid var(--dsc-bd, rgba(165, 178, 255, 0.16));
    border-radius: 20px;
    max-width: 500px;
    width: 100%;
    max-height: 100%;
    min-height: 0;
    overflow: hidden;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    /* Flex-Spalte: Header behält seine Höhe, der Stripe-Container bekommt
       den restlichen sichtbaren Platz, auch bei geöffneter Tastatur. */
    display: flex;
    flex-direction: column;
}

.checkout-modal-overlay.active .checkout-modal {
    transform: scale(1);
}

.checkout-modal-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 44px;
    height: 44px;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 1;
}

.checkout-modal-close svg {
    width: 18px;
    height: 18px;
    color: rgba(255, 255, 255, 0.6);
}

.checkout-modal-close:hover {
    background: rgba(255, 255, 255, 0.15);
}

.checkout-modal-header {
    box-sizing: border-box;
    min-height: 60px;
    padding: 18px 60px 18px 16px;
    flex-shrink: 0;
    border-bottom: 1px solid var(--dsc-bd, rgba(165, 178, 255, 0.16));
}

.checkout-modal-header h2 {
    color: #ffffff;
    font-size: 18px;
    line-height: 24px;
    font-weight: 700;
    margin: 0;
    overflow-wrap: anywhere;
}

.checkout-container {
    min-height: 0;
    flex: 1 1 auto;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
}

.checkout-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 16px;
}

.checkout-loading .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.12);
    border-top-color: var(--brand-mid);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.checkout-loading p {
    color: var(--dsc-mut, rgba(226, 229, 255, 0.6));
    font-size: 15px;
    margin: 0;
}

.checkout-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    gap: 12px;
    text-align: center;
}

.checkout-error .error-icon {
    font-size: 32px;
}

.checkout-error p {
    color: var(--dsc-mut, rgba(226, 229, 255, 0.6));
    font-size: 15px;
    margin: 0;
}

.checkout-error .retry-btn {
    margin-top: 16px;
    padding: 12px 24px;
    background: var(--brand-cta, linear-gradient(135deg, #6B7FE8 0%, #4F46E5 100%));
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.45);
}

.checkout-error .retry-btn:hover {
    filter: brightness(1.05);
}

/* ============================================================
   PURCHASE SUCCESS TOAST
   ============================================================ */

.purchase-success-toast {
    position: fixed;
    bottom: 200px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: linear-gradient(135deg, #10b981, #059669);
    padding: 16px 24px;
    border-radius: 16px;
    z-index: 10002;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.3);
}

.purchase-success-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toast-icon {
    font-size: 24px;
}

.toast-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.toast-text strong {
    color: white;
    font-size: 15px;
}

.toast-text span {
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
}

/* Mobile Responsive for modals */
@media (max-width: 768px) {
    .upgrade-modal-overlay,
    .checkout-modal-overlay {
        padding: 10px;
    }

    .upgrade-modal {
        max-width: 100%;
    }

    .upgrade-modal-content {
        padding: 20px 16px;
    }

    .upgrade-box {
        padding: 14px;
    }

    .credits-options {
        gap: 6px;
    }

    .credit-option {
        padding: 8px 6px;
    }

    .credit-amount {
        font-size: 14px;
    }

    .checkout-modal {
        max-width: 100%;
        max-height: 100%;
    }

    .purchase-success-toast {
        bottom: 160px;
        left: 16px;
        right: 16px;
        transform: translateY(20px);
    }

    .purchase-success-toast.visible {
        transform: translateY(0);
    }
}

/* ============================================================
   Paywall Bottom-Sheet (Redesign 2026-07-13)
   Vorlage: _mockups/sales-modal-concept.html, angepasst an Brand-Tokens.
   Genutzt von paymentController.showAIGuideNoAccessModal().
   ============================================================ */

.pw-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: rgba(4, 5, 9, 0.6);
    backdrop-filter: blur(5px) saturate(0.75);
    -webkit-backdrop-filter: blur(5px) saturate(0.75);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pw-overlay.active { opacity: 1; }
.pw-overlay.closing { opacity: 0; }

.pw-sheet {
    position: relative;
    width: 100%;
    max-width: 430px;
    max-height: calc(100dvh - 56px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 28px 28px 0 0;
    border-top: 1px solid rgba(176, 188, 255, 0.22);
    background:
        radial-gradient(circle at 50% -20%, rgba(107, 127, 232, 0.16), transparent 38%),
        linear-gradient(180deg, rgba(15, 17, 28, 0.985), rgba(8, 9, 15, 0.995));
    box-shadow: 0 -24px 70px rgba(0, 0, 0, 0.62);
    transform: translateY(28px);
    transition: transform 0.3s ease;
}

.pw-overlay.active .pw-sheet { transform: translateY(0); }

.pw-grabber {
    flex: 0 0 auto;
    width: 38px;
    height: 4px;
    margin: 9px auto 0;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.18);
}

.pw-close {
    position: absolute;
    z-index: 2;
    top: 17px;
    right: 17px;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.07);
    color: rgba(255, 255, 255, 0.68);
    cursor: pointer;
}

.pw-close svg { width: 17px; height: 17px; }
.pw-close:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }

.pw-scroll {
    flex: 0 1 auto;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
    padding: 14px 20px 0;
}
.pw-scroll::-webkit-scrollbar { display: none; }

.pw-eyebrow {
    display: flex;
    justify-content: center;
    margin: 2px 42px 9px;
}

.pw-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 10px;
    border-radius: 999px;
    color: var(--brand-gold, #FFD60A);
    background: rgba(255, 210, 28, 0.075);
    border: 1px solid rgba(255, 210, 28, 0.19);
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 0.55px;
    text-transform: uppercase;
}

.pw-badge svg { width: 13px; height: 13px; }

.pw-title {
    margin: 0;
    color: #f7f8ff;
    font-size: 26px;
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -0.6px;
    text-align: center;
}

.pw-lead {
    margin: 8px auto 15px;
    max-width: 330px;
    color: #a4a8ba;
    font-size: 13.5px;
    line-height: 1.42;
    text-align: center;
}

.pw-continuity {
    position: relative;
    padding: 14px 14px 13px;
    border: 1px solid var(--dsc-bd, rgba(165, 178, 255, 0.16));
    border-radius: 17px;
    background: linear-gradient(135deg, rgba(102, 119, 232, 0.12), rgba(255, 255, 255, 0.025));
    overflow: hidden;
}

.pw-continuity::after {
    content: "";
    position: absolute;
    width: 100px;
    height: 100px;
    right: -45px;
    top: -55px;
    border-radius: 50%;
    background: rgba(107, 127, 232, 0.14);
    filter: blur(18px);
}

.pw-progress-head {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    color: #f5f6ff;
    font-size: 13.5px;
    font-weight: 700;
}

.pw-progress-head span:last-child {
    color: #aeb9ff;
    font-size: 11.5px;
    font-weight: 700;
    white-space: nowrap;
}

.pw-track {
    position: relative;
    z-index: 1;
    height: 6px;
    margin: 9px 0 12px;
    overflow: hidden;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.09);
}

.pw-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #7588ff, #9facff);
    box-shadow: 0 0 12px rgba(117, 136, 255, 0.5);
}

.pw-memory {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 34px 1fr;
    align-items: center;
    gap: 10px;
}

.pw-orb {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #9baaff, #5265e8 52%, #303bc0 100%);
    box-shadow: 0 0 0 4px rgba(107, 127, 232, 0.10), 0 5px 15px rgba(40, 46, 145, 0.42);
}

.pw-wave { display: flex; align-items: center; gap: 2px; height: 14px; }
.pw-wave i { width: 2px; border-radius: 2px; background: #fff; }
.pw-wave i:nth-child(1), .pw-wave i:nth-child(5) { height: 5px; opacity: 0.72; }
.pw-wave i:nth-child(2), .pw-wave i:nth-child(4) { height: 10px; }
.pw-wave i:nth-child(3) { height: 14px; }

.pw-memory-copy b {
    display: block;
    margin-bottom: 1px;
    color: #e8ebff;
    font-size: 11.5px;
    font-weight: 700;
}

.pw-memory-copy span {
    display: block;
    color: #a4a8ba;
    font-size: 11.5px;
    line-height: 1.35;
}

.pw-choice-title {
    margin: 18px 2px 9px;
    color: #eef0ff;
    font-size: 13px;
    font-weight: 700;
}

.pw-plans { display: grid; gap: 9px; }

.pw-plan {
    position: relative;
    width: 100%;
    min-height: 76px;
    display: grid;
    grid-template-columns: 24px 1fr auto;
    align-items: start;
    gap: 10px;
    padding: 12px 13px;
    border: 1px solid var(--dsc-bd, rgba(165, 178, 255, 0.16));
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.025);
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.pw-plan:hover { transform: translateY(-1px); border-color: rgba(176, 188, 255, 0.3); }
.pw-plan:active { transform: scale(0.99); }

.pw-plan.selected {
    border-color: rgba(139, 154, 255, 0.58);
    background: linear-gradient(135deg, rgba(107, 127, 232, 0.16), rgba(79, 70, 229, 0.065));
    box-shadow: 0 8px 28px rgba(46, 48, 137, 0.19), inset 0 0 0 1px rgba(163, 175, 255, 0.08);
}

.pw-radio {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    display: grid;
    place-items: center;
    border: 1.5px solid rgba(255, 255, 255, 0.27);
    border-radius: 50%;
}

/* USPs/Benefits stehen IN der Options-Karte (Dan 2026-07-13), nicht mehr lose darunter */
.pw-plan-benefits {
    display: grid;
    gap: 6px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(165, 178, 255, 0.12);
}

.pw-credit-benefits {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
    margin-top: 4px;
    padding: 0 2px;
}

.pw-plan.selected .pw-radio { border-color: #8fa0ff; }
.pw-plan.selected .pw-radio::after {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #8193ff;
    box-shadow: 0 0 10px rgba(129, 147, 255, 0.62);
}

.pw-plan-copy strong {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 7px;
    margin-bottom: 3px;
    color: #f6f7ff;
    font-size: 14.5px;
    font-weight: 700;
    letter-spacing: -0.15px;
}

.pw-plan-copy small {
    display: block;
    color: #a4a8ba;
    font-size: 11.5px;
    line-height: 1.35;
}

.pw-tag {
    display: inline-flex;
    padding: 3px 6px;
    border-radius: 6px;
    color: #cfd5ff;
    background: rgba(127, 145, 255, 0.12);
    font-size: 8.5px;
    font-weight: 800;
    letter-spacing: 0.35px;
    text-transform: uppercase;
}

.pw-tag-gold {
    color: #ffe87b;
    background: rgba(255, 210, 28, 0.10);
}

.pw-price {
    min-width: 61px;
    color: #fff;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.65px;
    text-align: right;
}

.pw-price span {
    display: block;
    margin-top: 1px;
    color: #74798e;
    font-size: 9.5px;
    font-weight: 650;
    letter-spacing: 0;
}

/* Credits immer sichtbar als Zweite-Wahl-Sektion (Dan 2026-07-13, kein Dropdown mehr):
   der sichtbare Stunden-Kontrast (1h/€5 vs. unbegrenzt/€20) verkauft die All-in-Tour */
.pw-more-wrap { margin-top: 14px; }

.pw-credits-label {
    color: #a7acc0;
    font-size: 11.5px;
    font-weight: 650;
    letter-spacing: 0.1px;
}

.pw-credits-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 8px;
}

.pw-small-plan {
    position: relative;
    border: 1px solid var(--dsc-bd, rgba(165, 178, 255, 0.16));
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.025);
    padding: 12px 9px 9px;
    color: #e8eaff;
    font: inherit;
    cursor: pointer;
    text-align: center;
}

.pw-small-plan.selected {
    border-color: rgba(139, 154, 255, 0.58);
    background: rgba(107, 127, 232, 0.13);
    box-shadow: inset 0 0 0 1px rgba(163, 175, 255, 0.06);
}

.pw-small-plan b { display: block; font-size: 13px; }
.pw-small-plan span { display: block; color: #a4a8ba; font-size: 10.5px; }
.pw-small-plan .pw-small-credits { margin-top: 2px; color: #8b90a6; font-size: 9.5px; }
.pw-small-plan .pw-small-tag { display: inline-flex; }

/* €10-Option: leicht hervorgehobene Empfehlung (Dan 2026-07-13) */
.pw-small-rec { border-color: rgba(255, 210, 28, 0.32); }

.pw-small-tag {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    background: #1a1508;
    border: 1px solid rgba(255, 210, 28, 0.32);
    white-space: nowrap;
}

.pw-benefits {
    min-height: 38px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
    margin-top: 11px;
}

.pw-benefit {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    color: #b7bbce;
    font-size: 10.5px;
    line-height: 1.28;
}

.pw-benefit svg { flex: 0 0 auto; width: 13px; height: 13px; color: #44df8a; margin-top: 1px; }

.pw-action {
    position: relative;
    flex: 0 0 auto;
    z-index: 3;
    padding: 15px 20px max(17px, env(safe-area-inset-bottom));
    background: linear-gradient(180deg, rgba(8, 9, 15, 0), rgba(8, 9, 15, 0.95) 20%, #08090f 42%);
}

.pw-buy {
    width: 100%;
    height: 52px;
    border: 0;
    border-radius: 15px;
    background: linear-gradient(135deg, var(--brand-mid, #6B7FE8) 0%, #4F46E5 100%);
    color: #fff;
    font: inherit;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -0.1px;
    cursor: pointer;
    box-shadow: 0 11px 30px rgba(69, 59, 220, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.18);
    transition: transform 0.15s ease, filter 0.15s ease;
}

.pw-buy:hover { filter: brightness(1.07); transform: translateY(-1px); }
.pw-buy:active { transform: scale(0.985); }
.pw-buy:disabled { opacity: 0.7; cursor: default; }

/* Kostenloser Ausgang „nur mit Karte navigieren": sekundär, aber vollflächig
   und lesbar — ein Mini-Textlink würde das Gratis-Versprechen unglaubwürdig
   machen. Gesetzt von paymentController (nur mit onNavigationOnly-Callback). */
.pw-navonly {
    width: 100%;
    margin-top: 9px;
    padding: 11px 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.92);
    font: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s ease;
}

.pw-navonly strong { font-size: 14px; font-weight: 700; letter-spacing: -0.1px; }
.pw-navonly small { color: #97a0b8; font-size: 11.5px; font-weight: 500; line-height: 1.35; text-align: center; }
.pw-navonly:hover { background: rgba(255, 255, 255, 0.09); }
.pw-navonly:active { transform: scale(0.99); }

.pw-pay-methods {
    margin-top: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.pw-pay-label {
    margin-right: 2px;
    color: #656b80;
    font-size: 8.8px;
    font-weight: 650;
}

.pw-pay-badge {
    height: 21px;
    min-width: 37px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.94);
    color: #101116;
    font-size: 8.4px;
    font-weight: 800;
    letter-spacing: -0.1px;
    white-space: nowrap;
}

.pw-pay-apple { font-size: 9.2px; gap: 2px; }
.pw-pay-apple svg { width: 9px; height: 11px; }
.pw-pay-google i { color: #4285f4; font-style: normal; }
.pw-pay-paypal { color: #0877c9; font-style: italic; }
.pw-pay-cards { gap: 2px; }
.pw-card-dot { width: 10px; height: 10px; border-radius: 50%; background: #ed001b; }
.pw-card-dot + .pw-card-dot { margin-left: -4px; background: #f79e1b; opacity: 0.92; }

.pw-trust {
    margin-top: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    color: #70768b;
    font-size: 9.8px;
    font-weight: 600;
}

.pw-trust svg { width: 11px; height: 11px; color: #8b92aa; }

@media (max-height: 700px) {
    .pw-scroll { padding-top: 9px; }
    .pw-title { font-size: 23px; }
    .pw-lead { margin-bottom: 11px; }
    .pw-continuity { padding: 11px 12px; }
    .pw-choice-title { margin-top: 13px; }
    .pw-plan { min-height: 68px; padding-top: 10px; padding-bottom: 10px; }
    .pw-benefits { margin-top: 8px; }
}
