.mldw-weather-shell,
.mldw-weather-shell * {
    box-sizing: border-box;
}

.mldw-weather-shell {
    --mldw-theme-bg: #202126;
    --mldw-theme-bg-soft: #24272d;
    --mldw-theme-card: rgba(255, 255, 255, .055);
    --mldw-theme-card-strong: rgba(255, 255, 255, .085);
    --mldw-ink: #f8fafc;
    --mldw-muted: #aeb8c7;
    --mldw-line: rgba(255, 255, 255, .10);
    --mldw-card: rgba(255, 255, 255, .065);
    --mldw-card-solid: #262a31;
    --mldw-shadow: 0 18px 46px rgba(0, 0, 0, .24);
    width: min(1180px, 100%);
    margin: 24px auto;
    padding: 0;
    color: var(--mldw-ink);
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
    position: relative;
}

.mldw-weather-shell::before { display: none; }

.mldw-hero,
.mldw-stats,
.mldw-map-wrap,
.mldw-legend,
.mldw-error {
    position: relative;
    z-index: 2;
}

.mldw-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 18px;
    padding: clamp(16px, 3vw, 28px);
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, .075);
    background:
        radial-gradient(circle at 83% 18%, rgba(14, 165, 233, .30), transparent 32%),
        linear-gradient(135deg, #242831 0%, #1b3548 46%, #0f6e9e 100%);
    color: #fff;
    box-shadow: 0 14px 38px rgba(0, 0, 0, .26);
    overflow: hidden;
}

.mldw-hero::after {
    content: "☀️  ☁️  🌧️  ⛈️";
    position: absolute;
    right: -16px;
    top: 12px;
    font-size: clamp(32px, 8vw, 82px);
    letter-spacing: 10px;
    opacity: .13;
    transform: rotate(-8deg);
    white-space: nowrap;
}

.mldw-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    margin-bottom: 10px;
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 999px;
    background: rgba(255, 255, 255, .12);
    color: #bae6fd;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.mldw-kicker::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #22c55e;
    box-shadow: 0 0 0 6px rgba(34, 197, 94, .16);
}

.mldw-hero h2 {
    margin: 0;
    color: #fff;
    font-size: clamp(26px, 4vw, 46px);
    line-height: 1.04;
    letter-spacing: -.04em;
}

.mldw-hero p {
    margin: 10px 0 0;
    max-width: 760px;
    color: rgba(255, 255, 255, .82);
    font-size: clamp(15px, 1.55vw, 18px);
    line-height: 1.55;
}

.mldw-hero-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    min-width: 190px;
}

.mldw-btn {
    appearance: none;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    font: inherit;
    font-weight: 900;
    padding: 12px 18px;
    transition: transform .2s ease, box-shadow .2s ease, opacity .2s ease;
}

.mldw-btn:hover,
.mldw-map-toolbar button:hover {
    transform: translateY(-1px);
}

.mldw-btn-primary {
    color: #082f49;
    background: linear-gradient(135deg, #facc15, #fb923c);
    box-shadow: 0 12px 28px rgba(251, 146, 60, .28);
}

.mldw-updated {
    font-size: 12px;
    color: rgba(255, 255, 255, .75);
    text-align: right;
}

.mldw-stats {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    margin: 14px 0;
}

.mldw-stat {
    min-height: 92px;
    padding: 16px;
    border-radius: 22px;
    border: 1px solid var(--mldw-line);
    background:
        linear-gradient(135deg, rgba(255,255,255,.075), rgba(255,255,255,.035)),
        #24272d;
    box-shadow: 0 12px 26px rgba(0, 0, 0, .18);
    backdrop-filter: blur(14px);
    position: relative;
    overflow: hidden;
}

.mldw-stat::after {
    position: absolute;
    right: 12px;
    bottom: -10px;
    font-size: 54px;
    opacity: .16;
}

.mldw-stat-warm::after { content: "🌡️"; }
.mldw-stat-cold::after { content: "❄️"; }
.mldw-stat-rain::after { content: "🌧️"; }
.mldw-stat-wind::after { content: "💨"; }
.mldw-stat-uv::after { content: "☀️"; }

.mldw-stat span {
    display: block;
    color: var(--mldw-muted);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.mldw-stat strong {
    display: block;
    margin-top: 9px;
    font-size: clamp(17px, 1.8vw, 22px);
    line-height: 1.12;
    letter-spacing: -.03em;
    color: #f8fafc;
}

.mldw-map-wrap {
    min-height: var(--mldw-map-height);
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, .085);
    background: #15181e;
    box-shadow: 0 14px 36px rgba(0, 0, 0, .28);
    overflow: hidden;
    position: relative;
}

.mldw-map {
    width: 100%;
    height: var(--mldw-map-height);
    min-height: 420px;
    background: #11151b;
}

.mldw-map-toolbar {
    position: absolute;
    top: 14px;
    left: 14px;
    right: 14px;
    z-index: 600;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    pointer-events: none;
}

.mldw-map-toolbar button {
    pointer-events: auto;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 999px;
    background: rgba(255, 255, 255, .92);
    color: #0f172a;
    padding: 9px 12px;
    font-size: 12px;
    font-weight: 900;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .12);
    cursor: pointer;
}

