:root {
  color-scheme: dark;
  --bg: #06142b;
  --bg-strong: #081429;
  --panel: #102543;
  --panel-soft: #173456;
  --line: #385274;
  --text: #f5f8ff;
  --muted: #afc2dc;
  --cyan: #6dbbff;
  --blue: #286bea;
  --green: #62deb1;
  --yellow: #ffc96a;
  --orange: #ffab72;
  --red: #ff7789;
  --radius: 18px;
  --shadow: 0 24px 70px rgba(0, 7, 22, .38);
  --surface-inset: #0a1c35;
  --surface-frost: rgba(16, 37, 67, .88);
  --body-background: radial-gradient(ellipse 75% 52% at 85% -8%, rgba(32, 96, 181, .25), transparent 72%), radial-gradient(circle at -12% 42%, rgba(22, 84, 149, .12), transparent 40%), #06142b;
  font-family: Inter, "Segoe UI", Arial, Helvetica, sans-serif;
}

:root.light {
  color-scheme: light;
  --bg: #eef4fa;
  --bg-strong: #dce9f5;
  --panel: #ffffff;
  --panel-soft: #e6f0f8;
  --line: #b8ccdd;
  --text: #10243a;
  --muted: #587087;
  --cyan: #007c99;
  --surface-inset: #eaf2fa;
  --surface-frost: rgba(255, 255, 255, .94);
  --body-background: radial-gradient(circle at 90% 0%, #d5e8fd, transparent 50%), #eef4fa;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html { scroll-behavior: smooth; }
body { background: var(--body-background); color: var(--text); line-height: 1.5; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid rgba(255, 194, 38, .8);
  outline-offset: 3px;
}
[hidden] { display: none !important; }

.topbar {
  align-items: center;
  background: var(--bg-strong);
  border-bottom: 1px solid #18365c;
  display: flex;
  min-height: 68px;
  justify-content: space-between;
  padding: 0 24px;
}
.brand { align-items: center; display: flex; font-size: 22px; font-weight: 900; gap: 10px; letter-spacing: -.02em; }
.brand-mark { color: var(--yellow); font-size: 25px; }
.brand span { color: var(--yellow); }
.desktop-nav { align-items: center; display: flex; gap: 6px; margin-left: auto; }
.desktop-nav a { border-radius: 8px; color: var(--muted); font-size: 14px; font-weight: 800; padding: 10px 12px; }
.desktop-nav a:hover, .desktop-nav a[aria-current="page"] { background: #102e59; color: white; }
.role-identity { color: var(--muted); font-size: 12px; margin-left: 10px; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-actions { align-items: center; display: flex; gap: 10px; }
.icon-button {
  align-items: center;
  background: #102c54;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  height: 42px;
  justify-content: center;
  min-width: 42px;
  position: relative;
}
.badge {
  background: var(--red);
  border-radius: 12px;
  font-size: 11px;
  font-weight: 800;
  min-width: 18px;
  padding: 2px 5px;
  position: absolute;
  right: -4px;
  top: -4px;
}

.auth-page {
  align-items: center;
  background: radial-gradient(circle at top, #174fa8, var(--bg-strong) 64%);
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 32px 18px;
}
.auth-shell { max-width: 480px; width: 100%; }
.auth-brand { margin-bottom: 26px; text-align: center; }
.auth-brand .brand-mark { display: block; font-size: 54px; }
.auth-brand h1 { font-size: 42px; margin: 8px 0 4px; }
.auth-brand h1 span { color: var(--yellow); }
.auth-brand p { color: var(--muted); margin: 0; }
.role-switch { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; margin-bottom: 14px; }
.role-switch a {
  background: #0b2244;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  font-weight: 700;
  padding: 12px;
  text-align: center;
}
.role-switch a.active { background: #1b63dc; color: white; }
.auth-card {
  background: rgba(13, 38, 75, .96);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}
.tabs { border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 24px; }
.tabs a { color: var(--muted); font-weight: 800; padding: 12px; text-align: center; }
.tabs a.active { border-bottom: 3px solid var(--cyan); color: white; }
.field { display: grid; gap: 7px; margin-bottom: 17px; }
.field label { color: #dce9f8; font-size: 13px; font-weight: 800; text-transform: uppercase; }
.field input, .field select {
  background: #061a36;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: white;
  min-height: 48px;
  outline: none;
  padding: 0 14px;
  width: 100%;
}
.field textarea {
  background: #061a36;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: white;
  min-height: 130px;
  outline: none;
  padding: 14px;
  resize: vertical;
  width: 100%;
}
.field input:focus, .field select:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(78, 225, 255, .12); }
.field textarea:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(78, 225, 255, .12); }
.form-row { display: grid; gap: 12px; grid-template-columns: 1fr 94px; }
.button {
  background: var(--blue);
  border: 0;
  border-radius: 6px;
  color: white;
  cursor: pointer;
  display: inline-flex;
  font-weight: 900;
  justify-content: center;
  min-height: 48px;
  padding: 14px 18px;
  width: 100%;
}
.button:hover { filter: brightness(1.08); }
.button:disabled { cursor: wait; opacity: .65; }
.button.secondary { background: transparent; border: 1px solid #5074a6; color: white; }
.helper { color: var(--muted); font-size: 13px; line-height: 1.45; }
.error { color: #ff9aa3; min-height: 20px; }
.success { color: #71eab5; }
.guest-link { color: var(--muted); display: block; margin-top: 18px; text-align: center; }
.restricted-note { background: rgba(255, 214, 107, .08); border: 1px solid #7d6637; border-radius: 6px; color: var(--yellow); margin-bottom: 14px; padding: 12px; }

.app-shell { margin: 0 auto; max-width: 1180px; min-height: calc(100vh - 68px); padding: 30px 24px 104px; }
.location-row { align-items: center; display: flex; gap: 14px; justify-content: space-between; margin-bottom: 28px; }
.location-button { background: transparent; border: 0; color: var(--text); cursor: pointer; font-size: 17px; font-weight: 800; padding: 8px 0; }
.home-layout { display: grid; gap: 22px; grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr); }
.weather-column { min-width: 0; }
.weather-hero { background: linear-gradient(165deg, rgba(22, 79, 166, .48), rgba(6, 25, 57, .72)); border: 1px solid rgba(69, 116, 175, .45); border-radius: 24px; padding: 34px 24px 28px; text-align: center; }
.weather-icon { font-size: 62px; }
.temperature { font-size: 82px; font-weight: 300; line-height: 1; margin: 10px 0; }
.temperature small { color: var(--muted); font-size: 32px; }
.condition { font-size: 24px; margin: 8px 0; }
.muted { color: var(--muted); }
.weather-grid { border: 1px solid rgba(69, 116, 175, .36); border-radius: 16px; display: grid; gap: 1px; grid-template-columns: repeat(3, 1fr); margin: 18px 0 0; overflow: hidden; }
.metric { background: rgba(8, 34, 70, .92); padding: 20px; text-align: center; }
.metric small { color: var(--muted); display: block; margin-bottom: 8px; }
.metric strong { font-size: 21px; }
.warning-panel { align-self: stretch; background: linear-gradient(160deg, rgba(81, 31, 52, .92), rgba(24, 27, 51, .96)); border: 1px solid rgba(255, 95, 109, .42); border-radius: 24px; display: flex; flex-direction: column; justify-content: center; min-height: 280px; padding: 28px; text-align: center; }
.warning-panel h2 { font-size: 20px; margin: 0 0 8px; }
.warning-panel .button { margin-top: 18px; }
.risk-icon { align-items: center; background: var(--yellow); clip-path: polygon(50% 0, 100% 100%, 0 100%); color: #342600; display: flex; font-size: 28px; font-weight: 900; height: 62px; justify-content: center; margin: 0 auto 16px; padding-top: 18px; width: 70px; }
.data-source { color: var(--muted); font-size: 12px; margin-top: 10px; }

.page-heading { align-items: flex-end; display: flex; justify-content: space-between; margin: 8px 0 24px; }
.page-heading h1 { margin: 0; }
.active-count { background: rgba(255, 95, 109, .13); border: 1px solid rgba(255, 95, 109, .28); border-radius: 16px; color: #ff8994; font-size: 13px; padding: 7px 12px; }
.confirmed-location { background: rgba(255, 214, 107, .08); border: 1px solid rgba(255, 214, 107, .25); border-radius: 14px; color: var(--yellow); font-size: 13px; margin-bottom: 16px; padding: 12px 14px; }
.alert-list { display: grid; gap: 14px; }
.alert-card { background: var(--panel); border: 1px solid var(--line); border-left: 5px solid var(--yellow); border-radius: 18px; box-shadow: 0 12px 28px rgba(0, 8, 25, .18); overflow: hidden; }
.alert-card[data-severity="CRITICAL"] { background: linear-gradient(90deg, rgba(255, 95, 109, .14), var(--panel) 72%); border-left-color: var(--red); }
.alert-card[data-severity="HIGH"] { background: linear-gradient(90deg, rgba(255, 152, 92, .12), var(--panel) 72%); border-left-color: var(--orange); }
.alert-card[data-severity="MODERATE"] { background: linear-gradient(90deg, rgba(255, 214, 107, .1), var(--panel) 72%); }
.alert-summary { align-items: flex-start; background: transparent; border: 0; color: inherit; cursor: pointer; display: grid; gap: 14px; grid-template-columns: auto 1fr auto; padding: 19px; text-align: left; width: 100%; }
.alert-level { color: var(--yellow); font-size: 12px; font-weight: 900; }
.alert-card[data-severity="CRITICAL"] .alert-level { color: #ff8f99; }
.alert-card[data-severity="HIGH"] .alert-level { color: #ffb17e; }
.alert-title { font-size: 19px; margin: 5px 0; }
.alert-time { color: #758fac; font-size: 12px; margin: 6px 0 0; }
.alert-detail { border-top: 1px solid var(--line); display: none; padding: 0 19px 19px; }
.alert-card.open .alert-detail { display: block; }
.recommendations { background: #0a2040; border-radius: 6px; margin-top: 14px; padding: 14px; }
.recommendations li { margin: 8px 0; }
.read-label { color: var(--green); font-size: 12px; }
.empty, .loading { color: var(--muted); padding: 28px; text-align: center; }

.profile-layout { display: grid; gap: 18px; grid-template-columns: 280px 1fr; }
.profile-summary, .settings-panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.avatar { align-items: center; background: #1d4777; border-radius: 50%; display: flex; font-size: 28px; height: 72px; justify-content: center; margin-bottom: 16px; width: 72px; }
.profile-summary h2 { margin: 0 0 5px; }
.role-pill { background: #16446c; border-radius: 14px; color: var(--cyan); display: inline-block; font-size: 12px; margin-top: 12px; padding: 6px 10px; }
.settings-panel h2 { font-size: 16px; margin: 0 0 18px; text-transform: uppercase; }
.setting { align-items: center; border-top: 1px solid var(--line); display: flex; gap: 14px; justify-content: space-between; padding: 16px 0; }
.setting:first-of-type { border-top: 0; }
.setting input[type="checkbox"] { accent-color: var(--cyan); height: 22px; width: 22px; }
.actions-row { display: flex; gap: 12px; margin-top: 18px; }

.profile-page { display: grid; gap: 16px; max-width: 520px; }
.profile-page .profile-summary, .profile-page .settings-panel { border-radius: 20px; }
.profile-card-row { align-items: center; display: flex; gap: 18px; }
.profile-card-row .avatar { flex: 0 0 auto; margin: 0; }
.profile-copy h2, .profile-copy p { margin: 0 0 5px; }
.profile-copy .helper { margin-top: 8px; }
.section-label { color: #6f89a8; font-size: 12px; letter-spacing: .08em; margin-bottom: 10px; text-transform: uppercase; }
.compact-button { margin-left: auto; max-width: 220px; }
.resource-links { padding-block: 12px; }
.resource-links .section-label { margin: 8px 10px; }
.resource-links .setting { padding-inline: 10px; }
.danger-button { background: rgba(255, 67, 91, .06); border: 1px solid rgba(255, 95, 109, .45); color: var(--red); }

.narrow-shell { max-width: 720px; }
.back-link { font-size: 28px; line-height: 1; }
.content-list { display: grid; gap: 14px; }
.content-card { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 20px; }
.content-card h2 { font-size: 19px; margin: 0 0 10px; }
.content-card p { color: var(--muted); line-height: 1.6; margin: 0 0 16px; }
.content-card a { color: var(--cyan); font-weight: 800; }
.report-panel { border-radius: 20px; margin-bottom: 28px; }
.coordinate-grid { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.report-panel .button.secondary { margin-bottom: 17px; }
.report-status { border-radius: 999px; display: inline-block; font-size: 12px; font-weight: 800; margin-bottom: 10px; padding: 5px 10px; }
.status-pending { background: rgba(255, 214, 107, .12); color: var(--yellow); }
.status-approved { background: rgba(37, 214, 138, .12); color: var(--green); }
.status-rejected { background: rgba(255, 95, 109, .12); color: var(--red); }
.report-history-card small { color: var(--muted); }

.permission-card { background: rgba(11, 35, 70, .96); border: 1px solid var(--line); border-radius: 26px; box-shadow: 0 20px 50px rgba(0, 0, 0, .35); max-width: 420px; padding: 34px 28px; text-align: center; width: 100%; }
.permission-card h1 { margin: 12px 0; }
.permission-card p { line-height: 1.55; }
.location-art { align-items: center; background: linear-gradient(145deg, #1657d7, #163981); border-radius: 50%; color: white; display: flex; font-size: 44px; height: 96px; justify-content: center; margin: 0 auto 22px; width: 96px; }

.map-page { height: 100vh; overflow: hidden; }
.map-header { align-items: center; background: rgba(3, 16, 32, .94); display: grid; grid-template-columns: 1fr auto 1fr; height: 52px; left: 0; padding: 0 16px; position: fixed; right: 0; top: 0; z-index: 1001; }
.map-header a { font-size: 28px; }
.map-header span { color: var(--muted); font-size: 12px; justify-self: end; }
.map-header strong { letter-spacing: -.025em; }
.map-header { background: rgba(6, 19, 39, .96); border-bottom: 1px solid rgba(153, 189, 238, .2); color: #f5f8ff; }
.map-header span { color: #b5c8e0; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#weather-map { background: #193447; bottom: 75px; left: 0; position: fixed; right: 0; top: 52px; }
.leaflet-container { font-family: inherit; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--panel); color: var(--text); }
.leaflet-popup-content p { color: var(--muted); margin: 6px 0 0; }
.layer-panel { background: rgba(5, 28, 67, .96); border: 1px solid #1f5aa1; border-radius: 18px; bottom: 94px; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); display: grid; gap: 10px; max-width: 310px; padding: 14px; position: fixed; right: 18px; transition: transform .2s, opacity .2s; width: calc(100% - 36px); z-index: 1002; }
.layer-panel.closed { opacity: 0; pointer-events: none; transform: translateY(18px); }
.layer-panel-title { align-items: center; display: flex; justify-content: space-between; }
.layer-panel-title button { background: transparent; border: 0; color: white; cursor: pointer; font-size: 25px; }
.layer-panel label { align-items: center; background: #0c3b7a; border-radius: 8px; display: flex; gap: 10px; padding: 11px; }
.layer-panel input { accent-color: #5fa7ff; }
.map-floating-button { background: #113d72; border: 1px solid #4382c4; border-radius: 50%; bottom: 95px; color: white; cursor: pointer; font-size: 20px; height: 46px; left: 18px; position: fixed; width: 46px; z-index: 1002; }
.map-legend { bottom: 154px; display: flex; left: 18px; position: fixed; z-index: 1002; }
.map-legend span { background: var(--level); color: #071225; font-size: 11px; font-weight: 900; padding: 5px 13px; }
.map-location-button { background: var(--panel); border: 1px solid #64a9ff; border-radius: 12px; bottom: 95px; box-shadow: 0 8px 25px rgba(0, 9, 32, .4); color: var(--text); cursor: pointer; font-size: 12px; font-weight: 800; left: 75px; min-height: 46px; padding: 0 13px; position: fixed; z-index: 1002; }
.map-location-button:hover { background: var(--panel-soft); }
.map-fallback { background: var(--surface-frost); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); left: 18px; max-height: calc(100vh - 250px); overflow-y: auto; padding: 22px; position: fixed; top: 69px; width: min(430px, calc(100vw - 36px)); z-index: 1002; }
.map-fallback h2 { font-size: 19px; letter-spacing: -.03em; margin: 0 0 8px; }
.map-fallback p { color: var(--muted); line-height: 1.5; margin: 0 0 16px; }
.map-fallback-list { display: grid; gap: 9px; list-style: none; margin: 0; padding: 0; }
.map-fallback-list li { background: var(--surface-inset); border: 1px solid var(--line); border-radius: 11px; line-height: 1.5; padding: 11px 13px; }
.map-fallback-list a { color: var(--cyan); font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.layer-panel { background: var(--surface-frost); border-color: var(--line); box-shadow: var(--shadow); }
.layer-panel label { background: var(--surface-inset); border: 1px solid var(--line); border-radius: 10px; cursor: pointer; line-height: 1.45; }
.layer-panel-title button { color: var(--text); }
.map-floating-button { background: var(--panel); border-color: #64a9ff; box-shadow: 0 8px 25px rgba(0, 9, 32, .4); }
.map-disclaimer { background: var(--surface-frost); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 24px rgba(0, 8, 25, .24); color: var(--muted); font-size: 12px; line-height: 1.45; margin: 0; max-width: 340px; padding: 10px 12px; position: fixed; right: 18px; top: 70px; z-index: 1001; }
.map-disclaimer a { color: var(--cyan); font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.map-fallback:not([hidden]) ~ .map-disclaimer { display: none; }

.bottom-nav { background: rgba(4, 18, 38, .97); border-top: 1px solid #18365c; bottom: 0; display: none; grid-template-columns: repeat(5, minmax(0, 110px)); justify-content: center; left: 0; min-height: calc(75px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); position: fixed; right: 0; z-index: 1010; }
.bottom-nav a { align-items: center; color: var(--muted); display: flex; flex-direction: column; justify-content: center; padding: 12px 8px; text-align: center; }
.bottom-nav a.active { color: var(--cyan); }
.bottom-nav a.disabled { cursor: not-allowed; opacity: .42; }
.bottom-nav span { display: block; font-size: 12px; margin-top: 4px; }
.bottom-nav .nav-center { align-self: center; background: radial-gradient(circle at 35% 30%, #5596c8, #174476 55%, #0a2b50); border: 3px solid #345f89; border-radius: 50%; color: var(--yellow); font-size: 25px; height: 56px; justify-self: center; margin-top: -20px; padding: 0; width: 56px; }
.modal { align-items: center; background: rgba(0, 6, 16, .75); display: none; inset: 0; justify-content: center; padding: 18px; position: fixed; z-index: 30; }
.modal.open { display: flex; }
.modal-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); max-width: 430px; padding: 24px; width: 100%; }
.modal-card h2 { margin-top: 0; }
.toast { background: #153e65; border: 1px solid var(--line); border-radius: 6px; bottom: 84px; display: none; left: 50%; padding: 12px 18px; position: fixed; transform: translateX(-50%); z-index: 50; }
.toast.show { display: block; }

.eyebrow { color: var(--yellow); font-size: 12px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.demo-chip { background: rgba(255, 194, 38, .12); border: 1px solid rgba(255, 194, 38, .28); border-radius: 999px; color: var(--yellow); display: inline-flex; font-size: 11px; font-weight: 900; margin-bottom: 10px; padding: 5px 9px; text-transform: uppercase; }
.updated-at { color: var(--muted); font-size: 12px; margin-top: 12px; }

.professional-shell { margin: 0 auto; max-width: 1280px; padding: 30px 24px 80px; }
.professional-heading { align-items: end; display: flex; gap: 20px; justify-content: space-between; margin-bottom: 26px; }
.professional-heading h1 { margin: 6px 0; }
.dashboard-grid { display: grid; gap: 20px; grid-template-columns: minmax(340px, .82fr) minmax(420px, 1.18fr); }
.dashboard-panel { background: rgba(8, 32, 66, .94); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 22px; }
.dashboard-panel h2 { font-size: 18px; margin: 0 0 6px; }
.dashboard-panel-header { align-items: start; display: flex; gap: 12px; justify-content: space-between; margin-bottom: 18px; }
.dashboard-panel-header p { margin: 5px 0 0; }
.dashboard-list { display: grid; gap: 12px; }
.review-card, .account-card { background: #091d3c; border: 1px solid #264873; border-radius: 12px; padding: 16px; }
.review-card h3, .account-card h3 { margin: 0 0 7px; }
.review-card p, .account-card p { line-height: 1.5; margin: 5px 0; }
.inline-actions { align-items: center; display: flex; flex-wrap: wrap; gap: 9px; margin-top: 14px; }
.inline-actions .button { min-height: 40px; padding: 9px 13px; width: auto; }
.button.approve { background: #159b65; }
.button.reject { background: transparent; border: 1px solid rgba(255, 95, 109, .65); color: #ff8e98; }
.field textarea, .field select { background: #061a36; border: 1px solid var(--line); border-radius: 8px; color: white; min-height: 48px; outline: none; padding: 12px 14px; width: 100%; }
.field textarea { min-height: 118px; resize: vertical; }
.form-grid { display: grid; gap: 0 12px; grid-template-columns: 1fr 1fr; }
.form-grid .span-2 { grid-column: 1 / -1; }
.stats-row { display: grid; gap: 12px; grid-template-columns: repeat(3, 1fr); margin-bottom: 20px; }
.stat-card { background: rgba(8, 32, 66, .94); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.stat-card strong { display: block; font-size: 27px; margin-top: 7px; }
.search-row { display: grid; gap: 10px; grid-template-columns: 1fr auto; }
.search-row .button { width: auto; }
.account-meta { color: var(--muted); display: flex; flex-wrap: wrap; font-size: 13px; gap: 8px 15px; }
.role-badge { background: rgba(36, 120, 255, .16); border-radius: 999px; color: #8eb8ff; display: inline-block; font-size: 12px; font-weight: 900; padding: 5px 9px; }
.full-panel { margin-top: 20px; }

@media (min-width: 721px) {
  .profile-page { grid-template-columns: minmax(250px, .75fr) minmax(360px, 1.25fr); max-width: 980px; }
  .profile-page .profile-summary { align-self: start; grid-row: 1 / span 4; }
  .profile-page .danger-button { grid-column: 2; }
}

@media (max-width: 720px) {
  body { background: linear-gradient(180deg, #0a3e91 0, #042354 28%, var(--bg) 62%, #000d21 100%); }
  .topbar { padding: 0 16px; }
  .desktop-nav, .role-identity { display: none; }
  .app-shell { max-width: 460px; padding: 22px 16px calc(96px + env(safe-area-inset-bottom)); }
  .home-layout { grid-template-columns: 1fr; }
  .weather-hero { background: transparent; border: 0; padding-inline: 0; }
  .warning-panel { min-height: 220px; }
  .profile-layout { grid-template-columns: 1fr; }
  .weather-grid { grid-template-columns: repeat(3, 1fr); }
  .metric { padding: 14px 7px; }
  .metric strong { font-size: 16px; }
  .temperature { font-size: 68px; }
  .bottom-nav { display: grid; grid-template-columns: repeat(5, 1fr); }
  .bottom-nav a { padding-inline: 5px; }
  .form-row { grid-template-columns: 1fr 82px; }
  .coordinate-grid { grid-template-columns: 1fr; }
  .page-heading h1 { font-size: 25px; }
  .professional-shell { padding: 24px 16px 70px; }
  .professional-heading { align-items: start; flex-direction: column; }
  .dashboard-grid, .form-grid, .stats-row { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .search-row { grid-template-columns: 1fr; }
  .search-row .button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

/* PrevClima visual system: a weather observatory, not a generic card dashboard. */
.topbar {
  background: rgba(6, 19, 39, .88);
  border-bottom-color: rgba(126, 173, 231, .16);
  box-shadow: 0 10px 32px rgba(0, 4, 16, .13);
  gap: 18px;
  min-height: 76px;
  padding-inline: clamp(18px, 4vw, 60px);
  position: relative;
  z-index: 20;
}
.brand { font-size: 21px; letter-spacing: -.045em; white-space: nowrap; }
.brand-mark {
  align-items: center;
  background: linear-gradient(150deg, #1745a4, #102447 72%);
  border: 1px solid rgba(121, 181, 255, .42);
  border-radius: 13px;
  box-shadow: inset 0 1px rgba(255, 255, 255, .18), 0 8px 24px rgba(1, 12, 40, .38);
  display: inline-flex;
  font-size: 24px;
  height: 42px;
  justify-content: center;
  width: 42px;
}
.desktop-nav { gap: 5px; }
.desktop-nav a {
  border: 1px solid transparent;
  border-radius: 11px;
  color: var(--muted);
  font-weight: 650;
  padding: 10px 15px;
  transition: background .2s, color .2s, border-color .2s;
}
.desktop-nav a:hover, .desktop-nav a[aria-current="page"] {
  background: rgba(89, 153, 243, .12);
  border-color: rgba(115, 174, 251, .16);
  color: var(--text);
}
.desktop-nav a[aria-current="page"] { box-shadow: inset 0 -2px var(--cyan); }
.icon-button { background: var(--panel); transition: transform .2s, border-color .2s; }
.icon-button:hover { border-color: var(--cyan); transform: translateY(-2px); }

.auth-page { background: radial-gradient(circle at 16% 25%, rgba(31, 95, 181, .4), transparent 44%), #051225; }
.auth-shell {
  align-items: center;
  display: grid;
  gap: clamp(36px, 7vw, 110px);
  grid-template-columns: minmax(0, 1fr) minmax(380px, 440px);
  max-width: 1180px;
  width: 100%;
}
.auth-form-column { min-width: 0; }
.auth-story { max-width: 570px; padding: 30px 0; }
.auth-story .eyebrow { color: #a5cfff; letter-spacing: .19em; }
.auth-story-art {
  align-items: center;
  background: radial-gradient(circle, rgba(37, 113, 234, .29) 0%, rgba(37, 113, 234, .07) 30%, transparent 66%);
  display: flex;
  height: 280px;
  justify-content: center;
  margin: 2px auto 12px;
  position: relative;
  width: min(100%, 480px);
}
.story-orbit { border: 1px solid rgba(141, 190, 255, .3); border-radius: 50%; position: absolute; }
.story-orbit-one { height: 175px; width: 175px; }
.story-orbit-two { height: 265px; width: 265px; }
.story-orbit-two::before, .story-orbit-one::after {
  background: var(--yellow);
  border-radius: 50%;
  box-shadow: 0 0 22px rgba(255, 201, 106, .8);
  content: "";
  height: 8px;
  left: 17%;
  position: absolute;
  top: 14%;
  width: 8px;
}
.story-orbit-one::after { background: #7cbbff; left: auto; right: 9%; top: 75%; }
.story-core {
  align-items: center;
  background: linear-gradient(155deg, #295eba, #081b41 82%);
  border: 1px solid rgba(198, 220, 255, .54);
  border-radius: 27px;
  box-shadow: inset 0 1px rgba(255, 255, 255, .26), 0 0 65px rgba(42, 110, 219, .45);
  color: var(--yellow);
  display: flex;
  font-size: 68px;
  height: 118px;
  justify-content: center;
  transform: rotate(-8deg);
  width: 118px;
}
.story-signal { background: rgba(131, 186, 255, .34); height: 1px; position: absolute; width: 60px; }
.story-signal-one { left: 6%; top: 32%; transform: rotate(-20deg); }
.story-signal-two { right: 4%; top: 68%; transform: rotate(28deg); }
.auth-story h2 { font-size: clamp(36px, 4.2vw, 62px); font-weight: 750; letter-spacing: -.06em; line-height: 1.08; margin: 12px 0 18px; }
.auth-story h2 em { color: #8fbeff; font-style: normal; }
.auth-story p { color: var(--muted); font-size: 17px; line-height: 1.65; max-width: 490px; }
.auth-story-tags { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 24px; }
.auth-story-tags span { background: rgba(117, 168, 236, .1); border: 1px solid rgba(154, 192, 246, .23); border-radius: 100px; color: #c6dcf7; font-size: 12px; font-weight: 700; padding: 8px 12px; }
.auth-brand { margin-bottom: 20px; }
.auth-brand .brand-mark { display: flex; font-size: 38px; height: 62px; margin: auto; width: 62px; }
.auth-brand h1 { font-size: 35px; letter-spacing: -.055em; }
.auth-card {
  background: linear-gradient(145deg, rgba(25, 51, 88, .95), rgba(10, 28, 53, .98));
  border-color: rgba(153, 194, 247, .28);
  border-radius: 25px;
  box-shadow: 0 25px 80px rgba(0, 5, 20, .38), inset 0 1px rgba(255, 255, 255, .08);
  padding: clamp(22px, 3vw, 34px);
}
.role-switch { background: rgba(9, 30, 60, .72); border: 1px solid var(--line); border-radius: 13px; gap: 4px; padding: 5px; }
.role-switch a { background: transparent; border: 0; border-radius: 9px; font-size: 13px; padding: 10px; }
.role-switch a.active { background: #285fbd; box-shadow: 0 5px 16px rgba(0, 14, 48, .27); }
.tabs { border-color: rgba(141, 178, 222, .24); }
.tabs a { font-size: 14px; }
.tabs a.active { border-color: var(--yellow); }
.guest-link { font-size: 14px; margin-top: 14px; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 4px; }
.guest-link:hover { color: var(--text); text-decoration-color: currentColor; }
.field label { color: var(--muted); font-size: 11px; letter-spacing: .1em; }
.field input, .field select, .field textarea, .search-row input {
  background: var(--surface-inset);
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--text);
  min-height: 48px;
}
.field input::placeholder, .field textarea::placeholder, .search-row input::placeholder { color: var(--muted); opacity: .76; }
.field input:focus, .field select:focus, .field textarea:focus, .search-row input:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(109, 187, 255, .16); }
.search-row input { min-width: 0; padding: 0 14px; }
.button {
  align-items: center;
  background: linear-gradient(135deg, #377dee, #235ac2);
  border: 1px solid rgba(147, 192, 255, .25);
  border-radius: 11px;
  box-shadow: 0 8px 22px rgba(17, 74, 178, .2);
  font-weight: 800;
  gap: 8px;
  line-height: 1.25;
  transition: transform .18s, box-shadow .18s, filter .18s;
}
.button:hover { box-shadow: 0 12px 26px rgba(17, 74, 178, .27); filter: brightness(1.08); transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button.secondary { background: rgba(115, 160, 218, .08); border-color: var(--line); box-shadow: none; color: var(--text); }
.button:disabled { transform: none; }
.restricted-note { border-radius: 11px; line-height: 1.5; }

.app-shell { max-width: 1260px; padding: 38px clamp(18px, 4vw, 48px) 110px; }
.location-row { align-items: end; border-bottom: 1px solid rgba(148, 186, 228, .17); margin-bottom: 26px; padding-bottom: 22px; }
.location-context { display: grid; gap: 3px; }
.location-button { align-items: center; display: inline-flex; font-size: clamp(20px, 2.4vw, 27px); gap: 8px; letter-spacing: -.03em; padding: 0; text-align: left; }
.location-button:hover { color: var(--cyan); }
.location-chevron { color: var(--cyan); font-size: 20px; }
.home-layout { align-items: stretch; gap: 20px; grid-template-columns: minmax(0, 1.25fr) minmax(340px, .75fr); }
.weather-column { display: flex; flex-direction: column; }
.weather-hero {
  background: radial-gradient(circle at 79% 43%, rgba(108, 171, 255, .19), transparent 34%), linear-gradient(145deg, #173b75, #0c2348 72%);
  border-color: rgba(137, 186, 255, .3);
  border-radius: 26px;
  box-shadow: var(--shadow), inset 0 1px rgba(255, 255, 255, .1);
  min-height: 390px;
  overflow: hidden;
  padding: clamp(24px, 3vw, 34px);
  position: relative;
  text-align: left;
}
.weather-hero::before, .weather-hero::after { border: 1px solid rgba(161, 203, 255, .14); border-radius: 50%; content: ""; height: 410px; pointer-events: none; position: absolute; right: -105px; top: 25px; width: 410px; }
.weather-hero::after { height: 295px; right: -47px; top: 83px; width: 295px; }
.hero-kicker { align-items: center; display: flex; justify-content: space-between; position: relative; z-index: 1; }
.hero-live-dot { background: var(--green); border: 4px solid rgba(98, 222, 177, .18); border-radius: 50%; height: 13px; width: 13px; }
.weather-icon { filter: drop-shadow(0 10px 26px rgba(117, 167, 255, .3)); font-size: 72px; line-height: 1; margin: 45px 0 6px; position: relative; z-index: 1; }
.temperature { font-size: clamp(76px, 8vw, 112px); font-weight: 300; letter-spacing: -.09em; margin: 3px 0; position: relative; z-index: 1; }
.temperature small { font-size: .33em; letter-spacing: -.03em; padding-left: 6px; vertical-align: top; }
.condition { font-size: clamp(21px, 2vw, 27px); font-weight: 650; letter-spacing: -.025em; position: relative; z-index: 1; }
.weather-hero p { position: relative; z-index: 1; }
.weather-grid { border: 0; gap: 12px; margin-top: 12px; overflow: visible; }
.metric { background: var(--surface-frost); border: 1px solid var(--line); border-radius: 15px; padding: 16px 12px; text-align: left; }
.metric small { font-size: 12px; }
.metric strong { font-size: clamp(18px, 2vw, 24px); letter-spacing: -.035em; }
.warning-panel {
  align-items: flex-start;
  background: radial-gradient(circle at 85% 20%, rgba(241, 98, 102, .17), transparent 55%), linear-gradient(150deg, #382839, #1a2342 85%);
  border-color: rgba(255, 155, 158, .37);
  border-radius: 26px;
  box-shadow: var(--shadow), inset 0 1px rgba(255, 255, 255, .08);
  min-height: 390px;
  padding: clamp(24px, 3vw, 34px);
  text-align: left;
}
.warning-panel .eyebrow { color: #ffb0a9; }
.warning-panel .risk-icon { margin: 45px 0 24px; }
.warning-panel h2 { font-size: clamp(23px, 2.4vw, 31px); letter-spacing: -.04em; line-height: 1.15; margin-bottom: 10px; }
.warning-panel p { line-height: 1.6; }
.warning-panel .button { margin-top: auto; max-width: 220px; }
.data-source { overflow-wrap: anywhere; }

.page-heading { align-items: center; border-bottom: 1px solid rgba(148, 186, 228, .18); margin-bottom: 20px; padding-bottom: 24px; }
.page-heading h1, .professional-heading h1 { font-size: clamp(32px, 4.5vw, 49px); letter-spacing: -.055em; line-height: 1.12; }
.page-heading .muted, .professional-heading .muted { margin-bottom: 0; }
.confirmed-location { align-items: center; border-radius: 12px; display: flex; gap: 10px; line-height: 1.45; }
.active-count { font-weight: 800; white-space: nowrap; }
.alert-list { gap: 12px; }
.alert-card { border-left-width: 4px; border-radius: 16px; transition: border-color .2s, transform .2s, box-shadow .2s; }
.alert-card:hover { box-shadow: 0 16px 36px rgba(0, 8, 25, .26); transform: translateY(-2px); }
.alert-summary { align-items: center; gap: 18px; min-height: 108px; padding: 20px 24px; }
.alert-title { font-size: 20px; letter-spacing: -.03em; }
.alert-detail { line-height: 1.6; padding-inline: 24px; }
.recommendations { background: var(--surface-inset); border: 1px solid var(--line); border-radius: 12px; }
.empty, .loading { background: var(--surface-frost); border: 1px dashed var(--line); border-radius: 15px; line-height: 1.5; }

.profile-summary, .settings-panel, .content-card, .dashboard-panel, .stat-card { background: var(--surface-frost); border-color: var(--line); box-shadow: 0 14px 35px rgba(0, 9, 26, .13); }
.profile-summary, .settings-panel { border-radius: 18px; }
.profile-page { gap: 18px; max-width: 1100px; }
.profile-page .profile-summary, .profile-page .settings-panel { border-radius: 20px; }
.profile-page .profile-summary { align-items: flex-start; background: radial-gradient(circle at 80% 12%, rgba(79, 144, 255, .26), transparent 54%), var(--surface-frost); min-height: 208px; padding: 26px; }
.profile-card-row .avatar { background: linear-gradient(150deg, #3c75df, #1b396b); border: 1px solid rgba(174, 207, 255, .4); box-shadow: 0 12px 30px rgba(23, 73, 154, .27); height: 76px; width: 76px; }
.section-label { color: var(--cyan); font-weight: 800; letter-spacing: .12em; }
.setting { min-height: 65px; }
.setting:hover:is(a) { color: var(--cyan); }
.setting input[type="checkbox"] { cursor: pointer; }
.content-card { border-radius: 16px; padding: 24px; }
.content-card h2 { letter-spacing: -.025em; }
.report-panel { padding: clamp(20px, 3vw, 30px); }
.danger-button { box-shadow: none; }
.danger-button:hover { background: rgba(255, 103, 121, .12); box-shadow: none; }
.permission-card { background: var(--surface-frost); }

.professional-shell { max-width: 1360px; padding: 42px clamp(18px, 4vw, 54px) 100px; }
.professional-heading { border-bottom: 1px solid rgba(148, 186, 228, .18); padding-bottom: 24px; }
.professional-heading .compact-button { width: auto; }
.dashboard-grid { gap: 18px; }
.dashboard-panel { border-radius: 20px; padding: clamp(20px, 2.5vw, 28px); }
.dashboard-panel-header { border-bottom: 1px solid rgba(148, 186, 228, .16); padding-bottom: 16px; }
.dashboard-panel-header h2 { font-size: 21px; letter-spacing: -.03em; }
.dashboard-panel-header .button { width: auto; }
.stats-row { gap: 14px; }
.stat-card { border-radius: 17px; min-height: 120px; overflow: hidden; padding: 18px 20px; position: relative; }
.stat-card::before { background: var(--cyan); border-radius: 4px; content: ""; height: 4px; left: 20px; position: absolute; right: 20px; top: 0; }
.stat-card:nth-child(2)::before { background: var(--yellow); }
.stat-card:nth-child(3)::before { background: var(--green); }
.stat-card strong { font-size: clamp(26px, 3vw, 35px); letter-spacing: -.05em; }
.review-card, .account-card { background: var(--surface-inset); border-color: var(--line); border-radius: 14px; padding: 18px; }
.review-card h3, .account-card h3 { letter-spacing: -.025em; }
.button.approve { background: #087755; }
.button.reject { background: rgba(255, 95, 109, .09); color: #ffb1b9; }
.dashboard-list { gap: 10px; }
.full-panel { margin-top: 18px; }

.bottom-nav { background: rgba(6, 19, 39, .97); border-top-color: rgba(126, 173, 231, .25); box-shadow: 0 -16px 38px rgba(0, 6, 20, .28); }
.bottom-nav a { font-size: 21px; min-height: 70px; transition: color .2s, background .2s; }
.bottom-nav a:hover:not(.disabled), .bottom-nav a.active { background: rgba(101, 154, 231, .09); color: #93c8ff; }
.bottom-nav a.nav-center { background: radial-gradient(circle at 36% 27%, #588bd7, #1e4177 62%, #0b2448); box-shadow: 0 7px 24px rgba(31, 111, 232, .45); }
.nav-icon { fill: none; height: 24px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; width: 24px; }
.bottom-nav .nav-center .nav-icon { height: 29px; width: 29px; }
.top-actions .nav-icon { height: 20px; width: 20px; }
.bottom-nav span { font-size: 11px; font-weight: 750; }
.modal { backdrop-filter: blur(6px); }
.modal-card { background: var(--panel); border-radius: 20px; box-shadow: var(--shadow); }
.toast { background: #154e70; border-radius: 11px; box-shadow: var(--shadow); max-width: calc(100vw - 32px); }

:root.light .topbar, :root.light .bottom-nav { background: rgba(255, 255, 255, .95); }
:root.light .auth-page { background: radial-gradient(circle at 15% 20%, #d6e8fa, transparent 48%), #edf4fc; }
:root.light .auth-story h2 em { color: #185cba; }
:root.light .auth-story-tags span { color: #244d7a; }
:root.light .auth-card { background: white; }
:root.light .role-switch { background: #e6f0f8; }
:root.light .role-switch a.active { color: white; }
:root.light .warning-panel { background: linear-gradient(145deg, #fff1ef, #f5f5fd); }
:root.light .warning-panel .eyebrow { color: #a52b3c; }
:root.light .weather-hero { background: linear-gradient(145deg, #1f548e, #18335d); color: white; }
:root.light .weather-hero .muted, :root.light .weather-hero .temperature small, :root.light .weather-hero .updated-at { color: #d5e7ff; }
:root.light .field label { color: #43607d; }
:root.light .role-pill { color: #125077; }
:root.light .bottom-nav a:hover:not(.disabled), :root.light .bottom-nav a.active { color: #155a9e; }
:root.light .button.secondary { color: var(--text); }
:root.light .alert-card[data-severity="CRITICAL"] { background: linear-gradient(90deg, #fff0f1, #fff 72%); }
:root.light .alert-card[data-severity="HIGH"] { background: linear-gradient(90deg, #fff4e9, #fff 72%); }
:root.light .alert-card[data-severity="MODERATE"] { background: linear-gradient(90deg, #fff9e9, #fff 72%); }
:root.light .alert-level { color: #905c08; }
:root.light .alert-card[data-severity="CRITICAL"] .alert-level { color: #9e2635; }
:root.light .alert-card[data-severity="HIGH"] .alert-level { color: #9b4f15; }
:root.light .button.reject { color: #962334; }

@media (max-width: 900px) {
  .auth-shell { gap: 32px; grid-template-columns: minmax(0, 1fr) minmax(340px, 420px); }
  .auth-story h2 { font-size: 38px; }
  .auth-story-art { height: 230px; }
  .home-layout { grid-template-columns: minmax(0, 1fr) minmax(300px, .8fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  body { background: var(--body-background); }
  .auth-page { padding: 24px 16px; }
  .auth-shell { display: block; max-width: 470px; }
  .auth-story { display: none; }
  .auth-card { padding: 22px; }
  .topbar { min-height: 66px; padding-inline: 16px; }
  .brand { font-size: 19px; }
  .brand-mark { height: 38px; width: 38px; }
  .app-shell { max-width: 560px; padding: 28px 16px calc(104px + env(safe-area-inset-bottom)); }
  .location-row { align-items: start; gap: 10px; }
  .location-row > .muted { font-size: 12px; text-align: right; }
  .home-layout { gap: 12px; grid-template-columns: 1fr; }
  .weather-hero { min-height: 335px; padding: 23px; }
  .weather-icon { font-size: 56px; margin-top: 38px; }
  .temperature { font-size: clamp(72px, 17vw, 90px); }
  .weather-grid { gap: 7px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .metric { padding: 12px 9px; }
  .metric small { font-size: 11px; line-height: 1.35; }
  .metric strong { font-size: clamp(15px, 4vw, 20px); overflow-wrap: anywhere; }
  .warning-panel { min-height: 260px; }
  .warning-panel .risk-icon { margin: 26px 0 17px; }
  .warning-panel .button { margin-top: 14px; }
  .page-heading { align-items: start; gap: 12px; }
  .page-heading h1 { font-size: 34px; }
  .active-count { align-self: start; font-size: 11px; }
  .alert-summary { gap: 10px; grid-template-columns: auto minmax(0, 1fr) auto; padding: 17px 14px; }
  .alert-title { font-size: 17px; }
  .alert-detail { padding-inline: 14px; }
  .professional-shell { padding: 26px 16px 110px; }
  .professional-heading { align-items: start; }
  .dashboard-panel-header { flex-wrap: wrap; }
  .dashboard-panel-header .button { width: auto; }
  .stats-row { gap: 8px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stat-card { min-height: 106px; padding: 14px 10px; }
  .stat-card::before { left: 10px; right: 10px; }
  .stat-card .muted { font-size: 11px; }
  .stat-card strong { font-size: clamp(16px, 5vw, 28px); overflow-wrap: anywhere; }
  .profile-page .profile-summary { min-height: 0; }
  .map-disclaimer { font-size: 11px; left: 16px; max-width: none; right: 16px; top: 62px; width: auto; }
  .map-fallback { left: 16px; top: 62px; width: calc(100vw - 32px); }
  .map-header span { max-width: 90px; }
}
@media (max-width: 380px) {
  .location-row { align-items: start; flex-direction: column; }
  .page-heading { flex-direction: column; }
  .weather-grid { gap: 5px; }
  .metric { padding: 11px 6px; }
  .alert-summary { grid-template-columns: auto minmax(0, 1fr); }
  .alert-summary > :last-child { grid-column: 2; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; }
}
