:root {
    --primary-color: #e67e22;
    --bg-color: #fcfcfc;
    --text-color: #2c3e50;
    --card-bg: #ffffff;
    --border-radius-btn: 8px;
    --border-radius-card: 12px;
    --font-family-base: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --pwa-city-bar-height: 44px;
    --pwa-city-bar-total-height: calc(var(--pwa-city-bar-height) + env(safe-area-inset-top, 0px));
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    font-family: var(--font-family-base);
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
}

button, a, select, input, textarea, [role="button"] {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    outline: none;
}

button:focus, button:focus-visible, a:focus, a:focus-visible {
    outline: none;
}

#app {
    width: 100%;
    height: 100%;
    position: relative;
}

/* Fullscreen App Loader (Dashboard Style) */
#app-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0f172a;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #f8fafc;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

#app-loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.app-loader-spinner {
    width: 50px;
    height: 50px;
    border: 3.5px solid rgba(255, 255, 255, 0.15);
    border-top: 3.5px solid var(--primary-color, #c80000);
    border-radius: 50%;
    margin-bottom: 18px;
    animation: appLoaderSpin 0.85s linear infinite;
}

@keyframes appLoaderSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.app-loader-text {
    font-size: 0.95rem;
    font-weight: 500;
    color: #94a3b8;
    letter-spacing: 0.3px;
    margin: 0;
}

.screen {
    display: none;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    flex-direction: column;
}

.screen.active {
    display: flex;
    animation: screenFadeIn 0.35s ease-out forwards;
}

@keyframes screenFadeIn {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: none; }
}

/* 1. Welcome Screen (Fullscreen Architecture) */
#welcome-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    background: #ffffff;
    color: var(--text-color, #1e293b);
    display: none;
    flex-direction: column;
}

#welcome-screen.active {
    display: flex;
}

/* Custom Scrollbar for sleek aesthetic */
#welcome-screen::-webkit-scrollbar {
    width: 6px;
}
#welcome-screen::-webkit-scrollbar-track {
    background: transparent;
}
#welcome-screen::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.3);
    border-radius: 10px;
}
#welcome-screen::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.6);
}

/* Full-Bleed Hero Header (Print-Studio Look) */
.welcome-hero-header {
    width: 100%;
    min-height: 250px;
    height: 38vh;
    max-height: 350px;
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #0f172a;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    overflow: hidden;
    flex-shrink: 0;
}

.welcome-hero-header.no-image {
    background: #00618a;
}

.welcome-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.18) 0%, rgba(0,0,0,0.42) 45%, rgba(0,0,0,0.88) 100%);
    pointer-events: none;
}

.welcome-hero-content {
    position: relative;
    z-index: 2;
    padding: 20px 20px 34px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
}

.welcome-badge-org {
    display: inline-block;
    padding: 5px 16px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    border-radius: 20px;
    margin-bottom: 10px;
    background: var(--primary-color, #c80000);
    color: #ffffff !important;
    box-shadow: 0 3px 12px rgba(0,0,0,0.35);
}

.welcome-hero-title {
    font-size: clamp(1.4rem, 5vw, 1.85rem);
    font-weight: 800;
    color: #ffffff !important;
    margin: 0;
    line-height: 1.2;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 10px rgba(0,0,0,0.75);
    max-width: 480px;
}

/* Fullscreen Content Sheet (Flows edge-to-edge, smoothly overlaps hero bottom) */
.welcome-content-sheet {
    width: 100%;
    flex-grow: 1;
    background: #ffffff;
    border-radius: 26px 26px 0 0;
    margin-top: -22px;
    position: relative;
    z-index: 5;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.08);
    padding: 22px 18px 40px 18px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.welcome-content-inner {
    width: 100%;
    max-width: 480px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

/* Logo container & Logo constraints (Fixed sizing so it NEVER overflows) */
.welcome-logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 4px 0;
    box-sizing: border-box;
    overflow: hidden;
}

#welcome-logo {
    max-width: 180px;
    max-height: 56px;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.08));
    display: block;
}

/* Feature tags row */
.welcome-feature-tags {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    width: 100%;
}

.feature-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 3px 8px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #64748b;
    white-space: nowrap;
    flex-shrink: 0;
}
.feature-tag svg {
    width: 12px;
    height: 12px;
    color: var(--primary-color, #c80000);
    flex-shrink: 0;
}

/* Resume Tour Callout */
.resume-tour-callout {
    width: 100%;
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    color: white;
    border-radius: 20px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 10px 25px -5px rgba(16, 185, 129, 0.4);
    cursor: pointer;
    box-sizing: border-box;
    transition: transform 0.2s, box-shadow 0.2s;
}
.resume-tour-callout:active {
    transform: scale(0.98);
}
.resume-tour-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.resume-tour-info {
    display: flex;
    flex-direction: column;
    text-align: left;
    flex-grow: 1;
    min-width: 0;
}
.resume-tour-info strong {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.2;
}
.resume-tour-details {
    font-size: 0.8rem;
    opacity: 0.9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 3px;
}
.resume-tour-btn {
    background: white;
    color: #059669;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Language Selector Section */
.welcome-lang-section {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 0;
}

.welcome-section-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #94a3b8;
    white-space: nowrap;
}
.welcome-section-divider span {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #94a3b8;
    white-space: nowrap;
}

.lang-selector-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
    width: 100%;
}

.lang-card-btn {
    background: white;
    border: 1.5px solid #e2e8f0;
    border-radius: 18px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.03);
    transition: transform 0.15s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    text-align: left;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
}
.lang-card-btn:hover {
    border-color: #cbd5e1;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}
.lang-card-btn:active {
    transform: scale(0.97);
    border-color: var(--primary-color, #c80000);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.lang-card-flag {
    font-size: 1.7rem;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.12));
    flex-shrink: 0;
}
.lang-card-text {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    min-width: 0;
}
.lang-card-name {
    font-size: 0.95rem;
    font-weight: 750;
    color: #1e293b;
    line-height: 1.2;
}
.lang-card-code {
    font-size: 0.72rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

/* Welcome Screen Legal Footer (Impressum & Datenschutz) */
.welcome-legal-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 10px 0 4px 0;
    margin-top: 2px;
    width: 100%;
}
.welcome-legal-link {
    color: #94a3b8;
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s ease;
}
.welcome-legal-link:hover {
    color: #475569;
    text-decoration: underline;
}
.welcome-legal-link:active {
    color: var(--primary-color, #c80000);
}
.welcome-legal-sep {
    color: #cbd5e1;
    font-size: 0.8rem;
    user-select: none;
}

/* 2. Route Selection Screen */
#route-selection-screen {
    background: var(--bg-color);
    height: calc(100% - 60px);
    padding: 16px 0 80px 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
    scroll-snap-type: y mandatory;
    scroll-padding-top: 16px;
    scroll-behavior: smooth;
}
@media (max-height: 520px) {
    #route-selection-screen {
        scroll-snap-type: y proximity;
    }
}

/* Hero / Spotlight Card */
.route-hero-container {
    padding: 0 20px 20px 20px;
    box-sizing: border-box;
    scroll-snap-align: start;
    scroll-snap-stop: normal;
}
.route-hero-card {
    position: relative;
    width: 100%;
    min-height: 250px;
    border-radius: 20px;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    background-color: #1e293b;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 22px;
    box-sizing: border-box;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
    color: #ffffff;
    touch-action: pan-x pan-y;
}
.route-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.15) 0%, rgba(15, 23, 42, 0.5) 45%, rgba(15, 23, 42, 0.94) 100%);
    z-index: 1;
    pointer-events: none;
}
.route-hero-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.route-hero-badge {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 20px;
    background: #f59e0b;
    color: #ffffff;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}
.route-hero-badge svg {
    display: block;
    flex-shrink: 0;
}
.route-hero-title {
    margin: 0;
    font-size: 1.45rem;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.25;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}
.route-hero-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.92);
    font-weight: 600;
}
.route-hero-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.route-hero-meta-item svg {
    display: block;
    flex-shrink: 0;
    opacity: 0.95;
}
.route-hero-desc {
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.88);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}
.route-hero-actions {
    margin-top: 6px;
    display: flex;
    gap: 10px;
}
.route-hero-btn {
    flex: 1;
    padding: 12px 18px;
    background: var(--primary-color);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    transition: transform 0.15s ease, filter 0.15s ease;
}
.route-hero-btn svg {
    display: block;
    flex-shrink: 0;
}
.route-hero-btn:active {
    transform: scale(0.97);
}

/* ==========================================================================
   DYNAMIC HERO / SPOTLIGHT SLIDER
   ========================================================================== */
.route-hero-slider {
    position: relative;
    width: 100%;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
    background-color: #1e293b;
    touch-action: pan-y;
}
.route-hero-slider-viewport {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
    width: 100%;
    position: relative;
}
.route-hero-slide {
    grid-column: 1;
    grid-row: 1;
    width: 100%;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 1;
    transform: translateZ(0);
    backface-visibility: hidden;
}
.route-hero-slide.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    z-index: 2;
}
.route-hero-slider .route-hero-card {
    box-shadow: none;
    border-radius: 0;
    height: 100%;
    padding-bottom: 44px;
}

/* 1. Animation: Fade (Crossfade) */
.route-hero-slider[data-animation="fade"] .route-hero-slide {
    transition: opacity 0.7s ease-in-out, visibility 0.7s ease-in-out;
}
.route-hero-slider[data-animation="fade"] .route-hero-slide.is-active {
    opacity: 1;
    visibility: visible;
}
.route-hero-slider[data-animation="fade"] .route-hero-slide.is-prev,
.route-hero-slider[data-animation="fade"] .route-hero-slide.is-next {
    opacity: 0;
    visibility: visible;
}

/* 2. Animation: Slide Horizontal */
.route-hero-slider[data-animation="slide-h"] .route-hero-slide {
    transition: transform 0.55s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.55s ease, visibility 0.55s ease;
    transform: translateX(100%);
    opacity: 0;
}
.route-hero-slider[data-animation="slide-h"] .route-hero-slide.is-active {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
}
.route-hero-slider[data-animation="slide-h"] .route-hero-slide.is-prev {
    transform: translateX(-100%);
    opacity: 0;
    visibility: visible;
}
.route-hero-slider[data-animation="slide-h"] .route-hero-slide.is-next {
    transform: translateX(100%);
    opacity: 0;
    visibility: visible;
}

/* 3. Animation: Slide Vertical */
.route-hero-slider[data-animation="slide-v"] .route-hero-slide {
    transition: transform 0.55s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.55s ease, visibility 0.55s ease;
    transform: translateY(100%);
    opacity: 0;
}
.route-hero-slider[data-animation="slide-v"] .route-hero-slide.is-active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}
.route-hero-slider[data-animation="slide-v"] .route-hero-slide.is-prev {
    transform: translateY(-100%);
    opacity: 0;
    visibility: visible;
}
.route-hero-slider[data-animation="slide-v"] .route-hero-slide.is-next {
    transform: translateY(100%);
    opacity: 0;
    visibility: visible;
}

/* 4. Animation: Zoom & Fade */
.route-hero-slider[data-animation="zoom"] .route-hero-slide {
    transition: transform 0.65s cubic-bezier(0.2, 0.9, 0.3, 1), opacity 0.65s ease, visibility 0.65s ease;
    transform: scale(0.92);
    opacity: 0;
}
.route-hero-slider[data-animation="zoom"] .route-hero-slide.is-active {
    transform: scale(1);
    opacity: 1;
    visibility: visible;
}
.route-hero-slider[data-animation="zoom"] .route-hero-slide.is-prev {
    transform: scale(1.08);
    opacity: 0;
    visibility: visible;
}
.route-hero-slider[data-animation="zoom"] .route-hero-slide.is-next {
    transform: scale(0.92);
    opacity: 0;
    visibility: visible;
}

/* 5. Animation: Flash */
.route-hero-slider[data-animation="flash"] .route-hero-slide {
    transition: opacity 0.55s ease, filter 0.55s ease, visibility 0.55s ease;
    filter: brightness(2.2) contrast(1.1);
    opacity: 0;
}
.route-hero-slider[data-animation="flash"] .route-hero-slide.is-active {
    opacity: 1;
    visibility: visible;
    filter: brightness(1) contrast(1);
}
.route-hero-slider[data-animation="flash"] .route-hero-slide.is-prev,
.route-hero-slider[data-animation="flash"] .route-hero-slide.is-next {
    opacity: 0;
    visibility: visible;
    filter: brightness(2.2) contrast(1.1);
}

/* 6. Animation: 3D-Flip */
.route-hero-slider[data-animation="flip"] {
    perspective: 1200px;
}
.route-hero-slider[data-animation="flip"] .route-hero-slide {
    transition: transform 0.65s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.65s ease, visibility 0.65s ease;
    transform: rotateY(90deg);
    backface-visibility: hidden;
    opacity: 0;
}
.route-hero-slider[data-animation="flip"] .route-hero-slide.is-active {
    transform: rotateY(0deg);
    opacity: 1;
    visibility: visible;
}
.route-hero-slider[data-animation="flip"] .route-hero-slide.is-prev {
    transform: rotateY(-90deg);
    opacity: 0;
    visibility: visible;
}
.route-hero-slider[data-animation="flip"] .route-hero-slide.is-next {
    transform: rotateY(90deg);
    opacity: 0;
    visibility: visible;
}

/* Slider Navigation Dots */
.route-hero-slider-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 7px;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 5px 12px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    pointer-events: auto;
}
.route-hero-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.45);
    border: none;
    padding: 0;
    cursor: pointer;
    transition: width 0.25s ease, background-color 0.25s ease, border-radius 0.25s ease;
}
.route-hero-dot.is-active {
    width: 22px;
    border-radius: 11px;
    background: #ffffff;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.7);
}

/* Slider Navigation Arrows */
.route-hero-slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease, opacity 0.25s ease;
    opacity: 0;
    pointer-events: none;
}
.route-hero-slider:hover .route-hero-slider-arrow {
    opacity: 0.85;
    pointer-events: auto;
}
.route-hero-slider-arrow:hover {
    opacity: 1 !important;
    background: rgba(15, 23, 42, 0.85);
    transform: translateY(-50%) scale(1.08);
}
.route-hero-slider-arrow:active {
    transform: translateY(-50%) scale(0.95);
}
.route-hero-slider-arrow.prev { left: 12px; }
.route-hero-slider-arrow.next { right: 12px; }

