/* machim 공통 스타일
   원칙: 보통 크기 + 위계(굵기·색·여백), 강조색 하나(청록), 얇은 선과 옅은 그림자, 밝게·어둡게·시스템 */

/* ---------- 색 (밝게: 기본) ---------- */
:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f1f3f6;
  --text: #121417;
  --text-2: #4d5562;
  --text-3: #8d94a0;
  --line: #e9ecf0;
  --line-strong: #d9dde4;
  --accent: #0e7c70;
  --accent-strong: #0a6a5f;
  --accent-soft: #e9f6f3;
  --accent-line: #bfe5de;
  --on-accent: #ffffff;
  --critical: #c23b2e;
  --critical-soft: #fdeeec;
  --shadow-sm: 0 1px 2px rgba(17, 24, 39, 0.04);
  --shadow: 0 1px 2px rgba(17, 24, 39, 0.04), 0 4px 14px rgba(17, 24, 39, 0.05);
  --shadow-pop: 0 10px 30px rgba(17, 24, 39, 0.12), 0 2px 6px rgba(17, 24, 39, 0.06);
  --header-bg: rgba(255, 255, 255, 0.82);
}

/* ---------- 색 (어둡게): 시스템이 다크이고 밝게를 고르지 않았을 때 + 어둡게를 골랐을 때 ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0e1013;
    --surface: #16191e;
    --surface-2: #1c2026;
    --text: #eceef1;
    --text-2: #a8aeb9;
    --text-3: #707784;
    --line: #23272e;
    --line-strong: #30353e;
    --accent: #3ec6b4;
    --accent-strong: #66d4c6;
    --accent-soft: rgba(62, 198, 180, 0.12);
    --accent-line: rgba(62, 198, 180, 0.32);
    --on-accent: #06211d;
    --critical: #f2877b;
    --critical-soft: rgba(242, 135, 123, 0.12);
    --shadow-sm: none;
    --shadow: 0 0 0 1px rgba(255, 255, 255, 0.02);
    --shadow-pop: 0 12px 32px rgba(0, 0, 0, 0.5);
    --header-bg: rgba(14, 16, 19, 0.78);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e1013;
  --surface: #16191e;
  --surface-2: #1c2026;
  --text: #eceef1;
  --text-2: #a8aeb9;
  --text-3: #707784;
  --line: #23272e;
  --line-strong: #30353e;
  --accent: #3ec6b4;
  --accent-strong: #66d4c6;
  --accent-soft: rgba(62, 198, 180, 0.12);
  --accent-line: rgba(62, 198, 180, 0.32);
  --on-accent: #06211d;
  --critical: #f2877b;
  --critical-soft: rgba(242, 135, 123, 0.12);
  --shadow-sm: none;
  --shadow: 0 0 0 1px rgba(255, 255, 255, 0.02);
  --shadow-pop: 0 12px 32px rgba(0, 0, 0, 0.5);
  --header-bg: rgba(14, 16, 19, 0.78);
}

/* ---------- 폰트: Pretendard v1.3.9 (SIL OFL 1.1, static/fonts/LICENSE-Pretendard.txt) ---------- */
/* KS X 1001 한글 2,350자 subset. 글자를 먼저 기본 글꼴로 보이고 받으면 바꾼다 (swap). 파일 이름에 버전이 없어 ?v= 로 캐시를 고정한다 */
@font-face { font-family: "Pretendard"; font-weight: 400; font-display: swap; src: url("fonts/Pretendard-Regular.subset.woff2?v=1.3.9") format("woff2"); }
@font-face { font-family: "Pretendard"; font-weight: 600; font-display: swap; src: url("fonts/Pretendard-SemiBold.subset.woff2?v=1.3.9") format("woff2"); }
@font-face { font-family: "Pretendard"; font-weight: 700; font-display: swap; src: url("fonts/Pretendard-Bold.subset.woff2?v=1.3.9") format("woff2"); }
@font-face { font-family: "Pretendard"; font-weight: 800; font-display: swap; src: url("fonts/Pretendard-ExtraBold.subset.woff2?v=1.3.9") format("woff2"); }

