/**
 * Chronik-SEITE CSS - Wetterstation Schladming
 * Ausgelagert aus chronik.php
 * Nutzt globale Variablen aus style.css
 */

/* ── Flex-Reihenfolge in leaflet-top-left ─────────────────────────────────── */
/* Basis-Flexbox kommt aus livekarte.css. Hier nur die order für chr-* Klassen */
.leaflet-top.leaflet-left .chr-hamburger-btn { order: 1; }
.leaflet-top.leaflet-left .chr-info-wrap,
.leaflet-top.leaflet-left .chr-info-btn { order: 2; }
.leaflet-top.leaflet-left .chr-ktyp-wrap { order: 3; }
.leaflet-top.leaflet-left .chr-kat-badge { order: 4; }
.leaflet-top.leaflet-left .chr-panel-wrap {
    order: 98;
    flex-basis: 100%;
    pointer-events: none;
}
.leaflet-top.leaflet-left .chr-panel-wrap #chr-menu-panel {
    pointer-events: auto;
}
/* Info-Popup-Host + Kartentyp-Dropdown in neue Zeile */
.leaflet-top.leaflet-left #chr-info-popup-host {
    order: 99;
    flex-basis: 200px;
    flex-grow: 0;
    flex-shrink: 0;
    position: static;
}
.leaflet-top.leaflet-left #chr-ktyp-optionen {
    order: 100;
    flex-basis: 200px;
    flex-grow: 0;
    flex-shrink: 0;
    position: static;
}

/* Wrap-Container transparent (Hintergrund nur am inneren Element) */
.leaflet-top.leaflet-left .chr-ktyp-wrap,
.leaflet-top.leaflet-left .chr-info-wrap {
    background: none !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    overflow: visible !important;
}

/* ── Leaflet-Controls: Hamburger, Info, Kartentyp (Vorbild: livekarte.css) ── */

/* Basis für In-Karte-Controls */
.chr-control {
    background: var(--bg-tooltip);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-medium);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-family: var(--font-main);
    user-select: none;
    box-shadow: 0 4px 16px var(--overlay-medium);
}

/* Hamburger-Button (oben links) */
.chr-hamburger-btn {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    border-radius: var(--radius-lg) !important;
    border: 2px solid rgba(59,130,246,0.8) !important;
    box-shadow: 0 0 8px var(--blue-a40) !important;
    background: var(--bg-tooltip) !important;
    color: var(--blue-light);
    transition: background 0.12s, border-color 0.12s;
}
.chr-hamburger-btn:hover { background: var(--blue-a10) !important; border-color: rgba(59,130,246,1) !important; }

/* Info-Button */
.chr-info-btn {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    border-radius: var(--radius-lg) !important;
    border: 2px solid rgba(59,130,246,0.8) !important;
    box-shadow: 0 0 8px var(--blue-a40) !important;
    background: var(--bg-tooltip) !important;
    color: var(--blue-light);
    font-size: var(--fs-md);
    font-weight: 700;
    font-style: italic;
    font-family: Georgia, 'Times New Roman', serif;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.chr-info-btn:hover { background: var(--blue-a10) !important; color: var(--blue-light); border-color: rgba(59,130,246,1) !important; }

/* Kartentyp-Button (oben links, eigene Zeile) */
#chr-ktyp-btn {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    border-radius: var(--radius-lg);
    background: var(--bg-tooltip);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(59,130,246,0.8) !important;
    box-shadow: 0 0 8px var(--blue-a40) !important;
    transition: background 0.12s, border-color 0.12s;
    color: var(--blue-light);
}
#chr-ktyp-btn:hover { background: var(--blue-a10); border-color: rgba(59,130,246,1) !important; }
#chr-ktyp-btn.aktiv { background: var(--blue-a25); border-color: rgba(59,130,246,1) !important; box-shadow: 0 0 12px rgba(59,130,246,0.6) !important; }

/* Kategorie-Badge (zeigt aktive Kategorie neben Kartensymbol).
   Farbe kommt aus --kf (inline per JS gesetzt, Fallback blau). */
