body {
    font-family: Segoe UI, Arial, sans-serif;
    background: #0f172a;
    color: white;
    margin: 30px auto;
    max-width: 1600px;
    padding: 20px;
    transition: all 0.3s ease;
}

body.light {
    background: #f1f5f9;
    color: #0f172a;
}

h1 {
    text-align: center;
}

.cards {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    align-items: stretch;
}

.dashboard-cards > a,
.dashboard-cards > .card {
    min-width: 0;
    width: 100%;
}

.dashboard-cards .card,
.dashboard-cards .wind-instrument-card,
.dashboard-cards .rain-gauge-card,
.dashboard-cards .dial-card {
    box-sizing: border-box;
    height: 100%;
    width: 100%;
}

@media (max-width: 640px) {
    .dashboard-cards {
        grid-template-columns: minmax(0, 1fr);
    }
}

.card {
    background: #1e293b;
    padding: 20px;
    border-radius: 15px;
    width: 180px;
    text-align: center;
    transition: all 0.3s ease;
}

body.light .card {
    background: white;
    box-shadow: 0 3px 10px rgba(0,0,0,0.15);
}

.value {
    font-size: 36px;
    font-weight: bold;
}

.dial-card {
    background: #4b4c4c;
    padding: 20px;
    border-radius: 20px;
    width: 240px;
    text-align: center;
    transition: all 0.3s ease;
}

body.light .dial-card {
    background: white;
    box-shadow: 0 3px 10px rgba(0,0,0,0.15);
}