.mldw-map-toolbar button.is-active {
    color: #fff;
    background: linear-gradient(135deg, #0f172a, #0284c7);
    border-color: transparent;
}

.mldw-map-toolbar .mldw-density-toggle {
    margin-left: auto;
    background: rgba(15, 23, 42, .92);
    color: #fff;
}

.mldw-threshold-bar {
    position: absolute;
    top: 64px;
    left: 14px;
    right: 14px;
    z-index: 599;
    display: none;
    pointer-events: none;
}

.mldw-threshold-bar.is-visible {
    display: flex;
}

.mldw-threshold-set {
    pointer-events: auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    max-width: calc(100% - 22px);
    padding: 7px 8px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .45);
    background: rgba(15, 23, 42, .78);
    box-shadow: 0 10px 24px rgba(15, 23, 42, .22);
    backdrop-filter: blur(10px);
}

.mldw-threshold-set[hidden] { display: none !important; }

.mldw-threshold-set span {
    color: rgba(255, 255, 255, .82);
    font-size: 11px;
    font-weight: 950;
    letter-spacing: .05em;
    text-transform: uppercase;
    padding: 0 4px;
}

.mldw-threshold-set button {
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, .94);
    color: #0f172a;
    padding: 6px 9px;
    font-size: 11px;
    font-weight: 900;
    cursor: pointer;
}

