: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, .scenario-field select:focus-visible, .demo-actions button:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 35%, transparent); outline-offset: 2px; }
.refresh-button:disabled { opacity: .55; cursor: wait; }

.demo-bar { position: sticky; top: 0; z-index: 30; border-bottom: 3px solid #f3b63f; background: #10283a; color: #fff; box-shadow: 0 4px 14px rgba(15,35,51,.2); }
.demo-bar-inner { width: min(1480px, 100%); margin: 0 auto; padding: 10px 24px; display: grid; grid-template-columns: auto minmax(260px, 390px) auto minmax(280px, 1fr); align-items: center; gap: 14px; }
.demo-identity { display: flex; align-items: center; gap: 9px; white-space: nowrap; }
.demo-identity > div { display: grid; gap: 1px; }
.demo-identity strong { font-size: .82rem; }
.demo-identity div span { color: #bed0dc; font-size: .69rem; }
.demo-badge { display: inline-flex; border-radius: 999px; padding: 5px 8px; background: #f3b63f; color: #352400; font-size: .62rem; font-weight: 950; letter-spacing: .1em; text-transform: uppercase; }
.scenario-field { display: grid; gap: 3px; color: #bed0dc; font-size: .62rem; font-weight: 850; letter-spacing: .09em; text-transform: uppercase; }
.scenario-field select { width: 100%; border: 1px solid #587185; border-radius: 8px; background: #fff; color: var(--ink); padding: 8px 32px 8px 10px; font: inherit; font-size: .78rem; font-weight: 760; letter-spacing: 0; text-transform: none; cursor: pointer; }
.demo-actions { display: flex; gap: 6px; }
.demo-actions button { border: 1px solid #60798b; border-radius: 8px; background: transparent; color: #fff; padding: 8px 10px; font-size: .72rem; font-weight: 800; cursor: pointer; }
.demo-actions button:hover { border-color: #f3b63f; color: #ffd985; }
.demo-context { min-width: 0; display: grid; gap: 2px; border-left: 1px solid #40586a; padding-left: 14px; color: #d4e0e7; font-size: .7rem; line-height: 1.35; }
.demo-context span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.demo-context b { color: #fff; }

.status-hero { position: relative; overflow: hidden; background: var(--status-color, #16835c); color: #fff; border-radius: 20px; padding: 28px 34px; box-shadow: 0 12px 28px rgba(17,37,57,.14); }
.status-hero.is-red, .status-hero.is-purple { padding: clamp(32px, 4vw, 48px); }
.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: 7px 0 6px; font-size: clamp(1.7rem, 3.4vw, 2.65rem); line-height: 1; max-width: 1000px; letter-spacing: -.045em; }
.status-hero.is-red .status-title, .status-hero.is-purple .status-title { font-size: clamp(2rem, 4.6vw, 3.55rem); }
.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; }

.alert-clear-strip { margin-top: 14px; display: flex; align-items: center; gap: 8px; min-height: 42px; border: 1px solid #cae3d8; border-radius: 11px; background: #f7fbf9; color: #146346; padding: 9px 13px; font-size: .79rem; }
.alert-clear-strip > span { width: 9px; height: 9px; flex: 0 0 9px; border-radius: 50%; background: #16835c; }
.alert-clear-strip small { color: var(--muted); font-size: .74rem; }
.alert-summary { margin-top: 14px; border: 1px solid color-mix(in srgb, #c9363b 30%, var(--line)); border-left: 6px solid #c9363b; border-radius: 16px; background: #fff; padding: 17px 19px; box-shadow: 0 5px 16px rgba(20,41,61,.06); }
.alert-summary-warning { border-left-color: #b97c05; background: #fffaf0; }
.alert-summary-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.alert-summary-label { color: #a5242b; font-size: .68rem; font-weight: 900; letter-spacing: .11em; text-transform: uppercase; }
.alert-summary h2 { margin: 3px 0 0; font-size: 1.08rem; }
.alert-summary p { margin: 6px 0 0; color: var(--muted); font-size: .79rem; line-height: 1.48; }
.alert-count { min-width: 30px; height: 30px; border-radius: 999px; display: grid; place-items: center; background: #fbe9ea; color: #a5242b; font-size: .77rem; font-weight: 900; }
.alert-summary-list { display: grid; gap: 8px; margin-top: 12px; }
.alert-summary .alert-card { background: #f8fafb; border-radius: 9px; padding: 10px 12px; }
.alert-summary .alert-card + .alert-card { margin-top: 0; border-top: 0; }

.current-section { margin-top: 24px; }
.current-summary { display: none; }

.planning-section { margin-top: 28px; border-top: 1px solid var(--line); padding-top: 23px; }
.today-planning { margin-top: 18px; border-top: 0; padding-top: 0; }
.week-planning { margin-top: 28px; }
.planning-heading { align-items: flex-start; }
.planning-heading > span { max-width: 350px; text-align: right; line-height: 1.4; }
.planning-stack { display: grid; gap: 14px; }
.planning-stack[hidden] { display: none; }
.planning-gate { display: flex; align-items: center; justify-content: space-between; gap: 20px; border: 1px solid #d7dde3; border-radius: 15px; background: #f8fafb; padding: 16px 18px; }
.planning-gate > div { display: grid; gap: 3px; }
.planning-gate span { color: #7046a1; font-size: .66rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.planning-gate strong { font-size: .94rem; }
.planning-gate p { margin: 0; color: var(--muted); font-size: .76rem; line-height: 1.4; }
.planning-gate button { flex: 0 0 auto; border: 1px solid #bdc8d1; border-radius: 9px; background: #fff; color: var(--brand); padding: 9px 12px; font-size: .75rem; font-weight: 850; cursor: pointer; }
.planning-gate button:focus-visible, .current-summary:focus-visible, .support-details summary:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 35%, transparent); outline-offset: 2px; }

.forecast-panel { --forecast-color: #16835c; background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--forecast-color); border-radius: 16px; padding: 20px; box-shadow: 0 4px 14px rgba(20,41,61,.05); }
.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, .planning-label { flex: 0 0 auto; color: var(--ink); background: #edf1f4; border-radius: 999px; padding: 6px 10px; font-size: .68rem; font-weight: 850; }
.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 { justify-content: flex-end; margin-top: 13px; color: var(--muted); font-size: .7rem; }
.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; }

.week-panel { --week-color: #16835c; background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--week-color); border-radius: 16px; padding: 20px; box-shadow: 0 4px 14px rgba(20,41,61,.05); }
.week-header, .week-intro, .week-footer, .week-compact { display: flex; justify-content: space-between; gap: 18px; }
.week-header { align-items: flex-start; }
.week-header h2, .week-compact h2 { margin: 2px 0 0; font-size: 1.15rem; }
.week-kicker { color: var(--week-color); font-size: .68rem; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.week-chip { flex: 0 0 auto; color: var(--ink); background: #edf1f4; border-radius: 999px; padding: 6px 10px; font-size: .68rem; font-weight: 850; }
.week-intro { align-items: end; margin: 17px 0 14px; }
.week-intro h3 { margin: 0 0 4px; font-size: 1rem; }
.week-intro p, .week-compact p { margin: 0; color: var(--muted); font-size: .75rem; line-height: 1.45; }
.week-intro > strong { flex: 0 0 auto; color: var(--muted); font-size: .72rem; }
.week-days { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 9px; }
.week-day { min-width: 0; border-top: 4px solid var(--day-color); border-radius: 11px; padding: 10px; background: #f3f6f8; }
.week-day.is-flagged { background: color-mix(in srgb, var(--day-color) 8%, white); }
.week-day-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; }
.week-day-heading div { display: grid; gap: 1px; }
.week-day-heading span { color: var(--muted); font-size: .6rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.week-day-heading strong { font-size: .78rem; }
.week-day-heading b { max-width: 130px; color: var(--day-color); font-size: .62rem; line-height: 1.25; text-align: right; }
.week-day > p { margin: 14px 0 0; color: var(--muted); font-size: .68rem; line-height: 1.35; }
.week-concerns { display: grid; gap: 9px; margin-top: 13px; }
.week-concern { display: grid; gap: 3px; }
.week-concern + .week-concern { border-top: 1px solid color-mix(in srgb, var(--day-color) 16%, white); padding-top: 8px; }
.week-concern strong { font-size: .72rem; line-height: 1.3; }
.week-concern span, .week-day small { color: var(--muted); font-size: .6rem; line-height: 1.35; }
.week-day small { display: block; margin-top: 9px; font-weight: 750; }
.week-clear-summary { display: flex; align-items: center; gap: 8px; margin-top: 11px; color: #146346; background: #f4faf7; border-radius: 9px; padding: 9px 11px; font-size: .73rem; }
.week-clear-summary span { width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: #16835c; }
.week-confidence { display: flex; gap: 12px; align-items: baseline; margin-top: 14px; border-radius: 10px; padding: 10px 12px; background: #f3f6f8; font-size: .7rem; }
.week-confidence strong { flex: 0 0 auto; color: var(--week-color); }
.week-confidence span { color: var(--muted); line-height: 1.4; }
.week-footer { justify-content: flex-end; margin-top: 11px; color: var(--muted); font-size: .68rem; }
.week-footer span:first-child { font-weight: 800; }
.week-compact { align-items: center; padding-top: 16px; padding-bottom: 16px; }
.week-compact-copy { min-width: 0; }
.week-compact-meta { flex: 0 0 auto; display: grid; justify-items: end; gap: 3px; color: var(--muted); font-size: .66rem; }
.week-compact-meta strong { color: var(--ink); font-size: .72rem; }

.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(3, 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; }

.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; }
.support-details { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 25px; }
.support-details details { border: 1px solid var(--line); border-radius: 12px; background: #f8fafb; overflow: hidden; }
.support-details summary { display: grid; gap: 2px; padding: 13px 15px; cursor: pointer; list-style-position: inside; }
.support-details summary span { font-size: .79rem; font-weight: 820; }
.support-details summary small { margin-left: 18px; color: var(--muted); font-size: .69rem; }
.support-details .source-list, .support-details details > p { margin: 0; border-top: 1px solid var(--line); padding: 14px 16px; }
.support-details details > p { color: var(--muted); font-size: .74rem; line-height: 1.52; }
.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 (max-width: 1100px) { .zone-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 980px) { .demo-bar-inner { grid-template-columns: auto minmax(220px, 1fr) auto; } .demo-context { grid-column: 1 / -1; border-left: 0; border-top: 1px solid #40586a; padding: 6px 0 0; } }
@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; }
  .demo-bar { position: relative; }
  .demo-bar-inner { padding: 9px 12px; grid-template-columns: 1fr auto; gap: 8px; }
  .demo-identity { grid-column: 1 / -1; }
  .scenario-field { min-width: 0; }
  .demo-context { display: none; }
  .zone-grid { grid-template-columns: 1fr; }
  .zone-grid.is-mobile-collapsed { display: none; }
  .current-summary { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 14px; border: 1px solid var(--line); border-radius: 13px; background: #fff; color: var(--ink); padding: 13px 14px; text-align: left; cursor: pointer; box-shadow: 0 3px 10px rgba(20,41,61,.04); }
  .current-summary > span { min-width: 0; display: grid; gap: 3px; }
  .current-summary strong { font-size: .78rem; }
  .current-summary small { color: var(--muted); font-size: .69rem; line-height: 1.35; }
  .current-summary b { flex: 0 0 auto; color: var(--brand); font-size: .7rem; }
  .current-summary + .zone-grid { margin-top: 10px; }
  .status-hero { border-radius: 16px; }
  .status-hero, .status-hero.is-red, .status-hero.is-purple { padding: 24px 21px; }
  .alert-clear-strip { flex-wrap: wrap; }
  .alert-clear-strip small { width: 100%; margin-left: 17px; }
  .planning-heading { display: block; }
  .planning-heading > span { display: block; margin-top: 5px; text-align: left; }
  .planning-gate { flex-direction: column; align-items: stretch; }
  .planning-gate button { width: 100%; }
  .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; }
  .week-panel { padding: 17px; border-radius: 15px; }
  .week-days { grid-template-columns: 1fr; }
  .week-intro, .week-footer, .week-compact, .week-confidence { flex-direction: column; align-items: flex-start; }
  .week-compact-meta { flex-basis: auto; justify-items: start; }
  .support-details { grid-template-columns: 1fr; }
  .temperature { font-size: 3.1rem; }
  .footer { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; animation-duration: .01ms !important; } }
