/* Neerslagradar met tijdbalk (rain-nowcast.js): volledige speler in de weermodal en compacte speler in de weertegel. */

.rn { --rn-surface: #fff; --rn-line: #e2e8f0; --rn-text: #0f172a; --rn-muted: #64748b; --rn-accent: #0b2a55; --rn-blue: #2563eb; --rn-obs: #0b2a55; --rn-fc: #3b82f6;
      --rn-inset: 16px; position: relative; display: flex; flex-direction: column; gap: 12px; color: var(--rn-text); font-variant-numeric: tabular-nums; }
[data-theme="dark"] .rn { --rn-surface: #111827; --rn-line: #263041; --rn-text: #e5e7eb; --rn-muted: #94a3b8; --rn-accent: #93c5fd; --rn-blue: #60a5fa; --rn-obs: #93c5fd; --rn-fc: #3b82f6; }
.rn svg { width: 20px; height: 20px; fill: currentColor; display: block; }
.rn svg.rn-stroke { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* kaart */
.rn-stage { position: relative; border-radius: 16px; overflow: hidden; background: #dbe4ee; border: 1px solid var(--rn-line); isolation: isolate; }
.rn-full .rn-stage { height: clamp(200px, calc(100vh - 600px), 520px); }
.rn-map .leaflet-container { font: inherit; }
.rn .leaflet-tile-pane { filter: saturate(.2) contrast(1.05); }
[data-theme="dark"] .rn .leaflet-tile-pane { filter: saturate(.2) invert(1) hue-rotate(180deg) brightness(.92) contrast(.9); }
.rn .leaflet-bottom.leaflet-right .leaflet-control-zoom { margin-bottom: 22px; }
.rn-map { position: absolute; inset: 0; background: #dbe4ee; }
[data-theme="dark"] .rn-stage, [data-theme="dark"] .rn-map { background: #0b1220; }
.rn-map .leaflet-container { font: inherit; }
.rn .leaflet-image-layer.rn-img { transition: opacity .16s linear; image-rendering: auto; }
.rn-compact .rn-map .leaflet-control-container { display: none; }
.rn .leaflet-control-attribution { font-size: 10px; background: rgba(255, 255, 255, .7); }
[data-theme="dark"] .rn .leaflet-control-attribution { background: rgba(17, 24, 39, .7); color: #94a3b8; }
[data-theme="dark"] .rn .leaflet-control-attribution a { color: #93c5fd; }

.rn-hud { position: absolute; z-index: 500; display: flex; align-items: center; gap: 8px; pointer-events: none; }
.rn-tl { left: 10px; top: 10px; padding: 6px 12px 6px 8px; border-radius: 12px; background: rgba(255, 255, 255, .92); box-shadow: 0 2px 10px rgba(15, 23, 42, .18); color: #0f172a; }
[data-theme="dark"] .rn-tl { background: rgba(17, 24, 39, .9); color: #e5e7eb; }
.rn-tl b { font-size: 1.25rem; line-height: 1; letter-spacing: -.01em; }
.rn-tl small { font-size: .74rem; color: #64748b; }
.rn-kind { font-size: .66rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; background: #e2e8f0; color: #334155; }
.rn-kind.is-obs { background: #dbeafe; color: #1e3a8a; }
.rn-kind.is-fc { background: #fef3c7; color: #92400e; }
.rn-kind.is-now { background: #dcfce7; color: #166534; }
.rn-actions { right: 10px; top: 10px; flex-direction: column; align-items: flex-end; }
.rn-act { pointer-events: auto; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px 0 9px; border: 0; border-radius: 10px; cursor: pointer;
          background: rgba(255, 255, 255, .94); color: #0f172a; font: inherit; font-size: .78rem; font-weight: 600; box-shadow: 0 2px 10px rgba(15, 23, 42, .18); }
.rn-act[hidden] { display: none; }
.rn-act svg { width: 17px; height: 17px; }
.rn-act:hover { background: #fff; }
.rn-act.is-on { color: #1d4ed8; }
.rn-act.is-busy { opacity: .6; }
[data-theme="dark"] .rn-act { background: rgba(17, 24, 39, .92); color: #e5e7eb; }
.rn-legend { left: 10px; bottom: 10px; flex-direction: column; align-items: stretch; gap: 3px; width: 150px; padding: 6px 9px 5px; border-radius: 10px;
             background: rgba(255, 255, 255, .9); box-shadow: 0 2px 10px rgba(15, 23, 42, .16); color: #334155; }
[data-theme="dark"] .rn-legend { background: rgba(17, 24, 39, .9); color: #cbd5e1; }
.rn-legend small { font-size: .66rem; font-weight: 600; }
.rn-grad { height: 8px; border-radius: 4px; background: linear-gradient(90deg, #8ad, #26c, #4c4, #fc3, #e63, #a0a); }
.rn-leg-l { display: flex; justify-content: space-between; font-size: .62rem; color: #64748b; }

.rn-state { position: absolute; inset: 0; z-index: 600; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; padding: 16px;
            background: color-mix(in srgb, var(--rn-surface) 55%, transparent); color: var(--rn-text); font-size: .86rem; backdrop-filter: blur(2px); }
.rn-state[hidden] { display: none; }
.rn-state.is-error { background: color-mix(in srgb, var(--rn-surface) 88%, transparent); }
.rn-retry { border: 1px solid var(--rn-line); background: var(--rn-surface); color: var(--rn-text); border-radius: 9px; padding: 6px 12px; cursor: pointer; font: inherit; }
.rn-spin { width: 22px; height: 22px; border-radius: 50%; border: 3px solid color-mix(in srgb, var(--rn-blue) 25%, transparent); border-top-color: var(--rn-blue); animation: rn-rot .8s linear infinite; }
@keyframes rn-rot { to { transform: rotate(360deg); } }
.rn.is-buffering .rn-play { opacity: .75; }
.rn.is-buffering .rn-play::after { content: ""; position: absolute; inset: -3px; border-radius: 50%; border: 2px solid transparent; border-top-color: #fff; border-right-color: #fff; animation: rn-rot .8s linear infinite; }
.rn-toast { position: absolute; z-index: 700; left: 50%; bottom: 14px; transform: translateX(-50%); max-width: calc(100% - 24px); padding: 8px 14px; border-radius: 10px; font-size: .8rem;
            background: rgba(15, 23, 42, .92); color: #fff; box-shadow: 0 6px 20px rgba(15, 23, 42, .3); text-align: center; }
.rn-toast[hidden] { display: none; }

/* gekozen plek */
.rn-pin { pointer-events: none; }
.rn-pin i { position: absolute; left: -8px; top: -8px; width: 16px; height: 16px; border-radius: 50%; background: #0b2a55; border: 3px solid #fff; box-shadow: 0 0 0 2px rgba(11, 42, 85, .35), 0 2px 8px rgba(0, 0, 0, .35); }
.rn-pin.is-rain i { background: #2563eb; }
.rn-pin span { position: absolute; left: 0; bottom: 14px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; white-space: nowrap; gap: 2px; }
.rn-pin b { padding: 2px 8px; border-radius: 8px; background: rgba(255, 255, 255, .95); color: #0f172a; font-size: .72rem; font-weight: 700; box-shadow: 0 1px 6px rgba(0, 0, 0, .25); }
.rn-pin em { font-style: normal; padding: 1px 7px; border-radius: 8px; background: rgba(255, 255, 255, .95); color: #0f172a; font-size: .68rem; font-weight: 700; box-shadow: 0 1px 6px rgba(0, 0, 0, .25); }
.rn-pin em:empty { display: none; }
.rn-compact .rn-pin span { display: none; }
.rn-tip-leaflet { font: inherit; font-size: .74rem; font-weight: 600; }

/* tijdbalk */
.rn-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.rn-play { position: relative; flex: 0 0 auto; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer;
           background: var(--rn-accent); color: #fff; box-shadow: 0 3px 10px rgba(11, 42, 85, .3); transition: transform .12s; }
[data-theme="dark"] .rn-play { background: #2563eb; }
.rn-play:hover { transform: scale(1.06); }
.rn-play svg { width: 20px; height: 20px; }
.rn-play:focus-visible, .rn-track:focus-visible, .rn-mini:focus-visible, .rn-pill:focus-visible, .rn-act:focus-visible { outline: 3px solid color-mix(in srgb, var(--rn-blue) 55%, transparent); outline-offset: 2px; }
.rn-trackwrap { flex: 1 1 100%; order: -1; padding: 0 var(--rn-inset); min-width: 0; }
.rn-track { position: relative; height: 56px; cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; outline: none; border-radius: 8px; }
.rn-bar { position: absolute; left: 0; right: 0; top: 22px; height: 10px; border-radius: 6px; overflow: hidden; display: flex; background: var(--rn-line); }
.rn-z-obs { background: linear-gradient(90deg, color-mix(in srgb, var(--rn-obs) 55%, transparent), var(--rn-obs)); }
.rn-z-fc { flex: 1; background: repeating-linear-gradient(135deg, var(--rn-fc) 0 6px, color-mix(in srgb, var(--rn-fc) 55%, var(--rn-surface)) 6px 12px); }
.rn-ticks { position: absolute; left: 0; right: 0; top: 19px; height: 16px; pointer-events: none; }
.rn-ticks i { position: absolute; top: 5px; width: 1px; height: 6px; margin-left: -.5px; background: color-mix(in srgb, var(--rn-surface) 80%, transparent); opacity: .55; }
.rn-ticks i.is-on { opacity: 1; }
.rn-ticks i:not(.is-on) { background: color-mix(in srgb, var(--rn-muted) 50%, transparent); }
.rn-now { position: absolute; top: 6px; bottom: 14px; width: 2px; margin-left: -1px; background: #16a34a; border-radius: 2px; pointer-events: none; }
.rn-now span { position: absolute; left: 50%; bottom: 100%; transform: translateX(-50%); margin-bottom: 1px; padding: 1px 6px; border-radius: 6px; background: #16a34a; color: #fff; font-size: .62rem; font-weight: 800; letter-spacing: .05em; }
.rn-lbls { position: absolute; left: 0; right: 0; top: 38px; height: 16px; pointer-events: none; }
.rn-lbls span { position: absolute; transform: translateX(-50%); font-size: .7rem; color: var(--rn-muted); white-space: nowrap; }
.rn-thumb { position: absolute; top: 15px; width: 24px; height: 24px; margin-left: -12px; border-radius: 50%; background: #fff; border: 4px solid var(--rn-accent);
            box-shadow: 0 2px 8px rgba(15, 23, 42, .35); pointer-events: none; transition: left .12s linear, transform .12s; }
.rn[data-kind="fc"] .rn-thumb { border-color: var(--rn-fc); }
.rn[data-kind="now"] .rn-thumb { border-color: #16a34a; }
[data-theme="dark"] .rn-thumb { background: #e5e7eb; }
.rn-track.is-drag .rn-thumb { transform: scale(1.18); transition: none; }
.rn.is-playing .rn-thumb { transition: left .35s linear; }
.rn-clock { display: flex; flex-direction: column; line-height: 1.1; margin-right: auto; }
.rn-clock b { font-size: 1.1rem; }
.rn-clock small { font-size: .72rem; color: var(--rn-muted); }
.rn-ctl-more { display: flex; align-items: center; gap: 6px; }
.rn-mini { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--rn-line); background: var(--rn-surface); color: var(--rn-text); cursor: pointer; }
.rn-mini svg { width: 16px; height: 16px; }
.rn-pill { height: 34px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--rn-line); background: var(--rn-surface); color: var(--rn-text); font: inherit; font-size: .82rem; font-weight: 700; cursor: pointer; }
.rn-mini:hover, .rn-pill:hover { border-color: var(--rn-accent); }

/* samenvatting */
.rn-summary { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 14px; border: 1px solid var(--rn-line); background: color-mix(in srgb, var(--rn-line) 40%, transparent); }
.rn-sum-ic { font-size: 1.9rem; line-height: 1; }
.rn-sum-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rn-sum-t strong { font-size: 1.08rem; line-height: 1.2; }
.rn-sum-t small { font-size: .8rem; color: var(--rn-muted); }
.rn-where { display: inline-flex; align-items: center; gap: 5px; max-width: 40%; padding: 4px 10px; border-radius: 999px; background: var(--rn-surface); border: 1px solid var(--rn-line); font-size: .78rem; font-weight: 600; }
.rn-where svg { width: 15px; height: 15px; flex: 0 0 auto; color: var(--rn-blue); }
.rn-where span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rn-summary.tone-dry { background: color-mix(in srgb, #16a34a 11%, var(--rn-surface)); border-color: color-mix(in srgb, #16a34a 35%, var(--rn-line)); }
.rn-summary.tone-rain { background: color-mix(in srgb, #2563eb 11%, var(--rn-surface)); border-color: color-mix(in srgb, #2563eb 35%, var(--rn-line)); }
.rn-summary.tone-heavy { background: color-mix(in srgb, #ea580c 13%, var(--rn-surface)); border-color: color-mix(in srgb, #ea580c 40%, var(--rn-line)); }

/* grafiek: loopt gelijk met de tijdbalk eronder */
.rn-chart { display: flex; flex-direction: column; gap: 6px; margin-bottom: -4px; }
.rn-chart-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; }
.rn-chart-h strong { font-size: .9rem; }
.rn-chart-h small { font-size: .74rem; color: var(--rn-muted); }
.rn-plot { position: relative; height: 88px; margin: 0 var(--rn-inset); border-bottom: 1px solid var(--rn-line); cursor: ew-resize; touch-action: none; user-select: none; -webkit-user-select: none; }
.rn-grid i { position: absolute; left: -4px; right: -4px; height: 0; border-top: 1px dashed color-mix(in srgb, var(--rn-muted) 30%, transparent); pointer-events: none; }
.rn-grid i span { position: absolute; left: 4px; top: -14px; font-size: .64rem; color: var(--rn-muted); font-style: normal; }
.rn-bars { position: absolute; inset: 0; pointer-events: none; }
.rn-bars i { position: absolute; bottom: 0; transform: translateX(-50%); border-radius: 3px 3px 0 0; transition: opacity .15s; }
.rn-bars .rn-bar-v { min-width: 3px; opacity: .9; }
.rn-bars .rn-bar-dry { height: 2px; min-width: 3px; background: color-mix(in srgb, var(--rn-muted) 40%, transparent); }
.rn-bars .rn-bar-na { height: 2px; min-width: 3px; background: repeating-linear-gradient(90deg, color-mix(in srgb, var(--rn-muted) 35%, transparent) 0 2px, transparent 2px 4px); }
.rn-bars .is-sel { opacity: 1; outline: 2px solid color-mix(in srgb, var(--rn-text) 70%, transparent); outline-offset: 1px; }
.rn-cnow { position: absolute; top: 0; bottom: 0; width: 0; border-left: 2px dashed #16a34a; pointer-events: none; opacity: .8; }
.rn-cursor { position: absolute; top: -4px; bottom: -1px; width: 2px; margin-left: -1px; background: var(--rn-text); opacity: .75; pointer-events: none; transition: left .12s linear; }
.rn.is-playing .rn-cursor { transition: left .35s linear; }
.rn-tip { font-size: .82rem; margin: 0 var(--rn-inset); min-height: 1.2em; }
.rn-tip small { color: var(--rn-muted); margin-left: 4px; }

/* compact: weertegel op Home */
.rn-compact { height: 100%; gap: 0; }
.rn-compact .rn-stage { height: 100%; min-height: 210px; border-radius: 14px; cursor: pointer; }
.rn-compact .rn-tl { pointer-events: none; padding: 0; background: none; box-shadow: none; }
.rn-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 5px 11px 5px 8px; border-radius: 999px; background: rgba(255, 255, 255, .95); color: #0f172a;
           font-size: .78rem; font-weight: 700; box-shadow: 0 2px 10px rgba(15, 23, 42, .22); }
[data-theme="dark"] .rn-chip { background: rgba(17, 24, 39, .93); color: #e5e7eb; }
.rn-ic { font-size: 1rem; line-height: 1; }
.rn-cta { position: absolute; z-index: 500; right: 10px; top: 10px; padding: 4px 10px; border-radius: 999px; font-size: .72rem; font-weight: 600; color: #0b2a55; background: rgba(255, 255, 255, .92);
          opacity: 0; transform: translateY(-4px); transition: opacity .2s, transform .2s; pointer-events: none; }
.rn-compact .rn-stage:hover .rn-cta { opacity: 1; transform: none; }
.rn-compact .rn-controls { position: absolute; z-index: 550; left: 0; right: 0; bottom: 0; flex-wrap: nowrap; gap: 8px; padding: 6px 10px 4px 8px; cursor: default;
                           background: linear-gradient(0deg, rgba(255, 255, 255, .96), rgba(255, 255, 255, .86)); border-top: 1px solid rgba(15, 23, 42, .08); }
[data-theme="dark"] .rn-compact .rn-controls { background: linear-gradient(0deg, rgba(17, 24, 39, .97), rgba(17, 24, 39, .88)); }
.rn-compact .rn-play { width: 32px; height: 32px; }
.rn-compact .rn-play svg { width: 15px; height: 15px; }
.rn-compact .rn-trackwrap { flex: 1 1 auto; order: 0; padding: 0 8px; }
.rn-compact .rn-track { height: 44px; }
.rn-compact .rn-bar { top: 16px; height: 8px; }
.rn-compact .rn-ticks { top: 14px; }
.rn-compact .rn-ticks i { top: 4px; height: 5px; }
.rn-compact .rn-now { top: 4px; bottom: 14px; }
.rn-compact .rn-now span { font-size: .56rem; padding: 0 4px; }
.rn-compact .rn-lbls { top: 29px; }
.rn-compact .rn-lbls span { font-size: .64rem; }
.rn-compact .rn-thumb { top: 10px; width: 20px; height: 20px; margin-left: -10px; border-width: 3px; }
.rn-compact .rn-clock { margin: 0; min-width: 44px; text-align: right; }
.rn-compact .rn-clock b { font-size: .95rem; }
.rn-compact .rn-clock small { font-size: .64rem; }

@media (max-width: 640px) {
    .rn { --rn-inset: 12px; }
    .rn-full .rn-stage { height: clamp(200px, calc(100vh - 640px), 420px); }
    .rn-act span { display: none; }
    .rn-act { padding: 0 9px; }
    .rn-legend { width: 120px; }
    .rn-summary { flex-wrap: wrap; }
    .rn-where { max-width: 100%; }
    .rn-ctl-more .rn-mini { width: 38px; height: 38px; }
    .rn-pill { height: 38px; }
    .rn-plot { height: 76px; }
}
@media (prefers-reduced-motion: reduce) {
    .rn .leaflet-image-layer.rn-img, .rn-thumb, .rn-cursor, .rn-spin, .rn-cta, .rn-play, .rn-bars i { transition: none !important; animation-duration: 2s !important; }
}
