/**
 * DASHBOARD CSS - Wetterstation Schladming
 * Extrahiert aus index.php für bessere Wartbarkeit
 */

/* ============================================================================
   GRUNDLAYOUT
   ============================================================================ */

* { box-sizing: border-box; }

/* Body-Farben ergänzen (flex-Layout kommt aus header.php) */
body {
    background: var(--bg-page);
    font-family: var(--font-main);
    color: var(--text-primary);
}

.dashboard-wrapper {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1.5rem var(--space-lg);
    flex: 1;
}

.dashboard-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--blue-a25);
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

.header-time {
    font-size: var(--fs-base);
    color: var(--db-unit);
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
}

.live-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--green-deep);
    border-radius: var(--radius-full);
    animation: pulse 2s ease-in-out infinite;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.2); }
}

/* ============================================================================
   DESKTOP LAYOUT: Links Hauptkarte, Rechts Mini-Tiles (2-spaltig)
   ============================================================================ */

.db-layout {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 1.4fr);
    gap: var(--space-xl);
    align-items: start;
}

.db-main { 
    min-width: 0; 
    overflow: hidden; 
    width: 100%;
    contain: inline-size;
}

/* Panels: nur aktives sichtbar, fixe Breite */
.db-panel { display: none; width: 100%; max-width: 100%; }
.db-panel.active {
    display: block;
    width: 100%;
    max-width: 100%;
}

@keyframes dbFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Sidebar rechts */
.db-sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    position: sticky;
    top: 1rem;
}

/* Paar-Container: 2 Kacheln nebeneinander */
.db-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-sm);
}

/* Triple-Container: 3 Kacheln nebeneinander (Aurora, Mond, Sonne) */
.db-triple {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.5rem 0.4rem;
}

/* Im Triple: kompakteres Layout damit alle Texte lesbar sind */
.db-triple .db-mini-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--space-xs);
    padding: 0.5rem 0.3rem;
}
.db-triple .db-mini-icon {
    width: 20px;
    height: 20px;
}
.db-triple .db-mini-label {
    white-space: normal;
    text-align: center;
    overflow: visible;
    text-overflow: clip;
}
.db-triple .db-mini-value {
    white-space: normal;
    font-size: var(--fs-xs);
    line-height: 1.2;
    text-align: center;
}