@media (max-width: 768px) {
    .route-hero-slider-arrow {
        display: none;
    }
}

/* Category Swimlanes */
.route-categories-container {
    width: 100%;
}
.route-category-row {
    margin-bottom: 24px;
    scroll-snap-align: start;
    scroll-snap-stop: normal;
}
.route-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px 8px 20px;
}
.route-category-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}
.route-category-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    line-height: 1;
    flex-shrink: 0;
}
.route-category-icon svg {
    display: block;
}
.route-category-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-color);
    letter-spacing: -0.01em;
}
.route-category-badge {
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    background: rgba(100, 116, 139, 0.12);
    padding: 3px 8px;
    border-radius: 12px;
}

/* Horizontal Track (Shared by Swimlanes & Fallback) */
.route-cards-track,
.route-cards-container {
    width: 100%;
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    touch-action: pan-x pan-y;
    scroll-snap-type: x mandatory;
    scroll-padding-left: 20px;
    scroll-padding-inline: 20px;
    padding: 8px 20px 24px 20px;
    gap: 16px;
    box-sizing: border-box;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
#route-selection-screen > .route-cards-container {
    scroll-snap-align: start;
    scroll-snap-stop: normal;
}
.route-cards-track::-webkit-scrollbar,
.route-cards-container::-webkit-scrollbar {
    display: none;
}

/* 3. Tour Screen (States & Layout) */
#tour-screen { 
    display: none; 
    background: var(--bg-color); 
    height: calc(100% - 60px);
}
#tour-screen.active { display: flex; }

#top-media-container {
    width: 100%;
    position: relative;
    transition: height 0.4s ease;
    background: #e0e0e0;
}

/* Route Cards (Handy Dimensions & Balanced Proportions) */
.route-card {
    flex: 0 0 295px;
    width: 295px;
    max-width: 82vw;
    min-height: 415px;
    background: var(--card-bg);
    border-radius: 20px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.06);
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-sizing: border-box;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    touch-action: pan-x pan-y;
}

.route-card-img {
    aspect-ratio: 16 / 9;
    height: 155px;
    width: 100%;
    background-color: #cbd5e1;
    background-size: cover;
    background-position: center;
    position: relative;
    flex-shrink: 0;
}

.route-card-content {
    padding: 16px 18px 18px 18px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    min-height: 250px;
    box-sizing: border-box;
}

.route-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    color: #64748b;
    margin-bottom: 8px;
    font-weight: 600;
    flex-wrap: wrap;
}
.route-card-meta span {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.route-card h3 {
    margin: 0 0 8px 0;
    font-size: 1.18rem;
    font-weight: 700;
    color: var(--text-color);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.route-card p,
.route-card .rich-text {
    margin: 0 0 16px 0;
    color: #64748b;
    font-size: 0.88rem;
    line-height: 1.45;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    flex-grow: 1;
    -webkit-overflow-scrolling: touch;
}
.route-card .rich-text * {
    margin: 0;
    padding: 0;
    display: inline;
}

.route-card-btn {
    width: 100%;
    padding: 12px 16px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 0.98rem;
    font-weight: 700;
    margin-top: auto;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.route-card-btn:active {
    transform: scale(0.97);
}

/* Badges: Horizontal top row in image, never overflowing into content */
.route-badges {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
    position: absolute;
    top: 10px;
    left: 10px;
    max-width: calc(100% - 130px);
    z-index: 2;
}
.route-badge {
    background: var(--primary-color);
    opacity: 0.95;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    box-sizing: border-box;
    padding: 0;
    margin: 0;
    flex-shrink: 0;
}
.route-badge svg {
    width: 14px;
    height: 14px;
    margin: 0 !important;
    display: block;
}

.route-status-badges-group {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    pointer-events: none;
}

.route-status-badge {
    position: relative;
    color: white;
    padding: 5px 11px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.76rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    gap: 4px;
    line-height: 1;
    pointer-events: auto;
}
.route-status-badges-group .route-status-badge {
    position: static;
}
.route-status-badge.premium {
    background: rgba(231, 76, 60, 0.95);
}
.route-status-badge.unlocked {
    background: rgba(46, 204, 113, 0.95);
}

/* Rich Text Formatting for POI descriptions */
.rich-text {
    font-size: 1rem;
    line-height: 1.6;
    color: #444;
}
.rich-text p { margin-bottom: 12px; }
.rich-text b, .rich-text strong { font-weight: bold; color: #222; }
.rich-text i, .rich-text em { font-style: italic; }
.rich-text ul, .rich-text ol { margin-left: 20px; margin-bottom: 15px; }
.rich-text li { margin-bottom: 5px; }
.rich-text h1, .rich-text h2, .rich-text h3 { margin-top: 15px; margin-bottom: 10px; color: var(--primary-color); }

/* POI Favorite Button */
.poi-favorite-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 100;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: transform 0.2s ease, background 0.2s ease;
    padding: 0;
}
.poi-favorite-btn:active {
    transform: scale(0.88);
}
.poi-favorite-btn.active {
    background: rgba(0, 0, 0, 0.35);
    border-color: rgba(255, 255, 255, 0.25);
}
.poi-favorite-btn.active .heart-outline {
    display: none;
}
.poi-favorite-btn.active .heart-filled {
    display: block !important;
}

#map { width: 100%; height: 100%; position: absolute; top:0; left:0; z-index: 10; opacity: 1; transition: opacity 0.3s; }
#cover-image-container { 
    width: 100%; height: 100%; position: absolute; top:0; left:0; z-index: 15; 
    display: none; background: #000; opacity: 0; transition: opacity 0.3s;
}
.cover-carousel {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    touch-action: pan-x;
    scroll-snap-type: x mandatory;
    width: 100%;
    height: 100%;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.cover-carousel::-webkit-scrollbar { display: none; }
.carousel-slide {
    flex: 0 0 100%;
    scroll-snap-align: center;
    width: 100%;
    height: 100%;
    position: relative;
}
.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.carousel-dots {
    position: absolute;
    bottom: 12px; /* Set slightly lower */
    left: 0;
    width: 100%;
    display: flex;
    justify-content: flex-start;
    padding-left: 24px; /* Optically aligned with text edge */
    box-sizing: border-box;
    gap: 8px;
    z-index: 20;
    pointer-events: none;
}
.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transition: background 0.3s;
}
.carousel-dot.active {
    background: rgba(255, 255, 255, 1);
}

/* Show Map or Image State */
#top-media-container.show-image #map { opacity: 0; pointer-events: none; }
#top-media-container.show-image #cover-image-container { display: block; opacity: 1; pointer-events: auto; }

/* Floating Action Buttons */
.fab-container {
    position: absolute;
    bottom: -28px;
    right: 20px;
    z-index: 1500;
    display: flex;
    gap: 15px;
}
.fab-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: none;
    font-size: 1.5rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0.9;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}
.fab-btn:active { transform: scale(0.92); box-shadow: 0 4px 10px rgba(0,0,0,0.1); opacity: 1; }
#fab-view-toggle-btn { background: #34495e; font-size: 1.3rem; }

.bottom-sheet {
    width: 100%;
    background: white;
    box-sizing: border-box;
    box-shadow: 0 -4px 18px rgba(0,0,0,0.08);
    overflow-y: auto;
    z-index: 1000;
    transform: none !important;
    transition: height 0.35s ease, padding 0.35s ease;
}

/* STATE: Navigating (Big Map, Compact Panel) */
.state-navigating #top-media-container { height: calc(100% - 96px); }
.state-navigating #info-panel,
.state-navigating .bottom-sheet { 
    height: 96px; 
    padding: 12px 20px; 
    border-top-left-radius: 22px; 
    border-top-right-radius: 22px; 
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transform: none !important;
}
.state-navigating .arrived-state-only { display: none; }
.state-navigating .nav-state-only { 
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    animation: screenFadeIn 0.35s ease forwards; 
}
.state-navigating .fab-container { display: none; } /* Hide FABs when walking */

/* STATE: Arrived (Small Map, Big Panel) */
.state-arrived #top-media-container { height: 36%; }
.state-arrived #info-panel,
.state-arrived .bottom-sheet { 
    height: 64%; 
    padding: 26px 20px 22px 20px; 
    border-top-left-radius: 22px; 
    border-top-right-radius: 22px;
    overflow-y: auto;
    transform: none !important;
}
.state-arrived .nav-state-only { display: none; }
.state-arrived .arrived-state-only { display: block; animation: screenFadeIn 0.4s ease forwards; }
.state-arrived .fab-container { display: flex; animation: screenFadeIn 0.4s ease forwards; } /* Show FABs */

.bottom-sheet h2, .bottom-sheet h3 { margin-top: 0; color: var(--primary-color); margin-bottom: 8px; }

#nav-target-title {
    font-size: 1.05rem;
    font-weight: 750;
    color: var(--primary-color, #c80000);
    margin: 0;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Media Elements */
.station-media-container img { width: 100%; max-height: 250px; object-fit: cover; border-radius: 10px; margin-bottom: 10px; }
.distance-info { 
    font-weight: 600; 
    color: #64748b; 
    font-size: 0.92rem; 
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.primary-btn, .secondary-btn {
    padding: 15px; border-radius: 10px; font-size: 1.1rem; font-weight: bold; border: none; cursor: pointer; box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.primary-btn { background-color: var(--primary-color); color: white; width: 100%; }
.secondary-btn { background-color: #dddddd; color: #888888; }
.primary-btn:active, .secondary-btn:active { transform: scale(0.96); box-shadow: 0 2px 4px rgba(0,0,0,0.1); }

/* Modals */
.modal {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6); z-index: 3000; justify-content: center; align-items: center;
}
.modal.active { display: flex; }
.modal-content {
    background: white; width: 90%; max-width: 400px; padding: 25px; border-radius: 15px; box-sizing: border-box;
}
.modal-content h2 { margin-top:0; color: var(--primary-color); }

/* Compass Arrow */
.compass-arrow {
    display: none; position: absolute; top: 20px; right: 20px; width: 50px; height: 50px;
    background: rgba(255,255,255,0.9); border-radius: 50%; text-align: center; line-height: 50px;
    font-size: 24px; color: #e74c3c; z-index: 1000; box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    transition: transform 0.1s;
}

/* User Location Marker */
.user-marker-icon {
    position: relative;
    width: 40px;
    height: 40px;
}
.user-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    background-color: #3498db;
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
    z-index: 2;
}
.user-cone {
    position: absolute;
    top: -40px;
    left: -20px;
    width: 80px;
    height: 60px;
    background: radial-gradient(circle at center bottom, rgba(52, 152, 219, 0.6) 0%, rgba(52, 152, 219, 0) 75%);
    clip-path: polygon(50% 100%, 0 0, 100% 0);
    transform-origin: center bottom;
    z-index: 1;
    display: none;
    transition: transform 0.1s;
}

/* Bottom Navigation Bar */
.bottom-nav-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px;
    box-sizing: border-box;
    z-index: 2500;
    box-shadow: 0 -3px 12px rgba(0, 0, 0, 0.05);
}

.nav-left-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-item-btn {
    background: none;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4a5568;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, transform 0.15s;
    position: relative;
    padding: 0;
}
.nav-item-btn:active {
    background: rgba(0, 0, 0, 0.06);
    transform: scale(0.92);
}

.fav-badge-count {
    position: absolute;
    top: -4px;
    right: -6px;
    background: #e74c3c;
    color: white;
    font-size: 10px;
    font-weight: bold;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    box-sizing: border-box;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.nav-tour-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-tour-progress {
    display: flex;
    align-items: center;
    background: #f1f2f6;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
    color: var(--primary-color);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
}

.nav-circle-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f1f2f6;
    border: 1px solid #e2e8f0;
    color: #4a5568;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.2s ease, color 0.2s ease;
    padding: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.nav-circle-btn:active {
    transform: scale(0.9);
    background: #e2e8f0;
    color: var(--primary-color);
}

/* Favorites List in Modal */
.favorites-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: left;
}

.favorite-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 10px;
    transition: background 0.2s;
}

.favorite-item-img {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
    background: #e2e8f0;
    flex-shrink: 0;
}

.favorite-item-content {
    flex-grow: 1;
    min-width: 0;
}

.favorite-item-title {
    font-weight: bold;
    font-size: 0.95rem;
    color: #2c3e50;
    margin: 0 0 4px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.favorite-item-meta {
    font-size: 0.8rem;
    color: #7f8c8d;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.favorite-item-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.fav-action-btn {
    background: white;
    border: 1px solid #d2d6dc;
    border-radius: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #4a5568;
    transition: all 0.2s;
    padding: 0;
}
.fav-action-btn:hover, .fav-action-btn:active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}
.fav-action-btn.delete:hover, .fav-action-btn.delete:active {
    background: #e74c3c;
    color: white;
    border-color: #e74c3c;
}

.empty-favorites {
    text-align: center;
    padding: 35px 15px;
    color: #7f8c8d;
}
.empty-favorites svg {
    margin-bottom: 12px;
    opacity: 0.35;
}
.empty-favorites p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Settings Modal Groups */
.settings-scroll-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
    text-align: left;
}

.settings-app-version {
    text-align: center;
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 10px;
    margin-bottom: 2px;
    letter-spacing: 0.3px;
    user-select: none;
}

.settings-group {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.settings-group-title {
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #7f8c8d;
    margin-bottom: 2px;
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.95rem;
    color: #2c3e50;
    cursor: pointer;
    user-select: none;
}
.settings-row input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.settings-row-block {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.settings-row-block label {
    font-size: 0.9rem;
    color: #2c3e50;
    font-weight: 500;
}
.settings-row-block select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d2d6dc;
    border-radius: 8px;
    background: white;
    font-size: 0.95rem;
    color: #2c3e50;
    outline: none;
    box-sizing: border-box;
}

.map-style-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.map-style-btn {
    background: white;
    border: 1.5px solid #d2d6dc;
    border-radius: 8px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.2s;
}
.map-style-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}

