:root {
  --ink: #162126;
  --muted: #627176;
  --paper: #eef7f6;
  --panel: #ffffff;
  --line: #d7e6e4;
  --teal: #0f8a83;
  --teal-dark: #0a5f5a;
  --blue: #256bd7;
  --red: #d84d42;
  --amber: #de9d27;
  --shadow: 0 18px 48px rgba(22, 33, 38, 0.1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Arial, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  line-height: 1.55;
}
button, input, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 68px;
  padding: 0 clamp(16px, 4vw, 56px);
  border-bottom: 1px solid rgba(215, 230, 228, 0.9);
  background: rgba(238, 247, 246, 0.94);
  backdrop-filter: blur(14px);
}
.brand, .topbar nav { display: flex; align-items: center; gap: 12px; }
.brand { font-weight: 900; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--teal);
  color: white;
  font-size: 24px;
  font-weight: 900;
}
.topbar nav a { color: var(--muted); font-size: 14px; font-weight: 800; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(290px, 0.36fr);
  gap: 22px;
  padding: clamp(24px, 5vw, 64px);
}
.hero-copy, .status-card, .filters, .panel, .trust-band, .article-section, .source-section, .faq-section, .ad-slot, .site-footer {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 14px 34px rgba(22, 33, 38, 0.06);
}
.hero-copy { padding: clamp(26px, 5vw, 58px); }
.eyebrow { margin: 0 0 10px; color: var(--teal-dark); font-size: 13px; font-weight: 900; }
h1, h2, h3, p { margin-top: 0; }
h1 { max-width: 820px; margin-bottom: 16px; font-size: clamp(40px, 6vw, 74px); line-height: 1.04; }
h2 { margin-bottom: 12px; font-size: clamp(24px, 3vw, 34px); line-height: 1.15; }
.lead { max-width: 720px; margin-bottom: 28px; color: var(--muted); font-size: 18px; }
.hero-actions, .emergency-actions, .card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.primary-link, .secondary-link, button, .card-actions a, .emergency-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 15px;
  border: 0;
  border-radius: 8px;
  background: var(--teal);
  color: white;
  font-weight: 900;
}
.secondary-link, button.secondary {
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
}
.status-card {
  display: grid;
  align-content: space-between;
  min-height: 330px;
  padding: 26px;
  background: linear-gradient(145deg, rgba(15, 138, 131, 0.95), rgba(37, 107, 215, 0.88));
  color: white;
}
.status-card span { color: rgba(255,255,255,0.78); font-weight: 900; }
.status-card strong { font-size: clamp(54px, 7vw, 84px); line-height: 0.95; }
.status-card p { color: rgba(255,255,255,0.86); }
.trust-list { display: flex; flex-wrap: wrap; gap: 8px; }
.trust-list span {
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255,255,255,0.16);
  color: white;
  font-weight: 900;
}