/* Mini-Kachel */
.db-mini {
    background: var(--bg-card);
    border: 1px solid var(--blue-a25);
    border-left: 3px solid rgba(52,152,219,0.45);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.2s ease;
    overflow: hidden;
    min-height: 62px;
}
.db-mini:hover {
    border-color: var(--blue-a40);
    border-left-color: var(--blue);
    background: var(--bg-card-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}
.db-mini.active {
    border-color: var(--blue-a40);
    border-left-color: var(--blue);
    background: var(--bg-card);
    box-shadow: 0 0 16px var(--blue-a25);
}
.db-mini.active .db-mini-icon { opacity: 1; }
.db-mini.active .db-mini-label { color: var(--blue-accent); }

/* Farbige linke Border je Kategorie */
.db-mini[data-panel="temp"]      { border-left-color: var(--red); }
.db-mini[data-panel="windchill"] { border-left-color: var(--blue-accent); }
.db-mini[data-panel="feuchte"]   { border-left-color: var(--blue); }
.db-mini[data-panel="pressure"]  { border-left-color: var(--teal-light); }
.db-mini[data-panel="rain"]      { border-left-color: var(--blue-light); }
.db-mini[data-panel="schnee"]    { border-left-color: #e0f2fe; }
:root.light .db-mini[data-panel="schnee"] { border-left-color: #38bdf8; }
:root.light .db-mini[data-panel="schnee"] .db-mini-icon { color: #0ea5e9 !important; }
.db-mini[data-panel="wind"]      { border-left-color: #67e8f9; }
.db-mini[data-panel="foehn"]     { border-left-color: var(--yellow-dark); }
.db-mini[data-panel="solar"]     { border-left-color: var(--yellow); }
.db-mini[data-panel="uv"]        { border-left-color: var(--purple-bright); }
.db-mini[data-panel="taupunkt"]  { border-left-color: var(--cyan); }
.db-mini[data-panel="wetbulb"]   { border-left-color: var(--green-muted); }
.db-mini[data-panel="boden5"]    { border-left-color: var(--green-deep); }
.db-mini[data-panel="erde5"]     { border-left-color: var(--brown); }
.db-mini[data-panel="erde30"]    { border-left-color: var(--brown-dark); }
.db-mini[data-panel="bodenfeuchte"] { border-left-color: var(--teal); }

.db-mini-inner {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: 0.75rem 0.8rem;
}

.db-mini-icon {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    opacity: 0.85;
    transition: all 0.2s;
}
.db-mini:hover .db-mini-icon { opacity: 1; }

.db-mini-info {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    min-width: 0;
    overflow: hidden;
}
.db-mini-label {
    font-size: var(--fs-sm);
    font-weight: 700;
    color: var(--db-extreme-label);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.db-mini-value {
    font-size: var(--fs-lg);
    font-weight: 800;
    color: var(--db-value);
    line-height: 1.1;
    white-space: nowrap;
}
.db-mini-unit {
    font-size: var(--fs-sm);
    font-weight: 500;
    color: var(--db-label);
}

/* Trennlinie in Sidebar */
.db-sidebar-divider {
    height: 2px;
    background: var(--blue-a25);
    margin: 0.4rem 0;
    border-radius: var(--radius-sm);
}

/* ============================================================================
   48h CHART UNTER JEDER KARTE
   ============================================================================ */

.db-chart-wrap {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 2px solid var(--blue-a25);
}

.db-chart-wrap canvas {
    width: 100% !important;
    height: 250px !important;
    max-height: 250px;
}
#chart-foehn canvas {
    height: 290px !important;
    max-height: 290px;
}

.db-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.db-chart-title {
    font-size: var(--fs-md);
    font-weight: 600;
    color: var(--db-label);
    letter-spacing: 0.3px;
}

.db-chart-loading {
    text-align: center;
    padding: 2rem 0;
    color: var(--db-label);
    font-size: var(--fs-sm);
}

.db-chart-loading::after {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid var(--blue-a25);
    border-top-color: var(--blue);
    border-radius: var(--radius-full);
    margin-left: 0.5rem;
    vertical-align: middle;
    animation: dbChartSpin 0.8s linear infinite;
}

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

/* Mobile: Desktop-Layout verstecken */
@media (max-width: 600px) {
    .db-layout { display: none; }
}

/* Desktop: Mobile-Elemente + altes Grid verstecken */
@media (min-width: 601px) {
    .mobile-overview { display: none !important; }
    .mobile-toggle-all { display: none !important; }
    .dashboard-grid { display: none !important; }
}

/* Altes Grid nur noch für Mobile Fallback */
.dashboard-grid {
    display: none;
    grid-template-columns: 1fr;
    gap: var(--space-xl);
}
@media (max-width: 600px) {
    .dashboard-grid.show-all { display: grid; }
}

/* ============================================================================
   MOBILE ÜBERSICHT
   ============================================================================ */

.mobile-overview {
    display: none;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--space-sm);
    margin-bottom: 1rem;
}

.mobile-btn {
    background: var(--bg-card);
    border: 1px solid var(--blue-a25);
    border-radius: var(--radius-lg);
    padding: 0.6rem 0.4rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 0;
    overflow: hidden;
    /* Einheitliche Mindesthöhe für alle Cards (normal + row-Variante) */
    min-height: 4.2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.mobile-btn:hover, .mobile-btn:active {
    border-color: rgba(52, 152, 219, 0.6);
    transform: scale(0.98);
}

.mobile-btn-icon { font-size: var(--fs-lg); margin-bottom: 0.2rem; line-height: 1; }
.mobile-btn-value { font-size: var(--fs-md); font-weight: 700; color: var(--text-primary); line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mobile-btn-label { font-size: var(--fs-xs); color: var(--db-label); text-transform: uppercase; letter-spacing: 0.3px; margin-top: 0.15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Variante: Icon + Label nebeneinander (horizontal) */
.mobile-btn.mobile-btn-row {
    flex-direction: row;
    gap: 0.5rem;
}
.mobile-btn.mobile-btn-row .mobile-btn-icon { margin-bottom: 0; }
.mobile-btn.mobile-btn-row .mobile-btn-label { font-size: var(--fs-sm); margin-top: 0; text-transform: none; letter-spacing: 0; color: var(--text-primary); font-weight: 600; }

/* Mobile Toggle */
.mobile-toggle-all { display: none; }

@media (max-width: 600px) {
    .mobile-overview { display: grid; }
    .dashboard-grid { display: none; }
    .dashboard-grid.show-all { display: grid; }
    
    .mobile-toggle-all {
        display: block;
        width: 100%;
        padding: 0.75rem;
        margin-top: 0.5rem;
        background: transparent;
        border: 1px dashed var(--blue-a25);
        border-radius: var(--radius-md);
        color: var(--db-label);
        font-size: var(--fs-sm);
        cursor: pointer;
    }
    
    .mobile-toggle-all:hover { border-color: rgba(52, 152, 219, 0.5); color: var(--blue-light); }
    
    footer, .footer, .site-footer { padding: 0.75rem !important; font-size: var(--fs-sm) !important; }
    footer a, .footer a { display: inline !important; padding: 0.25rem 0.5rem !important; }
    footer br, .footer br { display: none; }
}

/* ============================================================================
   CARD MODAL (Mobile)
   ============================================================================ */

.card-modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--bg-overlay);
    z-index: 9998;
    overflow-y: auto;
    padding: 1rem;
}

.card-modal-overlay.active {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 1rem;
}

.card-modal-content {
    width: 100%;
    max-width: 400px;
    position: relative;
    padding-top: 2.5rem;
}

.card-modal-close {
    position: absolute;
    top: 0; right: 0;
    background: var(--blue-a25);
    border: 1px solid var(--blue-a40);
    border-radius: var(--radius-full);
    width: 36px; height: 36px;
    color: var(--blue-light);
    font-size: var(--fs-xl);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.card-modal-close:hover { background: var(--blue-a40); }

/* Modal Cards: Chart-Höhe auf Mobile anpassen */
.card-modal-content .db-chart-wrap canvas {
    height: 180px !important;
    max-height: 180px;
}
/* Modal Cards: single-column Layout */
.card-modal-content .db-card {
    grid-template-columns: 1fr;
}
.card-modal-content .db-card > .db-card-extremes {
    grid-column: 1;
    grid-row: auto;
    flex-direction: row;
    flex-wrap: wrap;
    gap: var(--space-sm);
}
.card-modal-content .db-card > .db-card-extremes .db-extreme {
    flex: 0 1 auto;
    min-width: auto;
}
.card-modal-content .db-card > .db-card-head {
    grid-column: 1;
}

/* ============================================================================
   EINHEITLICHE KARTEN-KOMPONENTE (db-card)
   Layout: Head → Extremes → Body → Chart
   ============================================================================ */

.db-card {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--blue-a10);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto;
    gap: 0;
}
/* Head links, Extremes rechts – gleiche Zeile */
.db-card > .db-card-head      { grid-column: 1; grid-row: 1; }
.db-card > .db-card-extremes   { grid-column: 2; grid-row: 1; align-self: center; }
/* Alles andere: volle Breite */
.db-card > .db-card-body,
.db-card > .db-card-anim,
.db-card > .db-chart-wrap,
.db-card > .thermal-bar-wrap,
.db-card > .windrose-row,
.db-card > .foehn-detail-row,
.db-card > .rain-summary-row,
.db-card > .snow-visual-section,
.db-card > .soil-section,
.db-card > .pressure-bar-section,
.db-card > .solar-ring-section,
.db-card > .uv-display-section,
.db-card > .boden-visual-section { grid-column: 1 / -1; }

/* Alle Inhalte in Cards dürfen nie breiter als der Container sein */
.db-card img,
.db-card iframe,
.db-card svg,
.db-card canvas,
.db-card .metric-card,
.db-card .db-card-body,
.db-card .db-card-anim {
    max-width: 100%;
    box-sizing: border-box;
}

.db-card.sonder {
    width: 100%;
    max-width: 100%;
}

/* --- HEAD: Parametername + Aktueller Wert (links) --- */
.db-card-head {
    display: block;
}
.db-card-head.full { display: block; }

.db-card-label {
    font-size: var(--fs-md);
    font-weight: 600;
    color: var(--db-label);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.3rem;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}
.db-card-label svg {
    width: 1.1em;
    height: 1.1em;
    flex-shrink: 0;
}

.db-card-val {
    font-size: var(--fs-hero);
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.db-card-unit {
    font-size: var(--fs-xl);
    font-weight: 600;
    color: var(--db-unit);
}

.db-card-sub {
    font-size: var(--fs-sm);
    color: var(--db-label);
    margin-top: 0.35rem;
}

.db-card-symbol {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 90px;
    height: 90px;
    flex-shrink: 0;
}

/* Icon in großen Cards: versteckt */
.db-card-icon { display: none; }
.db-card-icon svg { display: none; }
.db-card-icon::after { display: none; }

/* --- EXTREMES: Kompakt rechts neben Header, in Boxen --- */
.db-card-extremes {
    display: flex;
    flex-direction: row;
    gap: var(--space-sm);
    margin: 0;
    padding: 0;
    border: none;
    min-width: unset;
}

.db-extreme {
    flex: 1;
    background: var(--glass-medium);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 0.35rem 0.6rem;
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.db-extreme-label {
    font-size: var(--fs-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.1rem;
}
.db-extreme-val {
    font-size: var(--fs-xl);
    font-weight: 700;
    line-height: 1.2;
}
.db-extreme-time {
    font-size: var(--fs-xs);
    color: var(--db-label);
    margin-top: 0.05rem;
}
.db-extreme.cold { border-color: var(--blue-a25); background: var(--blue-a10); order: 2; }
.db-extreme.cold .db-extreme-label { color: var(--db-extreme-cold); }
.db-extreme.cold .db-extreme-val { color: var(--blue-light); }
.db-extreme.hot  { border-color: var(--red-a15); background: var(--red-a15); order: 1; }
.db-extreme.hot .db-extreme-label { color: var(--db-extreme-hot); }
.db-extreme.hot .db-extreme-val  { color: var(--red); }
.db-extreme.neutral .db-extreme-val { color: var(--db-extreme-neutral); }
.db-extreme.yellow { border-color: var(--yellow-a15); background: var(--yellow-a15); }
.db-extreme.yellow .db-extreme-label { color: var(--db-extreme-yellow-label); }
.db-extreme.yellow .db-extreme-val { color: var(--yellow); }

/* --- BODY: Zusatzinfos, Animationen --- */
.db-card-body {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--blue-a10);
}

.db-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-sm);
}

.db-info-box {
    background: var(--glass-light);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 0.5rem 0.6rem;
}
.db-info-label {
    font-size: var(--fs-xs);
    font-weight: 600;
    color: var(--db-label);
    text-transform: uppercase;
    margin-bottom: 0.15rem;
}
.db-info-val {
    font-size: var(--fs-lg);
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.15;
}

.db-card-anim {
    display: flex;
    justify-content: center;
    padding: 0.5rem 0;
}

/* --- Thermal Stress Bar (Gefühlte Temperatur) --- */
.thermal-bar-wrap {
    text-align: center;
}
.thermal-bar {
    position: relative;
    height: 15px;
    border-radius: var(--radius-md);
    background: linear-gradient(to right,
        #1e1b4b 0%,       /* -40°C extrem kalt */
        #312e81 8%,        /* -30°C */
        var(--blue) 18%,       /* -20°C */
        var(--teal) 28%,       /* -10°C */
        var(--cyan) 38%,       /* -2°C */
        var(--green-deep) 48%,       /* +5°C */
        var(--green-dark) 54%,       /* +12°C */
        var(--lime-dark) 60%,       /* +18°C */
        var(--yellow-deep) 68%,       /* +25°C */
        var(--yellow-dark) 74%,       /* +30°C */
        var(--orange) 80%,       /* +35°C */
        var(--red) 88%,       /* +40°C */
        #991b1b 100%       /* +50°C */
    );
    border: 1px solid var(--border-light);
    margin: 0 0 0.7rem 0;
}
.thermal-marker {
    position: absolute;
    top: -9px;
    transform: translateX(-50%);
    filter: drop-shadow(0 1px 2px var(--overlay-medium));
    z-index: 2;
    transition: left 1s ease;
}
.thermal-values {
    display: flex;
    justify-content: center;
    gap: var(--space-xl);
    margin-bottom: 0.5rem;
}
.thermal-val-item {
    display: flex;
    align-items: baseline;
    gap: var(--space-xs);
    font-size: var(--fs-base);
}
.thermal-arrow {
    font-size: var(--fs-xs);
}
.thermal-arrow.hot { color: var(--red); }
.thermal-arrow.cold { color: var(--blue-light); }
.thermal-val {
    font-weight: 700;
    color: var(--text-primary);
}
.thermal-unit {
    color: var(--db-unit);
    font-size: var(--fs-sm);
}
.thermal-time {
    color: var(--db-label);
    font-size: var(--fs-sm);
    margin-left: 0.2rem;
}
.thermal-label {
    font-size: var(--fs-md);
    font-weight: 600;
    color: var(--db-extreme-neutral);
    margin-top: 0.3rem;
}

.db-card .db-chart-wrap {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--blue-a10);
}

/* Akzentfarben für spezielle Info-Boxen */
.db-info-box.green  { border-color: rgba(16,185,129,0.3); background: rgba(16,185,129,0.1); }
.db-info-box.green .db-info-label  { color: var(--green-deep); }
.db-info-box.blue   { border-color: var(--blue-a25); background: var(--blue-a10); }
.db-info-box.blue .db-info-label   { color: var(--blue); }
.db-info-box.brown  { border-color: rgba(180,130,70,0.3); background: rgba(180,130,70,0.1); }
.db-info-box.brown .db-info-label  { color: var(--brown); }
.db-info-box.purple { border-color: var(--purple-a30); background: rgba(168,85,247,0.1); }
.db-info-box.purple .db-info-label { color: var(--purple); }
.db-info-box.yellow { border-color: var(--yellow-a35); background: var(--yellow-a15); }
.db-info-box.yellow .db-info-label { color: var(--yellow); }

/* ============================================================================
   ALTE METRIC CARDS (Mobile Fallback)
   ============================================================================ */

.metric-card {
    background: var(--bg-card);
    border: 1px solid var(--blue-a25);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

/* In db-card eingebettet: kein eigener Hintergrund/Border (db-card hat bereits) */
.db-card .metric-card {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
}

.metric-card:hover {
    border-color: var(--blue-a40);
    box-shadow: 0 8px 24px var(--blue-a10);
}

.metric-header {
    font-size: var(--fs-base);
    color: var(--db-label);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 0.75rem;
    font-weight: 600;
    min-height: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.metric-value {
    font-size: var(--fs-hero);
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    font-variant-numeric: tabular-nums;
    min-height: 2.75rem;
}

.metric-unit {
    font-size: var(--fs-lg);
    color: var(--db-unit);
    margin-left: 0.25rem;
}

/* ============================================================================
   TEMPERATUR BOX
   ============================================================================ */

.temp-box-grid { display: flex; flex-direction: column; gap: var(--space-lg); height: 100%; }
.temp-row-top { display: grid; grid-template-columns: 1fr 80px; gap: var(--space-lg); }

.temp-row-bottom {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
    padding-top: 1rem;
    border-top: 1px solid var(--blue-a10);
    margin-top: auto;
}

.temp-value-huge { font-size: var(--fs-hero); font-weight: 700; color: var(--text-primary); line-height: 1; min-height: 2.5rem; }
.temp-unit-large { font-size: var(--fs-xl); color: var(--db-unit); margin-left: 0.25rem; }

.minmax-row { display: flex; gap: var(--space-md); margin-top: 2rem; }

.minmax-compact {
    flex: 1;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--blue-a25);
    background: var(--blue-a10);
}

.minmax-compact.cold { border-color: var(--blue-a25); background: var(--blue-a10); }
.minmax-compact.hot { border-color: var(--red-a30); background: rgba(239, 68, 68, 0.08); }

.minmax-label-small { font-size: var(--fs-xs); color: var(--db-label); text-transform: uppercase; margin-bottom: 0.25rem; }
.minmax-value-small { font-size: var(--fs-lg); font-weight: 700; }
.minmax-value-small.cold { color: var(--blue); }
.minmax-value-small.hot { color: var(--red); }

/* Thermometer */
.thermo-vertical { position: relative; width: 70px; height: 240px; }

.thermo-scale-side {
    position: absolute;
    left: 0; top: 10px; bottom: 50px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 25px;
}

.thermo-scale-side span { font-size: var(--fs-xs); color: var(--db-label); font-weight: 600; text-align: right; }

.thermo-tube-wrap { position: absolute; left: 30px; top: 10px; bottom: 35px; }

.thermo-tube-mini {
    position: relative;
    width: 16px; height: 100%;
    background: var(--blue-a10);
    border: 2px solid var(--blue-a25);
    border-radius: 8px 8px 0 0;
    overflow: hidden;
}

.thermo-fill {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    transition: height 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.thermo-bulb-mini {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    width: 28px; height: 28px;
    border-radius: var(--radius-full);
    transition: background 0.3s ease;
    border: 2px solid var(--blue-a25);
}

/* Gefühlt Sektion */
.feel-section { padding-right: 0.5rem; }
.feel-value { font-size: var(--fs-hero); font-weight: 700; color: var(--text-primary); margin-bottom: 0.75rem; }

.color-bar-mini {
    width: 100%; height: 15px;
    background: linear-gradient(90deg, #1e40af 0%, var(--blue) 20%, var(--teal) 40%, var(--green-deep) 60%, var(--yellow) 80%, var(--red) 100%);
    border-radius: var(--radius-sm);
    position: relative;
    margin-bottom: 0.5rem;
}

.color-bar-indicator-mini {
    position: absolute;
    top: -6px;
    transform: translateX(-50%);
    width: 0; height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 8px solid var(--text-primary);
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.stress-text { font-size: var(--fs-sm); font-weight: 600; color: var(--blue-light); }

/* Windchill */
.windchill-section { text-align: center; padding-left: 0.5rem; border-left: 1px solid var(--blue-a10); }
.windchill-value { font-size: var(--fs-hero); font-weight: 700; color: var(--text-primary); margin-bottom: 0.75rem; }

/* ============================================================================
   LUFTDRUCK
   ============================================================================ */

.druck-tendenz {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: rgba(52, 152, 219, 0.08);
    border-radius: var(--radius-md);
    border: 1px solid var(--blue-a10);
}

/* ============================================================================
   REALISTISCHER MOND MIT KRATERN
   ============================================================================ */

.moon-icon {
    width: 24px; height: 24px;
    border-radius: var(--radius-full);
    position: relative;
    display: inline-block;
    overflow: hidden;
    background: 
        radial-gradient(circle at 30% 25%, rgba(120,120,120,0.4) 0%, transparent 8%),
        radial-gradient(circle at 65% 35%, rgba(100,100,100,0.3) 0%, transparent 12%),
        radial-gradient(circle at 45% 60%, rgba(110,110,110,0.35) 0%, transparent 10%),
        radial-gradient(circle at 70% 70%, rgba(90,90,90,0.25) 0%, transparent 6%),
        radial-gradient(circle at 25% 55%, rgba(105,105,105,0.3) 0%, transparent 7%),
        radial-gradient(circle at 35% 35%, #e8e8e8 0%, #c9c9c9 30%, #a8a8a8 60%, #888 100%);
    box-shadow: 
        inset -3px -3px 8px var(--overlay-medium),
        inset 2px 2px 6px var(--glass-hover),
        0 0 10px rgba(200,200,200,0.2);
}

.moon-icon.large {
    width: 100px; height: 100px;
    background: 
        radial-gradient(circle at 25% 20%, rgba(100,100,100,0.5) 0%, rgba(130,130,130,0.2) 4%, transparent 12%),
        radial-gradient(circle at 60% 30%, rgba(90,90,90,0.4) 0%, rgba(120,120,120,0.2) 5%, transparent 15%),
        radial-gradient(circle at 40% 55%, rgba(95,95,95,0.45) 0%, rgba(125,125,125,0.2) 4%, transparent 13%),
        radial-gradient(circle at 75% 65%, rgba(85,85,85,0.35) 0%, transparent 8%),
        radial-gradient(circle at 20% 50%, rgba(100,100,100,0.4) 0%, transparent 10%),
        radial-gradient(circle at 50% 15%, rgba(110,110,110,0.3) 0%, transparent 7%),
        radial-gradient(circle at 35% 75%, rgba(105,105,105,0.35) 0%, transparent 11%),
        radial-gradient(ellipse at 45% 40%, rgba(80,80,90,0.3) 0%, transparent 25%),
        radial-gradient(ellipse at 30% 60%, rgba(75,75,85,0.25) 0%, transparent 20%),
        radial-gradient(circle at 30% 30%, #f0f0f0 0%, #d4d4d4 25%, #b8b8b8 50%, #9a9a9a 75%, #7a7a7a 100%);
    box-shadow: 
        inset -6px -6px 20px var(--overlay-medium),
        inset 4px 4px 15px rgba(255,255,255,0.4),
        0 0 25px rgba(200,200,220,0.3),
        0 0 50px rgba(200,200,220,0.15);
}

.moon-icon::after {
    content: '';
    position: absolute;
    top: 0; width: 100%; height: 100%;
    border-radius: var(--radius-full);
    background: var(--bg-page);
    transition: all 0.3s ease;
}

.moon-icon.new::after { left: 0; width: 100%; opacity: 0.95; }
.moon-icon.waxing-crescent::after { left: 0; width: 80%; border-radius: 50% 0 0 50%; background: linear-gradient(90deg, var(--bg-page) 60%, transparent); }
.moon-icon.first-quarter::after { left: 0; width: 50%; border-radius: 50% 0 0 50%; }
.moon-icon.waxing-gibbous::after { left: 0; width: 30%; border-radius: 50% 0 0 50%; background: linear-gradient(90deg, var(--bg-page), transparent); }
.moon-icon.full::after { display: none; }
.moon-icon.waning-gibbous::after { right: 0; left: auto; width: 30%; border-radius: 0 50% 50% 0; background: linear-gradient(-90deg, var(--bg-page), transparent); }
.moon-icon.last-quarter::after { right: 0; left: auto; width: 50%; border-radius: 0 50% 50% 0; }
.moon-icon.waning-crescent::after { right: 0; left: auto; width: 80%; border-radius: 0 50% 50% 0; background: linear-gradient(-90deg, var(--bg-page) 60%, transparent); }

/* ============================================================================
   SCHNEEFLOCKEN & SCHNEE
   ============================================================================ */

.schneeflocken-container { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; }

.schneeflocke {
    position: absolute; top: -20px;
    font-size: var(--fs-xl);
    color: rgba(255, 255, 255, 0.8);
    animation: schneefall 8s linear infinite;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

@keyframes schneefall {
    0% { top: -20px; opacity: 0; transform: translateX(0) rotate(0deg); }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { top: 100%; opacity: 0; transform: translateX(20px) rotate(360deg); }
}

.schneeflocke:nth-child(1) { animation-duration: 8s; font-size: var(--fs-lg); }
.schneeflocke:nth-child(2) { animation-duration: 10s; font-size: var(--fs-xl); }
.schneeflocke:nth-child(3) { animation-duration: 7s; font-size: var(--fs-md); }
.schneeflocke:nth-child(4) { animation-duration: 9s; font-size: var(--fs-xl); }
.schneeflocke:nth-child(5) { animation-duration: 11s; font-size: var(--fs-xl); }
.schneeflocke:nth-child(6) { animation-duration: 8.5s; font-size: var(--fs-lg); }

.snow-layer-animated {
    position: absolute; bottom: 0; left: 0; right: 0;
    height: 0%;
    background: linear-gradient(to top, rgba(255,255,255,0.85), rgba(240,248,255,0.75) 30%, rgba(230,240,255,0.65) 60%, rgba(220,235,255,0.5));
    transition: height 1.5s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 5;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    box-shadow: inset 0 2px 8px rgba(255,255,255,0.5), 0 -2px 15px var(--blue-a25);
}

.snow-layer-animated::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(255,255,255,0.9) 1px, transparent 1px),
        radial-gradient(circle at 60% 70%, rgba(255,255,255,0.7) 0.8px, transparent 0.8px),
        radial-gradient(circle at 80% 20%, rgba(255,255,255,0.8) 1.2px, transparent 1.2px);
    background-size: 40px 40px, 35px 35px, 45px 45px;
    animation: snowSparkle 4s ease-in-out infinite;
    opacity: 0.6;
}

@keyframes snowSparkle { 0%, 100% { opacity: 0.6; } 50% { opacity: 0.9; } }

.snow-layer-animated::after {
    content: '';
    position: absolute; top: -2px; left: 0; right: 0;
    height: 4px;
    background: rgba(255,255,255,0.95);
    box-shadow: 0 -1px 3px var(--blue-a25);
}

/* Schneekanonen */
@keyframes snowfall {
    0% { transform: translate(0, 0); opacity: 0.9; }
    50% { opacity: 0.5; }
    100% { transform: translate(-50px, -33px); opacity: 0; }
}

.snow-active .snow-particle { animation: snowfall 0.5s ease-in infinite; }
.snow-inactive .snow-particle { opacity: 0; }
#snow-pile.snow-inactive ellipse { opacity: 0; }

/* ============================================================================
   SONNENANIMATION
   ============================================================================ */

@keyframes sun-rotate { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
#sun-rays-solar { animation: sun-rotate 20s linear infinite; }

/* ============================================================================
   INFO-POPUPS
   ============================================================================ */

.info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px; height: 18px;
    border-radius: var(--radius-full);
    background: var(--purple-a15);
    color: var(--purple);
    font-size: var(--fs-xs);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid var(--purple-a30);
}

.info-icon:hover { background: var(--purple-a30); transform: scale(1.1); }

.info-popup {
    display: none;
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-tooltip);
    border: 2px solid var(--purple-bright);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    max-width: 400px;
    z-index: 9999;
    box-shadow: 0 10px 40px var(--overlay-medium);
}

.info-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--overlay-heavy);
    z-index: 9998;
}

/* ============================================================================
   FÖHN
   ============================================================================ */

.foehn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-sm); }

.foehn-box { padding: 0.75rem; border-radius: var(--radius-md); border: 1px solid; text-align: center; }
.foehn-box .route { font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; margin-bottom: 0.25rem; }
.foehn-box .diff { font-size: var(--fs-xl); font-weight: 700; line-height: 1; }
.foehn-box .status { font-size: var(--fs-xs); font-weight: 600; margin-top: 0.25rem; }

.foehn-info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px; height: 18px;
    background: var(--blue-a25);
    border-radius: var(--radius-full);
    font-size: var(--fs-xs);
    color: var(--blue-light);
    cursor: pointer;
    transition: all 0.2s;
}

.foehn-info-icon:hover { background: var(--blue-a40); transform: scale(1.1); }

.foehn-error {
    background: var(--red-a15);
    border: 1px solid var(--red-a30);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    color: var(--red-light);
    text-align: center;
    font-size: var(--fs-sm);
}

.foehn-info-popup {
    display: none;
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-tooltip);
    border: 2px solid var(--blue-a40);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    max-width: 450px;
    width: 90%;
    z-index: 9999;
    box-shadow: 0 10px 40px var(--overlay-medium);
    color: var(--text-primary);
}

.foehn-info-popup h3 { margin: 0 0 1rem 0; color: var(--blue-light); font-size: var(--fs-lg); }
.foehn-info-popup p { margin: 0.5rem 0; font-size: var(--fs-base); line-height: 1.5; color: var(--text-secondary); }
.foehn-info-popup ul { margin: 0.75rem 0; padding-left: 1.25rem; }
.foehn-info-popup li { margin: 0.4rem 0; font-size: var(--fs-base); color: var(--text-secondary); }

.foehn-info-popup .close-btn {
    position: absolute;
    top: 0.75rem; right: 1rem;
    font-size: var(--fs-xl);
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
    background: none;
    border: none;
}

.foehn-info-popup .close-btn:hover { color: var(--text-primary); }

.foehn-info-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--overlay-heavy);
    z-index: 9998;
}

