:root {
    --midnight: #0D1B2A;
    --sage: #687A59;
    --sky: #52718E;
    --gold: #D49A3A;
    --fog: #F2F4F7;
    --white: #FFFFFF;
    --ink-soft: #526170;
    --line: #DCE2E8;
    --vfr: #437A5A;
    --mvfr: #52718E;
    --ifr: #B55245;
    --lifr: #754D78;
    --vlifr: #4C3052;
    --shadow: 0 12px 34px rgba(13, 27, 42, 0.08);
    --radius: 18px;
}

* { box-sizing: border-box; }

html { color-scheme: light; }

body {
    margin: 0;
    min-width: 320px;
    background: var(--fog);
    color: var(--midnight);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}

.preview-warning {
    padding: 10px 20px;
    color: var(--midnight);
    background: color-mix(in srgb, var(--gold) 30%, var(--fog));
    border-bottom: 2px solid var(--gold);
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1.4;
    text-align: center;
}

button, input { font: inherit; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.site-header {
    min-height: 64px;
    padding: 10px clamp(18px, 4vw, 56px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    background: var(--midnight);
    color: var(--white);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    color: inherit;
    text-decoration: none;
}

.brand-mark {
    width: 38px;
    height: 38px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: var(--gold);
    font-family: Georgia, serif;
    font-size: 1.3rem;
    font-weight: 700;
}

.brand strong, .brand small { display: block; }
.brand strong { font-size: 0.98rem; letter-spacing: 0.01em; }
.brand small { color: #B8C2CC; font-size: 0.72rem; }

.header-actions { display: flex; align-items: center; gap: 8px; }
.station-search input {
    width: 86px;
    padding: 8px 10px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 9px;
    outline: none;
    background: rgba(255, 255, 255, 0.08);
    color: var(--white);
    font-weight: 750;
    letter-spacing: 0.08em;
    text-align: center;
    text-transform: uppercase;
}
.station-search input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212, 154, 58, 0.2); }
.icon-button {
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 9px;
    background: var(--sky);
    color: var(--white);
    cursor: pointer;
    font-size: 1.25rem;
}
.icon-button:disabled { cursor: progress; opacity: 0.7; }

.dashboard {
    width: min(1180px, calc(100% - 36px));
    margin: 0 auto;
    padding: 32px 0 46px;
}

.page-status, .time-basis { margin: -8px 0 18px; font-size: 0.8rem; }
.page-status { padding: 10px 12px; border-radius: 9px; }
.status-info { background: #E9F0F5; color: var(--midnight); }
.status-warning { background: #FFF4DE; color: #76500F; }
.status-error { background: #FBE9E7; color: #842E25; }
.time-basis { color: var(--ink-soft); text-align: right; }

.station-context {
    margin-bottom: 20px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
}

.eyebrow {
    margin: 0 0 4px;
    color: var(--sky);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(1.65rem, 3vw, 2.25rem); line-height: 1.15; }
h2 { margin-bottom: 0; font-size: 1.08rem; }
.muted { color: var(--ink-soft); font-weight: 480; }

.guidance-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--ink-soft);
    font-size: 0.78rem;
    white-space: nowrap;
}
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--sage); box-shadow: 0 0 0 4px rgba(104, 122, 89, 0.13); }

.card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--white);
    box-shadow: var(--shadow);
}

