:root {
  --brand: #173a5e;
  --accent: #2f78a8;
  --ink: #172331;
  --muted: #667485;
  --surface: #fff;
  --canvas: #eef2f5;
  --line: #d9e1e7;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--canvas); }
button { font: inherit; }
.app-shell { min-height: 100vh; }
.page { width: min(1480px, 100%); margin: 0 auto; padding: 24px; }
.masthead { display: flex; justify-content: space-between; gap: 24px; align-items: center; padding: 2px 2px 20px; }
.brand { display: flex; align-items: center; gap: 13px; min-width: 0; }
.brand-mark { width: 46px; height: 46px; flex: 0 0 46px; border-radius: 13px; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: .78rem; font-weight: 900; letter-spacing: -.03em; }
.product-name, .section-label, .zone-label { color: var(--muted); font-size: .68rem; font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }
h1 { margin: 2px 0 0; font-size: clamp(1.08rem, 2.2vw, 1.55rem); letter-spacing: -.025em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.masthead-actions { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .82rem; white-space: nowrap; }
.refresh-button { border: 1px solid var(--line); background: #fff; color: var(--brand); border-radius: 10px; padding: 9px 13px; cursor: pointer; font-weight: 800; }
.refresh-button:hover { border-color: #aab7c3; }
.refresh-button:focus-visible, .schools-toggle:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 35%, transparent); outline-offset: 2px; }
.refresh-button:disabled { opacity: .55; cursor: wait; }

.status-hero { position: relative; overflow: hidden; background: var(--status-color, #16835c); color: #fff; border-radius: 20px; padding: clamp(25px, 4vw, 44px); box-shadow: 0 12px 28px rgba(17,37,57,.14); }
.status-hero::after { content: ''; position: absolute; width: 380px; height: 380px; border-radius: 50%; right: -145px; top: -220px; background: rgba(255,255,255,.10); }
.status-kicker { font-size: .72rem; font-weight: 850; letter-spacing: .15em; text-transform: uppercase; opacity: .86; }
.status-title { position: relative; z-index: 1; margin: 9px 0 7px; font-size: clamp(1.8rem, 4.6vw, 3.55rem); line-height: .98; max-width: 1000px; letter-spacing: -.045em; }
.status-detail { position: relative; z-index: 1; max-width: 850px; margin: 0; font-size: clamp(.94rem, 1.6vw, 1.12rem); line-height: 1.5; opacity: .94; }
.affected { position: relative; z-index: 1; display: inline-flex; margin-top: 18px; padding: 7px 11px; border-radius: 999px; background: rgba(255,255,255,.16); font-size: .76rem; font-weight: 780; }

.quality-ok, .quality-warning { margin: 14px 0 0; border-radius: 10px; padding: 11px 13px; font-size: .78rem; line-height: 1.45; }
.quality-ok { display: flex; align-items: center; gap: 8px; background: #e6f3ed; color: #146346; }
.quality-ok span { width: 8px; height: 8px; border-radius: 50%; background: #16835c; }
.quality-warning { background: #fff1cb; color: #6e4b05; }

.forecast-panel { --forecast-color: #16835c; margin-top: 20px; background: var(--surface); border: 1px solid var(--line); border-top: 6px solid var(--forecast-color); border-radius: 18px; padding: 22px; box-shadow: 0 5px 16px rgba(20,41,61,.06); }
.forecast-header, .forecast-summary, .forecast-footer, .forecast-compact { display: flex; justify-content: space-between; gap: 18px; }
.forecast-header { align-items: flex-start; }
.forecast-header h2, .forecast-compact h2 { margin: 2px 0 0; font-size: 1.15rem; }
.forecast-kicker, .forecast-window { color: var(--forecast-color); font-size: .68rem; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.forecast-chip { flex: 0 0 auto; color: var(--forecast-color); background: color-mix(in srgb, var(--forecast-color) 10%, white); border-radius: 999px; padding: 6px 10px; font-size: .66rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.forecast-summary { align-items: flex-end; margin: 20px 0 16px; }
.forecast-summary h3 { margin: 6px 0 4px; font-size: clamp(1.15rem, 2vw, 1.45rem); }
.forecast-summary p, .forecast-compact p { margin: 0; color: var(--muted); font-size: .78rem; line-height: 1.45; }
.forecast-peak { flex: 0 0 auto; text-align: right; }
.forecast-peak strong { display: block; font-size: 2.5rem; line-height: .9; letter-spacing: -.06em; }
.forecast-peak span { color: var(--muted); font-size: .66rem; }
.forecast-timeline { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-bottom: 15px; }
.forecast-hour { background: #f3f6f8; border-radius: 10px; padding: 9px 7px; text-align: center; }
.forecast-hour.is-flagged { background: color-mix(in srgb, var(--forecast-color) 10%, white); }
.forecast-hour span { display: block; color: var(--muted); font-size: .65rem; }
.forecast-hour strong { display: block; margin-top: 3px; font-size: .92rem; }
.forecast-guidance { display: flex; gap: 12px; align-items: baseline; color: var(--forecast-color); background: color-mix(in srgb, var(--forecast-color) 8%, white); border-radius: 11px; padding: 11px 13px; font-size: .78rem; }
.forecast-guidance strong { flex: 0 0 auto; }
.forecast-guidance span { color: var(--ink); line-height: 1.45; }
.forecast-footer { margin-top: 13px; color: var(--muted); font-size: .66rem; }
.forecast-footer span:first-child, .forecast-current-note { color: var(--muted); font-weight: 800; }
.forecast-compact { align-items: center; padding-top: 17px; padding-bottom: 17px; }
.forecast-compact-copy { min-width: 0; }
.forecast-current-note { flex: 0 0 auto; font-size: .7rem; }

.content-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; margin-top: 22px; align-items: start; }
.section-heading { display: flex; justify-content: space-between; align-items: end; margin: 0 2px 12px; }
.section-heading h2 { margin: 2px 0 0; font-size: 1.02rem; }
.section-heading > span { color: var(--muted); font-size: .76rem; }
.zone-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.zone-card { --card-color: #16835c; background: var(--surface); border: 1px solid var(--line); border-top: 5px solid var(--card-color); border-radius: 16px; padding: 18px; box-shadow: 0 4px 14px rgba(20,41,61,.055); }
.zone-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.zone-top h3 { margin: 2px 0 0; font-size: 1.05rem; }
.level-chip { color: var(--card-color); background: #f1f4f6; border-radius: 999px; padding: 5px 8px; font-size: .64rem; font-weight: 900; letter-spacing: .08em; }
.conditions { display: flex; gap: 18px; align-items: center; margin: 19px 0 16px; }
.temperature { font-size: 3.45rem; line-height: .8; font-weight: 790; letter-spacing: -.08em; }
.temperature sup { font-size: .46em; vertical-align: top; }
.condition-copy { display: grid; gap: 2px; color: var(--muted); font-size: .75rem; line-height: 1.35; }
.condition-copy strong { color: var(--ink); font-size: .9rem; }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.metric { background: #f3f6f8; border-radius: 10px; padding: 9px; min-height: 61px; }
.metric-label { display: block; color: var(--muted); font-size: .6rem; font-weight: 800; letter-spacing: .065em; text-transform: uppercase; }
.metric-value { display: block; margin-top: 4px; font-size: .8rem; font-weight: 760; line-height: 1.25; }
.trigger { display: flex; align-items: center; gap: 9px; min-height: 45px; border-radius: 10px; padding: 10px 11px; color: var(--card-color); background: #f3f6f8; }
.trigger-dot { width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: var(--card-color); }
.trigger div { display: grid; gap: 1px; font-size: .76rem; }
.trigger strong { font-size: .8rem; }
.schools-toggle { width: 100%; margin-top: 12px; padding: 0; border: 0; background: transparent; color: var(--muted); font-size: .7rem; text-align: left; cursor: pointer; }
.schools { margin: 8px 0 0; padding: 10px 0 0 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: .71rem; line-height: 1.55; }
.schools[hidden] { display: none; }

.side-panel { display: grid; gap: 14px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
.panel-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.panel h2 { margin: 0; font-size: .92rem; }
.panel-heading span { color: var(--muted); font-size: .64rem; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.alert-card { border-left: 4px solid var(--alert-color); padding: 9px 0 9px 12px; }
.alert-card + .alert-card { margin-top: 8px; border-top: 1px solid var(--line); }
.alert-event { font-size: .82rem; font-weight: 820; }
.alert-meta, .alert-headline { margin-top: 3px; color: var(--muted); font-size: .68rem; line-height: 1.45; }
.empty-state, .warning-state, .source-list, .disclaimer-panel p { color: var(--muted); font-size: .74rem; line-height: 1.52; }
.warning-state { color: #76520b; background: #fff3d5; padding: 10px; border-radius: 9px; }
.source-list { display: grid; gap: 10px; }
.source-list strong { color: var(--ink); }
.disclaimer-panel { background: #f8fafb; }
.disclaimer-panel p { margin: 9px 0 0; }
.footer { display: flex; justify-content: space-between; gap: 16px; padding: 19px 2px 5px; color: var(--muted); font-size: .67rem; }
.footer a { color: inherit; font-weight: 800; text-decoration: none; }
.footer a:hover { text-decoration: underline; }

.loading-screen, .error-screen { min-height: 100vh; display: grid; place-content: center; text-align: center; padding: 30px; color: var(--muted); }
.loading-mark { display: flex; justify-content: center; gap: 5px; }
.loading-mark span { width: 8px; height: 8px; background: var(--brand); border-radius: 50%; animation: pulse 1s infinite alternate; }
.loading-mark span:nth-child(2) { animation-delay: .2s; }
.loading-mark span:nth-child(3) { animation-delay: .4s; }
.error-card { max-width: 460px; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 28px; }
.error-card .brand-mark { margin: 0 auto 18px; }
.error-card h1 { white-space: normal; }
@keyframes pulse { to { opacity: .25; transform: translateY(-5px); } }

@media (min-width: 1280px) { .zone-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 920px) { .content-grid { grid-template-columns: 1fr; } .side-panel { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 720px) { .side-panel { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .page { padding: 12px; }
  .masthead { display: block; }
  .masthead h1 { white-space: normal; }
  .masthead-actions { margin-top: 12px; justify-content: space-between; font-size: .72rem; }
  .zone-grid { grid-template-columns: 1fr; }
  .status-hero { border-radius: 16px; }
  .forecast-panel { padding: 17px; border-radius: 15px; }
  .forecast-summary { align-items: flex-start; }
  .forecast-peak strong { font-size: 2rem; }
  .forecast-timeline { gap: 4px; }
  .forecast-hour { padding: 8px 2px; }
  .forecast-hour strong { font-size: .78rem; }
  .forecast-guidance, .forecast-footer, .forecast-compact { flex-direction: column; }
  .forecast-current-note { flex-basis: auto; }
  .temperature { font-size: 3.1rem; }
  .footer { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; animation-duration: .01ms !important; } }
