/* Weather page (index.html), from the My Weather Hub website package. Self-contained: the page needs
   no other stylesheet besides Leaflet's. Lightning Tracker's night-sky palette with a sky-blue accent. */

:root {
    --ws-night: #030b1c;
    --ws-navy: #0e2a4f;
    --ws-teal: #3cf2c8;
    --ws-sun: #ffc21a;
    --ws-sky: #5ac8fa;
    --ws-blue: #4f9dff;
    --ws-purple: #b18cff;
    --ws-orange: #ff9f43;
    --ws-red: #ff6b6b;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.72);
    --text-tertiary: rgba(255, 255, 255, 0.5);
    --bg-primary: #02060f;
    --bg-card: rgba(255, 255, 255, 0.045);
    --bg-card-strong: rgba(255, 255, 255, 0.07);
    --border-color: rgba(255, 255, 255, 0.1);
    color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    background: radial-gradient(ellipse 120% 60% at 50% -10%, rgba(90, 200, 250, 0.14), transparent 60%), var(--bg-primary);
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--ws-sky); }

.ws-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* Header */

.ws-hero {
    padding: 18px 0 16px;
    background:
        radial-gradient(ellipse 60% 160% at 50% 0%, rgba(90, 200, 250, 0.12), transparent 70%),
        linear-gradient(180deg, var(--ws-navy), var(--ws-night));
    border-bottom: 1px solid var(--border-color);
}

.ws-embed .ws-hero { display: none; }

.ws-hero-inner, .ws-shell {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 24px;
}

.ws-hero-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 24px;
}

.ws-hero-title { display: flex; align-items: center; gap: 14px; min-width: 0; }

.ws-hero h1 {
    margin: 0;
    font-size: clamp(1.5rem, 2.6vw, 2.1rem);
    font-weight: 700;
    line-height: 1.15;
}

.ws-gradient-text {
    background: linear-gradient(90deg, var(--ws-sun), var(--ws-sky), var(--ws-teal));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.ws-subtitle { margin: 2px 0 0; color: var(--text-secondary); font-size: 0.92rem; }

.ws-brand-mark { flex-shrink: 0; width: 44px; height: auto; filter: drop-shadow(0 4px 12px rgba(90, 200, 250, 0.3)); }

.ws-hero-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }

.ws-select { display: inline-flex; align-items: center; gap: 8px; color: var(--text-secondary); font-size: 0.9rem; }

.ws-select select, .ws-button {
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #0b1426;
    color: var(--text-primary);
    font: inherit;
}

.ws-button { cursor: pointer; }
.ws-button:hover, .ws-button:focus-visible, .ws-select select:focus-visible { border-color: var(--ws-sky); outline: none; }
.ws-button[aria-pressed="true"] { background: rgba(90, 200, 250, 0.15); border-color: var(--ws-sky); }