/* ---------- 기본 ---------- */
:root {
  --radius: 14px;
  --radius-sm: 10px;
  --wrap: 680px;
  --font: "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: -0.012em;
  word-break: keep-all;
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
main.wrap { padding-top: 28px; padding-bottom: 56px; }

/* ---------- 헤더 · 로고 · 테마 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-inner { height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 9px; }
.brand-mark { color: var(--accent); flex: none; }
.brand-text { display: inline-flex; align-items: baseline; gap: 6px; font-size: 17px; letter-spacing: -0.03em; }
.brand-name { font-weight: 800; color: var(--accent); }
.brand-service { font-weight: 700; color: var(--text); }

.theme-toggle {
  display: none; /* 자바스크립트가 있을 때만 */
  padding: 3px; gap: 2px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px;
}
.js .theme-toggle { display: inline-flex; }
.theme-toggle button {
  width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 999px; background: transparent; color: var(--text-3); cursor: pointer;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.theme-toggle button:hover { color: var(--text); }
.theme-toggle button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm), 0 0 0 1px var(--line); }

/* ---------- 홈 상단 ---------- */
.hero { padding: 8px 0 20px; }
.hero-title { font-size: 26px; line-height: 1.3; font-weight: 800; letter-spacing: -0.04em; }
.hero-lead { margin-top: 10px; color: var(--text-2); font-size: 15px; line-height: 1.65; }
.hero-meta { display: block; margin-top: 4px; color: var(--text-3); font-size: 13px; }