.settings-action-btn {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: none;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    text-align: center;
    box-sizing: border-box;
}
.settings-action-btn:active {
    transform: scale(0.98);
}
.settings-action-btn.danger {
    background: #e74c3c;
    color: white;
}
.settings-action-btn.warning {
    background: #ffffff;
    color: #7f8c8d;
    border: 1px solid #d2d6dc;
}
.settings-action-btn.warning:active {
    background: #f1f2f6;
    color: #c0392b;
}
.settings-action-btn.feedback-action-btn {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    color: #334155;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.settings-action-btn.feedback-action-btn:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}
.settings-action-btn.feedback-action-btn .feedback-btn-star {
    stroke: #f59e0b;
    fill: #f59e0b;
    flex-shrink: 0;
}

.settings-legal-link {
    flex: 1;
    text-align: center;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #334155;
    font-weight: 600;
    transition: background 0.2s, color 0.2s;
}
.settings-legal-link:hover {
    background: #f1f5f9;
    color: #1e293b;
}

/* Unlock Prices Box & Modal Table */
.unlock-prices-box {
    background: #f8f9fa;
    border: 1px solid #e2e8f0;
    padding: 15px;
    border-radius: 10px;
    margin: 20px 0;
    text-align: left;
    transition: background 0.3s, border-color 0.3s;
}
.unlock-prices-box small {
    color: #64748b;
    display: block;
    line-height: 1.4;
}
.unlock-prices-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 5px;
    font-size: 0.95rem;
}
.unlock-prices-table thead tr {
    border-bottom: 2px solid #cbd5e1;
    color: #64748b;
    font-size: 0.85rem;
}
.unlock-prices-table th {
    padding: 8px 0;
    font-weight: 600;
}
.unlock-prices-table th.price-th-label {
    text-align: left;
}
.unlock-prices-table th.price-th-val {
    text-align: right;
}
.unlock-prices-table td {
    padding: 10px 0;
    border-bottom: 1px solid #e2e8f0;
}
.unlock-prices-table td.price-label {
    font-weight: 500;
    color: #1e293b;
}
.unlock-prices-table td.price-reg {
    text-align: right;
    color: #334155;
}
.unlock-prices-table td.price-erm {
    text-align: right;
    color: var(--primary-color);
    font-weight: bold;
}
.unlock-prices-empty {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-top: 5px;
}
.unlock-redeem-hint {
    margin-top: 15px;
    padding: 12px;
    background: #f8f9fa;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    text-align: center;
    transition: background 0.3s, border-color 0.3s;
}
.unlock-redeem-hint span {
    font-size: 0.95rem;
    color: #475569;
}
.unlock-redeem-link {
    background: none;
    border: none;
    color: var(--primary-color);
    font-weight: 700;
    cursor: pointer;
    text-decoration: underline;
    font-size: 0.95rem;
    margin-left: 6px;
    padding: 0;
}

/* Bottom Navigation Redeem Button */
.nav-redeem-btn {
    background: var(--primary-color, #c80000);
    color: #ffffff;
    border: none;
    border-radius: 20px;
    padding: 8px 18px;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18);
    transition: transform 0.15s ease, opacity 0.2s ease, box-shadow 0.2s ease;
    flex-shrink: 0;
}
.nav-redeem-btn:active {
    transform: scale(0.93);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}
.nav-redeem-btn svg {
    display: block;
    flex-shrink: 0;
}

/* Hide redeem button during active tours to prevent bottom navigation distortion */
#tour-screen.active ~ #bottom-nav-bar #nav-redeem-btn,
#tour-screen.active ~ .bottom-nav-bar #nav-redeem-btn,
.bottom-nav-bar:has(#nav-tour-group:not([style*="display: none"])) #nav-redeem-btn {
    display: none !important;
}

/* Ticket Redeem Bottom Sheet (Fly-In Drawer) */
.sheet-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 3000;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}
.sheet-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.sheet-overlay .bottom-sheet {
    position: relative;
    background: #ffffff;
    width: 100%;
    max-width: 520px;
    border-radius: 24px 24px 0 0;
    padding: 16px 24px 34px 24px;
    box-sizing: border-box;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.25);
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 85vh;
    overflow-y: auto;
}
.sheet-overlay.active .bottom-sheet {
    transform: translateY(0);
}

.sheet-handle {
    width: 44px;
    height: 5px;
    background: #e2e8f0;
    border-radius: 3px;
    margin: 0 auto 16px auto;
}

.sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sheet-icon-badge {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: #f1f5f9;
    color: var(--primary-color, #2c3e50);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sheet-close-btn {
    position: absolute;
    top: 16px;
    right: 18px;
    background: #f1f2f6;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s, transform 0.1s;
    padding: 0;
    z-index: 5;
}
.sheet-close-btn:hover {
    background: #e2e8f0;
    color: #1e293b;
}
.sheet-close-btn:active {
    background: #cbd5e1;
    transform: scale(0.92);
}

.sheet-input-wrap {
    margin-bottom: 16px;
}
.sheet-input-wrap input {
    width: 100%;
    padding: 15px;
    font-size: 1.3rem;
    font-family: monospace;
    font-weight: 700;
    letter-spacing: 3px;
    text-align: center;
    text-transform: uppercase;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #f8fafc;
    margin-bottom: 14px;
}
.sheet-input-wrap input:focus {
    border-color: var(--primary-color, #c80000);
    box-shadow: 0 0 0 3px rgba(200, 0, 0, 0.15);
    background: #ffffff;
}

.sheet-submit-btn {
    width: 100%;
    padding: 16px;
    background: var(--primary-color);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 1.15rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}
.sheet-submit-btn:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}
.sheet-submit-btn:active {
    transform: scale(0.96);
}

.sheet-status-msg {
    font-size: 0.9rem;
    min-height: 22px;
    margin-top: 14px;
    margin-bottom: 0;
    text-align: center;
    font-weight: 600;
}

/* ========================================================= */
/* Live-Ticker & Notfall-Banner                              */
/* ========================================================= */
.live-banner-wrap {
    position: fixed;
    top: 14px;
    left: 14px;
    right: 14px;
    max-width: 580px;
    margin: 0 auto;
    z-index: 10000;
    pointer-events: auto;
    animation: slideDownBanner 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideDownBanner {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.live-banner {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 16px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(0,0,0,0.06);
    line-height: 1.4;
    position: relative;
}

.live-banner.info {
    background: #ebf8ff;
    border-left: 5px solid #3182ce;
    color: #2b6cb0;
}
.live-banner.warning {
    background: #fffaf0;
    border-left: 5px solid #dd6b20;
    color: #c05621;
}
.live-banner.danger {
    background: #fff5f5;
    border-left: 5px solid #e53e3e;
    color: #c53030;
}
.live-banner.success {
    background: #f0fff4;
    border-left: 5px solid #38a169;
    color: #276749;
}

.live-banner-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex: 1;
}

.live-banner-icon {
    font-size: 1.35rem;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 2px;
}

.live-banner-text-wrap {
    flex: 1;
}

.live-banner-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 3px;
    display: block;
    color: #1a202c;
}

.live-banner-message {
    font-size: 0.88rem;
    color: #4a5568;
    display: block;
}

.live-banner-link {
    display: inline-block;
    margin-top: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: underline;
    color: inherit;
}

.live-banner-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    color: #718096;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background 0.2s, color 0.2s;
    flex-shrink: 0;
}

.live-banner-close:hover, .live-banner-close:active {
    background: rgba(0,0,0,0.08);
    color: #1a202c;
}

/* Persistent mode: close button hidden */
.live-banner.persistent .live-banner-close {
    display: none !important;
}

/* Marquee / Laufschrift Style */
.live-banner.style-marquee {
    padding: 9px 14px;
    align-items: center;
    overflow: hidden;
}
.live-banner.style-marquee .live-banner-content {
    align-items: center;
    overflow: hidden;
    position: relative;
    white-space: nowrap;
}
.live-banner.style-marquee .live-banner-text-wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    animation: liveBannerMarquee 22s linear infinite;
    padding-left: 100%;
}
.live-banner.style-marquee:hover .live-banner-text-wrap {
    animation-play-state: paused;
}
.live-banner.style-marquee .live-banner-title {
    display: inline;
    margin-bottom: 0;
}
.live-banner.style-marquee .live-banner-message {
    display: inline;
}
@keyframes liveBannerMarquee {
    0% { transform: translateX(0%); }
    100% { transform: translateX(-100%); }
}

/* Carousel controls */
.live-banner-carousel-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 6px;
    margin-top: 6px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    font-size: 0.78rem;
    color: rgba(0, 0, 0, 0.6);
}
.live-banner-carousel-arrows {
    display: flex;
    gap: 4px;
}
.live-banner-nav-btn {
    background: rgba(0, 0, 0, 0.06);
    border: none;
    border-radius: 4px;
    padding: 2px 7px;
    font-size: 0.8rem;
    cursor: pointer;
    font-weight: bold;
    color: inherit;
    line-height: 1.2;
}
.live-banner-nav-btn:hover {
    background: rgba(0, 0, 0, 0.12);
}
.live-banner-dots {
    display: flex;
    gap: 4px;
    align-items: center;
}
.live-banner-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: all 0.2s ease;
}
.live-banner-dot.active {
    width: 14px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.7);
}

/* Notfall Modal Overlay */
.live-banner-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(6px);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    animation: fadeInModal 0.25s ease-out;
}
@keyframes fadeInModal {
    from { opacity: 0; }
    to { opacity: 1; }
}
.live-banner-modal-card {
    background: white;
    width: 100%;
    max-width: 440px;
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: scaleInModal 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
}
@keyframes scaleInModal {
    from { transform: scale(0.92); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
.live-banner-modal-card.danger {
    border-top: 6px solid #e53e3e;
}
.live-banner-modal-card.warning {
    border-top: 6px solid #dd6b20;
}
.live-banner-modal-card.info {
    border-top: 6px solid #3182ce;
}
.live-banner-modal-card.success {
    border-top: 6px solid #38a169;
}
.live-banner-modal-icon {
    font-size: 2.8rem;
    line-height: 1;
    margin-bottom: 12px;
}
.live-banner-modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 8px;
}
.live-banner-modal-text {
    font-size: 0.95rem;
    color: #475569;
    line-height: 1.5;
    margin-bottom: 18px;
    text-align: left;
}
.live-banner-modal-link {
    display: inline-block;
    margin-bottom: 18px;
    font-size: 0.92rem;
    font-weight: 600;
    color: #00618a;
    text-decoration: underline;
}
.live-banner-modal-btn {
    width: 100%;
    padding: 12px;
    background: #1e293b;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.live-banner-modal-btn:hover, .live-banner-modal-btn:active {
    background: #0f172a;
}

/* ========================================================= */
/* Star Rating & Feedback                                    */
/* ========================================================= */
.star-rating-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 15px 0;
}
.feedback-star {
    font-size: 2.3rem;
    color: #cbd5e1;
    cursor: pointer;
    transition: color 0.15s ease, transform 0.15s ease;
    user-select: none;
    line-height: 1;
}
.feedback-star:hover, .feedback-star.hovered {
    transform: scale(1.18);
    color: #f59e0b;
}
.feedback-star.active {
    color: #f59e0b;
}

/* ========================================================= */
/* Theme Quick-Toggle & Recenter Controls                    */
/* ========================================================= */
.map-quick-btn {
    position: absolute;
    top: 15px;
    z-index: 100;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #1e293b;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(0,0,0,0.14);
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
    padding: 0;
    user-select: none;
}
.map-quick-btn svg {
    display: block;
    width: 20px;
    height: 20px;
    stroke: currentColor;
}
.map-quick-btn:active {
    transform: scale(0.9);
}
.map-quick-btn:hover {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 5px 14px rgba(0, 0, 0, 0.18);
}
.theme-toggle-btn {
    left: 15px;
}
.map-recenter-btn {
    left: 63px;
}
.map-recenter-btn.locating svg {
    animation: recenterPulse 0.5s ease;
}
@keyframes recenterPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.28); color: var(--primary-color, #00618a); }
    100% { transform: scale(1); }
}
#top-media-container.show-image .map-recenter-btn {
    display: none !important;
}

.theme-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99999;
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #ffffff;
    font-size: 0.86rem;
    font-weight: 600;
    padding: 8px 18px;
    border-radius: 24px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.14);
    pointer-events: none;
    white-space: nowrap;
    animation: toastFadeIn 0.25s ease-out;
    letter-spacing: 0.2px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.theme-toast svg {
    display: inline-block;
    width: 18px;
    height: 18px;
    stroke: currentColor;
    flex-shrink: 0;
}
.theme-mode-selector .map-style-btn svg {
    display: inline-block;
    vertical-align: middle;
    margin-right: 5px;
    stroke: currentColor;
}
@keyframes toastFadeIn {
    from { opacity: 0; transform: translate(-50%, -8px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

/* ========================================================= */
/* Night-Illuminated Badge (Abends beleuchtet 🌟)            */
/* ========================================================= */
.badge-night_illuminated,
.badge-night-illuminated {
    background: #f59e0b !important;
    color: #ffffff !important;
}

/* Warm golden pulse/glow in Dark Mode */
.theme-dark .badge-night_illuminated,
.theme-dark .badge-night-illuminated {
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.85);
    animation: nightGlowPulse 2.5s infinite alternate ease-in-out;
}
@keyframes nightGlowPulse {
    0% { box-shadow: 0 0 8px rgba(245, 158, 11, 0.5); }
    100% { box-shadow: 0 0 18px rgba(245, 158, 11, 0.95), 0 0 24px rgba(251, 191, 36, 0.4); }
}

/* ========================================================= */
/* Dark Mode / Dämmerungs-Theme (.theme-dark)                */
/* ========================================================= */
body.theme-dark,
.theme-dark #app {
    background-color: #0b0f19;
    color: #f1f5f9;
}

/* Dark Mode Leaflet Map (CSS Inversion Filter - 100% Free & No API Key Required) */
.theme-dark #map,
.theme-dark .leaflet-container {
    background: #191a1a !important;
}

.theme-dark #map:not(.map-is-satellite) .leaflet-tile-pane,
.theme-dark .leaflet-control-zoom-in,
.theme-dark .leaflet-control-zoom-out,
.theme-dark .leaflet-control-attribution {
    filter: invert(100%) hue-rotate(180deg) brightness(95%) contrast(90%);
    -webkit-filter: invert(100%) hue-rotate(180deg) brightness(95%) contrast(90%);
}

/* Preserve original colors for GPS markers, heading cones, and waypoint dots */
.theme-dark .leaflet-marker-pane,
.theme-dark .leaflet-overlay-pane,
.theme-dark .leaflet-shadow-pane {
    filter: none !important;
    -webkit-filter: none !important;
}

.theme-dark .theme-toggle-btn,
.theme-dark .map-recenter-btn,
.theme-dark .map-quick-btn {
    background: rgba(30, 41, 59, 0.92);
    border-color: rgba(255, 255, 255, 0.18);
    color: #f8fafc;
    box-shadow: 0 3px 12px rgba(0,0,0,0.45);
}
.theme-dark .map-quick-btn:hover {
    background: rgba(45, 59, 82, 0.95);
    box-shadow: 0 5px 16px rgba(0, 0, 0, 0.55);
}

.theme-dark #welcome-screen {
    background-color: #0b0f19;
    color: #f1f5f9;
}
.theme-dark .welcome-content-sheet {
    background: #0f172a;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.45);
}
.theme-dark .welcome-hero-content .welcome-hero-title {
    color: #ffffff !important;
}
.theme-dark .welcome-logo-container:not(.has-dark-logo) #welcome-logo {
    filter: brightness(0) invert(1) drop-shadow(0 2px 8px rgba(0, 0, 0, 0.45));
}
.theme-dark .welcome-logo-container.has-dark-logo #welcome-logo {
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.45));
}
.theme-dark .feature-tag {
    background: #1e293b;
    border-color: #334155;
    color: #94a3b8;
}
.theme-dark .welcome-section-divider span {
    color: #64748b;
}
.theme-dark .lang-card-btn {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}
.theme-dark .lang-card-name {
    color: #f8fafc;
}
.theme-dark .lang-card-btn:hover {
    border-color: #475569;
}
.theme-dark .welcome-legal-link {
    color: #64748b;
}
.theme-dark .welcome-legal-link:hover {
    color: #94a3b8;
}
.theme-dark .welcome-legal-sep {
    color: #334155;
}

