:root {
  --bg: #f3f6fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #dbe3ef;
  --blue: #2563eb;
  --blue-dark: #1e40af;
  --red: #dc2626;
  --red-soft: #fef2f2;
  --green: #16a34a;
  --green-soft: #ecfdf3;
  --amber: #d97706;
  --shadow: 0 18px 48px rgba(15, 23, 42, 0.10);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 72px;
  padding: 12px max(20px, calc((100vw - 1200px) / 2));
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid rgba(219, 227, 239, 0.9);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  color: white;
  background: var(--blue);
  font-weight: 900;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
  font-size: 12px;
}

.quick-nav {
  display: flex;
  gap: 8px;
}

.quick-nav button,
.secondary-action,
.footer button {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: white;
  font-weight: 700;
}

main {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto 40px;
}

.hero {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 24px;
  align-items: stretch;
  min-height: 430px;
  margin-top: 22px;
  padding: 34px;
  border-radius: 16px;
  color: white;
  background:
    linear-gradient(90deg, rgba(8, 13, 28, 0.94), rgba(8, 13, 28, 0.58)),
    url("https://images.unsplash.com/photo-1579547621113-e4bb2a19bdd6?auto=format&fit=crop&w=1800&q=80") center/cover;
  box-shadow: var(--shadow);
}

.hero-copy {
  align-self: end;
  max-width: 760px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 10px;
  color: #93c5fd;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 18px;
  font-size: clamp(38px, 5vw, 68px);
  line-height: 1;
  letter-spacing: 0;
}

.lead {
  max-width: 720px;
  color: #dbeafe;
  font-size: 19px;
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.primary-action,
.locate-action {
  min-height: 46px;
  padding: 0 18px;
  border: 0;
  border-radius: 8px;
  color: white;
  background: var(--blue);
  font-weight: 900;
}

.route-action,
.small-route-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  color: white;
  background: var(--green);
  font-weight: 900;
  text-decoration: none;
}

.small-route-action {
  margin-top: 12px;
}

.primary-action:hover,
.locate-action:hover {
  background: var(--blue-dark);
}

.status-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.62);
  backdrop-filter: blur(16px);
}

.status-row {
  display: flex;
  gap: 14px;
  align-items: center;
}

.status-row strong,
.status-row small {
  display: block;
}

.status-row small {
  margin-top: 4px;
  color: #bfdbfe;
}

.status-dot {
  width: 14px;
  height: 14px;
  border-radius: 99px;
  background: #94a3b8;
}

.status-dot.active {
  background: #f87171;
  box-shadow: 0 0 0 8px rgba(248, 113, 113, 0.18);
}

.status-dot.clear {
  background: #4ade80;
  box-shadow: 0 0 0 8px rgba(74, 222, 128, 0.16);
}

.status-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 28px;
}

.status-metrics div {
  padding: 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.10);
}

.status-metrics strong {
  display: block;
  font-size: 28px;
}

.status-metrics span {
  color: #cbd5e1;
  font-size: 13px;
}

.toolbar,
.insight-strip,
.content-section,
.nearest-panel,
.footer {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.toolbar {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 14px;
  align-items: end;
  margin-top: 18px;
  padding: 18px;
}

.field label {
  display: block;
  margin-bottom: 8px;
  color: #334155;
  font-size: 13px;
  font-weight: 900;
}

.field select {
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: white;
  color: var(--ink);
}

.insight-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin-top: 18px;
  overflow: hidden;
}

.insight-strip article {
  padding: 18px;
  background: white;
}

.insight-strip span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.insight-strip strong {
  font-size: 20px;
}

.nearest-panel {
  margin-top: 18px;
  padding: 18px;
  border-color: #bfdbfe;
  background: #eff6ff;
}

.nearest-panel p {
  margin-bottom: 12px;
}

.content-section {
  margin-top: 18px;
  padding: 26px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 22px;
}

.section-heading h2 {
  margin-bottom: 0;
  font-size: 30px;
}