.dial {
    width: 170px;
    height: 170px;
    border-radius: 50%;
    margin: 10px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: conic-gradient(#38bdf8 0deg, #38bdf8 var(--dial-angle), #334155 var(--dial-angle), #334155 360deg);
    position: relative;
}

.dial::before {
    content: "";
    position: absolute;
    width: 125px;
    height: 125px;
    border-radius: 50%;
    background: #1e293b;
}

body.light .dial::before {
    background: white;
}

.solar-visual {
    position: relative;
    width: 160px;
    height: 120px;
    margin: 12px auto 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.solar-circle {
    width: var(--solar-size);
    height: var(--solar-size);
    border-radius: 50%;
    background: radial-gradient(
        circle at 35% 35%,
        #fffef5 0%,
        hsl(var(--solar-hue), 100%, calc(var(--solar-lightness) + 10%)) 18%,
        hsl(var(--solar-hue), 100%, var(--solar-lightness)) 48%,
        rgba(245, 158, 11, 0.92) 100%
    );
    box-shadow:
        0 0 calc(var(--solar-size) * 0.7) rgba(255, 207, 66, 0.85),
        0 0 calc(var(--solar-size) * 1.4) rgba(255, 166, 0, 0.4);
    transition: width 0.35s ease, height 0.35s ease, box-shadow 0.35s ease, background 0.35s ease;
}

.moon-visual {
    font-size: 88px;
    line-height: 1;
    filter: drop-shadow(0 0 16px rgba(226, 232, 240, 0.7));
}

.solar-reading-row {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 6px;
    margin-top: 8px;
}

.solar-arc-value {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.1;
    color: #ffffff;
}

body.light .solar-arc-value {
    color: #0f172a;
}

.solar-unit {
    font-size: 18px;
    opacity: 0.9;
    font-weight: 600;
    margin-bottom: 2px;
    color: #ffffff;
}

body.light .solar-unit {
    color: #0f172a;
}

.dial-value {
    position: relative;
    z-index: 1;
    font-size: 32px;
    font-weight: bold;
}

.dial-label {
    font-size: 16px;
    opacity: 0.85;
}

.chart {
    margin-top: 30px;
    background: #1e293b;
    border-radius: 15px;
    padding: 20px;
}

body.light .chart {
    background: white;
}

.humidity-dial {
    background: conic-gradient(#3b82f6 0deg, #3b82f6 var(--dial-angle), #334155 var(--dial-angle), #334155 360deg);
}

.compass-card {
    background: #1e293b;
    padding: 20px;
    border-radius: 20px;
    width: 240px;
    text-align: center;
}

body.light .compass-card {
    background: white;
    box-shadow: 0 3px 10px rgba(0,0,0,0.15);
}

.compass {
    width: 200px;
    height: 200px;
    border: 5px solid #38bdf8;
    border-radius: 50%;
    position: relative;
    margin: 15px auto;
}

.direction-label {
    position: absolute;
    font-weight: bold;
    font-size: 18px;
}

body.light .direction-label {
    color: #0f172a;
}

.wind-info {
    margin-top: 15px;
    text-align: center;
    color: #64748b;
}

.wind-info strong {
    font-size: 1.5rem;
    display: block;
}

.north {
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
}

.south {
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
}

.east {
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
}

.west {
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
}

.arrow {
    position: absolute;
    left: 50%;
    top: 50%;
    font-size: 50px;
    color: #ef4444;
    transform-origin: center center;
    line-height: 1;
}

.centre-dot {
    background: white;
}

body.light .centre-dot {
    background: #0f172a;
}

.nav-links {
    text-align: center;
    margin: 20px 0;
}

.nav-links a {
    text-align: center;
    display: inline-block;
    margin: 20px 10px;
    padding: 10px 16px;
    border-radius: 999px;
    background: #1e293b;
    color: white;
    text-decoration: none;
    font-weight: 600;
}

.nav-links a:hover {
    transform: translateY(-3px);
}

.echarts-heatmap {
    width: 100%;
    height: min(72vh, 820px);
    min-height: 420px;
    background: #1e293b;
    border-radius: 12px;
}

.heatmap-note {
    margin: 8px 0 24px;
    color: #94a3b8;
    text-align: right;
    font-size: 0.9rem;
}

body.light .echarts-heatmap {
    background: #ffffff;
}

.heatmap-wrapper {
    overflow-x: auto;
    background: white;
    padding: 20px;
    border-radius: 16px;
}

table {
    border-collapse: collapse;
    font-size: 12px;
    color: #111827;
    min-width: 1200px;
}

th,
td {
    border: 1px solid #d1d5db;
    padding: 5px 7px;
    text-align: center;
    min-width: 42px;
}

th {
    background: #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 2;
}

.date-cell {
    background: #f3f4f6;
    font-weight: bold;
    position: sticky;
    left: 0;
    z-index: 3;
}

.calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
}

.day {
    background: #1e293b;
    border-radius: 12px;
    padding: 10px;
    min-height: 100px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.date {
    font-weight: bold;
    margin-bottom: 8px;
}

.day.hot {
    background: #dc2626;
}

.day.warm {
    background: #f97316;
}

.day.mild {
    background: #eab308;
    color: #000;
}

.day.cool {
    background: #22c55e;
}

.day.cold {
    background: #3b82f6;
}

.legend {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.legend-box {
    width: 20px;
    height: 20px;
    display: inline-block;
    border-radius: 4px;
    margin-right: 5px;
}

.legend-box.cold {
    background: #3b82f6;
}

.legend-box.cool {
    background: #22c55e;
}

.legend-box.mild {
    background: #eab308;
}

.legend-box.warm {
    background: #f97316;
}

.legend-box.hot {
    background: #dc2626;
}

.month-header {
    grid-column: 1 / -1;
    font-size: 2rem;
    font-weight: bold;
    color: rgb(198, 195, 195);
    margin-top: 20px;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 2px solid rgba(255,255,255,0.2);
}

.rain-bar {
    width: 100%;
    height: 6px;
    background: rgba(255,255,255,0.25);
    border-radius: 3px;
    margin-top: 8px;
}

.rain-fill {
    height: 100%;
    background: linear-gradient(to right, #38bdf8, #0ea5e9);
    border-radius: 3px;
}

.day:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.25);
}

.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    justify-content: center;
    align-items: center;
    z-index: 999;
}

.modal-content {
    background: #1e293b;
    color: white;
    padding: 35px;
    border-radius: 18px;
    min-width: 450px;
    max-width: 600px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
}

.close {
    float: right;
    font-size: 32px;
    font-weight: bold;
    color: #cbd5e1;
    cursor: pointer;
    transition: color 0.2s ease;
}

.close:hover {
    color: white;
}

#modalDaylightSummary {
    font-style: italic;
    color: #facc15;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(255,255,255,0.15);
    font-size: 1.15rem;
    font-weight: 600;
}

#modalDate {
    font-size: 2.2rem;
    font-weight: 700;
    color: #f8fafc;
    margin-bottom: 30px;
}

.modal-content p {
    font-size: 1.2rem;
    margin: 14px 0;
    line-height: 1.5;
    display: flex;
    justify-content: space-between;
}