/* ============================================================================
   WIEDERVERWENDBARE HILFSKLASSEN
   ============================================================================ */

/* Data-Box: Hintergrund-Kästchen für Werte */
.data-box {
    background: rgba(52, 152, 219, 0.08);
    border-radius: var(--radius-md);
    padding: 0.5rem;
    border: 1px solid var(--blue-a10);
}

.data-box-green {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: var(--radius-md);
    padding: 0.75rem;
}

.data-box-brown {
    background: rgba(180, 130, 70, 0.15);
    border: 1px solid rgba(180, 130, 70, 0.3);
    border-radius: var(--radius-md);
    padding: 0.5rem;
}

.data-box-blue {
    background: var(--blue-a10);
    border: 1px solid var(--blue-a25);
    border-radius: var(--radius-md);
    padding: 0.75rem;
}

.data-box-purple {
    background: var(--purple-a15);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    border: 1px solid var(--purple-a15);
}

/* Label & Werte */
.label-small { font-size: var(--fs-xs); color: var(--db-label); text-transform: uppercase; margin-bottom: 0.25rem; font-weight: 600; }
.label-green { font-size: var(--fs-xs); color: var(--green-deep); text-transform: uppercase; margin-bottom: 0.25rem; font-weight: 600; }
.label-brown { font-size: var(--fs-xs); color: var(--brown); text-transform: uppercase; margin-bottom: 0.15rem; font-weight: 600; }
.label-blue { font-size: var(--fs-xs); color: var(--blue); text-transform: uppercase; margin-bottom: 0.25rem; font-weight: 600; }
.label-purple { font-size: var(--fs-xs); color: var(--purple); display: block; margin-bottom: 0.25rem; }