.section-heading p:last-child {
  max-width: 460px;
  margin-bottom: 0;
  color: var(--muted);
  text-align: right;
  line-height: 1.5;
}

.alert-list,
.news-list,
.accordion-list,
.shelter-list {
  display: grid;
  gap: 12px;
}

.notice,
.medical-item,
.shelter-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
}

.notice {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  padding: 18px;
}

.notice.active {
  border-color: #fecaca;
  background: var(--red-soft);
}

.notice h3,
.shelter-card h3 {
  margin-bottom: 8px;
  font-size: 18px;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
}

.meta a,
.notice a {
  color: var(--blue);
  font-weight: 800;
  text-decoration: none;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: max-content;
  height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
}

.badge.red {
  color: #991b1b;
  background: #fee2e2;
}

.badge.green {
  color: #166534;
  background: #dcfce7;
}

.badge.blue {
  color: #1d4ed8;
  background: #dbeafe;
}

.badge.amber {
  color: #92400e;
  background: #fef3c7;
}

.map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.6fr);
  gap: 18px;
}

#map {
  width: 100%;
  min-height: 620px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.map-side {
  max-height: 620px;
  overflow: auto;
  padding-right: 4px;
}

.map-side h3 {
  position: sticky;
  top: 0;
  z-index: 1;
  margin: 0 0 12px;
  padding: 0 0 10px;
  background: white;
}

.shelter-card {
  padding: 16px;
}

.shelter-card p {
  color: #334155;
}

.medical-item button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: 100%;
  min-height: 56px;
  padding: 16px;
  border: 0;
  border-radius: 10px;
  background: white;
  color: var(--ink);
  font-weight: 900;
  text-align: left;
}

.medical-steps {
  display: none;
  margin: 0;
  padding: 0 20px 18px 38px;
  color: #334155;
}

.medical-item.open .medical-steps {
  display: block;
}

.medical-steps li {
  margin: 8px 0;
}

.footer {
  width: min(1200px, calc(100% - 32px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 auto 34px;
  padding: 18px;
  color: var(--muted);
}

.footer button {
  width: auto;
}

.alert-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.62);
  backdrop-filter: blur(8px);
}

.alert-modal-card {
  position: relative;
  width: min(520px, 100%);
  padding: 28px;
  border-radius: 14px;
  background: white;
  box-shadow: 0 28px 90px rgba(15, 23, 42, 0.28);
}

.alert-modal-card h2 {
  margin: 16px 0 10px;
  font-size: 30px;
}

.alert-modal-card p {
  color: var(--muted);
  line-height: 1.55;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.hidden {
  display: none !important;
}

@media (max-width: 940px) {
  .topbar,
  .quick-nav,
  .hero,
  .section-heading,
  .footer {
    display: block;
  }

  .quick-nav {
    margin-top: 12px;
    overflow-x: auto;
    white-space: nowrap;
  }

  .quick-nav button {
    margin-right: 6px;
  }

  .hero {
    padding: 24px;
  }

  .status-panel {
    margin-top: 24px;
  }

  .toolbar,
  .insight-strip,
  .map-layout {
    grid-template-columns: 1fr;
  }

  .locate-action {
    width: 100%;
  }

  .section-heading p:last-child {
    margin-top: 8px;
    text-align: left;
  }

  #map {
    min-height: 420px;
  }

  .map-side {
    max-height: none;
  }

  .footer button {
    width: 100%;
    margin-top: 12px;
  }
}

@media (max-width: 560px) {
  main,
  .footer {
    width: min(100% - 20px, 1200px);
  }

  .topbar {
    padding: 10px;
  }

  h1 {
    font-size: 34px;
  }

  .lead {
    font-size: 16px;
  }

  .hero-actions {
    display: grid;
  }

  .primary-action,
  .secondary-action,
  .route-action {
    width: 100%;
  }

  .notice {
    grid-template-columns: 1fr;
  }
}
