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

    :root {
        --bg:         #f2f5fa;
        --surface:    #ffffff;
        --surface-2:  #edf0f7;
        --border:     rgba(0,0,0,0.08);
        --border-2:   rgba(0,0,0,0.05);
        --text:       #0d1520;
        --text-muted: #8a9ab5;
        --text-dim:   #4f627a;

        --heat:   #d0400e;
        --cold:   #0272a8;
        --rain:   #0788a3;
        --wind:   #6d28d9;

        --gold:   #c08a08;
        --silver: #607080;
        --bronze: #8c5228;
    }

    body {
        background: var(--bg);
        color: var(--text);
        font-family: 'DM Sans', sans-serif;
        min-height: 100vh;
        line-height: 1.5;
    }

    /* Subtle grid texture */
    body::before {
        content: '';
        position: fixed;
        inset: 0;
        background-image:
            linear-gradient(rgba(0,0,0,0.028) 1px, transparent 1px),
            linear-gradient(90deg, rgba(0,0,0,0.028) 1px, transparent 1px);
        background-size: 60px 60px;
        pointer-events: none;
        z-index: 0;
    }

    .page-wrap {
        position: relative;
        z-index: 1;
        max-width: 1360px;
        margin: 0 auto;
        padding: 0 28px 72px;
    }

    /* ---- HEADER ---- */
    header {
        padding: 52px 0 40px;
        border-bottom: 1px solid var(--border);
        margin-bottom: 48px;
    }

    .header-inner {
        display: flex;
        align-items: flex-end;
        justify-content: space-between;
        gap: 24px;
        flex-wrap: wrap;
    }

    .eyebrow {
        font-family: 'DM Mono', monospace;
        font-size: 11px;
        letter-spacing: 0.15em;
        text-transform: uppercase;
        color: var(--text-muted);
        margin-bottom: 10px;
    }

    h1 {
        font-family: 'Fraunces', serif;
        font-size: clamp(2rem, 4vw, 3.6rem);
        font-weight: 700;
        line-height: 1.1;
        letter-spacing: -0.025em;
        color: var(--text);
    }

    h1 em {
        font-style: italic;
        font-weight: 300;
        color: var(--text-dim);
    }

    .region-lead {
        font-family: 'DM Sans', sans-serif;
        font-size: 15px;
        color: var(--text-dim);
        max-width: 680px;
        margin-top: 14px;
        line-height: 1.7;
    }

        .header-meta {
        display: flex;
        align-items: center;
        gap: 16px;
        margin-top: 14px;
        flex-wrap: wrap;
    }

    .live-badge {
        font-family: 'DM Mono', monospace;
        font-size: 12px;
        color: var(--text-muted);
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .live-dot {
        width: 7px;
        height: 7px;
        border-radius: 50%;
        background: #16a34a;
        box-shadow: 0 0 7px rgba(22,163,74,0.5);
        animation: pulse 2s ease-in-out infinite;
    }

    @keyframes pulse {
        0%, 100% { opacity: 1; }
        50%       { opacity: 0.4; }
    }

    .tag {
        font-family: 'DM Mono', monospace;
        font-size: 11px;
        color: var(--text-muted);
        background: rgba(0,0,0,0.04);
        padding: 3px 10px;
        border-radius: 4px;
        border: 1px solid var(--border);
        text-decoration: none;
        transition: color 0.15s;
    }

    .tag:hover { color: var(--text-dim); }

    /* ---- CONTROLS ---- */
    .controls {
        display: flex;
        gap: 10px;
        align-items: center;
    }

    .toggle-label {
        font-family: 'DM Mono', monospace;
        font-size: 10px;
        color: var(--text-muted);
        letter-spacing: 0.1em;
        text-transform: uppercase;
    }

    .toggle-group {
        display: flex;
        background: #fff;
        border: 1px solid var(--border);
        border-radius: 8px;
        overflow: hidden;
        box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    }

    .toggle-btn {
        font-family: 'DM Mono', monospace;
        font-size: 12px;
        font-weight: 500;
        padding: 8px 16px;
        border: none;
        cursor: pointer;
        background: transparent;
        color: var(--text-muted);
        transition: background 0.15s, color 0.15s;
        letter-spacing: 0.04em;
    }

    .toggle-btn:hover { color: var(--text-dim); }

    .toggle-btn.active {
        background: rgba(0,0,0,0.07);
        color: var(--text);
    }

    /* ---- REGION PILLS ---- */
    .region-row {
        display: flex;
        align-items: center;
        gap: 12px;
        margin-bottom: 32px;
        flex-wrap: wrap;
    }

    .region-label {
        font-family: 'DM Mono', monospace;
        font-size: 11px;
        color: var(--text-muted);
        letter-spacing: 0.1em;
        text-transform: uppercase;
    }

    .region-pills {
        display: flex;
        gap: 6px;
        flex-wrap: wrap;
    }

    .region-pill {
        font-family: 'DM Sans', sans-serif;
        font-size: 12px;
        font-weight: 500;
        padding: 5px 14px;
        border-radius: 100px;
        border: 1px solid var(--border);
        background: #fff;
        color: var(--text-muted);
        cursor: pointer;
        transition: all 0.15s;
        box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    }

    .region-pill:hover { color: var(--text-dim); border-color: rgba(0,0,0,0.15); }

    .region-pill.active {
        background: var(--text);
        color: #fff;
        border-color: var(--text);
    }

    /* ---- GRID ---- */
    .grid {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }

    @media (max-width: 1320px) {
        .grid { grid-template-columns: repeat(2, 1fr); }
    }

    @media (max-width: 700px) {
        .grid { grid-template-columns: 1fr; }
    }

    /* ---- CARD ---- */
    .card {
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: 12px;
        overflow: hidden;
        box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 6px 24px rgba(0,0,0,0.04);
        opacity: 0;
        transform: translateY(16px);
        animation: cardIn 0.45s ease forwards;
    }

    .card:nth-child(1) { animation-delay: 0.05s; }
    .card:nth-child(2) { animation-delay: 0.15s; }
    .card:nth-child(3) { animation-delay: 0.25s; }
    .card:nth-child(4) { animation-delay: 0.35s; }

    @keyframes cardIn {
        to { opacity: 1; transform: translateY(0); }
    }

    .card-header {
        padding: 18px 20px 14px;
        border-bottom: 1px solid var(--border-2);
        position: relative;
        background: #fafbfd;
    }

    .accent-bar {
        position: absolute;
        top: 0; left: 0; right: 0;
        height: 3px;
    }

    .card--heat .accent-bar { background: linear-gradient(90deg, #e84c1c, #f97316); }
    .card--cold .accent-bar { background: linear-gradient(90deg, #0284c7, #38bdf8); }
    .card--rain .accent-bar { background: linear-gradient(90deg, #0891b2, #22d3ee); }
    .card--wind .accent-bar { background: linear-gradient(90deg, #7c3aed, #a78bfa); }

    .card-title {
        font-family: 'DM Sans', sans-serif;
        font-size: 11px;
        font-weight: 600;
        letter-spacing: 0.1em;
        text-transform: uppercase;
        margin-bottom: 3px;
    }

    .card--heat .card-title { color: var(--heat); }
    .card--cold .card-title { color: var(--cold); }
    .card--rain .card-title { color: var(--rain); }
    .card--wind .card-title { color: var(--wind); }

    .card-ts {
        font-family: 'DM Mono', monospace;
        font-size: 11px;
        color: var(--text-muted);
    }

    /* ---- TABLE ---- */
    table {
        width: 100%;
        border-collapse: collapse;
    }

    tbody tr {
        border-bottom: 1px solid var(--border-2);
        transition: background 0.12s;
        opacity: 0;
        animation: rowIn 0.3s ease forwards;
    }

    tbody tr:last-child { border-bottom: none; }
    tbody tr:hover { background: #f7f9fc; }

    tbody tr:nth-child(1)  { animation-delay: 0.30s; }
    tbody tr:nth-child(2)  { animation-delay: 0.33s; }
    tbody tr:nth-child(3)  { animation-delay: 0.36s; }
    tbody tr:nth-child(4)  { animation-delay: 0.39s; }
    tbody tr:nth-child(5)  { animation-delay: 0.42s; }
    tbody tr:nth-child(6)  { animation-delay: 0.45s; }
    tbody tr:nth-child(7)  { animation-delay: 0.48s; }
    tbody tr:nth-child(8)  { animation-delay: 0.51s; }
    tbody tr:nth-child(9)  { animation-delay: 0.54s; }
    tbody tr:nth-child(10) { animation-delay: 0.57s; }
    tbody tr:nth-child(11) { animation-delay: 0.60s; }
    tbody tr:nth-child(12) { animation-delay: 0.63s; }
    tbody tr:nth-child(13) { animation-delay: 0.66s; }
    tbody tr:nth-child(14) { animation-delay: 0.69s; }
    tbody tr:nth-child(15) { animation-delay: 0.72s; }

    @keyframes rowIn {
        from { opacity: 0; transform: translateX(-5px); }
        to   { opacity: 1; transform: translateX(0); }
    }

    td {
        padding: 8px 14px;
        font-size: 13px;
        vertical-align: middle;
    }

    td.td-rank    { width: 38px; padding-right: 6px; }
    td.td-station { width: 56px; }
    td.td-value   { text-align: right; white-space: nowrap; }

    /* ---- RANK BADGE ---- */
    .rank {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 22px;
        height: 22px;
        border-radius: 50%;
        font-family: 'DM Mono', monospace;
        font-size: 10px;
        font-weight: 500;
    }

    .rank-1 { background: rgba(192,138,8,0.1);  color: var(--gold);   border: 1px solid rgba(192,138,8,0.25); }
    .rank-2 { background: rgba(96,112,128,0.1); color: var(--silver); border: 1px solid rgba(96,112,128,0.2); }
    .rank-3 { background: rgba(140,82,40,0.1);  color: var(--bronze); border: 1px solid rgba(140,82,40,0.2); }
    .rank-n { color: var(--text-muted); font-family: 'DM Mono', monospace; font-size: 11px; }

    /* ---- LOCATION ---- */
    .loc-name {
        color: var(--text);
        font-size: 13px;
        font-weight: 400;
    }

    .loc-country {
        font-size: 11px;
        color: var(--text-muted);
        margin-top: 1px;
    }

    /* ---- STATION ID ---- */
    .station {
        font-family: 'DM Mono', monospace;
        font-size: 11px;
        color: var(--text-muted);
    }

    /* ---- VALUE ---- */
    .value {
        font-family: 'DM Sans', sans-serif;
        font-size: 13.5px;
        font-weight: 500;
        font-variant-numeric: tabular-nums;
    }

    .card--heat .value { color: var(--heat); }
    .card--cold .value { color: var(--cold); }
    .card--rain .value { color: var(--rain); }
    .card--wind .value { color: var(--wind); }

    tbody tr:first-child .value { font-size: 15.5px; font-weight: 600; }

    /* ---- EMPTY STATE ---- */
    .empty-state {
        padding: 36px 20px;
        text-align: center;
    }

    .empty-icon {
        font-size: 22px;
        margin-bottom: 8px;
        opacity: 0.4;
    }

    .empty-title {
        font-family: 'DM Sans', sans-serif;
        font-size: 13px;
        font-weight: 500;
        color: var(--text-muted);
        margin-bottom: 4px;
    }

    .empty-sub {
        font-family: 'DM Mono', monospace;
        font-size: 11px;
        color: var(--text-muted);
        opacity: 0.7;
    }

    /* Fade/loading on region switch */
    tbody { transition: opacity 0.2s ease; }
    tbody.fading { opacity: 0; }

    /* Loading skeleton rows */
    .skel-row td { padding: 10px 14px; }
    .skel {
        height: 12px;
        border-radius: 4px;
        background: linear-gradient(90deg, #e8edf5 25%, #f2f5fa 50%, #e8edf5 75%);
        background-size: 200% 100%;
        animation: shimmer 1.2s infinite;
    }
    .skel.skel-sm  { width: 24px; }
    .skel.skel-md  { width: 80px; }
    .skel.skel-lg  { width: 130px; }
    .skel.skel-val { width: 56px; margin-left: auto; }
    @keyframes shimmer {
        0%   { background-position: 200% 0; }
        100% { background-position: -200% 0; }
    }

    /* ---- COOKIE BANNER ---- */
    #cookie-banner {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--surface);
        border-top: 1px solid var(--border);
        padding: 14px 28px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 20px;
        flex-wrap: wrap;
        z-index: 100;
        box-shadow: 0 -4px 20px rgba(0,0,0,0.06);
        font-family: 'DM Mono', monospace;
        font-size: 11px;
        color: var(--text-muted);
    }

    #cookie-banner.hidden { display: none; }

    #cookie-banner a {
        color: var(--text-dim);
        text-decoration: underline;
    }

    #cookie-accept {
        font-family: 'DM Mono', monospace;
        font-size: 11px;
        font-weight: 500;
        padding: 7px 18px;
        border-radius: 6px;
        border: 1px solid var(--border);
        background: var(--text);
        color: #fff;
        cursor: pointer;
        white-space: nowrap;
        transition: opacity 0.15s;
    }

    #cookie-accept:hover { opacity: 0.85; }

    /* ---- RECORDS BANNER ---- */
    .records-banner {
        display: flex;
        align-items: center;
        gap: 16px;
        flex-wrap: wrap;
        margin-top: 48px;
        padding: 16px 20px;
        background: white;
        border: 1px solid var(--border);
        border-radius: 10px;
        text-decoration: none;
        transition: border-color 0.15s, box-shadow 0.15s;
    }
    .records-banner:hover {
        border-color: rgba(109,40,217,0.3);
        box-shadow: 0 2px 8px rgba(109,40,217,0.08);
    }
    .records-banner-label {
        font-family: 'DM Mono', monospace;
        font-size: 10px;
        letter-spacing: 0.1em;
        text-transform: uppercase;
        color: var(--wind);
        background: rgba(109,40,217,0.07);
        padding: 3px 8px;
        border-radius: 4px;
        white-space: nowrap;
    }
    .records-banner-text {
        font-family: 'DM Mono', monospace;
        font-size: 12px;
        color: var(--text-dim);
        flex: 1;
    }
    .records-banner--birthday:hover {
        border-color: rgba(220,38,38,0.3);
        box-shadow: 0 2px 8px rgba(220,38,38,0.08);
    }
    .records-banner--birthday .records-banner-label {
        color: var(--heat);
        background: rgba(220,38,38,0.07);
    }
    .records-banner--birthday .records-banner-cta { color: var(--heat); }
    @media (max-width: 700px) {
        .records-banner-text { display: none; }
    }

    /* ---- FOOTER ---- */
    footer {
        margin-top: 52px;
        padding-top: 28px;
        border-top: 1px solid var(--border);
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 24px;
        flex-wrap: wrap;
    }

    .footer-credit {
        font-family: 'DM Mono', monospace;
        font-size: 11px;
        color: var(--text-muted);
        line-height: 1.9;
    }

    .footer-credit a {
        color: var(--text-dim);
        text-decoration: none;
        border-bottom: 1px solid var(--border);
        transition: color 0.15s;
    }

    .footer-credit a:hover { color: var(--text); }

    .footer-note {
        font-size: 12px;
        color: var(--text-muted);
        max-width: 460px;
        line-height: 1.7;
    }