.theme-dark #route-selection-screen {
    background: #0b0f19;
}
.theme-dark .route-hero-card {
    border: 1px solid #334155;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}
.theme-dark .route-category-title {
    color: #f8fafc;
}
.theme-dark .route-category-badge {
    color: #94a3b8;
    background: rgba(148, 163, 184, 0.15);
}
.theme-dark .route-card {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}
.theme-dark .route-card h3,
.theme-dark .route-card-title {
    color: #f8fafc;
}
.theme-dark .route-card p,
.theme-dark .route-card .rich-text,
.theme-dark .route-card-desc {
    color: #94a3b8;
}
.theme-dark .route-card-meta {
    border-color: #334155;
    color: #94a3b8;
}
.theme-dark .route-meta-item {
    color: #cbd5e1;
}
.theme-dark .route-meta-item svg {
    color: #94a3b8;
}

.theme-dark #tour-screen {
    background: #0b0f19;
}
.theme-dark #info-panel {
    background: #0f172a;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.4);
}
.theme-dark #info-panel h3,
.theme-dark #info-panel h2 {
    color: #f8fafc;
}
.theme-dark #current-station-desc {
    color: #cbd5e1;
}
.theme-dark #distance-info {
    color: #94a3b8;
}
.theme-dark .bottom-nav-bar {
    background: rgba(15, 23, 42, 0.96);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
}
.theme-dark .nav-item-btn {
    color: #94a3b8;
}
.theme-dark .nav-item-btn:hover,
.theme-dark .nav-item-btn:active {
    color: #f8fafc;
    background: rgba(255, 255, 255, 0.08);
}
.theme-dark .nav-redeem-btn {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}
.theme-dark .nav-circle-btn {
    background: #1e293b;
    border: 1px solid #334155;
    color: #f8fafc;
}
.theme-dark .nav-circle-btn:active {
    background: #334155;
}
.theme-dark .nav-tour-progress {
    background: rgba(30, 41, 59, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
}

.theme-dark .fab-btn {
    background: #1e293b;
    color: #f8fafc;
    border: 1px solid #334155;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}

/* Modals Dark Mode */
.theme-dark .modal-content {
    background: #0f172a;
    color: #f8fafc;
    border: 1px solid #334155;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}
.theme-dark .modal-content h2,
.theme-dark .modal-content h3 {
    color: #f8fafc;
}
.theme-dark .modal-content p {
    color: #cbd5e1;
}

/* Settings Groups Dark Mode */
.theme-dark .settings-group {
    background: #1e293b;
    border: 1px solid #334155;
}
.theme-dark .settings-group-title {
    color: #94a3b8;
}
.theme-dark .settings-app-version {
    color: #64748b;
}
.theme-dark .settings-row {
    color: #f8fafc;
}
.theme-dark .settings-row:hover {
    color: #ffffff;
}
.theme-dark .settings-row-block label {
    color: #cbd5e1;
}
.theme-dark .settings-row-block select {
    background: #0f172a;
    color: #f8fafc;
    border-color: #334155;
}
.theme-dark .map-style-btn {
    background: #0f172a;
    border-color: #334155;
    color: #94a3b8;
}
.theme-dark .map-style-btn.active {
    border-color: var(--primary-color);
    color: #f8fafc;
    background: rgba(200, 0, 0, 0.25);
}
.theme-dark .settings-action-btn {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}
.theme-dark .settings-legal-link {
    background: #0f172a !important;
    border-color: #334155 !important;
    color: #cbd5e1 !important;
}
.theme-dark .settings-legal-link:hover,
.theme-dark .settings-legal-link:active {
    background: #334155 !important;
    color: #ffffff !important;
}
.theme-dark .settings-action-btn.warning {
    background: #0f172a !important;
    border-color: #334155 !important;
    color: #cbd5e1 !important;
}
.theme-dark .settings-action-btn.warning:active {
    background: #334155 !important;
    color: #e74c3c !important;
}
.theme-dark .settings-action-btn.feedback-action-btn:hover {
    background: #334155 !important;
}

/* Ticket Unlock Modal Dark Mode */
.theme-dark .unlock-prices-box {
    background: #1e293b;
    border-color: #334155;
}
.theme-dark .unlock-prices-box small {
    color: #94a3b8;
}
.theme-dark .unlock-prices-table thead tr {
    border-bottom-color: #334155;
    color: #94a3b8;
}
.theme-dark .unlock-prices-table td {
    border-bottom-color: #334155;
}
.theme-dark .unlock-prices-table td.price-label {
    color: #f1f5f9;
}
.theme-dark .unlock-prices-table td.price-reg {
    color: #cbd5e1;
}
.theme-dark .unlock-prices-table td.price-erm {
    color: var(--primary-color);
}
.theme-dark .unlock-prices-empty {
    color: #94a3b8;
}
.theme-dark .unlock-redeem-hint {
    background: #1e293b;
    border-color: #475569;
}
.theme-dark .unlock-redeem-hint span {
    color: #cbd5e1;
}
.theme-dark .secondary-btn {
    background: #1e293b !important;
    color: #f8fafc !important;
    border: 1px solid #334155 !important;
}
.theme-dark .secondary-btn:hover,
.theme-dark .secondary-btn:active {
    background: #334155 !important;
    color: #ffffff !important;
}

/* Online-Shop Configurator inside Unlock Modal (Light & Dark Mode) */
.pwa-shop-steps-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 6px 10px;
    margin-bottom: 16px;
    gap: 8px;
}
.pwa-shop-step-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #64748b;
    padding: 4px 6px;
    min-width: 28px;
    height: 28px;
    border-radius: 14px;
    cursor: default;
    background: transparent;
    transition: all 0.2s ease;
    user-select: none;
    box-sizing: border-box;
}
.pwa-shop-step-pill.is-active {
    background: var(--primary-color, #00618a);
    color: #ffffff;
    padding: 4px 12px;
    box-shadow: 0 2px 6px rgba(0, 97, 138, 0.25);
    cursor: default;
}
.pwa-shop-step-pill.is-completed {
    color: var(--primary-color, #00618a);
    background: rgba(0, 97, 138, 0.1);
    cursor: pointer;
}
.pwa-shop-step-pill.is-completed:hover {
    background: rgba(0, 97, 138, 0.18);
}
.pwa-step-num {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(0,0,0,0.06);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1;
}
.pwa-shop-step-pill.is-active .pwa-step-num {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}
.pwa-shop-step-pill.is-completed .pwa-step-num {
    background: var(--primary-color, #00618a);
    color: #ffffff;
}
.pwa-shop-step-label {
    white-space: nowrap;
    font-size: 0.78rem;
    font-weight: 700;
}
.pwa-shop-step-arrow {
    color: #cbd5e1;
    font-size: 0.85rem;
    font-weight: 900;
    flex-shrink: 0;
}

/* Step 1: Ticket-Type Selection Cards */
.pwa-shop-type-card {
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 12px;
    cursor: pointer;
    background: #ffffff;
    text-align: left;
    transition: all 0.2s ease;
    position: relative;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}
.pwa-shop-type-card:hover {
    border-color: #cbd5e1;
    transform: translateY(-1px);
}
.pwa-shop-type-card.is-selected {
    border-color: var(--primary-color, #00618a);
    background: rgba(var(--primary-rgb, 0, 97, 138), 0.05);
    box-shadow: 0 4px 12px rgba(var(--primary-rgb, 0, 97, 138), 0.12);
}
.pwa-shop-type-card.is-pass {
    border-color: #fef08a;
    background: #fffdf5;
}
.pwa-shop-type-card.is-pass:hover {
    border-color: #fde047;
}
.pwa-shop-type-card.is-pass.is-selected {
    border-color: #ca8a04;
    background: #fefce8;
    box-shadow: 0 4px 14px rgba(202, 138, 4, 0.18);
}
.pwa-shop-type-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
    gap: 8px;
}
.pwa-shop-type-title {
    font-size: 0.98rem;
    font-weight: 800;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 6px;
}
.pwa-shop-type-card.is-pass .pwa-shop-type-title {
    color: #713f12;
}
.pwa-shop-type-badge {
    background: #fef08a;
    color: #854d0e;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 999px;
    letter-spacing: 0.02em;
}
.pwa-shop-type-desc {
    font-size: 0.8rem;
    color: #64748b;
    line-height: 1.4;
    margin-bottom: 10px;
}
.pwa-shop-type-features {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 0.76rem;
    color: #475569;
    margin-bottom: 10px;
}
.pwa-shop-type-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 8px;
    border-top: 1px solid #f1f5f9;
}
.pwa-shop-type-price-from {
    font-size: 0.82rem;
    font-weight: 700;
    color: #0f172a;
}
.pwa-shop-type-card.is-pass .pwa-shop-type-price-from {
    color: #854d0e;
}
.pwa-shop-radio-circle {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid #cbd5e1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 900;
}
.pwa-shop-type-card.is-selected .pwa-shop-radio-circle {
    border-color: var(--primary-color, #00618a);
    background: var(--primary-color, #00618a);
}
.pwa-shop-type-card.is-pass.is-selected .pwa-shop-radio-circle {
    border-color: #ca8a04;
    background: #ca8a04;
}

/* Selected Ticket Badge Pill */
.pwa-shop-selected-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 20px;
    background: #f1f5f9;
    color: #334155;
    font-size: 0.78rem;
    font-weight: 700;
    margin-bottom: 12px;
    border: 1px solid #e2e8f0;
}
.pwa-shop-selected-badge.is-pass {
    background: #fefce8;
    color: #854d0e;
    border-color: #fef08a;
}

/* Wizard Navigation Rows */
.pwa-shop-nav-row {
    display: flex;
    gap: 8px;
    margin-top: 14px;
    align-items: center;
}
.pwa-shop-btn-next {
    flex: 1;
    padding: 12px 16px;
    background: var(--primary-color, #00618a);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-weight: 800;
    font-size: 0.92rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: opacity 0.2s, transform 0.1s;
    box-shadow: 0 3px 8px rgba(0,0,0,0.1);
}
.pwa-shop-btn-next:active {
    transform: scale(0.99);
}
.pwa-shop-btn-back {
    padding: 12px 14px;
    background: #f8fafc;
    color: #475569;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: background 0.15s;
}
.pwa-shop-btn-back:hover {
    background: #f1f5f9;
}

/* Subtotal in Step 3 */
.pwa-shop-subtotal-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 0.86rem;
    color: #334155;
    text-align: right;
    margin-top: 8px;
}

/* Detailed Order Summary in Step 4 */
.pwa-shop-checkout-card {
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 14px;
}
.pwa-shop-checkout-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px dashed #e2e8f0;
    font-size: 0.82rem;
    color: #475569;
}
.pwa-shop-checkout-line:last-child {
    border-bottom: none;
    padding-top: 10px;
    margin-top: 4px;
}

.pwa-shop-section-title {
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #475569;
    margin-bottom: 8px;
}
.pwa-shop-tier-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 6px;
    border-radius: 10px;
    border: 2px solid #e2e8f0;
    background: #ffffff;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s;
}
.pwa-shop-tier-btn.is-selected {
    border-color: var(--primary-color, #00618a);
    background: rgba(var(--primary-rgb, 0, 97, 138), 0.08);
}
.pwa-shop-tier-title {
    font-weight: 700;
    font-size: 0.88rem;
    color: #0f172a;
}
.pwa-shop-tier-sub {
    font-size: 0.75rem;
    color: #64748b;
}
.pwa-shop-tier-radio {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #cbd5e1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 800;
    flex-shrink: 0;
}
.pwa-shop-tier-btn.is-selected .pwa-shop-tier-radio {
    border-color: var(--primary-color, #00618a);
    background: var(--primary-color, #00618a);
}
.pwa-shop-devices-box {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 12px;
}
.pwa-shop-device-row-divider {
    border-bottom: 1px solid #f1f5f9;
}
.pwa-shop-device-title {
    font-weight: 700;
    font-size: 0.88rem;
    color: #0f172a;
}
.pwa-shop-device-sub {
    font-size: 0.76rem;
    color: #64748b;
}
.pwa-shop-step-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #0f172a;
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.pwa-shop-step-count {
    min-width: 24px;
    text-align: center;
    font-weight: 800;
    font-size: 0.95rem;
    color: #0f172a;
}
.pwa-shop-email-input {
    width: 100%;
    box-sizing: border-box;
    padding: 9px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.84rem;
    background: #ffffff;
    color: #0f172a;
}
.pwa-shop-email-input.is-required-empty {
    border-color: #93c5fd;
}
.pwa-shop-summary-box {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.pwa-shop-summary-title {
    font-size: 0.8rem;
    color: #1e3a8a;
    font-weight: 700;
}
.pwa-shop-summary-tax {
    font-size: 0.72rem;
    color: #3b82f6;
}
.pwa-shop-summary-instant {
    font-size: 0.72rem;
    color: #15803d;
    font-weight: 600;
    margin-top: 1px;
}
.pwa-shop-summary-price {
    font-size: 1.22rem;
    font-weight: 900;
    color: #0f172a;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Dark Mode Overrides for Online-Shop Configurator */
.theme-dark .pwa-shop-section-title {
    color: #94a3b8 !important;
}
.theme-dark .pwa-shop-tier-btn {
    background: #0f172a !important;
    border-color: #334155 !important;
}
.theme-dark .pwa-shop-tier-btn.is-selected {
    border-color: var(--primary-color, #38bdf8) !important;
    background: rgba(var(--primary-rgb, 56, 189, 248), 0.18) !important;
}
.theme-dark .pwa-shop-tier-title {
    color: #f8fafc !important;
}
.theme-dark .pwa-shop-tier-sub {
    color: #94a3b8 !important;
}
.theme-dark .pwa-shop-tier-radio {
    background: #1e293b !important;
    border-color: #475569 !important;
}
.theme-dark .pwa-shop-tier-btn.is-selected .pwa-shop-tier-radio {
    border-color: var(--primary-color, #38bdf8) !important;
    background: var(--primary-color, #00618a) !important;
    color: #ffffff !important;
}
.theme-dark .pwa-shop-devices-box {
    background: #0f172a !important;
    border-color: #334155 !important;
}
.theme-dark .pwa-shop-device-row-divider {
    border-bottom-color: #1e293b !important;
}
.theme-dark .pwa-shop-device-title {
    color: #f8fafc !important;
}
.theme-dark .pwa-shop-device-sub {
    color: #94a3b8 !important;
}
.theme-dark .pwa-shop-step-btn {
    background: #1e293b !important;
    border-color: #475569 !important;
    color: #f8fafc !important;
}
.theme-dark .pwa-shop-step-btn:active {
    background: #334155 !important;
}
.theme-dark .pwa-shop-step-count {
    color: #f8fafc !important;
}
.theme-dark .pwa-shop-email-input {
    background: #0f172a !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}
.theme-dark .pwa-shop-email-input::placeholder {
    color: #64748b !important;
}
.theme-dark .pwa-shop-email-input.is-required-empty {
    border-color: #3b82f6 !important;
}
.theme-dark .pwa-shop-summary-box {
    background: rgba(30, 58, 138, 0.32) !important;
    border-color: rgba(59, 130, 246, 0.4) !important;
}
.theme-dark .pwa-shop-summary-title {
    color: #e0f2fe !important;
}
.theme-dark .pwa-shop-summary-tax {
    color: #93c5fd !important;
}
.theme-dark .pwa-shop-summary-instant {
    color: #4ade80 !important;
}
.theme-dark .pwa-shop-steps-bar {
    background: #1e293b !important;
    border-color: #334155 !important;
}
.theme-dark .pwa-shop-step-pill {
    color: #94a3b8 !important;
}
.theme-dark .pwa-shop-step-pill .pwa-step-num {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #94a3b8 !important;
}
.theme-dark .pwa-shop-step-pill.is-active {
    background: var(--primary-color, #00618a) !important;
    color: #ffffff !important;
}
.theme-dark .pwa-shop-step-pill.is-active .pwa-step-num {
    background: rgba(255, 255, 255, 0.25) !important;
    color: #ffffff !important;
}
.theme-dark .pwa-shop-step-pill.is-completed {
    color: #38bdf8 !important;
    background: rgba(56, 189, 248, 0.15) !important;
}
.theme-dark .pwa-shop-step-pill.is-completed:hover {
    background: rgba(56, 189, 248, 0.25) !important;
}
.theme-dark .pwa-shop-step-pill.is-completed .pwa-step-num {
    background: #0284c7 !important;
    color: #ffffff !important;
}
.theme-dark .pwa-shop-step-arrow {
    color: #475569 !important;
}
.theme-dark .pwa-shop-type-card {
    background: #1e293b !important;
    border-color: #334155 !important;
}
.theme-dark .pwa-shop-type-card:hover {
    border-color: #475569 !important;
}
.theme-dark .pwa-shop-type-title {
    color: #f8fafc !important;
}
.theme-dark .pwa-shop-type-desc {
    color: #94a3b8 !important;
}
.theme-dark .pwa-shop-type-features {
    color: #cbd5e1 !important;
}
.theme-dark .pwa-shop-type-footer {
    border-top-color: #334155 !important;
}
.theme-dark .pwa-shop-type-price-from {
    color: #f8fafc !important;
}
.theme-dark .pwa-shop-type-card.is-pass {
    background: #262211 !important;
    border-color: #713f12 !important;
}
.theme-dark .pwa-shop-type-card.is-pass:hover {
    border-color: #a16207 !important;
}
.theme-dark .pwa-shop-type-card.is-pass.is-selected {
    border-color: #ca8a04 !important;
    background: #3c3314 !important;
}
.theme-dark .pwa-shop-type-card.is-pass .pwa-shop-type-title {
    color: #fef08a !important;
}
.theme-dark .pwa-shop-type-card.is-pass .pwa-shop-type-price-from {
    color: #fef08a !important;
}
.theme-dark .pwa-shop-selected-badge {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #e2e8f0 !important;
}
.theme-dark .pwa-shop-selected-badge.is-pass {
    background: #3c3314 !important;
    border-color: #854d0e !important;
    color: #fef08a !important;
}
.theme-dark .pwa-shop-btn-back {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #cbd5e1 !important;
}
.theme-dark .pwa-shop-btn-back:hover {
    background: #334155 !important;
}
.theme-dark .pwa-shop-subtotal-box {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #cbd5e1 !important;
}
.theme-dark .pwa-shop-checkout-card {
    background: #1e293b !important;
    border-color: #334155 !important;
}
.theme-dark .pwa-shop-checkout-line {
    border-color: #334155 !important;
    color: #cbd5e1 !important;
}


/* Redeem Sheet Dark Mode */
.theme-dark .sheet-overlay .bottom-sheet {
    background: #0f172a;
    color: #f8fafc;
    border-top: 1px solid #334155;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.6);
}
.theme-dark .sheet-title {
    color: #f8fafc;
}
.theme-dark .sheet-desc {
    color: #94a3b8;
}
.theme-dark .sheet-handle {
    background: #334155;
}
.theme-dark .sheet-close-btn {
    background: #1e293b;
    color: #94a3b8;
    border-color: #334155;
}
.theme-dark .sheet-close-btn:hover {
    background: #334155;
    color: #ffffff;
}
.theme-dark .sheet-input-wrap input {
    background: #1e293b;
    color: #f8fafc;
    border-color: #334155;
}
.theme-dark .sheet-input-wrap input::placeholder {
    color: #64748b;
}

/* Favorites & Info Modal Dark Mode */
.theme-dark .favorite-card {
    background: #1e293b;
    border-color: #334155;
}
.theme-dark .favorite-title {
    color: #f8fafc;
}
.theme-dark #info-modal-body p {
    color: #cbd5e1;
}
.theme-dark #info-modal-body strong {
    color: #f8fafc;
}

/* Feedback Modal Styling */
#feedback-submit-btn {
    border: none !important;
    border-radius: var(--border-radius-btn, 10px) !important;
    background-color: var(--primary-color) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    font-size: 0.95rem !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.18) !important;
    transition: transform 0.15s ease, opacity 0.15s ease, box-shadow 0.15s ease !important;
}
#feedback-submit-btn:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    transform: none !important;
}
#feedback-submit-btn:not(:disabled):active {
    transform: scale(0.97) !important;
}

/* Feedback Modal Dark Mode */
.theme-dark #feedback-modal p {
    color: #94a3b8;
}
.theme-dark #feedback-comment {
    background: #1e293b;
    color: #f8fafc;
    border-color: #334155;
}
.theme-dark #feedback-comment::placeholder {
    color: #64748b;
}
.theme-dark #feedback-modal .secondary-btn {
    background: #1e293b !important;
    color: #cbd5e1 !important;
    border-color: #334155 !important;
}

/* --- Accessibility: Font Size Switcher (Root & Global Scaling) --- */
html.font-size-normal, body.font-size-normal {
    font-size: 16px !important;
}

html.font-size-medium, body.font-size-medium {
    font-size: 18px !important;
}

html.font-size-large, body.font-size-large {
    font-size: 21px !important;
}

/* --- Accessibility: Medium (A+ / 115%) Targeted Overrides --- */
/* 1. Routen-Auswahl */
.font-size-medium .route-card h3 {
    font-size: 1.65rem !important;
    line-height: 1.35 !important;
}
.font-size-medium .route-card p,
.font-size-medium .route-card .rich-text,
.font-size-medium .route-card .rich-text * {
    font-size: 1.12rem !important;
    line-height: 1.55 !important;
}
.font-size-medium .route-card-meta,
.font-size-medium .route-card-meta * {
    font-size: 0.95rem !important;
}
.font-size-medium .route-card-btn {
    font-size: 1.25rem !important;
    padding: 18px !important;
}
.font-size-medium .route-status-badge {
    font-size: 0.85rem !important;
}

/* 2. Menü, Einstellungen & Options */
.font-size-medium #settings-modal h2 {
    font-size: 1.65rem !important;
}
.font-size-medium .settings-group-title {
    font-size: 0.88rem !important;
    letter-spacing: 0.6px !important;
}
.font-size-medium .settings-row,
.font-size-medium .settings-row span {
    font-size: 1.1rem !important;
}
.font-size-medium .settings-row-block label {
    font-size: 1.05rem !important;
}
.font-size-medium .settings-row-block select {
    font-size: 1.05rem !important;
    padding: 12px !important;
}
.font-size-medium .map-style-btn,
.font-size-medium .map-style-btn span:not(.font-size-glyph) {
    font-size: 1.02rem !important;
}
.font-size-medium .settings-action-btn,
.font-size-medium .settings-legal-link {
    font-size: 1.05rem !important;
    padding: 13px !important;
}

/* 3. Station, Audio & Infopanel */
.font-size-medium #current-station-title {
    font-size: 1.65rem !important;
}
.font-size-medium #nav-target-title {
    font-size: 1.35rem !important;
}
.font-size-medium #distance-info {
    font-size: 1.05rem !important;
}
.font-size-medium #current-station-desc,
.font-size-medium #current-station-desc *,
.font-size-medium #info-text,
.font-size-medium .info-panel-body,
.font-size-medium .bottom-sheet p,
.font-size-medium .bottom-sheet span {
    font-size: 1.15rem !important;
    line-height: 1.65 !important;
}
.font-size-medium #next-station-btn {
    font-size: 1.25rem !important;
    padding: 18px !important;
}