.chr-kat-badge {
    display: none;
    align-items: center;
    height: 36px;
    padding: 0 12px;
    background: var(--bg-tooltip);
    backdrop-filter: blur(12px);
    border: 1px solid color-mix(in srgb, var(--kf, var(--blue)) 55%, transparent);
    border-radius: var(--radius-lg);
    color: var(--kf, var(--blue-light));
    font-size: var(--fs-sm);
    font-weight: 600;
    font-family: var(--font-main);
    box-shadow: 0 0 8px color-mix(in srgb, var(--kf, var(--blue)) 35%, transparent);
    white-space: nowrap;
    pointer-events: none;
    margin: 0 !important;
}

/* Haupt-Panel (Kategorien + Gewässer) */
#chr-menu-panel {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 200px;
    max-width: calc(100vw - 16px);
    max-height: calc(100vh - 70px);
    overflow-y: auto;
    overflow-x: hidden;
    border-radius: var(--radius-lg);
    margin: 0 !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.chr-panel-section {
    padding: 8px 10px;
    border-bottom: 1px solid var(--glass-light);
}
.chr-panel-section:last-child { border-bottom: none; }

.chr-panel-label {
    font-size: var(--fs-xs);
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.35rem;
    padding: 0 2px;
}

/* Kategorie-Buttons (im Panel) – Optik analog .lk-param-btn aus livekarte */
.chr-kat-btn {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    width: 100%;
    padding: 7px 10px;
    margin-bottom: 3px;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    background: var(--glass-light);
    color: var(--text-secondary);
    font-size: var(--fs-base);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.13s, color 0.13s, border-color 0.13s, box-shadow 0.13s;
    text-align: left;
    font-family: inherit;
    white-space: nowrap;
}
.chr-kat-btn:last-child { margin-bottom: 0; }
.chr-kat-btn:hover {
    background: var(--glass-medium);
    color: var(--text-primary);
    border-color: var(--border-light);
}
/* Aktiv: Gradient + Glow in der Kategorie-Farbe (var(--kf) wird inline per style= gesetzt).
   Fallback ist Blau, falls keine Kategorie-Farbe vorhanden. */
.chr-kat-btn.aktiv {
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--kf, var(--blue)) 40%, transparent),
        color-mix(in srgb, var(--kf, var(--blue)) 30%, transparent));
    border-color: var(--kf, var(--blue));
    color: var(--text-primary);
    box-shadow: 0 0 10px color-mix(in srgb, var(--kf, var(--blue)) 40%, transparent);
}
.chr-kat-icon {
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    width: 18px; height: 18px;
}
.chr-kat-icon svg { width: 18px; height: 18px; }

/* Anzahl pro Kategorie (z.B. "Alle (38)") – dezent in Klammern hinter dem Label */
.chr-kat-count {
    margin-left: auto;
    padding-left: 0.5rem;
    font-size: var(--fs-sm);
    font-weight: 500;
    color: var(--text-muted);
}
.chr-kat-btn.aktiv .chr-kat-count {
    color: var(--text-secondary);
}

/* Info-Popup (versteckt, Inhalt wird in Host kopiert) */
#chr-info-popup { display: none !important; }

/* Info-Popup-Host (rendert neben Button in leaflet-top-left) */
#chr-info-popup-host {
    width: 200px;
    max-width: calc(100vw - 16px);
    height: 420px;
    max-height: calc(100vh - 70px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    background: var(--bg-tooltip);
    backdrop-filter: blur(12px);
    border: 1px solid var(--blue-a40);
    border-radius: var(--radius-lg);
    padding: 1rem 1rem 0.85rem;
    box-shadow: 0 8px 32px var(--overlay-heavy), 0 0 16px var(--blue-a10);
    color: var(--text-secondary);
    font-size: var(--fs-base);
    font-family: var(--font-main);
    line-height: 1.5;
}
#chr-info-popup-host h3 {
    font-size: var(--fs-md);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}
#chr-info-popup-host h4 {
    font-size: var(--fs-base);
    font-weight: 600;
    color: var(--blue-light);
    margin: 0.65rem 0 0.2rem;
}
#chr-info-popup-host p { margin-bottom: 0.3rem; }
#chr-info-popup-host strong { color: inherit; font-weight: inherit; }
#chr-info-popup-host em { color: var(--blue-accent); font-style: normal; }