.mldw-threshold-set button.is-active {
    background: linear-gradient(135deg, #facc15, #fb923c);
    color: #082f49;
}

.mldw-map-note {
    position: absolute;
    left: 14px;
    bottom: 14px;
    z-index: 590;
    max-width: min(560px, calc(100% - 28px));
    padding: 8px 12px;
    border-radius: 999px;
    color: #f8fafc;
    background: rgba(32, 33, 38, .88);
    border: 1px solid rgba(255,255,255,.10);
    box-shadow: 0 10px 22px rgba(0, 0, 0, .22);
    font-size: 12px;
    font-weight: 800;
    backdrop-filter: blur(10px);
}

.mldw-weather-marker {
    width: max-content !important;
    height: max-content !important;
}

.mldw-marker {
    --marker-bg: linear-gradient(135deg, #fff, #f8fafc);
    --marker-ring: rgba(255,255,255,.94);
    position: relative;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    border: 2px solid var(--marker-ring);
    background: var(--marker-bg);
    color: #0f172a;
    box-shadow: 0 10px 22px rgba(15, 23, 42, .24);
    transform-origin: center;
    transition: transform .18s ease, opacity .18s ease, filter .18s ease, width .18s ease, height .18s ease;
    will-change: transform, opacity;
}

.mldw-marker:hover {
    transform: scale(1.08);
    z-index: 999 !important;
}

.mldw-marker.is-hidden-by-density {
    opacity: 0;
    pointer-events: none;
    transform: scale(.72);
}

.mldw-marker.is-mini {
    grid-template-columns: 1fr;
}

.mldw-marker.is-label {
    display: grid;
    grid-template-columns: 30px auto;
    grid-template-rows: auto auto;
    column-gap: 7px;
    align-items: center;
    justify-items: start;
    width: auto;
    min-width: 92px;
    height: 42px;
    padding: 5px 10px 5px 6px;
}

.mldw-marker.is-selected-weather {
    box-shadow: 0 0 0 5px rgba(14, 165, 233, .12), 0 12px 24px rgba(15, 23, 42, .28);
}

.mldw-marker-icon {
    display: grid;
    place-items: center;
    width: 29px;
    height: 29px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .76);
    font-size: 17px;
    box-shadow: inset 0 -2px 5px rgba(15, 23, 42, .08);
}

.mldw-marker.is-mini .mldw-marker-icon {
    width: 30px;
    height: 30px;
    font-size: 17px;
}

.mldw-marker-temp {
    position: absolute;
    left: 50%;
    bottom: -8px;
    transform: translateX(-50%);
    min-width: 34px;
    padding: 2px 6px;
    border-radius: 999px;
    text-align: center;
    background: rgba(255,255,255,.92);
    color: #0f172a;
    font-size: 11px;
    font-weight: 950;
    line-height: 1.1;
    box-shadow: 0 5px 12px rgba(15, 23, 42, .18);
    white-space: nowrap;
}

.mldw-marker.is-label .mldw-marker-temp {
    position: static;
    grid-column: 2;
    grid-row: 1;
    transform: none;
    padding: 0;
    min-width: 0;
    background: transparent;
    box-shadow: none;
    font-size: 15px;
    line-height: 1;
}

.mldw-marker-city {
    display: none;
    grid-column: 2;
    grid-row: 2;
    max-width: 104px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: rgba(15, 23, 42, .72);
    font-size: 10px;
    font-weight: 850;
}

.mldw-marker.is-label .mldw-marker-city {
    display: block;
}

.mldw-temp-cold { --marker-bg: linear-gradient(135deg, #dbeafe, #60a5fa); }
.mldw-temp-mild { --marker-bg: linear-gradient(135deg, #dcfce7, #22c55e); }
.mldw-temp-warm { --marker-bg: linear-gradient(135deg, #fef3c7, #f59e0b); }
.mldw-temp-hot { --marker-bg: linear-gradient(135deg, #fed7aa, #ef4444); color: #fff; }
.mldw-temp-hot .mldw-marker-city { color: rgba(255,255,255,.88); }
.mldw-temp-hot.mldw-marker.is-label .mldw-marker-temp { color: #fff; }

.mldw-group-storm .mldw-marker,
.mldw-marker.mldw-group-storm {
    animation: mldwPulse 1.8s ease-in-out infinite;
    box-shadow: 0 0 0 6px rgba(239, 68, 68, .16), 0 14px 26px rgba(127, 29, 29, .32);
}

@keyframes mldwPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.06); }
}

.mldw-popup { min-width: 220px; }

.mldw-popup-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.mldw-popup-title b { display: block; font-size: 16px; }

.mldw-popup-title span {
    display: grid;
    place-items: center;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    border-radius: 14px;
    background: #11151b;
    font-size: 24px;
}

.mldw-popup-meta { color: #64748b; font-size: 12px; }

.mldw-popup-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 12px;
}

.mldw-popup-grid div {
    padding: 8px;
    border-radius: 12px;
    background: #f8fafc;
}

.mldw-popup-grid small {
    display: block;
    color: #64748b;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.mldw-popup-grid strong { display: block; margin-top: 2px; font-size: 14px; }

.mldw-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
    padding: 0 4px;
    color: var(--mldw-muted);
    font-size: 13px;
    font-weight: 800;
}

.mldw-legend span { display: inline-flex; align-items: center; gap: 7px; }

.mldw-dot {
    display: inline-block;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, .16);
}

.mldw-dot-cold { background: #60a5fa; }
.mldw-dot-mild { background: #22c55e; }
.mldw-dot-warm { background: #f59e0b; }
.mldw-dot-hot { background: #ef4444; }
.mldw-source { margin-left: auto; color: #aeb8c7; }

.mldw-loading {
    position: absolute;
    inset: 0;
    z-index: 700;
    display: grid;
    place-content: center;
    gap: 10px;
    text-align: center;
    padding: 28px;
    background: linear-gradient(135deg, rgba(32, 33, 38, .94), rgba(22, 27, 34, .92));
}

.mldw-loading.is-hidden { display: none; }
.mldw-loading strong { font-size: 19px; }
.mldw-loading span { color: #aeb8c7; }

.mldw-spinner {
    width: 54px;
    height: 54px;
    margin: 0 auto;
    border-radius: 50%;
    border: 5px solid rgba(2, 132, 199, .14);
    border-top-color: #0284c7;
    animation: mldwSpin .85s linear infinite;
}

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

.mldw-error {
    margin-top: 14px;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid rgba(220, 38, 38, .26);
    background: rgba(127, 29, 29, .22);
    color: #fecaca;
    font-weight: 800;
}

.mldw-weather-shell .leaflet-container { font-family: inherit; }

.mldw-weather-shell .leaflet-control-attribution {
    border-radius: 12px 0 0 0;
    font-size: 10px;
}

.mldw-weather-shell .leaflet-control-zoom {
    border: 0;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .28);
}

.mldw-weather-shell .leaflet-control-zoom a {
    width: 34px;
    height: 34px;
    line-height: 34px;
    border: 0;
    color: #0f172a;
    background: rgba(255,255,255,.94);
}

@media (max-width: 860px) {
    .mldw-hero { grid-template-columns: 1fr; align-items: start; }
    .mldw-hero-actions { align-items: flex-start; min-width: 0; }
    .mldw-updated { text-align: left; }
    .mldw-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .mldw-source { width: 100%; margin-left: 0; }
}

@media (max-width: 560px) {
    .mldw-weather-shell {
        margin: 18px auto;
        border-radius: 0;
        padding: 0;
    }

    .mldw-hero { border-radius: 18px; }
    .mldw-stats { grid-template-columns: 1fr; }

    .mldw-map-wrap {
        border-radius: 20px;
        min-height: 520px;
    }

    .mldw-map { height: 520px; }

    .mldw-map-toolbar {
        top: 10px;
        left: 10px;
        right: 10px;
        gap: 6px;
    }

    .mldw-threshold-bar {
        top: 112px;
        left: 10px;
        right: 10px;
    }

    .mldw-threshold-set {
        border-radius: 18px;
        gap: 5px;
    }

    .mldw-threshold-set button {
        padding: 6px 8px;
        font-size: 10px;
    }

    .mldw-map-toolbar button {
        padding: 8px 9px;
        font-size: 11px;
    }

    .mldw-map-toolbar .mldw-density-toggle {
        margin-left: 0;
    }

    .mldw-marker {
        width: 40px;
        height: 40px;
    }

    .mldw-marker.is-label {
        min-width: 82px;
        height: 39px;
        grid-template-columns: 28px auto;
        padding-right: 8px;
    }

    .mldw-marker-icon {
        width: 27px;
        height: 27px;
        font-size: 16px;
    }

    .mldw-marker.is-label .mldw-marker-temp { font-size: 13px; }
    .mldw-marker-city { max-width: 70px; font-size: 9px; }
    .mldw-map-note { left: 10px; bottom: 10px; border-radius: 16px; font-size: 11px; }
}

.mldw-marker.is-layer-rain {
    --marker-bg: linear-gradient(135deg, #dbeafe, #0284c7);
    --marker-ring: rgba(186, 230, 253, .96);
    color: #082f49;
}

.mldw-marker.is-layer-storm {
    --marker-bg: linear-gradient(135deg, #fde68a, #ef4444 58%, #7f1d1d);
    --marker-ring: rgba(254, 202, 202, .98);
    color: #fff;
    animation: mldwPulse 1.5s ease-in-out infinite;
}

.mldw-marker.is-layer-snow {
    --marker-bg: linear-gradient(135deg, #ecfeff, #60a5fa);
    --marker-ring: rgba(219, 234, 254, .98);
    color: #082f49;
}

.mldw-marker.is-layer-wind {
    --marker-bg: linear-gradient(135deg, #f8fafc, #64748b);
    --marker-ring: rgba(226, 232, 240, .98);
    color: #0f172a;
}

.mldw-marker.is-layer-uv {
    --marker-bg: linear-gradient(135deg, #fef9c3, #f97316);
    --marker-ring: rgba(254, 240, 138, .98);
    color: #431407;
}

.mldw-marker.is-layer-rain .mldw-marker-city,
.mldw-marker.is-layer-wind .mldw-marker-city,
.mldw-marker.is-layer-snow .mldw-marker-city,
.mldw-marker.is-layer-uv .mldw-marker-city {
    color: rgba(15, 23, 42, .76);
}

.mldw-marker.is-layer-storm .mldw-marker-city,
.mldw-marker.is-layer-storm.mldw-marker.is-label .mldw-marker-temp {
    color: rgba(255,255,255,.95);
}

.mldw-marker.is-layer-rain.mldw-marker.is-label .mldw-marker-temp,
.mldw-marker.is-layer-snow.mldw-marker.is-label .mldw-marker-temp,
.mldw-marker.is-layer-wind.mldw-marker.is-label .mldw-marker-temp,
.mldw-marker.is-layer-uv.mldw-marker.is-label .mldw-marker-temp {
    font-size: 13px;
}

.mldw-map-note.is-empty {
    color: #78350f;
    background: rgba(254, 243, 199, .94);
    border-color: rgba(245, 158, 11, .35);
}

@media (max-width: 560px) {
    .mldw-marker.is-layer-rain.mldw-marker.is-label .mldw-marker-temp,
    .mldw-marker.is-layer-snow.mldw-marker.is-label .mldw-marker-temp,
    .mldw-marker.is-layer-wind.mldw-marker.is-label .mldw-marker-temp,
    .mldw-marker.is-layer-uv.mldw-marker.is-label .mldw-marker-temp {
        font-size: 11px;
    }
}


/* Jannah-Dark-Theme-Anpassung: kein heller Rahmen, kein iframe-artiger Container */
.mldw-weather-shell .mldw-stat span,
.mldw-weather-shell .mldw-legend,
.mldw-weather-shell .mldw-popup-meta {
    color: var(--mldw-muted);
}

.mldw-weather-shell .mldw-stat strong,
.mldw-weather-shell .mldw-loading strong {
    color: #f8fafc;
}

.mldw-weather-shell .mldw-legend {
    padding: 0;
}

.mldw-weather-shell .leaflet-control-attribution {
    background: rgba(32, 33, 38, .82);
    color: rgba(248, 250, 252, .72);
}

.mldw-weather-shell .leaflet-control-attribution a {
    color: rgba(186, 230, 253, .92);
}
