:root {
  color-scheme: light;
  --ink: #14243a;
  --muted: #718096;
  --line: #e9eef5;
  --blue: #236be8;
  --blue-dark: #1659ce;
  --sky: #edf5ff;
  --canvas: #f5f8fc;
  --green: #23a878;
  --amber: #d88916;
  --red: #e2635d;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); }
button, input, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.topbar {
  height: 70px;
  padding: 0 max(24px, calc((100vw - 1080px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255,255,255,.86);
  border-bottom: 1px solid #edf1f6;
}
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; font: 800 20px ui-sans-serif, system-ui, sans-serif; letter-spacing: -1px; }
.brand-mark { width: 31px; height: 31px; display: grid; place-items: center; color: white; border-radius: 10px; background: var(--blue); }
.brand-mark svg { width: 25px; height: 25px; }
.header-right { display: flex; align-items: center; gap: 12px; }
.last-checked { color: #718096; font-size: 10px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.icon-button { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 11px; color: #65758b; background: white; }
.icon-button svg { width: 18px; height: 18px; }
.icon-button:hover { color: var(--blue); border-color: #b8d2ff; }
.icon-button:disabled { cursor: wait; opacity: .6; }
.icon-button.is-spinning svg { animation: spin .8s linear infinite; }
.alerts-toggle.has-alerts { color: var(--blue); border-color: #c8dcfb; background: #f2f7ff; }
@keyframes spin { to { transform: rotate(360deg); } }

.page-shell { width: min(100% - 48px, 900px); margin: 0 auto; padding: 24px 0 36px; }
.intro { margin: 0 0 28px 5px; }
.eyebrow { margin: 0 0 7px; color: #7c8ba0; font: 700 9px ui-sans-serif, system-ui, sans-serif; letter-spacing: 1.25px; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 9px; font: 800 clamp(31px, 5vw, 43px)/1.12 ui-sans-serif, system-ui, sans-serif; letter-spacing: -2px; }
.intro-copy { margin-bottom: 0; color: var(--muted); font-size: 14px; }
.mobile-break { display: none; }
.dashboard { display: grid; grid-template-columns: 1.08fr .92fr; gap: 16px; align-items: stretch; }
.forecast-card {
  min-height: 257px;
  padding: 25px 26px 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: white;
  border-radius: 20px;
  background: radial-gradient(ellipse at 91% 8%, rgba(132,184,255,.42), transparent 36%), linear-gradient(135deg, #276fe5 0%, #1b5fce 100%);
  box-shadow: 0 12px 28px rgba(37, 104, 220, .18);
}
.forecast-card-top { display: flex; justify-content: space-between; gap: 8px; }
.eyebrow-light { color: rgba(255,255,255,.71); }
.forecast-card h2 { margin: 0; font: 700 18px ui-sans-serif, system-ui, sans-serif; letter-spacing: -.4px; }
.weather-illustration { flex: 0 0 74px; width: 74px; height: 74px; margin: -6px -3px 0 0; }
.weather-illustration svg { width: 100%; height: 100%; }
.forecast-message { max-width: 390px; margin: 20px 0 16px; font: 700 clamp(20px, 2.8vw, 25px)/1.35 Manrope, sans-serif; letter-spacing: -.65px; }
.forecast-meta { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: auto; padding-top: 13px; border-top: 1px solid rgba(255,255,255,.2); }
.forecast-time { color: rgba(255,255,255,.72); font-size: 10px; text-align: right; }
.forecast-card.is-stale .forecast-time { color: #ffe29a; }
.panel { padding: 21px 22px; border: 1px solid #eaf0f6; border-radius: 18px; background: white; box-shadow: 0 4px 14px rgba(39, 64, 96, .035); }
.rain-card { min-height: 257px; display: flex; flex-direction: column; }
.section-heading { display: flex; align-items: center; gap: 12px; }
.heading-icon { width: 41px; height: 41px; flex: 0 0 41px; display: grid; place-items: center; border-radius: 13px; }
.heading-icon svg { width: 21px; height: 21px; }
.rain-icon { color: #3178e8; background: #edf5ff; }
.alert-icon { color: #8460c7; background: #f4efff; }
.section-heading .eyebrow, .panel-heading .eyebrow { margin-bottom: 4px; }
.section-heading h2, .panel-heading h2 { margin: 0; font: 700 15px ui-sans-serif, system-ui, sans-serif; letter-spacing: -.35px; }
.rain-status { display: flex; align-items: flex-start; gap: 10px; margin: 22px 0 0 2px; }
.status-indicator { flex: 0 0 8px; width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: #a6b2c1; }
.status-indicator.is-dry { background: #35b88a; box-shadow: 0 0 0 4px #e9f8f2; }
.status-indicator.is-wet { background: #4386ed; box-shadow: 0 0 0 4px #edf5ff; }
.rain-status p { margin: 0; color: #35465e; font-size: 13px; line-height: 1.55; }
.rain-detail { margin: 9px 0 0 20px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.data-time { width: 100%; margin: auto 0 0; padding-top: 13px; color: #9aa6b5; border-top: 1px solid #e9eef5; font-size: 10px; text-align: right; }

.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.panel-close { padding: 7px 10px; color: #53647b; border: 1px solid #e2e9f1; border-radius: 8px; background: white; font-size: 10px; font-weight: 600; }
.panel-close:hover { color: var(--blue); border-color: #bdd3f4; }
.private-label { display: inline-flex; align-items: center; gap: 5px; color: #8b98aa; font-size: 9px; white-space: nowrap; }
.private-label svg { width: 14px; height: 14px; }
.location-selector {
  width: 100%;
  min-height: 66px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 12px;
  padding: 12px 16px;
  color: var(--ink);
  border: 1px solid #e2eaf3;
  border-radius: 16px;
  background: white;
  box-shadow: 0 4px 14px rgba(39, 64, 96, .035);
  text-align: left;
}
.location-selector:hover, .location-selector.is-open { border-color: #bfd4f4; background: #fbfdff; }
.location-selector-icon { width: 36px; height: 36px; flex: 0 0 36px; display: grid; place-items: center; color: var(--blue); border-radius: 11px; background: #edf5ff; }
.location-selector-icon svg { width: 20px; height: 20px; }
.location-selector-copy { min-width: 0; display: flex; flex: 1; flex-direction: column; gap: 3px; }
.location-selector-copy .eyebrow { margin: 0; font-size: 8px; }
.location-selector-copy strong { overflow-wrap: anywhere; color: #34465e; font-size: 13px; font-weight: 700; line-height: 1.35; }
.location-selector-hint { color: #929eae; font-size: 9px; text-align: right; }
.location-selector-chevron { color: #7d8a9c; font-size: 19px; transition: transform .15s; }
.location-selector.is-open .location-selector-chevron { transform: rotate(180deg); }
.location-card { margin: 0 0 12px; scroll-margin-top: 80px; }
.location-card[hidden], .alerts-card[hidden], .details-panel[hidden] { display: none; }
.location-description { margin: 13px 0 15px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.location-button { width: 100%; min-height: 43px; display: flex; align-items: center; gap: 10px; padding: 0 12px; color: #225fc3; border: 1px solid #cfe0fa; border-radius: 11px; background: #f4f8ff; font-size: 11px; font-weight: 700; text-align: left; }
.location-button:hover { background: #eaf2ff; border-color: #a9c7f5; }
.location-button:disabled, .primary-button:disabled { cursor: wait; opacity: .65; }
.location-button svg { width: 18px; height: 18px; }
.button-arrow { margin-left: auto; font-size: 17px; font-weight: 400; }
.or-divider { display: flex; align-items: center; gap: 10px; margin: 15px 0 12px; color: #99a4b1; font-size: 9px; }
.or-divider::before, .or-divider::after { height: 1px; flex: 1; background: #edf1f5; content: ''; }
.postal-form { display: flex; gap: 8px; }
.postal-form input { width: 0; min-width: 0; flex: 1; height: 42px; padding: 0 12px; color: var(--ink); border: 1px solid #e0e7f0; border-radius: 10px; outline: none; background: #fff; font-size: 12px; letter-spacing: .4px; }
.postal-form input::placeholder { color: #a3adba; }
.postal-form input:focus, .alert-controls select:focus { border-color: #7ba9f1; box-shadow: 0 0 0 3px rgba(35,107,232,.1); }
.primary-button { height: 42px; padding: 0 13px; color: white; border: 0; border-radius: 10px; background: var(--blue); font-size: 11px; font-weight: 700; white-space: nowrap; }
.primary-button:hover { background: var(--blue-dark); }
.feedback { min-height: 14px; margin: 7px 0 -3px; color: #b6534f; font-size: 10px; }
.feedback.success { color: #21845f; }

.alerts-card { margin: 0 0 12px; scroll-margin-top: 80px; }
.alerts-copy { margin: 14px 0 14px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.alert-preview { display: flex; align-items: flex-start; gap: 10px; margin: 12px 0; padding: 11px 12px; color: #43536b; border: 1px solid #e5edf7; border-radius: 11px; background: #f8faff; }
.alert-preview-icon { width: 28px; height: 28px; flex: 0 0 28px; display: grid; place-items: center; color: var(--blue); border-radius: 9px; background: #e9f2ff; }
.alert-preview-icon svg { width: 17px; height: 17px; }
.alert-preview > span:last-child { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.alert-preview-label { color: #78869b; font-size: 8px; font-weight: 700; letter-spacing: .8px; }
.alert-preview strong { font-size: 10px; }
.alert-preview-message { color: #718096; font-size: 9px; line-height: 1.45; }
.alert-controls { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 11px 0; border-top: 1px solid #f0f3f7; }
.select-label { color: #53647b; font-size: 10px; font-weight: 600; }
.alert-controls select { max-width: 58%; height: 32px; padding: 0 25px 0 9px; color: #35465e; border: 1px solid #e0e7f0; border-radius: 8px; outline: none; background: #fff; font-size: 10px; }
.desktop-alert-button { width: 100%; display: flex; align-items: center; gap: 8px; padding: 11px 0; color: #41516a; border: 0; border-top: 1px solid #f0f3f7; background: transparent; font-size: 10px; text-align: left; }
.desktop-alert-button:disabled { cursor: not-allowed; opacity: .5; }
.desktop-alert-icon { color: #7385a0; font-size: 15px; }
.toggle-track { width: 31px; height: 18px; display: inline-flex; align-items: center; margin-left: auto; padding: 2px; border-radius: 99px; background: #dce3ec; transition: background .2s; }
.toggle-knob { width: 14px; height: 14px; border-radius: 50%; background: white; box-shadow: 0 1px 3px #0002; transition: transform .2s; }
.desktop-alert-button.is-on .toggle-track { background: #38b58a; }
.desktop-alert-button.is-on .toggle-knob { transform: translateX(13px); }
.notification-note { margin: 3px 0 0; color: #9aa5b3; font-size: 9px; line-height: 1.5; }
.toast { display: none; position: fixed; z-index: 20; top: 82px; right: max(20px, calc((100vw - 900px) / 2)); width: min(360px, calc(100vw - 40px)); padding: 12px 14px; color: #235b49; border: 1px solid #d8efe5; border-radius: 12px; background: #f1faf6; box-shadow: 0 12px 30px rgba(35, 67, 54, .15); font-size: 11px; line-height: 1.5; }
.toast.is-visible { display: block; }
.details-panel { margin-top: 16px; }
.details-panel summary { display: flex; align-items: center; justify-content: space-between; cursor: pointer; list-style: none; }
.details-panel summary::-webkit-details-marker { display: none; }
.details-panel summary strong { display: block; font: 700 13px ui-sans-serif, system-ui, sans-serif; }
.details-panel summary .eyebrow { margin-bottom: 4px; }
.details-chevron { color: #7d8a9c; font-size: 20px; transition: transform .15s; }
.details-panel[open] .details-chevron { transform: rotate(180deg); }
.station-list { margin-top: 17px; padding-top: 6px; border-top: 1px solid #edf1f5; }
.station-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid #f2f4f7; font-size: 11px; }
.station-row:last-child { border-bottom: 0; }
.station-name { color: #53647b; }
.station-distance { color: #8492a5; white-space: nowrap; }
.rain-value { color: #236be8; font-weight: 700; }
.muted-copy { margin: 8px 0; color: var(--muted); font-size: 11px; }
.footer { display: flex; justify-content: space-between; gap: 12px; margin: 24px 2px 0; color: #8996a7; font-size: 10px; }
.footer-dot { padding: 0 3px; color: #c3ccd6; }
.data-sources { margin: 17px 2px 0; padding-top: 13px; border-top: 1px solid #e9eef5; color: #8b98a9; font-size: 9px; line-height: 1.65; }
.data-sources h2 { margin: 0 0 6px; color: #718096; font: 700 10px ui-sans-serif, system-ui, sans-serif; }
.data-sources p { margin: 0 0 5px; }
.data-sources a { color: #65758b; text-underline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; clip-path: inset(50%); }

@media (min-width: 1100px) {
  .page-shell { padding-top: 28px; }
}
@media (max-width: 700px) {
  .topbar { height: 60px; padding: 0 18px; }
  .header-right { gap: 8px; }
  .last-checked { font-size: 9px; }
  .brand { font-size: 18px; }
  .brand-mark { width: 29px; height: 29px; }
  .page-shell { width: min(100% - 32px, 500px); padding: 16px 0 28px; }
  .intro { margin: 0 0 22px 2px; }
  h1 { font-size: 34px; letter-spacing: -1.7px; }
  .mobile-break { display: initial; }
  .intro-copy { max-width: 290px; font-size: 12px; line-height: 1.5; }
  .dashboard { grid-template-columns: 1fr; gap: 12px; }
  .forecast-card { min-height: 224px; padding: 22px 21px 17px; border-radius: 18px; }
  .forecast-card h2 { font-size: 16px; }
  .weather-illustration { width: 65px; height: 65px; flex-basis: 65px; }
  .forecast-message { max-width: 330px; margin: 21px 0 17px; font-size: 23px; }
  .panel { padding: 18px; border-radius: 16px; }
  .rain-card { min-height: 0; }
  .location-selector { min-height: 62px; gap: 9px; padding: 10px 12px; border-radius: 14px; }
  .location-selector-hint { display: none; }
  .location-card, .alerts-card { padding: 16px; }
  .toast { top: 68px; left: 12px; right: 12px; width: auto; }
  .details-panel { margin-top: 12px; }
  .footer { margin-top: 20px; font-size: 9px; }
}
@media (max-width: 380px) {
  .topbar { padding: 0 12px; }
  .header-right { gap: 5px; }
  .last-checked { font-size: 6px; }
  .icon-button { width: 32px; height: 32px; }
  .brand { font-size: 16px; }
  .brand-mark { width: 26px; height: 26px; }
  .page-shell { width: calc(100% - 24px); }
  .panel { padding: 16px; }
  .private-label { font-size: 8px; }
  .primary-button { padding: 0 10px; }
  .footer { flex-direction: column; gap: 5px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