.value-big { font-size: var(--fs-hero); font-weight: 700; color: var(--db-value); line-height: 1; }
.value-medium { font-size: var(--fs-hero); font-weight: 700; color: var(--db-value); line-height: 1; }
.value-small { font-size: var(--fs-lg); font-weight: 700; color: var(--db-value); }
.value-unit { font-size: var(--fs-base); color: var(--db-unit); }
.value-unit-large { font-size: var(--fs-xl); color: var(--db-unit); }

/* Grid-Helfer */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-sm); }
.grid-2-wide { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-lg); }

/* ============================================================================
   MOBILE ANPASSUNGEN
   ============================================================================ */

@media (max-width: 768px) {
    .temp-row-top { grid-template-columns: 1fr 60px; }
    .thermo-vertical { height: 140px !important; width: 60px; }
    .thermo-scale-side { width: 20px; font-size: var(--fs-xs); }
    .thermo-tube-wrap { left: 25px; }
    .thermo-tube-mini { width: 14px; }
    .thermo-bulb-mini { width: 24px; height: 24px; bottom: -26px; }
    .temp-row-bottom { grid-template-columns: 1fr 1fr; gap: var(--space-sm); }
    .feel-section { padding-right: 0.25rem; }
    .windchill-section { padding-left: 0.25rem; }
    .temp-value-huge { font-size: var(--fs-hero); }
    .feel-value, .windchill-value { font-size: var(--fs-xl); }
    .color-bar-mini { height: 18px; }
    .stress-text { font-size: var(--fs-xs); }
}

