:root {
    --ink: #082a4b;
    --blue: #0f568c;
    --teal: #117f7a;
    --paper: #ffffff;
    --mist: #eaf1f7;
    --line: #cad9e6;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: "Trebuchet MS", Verdana, sans-serif; background: radial-gradient(circle at 10% 0%, #f7fbff 0, #eaf1f7 42%, #e3edf5 100%); color: var(--ink); }
a { color: #075a93; }
.page { max-width: 1420px; margin: 0 auto; padding: 18px; }
.site-header { display: grid; grid-template-columns: minmax(0, 1fr) 235px minmax(270px, 1fr); gap: 24px; align-items: center; background: linear-gradient(120deg, #0f568c 0%, #147083 56%, #117f7a 100%); color: #fff; border-radius: 0 0 18px 18px; padding: 20px 22px; box-shadow: 0 12px 30px rgba(8, 42, 75, 0.14); }
.brand-block h1 { margin: 3px 0 5px; font-size: 30px; line-height: 1.06; }
.brand-block p { margin: 0; max-width: 720px; font: 14px/1.45 Arial, sans-serif; }
.site-kicker { color: #fff; font-size: 12px; font-weight: bold; letter-spacing: .12em; text-decoration: none; text-transform: uppercase; }
.blacknight-logo { display: flex; justify-content: center; }
.blacknight-logo img { display: block; max-width: 220px; max-height: 82px; object-fit: contain; }
.header-side { text-align: right; }
.partner-credit { font: 14px/1.45 Arial, sans-serif; }
.partner-credit a, .top-links a { color: #fff; font-weight: bold; }
.top-links { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.top-links a { border: 1px solid rgba(255,255,255,.34); border-radius: 999px; padding: 7px 11px; font: bold 13px Arial, sans-serif; text-decoration: none; background: rgba(255,255,255,.1); }
.info-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.info-card { background: rgba(255,255,255,.96); border: 1px solid rgba(202,217,230,.9); border-radius: 15px; padding: 13px 15px; box-shadow: 0 6px 16px rgba(8,42,75,.05); }
.info-card .label { color: #496782; font: 11px Arial, sans-serif; letter-spacing: .08em; text-transform: uppercase; }
.info-card .value { margin-top: 5px; color: #061f38; font-size: 19px; font-weight: bold; }
.time-zone { color: #587188; font-size: 11px; font-weight: normal; }
.forecast-card { max-width: 1120px; margin: 13px auto 0; background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: 14px; box-shadow: 0 10px 24px rgba(8,42,75,.07); }
.layer-switch { display: flex; width: max-content; max-width: 100%; flex-wrap: wrap; justify-content: center; gap: 4px; margin: 0 auto 12px; padding: 4px; border-radius: 18px; background: #e3edf4; }
.layer-switch button { border: 0; border-radius: 999px; padding: 9px 22px; background: transparent; color: #123f62; font-weight: bold; cursor: pointer; }
.layer-switch button.active { background: var(--blue); color: #fff; box-shadow: 0 3px 9px rgba(15,86,140,.2); }
.forecast-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 12px; }
.control-group { display: flex; gap: 8px; }
.control-group button, .timeline-play { min-width: 88px; border: 0; border-radius: 999px; padding: 10px 15px; background: var(--blue); color: #fff; font-weight: bold; cursor: pointer; }
.control-group button:hover, .control-group button:focus-visible, .timeline-play:hover, .timeline-play:focus-visible { background: #0b416b; }
.control-group button.secondary { background: #dbe9f2; color: #0b416b; }
.control-group button.secondary:hover, .control-group button.secondary:focus-visible { background: #c5dbe9; }
.valid-time { display: flex; align-items: baseline; justify-content: flex-end; flex-wrap: wrap; gap: 7px; text-align: right; }
.valid-label { color: #587188; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.valid-time strong { font-size: 20px; }
.lead-time { border-radius: 999px; padding: 5px 9px; background: #e5f3f1; color: #0b6a66; font-size: 12px; font-weight: bold; }
.map-wrap { position: relative; }
.forecast-lightning-status { margin: 0 0 5px; font-size: 10px; }
.forecast-legend.solar .legend-gradient { background: linear-gradient(90deg, #39496b, #378b99, #e4be41, #f6882b, #a83120); }
.forecast-legend.snow .legend-gradient { background: linear-gradient(90deg, #bbe7f6, #69b1e5, #4779db, #6044c0, #591a7d); }
.forecast-legend.precip-type .legend-gradient { display: none; }
.forecast-legend.precip-type .legend-values { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px 5px; }
.forecast-legend.precip-type .legend-values i { display: inline-block; width: 8px; height: 8px; margin-right: 3px; border-radius: 2px; vertical-align: middle; }
.control-group button:disabled { opacity: .45; cursor: default; }
.forecast-legend.lightning .legend-gradient { background: linear-gradient(90deg, #fff09c, #f8b93d 25%, #ec6c1e 50%, #d33246 75%, #841d5f); }
.forecast-run-badge { position: absolute; z-index: 500; top: 10px; right: 10px; border-radius: 7px; padding: 6px 8px; background: rgba(255,255,255,.94); color: var(--ink); font: bold 11px Arial, sans-serif; box-shadow: 0 2px 8px rgba(8,42,75,.16); pointer-events: none; }
#forecastMap { height: 72vh; min-height: 610px; max-height: 780px; border: 1px solid #b9cddd; border-radius: 14px; background: #acd5df; overflow: hidden; }
.forecast-values-canvas { position: absolute; pointer-events: none; }
.forecast-legend { position: absolute; z-index: 500; left: 12px; bottom: 12px; width: min(220px, calc(100% - 24px)); border: 1px solid rgba(255,255,255,.9); border-radius: 9px; padding: 6px 8px 5px; background: rgba(255,255,255,.92); box-shadow: 0 4px 14px rgba(8,42,75,.16); font: 8px Arial, sans-serif; }
.forecast-legend strong { display: block; margin-bottom: 4px; font-size: 11px; }
.legend-gradient { height: 9px; border-radius: 3px; background: linear-gradient(90deg, #5b2d91 0%, #755bbe 12.5%, #8a93dc 25%, #55c8da 37.5%, #96e1d2 50%, #ecde5c 62.5%, #f89529 75%, #dc3c31 87.5%, #9f246e 100%); }
.forecast-legend.rainfall .legend-gradient { background: linear-gradient(90deg, #c4eeff 0%, #85d6ff 12.5%, #44b0f4 25%, #1e77d6 37.5%, #21aa80 50%, #7ec440 62.5%, #f5d334 75%, #f57e23 87.5%, #be256f 100%); }
.forecast-legend.wind .legend-gradient { background: linear-gradient(90deg, #e0f4f8 0%, #97dde5 14%, #48b7d3 28%, #2a83ba 42%, #35b579 56%, #f2d041 70%, #f1842f 82%, #d3373c 91%, #7e2678 100%); }
.forecast-legend.cloud .legend-gradient { border: 1px solid #bdc7ce; background: linear-gradient(90deg, rgba(255,255,255,.2), #eef0f1 25%, #d5d8da 50%, #bfc3c6 75%, #94999d 100%); }
.forecast-legend.visibility .legend-gradient { background: linear-gradient(90deg, #b0182b 0%, #e84a27 17%, #f5912c 33%, #f5d345 50%, #67be79 68%, #46accd 84%, #b1dce8 100%); }
.forecast-legend.direction { width: auto; min-width: 148px; }
.forecast-legend.direction .legend-gradient, .forecast-legend.direction .legend-values { display: none; }
.legend-values { display: flex; justify-content: space-between; margin-top: 2px; color: #334e67; }
.timeline-wrap { padding: 12px 3px 0; }
.timeline-controls { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 2px 12px; }
.timeline-play { min-width: 72px; min-height: 44px; }
#forecastTimeline { width: 100%; min-width: 0; margin: 0; accent-color: var(--blue); }
.timeline-ends { grid-column: 2; display: flex; justify-content: space-between; gap: 12px; color: #587188; font: 11px Arial, sans-serif; }
.model-note { margin: 11px 2px 0; color: #4d667c; font: 12px/1.5 Arial, sans-serif; }
.notice { margin-top: 18px; border: 1px solid #e9cf77; border-radius: 14px; padding: 14px; background: #fff8db; color: #715500; }
.site-footer { margin: 18px 0 4px; text-align: center; color: #526c83; font: 12px/1.55 Arial, sans-serif; }

@media (max-width: 880px) {
    .page { padding: 7px; }
    .site-header { grid-template-columns: 1fr; gap: 8px; padding: 13px; border-radius: 0 0 14px 14px; }
    .brand-block h1 { font-size: 22px; }
    .brand-block p { font-size: 12px; }
    .blacknight-logo { display: none; }
    .header-side { text-align: left; }
    .partner-credit { display: none; }
    .top-links { justify-content: flex-start; margin-top: 3px; }
    .top-links a { padding: 6px 9px; font-size: 11px; }
    .info-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-top: 8px; }
    .info-card { padding: 9px 10px; border-radius: 11px; }
    .info-card .value { font-size: 15px; }
    .forecast-card { margin-top: 8px; padding: 7px; border-radius: 13px; }
    .forecast-toolbar { align-items: stretch; flex-direction: column-reverse; gap: 8px; }
    .valid-time { justify-content: flex-start; text-align: left; }
    .valid-time strong { font-size: 17px; }
    .control-group { flex-wrap: wrap; }
    .control-group button { flex: 1 1 calc(25% - 8px); min-width: 72px; padding: 9px 7px; }
    #forecastMap { height: 61vh; min-height: 430px; border-radius: 10px; }
    .layer-switch { margin-bottom: 8px; }
    .layer-switch button { flex: 1 1 calc(50% - 4px); padding: 8px 10px; }
    .forecast-legend { left: 7px; bottom: 7px; width: min(210px, calc(100% - 14px)); padding: 5px 6px; }
}