.wind-instrument-card {
    background: #1e293b;
    padding: 22px;
    border-radius: 22px;
    text-align: center;
    color: white;
    box-shadow: 0 10px 24px rgba(0,0,0,0.25);
}

body.light .wind-instrument-card {
    background: white;
    color: #0f172a;
    box-shadow: 0 3px 12px rgba(0,0,0,0.15);
}

.wind-instrument-card h3 {
    margin-bottom: 16px;
}

.wind-rose {
    width: 220px;
    height: 220px;
    border-radius: 50%;
    margin: 0 auto;
    position: relative;

    background:
        radial-gradient(circle at center, #0f172a 0%, #1e293b 55%, #334155 100%);

    border: 4px solid #38bdf8;
    box-shadow:
        inset 0 0 30px rgba(56,189,248,0.18),
        0 0 18px rgba(56,189,248,0.18);
}

body.light .wind-rose {
    background:
        radial-gradient(circle at center, #ffffff 0%, #f1f5f9 60%, #dbeafe 100%);
}

.wind-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.18);
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

body.light .wind-ring {
    border: 1px solid rgba(15,23,42,0.18);
}

.inner-ring {
    width: 80px;
    height: 80px;
}

.middle-ring {
    width: 145px;
    height: 145px;
}

.wind-point {
    position: absolute;
    font-size: 13px;
    font-weight: 800;
    color: #e0f2fe;
    letter-spacing: 0.5px;
}

body.light .wind-point {
    color: #0f172a;
}

.wind-n {
    top: 9px;
    left: 50%;
    transform: translateX(-50%);
}

.wind-ne {
    top: 30px;
    right: 31px;
}

.wind-e {
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
}

.wind-se {
    bottom: 30px;
    right: 31px;
}

.wind-s {
    bottom: 9px;
    left: 50%;
    transform: translateX(-50%);
}

.wind-sw {
    bottom: 30px;
    left: 31px;
}

.wind-w {
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
}

.wind-nw {
    top: 30px;
    left: 31px;
}

.wind-needle {
    position: absolute;
    left: 50%;
    top: 50%;
    color: #ef4444;
    font-size: 72px;
    line-height: 1;
    transform-origin: 50% 100%;
    z-index: 4;
    transition: transform 0.8s ease;
    text-shadow: 0 0 12px rgba(239,68,68,0.45);
}

.wind-centre {
    position: absolute;
    width: 78px;
    height: 78px;
    border-radius: 50%;
    background: #020617;
    border: 3px solid #38bdf8;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 18px rgba(56,189,248,0.45);
}

body.light .wind-centre {
    background: white;
}

.wind-speed-value {
    font-size: 24px;
    font-weight: 900;
    line-height: 1;
}

.wind-speed-unit {
    font-size: 12px;
    opacity: 0.75;
    margin-top: 3px;
}

.wind-summary {
    margin-top: 16px;
    font-size: 18px;
}

.wind-summary strong {
    font-size: 24px;
    margin-right: 8px;
}

.wind-summary span {
    font-weight: 700;
    color: #38bdf8;
}

.temp-range-card {
    background: #1e293b;
    border-radius: 20px;
    padding: 20px;
    text-align: center;
}

.temp-high {
    color: #ef4444;
    font-size: 1.8rem;
    font-weight: bold;
}

.temp-low {
    color: #3b82f6;
    font-size: 1.8rem;
    font-weight: bold;
    margin-top: 10px;
}

.page-header {
    margin-bottom: 40px;
    padding: 18px 22px 12px;
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.16);
    border: 1px solid rgba(148, 163, 184, 0.18);
}

body.light .page-header {
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(15, 23, 42, 0.08);
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.06);
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.station-title h1 {
    margin: 0;
    font-size: 2.5rem;
}

.station-location {
    margin: 5px 0;
    opacity: 0.8;
    font-size: 1rem;
}

.last-updated {
    margin: 5px 0;
    font-size: 0.95rem;
    opacity: 0.7;
}

.theme-button {
    padding: 10px 16px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(15, 23, 42, 0.8);
    color: #f8fafc;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.25s ease;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.2);
}

body.light .theme-button {
    background: rgba(255, 255, 255, 0.9);
    color: #0f172a;
    border-color: rgba(15, 23, 42, 0.18);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
}

.theme-button:hover {
    transform: translateY(-1px);
    filter: brightness(1.08);
}