/* 4. Modals (Info, Favoriten, Feedback, Ticket, Unlock) */
.font-size-medium .modal-content h2,
.font-size-medium .sheet-title {
    font-size: 1.6rem !important;
}
.font-size-medium .modal-content p,
.font-size-medium .modal-content span,
.font-size-medium .sheet-desc {
    font-size: 1.1rem !important;
}
.font-size-medium #info-modal-body,
.font-size-medium #info-modal-body * {
    font-size: 1.15rem !important;
    line-height: 1.65 !important;
}
.font-size-medium .favorite-item-title {
    font-size: 1.1rem !important;
}
.font-size-medium .favorite-item-desc {
    font-size: 0.95rem !important;
}
.font-size-medium #feedback-comment {
    font-size: 1.05rem !important;
}
.font-size-medium .modal-content .secondary-btn {
    font-size: 1.05rem !important;
}

/* 5. Willkommensbildschirm */
.font-size-medium .welcome-hero-title {
    font-size: clamp(1.6rem, 5.5vw, 2.1rem) !important;
}
.font-size-medium .welcome-badge-org {
    font-size: 0.85rem !important;
}
.font-size-medium .welcome-feature-tags .feature-tag {
    font-size: 0.92rem !important;
}
.font-size-medium .resume-tour-info strong {
    font-size: 1.15rem !important;
}
.font-size-medium .resume-tour-details {
    font-size: 0.95rem !important;
}
.font-size-medium #welcome-text {
    font-size: 1.05rem !important;
}
.font-size-medium .lang-btn {
    font-size: 1.15rem !important;
}
.font-size-medium .welcome-legal-link {
    font-size: 0.95rem !important;
}


/* --- Accessibility: Large (A++ / 130%) Targeted Overrides --- */
/* 1. Routen-Auswahl */
.font-size-large .route-card h3 {
    font-size: 1.85rem !important;
    line-height: 1.35 !important;
}
.font-size-large .route-card p,
.font-size-large .route-card .rich-text,
.font-size-large .route-card .rich-text * {
    font-size: 1.3rem !important;
    line-height: 1.65 !important;
}
.font-size-large .route-card-meta,
.font-size-large .route-card-meta * {
    font-size: 1.08rem !important;
}
.font-size-large .route-card-btn {
    font-size: 1.4rem !important;
    padding: 20px !important;
}
.font-size-large .route-status-badge {
    font-size: 0.95rem !important;
}

/* 2. Menü, Einstellungen & Options */
.font-size-large #settings-modal h2 {
    font-size: 1.85rem !important;
}
.font-size-large .settings-group-title {
    font-size: 1rem !important;
    letter-spacing: 0.7px !important;
}
.font-size-large .settings-row,
.font-size-large .settings-row span {
    font-size: 1.25rem !important;
}
.font-size-large .settings-row-block label {
    font-size: 1.18rem !important;
}
.font-size-large .settings-row-block select {
    font-size: 1.2rem !important;
    padding: 13px !important;
}
.font-size-large .map-style-btn,
.font-size-large .map-style-btn span:not(.font-size-glyph) {
    font-size: 1.15rem !important;
}
.font-size-large .settings-action-btn,
.font-size-large .settings-legal-link {
    font-size: 1.18rem !important;
    padding: 15px !important;
}

/* 3. Station, Audio & Infopanel */
.font-size-large #current-station-title {
    font-size: 1.85rem !important;
}
.font-size-large #nav-target-title {
    font-size: 1.55rem !important;
}
.font-size-large #distance-info {
    font-size: 1.2rem !important;
}
.font-size-large #current-station-desc,
.font-size-large #current-station-desc *,
.font-size-large #info-text,
.font-size-large .info-panel-body,
.font-size-large .bottom-sheet p,
.font-size-large .bottom-sheet span {
    font-size: 1.35rem !important;
    line-height: 1.75 !important;
}
.font-size-large #next-station-btn {
    font-size: 1.45rem !important;
    padding: 20px !important;
}