/* ---------- 검색 ---------- */
.search-section { margin-bottom: 32px; }
.search-section .section-title { margin-bottom: 10px; }
.search { position: relative; }
.search-field {
  display: flex; align-items: center; gap: 12px;
  height: 58px; padding: 0 18px;
  background: var(--surface); border: 2px solid var(--accent-line); border-radius: 16px;
  box-shadow: var(--shadow); color: var(--accent);
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.search-field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); color: var(--accent); }
.search-field:hover { border-color: var(--accent); }
.search-field input {
  flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent;
  font-size: 17px; font-weight: 500; color: var(--text);
}
.search-field input::placeholder { color: var(--text-3); font-weight: 400; }
.search-field svg { width: 20px; height: 20px; }
.search-field input::-webkit-search-cancel-button { cursor: pointer; }
.search-suggest:empty { display: none; }
.search-suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 20;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-pop); max-height: min(70vh, 520px); overflow-y: auto;
}
.suggest { padding: 6px 0; }
.suggest-empty { padding: 14px 16px; font-size: 14px; color: var(--text-2); }
.suggest-more { display: block; padding: 12px 16px; border-top: 1px solid var(--line); font-size: 14px; font-weight: 600; color: var(--accent); }
.suggest-more:hover { background: var(--surface-2); }
.result-label { padding: 10px 16px 4px; font-size: 12px; font-weight: 600; color: var(--text-3); letter-spacing: 0; }
.result-list { list-style: none; margin: 0; padding: 0; }
.result { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 10px 16px; transition: background 0.12s var(--ease); }
.result:hover, .result:focus-visible { background: var(--surface-2); outline-offset: -2px; }
.result-name { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-sub { flex: none; font-size: 13px; color: var(--text-3); }
.panel { margin-top: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px 0; }
.muted-text { margin-top: 16px; color: var(--text-2); font-size: 14px; }

/* 내 위치 */
.locate { display: none; margin-top: 10px; }
.js .locate { display: block; }
.locate-btn {
  width: 100%; height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line-strong); border-radius: 14px; background: var(--surface); color: var(--text);
  font-size: 15px; font-weight: 600; cursor: pointer; box-shadow: var(--shadow-sm);
  transition: border-color 0.15s var(--ease), color 0.15s var(--ease), background 0.15s var(--ease);
}
.locate-btn svg { color: var(--accent); }
.locate-btn:hover { border-color: var(--accent); color: var(--accent); }
.locate-btn:disabled { cursor: progress; opacity: 0.7; }
.locate-msg:empty { display: none; }
/* 진료과목별 내 주변 카드 (홈) */
.js .dept-locate { margin-top: 16px; }
.dept-locate-title { margin-bottom: 8px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.dept-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.locate-btn.dept-card {
  height: auto; padding: 14px; gap: 12px;
  justify-content: flex-start; text-align: left; border-radius: var(--radius);
  border-color: var(--line); box-shadow: var(--shadow);
}
.locate-btn.dept-card:hover { border-color: var(--accent-line); background: var(--accent-soft); color: var(--text); }
.dept-card-icon {
  flex: none; width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 12px; background: var(--accent-soft); color: var(--accent);
}
.dept-card-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.dept-card-text strong { font-size: 15px; font-weight: 700; letter-spacing: -0.02em; white-space: nowrap; }
.dept-card-text .locate-label { margin-top: 2px; font-size: 13px; font-weight: 500; color: var(--text-2); }
/* 좁은 화면: 아이콘을 글자 위로 */
@media (max-width: 480px) {
  .locate-btn.dept-card { flex-direction: column; align-items: flex-start; gap: 10px; }
  .dept-card-icon { width: 38px; height: 38px; border-radius: 11px; }
}

/* 진료과목 필터 */
.filter { margin: 0 0 16px; }
.filter-label { font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 8px; }
.filter-chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.filter-chips::-webkit-scrollbar { display: none; }
.fchip {
  flex: none; display: inline-flex; align-items: baseline; gap: 5px;
  padding: 7px 12px; border-radius: 999px; white-space: nowrap;
  background: var(--surface); border: 1px solid var(--line); font-size: 13px; color: var(--text-2);
  transition: border-color 0.12s var(--ease), color 0.12s var(--ease), background 0.12s var(--ease);
}
.fchip:hover { border-color: var(--accent); color: var(--accent); }
.fchip.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.fchip.empty:not(.on) { color: var(--text-3); }
.fchip .n { font-size: 11px; opacity: 0.75; font-variant-numeric: tabular-nums; }
.filter-note { margin-top: 8px; font-size: 12px; color: var(--text-3); line-height: 1.55; }
.locate-msg { margin-top: 8px; font-size: 13px; color: var(--critical); }
.near-note { margin: -12px 0 14px; font-size: 13px; color: var(--text-3); }
.empty-panel { padding: 20px; }
.empty-panel p { color: var(--text-2); font-size: 14px; }
.empty-panel .locate { margin-top: 14px; }
.empty-links { margin-top: 12px; }
.empty-links a { color: var(--accent); font-weight: 600; }
.row-sub .dist { color: var(--accent); font-weight: 700; }
.badge.small { margin-left: 6px; padding: 1px 7px; font-size: 11px; vertical-align: 2px; }

/* ---------- 안내 (방문 전 전화) ---------- */
.callout {
  margin: 4px 0 28px; padding: 16px;
  background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: var(--radius);
}
.callout-main { display: flex; align-items: flex-start; gap: 12px; }
.callout-icon {
  flex: none; width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; background: var(--accent); color: var(--on-accent);
}
.callout-icon svg { width: 17px; height: 17px; }
.callout-body { flex: 1; min-width: 0; }
.callout-title { font-weight: 700; font-size: 15px; line-height: 1.45; color: var(--text); }
.callout-text { margin-top: 2px; font-size: 13px; color: var(--text-2); }
.callout-119row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--accent-line);
  font-size: 13px; color: var(--text-2); line-height: 1.5;
}
.callout-119row strong { color: var(--text); font-weight: 600; }
.callout-119 {
  flex: none; display: inline-flex; align-items: center; justify-content: center; white-space: nowrap;
  height: 34px; padding: 0 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--critical-soft);
  color: var(--critical); font-weight: 800; font-size: 14px; letter-spacing: 0;
  box-shadow: var(--shadow-sm);
  transition: background 0.15s var(--ease);
}
.callout-119:hover { background: var(--critical-soft); }