/* Kartentyp-Dropdown (eigene Zeile in leaflet-top-left) */
#chr-ktyp-optionen {
    display: none;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-tooltip);
    border: 1px solid var(--glass-hover);
    border-radius: var(--radius-lg);
    margin-top: 4px;
    padding: 4px 0;
    box-shadow: 0 4px 16px var(--overlay-medium);
    width: 200px;
    max-width: calc(100vw - 16px);
    font-family: var(--font-main);
}
#chr-ktyp-optionen.offen { display: flex; }
.chr-ktyp-btn {
    padding: 7px 14px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: var(--fs-base);
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    font-family: var(--font-main);
    transition: background 0.13s, color 0.13s;
    white-space: nowrap;
}
.chr-ktyp-btn:hover { background: var(--glass-light); color: var(--text-primary); }
.chr-ktyp-btn.aktiv { color: var(--blue-light); background: var(--blue-a10); }
.chr-ktyp-sep {
    height: 1px; background: var(--glass-light); margin: 4px 8px;
}


/* ── Popup ─────────────────────────────────────────────────────────────── */
.leaflet-popup { display: none !important; }

/* Fixes Seiten-Panel – rechts oben, kompakt */
/* ── Ereignis-Popup: zentriert über Karte (wie TAWES-Popup in Livekarte) ── */
#chr-panel-overlay {
    display: none;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    background: var(--bg-overlay);
    z-index: 10002;
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    overscroll-behavior: contain;
    touch-action: none;
}
#chr-panel-overlay.sichtbar { display: flex; }

#chr-panel {
    background: var(--bg-card-solid);
    border: 2px solid rgba(102,126,234,0.3);
    border-radius: 14px;
    width: 100%;
    max-width: 460px;
    max-height: 90vh;
    max-height: 90dvh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 30px rgba(102,126,234,0.08);
    display: flex;
    flex-direction: column;
    font-family: var(--font-main);
    color: var(--text-primary);
    touch-action: auto;
}
#chr-panel-inner { display: flex; flex-direction: column; overflow: hidden; flex: 1; min-height: 0; }
#chr-panel-head { padding: 0.75rem 1rem 0; flex-shrink: 0; display: flex; align-items: flex-start; gap: var(--space-sm); }
#chr-panel-head-content { flex: 1; min-width: 0; }
#chr-panel-foto { flex-shrink: 0; padding: 0 1rem; }
#chr-panel-body { overflow-y: auto; flex: 1; min-height: 0; padding: 0 1rem;
    scrollbar-width: thin; scrollbar-color: var(--border-light) transparent;
    -webkit-overflow-scrolling: touch; overscroll-behavior: contain; touch-action: pan-y; }
#chr-panel-foot { flex-shrink: 0; padding: 0 1rem 1rem; border-top: 1px solid var(--glass-light); padding-top: 0.75rem; margin-top: 0.25rem; }
#chr-panel-close {
    flex-shrink: 0;
    background: var(--glass-light);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: var(--fs-lg);
    line-height: 1;
    cursor: pointer;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin-top: 0.1rem;
    transition: all 0.15s;
}
#chr-panel-close:hover { background: var(--red-a15); border-color: var(--red-a30); color: var(--red-light); }

.chr-popup { font-family: var(--font-main); color: var(--text-primary); }
.chr-popup-kat { display: inline-flex; align-items: center; gap: var(--space-sm); font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; padding: 0.18rem 0.55rem; border-radius: var(--radius-lg); margin-bottom: 0.4rem; }
.chr-popup-titel { font-size: var(--fs-md); font-weight: 700; color: var(--text-primary); line-height: 1.3; margin-bottom: 0.2rem; }
.chr-popup-datum { font-size: var(--fs-sm); color: var(--text-muted); margin-bottom: 0.55rem; }
.chr-popup-beschr { font-size: var(--fs-base); color: var(--text-secondary); line-height: 1.55; margin-bottom: 0.55rem; }