/* 4. Modals (Info, Favoriten, Feedback, Ticket, Unlock) */
.font-size-large .modal-content h2,
.font-size-large .sheet-title {
    font-size: 1.85rem !important;
}
.font-size-large .modal-content p,
.font-size-large .modal-content span,
.font-size-large .sheet-desc {
    font-size: 1.25rem !important;
}
.font-size-large #info-modal-body,
.font-size-large #info-modal-body * {
    font-size: 1.35rem !important;
    line-height: 1.75 !important;
}
.font-size-large .favorite-item-title {
    font-size: 1.25rem !important;
}
.font-size-large .favorite-item-desc {
    font-size: 1.1rem !important;
}
.font-size-large #feedback-comment {
    font-size: 1.2rem !important;
}
.font-size-large .modal-content .secondary-btn {
    font-size: 1.2rem !important;
}

/* 5. Willkommensbildschirm */
.font-size-large .welcome-hero-title {
    font-size: clamp(1.8rem, 6.5vw, 2.4rem) !important;
}
.font-size-large .welcome-badge-org {
    font-size: 0.95rem !important;
}
.font-size-large .welcome-feature-tags .feature-tag {
    font-size: 1.08rem !important;
}
.font-size-large .resume-tour-info strong {
    font-size: 1.3rem !important;
}
.font-size-large .resume-tour-details {
    font-size: 1.1rem !important;
}
.font-size-large #welcome-text {
    font-size: 1.2rem !important;
}
.font-size-large .lang-btn {
    font-size: 1.3rem !important;
}
.font-size-large .welcome-legal-link {
    font-size: 1.1rem !important;
}

/* Font Size Selector in Settings */
.font-size-selector {
    display: flex;
    gap: 8px;
}
.font-size-selector .map-style-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 10px 6px;
}

/* ========================================================= */
/* DSGVO Cookie-Banner & Consent-Management                  */
/* ========================================================= */
.cookie-banner-overlay {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 999999;
    padding: 16px;
    display: flex;
    justify-content: center;
    pointer-events: none;
    animation: cookieSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes cookieSlideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.cookie-banner-card {
    pointer-events: auto;
    width: 100%;
    max-width: 520px;
    background: #ffffff;
    color: #1e293b;
    border-radius: 16px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(0, 0, 0, 0.08);
    padding: 20px 22px;
    font-size: 0.9rem;
    line-height: 1.45;
}

.cookie-banner-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.cookie-banner-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}
.cookie-banner-desc {
    color: #475569;
    margin: 0 0 14px 0;
    font-size: 0.86rem;
}
.cookie-banner-links {
    margin: 6px 0 14px 0;
    font-size: 0.82rem;
}
.cookie-banner-links a {
    color: var(--primary-color, #00618a);
    text-decoration: underline;
    margin-right: 12px;
}

.cookie-options-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
    background: #f8fafc;
    border-radius: 10px;
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
}
.cookie-option-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.cookie-option-info {
    flex: 1;
}
.cookie-option-name {
    font-weight: 600;
    font-size: 0.88rem;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 6px;
}
.cookie-badge-req {
    font-size: 0.72rem;
    padding: 1px 6px;
    background: #e2e8f0;
    color: #475569;
    border-radius: 4px;
    font-weight: normal;
}
.cookie-option-desc {
    font-size: 0.78rem;
    color: #64748b;
    margin-top: 2px;
}