/* ---------- 페이지 머리 ---------- */
.page-head { margin-bottom: 20px; }
.crumb { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: var(--text-3); margin-bottom: 8px; }
.crumb a { transition: color 0.12s var(--ease); }
.crumb a:hover { color: var(--accent); }
.crumb .sep { color: var(--text-3); opacity: 0.6; }
.page-title { font-size: 26px; font-weight: 800; letter-spacing: -0.04em; line-height: 1.3; }
.page-meta { margin-top: 6px; font-size: 13px; color: var(--text-2); }
.page-meta .dot { margin-right: 4px; color: var(--text-3); }
.section-title { margin: 0 0 12px; font-size: 17px; font-weight: 700; letter-spacing: -0.03em; }

/* ---------- 지역 목록 ---------- */
.group {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; margin-bottom: 14px;
}
.group-title {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 12px 18px; font-size: 13px; color: var(--text-2); font-weight: 600;
  background: var(--surface-2); border-bottom: 1px solid var(--line);
}
.group-title .count { font-weight: 500; color: var(--text-3); }
.group-title.critical { color: var(--critical); }
.row { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-top: 1px solid var(--line); transition: background 0.12s var(--ease); }
.group-title + .row { border-top: 0; }
.row:hover { background: var(--surface-2); }
.row-main { flex: 1; min-width: 0; }
.row-name { display: block; font-weight: 600; line-height: 1.4; letter-spacing: -0.02em; }
.row-main:hover .row-name { color: var(--accent); }
.row-sub { display: block; margin-top: 3px; font-size: 13px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.call {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 13px; border-radius: 999px;
  border: 1px solid var(--accent-line); background: var(--accent-soft);
  color: var(--accent); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: 0;
  white-space: nowrap; transition: background 0.15s var(--ease), color 0.15s var(--ease), border-color 0.15s var(--ease);
}
.call:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

/* ---------- 홈: 지역 ---------- */
.sido-nav { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; padding: 0; list-style: none; }
.sido-nav a {
  display: inline-block; padding: 6px 12px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); font-size: 13px; color: var(--text-2);
  transition: border-color 0.12s var(--ease), color 0.12s var(--ease);
}
.sido-nav a:hover { border-color: var(--accent); color: var(--accent); }
.sido {
  margin-bottom: 12px; padding: 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  scroll-margin-top: 76px;
}
.sido-title { display: flex; justify-content: space-between; align-items: baseline; font-size: 16px; font-weight: 700; letter-spacing: -0.03em; margin-bottom: 12px; }
.sido-title .count { font-size: 13px; font-weight: 500; color: var(--text-3); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; list-style: none; }
.chip {
  display: inline-flex; align-items: baseline; gap: 5px;
  padding: 7px 12px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid transparent; font-size: 14px;
  transition: border-color 0.12s var(--ease), background 0.12s var(--ease), color 0.12s var(--ease);
}
.chip:hover { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent); }
.chip .n { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }

/* ---------- 상세 ---------- */
.badge {
  display: inline-block; padding: 3px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; letter-spacing: 0;
  background: var(--surface-2); color: var(--text-2);
}
.badge.critical { background: var(--critical-soft); color: var(--critical); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 24px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 18px; border-radius: 12px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text);
  font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; white-space: nowrap;
  box-shadow: var(--shadow-sm);
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease);
}
.btn:hover { border-color: var(--text-3); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.info {
  margin: 0; padding: 4px 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.info div { display: grid; grid-template-columns: 92px 1fr; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.info div:first-child { border-top: 0; }
.info dt { color: var(--text-3); font-size: 14px; }
.info dd { margin: 0; }
.info dd a { color: var(--accent); font-weight: 700; }
.info .links { display: flex; gap: 14px; margin-top: 6px; font-size: 13px; }

/* 상세 카드: 행마다 값 + 버튼 */
.detail-card {
  margin-bottom: 14px; padding: 4px 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.detail-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 0; border-top: 1px solid var(--line); }
.detail-row:first-child { border-top: 0; }
.detail-row.stack { flex-direction: column; align-items: stretch; }
.detail-main { min-width: 0; }
.detail-label { font-size: 13px; color: var(--text-3); }
.detail-value { margin-top: 2px; line-height: 1.5; }
.detail-value.tel { font-size: 18px; font-weight: 700; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.detail-row .btn { flex: none; height: 42px; padding: 0 16px; font-size: 14px; }
.detail-actions .btn { flex: 1 1 0; min-width: 0; padding: 0 12px; }

/* 진료 정보 */
.info-card { padding: 18px; }
.peds { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; font-weight: 700; font-size: 15px; }
.peds-dot { width: 8px; height: 8px; border-radius: 999px; background: currentColor; }
.peds.yes { color: var(--accent); }
.peds.no { color: var(--text-2); }
.depts { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 0; padding: 0; list-style: none; }
.depts li { padding: 4px 10px; border-radius: 8px; background: var(--surface-2); font-size: 13px; color: var(--text-2); }
.depts li.hl { background: var(--accent-soft); color: var(--accent); font-weight: 700; box-shadow: inset 0 0 0 1px var(--accent-line); }
.info-note { margin-top: 10px; font-size: 12px; color: var(--text-3); line-height: 1.55; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin: 16px 0 0; }
.stats div { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); }
.stats dt { font-size: 12px; color: var(--text-3); }
.stats dd { margin: 2px 0 0; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: 0; }
.info-block { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 14px; color: var(--text-2); }
.info-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.hours summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text); }
.hours ul { margin: 8px 0 0; padding: 0; list-style: none; }
.hours li { display: flex; gap: 12px; padding: 3px 0; font-variant-numeric: tabular-nums; }
.hours li span { min-width: 64px; color: var(--text-3); }
.info-source { margin-top: 14px; font-size: 12px; color: var(--text-3); }

/* 지도 */
.map { margin-top: 12px; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); aspect-ratio: 16 / 10; }
.map iframe { display: block; width: 100%; height: 100%; border: 0; }