.chr-popup-foto { width: 100%; border-radius: var(--radius-md); margin-bottom: 0.4rem; aspect-ratio: 16/9; object-fit: cover; cursor: zoom-in; display: block; }
/* ── Foto-Slider ── */
.chr-slider { position: relative; margin-bottom: 0.4rem; user-select: none; }
.chr-slider-track { display: flex; overflow: hidden; border-radius: var(--radius-md); aspect-ratio: 16/9; }
.chr-slider-track img { width: 100%; flex-shrink: 0; object-fit: cover; cursor: zoom-in; }
.chr-slider-inner { display: flex; width: 100%; transition: transform 0.3s ease; }
.chr-slider-quelle { font-size: var(--fs-xs); color: var(--text-muted); margin-bottom: 0.3rem; min-height: 0.9rem; }
.chr-slider-dots { display: flex; justify-content: center; gap: var(--space-sm); margin: 0.25rem 0 0.1rem; }
.chr-slider-dot { width: 6px; height: 6px; border-radius: var(--radius-full); background: rgba(255,255,255,0.2); cursor: pointer; transition: background 0.15s; }
.chr-slider-dot.aktiv { background: var(--blue-accent); }
.chr-slider-prev, .chr-slider-next { position: absolute; top: 50%; transform: translateY(-50%); background: var(--overlay-medium); border: none; color: var(--text-primary); font-size: var(--fs-lg); width: 28px; height: 28px; border-radius: var(--radius-full); cursor: pointer; display: flex; align-items: center; justify-content: center; z-index: 10; line-height: 1; padding: 0; transition: background 0.15s; }
.chr-slider-prev { left: 0.4rem; }
.chr-slider-next { right: 0.4rem; }
.chr-slider-prev:hover, .chr-slider-next:hover { background: rgba(0,0,0,0.8); }

.chr-popup-btn { display: block; width: 100%; margin-top: 0.5rem; padding: 0.45rem; text-align: center; background: rgba(59,130,246,0.13); border: 1px solid rgba(59,130,246,0.32); border-radius: var(--radius-md); color: var(--blue-accent); font-size: var(--fs-base); font-weight: 600; text-decoration: none; transition: background 0.15s; cursor: pointer; font-family: inherit; box-sizing: border-box; }
.chr-popup-btn:hover { background: var(--blue-a25); }

@media (max-width: 800px) {
    #chr-panel {
        position: fixed;
        top: 70px;
        bottom: auto;
        left: 50%;
        transform: translateX(-50%);
        right: auto;
        width: min(480px, 92vw);
        height: auto;
        max-height: calc(100dvh - 90px);
        border-radius: 16px;
        padding-top: 0.4rem;
    }
    #chr-panel::before {
        content: '';
        display: block;
        width: 36px; height: 4px;
        background: var(--glass-hover);
        border-radius: var(--radius-sm);
        margin: 0 auto 0.2rem;
        flex-shrink: 0;
    }
    #chr-panel-body {
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }
}
/* ── Marker ─────────────────────────────────────────────────────────────── */
.chr-ereignis-pin { display: flex; flex-direction: column; align-items: center; }
.chr-pin-svg-wrap { position: relative; width: 30px; height: 36px; }
.chr-pin-svg-wrap .pin-bg { position: absolute; top: 0; left: 0; }
.chr-pin-svg-wrap .pin-ico { position: absolute; top: 6px; left: 7px; }
/* Leaflet Tooltip Reset */
.leaflet-tooltip { background: transparent !important; border: none !important; box-shadow: none !important; padding: 0 !important; }
.leaflet-tooltip::before { display: none !important; }
.lk-gewaesser-label { background: var(--bg-tooltip) !important; border: 1px solid var(--sky-a40) !important; border-radius: var(--radius-sm) !important; color: var(--blue-accent) !important; font-size: var(--fs-xs) !important; font-weight: 600 !important; padding: 2px 6px !important; box-shadow: none !important; white-space: nowrap; }
/* ── Lightbox ───────────────────────────────────────────────────────────── */
#chr-lightbox { display:none;position:fixed;inset:0;width:100%;height:100vh;height:100dvh;background:rgba(0,0,0,0.93);z-index:10003;align-items:center;justify-content:center;overscroll-behavior:contain;touch-action:none; }
#chr-lightbox.on { display:flex; }
#chr-lightbox img { max-width:90%;max-height:88vh;border-radius: var(--radius-md);object-fit:contain;transform-origin:center center;will-change:transform;user-select:none;-webkit-user-select:none;-webkit-user-drag:none;touch-action:none; }
#chr-lb-close { position:absolute;top:1rem;right:1.5rem;background:none;border:none;color:#fff;font-size: var(--fs-hero);cursor:pointer;line-height:1; }
#chr-lb-prev, #chr-lb-next { position:absolute;top:50%;transform:translateY(-50%);background:var(--glass-hover);border:none;color:#fff;font-size: var(--fs-hero);width:48px;height:48px;border-radius: var(--radius-full);cursor:pointer;display:flex;align-items:center;justify-content:center;transition:background 0.15s;line-height:1;padding:0; }
#chr-lb-prev { left:1rem; }
#chr-lb-next { right:1rem; }
#chr-lb-prev:hover, #chr-lb-next:hover { background:var(--glass-hover); }
#chr-lb-counter { position:absolute;bottom:1.2rem;left:50%;transform:translateX(-50%);color:rgba(255,255,255,0.5);font-size: var(--fs-sm);font-family: var(--font-main); }
#chr-lb-caption-wrap {
    position: absolute;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    max-width: 85%;
    width: auto;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    padding: 0.6rem 1rem;
    border-radius: var(--radius-md);
    text-align: center;
    pointer-events: none;
    z-index: 2;
}
#chr-lb-caption {
    color: #f1f5f9;
    font-family: var(--font-main);
    font-size: 0.88rem;
    line-height: 1.45;
}
#chr-lb-source {
    color: rgba(203, 213, 225, 0.7);
    font-family: var(--font-main);
    font-size: 0.72rem;
    margin-top: 0.25rem;
    font-style: italic;
}
#chr-lb-source:empty { display: none; }
#chr-lb-caption:empty { display: none; }
@media (max-width: 768px) {
    #chr-lb-caption-wrap {
        bottom: 2.8rem;
        max-width: 92%;
        padding: 0.5rem 0.8rem;
    }
    #chr-lb-caption { font-size: 0.82rem; }
    #chr-lb-source { font-size: 0.68rem; }
}