.cookie-btn-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.cookie-btn {
    flex: 1;
    min-width: 110px;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.15s ease;
    text-align: center;
}
.cookie-btn-primary {
    background: var(--primary-color, #00618a);
    color: #ffffff;
}
.cookie-btn-primary:hover {
    filter: brightness(1.08);
}
.cookie-btn-secondary {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #cbd5e1;
}
.cookie-btn-secondary:hover {
    background: #e2e8f0;
}
.cookie-btn-link {
    background: transparent;
    color: #64748b;
    text-decoration: underline;
    font-size: 0.82rem;
    padding: 8px;
    width: 100%;
    margin-top: 4px;
    border: none;
    cursor: pointer;
}

/* Dark Mode for Cookie Banner */
.theme-dark .cookie-banner-card {
    background: #0f172a;
    color: #f8fafc;
    border-color: #334155;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.6);
}
.theme-dark .cookie-banner-title {
    color: #ffffff;
}
.theme-dark .cookie-banner-desc {
    color: #94a3b8;
}
.theme-dark .cookie-options-list {
    background: #1e293b;
    border-color: #334155;
}
.theme-dark .cookie-option-name {
    color: #f8fafc;
}
.theme-dark .cookie-badge-req {
    background: #334155;
    color: #94a3b8;
}
.theme-dark .cookie-option-desc {
    color: #94a3b8;
}
.theme-dark .cookie-btn-secondary {
    background: #1e293b;
    color: #f8fafc;
    border-color: #334155;
}
.theme-dark .cookie-btn-secondary:hover {
    background: #334155;
}

/* ========================================================= */
/* Wartungsmodus / Maintenance Screen                         */
/* ========================================================= */
.maintenance-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #ffffff;
    z-index: 9999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.maintenance-box {
    background: rgba(30, 41, 59, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    padding: 35px 28px;
    max-width: 460px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}
.maintenance-icon {
    font-size: 3.5rem;
    margin-bottom: 15px;
    line-height: 1;
}
.maintenance-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin: 0 0 12px 0;
    color: #ffffff;
}
.maintenance-text {
    font-size: 0.98rem;
    color: #cbd5e1;
    line-height: 1.6;
    margin-bottom: 25px;
}
.maintenance-pin-card {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.maintenance-pin-form {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 10px;
}
.maintenance-pin-input {
    width: 140px;
    text-align: center;
    font-size: 1.1rem;
    letter-spacing: 4px;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(15, 23, 42, 0.6);
    color: #ffffff;
}
.maintenance-pin-btn {
    padding: 10px 18px;
    border-radius: 8px;
    background: var(--primary-color, #00618a);
    color: #ffffff;
    border: none;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.95rem;
}






/* --- Dynamic Design System Variables (Tab 8.1) --- */
.btn-primary, .btn-secondary, .tour-start-btn, .action-button, button.primary-btn, .start-tour-btn {
    border-radius: var(--border-radius-btn, 8px) !important;
}

.station-card, .route-card, .card {
    border-radius: var(--border-radius-card, 12px);
}

@keyframes activeMarkerPulseAnimation {
    0% { transform: scale(0.6); opacity: 0.9; }
    100% { transform: scale(1.8); opacity: 0; }
}

.active-marker-pulse {
    position: absolute;
    top: -8px;
    left: -8px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    animation: activeMarkerPulseAnimation 1.8s infinite ease-out;
    pointer-events: none;
    z-index: -1;
}

/* --- Free CSS-Filtered Map Styles (No API Key Required) --- */
.map-style-dark:not(.map-is-satellite) .leaflet-tile-pane {
    filter: invert(100%) hue-rotate(180deg) brightness(95%) contrast(90%) !important;
    -webkit-filter: invert(100%) hue-rotate(180deg) brightness(95%) contrast(90%) !important;
}

.map-style-clean:not(.map-is-satellite) .leaflet-tile-pane {
    filter: grayscale(85%) contrast(106%) brightness(103%) !important;
    -webkit-filter: grayscale(85%) contrast(106%) brightness(103%) !important;
}

.map-style-dark .leaflet-marker-pane,
.map-style-dark .leaflet-overlay-pane,
.map-style-dark .leaflet-shadow-pane,
.map-style-clean .leaflet-marker-pane,
.map-style-clean .leaflet-overlay-pane,
.map-style-clean .leaflet-shadow-pane {
    filter: none !important;
    -webkit-filter: none !important;
}

/* ==========================================================================
   RTL (Right-to-Left) Language Support (Arabic, Hebrew, Persian/Farsi, Urdu)
   ========================================================================== */

/* 1. Global Typography & Direction */
[dir="rtl"],
body.rtl-mode {
    direction: rtl;
    text-align: right;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans Arabic", "Noto Sans Hebrew", "Cairo", Tahoma, Arial, sans-serif;
}

/* IMPORTANT: Arabic script is cursive; letter-spacing disconnects ligatures! */
[dir="rtl"] *,
body.rtl-mode * {
    letter-spacing: normal !important;
}

/* 2. Text Alignment & Layout Adjustments */
[dir="rtl"] .resume-tour-info,
[dir="rtl"] .lang-card-btn,
[dir="rtl"] .favorites-list,
[dir="rtl"] .settings-scroll-body,
[dir="rtl"] .unlock-prices-box,
[dir="rtl"] .live-banner-modal-text,
[dir="rtl"] .modal-content,
[dir="rtl"] .bottom-sheet,
[dir="rtl"] #info-modal-body,
[dir="rtl"] .route-card-content,
[dir="rtl"] .route-card p,
[dir="rtl"] .route-card .rich-text,
[dir="rtl"] #current-station-desc,
[dir="rtl"] #nav-target-title,
[dir="rtl"] #current-station-title {
    text-align: right;
}

/* Price matrix in unlock modal */
[dir="rtl"] .unlock-prices-table th.price-th-label,
[dir="rtl"] .unlock-prices-table td.price-label {
    text-align: right;
}
[dir="rtl"] .unlock-prices-table th.price-th-val,
[dir="rtl"] .unlock-prices-table td.price-val {
    text-align: left;
}

/* 3. Absolute Position Inversions */
[dir="rtl"] .sheet-close-btn {
    right: auto;
    left: 18px;
}

[dir="rtl"] .theme-toggle-btn {
    left: auto;
    right: 15px;
}

[dir="rtl"] .map-recenter-btn {
    left: auto;
    right: 63px;
}

[dir="rtl"] .poi-favorite-btn {
    right: auto;
    left: 15px;
}

[dir="rtl"] .fab-container {
    right: auto;
    left: 20px;
}

[dir="rtl"] .route-badges {
    left: auto;
    right: 15px;
}

[dir="rtl"] .route-status-badges-group {
    right: auto;
    left: 10px;
    align-items: flex-start;
}

[dir="rtl"] .route-hero-slider-arrow.prev {
    left: auto;
    right: 12px;
    transform: translateY(-50%) scaleX(-1);
}
[dir="rtl"] .route-hero-slider-arrow.next {
    right: auto;
    left: 12px;
    transform: translateY(-50%) scaleX(-1);
}
[dir="rtl"] .route-hero-slider[data-animation="slide-h"] .route-hero-slide {
    transform: translateX(-100%);
}
[dir="rtl"] .route-hero-slider[data-animation="slide-h"] .route-hero-slide.is-active {
    transform: translateX(0);
}
[dir="rtl"] .route-hero-slider[data-animation="slide-h"] .route-hero-slide.is-prev {
    transform: translateX(100%);
}
[dir="rtl"] .route-hero-slider[data-animation="slide-h"] .route-hero-slide.is-next {
    transform: translateX(-100%);
}

/* 4. Directional Icon Mirroring */
[dir="rtl"] .resume-tour-btn svg,
[dir="rtl"] .flip-in-rtl {
    transform: scaleX(-1);
}

/* 5. Strict LTR Isolation: Codes, Phone Numbers, PINs, Media Players */
/* According to international standards, media playback and token inputs stay LTR */
[dir="rtl"] #promo-code-input,
[dir="rtl"] .maintenance-pin-input,
[dir="rtl"] .station-meta-phone,
[dir="rtl"] .station-meta-linkurl,
[dir="rtl"] .keep-ltr,
[dir="rtl"] audio,
[dir="rtl"] .audio-progress-bar,
[dir="rtl"] .audio-timeline,
[dir="rtl"] .time-display {
    direction: ltr !important;
    text-align: left !important;
    unicode-bidi: embed;
}

/* Numbers & coordinates display */
[dir="rtl"] .coord-badge,
[dir="rtl"] .distance-badge,
[dir="rtl"] .stat-code {
    direction: ltr;
    display: inline-block;
}

/* ==========================================================================
   FREE DISCOVERY MODE & SMART ARRIVAL NOTIFICATIONS
   ========================================================================== */

.nav-tour-progress.is-clickable {
    cursor: pointer;
    transition: transform 0.15s ease, background 0.2s ease;
}
.nav-tour-progress.is-clickable:active {
    transform: scale(0.96);
    background: #e2e8f0;
}

/* Smart Arrival Toast */
.poi-arrival-toast {
    position: absolute;
    bottom: calc(var(--bottom-sheet-peek, 70px) + 14px);
    left: 12px;
    right: 12px;
    z-index: 1005;
    background: rgba(15, 23, 42, 0.94);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #ffffff;
    border-radius: 14px;
    padding: 10px 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.15);
    animation: toastSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes toastSlideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.poi-arrival-toast-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.poi-arrival-toast-icon {
    font-size: 1.4rem;
    line-height: 1;
}

.poi-arrival-toast-body {
    flex: 1;
    min-width: 0;
}

.poi-arrival-toast-title {
    font-weight: 700;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #ffffff;
}

.poi-arrival-toast-sub {
    font-size: 0.76rem;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}

.poi-arrival-toast-btn {
    background: #10b981;
    color: #ffffff;
    border: none;
    padding: 6px 13px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.4);
    transition: transform 0.15s ease;
}

.poi-arrival-toast-btn:active {
    transform: scale(0.95);
}

.poi-arrival-toast-close {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

/* Route POIs Modal Items */
.route-poi-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.route-poi-item:hover, .route-poi-item:active {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.route-poi-item:active {
    transform: scale(0.99);
}

.route-poi-item.is-active-target {
    background: #f0f9ff;
    border-color: var(--primary-color);
}

.route-poi-item.is-visited {
    background: #f8fafc;
    border-color: #d1fae5;
}

.route-poi-status-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.route-poi-status-icon.unvisited {
    background: #e2e8f0;
    color: #475569;
}

.route-poi-status-icon.active-target {
    background: var(--primary-color);
    color: #ffffff;
    box-shadow: 0 0 0 3px rgba(0, 97, 138, 0.25);
}

.route-poi-status-icon.visited {
    background: #10b981;
    color: #ffffff;
}

.route-poi-item-info {
    flex: 1;
    min-width: 0;
}

.route-poi-item-title {
    font-weight: 600;
    font-size: 0.92rem;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.route-poi-item-meta {
    font-size: 0.78rem;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
}

.route-poi-item-dist {
    font-weight: 600;
    color: #0284c7;
}

.route-poi-item-badge-visited {
    color: #059669;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

/* Custom Station Pins for Visited Stations */
.custom-station-pin.is-visited > div > div:last-child {
    background: #10b981 !important;
    border-color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.4) !important;
}

/* Dark mode adjustments */
.theme-dark .route-poi-item {
    background: #1e293b;
    border-color: #334155;
}
.theme-dark .route-poi-item.is-active-target {
    background: #0c4a6e;
    border-color: #38bdf8;
}
.theme-dark .route-poi-item-title {
    color: #f1f5f9;
}
.theme-dark .route-poi-status-icon.unvisited {
    background: #334155;
    color: #94a3b8;
}

/* ==========================================================================
   VIALINGO CITY-ESCAPE GAME ENGINE & FOG OF WAR STYLES
   ========================================================================== */

/* Leaflet Fog of War Pulsing Search Area */
.escape-search-pulse {
    animation: escapePulseRing 2.4s infinite ease-in-out;
}

@keyframes escapePulseRing {
    0% {
        stroke-opacity: 0.95;
        stroke-width: 2.5px;
        fill-opacity: 0.16;
    }
    50% {
        stroke-opacity: 0.45;
        stroke-width: 5px;
        fill-opacity: 0.32;
    }
    100% {
        stroke-opacity: 0.95;
        stroke-width: 2.5px;
        fill-opacity: 0.16;
    }
}

/* Mystery Stage Center Pin */
.escape-mystery-pin {
    width: 32px;
    height: 32px;
    background: #ea580c;
    color: white;
    border: 2.5px solid white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    box-shadow: 0 3px 10px rgba(234, 88, 12, 0.45);
    cursor: pointer;
    transition: transform 0.2s ease;
}
.escape-mystery-pin:hover {
    transform: scale(1.12);
}

/* Top Escape HUD Bar */
.escape-hud-container {
    position: absolute;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 30px;
    padding: 6px 16px;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.14);
    color: #1e293b;
    user-select: none;
    animation: slideDownHud 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideDownHud {
    from { opacity: 0; transform: translate(-50%, -20px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

.escape-hud-stage-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--primary-color, #2563eb);
    color: #ffffff;
    padding: 4px 11px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.escape-hud-timer-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.98rem;
    font-weight: 800;
    color: #1e293b;
    letter-spacing: 0.5px;
}

.escape-hud-timer-wrap.penalty-active {
    color: #dc2626;
    animation: flashTimer 0.6s ease 2;
}

@keyframes flashTimer {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.escape-hud-actions {
    display: none;
}

/* Floating Mission Action Button on Seam */
.fab-escape-btn {
    background: var(--primary-color, #2563eb) !important;
    color: white !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22) !important;
}

/* Mission & Hint Modal Sheets */
.escape-modal-sheet {
    max-height: 90vh;
    overflow-y: auto;
    background: #ffffff;
    border-radius: 20px 20px 0 0;
    padding: 24px 20px;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.2);
    color: #2c3e50;
}

.escape-clue-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-left: 4px solid var(--primary-color, #2563eb);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    color: #2c3e50;
    font-size: 0.96rem;
    line-height: 1.6;
}

.escape-utensils-needed-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
    align-items: center;
}

.escape-needed-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 11px;
    border-radius: 14px;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #334155;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Code Input Box */
.escape-code-input-wrapper {
    display: flex;
    gap: 10px;
    margin-top: 8px;
    margin-bottom: 12px;
}

.escape-code-input {
    width: 100%;
    flex: 1;
    padding: 13px 14px;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 1px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    text-transform: uppercase;
    text-align: center;
    background: #f8fafc;
    color: #1e293b;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.escape-code-input:focus {
    outline: none;
    border-color: var(--primary-color, #2563eb);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    background: #ffffff;
}

.escape-code-submit-btn {
    background: var(--primary-color, #2563eb);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 12px 20px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.escape-code-submit-btn:hover {
    opacity: 0.92;
    transform: translateY(-1px);
}

.escape-feedback-msg {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 14px;
    display: none;
    animation: fadeInEscapeMsg 0.25s ease;
}

@keyframes fadeInEscapeMsg {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.escape-feedback-msg.success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}

.escape-feedback-msg.error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

/* Escape Mission Solved Button */
.escape-continue-btn {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, #ea580c, #c2410c);
    color: #ffffff !important;
    border: none;
    border-radius: 12px;
    font-weight: 800;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(234, 88, 12, 0.38);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.escape-continue-btn:hover {
    background: linear-gradient(135deg, #f97316, #ea580c);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(234, 88, 12, 0.48);
}

.escape-continue-btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 8px rgba(234, 88, 12, 0.3);
}

/* 3-Tier Hints Accordion in PWA */
.escape-hint-card {
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 10px;
}

.escape-hint-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.88rem;
    font-weight: 700;
    color: #1e293b;
}

.escape-hint-body {
    margin-top: 8px;
    font-size: 0.9rem;
    color: #475569;
    line-height: 1.5;
}

/* Victory Celebration Modal */
.escape-victory-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    animation: fadeInVictory 0.4s ease;
}

@keyframes fadeInVictory {
    from { opacity: 0; }
    to { opacity: 1; }
}

.escape-victory-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 32px 24px;
    max-width: 480px;
    width: 100%;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45);
    animation: scaleUpVictory 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes scaleUpVictory {
    from { transform: scale(0.9) translateY(20px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

.escape-trophy-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border: 3px solid #f59e0b;
    color: #b45309;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.35);
    animation: bounceTrophy 1s ease infinite alternate;
}

@keyframes bounceTrophy {
    from { transform: translateY(0); }
    to { transform: translateY(-6px); }
}

.escape-victory-stats-row {
    display: flex;
    gap: 10px;
    margin: 20px 0;
}

.escape-stat-box {
    flex: 1;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 8px;
}

.escape-stat-val {
    font-size: 1.15rem;
    font-weight: 800;
    color: #0f172a;
    display: block;
    margin-bottom: 2px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.escape-stat-lbl {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Dark theme overrides */
.theme-dark .escape-hud-container {
    background: rgba(15, 23, 42, 0.94);
    border-color: rgba(255, 255, 255, 0.18);
}
.theme-dark .escape-modal-sheet,
.theme-dark .escape-victory-card {
    background: #0f172a;
    color: #f8fafc;
}
.theme-dark .escape-clue-card {
    background: #431407;
    border-color: #7c2d12;
    color: #fdba74;
}
.theme-dark .escape-code-input {
    background: #1e293b;
    border-color: #334155;
    color: #f8fafc;
}
.theme-dark .escape-hint-card {
    background: #1e293b;
    border-color: #334155;
}
.theme-dark .escape-hint-header {
    color: #f1f5f9;
}
.theme-dark .escape-hint-body {
    color: #cbd5e1;
}
.theme-dark .escape-stat-box {
    background: #1e293b;
    border-color: #334155;
}
.theme-dark .escape-stat-val {
    color: #f8fafc;
}
.theme-dark .escape-needed-chip {
    background: #1e293b;
    border-color: #334155;
    color: #cbd5e1;
}
.theme-dark .escape-continue-btn {
    background: linear-gradient(135deg, #ea580c, #9a3412);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
}
.theme-dark #escape-review-mission-btn {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #cbd5e1 !important;
}
.theme-dark .escape-feedback-msg.success {
    background: #064e3b;
    border-color: #059669;
    color: #d1fae5;
}
.theme-dark .escape-feedback-msg.error {
    background: #450a0a;
    border-color: #b91c1c;
    color: #fecaca;
}

/* =========================================================================
   LIVE-PUSH-STATIONEN: TOP-BANNER & DETAIL-POPUP (LIGHT & DARK MODE)
   ========================================================================= */
.pwa-live-push-banner {
    position: fixed;
    top: 14px;
    left: 50%;
    transform: translateX(-50%) translateY(-130%);
    width: calc(100% - 24px);
    max-width: 430px;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 18px;
    padding: 13px 15px;
    box-shadow: 0 18px 38px -8px rgba(15, 23, 42, 0.24), 0 4px 12px rgba(15, 23, 42, 0.08);
    z-index: 9800;
    transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease;
    opacity: 0;
    color: #0f172a;
    pointer-events: auto;
}
.pwa-live-push-banner.is-visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Layered Card Deck Effect for Multi-Push Stack */
.pwa-live-push-banner.is-stacked::before,
.pwa-live-push-banner.is-stacked-deep::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    border-radius: 18px;
    pointer-events: none;
    transition: transform 0.28s ease, opacity 0.28s ease;
}
.pwa-live-push-banner.is-stacked::before {
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(203, 213, 225, 0.9);
    transform: translateY(6px) scale(0.965);
    z-index: -1;
    box-shadow: 0 10px 22px -4px rgba(15, 23, 42, 0.16);
    opacity: 0.95;
}
.pwa-live-push-banner.is-stacked-deep::after {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(203, 213, 225, 0.75);
    transform: translateY(11px) scale(0.93);
    z-index: -2;
    box-shadow: 0 14px 28px -6px rgba(15, 23, 42, 0.12);
    opacity: 0.8;
}

.pwa-live-push-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.pwa-live-push-icon {
    width: 44px;
    height: 44px;
    border-radius: 13px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.45rem;
    flex-shrink: 0;
}
.pwa-live-push-thumb {
    width: 52px;
    height: 52px;
    border-radius: 11px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid #e2e8f0;
}
.pwa-live-push-content {
    flex: 1;
    min-width: 0;
}
.pwa-live-push-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}
.pwa-live-push-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
    flex-wrap: wrap;
}
.pwa-live-push-title {
    font-weight: 800;
    font-size: 0.95rem;
    color: #0f172a;
    line-height: 1.25;
    margin: 0;
}
.pwa-live-push-stack-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 7px;
    border-radius: 6px;
    background: #e0f2fe;
    color: #0369a1;
    font-size: 0.69rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    flex-shrink: 0;
}
.pwa-live-push-close {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 1.25rem;
    line-height: 1;
    padding: 0 2px;
    cursor: pointer;
}
.pwa-live-push-msg {
    font-size: 0.84rem;
    color: #475569;
    line-height: 1.42;
    margin: 4px 0 0 0;
}
.pwa-live-push-voucher {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 7px;
    padding: 3px 9px;
    border-radius: 7px;
    background: #f0fdf4;
    border: 1px dashed #22c55e;
    color: #15803d;
    font-size: 0.76rem;
    font-weight: 700;
}
.pwa-live-push-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding-top: 9px;
    border-top: 1px solid #f1f5f9;
}
.pwa-live-push-stack-ctrl {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 2px 4px;
}
.pwa-live-push-nav-btn {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 5px;
    color: #475569;
    cursor: pointer;
    padding: 0;
    font-size: 1.05rem;
    line-height: 1;
    font-weight: 800;
    transition: background 0.15s ease, color 0.15s ease;
    user-select: none;
}
.pwa-live-push-nav-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}
.pwa-live-push-nav-btn:active {
    transform: scale(0.92);
}
.pwa-live-push-stack-count {
    font-size: 0.73rem;
    font-weight: 700;
    color: #334155;
    padding: 0 5px;
    white-space: nowrap;
    user-select: none;
}
.pwa-live-push-action-btns {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}
.pwa-live-push-btn-secondary {
    background: #f1f5f9;
    color: #475569;
    border: none;
    border-radius: 9px;
    padding: 6px 12px;
    font-size: 0.79rem;
    font-weight: 600;
    cursor: pointer;
}
.pwa-live-push-btn-primary {
    background: var(--primary-color, #0284c7);
    color: #ffffff;
    border: none;
    border-radius: 9px;
    padding: 6px 14px;
    font-size: 0.79rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.25);
}

/* Dark Mode Overrides for Live-Push Banner */
.theme-dark .pwa-live-push-banner {
    background: rgba(15, 23, 42, 0.96);
    border-color: rgba(51, 65, 85, 0.9);
    color: #f8fafc;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.55);
}
.theme-dark .pwa-live-push-banner.is-stacked::before {
    background: rgba(23, 33, 56, 0.95);
    border-color: rgba(51, 65, 85, 0.85);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
}
.theme-dark .pwa-live-push-banner.is-stacked-deep::after {
    background: rgba(30, 41, 59, 0.9);
    border-color: rgba(51, 65, 85, 0.65);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.4);
}
.theme-dark .pwa-live-push-icon {
    background: rgba(30, 41, 59, 0.9);
    border-color: #334155;
}
.theme-dark .pwa-live-push-title {
    color: #f8fafc;
}
.theme-dark .pwa-live-push-stack-tag {
    background: rgba(2, 132, 199, 0.22);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.3);
}
.theme-dark .pwa-live-push-msg {
    color: #cbd5e1;
}
.theme-dark .pwa-live-push-voucher {
    background: rgba(22, 163, 74, 0.18);
    border-color: #4ade80;
    color: #86efac;
}
.theme-dark .pwa-live-push-actions {
    border-top-color: #1e293b;
}
.theme-dark .pwa-live-push-stack-ctrl {
    background: #1e293b;
    border-color: #334155;
}
.theme-dark .pwa-live-push-nav-btn {
    color: #94a3b8;
}
.theme-dark .pwa-live-push-nav-btn:hover {
    background: #334155;
    color: #f8fafc;
}
.theme-dark .pwa-live-push-stack-count {
    color: #cbd5e1;
}
.theme-dark .pwa-live-push-btn-secondary {
    background: #1e293b;
    color: #cbd5e1;
}

.pwa-live-push-map-pin {
    background: transparent !important;
    border: none !important;
}

/* =========================================================
   FLOATING WELCOME AUDIO BANNER OVER MAP
   ========================================================= */
.welcome-audio-floating-banner {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 9999px;
    padding: 4px 5px 4px 13px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08), 0 1px 3px rgba(15, 23, 42, 0.04);
    pointer-events: auto;
    max-width: calc(100% - 32px);
    box-sizing: border-box;
    user-select: none;
    animation: slideUpWelcomeBanner 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.welcome-audio-status {
    font-size: 0.85rem;
    font-weight: 600;
    color: #64748b;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
}

.welcome-audio-mic-icon {
    width: 15px;
    height: 15px;
    stroke: currentColor;
    flex-shrink: 0;
    display: inline-block;
    animation: micPulse 1.8s ease-in-out infinite;
}

.welcome-audio-skip-btn {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
    border-radius: 9999px;
    padding: 4px 11px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.welcome-audio-skip-btn:hover {
    background: #e2e8f0;
    color: #1e293b;
    border-color: #cbd5e1;
}

.welcome-audio-skip-btn:active {
    transform: scale(0.95);
}

@keyframes slideUpWelcomeBanner {
    from { opacity: 0; transform: translate(-50%, 15px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes micPulse {
    0%, 100% { opacity: 0.75; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.08); }
}

/* Dark theme overrides */
.theme-dark .welcome-audio-floating-banner {
    background: rgba(15, 23, 42, 0.94);
    border-color: rgba(255, 255, 255, 0.14);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
}

.theme-dark .welcome-audio-status {
    color: #94a3b8;
}

.theme-dark .welcome-audio-skip-btn {
    background: #1e293b;
    color: #94a3b8;
    border-color: #334155;
}

.theme-dark .welcome-audio-skip-btn:hover {
    background: #334155;
    color: #f8fafc;
    border-color: #475569;
}

.font-size-medium .welcome-audio-status {
    font-size: 0.95rem;
}

.font-size-large .welcome-audio-status {
    font-size: 1.05rem;
}



/* ==========================================================================
   VIALINGO NETWORK - FLOATING CITY PILL & BOTTOM SHEET MODAL
   ========================================================================== */

/* ========================================================================== */
/* VIALINGO NETWORK - SLIM CITY SELECTOR TOP BAR                              */
/* ========================================================================== */

.pwa-city-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--pwa-city-bar-total-height);
    padding-top: env(safe-area-inset-top, 0px);
    z-index: 1200;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.05);
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.pwa-city-bar .city-bar-inner {
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    padding: 0 16px;
    padding-left: max(16px, env(safe-area-inset-left, 16px));
    padding-right: max(16px, env(safe-area-inset-right, 16px));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    box-sizing: border-box;
}

.pwa-city-bar .city-bar-location {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1;
}

.pwa-city-bar .city-bar-pin {
    color: var(--primary-color, #00618a);
    flex-shrink: 0;
}

.pwa-city-bar .city-bar-name {
    font-size: 0.92rem;
    font-weight: 700;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.01em;
}

.pwa-city-bar .city-bar-caret {
    color: #94a3b8;
    flex-shrink: 0;
    transition: transform 0.2s ease, color 0.2s ease;
}

.pwa-city-bar:hover .city-bar-caret {
    transform: translateY(1px);
    color: #475569;
}

.pwa-city-bar .city-bar-action {
    flex-shrink: 0;
}

.pwa-city-bar .city-bar-action-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 11px;
    background: rgba(0, 97, 138, 0.08);
    color: var(--primary-color, #00618a);
    border: 1px solid rgba(0, 97, 138, 0.12);
    border-radius: 9999px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    transition: all 0.2s ease;
}

.pwa-city-bar:hover .city-bar-action-pill {
    background: rgba(0, 97, 138, 0.15);
    border-color: rgba(0, 97, 138, 0.25);
}

.pwa-city-bar:active {
    background: rgba(248, 250, 252, 0.98);
}

@media (max-width: 360px) {
    .pwa-city-bar .city-bar-action-text {
        display: none;
    }
    .pwa-city-bar .city-bar-action-pill {
        padding: 4px 7px;
    }
}

/* RTL Support */
[dir="rtl"] .pwa-city-bar .city-bar-inner {
    flex-direction: row-reverse;
}

/* Dark Mode */
.theme-dark .pwa-city-bar,
body.dark-mode .pwa-city-bar,
[data-theme="dark"] .pwa-city-bar {
    background: rgba(15, 23, 42, 0.96);
    border-bottom-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);
}

.theme-dark .pwa-city-bar .city-bar-name,
body.dark-mode .pwa-city-bar .city-bar-name,
[data-theme="dark"] .pwa-city-bar .city-bar-name {
    color: #f8fafc;
}

.theme-dark .pwa-city-bar .city-bar-caret,
body.dark-mode .pwa-city-bar .city-bar-caret,
[data-theme="dark"] .pwa-city-bar .city-bar-caret {
    color: #64748b;
}

.theme-dark .pwa-city-bar .city-bar-action-pill,
body.dark-mode .pwa-city-bar .city-bar-action-pill,
[data-theme="dark"] .pwa-city-bar .city-bar-action-pill {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.16);
    color: #e2e8f0;
}

.theme-dark .pwa-city-bar:hover .city-bar-action-pill,
body.dark-mode .pwa-city-bar:hover .city-bar-action-pill,
[data-theme="dark"] .pwa-city-bar:hover .city-bar-action-pill {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
}

/* Screen layout adjustments when city bar is active */
body.has-city-bar #welcome-screen {
    top: var(--pwa-city-bar-total-height);
    height: calc(100% - var(--pwa-city-bar-total-height));
}

