body {
    font-family: "Inter", "Segoe UI", sans-serif;
}

.dashboard-hero {
    position: relative;
    overflow: hidden;
    background: linear-gradient(125deg, #e8f4fc 0%, #dbeafe 35%, #bfdbfe 65%, #e0f2fe 100%);
    border: 1px solid rgba(59, 130, 246, 0.22);
    box-shadow: 0 10px 28px rgba(37, 99, 235, 0.12);
    padding: 1.5rem;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background:
            radial-gradient(circle at 88% 18%, rgba(147, 197, 253, 0.45), transparent 45%),
            radial-gradient(circle at 8% 88%, rgba(191, 219, 254, 0.55), transparent 40%);
    pointer-events: none;
}

.dashboard-hero .hero-title {
    color: #0f172a;
    font-weight: 600;
}

.dashboard-hero .hero-subtitle {
    color: #475569;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.eyebrow {
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.75rem;
    font-weight: 700;
}

.dashboard-menu .menu-pill {
    border: 1px solid rgba(59, 130, 246, 0.25);
    padding: 0.42rem 0.9rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.75);
    color: #1e3a8a;
    font-size: 0.8rem;
    font-weight: 600;
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.dashboard-menu .menu-pill:hover {
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15);
    transform: translateY(-1px);
}

.dashboard-menu .menu-pill.active {
    background: #2563eb;
    border-color: #1d4ed8;
    color: #ffffff;
    box-shadow: 0 2px 10px rgba(37, 99, 235, 0.25);
}

.hero-stats .stat-chip {
    min-width: 96px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 0.75rem;
    padding: 0.5rem 0.65rem;
    background: rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(8px);
}

.hero-stats .stat-label {
    display: block;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.72);
}

.hero-stats .stat-value {
    display: block;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 700;
}

.section-panel {
    scroll-margin-top: 1rem;
}

.map-shell {
    border-radius: 1rem;
    border: 1px solid #dbe4f0;
    overflow: visible;
}

.map-object {
    width: 100%;
    min-height: 0;
    aspect-ratio: 800 / 533;
    max-height: min(72vh, 640px);
    background: #f4f7fb;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem;
}

#district-map-container {
    width: 100%;
    max-width: 100%;
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

#district-map-container svg,
#district-map {
    width: 100%;
    height: auto;
    max-width: 100%;
    max-height: min(72vh, 640px);
    display: block;
}

#district-map .district path {
    fill: #cfe2ff;
    stroke: #0d6efd;
    stroke-width: 2;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
}

#district-map .district text {
    font-size: 20px;
    font-weight: 600;
    fill: #0b2f6b;
    text-anchor: middle;
    pointer-events: none;
}

#district-map .district:hover path,
#district-map .district.active path {
    fill: #0d6efd;
    stroke: #083b8a;
}

#district-map .district:hover text,
#district-map .district.active text {
    fill: #ffffff;
}

.station-panel {
    border: 1px solid #e5e7eb;
    background: #f8fafc;
}

/* Horizontal strip: flex utilities on #city-weather-accordion-root reinforce row layout */
#city-weather-accordion-root.city-weather-strip {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
    min-width: 0;
    width: 100%;
    padding-bottom: 0.2rem;
    scroll-snap-type: x proximity;
}

.city-weather-panel {
    flex: 0 0 auto;
    align-self: flex-start;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    width: clamp(13.25rem, 28vw, 15.75rem);
    max-width: min(15.75rem, calc(100vw - 2.5rem));
    min-height: 0;
    overflow: hidden;
    border: 1px solid #dfe4ec;
    border-radius: 0.85rem;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
    transition: width 0.28s ease, max-width 0.28s ease, box-shadow 0.22s ease, border-color 0.2s ease;
    scroll-snap-align: start;
}

.city-weather-panel.expanded {
    width: min(34rem, calc(100vw - 1.5rem));
    max-width: min(34rem, calc(100vw - 1.5rem));
    border-color: #c7d2e0;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
}

.city-weather-header {
    cursor: pointer;
    border-radius: 0.85rem;
    box-sizing: border-box;
    padding: 0.55rem 0.65rem 0.55rem 0.55rem;
    gap: 0.45rem;
    transition: background-color 0.15s ease;
}

.city-weather-header-text {
    min-width: 0;
    overflow: hidden;
}

.city-weather-station-name {
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.2;
    margin-bottom: 0.2rem;
    color: #0f172a;
}

.city-weather-summary {
    font-size: 0.72rem;
    line-height: 1.35;
}

.city-weather-temp-line {
    display: flex;
    gap: 0.25rem;
    align-items: baseline;
    min-width: 0;
}

.city-weather-temp-value {
    flex: 1 1 0;
    font-size: 0.74rem;
    font-weight: 600;
    color: #334155;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.city-weather-header:hover,
.city-weather-header:focus-visible {
    background: rgba(13, 110, 253, 0.06);
}

.city-weather-header:focus {
    outline: none;
}

.city-weather-header:focus-visible {
    box-shadow: inset 0 0 0 2px rgba(13, 110, 253, 0.35);
}

.city-weather-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    flex-shrink: 0;
    width: 2rem;
    min-height: 2rem;
}

.city-weather-icon .city-weather-weather-svg,
.city-weather-sky-cell .city-weather-weather-svg {
    display: block;
    width: 1.65rem;
    height: 1.65rem;
    flex-shrink: 0;
}

