:root {
  --ink: #172033;
  --muted: #64748b;
  --line: #dbe6f4;
  --paper: #ffffff;
  --soft: #f5f9ff;
  --teal: #2563eb;
  --teal-dark: #1d4ed8;
  --mint: #dbeafe;
  --coral: #0ea5e9;
  --amber: #60a5fa;
  --shadow: 0 18px 55px rgba(37, 99, 235, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--soft);
  color: var(--ink);
  font-family: "Noto Sans KR", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.55;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 72px;
  padding: 14px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid rgba(220, 230, 225, 0.86);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  flex: 0 0 auto;
  object-fit: contain;
}

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

.brand strong {
  font-size: 17px;
  letter-spacing: 0;
}

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

.top-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-nav a {
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.top-nav a:hover {
  background: var(--mint);
  color: var(--teal-dark);
}

.hero {
  position: relative;
  min-height: min(340px, calc(50vh - 36px));
  overflow: hidden;
  background: #e8f2ff;
}

.hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero::after {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(90deg, rgba(245, 249, 255, 0.96) 0%, rgba(245, 249, 255, 0.82) 36%, rgba(245, 249, 255, 0.28) 68%, rgba(245, 249, 255, 0.08) 100%),
    linear-gradient(0deg, rgba(245, 249, 255, 1) 0%, rgba(245, 249, 255, 0) 28%);
}

.hero-content {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: center;
  width: min(1180px, calc(100% - 36px));
  min-height: min(340px, calc(50vh - 36px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.eyebrow {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  padding: 5px 9px;
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 800;
}

.hero h1 {
  max-width: 430px;
  margin: 0;
  font-size: clamp(24px, 3.5vw, 38px);
  line-height: 1.08;
  letter-spacing: 0;
}

.hero p {
  max-width: 520px;
  margin: 12px 0 0;
  color: #40526f;
  font-size: clamp(13px, 1.2vw, 16px);
}

.search-panel {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  width: min(650px, 100%);
  margin-top: 18px;
  padding: 6px;
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.search-panel input {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 13px 14px;
  color: var(--ink);
  outline: none;
}

.primary-button,
.secondary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0 16px;
  cursor: pointer;
  font-weight: 800;
  white-space: nowrap;
}

.primary-button {
  background: var(--teal);
  color: white;
}

.primary-button:hover {
  background: var(--teal-dark);
}

.secondary-button {
  border-color: var(--line);
  background: white;
  color: var(--teal-dark);
}

.ghost-button {
  background: transparent;
  color: var(--teal-dark);
}

.section {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: 72px 0;
}

.section.compact {
  padding-top: 36px;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.section-head h2,
.page-title h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.18;
  letter-spacing: 0;
}

.section-head p,
.page-title p {
  max-width: 680px;
  margin: 8px 0 0;
  color: var(--muted);
}

.region-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.region-card,
.shelter-item,
.info-block,
.filter-bar {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 10px 28px rgba(37, 99, 235, 0.07);
}

.region-card {
  display: grid;
  min-height: 178px;
  padding: 20px;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.region-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.region-card .topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.region-card h3 {
  margin: 18px 0 8px;
  font-size: 25px;
  letter-spacing: 0;
}

.region-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.region-card .meta {
  align-self: end;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 22px;
  color: var(--teal-dark);
  font-weight: 800;
}

.stat-band {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.stat-band div {
  padding: 24px;
  background: white;
}

.stat-band strong {
  display: block;
  color: var(--teal-dark);
  font-size: 32px;
  line-height: 1;
}

.stat-band span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}

.page-hero {
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #f5faf7 100%);
}

.page-title {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: 48px 0 34px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 22px;
  align-items: start;
}

.filter-bar {
  display: grid;
  grid-template-columns: 1fr 180px 180px;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px;
}

.filter-bar input,
.filter-bar select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 0 12px;
  color: var(--ink);
}

.shelter-list {
  display: grid;
  gap: 12px;
}

.shelter-item {
  padding: 18px;
}

.shelter-item.is-active {
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 14px 36px rgba(37, 99, 235, 0.16);
}

.shelter-item header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.shelter-item h3 {
  margin: 0 0 8px;
  font-size: 20px;
  letter-spacing: 0;
}

.shelter-item address,
.shelter-item p {
  margin: 0;
  color: var(--muted);
  font-style: normal;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  background: var(--mint);
  color: var(--teal-dark);
  padding: 0 10px;
  font-size: 13px;
  font-weight: 800;
}

.item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.map-panel {
  position: sticky;
  top: 92px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: 0 10px 28px rgba(37, 99, 235, 0.07);
}

.map-art {
  position: relative;
  min-height: 360px;
  background:
    linear-gradient(90deg, rgba(37, 99, 235, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(37, 99, 235, 0.08) 1px, transparent 1px),
    #eef6ff;
  background-size: 46px 46px;
}

.kakao-map {
  position: relative;
  width: 100%;
  min-height: 430px;
  background: #eef6ff;
}

.map-fallback {
  display: grid;
  min-height: 430px;
  place-content: center;
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.map-fallback strong {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
}

.map-info {
  display: grid;
  gap: 4px;
  min-width: 210px;
  padding: 12px;
  color: var(--ink);
  font-family: "Noto Sans KR", system-ui, sans-serif;
  line-height: 1.35;
}

.map-info strong {
  color: var(--teal-dark);
  font-size: 14px;
}

.map-info span,
.map-info em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.map-road {
  position: absolute;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
}

.map-road.one {
  top: 100px;
  left: -24px;
  width: 108%;
  height: 30px;
  transform: rotate(-8deg);
}

.map-road.two {
  top: 220px;
  left: 14%;
  width: 92%;
  height: 24px;
  transform: rotate(20deg);
}

.pin {
  position: absolute;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 3px solid white;
  border-radius: 999px;
  background: var(--coral);
  color: white;
  box-shadow: 0 8px 22px rgba(14, 165, 233, 0.34);
  font-size: 13px;
  font-weight: 900;
}

.map-caption {
  padding: 18px;
  border-top: 1px solid var(--line);
}

.map-caption strong {
  display: block;
  margin-bottom: 6px;
}

.map-caption p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.info-block {
  padding: 22px;
}

.info-block h3 {
  margin: 0 0 10px;
  font-size: 19px;
}

.info-block p {
  margin: 0;
  color: var(--muted);
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 34px clamp(18px, 4vw, 56px);
  border-top: 1px solid var(--line);
  background: white;
  color: var(--muted);
}

.site-footer p {
  margin: 6px 0 0;
}

.empty {
  padding: 36px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: white;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 980px) {
  .region-grid,
  .info-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .map-panel {
    position: relative;
    top: auto;
  }
}

@media (max-width: 720px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-nav {
    width: 100%;
    overflow-x: auto;
  }

  .hero,
  .hero-content {
    min-height: 320px;
  }

  .hero::after {
    background:
      linear-gradient(180deg, rgba(245, 249, 255, 0.98) 0%, rgba(245, 249, 255, 0.88) 54%, rgba(245, 249, 255, 0.26) 100%),
      linear-gradient(0deg, rgba(245, 249, 255, 1) 0%, rgba(245, 249, 255, 0) 24%);
  }

  .search-panel,
  .filter-bar {
    grid-template-columns: 1fr;
  }

  .section-head,
  .site-footer {
    align-items: start;
    flex-direction: column;
  }

  .region-grid,
  .info-grid,
  .stat-band {
    grid-template-columns: 1fr;
  }

  .shelter-item header {
    flex-direction: column;
  }
}