body.has-city-bar #route-selection-screen {
    top: var(--pwa-city-bar-total-height);
    height: calc(100% - 60px - var(--pwa-city-bar-total-height));
}

body.has-city-bar .live-banner-wrap {
    top: calc(var(--pwa-city-bar-total-height) + 10px);
}


/* Network Cities Bottom-Sheet Modal */
.network-cities-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 3500;
    display: none;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.network-cities-modal.active {
    display: flex;
    opacity: 1;
    pointer-events: auto;
}

.network-cities-sheet {
    width: 100%;
    max-width: 580px;
    max-height: 88vh;
    background: #ffffff;
    border-radius: 24px 24px 0 0;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    position: relative;
    transform: translateY(100%);
    transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}

.network-cities-modal.active .network-cities-sheet {
    transform: translateY(0);
}

.network-sheet-handle {
    width: 44px;
    height: 4px;
    background: #cbd5e1;
    border-radius: 9999px;
    margin: 10px auto 4px auto;
    flex-shrink: 0;
}

.network-sheet-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 20px 14px 20px;
    border-bottom: 1px solid #f1f5f9;
    flex-shrink: 0;
}

.network-sheet-title-wrap {
    flex: 1;
}

.network-sheet-super {
    margin-bottom: 4px;
}

.network-super-pill {
    display: inline-block;
    padding: 3px 9px;
    background: #eff6ff;
    color: var(--primary-color, #2563eb);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 9999px;
}

.network-sheet-title {
    margin: 0 0 4px 0;
    font-size: 1.25rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.25;
}

.network-sheet-desc {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.4;
    color: #64748b;
}

.network-sheet-close-btn {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f1f5f9;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.network-sheet-close-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.network-sheet-body {
    padding: 16px 20px calc(28px + env(safe-area-inset-bottom, 0px)) 20px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.network-tier-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.network-tier-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.network-tier-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.network-tier-icon.pass-icon {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

.network-tier-icon.single-icon {
    background: #f1f5f9;
    color: #64748b;
}

.network-tier-titles {
    flex: 1;
}

.network-tier-title {
    margin: 0;
    font-size: 0.96rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.25;
}

.network-tier-desc {
    margin: 2px 0 0 0;
    font-size: 0.78rem;
    color: #64748b;
    line-height: 1.3;
}

.network-cities-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Network City Card */
.network-city-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 14px;
    border-radius: 16px;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    text-decoration: none;
    color: inherit;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
    cursor: pointer;
    position: relative;
}

.network-city-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
    border-color: #cbd5e1;
    background: #ffffff;
}

.network-city-card.current-city {
    background: #eff6ff;
    border: 2px solid var(--primary-color, #2563eb);
    box-shadow: 0 2px 10px rgba(37, 99, 235, 0.12);
    cursor: default;
}

.network-city-card.current-city:hover {
    transform: none;
    box-shadow: 0 2px 10px rgba(37, 99, 235, 0.12);
}

.network-city-thumb-wrap {
    position: relative;
    width: 72px;
    height: 72px;
    flex-shrink: 0;
    border-radius: 12px;
    overflow: hidden;
    background: #e2e8f0;
}

.network-city-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.network-city-active-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--primary-color, #2563eb);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
    border: 2px solid #ffffff;
    z-index: 2;
}

[dir="rtl"] .network-city-active-badge,
body.rtl-mode .network-city-active-badge {
    left: auto;
    right: 6px;
}

.network-city-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
}

.network-city-name {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.28;
    word-break: break-word;
    overflow-wrap: break-word;
}

.network-city-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: #64748b;
    font-weight: 500;
}

.network-city-meta svg {
    flex-shrink: 0;
    color: #94a3b8;
}

/* Dark Mode Modal */
.theme-dark .network-cities-sheet,
body.dark-mode .network-cities-sheet,
[data-theme="dark"] .network-cities-sheet {
    background: #0f172a;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.6);
}

.theme-dark .network-sheet-handle,
body.dark-mode .network-sheet-handle,
[data-theme="dark"] .network-sheet-handle {
    background: #334155;
}

.theme-dark .network-sheet-header,
body.dark-mode .network-sheet-header,
[data-theme="dark"] .network-sheet-header {
    border-bottom-color: #1e293b;
}

.theme-dark .network-super-pill,
body.dark-mode .network-super-pill,
[data-theme="dark"] .network-super-pill {
    background: #1e293b;
    color: #60a5fa;
}

.theme-dark .network-sheet-title,
body.dark-mode .network-sheet-title,
[data-theme="dark"] .network-sheet-title,
.theme-dark .network-tier-title,
body.dark-mode .network-tier-title,
[data-theme="dark"] .network-tier-title,
.theme-dark .network-city-name,
body.dark-mode .network-city-name,
[data-theme="dark"] .network-city-name {
    color: #f8fafc;
}

.theme-dark .network-sheet-desc,
body.dark-mode .network-sheet-desc,
[data-theme="dark"] .network-sheet-desc,
.theme-dark .network-tier-desc,
body.dark-mode .network-tier-desc,
[data-theme="dark"] .network-tier-desc,
.theme-dark .network-city-meta,
body.dark-mode .network-city-meta,
[data-theme="dark"] .network-city-meta {
    color: #94a3b8;
}

.theme-dark .network-sheet-close-btn,
body.dark-mode .network-sheet-close-btn,
[data-theme="dark"] .network-sheet-close-btn {
    background: #1e293b;
    color: #94a3b8;
}

.theme-dark .network-sheet-close-btn:hover,
body.dark-mode .network-sheet-close-btn:hover,
[data-theme="dark"] .network-sheet-close-btn:hover {
    background: #334155;
    color: #f8fafc;
}

.theme-dark .network-tier-icon.single-icon,
body.dark-mode .network-tier-icon.single-icon,
[data-theme="dark"] .network-tier-icon.single-icon {
    background: #1e293b;
    color: #94a3b8;
}

.theme-dark .network-city-card,
body.dark-mode .network-city-card,
[data-theme="dark"] .network-city-card {
    background: #1e293b;
    border-color: #334155;
}

.theme-dark .network-city-card:hover,
body.dark-mode .network-city-card:hover,
[data-theme="dark"] .network-city-card:hover {
    background: #273549;
    border-color: #475569;
}

.theme-dark .network-city-card.current-city,
body.dark-mode .network-city-card.current-city,
[data-theme="dark"] .network-city-card.current-city {
    background: #172554;
    border-color: var(--primary-color, #3b82f6);
}

.theme-dark .network-city-name,
body.dark-mode .network-city-name,
[data-theme="dark"] .network-city-name {
    color: #f8fafc;
}

.theme-dark .network-city-meta,
body.dark-mode .network-city-meta,
[data-theme="dark"] .network-city-meta {
    color: #94a3b8;
}

.theme-dark .network-city-active-badge,
body.dark-mode .network-city-active-badge,
[data-theme="dark"] .network-city-active-badge {
    border-color: #1e293b;
}

/* Desktop Modal Centering */
@media (min-width: 640px) {
    .network-cities-modal {
        align-items: center;
        padding: 20px;
    }
    .network-cities-sheet {
        border-radius: 24px;
        transform: scale(0.95);
        opacity: 0;
        transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    }
    .network-cities-modal.active .network-cities-sheet {
        transform: scale(1);
        opacity: 1;
    }
    .network-sheet-handle {
        display: none;
    }
}

/* ==========================================================================
   Vialingo-Pass - Auto-Unlock Welcome Toast / Banner
   ========================================================================== */
.pwa-pass-welcome-banner {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 14px);
    left: 50%;
    transform: translateX(-50%) translateY(-14px);
    z-index: 10000;
    width: calc(100% - 28px);
    max-width: 440px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 16px;
    box-shadow: 0 10px 30px -4px rgba(0, 0, 0, 0.12), 0 4px 10px -2px rgba(0, 0, 0, 0.05);
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-sizing: border-box;
    opacity: 0;
    pointer-events: auto;
    transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1), transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Offset when top city bar is active */
body.has-city-bar .pwa-pass-welcome-banner {
    top: calc(var(--pwa-city-bar-total-height, 44px) + 12px);
}

.pwa-pass-welcome-banner.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.pwa-pass-welcome-banner.closing {
    opacity: 0;
    transform: translateX(-50%) translateY(-14px);
}

.pass-welcome-icon-box {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(37, 99, 235, 0.08);
    color: var(--primary-color, #2563eb);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pass-welcome-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pass-welcome-header {
    display: flex;
    align-items: center;
    gap: 6px;
}

.pass-welcome-pill {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--primary-color, #2563eb);
    background: rgba(37, 99, 235, 0.1);
    padding: 2px 7px;
    border-radius: 9999px;
    display: inline-block;
}

.pass-welcome-status {
    font-size: 0.76rem;
    font-weight: 700;
    color: #10b981;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.pass-welcome-status::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10b981;
    display: inline-block;
}

.pass-welcome-text {
    font-size: 0.82rem;
    font-weight: 500;
    color: #334155;
    line-height: 1.35;
    margin: 0;
}

.pass-welcome-dismiss {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s ease, color 0.15s ease;
    padding: 0;
}

.pass-welcome-dismiss:hover,
.pass-welcome-dismiss:active {
    background: #f1f5f9;
    color: #0f172a;
}

/* Dark Mode Support */
body.dark-mode .pwa-pass-welcome-banner,
.theme-dark .pwa-pass-welcome-banner,
[data-theme="dark"] .pwa-pass-welcome-banner {
    background: rgba(15, 23, 42, 0.94);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 10px 30px -4px rgba(0, 0, 0, 0.45);
}

body.dark-mode .pass-welcome-text,
.theme-dark .pass-welcome-text,
[data-theme="dark"] .pass-welcome-text {
    color: #cbd5e1;
}

body.dark-mode .pass-welcome-dismiss:hover,
.theme-dark .pass-welcome-dismiss:hover,
[data-theme="dark"] .pass-welcome-dismiss:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #f8fafc;
}