.city-weather-sky-cell .city-weather-weather-svg {
    width: 1.45rem;
    height: 1.45rem;
    margin: 0 auto;
}

.city-weather-sky-cell {
    width: 3rem;
}

.city-weather-chevron {
    flex-shrink: 0;
    width: 1rem;
    text-align: center;
    font-size: 0.65rem;
    line-height: 1.2;
    transition: transform 0.22s ease;
}

.city-weather-panel.expanded .city-weather-chevron {
    transform: rotate(180deg);
}

/* Collapsed: hide body completely (max-height clips are unreliable with tables inside) */
.city-weather-panel > .city-weather-body {
    display: none;
    flex: 0 0 auto;
    overflow: hidden;
}

.city-weather-panel.expanded > .city-weather-body {
    display: block;
    max-height: min(70vh, 720px);
    overflow-y: auto;
    overflow-x: hidden;
}

.city-weather-meta {
    font-size: 0.78rem;
    color: #64748b;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    word-break: break-word;
}

.city-weather-table {
    font-size: 0.8rem;
}

.city-weather-table td {
    vertical-align: middle;
}

.rainfall-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.65rem;
    align-items: center;
}

.rainfall-legend .legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: #475569;
}

.rainfall-legend .legend-swatch {
    display: inline-block;
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 2px;
    border: 1px solid rgba(15, 23, 42, 0.2);
}

.warning-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.65rem;
    align-items: center;
}

.warning-legend .legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: #475569;
}

.warning-legend .legend-swatch {
    display: inline-block;
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 2px;
    border: 1px solid rgba(15, 23, 42, 0.2);
}

/* Station strip: hint on the left with title */
.city-weather-section-header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem 1rem;
}

.nowcast-last-updated {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem 0.75rem;
    margin-top: 0.35rem;
    padding: 0.45rem 0.75rem;
    border-radius: 0.5rem;
    background: linear-gradient(90deg, #eff6ff 0%, #f8fafc 100%);
    border: 1px solid #bfdbfe;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.12);
}

.nowcast-last-updated-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #1d4ed8;
}

.nowcast-last-updated-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: #0f172a;
}

.nowcast-last-updated-card {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem 0.65rem;
    padding: 0.5rem 0.65rem;
    border-radius: 0.5rem;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    box-shadow: 0 1px 4px rgba(37, 99, 235, 0.1);
}

.detail-section {
    margin: 0.75rem 0;
    padding: 0.65rem 0.75rem;
    border-radius: 0.5rem;
    background: #f8fafc;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.warning-days-list {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.warning-day-row {
    padding: 0.6rem 0.75rem;
    border-radius: 0.5rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
}

.warning-day-date {
    font-size: 0.82rem;
    color: #0f172a;
    margin-bottom: 0.2rem;
}

.warning-day-text {
    font-size: 0.8rem;
    color: #475569;
    line-height: 1.4;
}

/* AWS / ARG station observation tables */
.aws-legends {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
}

.aws-legend-org strong {
    color: #b91c1c;
}

.aws-legend-aws strong {
    color: #1d4ed8;
}

.aws-legend-arg strong {
    color: #15803d;
}

.aws-table-title.aws-type-org {
    color: #b91c1c;
    border-left: 4px solid #b91c1c;
    padding-left: 0.5rem;
}

.aws-table-title.aws-type-aws {
    color: #1d4ed8;
    border-left: 4px solid #1d4ed8;
    padding-left: 0.5rem;
}

.aws-table-title.aws-type-arg {
    color: #15803d;
    border-left: 4px solid #15803d;
    padding-left: 0.5rem;
}

.aws-type-cell.aws-type-org {
    color: #b91c1c;
    font-weight: 600;
}

.aws-type-cell.aws-type-aws {
    color: #1d4ed8;
    font-weight: 600;
}

.aws-type-cell.aws-type-arg {
    color: #15803d;
    font-weight: 600;
}

.aws-station-table thead th {
    white-space: nowrap;
    font-size: 0.72rem;
}

.aws-observations-panel {
    border: 1px solid #e2e8f0;
}

/* --- Responsive: mobile & tablet --- */
@media (max-width: 991.98px) {
    .dashboard-hero {
        padding: 1rem 1.1rem;
    }

    .dashboard-hero .hero-title {
        font-size: clamp(1.15rem, 4.5vw, 1.5rem);
    }

    .dashboard-hero .hero-subtitle {
        font-size: 0.875rem;
    }

    .map-object {
        max-height: min(65vh, 520px);
    }

    #district-map-container svg,
    #district-map {
        max-height: min(65vh, 520px);
    }

    #district-map .district text {
        font-size: 14px;
    }
}

@media (max-width: 575.98px) {
    main.container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .dashboard-menu {
        gap: 0.35rem !important;
    }

    .dashboard-menu .menu-pill {
        font-size: 0.72rem;
        padding: 0.38rem 0.7rem;
    }

    .city-weather-panel {
        width: min(14rem, 88vw);
        max-width: 88vw;
    }

    .city-weather-panel.expanded {
        width: min(100%, calc(100vw - 1.5rem));
        max-width: calc(100vw - 1.5rem);
    }

    .map-object {
        aspect-ratio: 800 / 533;
        max-height: none;
    }

    #district-map-container svg,
    #district-map {
        max-height: none;
    }

    #district-map .district text {
        font-size: 11px;
    }

    #district-map .district path {
        stroke-width: 1.5;
    }

    .rainfall-legend,
    .warning-legend,
    .aws-legends {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.35rem;
    }
}