/* Messdaten-Status-Banner (oben zentriert, zeigt aktiv angezeigtes Datum) */
#chr-mess-status {
    display: none;
    position: absolute;
    top: 0.75rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1100;
    background: var(--bg-tooltip);
    backdrop-filter: blur(10px);
    border: 1.5px solid var(--blue);
    border-radius: var(--radius-lg);
    padding: 0.55rem 0.75rem 0.55rem 1rem;
    box-shadow: 0 4px 16px var(--overlay-medium), 0 0 16px var(--blue-a25);
    max-width: calc(100vw - 16px);
    font-family: var(--font-main);
    align-items: center;
    gap: 0.6rem;
}
#chr-mess-status.sichtbar { display: flex; }
.chr-mess-status-titel {
    font-size: var(--fs-md);
    font-weight: 700;
    color: var(--blue-light);
    letter-spacing: 0.01em;
    white-space: nowrap;
}
.chr-mess-status-close {
    background: var(--glass-light);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: var(--fs-lg);
    line-height: 1;
    cursor: pointer;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    flex-shrink: 0;
    transition: all 0.15s;
}
.chr-mess-status-close:hover { background: var(--red-a15); border-color: var(--red-a30); color: var(--red-light); }

@media (max-width:600px) {
    #chr-mess-status {
        top: 0.8rem;
        left: 0.5rem;
        right: 0.5rem;
        transform: none;
        max-width: calc(100% - 1rem);
        padding: 0.55rem 0.75rem;
        z-index: 1105;
        justify-content: center;
    }
    .chr-mess-status-titel { font-size: var(--fs-base); }
}

@media (max-width:768px) {
    .chr-popup { min-width:250px; }
    /* Popup ganz oben am Screen (direkt unter Header) */
    #chr-panel-overlay {
        align-items: flex-start !important;
        justify-content: center !important;
        padding: 70px 0.4rem 0.4rem !important;
    }
    #chr-panel {
        max-height: calc(100dvh - 80px);
        overflow-y: auto;
        margin-top: 0 !important;
    }
    #chr-panel-foto { padding: 0 0.75rem; }
    #chr-panel-head { padding: 0.6rem 0.75rem 0; }
    #chr-panel-body { padding: 0 0.75rem; }
    #chr-panel-foot { padding: 0 0.75rem 0.75rem; }
    .chr-popup-titel { font-size: var(--fs-base); }
    .chr-popup-beschr { font-size: var(--fs-sm); }
}

/* ============================================================================
   LIGHT-MODE: Kontrast-Verbesserungen
   ============================================================================
   Im Light-Theme sind die Glass-Hintergründe sehr dezent, daher:
   - Kräftigere Box-Füllung für Panel + Buttons
   - Dunklere Textfarben für Labels und Zahlen
   - Kat-Badge oben rechts mit weißem Fill und klarer Farbgrenze
============================================================================ */