/* ============================================================================
   MOBILE CHART-CARDS: Kompakter Header, mehr Platz für Chart
   ============================================================================ */
@media (max-width: 600px) {

    /* Card: kompakteres Padding */
    .db-card:has(.db-chart-wrap) {
        padding: 0.55rem 0.65rem 0.55rem;
    }

    /* Zeile 1: Label + Wert nebeneinander */
    .db-card:has(.db-chart-wrap) > .db-card-head {
        display: flex;
        flex-direction: row;
        align-items: baseline;
        gap: var(--space-sm);
        margin-bottom: 0.5rem;
    }

    /* Inneres div: Label + Wert in einer Zeile, vertikal zentriert */
    .db-card:has(.db-chart-wrap) > .db-card-head > div:first-child {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: var(--space-sm);
        flex-wrap: nowrap;
    }

    /* Doppelpunkt nach Label */
    .db-card:has(.db-chart-wrap) .db-card-label::after {
        content: ':';
    }

    .db-card:has(.db-chart-wrap) .db-card-label {
        font-size: var(--fs-base);
        margin-bottom: 0;
    }

    /* Untertitel + Icon auf Mobile ausblenden */
    .db-card:has(.db-chart-wrap) .db-card-sub,
    .db-card:has(.db-chart-wrap) .db-card-icon {
        display: none !important;
    }

    /* Aktueller Wert: gleiche Größe wie Label, direkt daneben */
    .db-card:has(.db-chart-wrap) .db-card-val {
        display: inline;
        font-size: var(--fs-base);
        font-weight: 700;
        line-height: 1;
        white-space: nowrap;
    }
    .db-card:has(.db-chart-wrap) .db-card-unit {
        font-size: var(--fs-base);
    }

    /* Extremes: horizontal, volle Breite, kompakt */
    .db-card:has(.db-chart-wrap) > .db-card-extremes {
        display: flex;
        flex-direction: row;
        gap: var(--space-sm);
        min-width: unset;
        align-self: stretch;
        margin-top: 0.2rem;
        margin-bottom: 0.3rem;
        grid-column: 1 / -1;
    }

    .db-card:has(.db-chart-wrap) .db-extreme {
        flex: 1;
        flex-direction: row;
        align-items: flex-end;
        justify-content: space-between;
        padding: 0.3rem 0.5rem;
        border-radius: var(--radius-md);
        gap: var(--space-sm);
        text-align: left;
    }

    .db-card:has(.db-chart-wrap) .db-extreme-label { font-size: var(--fs-xs); margin-bottom: 0; }
    .db-card:has(.db-chart-wrap) .db-extreme-val   { font-size: var(--fs-base); line-height: 1; font-weight: 700; }
    .db-card:has(.db-chart-wrap) .db-extreme-time  { font-size: var(--fs-xs); margin-top: 0.1rem; margin-left: 0; }

    /* Chart: mehr Höhe auf Mobile */
    .db-card:has(.db-chart-wrap) .db-chart-wrap {
        margin-top: 0;
        padding-top: 0.35rem;
    }

    .db-chart-wrap canvas {
        height: 200px !important;
        max-height: 200px;
    }

    /* Föhn-Chart etwas kürzer */
    #chart-foehn canvas {
        height: 200px !important;
        max-height: 200px;
    }

    /* Chart-Titel auf Mobile ausblenden — spart eine Zeile */
    .db-card:has(.db-chart-wrap) .db-chart-header {
        display: none;
    }

    /* Chart dadurch etwas höher */
    .db-card:has(.db-chart-wrap) .db-chart-wrap canvas {
        height: 220px !important;
        max-height: 220px;
    }
}