.hero {
    padding: clamp(24px, 4vw, 42px);
    display: grid;
    grid-template-columns: minmax(220px, 0.8fr) minmax(520px, 1.4fr);
    gap: clamp(28px, 5vw, 64px);
    background: linear-gradient(135deg, var(--midnight), #18334B);
    color: var(--white);
}

.hero .eyebrow { color: #AEC0CF; }
.condition-line { display: flex; align-items: center; gap: 14px; margin: 14px 0 8px; }
.category {
    display: inline-flex;
    min-width: 68px;
    padding: 8px 12px;
    justify-content: center;
    border-radius: 9px;
    color: var(--white);
    font-weight: 850;
    letter-spacing: 0.04em;
}
.category-vfr { background: var(--sage); }
.category-mvfr { background: var(--sky); }
.category-ifr { background: var(--ifr); }
.category-lifr { background: var(--lifr); }
.category-vlifr { background: var(--vlifr); }
.category-unknown { background: var(--ink-soft); }
.condition-summary { max-width: 180px; font-size: clamp(1.25rem, 2.3vw, 1.75rem); font-weight: 700; line-height: 1.15; }
.observation-time { margin: 0; color: #B8C2CC; font-size: 0.78rem; }

.hero-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; align-items: stretch; }
.metric {
    min-width: 0;
    padding: 17px 15px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.055);
}
.metric span, .metric strong { display: block; }
.metric-label { min-height: 30px; color: #AEC0CF; font-size: 0.71rem; font-weight: 750; text-transform: uppercase; }
.metric strong { margin: 5px 0 1px; font-size: clamp(1.2rem, 2vw, 1.55rem); }
.metric > span:last-child { color: #CFD6DD; font-size: 0.78rem; }

.next-change {
    margin: 18px 0;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    border: 1px solid rgba(212, 154, 58, 0.35);
    border-radius: 13px;
    background: #FFF9EE;
}
.next-change-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--gold); color: var(--white); font-weight: 800; }
.next-change p { margin-bottom: 0; font-size: 0.9rem; }
.next-change .eyebrow { color: #936516; font-size: 0.65rem; }
.placeholder-tag { margin-left: auto; color: #936516; font-size: 0.69rem; font-weight: 750; white-space: nowrap; }

.timeline-card { padding: 24px; }
.section-heading { margin-bottom: 22px; display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.section-tools { display: flex; align-items: flex-end; flex-direction: column; gap: 10px; }
.category-key { display: flex; flex-wrap: wrap; gap: 12px; color: var(--ink-soft); font-size: 0.68rem; font-weight: 700; }
.category-key span { display: inline-flex; align-items: center; gap: 5px; }
.category-key i { width: 8px; height: 8px; border-radius: 2px; }
.key-vfr { background: var(--vfr); } .key-mvfr { background: var(--mvfr); } .key-ifr { background: var(--ifr); } .key-lifr { background: var(--lifr); } .key-vlifr { background: var(--vlifr); }

.subhourly-card { margin: 18px 0; padding: 24px; }
.subhourly-card .section-heading { margin-bottom: 16px; }
.subhourly-meta { color: var(--ink-soft); font-size: 0.72rem; font-weight: 650; }
.subhourly-scroll { max-width: 100%; overflow-x: auto; padding-bottom: 5px; }
.subhourly-scroll:focus-visible { outline: 3px solid rgba(82, 113, 142, 0.28); outline-offset: 3px; }
.subhourly-timeline { min-width: 1530px; display: grid; grid-template-columns: repeat(24, minmax(58px, 1fr)); gap: 5px; }
.subhourly-period { min-width: 58px; text-align: center; }
.subhourly-period time { display: block; margin-bottom: 6px; color: var(--ink-soft); font-size: 0.65rem; font-weight: 700; }
.subhourly-block { height: 40px; display: grid; place-items: center; border-radius: 7px; color: var(--white); font-size: 0.64rem; font-weight: 850; }
.subhourly-block.vfr { background: var(--vfr); }
.subhourly-block.mvfr { background: var(--mvfr); }
.subhourly-block.ifr { background: var(--ifr); }
.subhourly-block.lifr { background: var(--lifr); }
.subhourly-block.vlifr { background: var(--vlifr); }
.subhourly-block.unknown { background: var(--ink-soft); }
.subhourly-note { margin: 10px 0 0; color: var(--ink-soft); font-size: 0.7rem; }

.timeline { display: grid; grid-template-columns: repeat(12, minmax(48px, 1fr)); gap: 6px; overflow-x: auto; padding-bottom: 5px; }
.timeline-hour { min-width: 48px; text-align: center; }
.timeline-hour time { display: block; margin-bottom: 7px; color: var(--ink-soft); font-size: 0.69rem; font-weight: 700; }
.timeline-block { height: 44px; display: grid; place-items: center; border-radius: 8px; color: var(--white); font-size: 0.68rem; font-weight: 850; }
.timeline-block.vfr { background: var(--vfr); } .timeline-block.mvfr { background: var(--mvfr); } .timeline-block.ifr { background: var(--ifr); } .timeline-block.lifr { background: var(--lifr); }
.timeline-block.unknown { background: var(--ink-soft); }
.empty-state { grid-column: 1 / -1; margin: 0; padding: 12px; color: var(--ink-soft); text-align: center; }
.guidance-link { color: var(--sky); font-size: 0.78rem; font-weight: 800; text-decoration: none; }
.guidance-link:hover, .guidance-link:focus-visible { text-decoration: underline; }

.forecast-grid { margin: 18px 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.forecast-card { padding: 23px; display: flex; gap: 15px; box-shadow: 0 8px 24px rgba(13, 27, 42, 0.055); }
.card-icon { flex: 0 0 auto; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; color: var(--white); font-size: 1.1rem; font-weight: 800; }
.icon-sky { background: var(--sky); } .icon-sage { background: var(--sage); } .icon-gold { background: var(--gold); }
.forecast-card-copy { flex: 1; min-width: 0; }
.card-lead { margin: 11px 0 17px; color: var(--midnight); font-size: 0.92rem; font-weight: 720; }
.compact-values { margin: 0; }
.compact-values div { padding: 8px 0; display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); font-size: 0.75rem; }
.compact-values dt { color: var(--ink-soft); }
.compact-values dd { margin: 0; font-weight: 760; text-align: right; }

.full-guidance { margin-top: 18px; padding: 24px; scroll-margin-top: 18px; }
.full-guidance-heading { margin-bottom: 18px; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.full-guidance-heading p:last-child { margin: 0; color: var(--ink-soft); font-size: 0.75rem; text-align: right; }
.guidance-table-wrap { max-width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--white); }
.guidance-table-wrap:focus-visible { outline: 3px solid rgba(82, 113, 142, 0.28); outline-offset: 3px; }
.guidance-table { width: max-content; min-width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.72rem; }
.guidance-table th, .guidance-table td { min-width: 92px; padding: 10px 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: center; white-space: nowrap; }
.guidance-table thead th { background: #E9EEF3; color: var(--midnight); font-weight: 800; }
.guidance-table thead th:first-child, .guidance-table tbody th { position: sticky; left: 0; z-index: 2; min-width: 150px; text-align: left; }
.guidance-table thead th:first-child { z-index: 3; background: #E9EEF3; }
.guidance-table tbody th { background: var(--white); color: var(--midnight); }
.guidance-table tr:last-child th, .guidance-table tr:last-child td { border-bottom: 0; }
.guidance-table th:last-child, .guidance-table td:last-child { border-right: 0; }
.guidance-date, .guidance-table time { display: block; }
.guidance-date { color: var(--ink-soft); font-size: 0.62rem; font-weight: 650; }
.guidance-table time { margin-top: 2px; }
.category-cell { color: var(--white); font-weight: 850; }
.category-cell.vfr { background: var(--vfr); }
.category-cell.mvfr { background: var(--mvfr); }
.category-cell.ifr { background: var(--ifr); }
.category-cell.lifr { background: var(--lifr); }
.category-cell.vlifr { background: var(--vlifr); }

footer {
    padding: 22px 18px 28px;
    display: flex;
    justify-content: center;
    gap: 20px;
    color: var(--ink-soft);
    font-size: 0.72rem;
}
footer p { margin: 0; }
footer a { color: var(--sky); font-weight: 750; }

@media (max-width: 900px) {
    .hero { grid-template-columns: 1fr; }
    .forecast-grid { grid-template-columns: 1fr 1fr; }
    .forecast-card:last-child { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
    .site-header { min-height: 58px; padding-inline: 14px; }
    .brand small { display: none; }
    .dashboard { width: min(100% - 24px, 1180px); padding-top: 22px; }
    .station-context { align-items: flex-start; flex-direction: column; gap: 10px; }
    .guidance-meta { white-space: normal; }
    .hero { padding: 22px; gap: 24px; }
    .hero-metrics { grid-template-columns: 1fr 1fr; }
    .next-change { align-items: flex-start; }
    .placeholder-tag { display: none; }
    .section-heading { align-items: flex-start; flex-direction: column; }
    .section-tools { align-items: flex-start; }
    .subhourly-card { padding: 20px 16px; }
    .timeline-card { padding: 20px 16px; }
    .forecast-grid { grid-template-columns: 1fr; }
    .forecast-card:last-child { grid-column: auto; }
    .full-guidance { padding: 20px 16px; }
    .full-guidance-heading { align-items: flex-start; flex-direction: column; gap: 6px; }
    .full-guidance-heading p:last-child { text-align: left; }
    footer { align-items: center; flex-direction: column; gap: 7px; text-align: center; }
}