/* 기관 분류: 네 가지 중 이 병원 표시 */
.tier-intro { margin-top: 4px; font-size: 14px; color: var(--text-2); line-height: 1.6; }
.tier-list { margin: 14px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.tier-list li { padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--line); }
.tier-list li.current { border: 1.5px solid var(--accent); background: var(--accent-soft); }
.tier-list li.current.critical { border-color: var(--critical); background: var(--critical-soft); }
.tier-item-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tier-item-name { font-size: 14px; font-weight: 600; color: var(--text-2); }
.tier-list li.current .tier-item-name { color: var(--text); font-weight: 700; }
.tier-item-desc { margin-top: 2px; font-size: 12px; color: var(--text-3); }
.tier-here { flex: none; padding: 2px 8px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 700; letter-spacing: 0; }
.tier-list li.current.critical .tier-here { background: var(--critical); color: #fff; }
.tier-note { margin-top: 12px; font-size: 13px; color: var(--text-3); }

.tier { padding: 18px; }

/* ---------- 빈 화면 / 에러 ---------- */
.empty { padding: 56px 0; text-align: center; }
.empty-code { font-size: 13px; color: var(--text-3); font-variant-numeric: tabular-nums; letter-spacing: 0.08em; }
.empty h1 { margin: 8px 0 24px; font-size: 22px; letter-spacing: -0.03em; }

/* ---------- 하단 ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 24px 0 40px; font-size: 13px; color: var(--text-2); }
.site-footer p + p { margin-top: 4px; }
.site-footer .muted { color: var(--text-3); }

/* ---------- 마침 메인 (data-brand="home"): 응급실과 다른 자체 색 ---------- */
:root[data-brand="home"] {
  --wrap: 1080px;
  --bg: #f3f4f7;
  --surface: #ffffff;
  --surface-2: #eceef3;
  --text: #0b0c10;
  --text-2: #33363e;
  --text-3: #5f636d;
  --line: #d9dce3;
  --line-strong: #b9bec9;
  --accent: #3a37ff;
  --accent-strong: #2a27e0;
  --accent-soft: #e8e8ff;
  --accent-line: #b9b8ff;
  --on-accent: #ffffff;
  --header-bg: rgba(255, 255, 255, 0.86);
}
@media (prefers-color-scheme: dark) {
  :root[data-brand="home"]:not([data-theme="light"]) {
    --bg: #090a0e; --surface: #15171e; --surface-2: #1e2129;
    --text: #f4f5f7; --text-2: #c9ccd4; --text-3: #959aa5;
    --line: #2b2e38; --line-strong: #444958;
    --accent: #8f8dff; --accent-strong: #aaa8ff; --accent-soft: rgba(143, 141, 255, 0.16); --accent-line: rgba(143, 141, 255, 0.45);
    --on-accent: #0b0a33; --header-bg: rgba(9, 10, 14, 0.82);
  }
}
:root[data-brand="home"][data-theme="dark"] {
  --bg: #090a0e; --surface: #15171e; --surface-2: #1e2129;
  --text: #f4f5f7; --text-2: #c9ccd4; --text-3: #959aa5;
  --line: #2b2e38; --line-strong: #444958;
  --accent: #8f8dff; --accent-strong: #aaa8ff; --accent-soft: rgba(143, 141, 255, 0.16); --accent-line: rgba(143, 141, 255, 0.45);
  --on-accent: #0b0a33; --header-bg: rgba(9, 10, 14, 0.82);
}

/* 워드마크 "마침." */
.mk-logo { display: inline-flex; align-items: baseline; font-size: 22px; font-weight: 800; letter-spacing: -0.065em; line-height: 1; color: var(--text); }
.mk-logo-dot { display: inline-block; width: 0.3em; height: 0.3em; margin-left: 0.12em; border-radius: 999px; background: var(--accent); }

.mk-hero { display: grid; gap: 36px; padding: 44px 0 40px; }
.mk-slogan { font-size: 29px; line-height: 1.42; font-weight: 800; letter-spacing: -0.05em; color: var(--text); }
.mk-slogan-key { color: var(--accent); }
.mk-sub { margin-top: 12px; font-size: 15.5px; font-weight: 500; line-height: 1.6; color: var(--text-2); }
.mk-slogan-dot { color: var(--accent); }
.mk-facts { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 22px 0 0; padding: 0; list-style: none; }
.mk-facts li { display: inline-flex; align-items: center; gap: 5px; font-size: 13.5px; font-weight: 600; color: var(--text-2); }
.mk-facts svg { color: var(--accent); flex: none; width: 14px; height: 14px; }

.mk-services { margin-bottom: 8px; }
.mk-section-head h2 { margin: 0 0 12px; font-size: 14px; font-weight: 800; color: var(--text); letter-spacing: -0.02em; }
/* 응급실 찾기 미리보기 (휴대폰 모양, HTML 로 그림) */
.mk-preview { position: relative; display: flex; justify-content: center; padding: 8px 0 20px; }
.mk-phone {
  display: flex; flex-direction: column; width: 272px; padding: 14px 14px 70px;
  background: var(--surface); border: 7px solid var(--text); border-radius: 38px;
  box-shadow: 0 30px 60px -24px rgba(11, 12, 16, 0.35), 0 8px 18px -8px rgba(11, 12, 16, 0.18);
  transition: transform 0.3s var(--ease);
}
.mk-preview:hover .mk-phone { transform: translateY(-4px) rotate(-1deg); }
.mk-phone-bar { display: flex; align-items: center; gap: 7px; padding: 4px 4px 12px; border-bottom: 1px solid var(--line); }
.mk-phone-mark { width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; border-radius: 7px; background: #0fa894; color: #fff; }
.mk-phone-mark svg { width: 15px; height: 15px; }
.mk-phone-brand { font-size: 12px; font-weight: 700; color: var(--text); letter-spacing: -0.03em; }
.mk-phone-brand b { color: #0b9a87; font-weight: 800; }
.mk-phone-title { margin: 14px 4px 0; font-size: 17px; font-weight: 800; letter-spacing: -0.04em; color: var(--text); }
.mk-phone-meta { margin: 2px 4px 10px; font-size: 11px; color: var(--text-3); }
.mk-row { display: flex; align-items: center; gap: 8px; padding: 10px 6px; border-top: 1px solid var(--line); }
.mk-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mk-row-name { font-size: 13px; font-weight: 700; color: var(--text); letter-spacing: -0.03em; }
.mk-row-kind { font-size: 10.5px; color: var(--text-3); }
.mk-row-kind.critical { color: var(--critical); font-weight: 600; }
.mk-row-call { flex: none; padding: 5px 10px; border-radius: 999px; background: #0fa894; color: #fff; font-size: 11px; font-weight: 700; }
.mk-float {
  position: absolute; left: 50%; bottom: 36px; transform: translateX(-160px);
  display: flex; align-items: center; gap: 9px; padding: 10px 14px 10px 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 14px 30px -12px rgba(11, 12, 16, 0.3);
  font-size: 11.5px; line-height: 1.4; color: var(--text-2);
}
.mk-float b { font-size: 12.5px; color: var(--text); }
.mk-float-icon { width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border-radius: 9px; background: var(--accent); color: var(--on-accent); }
@media (max-width: 380px) { .mk-float { transform: translateX(-140px); } .mk-phone { width: 248px; } }

/* 서비스 카드: 두 칸 격자 (서비스가 늘면 카드가 차례로 채워진다) */
.mk-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.mk-card {
  position: relative; display: flex; flex-direction: column; gap: 14px; min-height: 196px; padding: 18px;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 20px;
  box-shadow: 0 1px 2px rgba(11, 12, 16, 0.06), 0 12px 30px -12px rgba(11, 12, 16, 0.22);
  transition: transform 0.2s var(--ease), border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
a.mk-card:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: 0 2px 4px rgba(18, 19, 24, 0.04), 0 18px 36px -14px rgba(18, 19, 24, 0.2); }
a.mk-card:focus-visible { outline-offset: 3px; border-radius: 20px; }
.mk-card-top { display: flex; align-items: flex-start; justify-content: space-between; }
.mk-card-icon { flex: none; width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; }
.mk-card-icon.er { background: #0fa894; color: #ffffff; box-shadow: 0 6px 14px -6px rgba(15, 168, 148, 0.7); } /* 응급실 찾기 고유 색 */
.mk-card-go {
  width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; background: var(--accent); color: var(--on-accent);
  transition: background 0.2s var(--ease), transform 0.2s var(--ease);
}
.mk-card-go svg { width: 16px; height: 16px; }
a.mk-card:hover .mk-card-go { background: var(--accent-strong); transform: translateX(2px); }
.mk-card-body { display: flex; flex-direction: column; margin-top: auto; }
.mk-card-status { display: inline-flex; align-items: center; gap: 5px; margin-bottom: 6px; font-size: 12px; font-weight: 700; color: #0b9a87; }
.mk-card-status::before { content: ""; width: 6px; height: 6px; border-radius: 999px; background: currentColor; box-shadow: 0 0 0 3px rgba(23, 162, 145, 0.15); }
.mk-card-name { font-size: 18px; font-weight: 800; letter-spacing: -0.04em; line-height: 1.3; color: var(--text); }
.mk-card-desc { margin-top: 3px; font-size: 13.5px; font-weight: 500; line-height: 1.5; color: var(--text-2); }
.mk-card-url { padding-top: 12px; border-top: 1px solid var(--line); font-size: 12.5px; font-weight: 700; color: var(--accent); letter-spacing: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mk-card-soon { justify-content: flex-end; background: transparent; border-style: dashed; border-color: var(--line-strong); box-shadow: none; }
.mk-card-soon .mk-card-name { color: var(--text-2); }
@media (max-width: 340px) { .mk-grid { grid-template-columns: 1fr; } }
@media (min-width: 900px) {
  .mk-hero { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); align-items: center; gap: 48px; padding: 88px 0 72px; }
  .mk-slogan { font-size: 54px; line-height: 1.28; }
  .mk-sub { font-size: 18px; margin-top: 18px; }
  .mk-facts { margin-top: 28px; }
  .mk-phone { width: 300px; }
  .mk-float { transform: translateX(-200px); bottom: 38px; }
}


@media (min-width: 640px) {
  .mk-hero { padding: 72px 0 56px; }
  .mk-slogan { font-size: 44px; }
  .mk-card { min-height: 216px; padding: 22px; }
  .mk-card-name { font-size: 19px; }
}

@media (min-width: 640px) {
  .hero { padding-top: 20px; }
  .hero-title { font-size: 32px; }
  .page-title { font-size: 30px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