/* Niederschlag: alle 3 Extremes nebeneinander, 2-zeilig */
#card-rain .db-card-extremes {
    flex-direction: row;
    flex-wrap: nowrap;
    min-width: unset;
}
#card-rain .db-extreme {
    flex: 1;
    min-width: 0;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
}
#card-rain .db-extreme-label { font-size: var(--fs-xs); }
#card-rain .db-extreme-val   { font-size: var(--fs-xl); font-weight: 700; white-space: nowrap; line-height: 1.2; }

/* Luftdruck: Werte nie umbrechen */
#card-pressure .db-extreme-val {
    white-space: nowrap;
    font-size: var(--fs-lg);
}

/* Schneehöhe: Werte nie umbrechen */
#card-schnee .db-extreme-val {
    white-space: nowrap;
    font-size: var(--fs-lg);
}

/* Schneehöhe: Label nicht umbrechen */
#card-schnee .db-extreme-label {
    white-space: nowrap;
}

/* Solar: Werte nie umbrechen */
#card-solar .db-extreme-val {
    white-space: nowrap;
    font-size: var(--fs-lg);
}

/* ============================================================================
   SOLAR INFO POPUP
   ============================================================================ */
.solar-info-popup {
    display: none;
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-tooltip);
    border: 2px solid rgba(251, 191, 36, 0.4);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    max-width: 450px;
    width: 90%;
    z-index: 9999;
    box-shadow: 0 10px 40px var(--overlay-medium);
    color: var(--text-primary);
}
.solar-info-popup h3 { margin: 0 0 1rem 0; color: var(--yellow); font-size: var(--fs-lg); }
.solar-info-popup p { margin: 0.5rem 0; font-size: var(--fs-base); line-height: 1.5; color: var(--text-secondary); }
.solar-info-popup ul { margin: 0.75rem 0; padding-left: 1.25rem; }
.solar-info-popup li { margin: 0.4rem 0; font-size: var(--fs-base); color: var(--text-secondary); }
.solar-info-popup .close-btn {
    position: absolute;
    top: 0.75rem; right: 1rem;
    font-size: var(--fs-xl);
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
    background: none;
    border: none;
}
.solar-info-popup .close-btn:hover { color: var(--text-primary); }
.solar-info-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--overlay-heavy);
    z-index: 9998;
}