:root.light #chr-menu-panel {
    background: rgba(255, 255, 255, 0.98);
    border-color: rgba(30, 60, 120, 0.18);
    box-shadow: 0 4px 16px rgba(30, 60, 120, 0.12);
}
:root.light .chr-panel-label {
    color: #1e293b;
}

/* Kategorie-Buttons: etwas satterer Default-Hintergrund, dunklere Schrift */
:root.light .chr-kat-btn {
    background: rgba(30, 60, 120, 0.06);
    color: #1e293b;
    border-color: transparent;
}
:root.light .chr-kat-btn:hover {
    background: rgba(30, 60, 120, 0.10);
    border-color: rgba(30, 60, 120, 0.18);
}
:root.light .chr-kat-btn.aktiv {
    color: #0f172a;
}
:root.light .chr-kat-count {
    color: #64748b;
}
:root.light .chr-kat-btn.aktiv .chr-kat-count {
    color: #334155;
}

/* Kat-Badge oben rechts: weißer Fill statt transparentes Glas,
   damit die farbige Schrift klar lesbar ist */
:root.light .chr-kat-badge {
    background: #ffffff;
    box-shadow: 0 1px 6px rgba(30, 60, 120, 0.15),
                0 0 0 1px color-mix(in srgb, var(--kf, var(--blue)) 35%, transparent);
}

/* ============================================================
   Permanente Ereignis-Labels (ab Zoom 13)
   ============================================================ */
.leaflet-tooltip.chr-label {
    background: rgba(15, 23, 42, 0.92);
    border: 1px solid rgba(148, 163, 184, 0.35);
    color: #f8fafc;
    font-family: var(--font-main);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.55),
                0 0 0 1px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
    pointer-events: none;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}
.leaflet-tooltip.chr-label::before { display: none; } /* Pfeil weg */
.leaflet-tooltip.chr-label .chr-label-jahr {
    font-weight: 800;
    margin-right: 0.3rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 1),
                 0 0 4px rgba(0, 0, 0, 0.7);
    filter: brightness(1.15) saturate(1.2);
}
.leaflet-tooltip.chr-label .chr-label-titel {
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 1),
                 0 0 3px rgba(0, 0, 0, 0.6);
    filter: brightness(1.3) saturate(1.1);
}
/* Light-Theme: dunkler Background (gleich wie Dark-Mode) damit Kategoriefarben knackig lesbar bleiben */
:root.light .leaflet-tooltip.chr-label {
    background: rgba(15, 23, 42, 0.88);
    border-color: rgba(148, 163, 184, 0.35);
    color: #f8fafc;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35),
                0 0 0 1px rgba(0, 0, 0, 0.15);
}
:root.light .leaflet-tooltip.chr-label .chr-label-jahr {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 1),
                 0 0 4px rgba(0, 0, 0, 0.7);
}

/* Long-Press-Popup (Mobile-Ersatz fuer Hover-Tooltip) */
.leaflet-popup.chr-longpress-popup .leaflet-popup-content-wrapper {
    background: transparent;
    box-shadow: none;
    padding: 0;
    border-radius: 0;
}
.leaflet-popup.chr-longpress-popup .leaflet-popup-content {
    margin: 0;
    padding: 0;
}
.leaflet-popup.chr-longpress-popup .leaflet-popup-tip {
    display: none;
}

/* ============================================================
   Station-Klick-Popup (Mobile)
   ============================================================ */
.leaflet-popup.chr-station-popup .leaflet-popup-content-wrapper {
    background: var(--bg-card-solid);
    border: 1px solid var(--blue-a25);
    border-radius: var(--radius-md);
    box-shadow: 0 6px 20px rgba(0,0,0,0.5);
    padding: 0.35rem 0.15rem;
}
.leaflet-popup.chr-station-popup .leaflet-popup-content {
    margin: 0.5rem 0.7rem;
    font-family: var(--font-main);
    color: var(--text-primary);
}
.leaflet-popup.chr-station-popup .leaflet-popup-tip {
    background: var(--bg-card-solid);
}
.leaflet-popup.chr-station-popup .leaflet-popup-close-button {
    color: var(--text-muted);
    font-size: 1.4rem;
    padding: 0.3rem 0.5rem 0 0;
}
.leaflet-popup.chr-station-popup .leaflet-popup-close-button:hover {
    color: var(--text-primary);
}