.ws-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 6px 14px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.ws-status-dot { width: 10px; height: 10px; border-radius: 50%; background: #6b7280; }
.ws-status-dot.ws-online { background: #22c55e; box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.2); }
.ws-status-dot.ws-stale { background: #f59e0b; }
.ws-status-dot.ws-offline { background: #ef4444; }

.ws-noscript { max-width: 1440px; margin: 16px auto; padding: 0 24px; color: var(--text-secondary); }

/* Cards */

.ws-shell { padding-top: 20px; padding-bottom: 64px; }

.ws-now {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
    gap: 16px;
}

.ws-card {
    margin: 0;
    padding: 16px 18px;
    border: 1px solid var(--border-color);
    border-radius: 18px;
    background: var(--bg-card);
    backdrop-filter: blur(8px);
    min-width: 0;
}

.ws-card h2, .ws-chart figcaption {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
    color: var(--ws-sky);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.ws-icon { font-size: 1rem; filter: saturate(0.9); }

.ws-card-hero {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 16px 32px;
    padding: 24px 28px;
    background:
        radial-gradient(ellipse 70% 120% at 0% 0%, rgba(255, 194, 26, 0.16), transparent 60%),
        linear-gradient(160deg, var(--ws-navy), var(--ws-night));
}

.ws-hero-reading { display: flex; align-items: center; gap: 22px; min-width: 0; }

.ws-condition { width: 96px; height: 96px; flex-shrink: 0; }
.ws-condition svg { width: 100%; height: 100%; }

.ws-temperature {
    font-size: clamp(3.5rem, 8vw, 5.5rem);
    font-weight: 200;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

.ws-condition-text { margin-top: 6px; font-size: 1.25rem; font-weight: 600; }
.ws-feels { color: var(--text-secondary); }

.ws-hilo { display: flex; flex-direction: column; gap: 6px; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.ws-hilo small { color: var(--text-tertiary); font-size: 0.78rem; }
.ws-arrow-up { color: var(--ws-red); }
.ws-arrow-down { color: var(--ws-blue); }

.ws-forecast { grid-column: 1 / -1; margin: 0; color: var(--text-secondary); }

.ws-split { display: flex; align-items: center; gap: 18px; }
.ws-values { flex: 1; min-width: 0; }
.ws-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.ws-big {
    font-size: 2rem;
    font-weight: 600;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.ws-caption { color: var(--text-tertiary); font-size: 0.8rem; margin-bottom: 8px; }
.ws-blue { color: var(--ws-blue); }
.ws-teal { color: var(--ws-teal); }
.ws-purple { color: var(--ws-purple); }
.ws-orange { color: var(--ws-orange); }

.ws-details {
    display: grid;
    grid-template-columns: auto auto;
    justify-content: space-between;
    gap: 4px 16px;
    margin: 0;
    font-size: 0.9rem;
}

.ws-details dt { color: var(--text-secondary); }
.ws-details dd { margin: 0; text-align: right; font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ws-details dd small { display: block; color: var(--text-tertiary); font-size: 0.72rem; font-weight: 400; }

.ws-compass, .ws-dial { width: 124px; flex-shrink: 0; }
.ws-ring { width: 108px; flex-shrink: 0; }

.ws-gauge-rain {
    position: relative;
    flex-shrink: 0;
    width: 34px;
    height: 130px;
    border: 2px solid rgba(79, 157, 255, 0.5);
    border-top: none;
    border-radius: 4px 4px 14px 14px;
    overflow: hidden;
    background: rgba(79, 157, 255, 0.06);
}

.ws-gauge-rain-fill {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 0;
    background: linear-gradient(0deg, #2563eb, var(--ws-blue));
    transition: height 0.8s ease;
}

.ws-uv-scale {
    position: relative;
    height: 10px;
    margin: 10px 0 14px;
    border-radius: 5px;
    background: linear-gradient(90deg, #22c55e 0%, #eab308 25%, #f97316 50%, #ef4444 70%, #a855f7 100%);
}

.ws-uv-marker {
    position: absolute;
    top: -4px;
    width: 4px;
    height: 18px;
    margin-left: -2px;
    border-radius: 2px;
    background: #ffffff;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.5);
    transition: left 0.8s ease;
}

/* Sections */

.ws-section { margin-top: 28px; }

.ws-section > h2, .ws-section-header h2 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
}

.ws-section-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 16px;
    margin-bottom: 12px;
}

.ws-section > h2 { margin-bottom: 12px; }

.ws-charts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
    gap: 16px;
}

.ws-chart svg { display: block; width: 100%; height: 200px; overflow: visible; }
.ws-chart text, .ws-days-chart text { fill: var(--text-tertiary); font-size: 11px; }
.ws-grid-line { stroke: rgba(255, 255, 255, 0.08); }
.ws-hover-line { stroke: rgba(255, 255, 255, 0.35); stroke-dasharray: 3 3; }

.ws-tooltip {
    position: fixed;
    z-index: 1000;
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: rgba(3, 11, 28, 0.95);
    color: var(--text-primary);
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
    pointer-events: none;
    white-space: nowrap;
}

.ws-tooltip[hidden] { display: none; }

.ws-map-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; color: var(--text-secondary); font-size: 0.9rem; }
.ws-toggle { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.ws-toggle input { accent-color: var(--ws-sky); width: 16px; height: 16px; margin: 0; }
.ws-radar-time { font-variant-numeric: tabular-nums; color: var(--text-tertiary); }

.ws-map-frame {
    position: relative;
    height: min(64vh, 620px);
    min-height: 340px;
    border: 1px solid var(--border-color);
    border-radius: 18px;
    overflow: hidden;
}

#ws-map { width: 100%; height: 100%; background: #0b1220; }

.ws-map-message {
    position: absolute;
    inset: 0;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.55);
    color: var(--text-secondary);
}

.ws-map-message[hidden] { display: none; }

.ws-pin {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--ws-navy);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.85rem;
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
    transform: translate(-50%, -100%);
}

.ws-pin-primary { background: var(--ws-sun); color: #111111; }
.ws-pin-arrow { display: inline-block; font-size: 0.8rem; }
.leaflet-div-icon.ws-pin-icon { background: none; border: none; }

.ws-note { margin: 8px 0 0; color: var(--text-tertiary); font-size: 0.8rem; }

.ws-about { margin-top: 12px; line-height: 1.55; }
.ws-about p { margin: 0 0 0.8em; max-width: 72ch; }
.ws-about p:last-child { margin-bottom: 0; }

/* Sensors */

.ws-sensors { margin-top: 12px; }
.ws-aqi-chip {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    color: #111111;
    font-size: 0.8rem;
    font-weight: 700;
}
.ws-aqi-scale { background: linear-gradient(90deg, #00e400 0%, #ffff00 17%, #ff7e00 33%, #ff0000 50%, #8f3f97 67%, #7e0023 100%); }
.ws-kp-scale { background: linear-gradient(90deg, #22c55e 0%, #eab308 45%, #f97316 60%, #ef4444 75%, #a855f7 100%); }
.ws-quakes { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.ws-quakes li { display: flex; gap: 10px; align-items: baseline; font-size: 0.9rem; }
.ws-quake-mag { min-width: 44px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ws-quakes small { display: block; color: var(--text-tertiary); font-size: 0.75rem; }
.ws-alarm { margin: 0 0 8px; color: var(--ws-orange); font-weight: 600; }
.ws-source { margin: 8px 0 0; color: var(--text-tertiary); font-size: 0.75rem; }
.ws-note a { color: var(--text-secondary); }

/* Earthquakes */

.ws-quakes-subtitle { margin-top: 2px; }
.ws-quake-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; color: var(--text-tertiary); font-size: 0.8rem; }
.ws-quake-legend[hidden] { display: none; }
.ws-quake-legend i { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.7); vertical-align: -1px; }
.ws-quake-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px 20px;
    margin: 0 0 16px;
}
.ws-quake-summary dt { color: var(--text-tertiary); font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.ws-quake-summary dd { margin: 2px 0 0; font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.ws-quake-summary .ws-quake-summary-detail { font-size: 0.78rem; font-weight: 400; color: var(--text-tertiary); }
.ws-quake-list { max-height: 460px; overflow-y: auto; }
.ws-quake-table td.ws-quake-where { text-align: left; white-space: normal; min-width: 220px; }
.ws-quake-table th:nth-child(3) { text-align: left; }
.ws-quake-table tbody tr { cursor: pointer; }
.ws-quake-table tbody tr:hover, .ws-quake-table tbody tr:focus-visible { background: rgba(90, 200, 250, 0.08); outline: none; }
.ws-quake-where a { color: var(--text-primary); text-decoration: none; font-weight: 600; }
.ws-quake-where a:hover { text-decoration: underline; }
.ws-quake-chip {
    display: inline-block;
    min-width: 38px;
    padding: 1px 8px;
    border: 2px solid;
    border-radius: 999px;
    text-align: center;
    font-weight: 700;
}
.ws-quake-more { margin-top: 10px; }
:root[data-theme="light"] .ws-quake-where a { color: #0b1220; }
:root[data-theme="light"] .ws-quake-legend i { border-color: rgba(11, 18, 32, 0.4); }

.ws-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    gap: 16px;
    margin-top: 28px;
}

.ws-table-wrap { overflow-x: auto; }
.ws-days-table { max-height: 340px; overflow-y: auto; margin-top: 10px; }

.ws-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; font-variant-numeric: tabular-nums; }
.ws-table th, .ws-table td { padding: 6px 8px; border-bottom: 1px solid rgba(255, 255, 255, 0.06); text-align: right; white-space: nowrap; }
.ws-table th:first-child, .ws-table td:first-child { text-align: left; color: var(--text-secondary); }
.ws-table thead th { position: sticky; top: 0; background: #070f1f; color: var(--text-tertiary); font-weight: 600; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; }
.ws-table td small { display: block; color: var(--text-tertiary); font-size: 0.7rem; }
.ws-hot { color: var(--ws-red); }
.ws-cold { color: var(--ws-blue); }

.ws-days-chart { display: block; width: 100%; height: 150px; }

.ws-stations { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.ws-station h3 { margin: 0 0 8px; font-size: 1rem; }
.ws-station .ws-big { font-size: 1.6rem; }

/* Footer */

.ws-footer { margin-top: 36px; display: flex; flex-direction: column; gap: 6px; }
.ws-meta { margin: 0; color: var(--text-tertiary); font-size: 0.82rem; }
.ws-visitors { margin: 0; color: var(--text-secondary); font-size: 0.82rem; font-variant-numeric: tabular-nums; }
.ws-powered-by { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--text-secondary); font-size: 0.85rem; }
.ws-powered-by img { border-radius: 5px; }
.ws-powered-by a { color: inherit; text-decoration: none; }
.ws-powered-by strong { color: var(--ws-sky); }
.ws-powered-by a:hover strong { text-decoration: underline; }

@media (max-width: 900px) {
    .ws-card-hero { grid-template-columns: 1fr; padding: 20px; }
    .ws-charts, .ws-columns { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
    .ws-hero-inner, .ws-shell { padding-left: 14px; padding-right: 14px; }
    .ws-now { grid-template-columns: 1fr; }
    .ws-condition { width: 72px; height: 72px; }
    .ws-split { align-items: flex-start; }
    .ws-compass, .ws-dial { width: 110px; }
    .ws-ring { width: 96px; }
}

@media (prefers-reduced-motion: reduce) {
    .ws-gauge-rain-fill, .ws-uv-marker { transition: none; }
}

/* Banners: warnings, earthquakes and lightning, only while something is active */

.ws-banners { display: grid; gap: 10px; margin-bottom: 16px; }
.ws-banners:empty { display: none; }
.ws-banner {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 12px 16px;
    border: 1px solid var(--banner, var(--ws-orange));
    border-radius: 14px;
    background: color-mix(in srgb, var(--banner, var(--ws-orange)) 14%, transparent);
}
.ws-banner strong { display: block; }
.ws-banner p { margin: 2px 0 0; color: var(--text-secondary); font-size: 0.9rem; }
.ws-banner a { margin-left: auto; white-space: nowrap; }
.ws-banner-icon { font-size: 1.3rem; line-height: 1.2; }
.ws-banner-extreme { --banner: #a855f7; }
.ws-banner-severe { --banner: #ef4444; }
.ws-banner-moderate { --banner: #f97316; }
.ws-banner-minor { --banner: #eab308; }
.ws-banner-quake { --banner: #b08968; }
.ws-banner-lightning { --banner: #facc15; }
.ws-banner-maintenance { --banner: #fb923c; }
.ws-banner-record { --banner: #818cf8; }
.ws-banner-others { --banner: var(--border-color); }
.ws-banner-others summary { cursor: pointer; font-weight: 600; }
.ws-banner-others ul { margin: 8px 0 0; padding-left: 18px; color: var(--text-secondary); font-size: 0.9rem; }

/* Sun and Moon */

.ws-card-wide { grid-column: span 2; }
.ws-sunmoon { display: grid; grid-template-columns: minmax(0, 1fr) 170px; gap: 16px; align-items: center; }
.ws-sky-path { width: 100%; height: 170px; display: block; }
.ws-sky-compass { width: 170px; height: 170px; display: block; }
.ws-sky-path text, .ws-sky-compass text { fill: var(--text-tertiary); font-size: 10px; }
.ws-sunmoon-details { margin-top: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); display: grid; gap: 8px 16px; }
.ws-sunmoon-details div { display: flex; flex-direction: column; }
.ws-sunmoon-details dt { color: var(--text-tertiary); font-size: 0.75rem; }
.ws-sunmoon-details dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Webcams */

.ws-webcams { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 16px; margin-top: 12px; }
.ws-webcam h3 { margin: 0 0 10px; font-size: 1rem; display: flex; align-items: center; gap: 8px; }
.ws-webcam-live { font-size: 0.7rem; font-weight: 700; color: #fff; background: #e5484d; border-radius: 4px; padding: 1px 6px; text-transform: uppercase; letter-spacing: 0.04em; }
.ws-webcam-picture { margin: 0; }
.ws-webcam-picture img { display: block; width: 100%; height: auto; border-radius: 10px; background: var(--bg-card-strong); }
.ws-webcam-picture figcaption { margin: 6px 0 0; font-variant-numeric: tabular-nums; }
.ws-webcam-frame { position: relative; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: #000; }
.ws-webcam-frame iframe, .ws-webcam-frame video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.ws-webcam-controls { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.ws-webcam-controls[hidden] { display: none; }
.ws-webcam-controls input[type="range"] { flex: 1; accent-color: var(--ws-sky); }

/* Arranging the page */

.ws-layout-bar { display: none; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; padding: 10px 14px; border: 1px dashed var(--ws-sky); border-radius: 12px; color: var(--text-secondary); font-size: 0.9rem; }
.ws-editing .ws-layout-bar { display: flex; }
.ws-user-hidden { display: none !important; }
.ws-editing .ws-user-hidden { display: block !important; opacity: 0.35; }
.ws-editing .ws-now > .ws-user-hidden { display: block !important; }
.ws-editing [data-key] { position: relative; outline: 1px dashed color-mix(in srgb, var(--ws-sky) 60%, transparent); outline-offset: 2px; cursor: grab; }
.ws-editing [data-key].ws-dragging { opacity: 0.5; }
.ws-arrange { display: none; position: absolute; top: 8px; right: 8px; z-index: 5; gap: 4px; }
.ws-editing .ws-arrange { display: flex; }
.ws-arrange button { padding: 2px 8px; border: 1px solid var(--border-color); border-radius: 6px; background: var(--bg-card-strong); color: var(--text-primary); font: inherit; font-size: 0.8rem; cursor: pointer; }
.ws-nav-link { text-decoration: none; }

@media (max-width: 900px) {
    .ws-card-wide { grid-column: auto; }
    .ws-sunmoon { grid-template-columns: 1fr; justify-items: center; }
}

/* Themes: the night sky is the default ("current"); dark is neutral black and grey; light is for daylight. */

:root[data-theme="dark"] {
    --ws-night: #000000;
    --ws-navy: #1c1c1e;
    --bg-primary: #000000;
    --bg-card: #141416;
    --bg-card-strong: #1f1f22;
    --border-color: rgba(255, 255, 255, 0.12);
}
:root[data-theme="dark"] body { background: #000000; }
:root[data-theme="dark"] .ws-hero { background: #0d0d0f; }
:root[data-theme="dark"] .ws-card-hero { background: linear-gradient(160deg, #1c1c1e, #0d0d0f); }
:root[data-theme="dark"] .ws-select select, :root[data-theme="dark"] .ws-button { background: #1c1c1e; }
:root[data-theme="dark"] .ws-table thead th { background: #141416; }

:root[data-theme="light"] {
    color-scheme: light;
    --ws-night: #e9eef6;
    --ws-navy: #ffffff;
    --ws-teal: #0f8f78;
    --ws-sun: #b77900;
    --ws-sky: #0a6fd6;
    --ws-blue: #2563eb;
    --ws-purple: #6d3fe0;
    --ws-orange: #d06a00;
    --ws-red: #d02b20;
    --text-primary: #0b1220;
    --text-secondary: rgba(11, 18, 32, 0.74);
    --text-tertiary: rgba(11, 18, 32, 0.52);
    --bg-primary: #f3f6fb;
    --bg-card: #ffffff;
    --bg-card-strong: #f3f6fb;
    --border-color: rgba(11, 18, 32, 0.12);
}
:root[data-theme="light"] body { background: linear-gradient(180deg, #eaf2ff, #f3f6fb 400px); }
:root[data-theme="light"] .ws-hero { background: linear-gradient(180deg, #ffffff, #eef3fb); }
:root[data-theme="light"] .ws-card-hero { background: radial-gradient(ellipse 70% 120% at 0% 0%, rgba(255, 194, 26, 0.22), transparent 60%), linear-gradient(160deg, #ffffff, #e8f0fc); }
:root[data-theme="light"] .ws-card { backdrop-filter: none; box-shadow: 0 1px 3px rgba(11, 18, 32, 0.06); }
:root[data-theme="light"] .ws-select select, :root[data-theme="light"] .ws-button { background: #ffffff; }
:root[data-theme="light"] .ws-status { background: #ffffff; }
:root[data-theme="light"] .ws-tooltip { background: rgba(255, 255, 255, 0.97); }
:root[data-theme="light"] .ws-table thead th { background: #ffffff; }
:root[data-theme="light"] .ws-table th, :root[data-theme="light"] .ws-table td { border-bottom-color: rgba(11, 18, 32, 0.08); }
:root[data-theme="light"] .ws-grid-line { stroke: rgba(11, 18, 32, 0.1); }
:root[data-theme="light"] .ws-hover-line { stroke: rgba(11, 18, 32, 0.35); }
:root[data-theme="light"] #ws-map { background: #dfe7f2; }
/* The drawings use white for night skies; on light they use the text colour instead. */
:root[data-theme="light"] svg [stroke^="rgba(255,255,255"] { stroke: rgba(11, 18, 32, 0.35); }
:root[data-theme="light"] svg [fill^="rgba(255,255,255"] { fill: rgba(11, 18, 32, 0.6); }
:root[data-theme="light"] svg text[fill="#fff"], :root[data-theme="light"] svg text[fill="#ffffff"] { fill: var(--text-primary); }
:root[data-theme="light"] svg [stroke="#fff"] { stroke: var(--text-primary); }
:root[data-theme="light"] svg circle[fill="#fff"] { fill: var(--text-primary); }
:root[data-theme="light"] svg circle[fill="#0b1426"] { fill: #ffffff; }

/* History page */

.wh-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.wh-tabs [role="tab"] { padding: 8px 16px; border: 1px solid var(--border-color); border-radius: 999px; background: var(--bg-card); color: var(--text-secondary); font: inherit; cursor: pointer; }
.wh-tabs [role="tab"][aria-selected="true"] { border-color: var(--ws-sky); color: var(--text-primary); background: color-mix(in srgb, var(--ws-sky) 18%, transparent); }
.wh-panel[hidden] { display: none; }
.wh-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 8px 0; }
.wh-controls input, .wh-controls select, .wh-edit-fields input, .wh-conditions input, .wh-conditions select {
    padding: 5px 8px; border: 1px solid var(--border-color); border-radius: 8px; background: var(--bg-card-strong); color: var(--text-primary); font: inherit;
}
.wh-gap { margin-top: 16px; }
.wh-link { padding: 0; border: none; background: none; color: var(--ws-sky); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.wh-manual, .wh-manual input { color: var(--ws-orange); }
.wh-total td { font-weight: 700; border-top: 1px solid var(--border-color); }
.wh-edit-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px 16px; margin: 12px 0; }
.wh-edit-fields .ws-select { justify-content: space-between; }
.wh-pending { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
#wh-insights p { margin: 0 0 6px; }

/* All sites */

.wa-sites { grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.wa-site { display: block; color: inherit; text-decoration: none; transition: transform 0.15s ease; }
.wa-site:hover, .wa-site:focus-visible { transform: translateY(-2px); }
.wa-site h2 { margin: 0 0 4px; font-size: 1.1rem; }
.wa-warning { margin: 10px 0 0; color: #f5a524; font-weight: 600; font-size: 0.9rem; }
.wh-diary { max-width: 28ch; white-space: normal; text-align: left; font-size: 0.85rem; color: var(--ws-muted, inherit); }
.wh-report { margin: 12px 0 0; padding: 14px; overflow: auto; max-height: 70vh; font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre; background: rgba(0, 0, 0, 0.25); border-radius: 10px; }
[data-theme="light"] .wh-report { background: rgba(0, 0, 0, 0.05); }
.wa-maintenance { margin: 8px 0 0; color: #fb923c; font-weight: 600; font-size: 0.9rem; }