/* Solar Info-Icon: auf Mobile kein Kreis */
@media (max-width: 600px) {
    .solar-info-trigger {
        width: auto !important;
        height: auto !important;
        border-radius: 0 !important;
        background: transparent !important;
        border: none !important;
        font-size: var(--fs-md) !important;
        color: var(--db-label) !important;
    }
}

/* ============================================================================
   EINHEITLICHE INFO-POPUPS
   ============================================================================ */
@media (max-width: 600px) {
    .ipu-popup {
        max-height: 75vh;
        overflow-y: auto;
        top: 50%;
        transform: translate(-50%, -50%);
        width: 94%;
    }
    .ipu-body {
        overflow-y: visible;
    }
}

.ipu-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--overlay-heavy);
    z-index: 9998;
}
.ipu-popup {
    display: none;
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-tooltip);
    border-radius: var(--radius-lg);
    padding: 1.4rem 1.5rem 1.25rem;
    max-width: 460px;
    width: 92%;
    z-index: 9999;
    box-shadow: 0 12px 48px var(--overlay-heavy);
    color: var(--text-primary);
    border: 1.5px solid var(--glass-medium);
}

/* Farbige Umrandung je Popup */
#foehn-info-popup,    #modal-foehn-info-popup    { border-color: rgba(245,158,11,0.5); border-width: 2px; }
#aurora-info-popup,   #modal-aurora-info-popup   { border-color: rgba(192,132,252,0.5); border-width: 2px; }
#sun-warning-popup,   #modal-sun-warning-popup   { border-color: rgba(168,85,247,0.5); border-width: 2px; }
#solar-info-popup,    #modal-solar-info-popup    { border-color: var(--yellow-a35); border-width: 2px; }
#windchill-info-popup,#modal-windchill-info-popup{ border-color: rgba(96,165,250,0.5); border-width: 2px; }
#taupunkt-info-popup, #modal-taupunkt-info-popup { border-color: rgba(34,211,238,0.5); border-width: 2px; }
#wetbulb-info-popup,  #modal-wetbulb-info-popup  { border-color: var(--green-a35); border-width: 2px; }
.ipu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--glass-light);
}
.ipu-title {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--fs-md);
    font-weight: 700;
    line-height: 1.2;
}
.ipu-title-icon { font-size: var(--fs-xl); }
.ipu-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: var(--fs-xl);
    cursor: pointer;
    line-height: 1;
    padding: 0.1rem 0.3rem;
    border-radius: var(--radius-sm);
    transition: color 0.15s, background 0.15s;
    flex-shrink: 0;
}
.ipu-close:hover { color: var(--text-primary); background: var(--glass-medium); }
.ipu-body { font-size: var(--fs-base); line-height: 1.6; color: var(--text-secondary); }
.ipu-body p { margin: 0 0 0.6rem 0; color: var(--text-secondary); }
.ipu-body strong { color: var(--text-primary); }
.ipu-body ul { margin: 0.4rem 0 0.8rem 0; padding-left: 1.2rem; }
.ipu-body li { margin: 0.3rem 0; }
.ipu-body .ipu-formula {
    background: var(--glass-light);
    border-radius: var(--radius-md);
    padding: 0.45rem 0.7rem;
    font-family: monospace;
    font-size: var(--fs-sm);
    margin: 0.4rem 0 0.8rem;
    color: var(--text-primary);
}
.ipu-body .ipu-footer {
    font-size: var(--fs-xs);
    color: var(--text-muted);
    margin-top: 0.75rem;
    padding-top: 0.65rem;
    border-top: 1px solid var(--glass-light);
}
.ipu-body .ipu-footer a { color: var(--blue-light); text-decoration: none; }
.ipu-body table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); margin: 0.4rem 0; }
.ipu-body thead tr { color: var(--text-muted); font-size: var(--fs-xs); text-transform: uppercase; border-bottom: 1px solid var(--glass-light); }
.ipu-body th, .ipu-body td { text-align: left; padding: 0.28rem 0.4rem; }

/* Copyright-Text unterhalb der Charts */
.db-chart-wrap::after {
    content: 'Schladming-Rohrmoos 1248m | © schladming-wetter.at';
    display: block;
    text-align: right;
    font-size: var(--fs-xs);
    color: var(--db-chart-copyright);
    margin-top: 0.15rem;
    pointer-events: none;
}

/* Wind: Böen-Wert nie umbrechen */
#card-wind .db-extreme-val {
    white-space: nowrap;
    font-size: var(--fs-lg);
}

/* ============================================================================
   UV-RECHNER SELECTS + HILFSKLASSEN
   Ersetzt die Inline-Styles aus index.php
   ============================================================================ */

.uv-select {
    width: 100%;
    padding: 0.4rem;
    background: var(--bg-card-solid);
    border: 1px solid var(--purple-a30);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: var(--fs-sm);
    cursor: pointer;
    font-family: inherit;
}
.uv-select:focus {
    outline: none;
    border-color: var(--purple);
}

/* Trennstrich in Extreme-Boxen */
.db-label-sep {
    color: var(--db-label);
}
