body {
    background-color: #f5f5f5;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.main-header {
    background: linear-gradient(90deg, #0d47a1, #1976d2);
    color: #fff;
}

.header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.header-nav-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-nav-links {
    gap: 1.25rem;
}

.header-nav-meta {
    gap: 1.25rem;
}

.header-nav-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.header-nav-link {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.header-nav-link:hover,
.header-nav-link:focus {
    color: #fff;
}

.header-nav-link.is-active {
    color: #fff;
    position: relative;
}

.header-nav-link.is-active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 2px;
    background: rgba(255, 255, 255, 0.9);
}

.header-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    cursor: pointer;
    padding: 0.35rem;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.header-toggle span {
    width: 100%;
    height: 3px;
    background: #fff;
    border-radius: 999px;
    display: block;
    margin: 3px 0;
}

.header-toggle:focus-visible,
.header-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.7);
}

@media (max-width: 991.98px) {
    .header-bar {
        flex-wrap: wrap;
    }

    .header-toggle {
        display: inline-flex;
        margin-left: auto;
    }

    .header-nav {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        gap: 1rem;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        padding-top: 0;
        margin-top: 0;
        transition: max-height 0.3s ease, opacity 0.3s ease;
    }

    .header-nav.is-open {
        max-height: 500px;
        opacity: 1;
        padding-top: 1rem;
    }

    .header-nav-section,
    .header-nav-group {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .header-nav-links,
    .header-nav-meta {
        gap: 0.5rem;
    }

    .header-nav-link.is-active::after {
        display: none;
    }
}

.panel {
    background: #fff;
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.nearest-panel {
    background: linear-gradient(135deg, rgba(13, 71, 161, 0.08), rgba(25, 118, 210, 0.05));
    border: 1px solid rgba(13, 71, 161, 0.12);
}

.nearest-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.nearest-panel-body {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
}

.nearest-highlight {
    background: linear-gradient(135deg, #1976d2, #2196f3);
    color: #fff;
    border-radius: 0.75rem;
    padding: 1.25rem;
    min-height: 160px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 12px 25px rgba(13, 71, 161, 0.25);
}

.nearest-section-label {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.75rem;
    opacity: 0.8;
}

.nearest-temp-value {
    font-size: 2.4rem;
    font-weight: 600;
}

.nearest-updated {
    font-size: 0.85rem;
    opacity: 0.85;
}

.nearest-status {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.nearest-status .badge {
    font-size: 0.75rem;
    letter-spacing: 0.04em;
}

.nearest-wind-card {
    background: #fff;
    border-radius: 0.75rem;
    padding: 1.25rem;
    text-align: center;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.nearest-wind-card .wind-pointer {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.nearest-wind-rose {
    width: 100px;
    height: 100px;
    border-color: rgba(13, 71, 161, 0.2);
}

.nearest-wind-speed {
    font-size: 1.4rem;
    font-weight: 600;
    color: #0d47a1;
}

.nearest-wind-direction {
    font-size: 0.9rem;
}

.nearest-metric-grid {
    background: #fff;
    border-radius: 0.75rem;
    padding: 1.25rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.06);
}

.nearest-metric-label {
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    color: #607d8b;
}

.nearest-metric-value {
    display: block;
    font-size: 1.2rem;
    color: #0d47a1;
}

.current-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.metric-card {
    background: #fff;
    border-radius: 0.75rem;
    border: 1px solid rgba(0, 0, 0, 0.08);
    padding: 1rem;
    text-align: center;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.04);
}

.metric-temp {
    grid-column: span 2;
    background: linear-gradient(135deg, #1976d2, #2196f3);
    color: #fff;
}

.metric-heading {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.35rem;
    color: inherit;
    opacity: 0.8;
}

.metric-card .metric-value {
    font-size: 1.75rem;
    font-weight: 600;
}

.metric-card .metric-value.small {
    font-size: 1.4rem;
}

.metric-subtext {
    font-size: 0.85rem;
    margin-top: 0.35rem;
    color: inherit;
    opacity: 0.9;
}

.wind-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.wind-rose {
    width: 90px;
    height: 90px;
    border: 2px solid rgba(25, 118, 210, 0.2);
    border-radius: 50%;
    position: relative;
    margin-bottom: 0.5rem;
}

.wind-pointer {
    position: absolute;
    bottom: 45%;
    left: 50%;
    width: 0;
    height: 0;
    transform-origin: bottom center;
}

.wind-pointer-body {
    display: block;
    width: 4px;
    height: 20px;
    background: #1565c000;
    margin-left: -2px;
    border-radius: 2px;
}

.wind-pointer-head {
    display: block;
    width: 0;
    height: 0;
    border-left: 9px solid transparent;
    border-right: 9px solid transparent;
    border-bottom: 30px solid #0d47a1;
    transform: translate(-9px, 2px);
}

#station-map {
    height: 450px;
    border-radius: 0.5rem;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
}

.wind-marker-icon {
    background: transparent;
    border: none;
}

.wind-marker {
    position: relative;
    width: 64px;
    height: 64px;
}

.wind-marker-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid rgba(25, 118, 210, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.74rem;
    font-weight: 600;
    color: #0d47a1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

.wind-marker-label {
    display: block;
    font-weight: 600;
    position: relative;
    z-index: 2;
}

.wind-marker .wind-pointer {
    position: absolute;
    bottom: 50%;
    left: 50%;
    width: 0;
    height: 0;
    transform-origin: bottom center;
    z-index: 1;
}

.wind-marker .wind-pointer-body {
    margin-left: -2px;
}

.wind-marker .wind-pointer-head {
    transform: translate(-9px, 2px);
}

.station-map-picker {
    height: 320px;
    border-radius: 0.5rem;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.history-charts {
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 0.5rem;
}

.history-charts .chart-scroll-inner {
    min-width: 1100px;
    padding: 0 0.5rem;
}

.chart-row {
    background: #fff;
    border: 1px solid rgba(13, 71, 161, 0.12);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    padding: 0.75rem 1rem;
    margin-bottom: 0;
    border-radius: 0;
}

.chart-row:first-of-type {
    border-top-left-radius: 0.6rem;
    border-top-right-radius: 0.6rem;
}

.chart-row:last-of-type {
    border-bottom-left-radius: 0.6rem;
    border-bottom-right-radius: 0.6rem;
    margin-bottom: 1rem;
}

.chart-row + .chart-row {
    border-top: none;
}

.chart-row-header {
    font-size: 0.9rem;
    color: #546e7a;
    margin-bottom: 0.5rem;
}

.chart-canvas {
    height: 140px;
}

.chart-canvas canvas {
    width: 100% !important;
    height: 100% !important;
}

.timeline {
    display: flex;
    justify-content: space-between;
    color: #607d8b;
    font-size: 0.85rem;
    letter-spacing: 0.02em;
}

.timeline span {
    min-width: 50px;
    text-align: center;
}

.timeline-top {
    border-bottom: 1px dashed rgba(96, 125, 139, 0.4);
    padding-bottom: 0.35rem;
    margin-bottom: 0.75rem;
}

.timeline-bottom {
    border-top: 1px dashed rgba(96, 125, 139, 0.4);
    padding-top: 0.35rem;
    margin-top: 0.5rem;
}

.station-marker-popup {
    min-width: 180px;
}

.table td, .table th {
    vertical-align: middle;
}