.trust-band {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0 clamp(24px, 5vw, 64px) 22px;
  padding: 14px;
}
.trust-band article {
  display: grid;
  gap: 4px;
  padding: 14px;
  border-radius: 8px;
  background: #fbfefd;
}
.trust-band strong { font-size: 17px; }
.trust-band span { color: var(--muted); font-weight: 700; }
.ad-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 84px;
  margin: 0 clamp(24px, 5vw, 64px) 22px;
  padding: 16px;
  text-align: center;
}
.ad-slot span {
  padding: 7px 10px;
  border-radius: 8px;
  background: #eef2f7;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}
.ad-slot p { margin: 0; color: var(--muted); font-weight: 700; }

.filters {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) repeat(2, minmax(130px, 0.6fr)) auto auto;
  gap: 10px;
  margin: 0 clamp(24px, 5vw, 64px) 22px;
  padding: 14px;
}
label { display: grid; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 900; }
input, select {
  width: 100%;
  min-height: 48px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfefd;
  color: var(--ink);
  outline: none;
}
input:focus, select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 138, 131, 0.13);
}
.check-field {
  display: flex;
  align-items: center;
  align-self: end;
  min-height: 48px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfefd;
}
.check-field input { width: 18px; min-height: 18px; accent-color: var(--teal); }

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.34fr);
  gap: 22px;
  padding: 0 clamp(24px, 5vw, 64px) clamp(34px, 6vw, 76px);
}
.panel { padding: clamp(18px, 3vw, 28px); }
.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}
.section-head select { max-width: 150px; }
.result-list, .saved-list, .side-stack { display: grid; gap: 14px; }
.hospital-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfefd;
}
.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.hospital-card p { margin-bottom: 0; color: var(--muted); }
.meta-row { display: flex; flex-wrap: wrap; gap: 8px; }
.meta-row span {
  padding: 6px 9px;
  border-radius: 8px;
  background: #e9f5f4;
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 900;
}
.meta-row .night { background: #fff2df; color: #8a4b00; }
.meta-row .open { background: #edf7f2; color: #246a51; }
.save-button.is-saved { background: var(--blue); }
.saved-item {
  display: grid;
  gap: 4px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfefd;
}
.saved-item span, .empty { color: var(--muted); font-size: 14px; font-weight: 700; }
.emergency-panel {
  border-color: rgba(216, 77, 66, 0.35);
}
.emergency-panel .eyebrow { color: var(--red); }
.emergency-actions a:first-child { background: var(--red); }
.quick-tool label { margin-bottom: 12px; }
.tool-result {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 8px;
  background: #f2faf9;
  color: var(--muted);
}
.tool-result strong { color: var(--ink); }
.checklist-panel {
  display: grid;
  gap: 10px;
}
.todo {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 14px;
}
.todo input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--teal);
}
progress {
  width: 100%;
  height: 10px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: #e8f0ef;
}
progress::-webkit-progress-bar { background: #e8f0ef; }
progress::-webkit-progress-value { background: var(--teal); }
.call-panel p { color: var(--muted); }

.article-section, .source-section, .faq-section, .site-footer {
  margin: 0 clamp(24px, 5vw, 64px) 22px;
  padding: clamp(18px, 3vw, 28px);
}
.article-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.article-card {
  display: grid;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfefd;
}
.article-card span {
  width: fit-content;
  padding: 6px 9px;
  border-radius: 8px;
  background: #e9f5f4;
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 900;
}
.article-card p { color: var(--muted); }
.article-card a, .text-link {
  color: var(--teal-dark);
  font-weight: 900;
}
.source-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.source-grid a {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfefd;
  color: var(--teal-dark);
  font-weight: 900;
}
.faq-section {
  display: grid;
  gap: 10px;
}
details {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfefd;
}
summary {
  cursor: pointer;
  color: var(--ink);
  font-weight: 900;
}
details p {
  margin: 10px 0 0;
  color: var(--muted);
}
.site-footer {
  display: grid;
  gap: 10px;
  color: var(--muted);
}
.site-footer strong { color: var(--ink); }
.site-footer p { margin: 0; }
.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.site-footer a {
  color: var(--teal-dark);
  font-weight: 900;
}
.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: min(360px, calc(100vw - 40px));
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: white;
  font-weight: 900;
  opacity: 0;
  transform: translateY(10px);
  transition: 0.2s ease;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 1040px) {
  .hero, .content-grid { grid-template-columns: 1fr; }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .article-grid, .trust-band, .source-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .topbar { align-items: flex-start; flex-direction: column; padding-top: 14px; padding-bottom: 14px; }
  .topbar nav { width: 100%; overflow-x: auto; padding-bottom: 2px; }
  h1 { font-size: 38px; }
  .hero, .content-grid { padding-left: 14px; padding-right: 14px; }
  .filters { grid-template-columns: 1fr; margin-left: 14px; margin-right: 14px; }
  .trust-band, .article-section, .source-section, .faq-section, .ad-slot, .site-footer { margin-left: 14px; margin-right: 14px; }
  .article-grid, .trust-band, .source-grid { grid-template-columns: 1fr; }
  .section-head { align-items: stretch; flex-direction: column; }
  .section-head select { max-width: none; }
  .card-actions a, .card-actions button, .hero-actions a { width: 100%; }
}