.nav-links {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    padding-top: 15px;
    border-top: 1px solid rgba(255,255,255,0.15);
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    font-weight: 600;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(15, 23, 42, 0.25);
    color: #f8fafc;
    border-radius: 999px;
    padding: 10px 16px;
    transition: all 0.25s ease;
}

body.light .nav-links {
    border-top: 1px solid rgba(0,0,0,0.15);
}

body.light .nav-links a {
    background: rgba(255, 255, 255, 0.8);
    color: #0f172a;
    border-color: rgba(15, 23, 42, 0.1);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.nav-links a:hover {
    transform: translateY(-2px);
    filter: brightness(1.06);
}

.chart-card-link {
    display: block;
    color: inherit;
    text-decoration: none;
    border-radius: 20px;
    transition: transform 0.25s ease, filter 0.25s ease;
}

.chart-card-link:hover,
.chart-card-link:focus-visible {
    transform: translateY(-3px);
    filter: brightness(1.08);
    outline: none;
}

.solar-dial {
    --dial-colour: #facc15;
}

.solar-dial::before {
    background: conic-gradient(
        #facc15 var(--dial-angle),
        rgba(255,255,255,.15) 0deg
    );
}

.barometer-card {
    background: #1e293b;
    border-radius: 20px;
    padding: 20px;
    text-align: center;
}

.pressure-trend {
    align-items: center;
    display: flex;
    font-size: 0.9rem;
    font-weight: bold;
    line-height: 1;
    margin-top: 0.35rem;
    justify-content: center;
    gap: 0.35rem;
}

.pressure-trend-arrow {
    font-size: 2rem;
}

.pressure-trend--rising {
    color: #ef4444;
}

.pressure-trend--falling {
    color: #38bdf8;
}

.pressure-trend--same {
    color: #94a3b8;
}

.barometer {
    width: 180px;
    height: 180px;
    margin: auto;
    position: relative;

    border-radius: 50%;
    border: 4px solid #a78bfa;
}

.barometer-needle {
    position: absolute;

    left: 50%;
    top: 50%;

    width: 4px;
    height: 70px;

    background: #ef4444;

    transform-origin: bottom center;
}

.barometer-centre {
    position: absolute;

    width: 18px;
    height: 18px;

    background: white;

    border-radius: 50%;

    left: 50%;
    top: 50%;

    transform: translate(-50%, -50%);
}

.pressure-reading {
    position: absolute;

    bottom: 20px;
    left: 50%;

    transform: translateX(-50%);

    font-weight: bold;
}

.pressure-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 0.8rem;
}

.rain-gauge-card {
    background: #1e293b;
    border-radius: 20px;
    padding: 20px;
    text-align: center;
    color: white;
}

body.light .rain-gauge-card {
    background: white;
    color: #0f172a;
}

.rain-gauge-card {
    background: #1e293b;
    border-radius: 20px;
    padding: 20px;
    text-align: center;
    color: white;
    box-shadow: 0 10px 20px rgba(0,0,0,.2);
}

body.light .rain-gauge-card {
    background: white;
    color: #0f172a;
    box-shadow: 0 3px 12px rgba(0,0,0,.15);
}

.rain-gauge-link,
.solar-dial-link {
    display: block;
    color: inherit;
    text-decoration: none;
    border-radius: 20px;
    transition: transform 0.25s ease, filter 0.25s ease;
}

.rain-gauge-link:hover,
.rain-gauge-link:focus-visible,
.solar-dial-link:hover,
.solar-dial-link:focus-visible {
    transform: translateY(-3px);
    filter: brightness(1.08);
    outline: none;
}

.rain-gauge-wrapper {
    display: flex;
    justify-content: center;
    align-items: stretch;
    gap: 10px;
    margin: 15px 0;
}

.rain-scale {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 180px;
    font-size: 0.75rem;
    opacity: 0.8;
    text-align: right;
}

.rain-scale span {
    line-height: 1;
}

.rain-gauge {
    width: 80px;
    height: 180px;
    border: 4px solid #38bdf8;
    border-radius: 0 0 25px 25px;
    overflow: hidden;
    position: relative;
    background: #eaf3ff;
}

body.light .rain-gauge {
    background: #eaf3ff;
}

.rain-water {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(
        to top,
        #0ea5e9,
        #7dd3fc
    );
    transition: height 0.5s ease;
}

.rain-reading {
    font-size: 1.4rem;
    font-weight: bold;
    margin-top: 8px;
}