:root {
  color-scheme: light;
  --navy: #0a315f;
  --navy-2: #123f73;
  --blue: #1672e6;
  --blue-soft: #eaf3ff;
  --mint: #e9f7f1;
  --green: #137957;
  --ink: #14243a;
  --muted: #617086;
  --line: #dbe3ed;
  --surface: #ffffff;
  --canvas: #eef3f8;
  --shadow: 0 12px 30px rgba(20, 49, 82, .12);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  overflow: hidden;
  background: var(--canvas);
  color: var(--ink);
  font-family: Pretendard, "Noto Sans KR", "Apple SD Gothic Neo", Arial, sans-serif;
  letter-spacing: 0;
}

button, input, a { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

.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;
}

.topbar {
  height: 82px;
  display: grid;
  grid-template-columns: 286px 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 0 28px;
  background: rgba(255, 255, 255, .98);
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 30;
}

.brand-sign {
  width: 246px;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.brand-awning {
  height: 8px;
  margin: 0 10px -1px;
  border: 1px solid #84b9f5;
  border-bottom: 0;
  background: repeating-linear-gradient(90deg, #1672e6 0 26px, #fff 26px 52px);
  border-radius: 6px 6px 0 0;
}

.brand-face {
  height: 55px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 7px 13px;
  background: #fff;
  border: 1px solid #bed6ef;
  border-radius: 6px;
  box-shadow: 0 5px 14px rgba(25, 75, 126, .12);
}

.brand-face img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  border-radius: 8px;
}

.brand-face span { min-width: 0; }
.brand-face strong { display: block; color: var(--navy); font-size: 19px; line-height: 1.05; }
.brand-face small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }

.topbar-copy { min-width: 0; }
.topbar-copy strong { display: block; font-size: 17px; color: var(--navy); }
.topbar-copy span { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; }

.top-actions { display: flex; align-items: center; gap: 10px; }
.top-actions a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--navy);
  font-weight: 750;
  font-size: 13px;
}
.top-actions svg { width: 16px; height: 16px; margin-right: 7px; }
.top-actions .partner-cta { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: 0 5px 14px rgba(22, 114, 230, .2); }
.top-actions .app-download { background: var(--navy); border-color: var(--navy); color: #fff; }

.map-shell {
  width: 100vw;
  height: calc(100vh - 82px);
  min-height: 0;
  display: grid;
  grid-template-columns: clamp(360px, 33vw, 430px) minmax(0, 1fr);
  overflow: hidden;
}

.directory {
  width: 100%;
  min-width: 0;
  max-width: 430px;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  background: var(--surface);
  border-right: 1px solid var(--line);
  position: relative;
  z-index: 20;
  overflow: hidden;
}

.directory-head { min-width: 0; padding: 20px 20px 14px; border-bottom: 1px solid var(--line); overflow: hidden; }

.mode-tabs {
  min-width: 0;
  height: 44px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 3px;
  background: #edf2f7;
  border-radius: 6px;
}

.mode-tab {
  min-width: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #5b6a7c;
  font-weight: 750;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mode-tab.is-active { background: #fff; color: var(--navy); box-shadow: 0 2px 8px rgba(25, 58, 92, .12); }

.search-form { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) 62px; gap: 8px; margin-top: 14px; }
.search-box {
  min-width: 0;
  height: 44px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 13px;
  border: 1px solid #cfd9e5;
  border-radius: 6px;
  background: #fff;
}
.search-box:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(22, 114, 230, .12); }
.search-box svg { width: 18px; color: #738297; flex: 0 0 auto; }
.search-box input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 14px; }
.search-form > button { border: 0; border-radius: 6px; background: var(--blue); color: #fff; font-weight: 800; }

.category-scroll {
  min-width: 0;
  max-width: 100%;
  display: flex;
  flex-wrap: nowrap;
  gap: 7px;
  margin-top: 13px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 7px;
  scrollbar-width: thin;
  scrollbar-color: #9fb7d1 transparent;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}
.category-scroll::-webkit-scrollbar { height: 5px; }
.category-scroll::-webkit-scrollbar-track { background: transparent; }
.category-scroll::-webkit-scrollbar-thumb { background: #b3c5d8; border-radius: 999px; }
.category-chip {
  flex: 0 0 auto;
  scroll-snap-align: start;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 12px;
  border: 1px solid #d4deea;
  border-radius: 17px;
  background: #fff;
  color: #5b687a;
  font-size: 12px;
  font-weight: 700;
}
.category-chip-icon {
  width: 21px;
  height: 21px;
  flex: 0 0 auto;
  object-fit: contain;
  border-radius: 5px;
  background: #fff;
}
.category-chip.is-active { color: #fff; background: var(--navy-2); border-color: var(--navy-2); }
.category-scroll[hidden] { display: none; }

.source-legend { display: flex; gap: 17px; align-items: center; margin-top: 13px; color: #667589; font-size: 11px; }
.source-legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--blue); }
.legend-sign { width: 19px; height: 16px; display: inline-flex; align-items: center; justify-content: center; border-radius: 3px 3px 5px 5px; background: var(--navy); color: #fff; font-size: 9px; font-style: normal; font-weight: 900; border-top: 3px solid #59b9ff; }

.result-summary {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
}
.result-summary strong { display: block; color: var(--navy); font-size: 15px; }
.result-summary span { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.location-button { min-height: 36px; display: inline-flex; align-items: center; gap: 6px; padding: 0 10px; border: 1px solid #cbd9e7; border-radius: 5px; background: #fff; color: var(--navy); font-size: 12px; font-weight: 750; flex: 0 0 auto; }
.location-button svg { width: 16px; }
.location-button span { margin: 0; color: inherit; font-size: inherit; }

.result-list { width: 100%; min-width: 0; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 10px; scroll-behavior: smooth; }

.result-card {
  width: 100%;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
  margin-bottom: 8px;
  border: 1px solid #e0e7ef;
  border-radius: 7px;
  background: #fff;
  text-align: left;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.result-card:hover { border-color: #9fc3ec; box-shadow: 0 7px 18px rgba(20, 61, 103, .09); }
.result-card.is-selected { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(22, 114, 230, .12); }

.result-icon {
  width: 54px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: var(--blue-soft);
  color: var(--blue);
  overflow: hidden;
  font-weight: 900;
  font-size: 16px;
}
.result-icon img { width: 100%; height: 100%; object-fit: cover; }
.result-icon.category { padding: 5px; background: #f7fbff; }
.result-icon.category img { object-fit: contain; }
.result-icon.category.regenerative { padding: 0; background: transparent; overflow: visible; }
.result-icon.category.regenerative img { object-fit: contain; }
.result-icon.partner { padding: 7px; background: var(--mint); }
.result-icon.partner img { object-fit: contain; border-radius: 7px; }

.result-main { min-width: 0; }
.result-row { display: flex; align-items: flex-start; gap: 8px; justify-content: space-between; }
.result-name { min-width: 0; color: var(--ink); font-size: 15px; line-height: 1.35; font-weight: 850; overflow-wrap: anywhere; }
.distance { flex: 0 0 auto; color: var(--blue); font-size: 12px; font-weight: 800; white-space: nowrap; }
.result-meta { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.source-badge, .type-badge { min-height: 22px; display: inline-flex; align-items: center; padding: 0 7px; border-radius: 4px; font-size: 10px; font-weight: 750; }
.source-badge.public { color: #1d61aa; background: #e9f3ff; }
.source-badge.partner { color: #0f6c50; background: #e6f6ef; }
.source-badge.registered { color: #765a16; background: #fff5d9; }
.type-badge { color: #586577; background: #f1f4f7; }
.result-address { margin: 8px 0 0; color: #667488; font-size: 12px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.result-actions { display: flex; gap: 7px; margin-top: 10px; }
.result-actions a { min-height: 30px; display: inline-flex; align-items: center; justify-content: center; padding: 0 10px; border: 1px solid #d3deea; border-radius: 5px; color: var(--navy); background: #fff; font-size: 11px; font-weight: 750; }
.result-actions a.primary { background: var(--navy); color: #fff; border-color: var(--navy); }

.loading-state { padding: 4px; }
.loading-bar { display: block; height: 94px; margin-bottom: 9px; border-radius: 7px; background: linear-gradient(90deg, #edf1f5 25%, #f8fafc 45%, #edf1f5 65%); background-size: 250% 100%; animation: loading 1.2s infinite linear; }
@keyframes loading { to { background-position: -250% 0; } }

.empty-state { padding: 54px 24px; text-align: center; color: var(--muted); }
.empty-state strong { display: block; color: var(--navy); margin-bottom: 8px; }

.map-panel { min-width: 0; min-height: 0; position: relative; z-index: 1; overflow: hidden; background: #dfe8f1; isolation: isolate; }
.map-canvas { width: 100%; height: 100%; }
.map-message { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; background: #eaf0f6; color: var(--muted); text-align: center; padding: 24px; }
.map-message[hidden] { display: none; }
.map-message strong { color: var(--navy); font-size: 19px; }
.map-status { position: absolute; left: 16px; bottom: 16px; min-height: 32px; display: flex; align-items: center; max-width: calc(100% - 32px); padding: 0 11px; border: 1px solid rgba(176, 192, 210, .82); border-radius: 5px; background: rgba(255, 255, 255, .94); color: #46566a; box-shadow: 0 5px 16px rgba(18, 47, 80, .12); font-size: 11px; z-index: 1000; }
.location-context {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 1000;
  min-height: 54px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 7px 8px 7px 10px;
  border: 1px solid rgba(176, 192, 210, .82);
  border-radius: 7px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 7px 18px rgba(18, 47, 80, .14);
}
.location-context > svg { width: 21px; color: var(--blue); }
.location-context span { min-width: 0; }
.location-context small { display: block; color: #738197; font-size: 9px; }
.location-context strong { display: block; margin-top: 2px; color: var(--navy); font-size: 12px; }
.location-context button { min-height: 36px; padding: 0 10px; border: 0; border-radius: 5px; background: var(--navy); color: #fff; font-size: 11px; font-weight: 800; }
.mobile-list-toggle { display: none; }

.partner-marker {
  position: relative;
  width: 138px;
  transform: translateY(-10px);
  filter: drop-shadow(0 6px 8px rgba(8, 40, 75, .22));
  cursor: pointer;
  transition: transform .18s ease, filter .18s ease;
}
.partner-marker.marker-service.is-selected { transform: translateY(-14px) scale(1.2); filter: drop-shadow(0 10px 14px rgba(8, 40, 75, .3)); }
.partner-service-preview {
  position: absolute;
  left: 50%;
  bottom: 66px;
  width: 150px;
  padding: 5px;
  border: 3px solid #fff;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(8, 40, 75, .28);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(8px) scale(.72);
  transform-origin: 50% 100%;
  transition: opacity .16s ease, transform .2s ease;
}
.partner-service-preview img { display: block; width: 140px; height: 86px; border-radius: 5px; object-fit: cover; }
.partner-service-preview strong { display: block; padding: 5px 3px 2px; overflow: hidden; color: var(--navy); font-size: 11px; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.partner-marker.marker-service.is-selected .partner-service-preview { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
.partner-marker::after { content: ""; position: absolute; left: 63px; bottom: -7px; border: 7px solid transparent; border-top-color: #4b93e8; border-bottom: 0; }
.partner-marker-awning { height: 11px; display: block; border: 2px solid #fff; border-bottom: 0; border-radius: 8px 8px 3px 3px; background: repeating-linear-gradient(90deg, #1672e6 0 13px, #fff 13px 26px); box-shadow: 0 -1px 0 #71aae9; }
.partner-marker-awning::after { content: none; }
.partner-marker-face { min-height: 41px; display: grid; grid-template-columns: 27px minmax(0, 1fr); align-items: center; gap: 7px; padding: 5px 8px; background: #fff; border: 2px solid #4b93e8; border-top: 0; border-radius: 0 0 9px 9px; }
.partner-marker-face img { width: 28px; height: 28px; border-radius: 5px; object-fit: contain; }
.partner-marker-face strong { color: var(--navy); font-size: 11px; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.partner-marker.marker-hospital {
  width: 62px;
  height: 56px;
  transform: translateY(-4px);
  border: 0;
  background: transparent;
  filter: drop-shadow(0 5px 5px rgba(13, 56, 104, .26));
}
.partner-marker.marker-hospital::after { content: none; }
.partner-hospital-building { position: relative; display: block; width: 62px; height: 56px; }
.partner-hospital-image { position: absolute; left: 6px; top: 0; width: 50px; height: 50px; object-fit: contain; }
.partner-hospital-preview {
  position: absolute;
  left: 50%;
  bottom: 60px;
  width: 150px;
  padding: 5px;
  border: 3px solid #fff;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(8, 40, 75, .28);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(8px) scale(.72);
  transform-origin: 50% 100%;
  transition: opacity .16s ease, transform .2s ease;
}
.partner-hospital-preview img { display: block; width: 140px; height: 86px; border-radius: 5px; object-fit: cover; }
.partner-hospital-preview strong { display: block; padding: 5px 3px 2px; overflow: hidden; color: var(--navy); font-size: 11px; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.partner-marker.marker-hospital.is-selected .partner-hospital-preview { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
.partner-hospital-building.tertiary { width: 68px; height: 58px; }
.partner-hospital-building.tertiary .partner-hospital-image { left: 0; width: 64px; height: 50px; }
.partner-hospital-building.regenerative .partner-hospital-image { mix-blend-mode: multiply; }
.partner-hospital-badge {
  position: absolute;
  right: 0;
  bottom: 0;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-height: 20px;
  padding: 2px 6px 2px 3px;
  border: 2px solid #4b93e8;
  border-radius: 7px;
  background: #fff;
  color: #0b4fa3;
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}
.partner-hospital-badge img { width: 16px; height: 16px; border-radius: 4px; object-fit: cover; }

.place-marker {
  --marker-color: #3d7fe2;
  position: relative;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 3px solid var(--marker-color);
  border-radius: 11px;
  background: #fff;
  color: #fff;
  box-shadow: 0 5px 10px rgba(13, 56, 104, .24);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}
.place-marker::before { content: ""; position: absolute; }
.place-marker::after { content: ""; position: absolute; left: 16px; bottom: -9px; border: 7px solid transparent; border-top-color: var(--marker-color); border-bottom: 0; }
.place-marker > img { position: relative; z-index: 1; width: 40px; height: 40px; border-radius: 8px; background: #fff; object-fit: cover; }
.place-marker.marker-hospital {
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  filter: drop-shadow(0 5px 5px rgba(13, 56, 104, .25));
}
.place-marker.marker-hospital::before,
.place-marker.marker-hospital::after { content: none; }
.place-marker.marker-hospital > img { width: 48px; height: 48px; border-radius: 0; background: transparent; object-fit: contain; }
.place-marker.marker-hospital.tertiary { width: 62px; height: 54px; }
.place-marker.marker-hospital.tertiary > img { width: 62px; height: 54px; }
.place-marker.marker-service::before { left: 2px; right: 2px; top: -8px; height: 11px; border: 2px solid #fff; border-bottom: 0; border-radius: 8px 8px 3px 3px; background: repeating-linear-gradient(90deg, #fff 0 8px, var(--marker-color) 8px 16px); }
.place-marker.marker-service.home-visit-medical { width: 66px; height: 58px; padding: 0; border: 0; border-radius: 0; overflow: visible; background: transparent; box-shadow: none; }
.place-marker.marker-service.home-visit-medical::before { content: "재택의료"; left: 50%; right: auto; top: -14px; height: auto; padding: 3px 7px; transform: translateX(-50%); border: 0; border-radius: 9px; background: #0a315f; color: #fff; font-size: 9px; font-weight: 800; line-height: 1; white-space: nowrap; box-shadow: 0 2px 6px rgba(10, 49, 95, .22); }
.place-marker.marker-service.home-visit-medical::after { content: none; }
.place-marker.marker-service.home-visit-medical > img { width: 66px; height: 58px; border-radius: 0; background: transparent; object-fit: contain; }
.place-marker.marker-service.home-visit-medical > img,
.place-marker.marker-hospital.regenerative > img,
.place-marker.marker-service.regenerative > img,
.result-icon.category.regenerative img { mix-blend-mode: multiply; }
.place-marker.marker-hospital.regenerative,
.place-marker.marker-service.regenerative {
  width: 58px;
  height: 54px;
  padding: 0;
  border: 0;
  border-radius: 0;
  overflow: visible;
  background: transparent;
  box-shadow: none;
  filter: drop-shadow(0 5px 6px rgba(8, 86, 108, .22));
}
.place-marker.marker-hospital.regenerative::before,
.place-marker.marker-service.regenerative::before {
  content: "첨단재생기관";
  left: 50%;
  right: auto;
  top: -16px;
  height: auto;
  padding: 3px 7px;
  transform: translateX(-50%);
  border: 0;
  border-radius: 9px;
  background: #087d91;
  color: #fff;
  font-size: 9px;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(8, 125, 145, .2);
}
.place-marker.marker-hospital.regenerative::after,
.place-marker.marker-service.regenerative::after { content: none; }
.place-marker.marker-hospital.regenerative > img,
.place-marker.marker-service.regenerative > img {
  width: 58px;
  height: 54px;
  border-radius: 0;
  background: transparent;
  object-fit: contain;
}
.place-marker.rehab { --marker-color: #16876a; }
.place-marker.care { --marker-color: #7a62b4; }
.place-marker.oriental { --marker-color: #b2684c; }
.place-marker.regenerative { --marker-color: #087d91; }
.place-marker.visit { --marker-color: #24698f; }
.place-marker.life { --marker-color: #c06b2d; }
.place-marker.home-care { --marker-color: #7657b5; }
.place-marker.day-care { --marker-color: #c27a22; }
.place-marker.tertiary { --marker-color: #0a315f; }

.leaflet-div-icon { background: transparent !important; border: 0 !important; }
.leaflet-container { font-family: inherit; background: #dfe8f1; }
.leaflet-control-attribution { font-size: 9px; }

@media (max-width: 1180px) {
  .topbar { grid-template-columns: 246px minmax(0, 1fr) auto; gap: 16px; padding: 0 20px; }
  .brand-sign { width: 228px; }
  .topbar-copy span { display: none; }
  .map-shell { grid-template-columns: clamp(330px, 33vw, 390px) minmax(0, 1fr); }
  .directory { max-width: 390px; }
}

@media (max-width: 860px) {
  html, body { min-height: 100%; height: auto; }
  body { overflow: auto; background: #f3f7fb; }

  .topbar {
    min-height: 72px;
    height: auto;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding: 10px 12px;
    position: sticky;
    top: 0;
  }
  .brand-sign { width: min(196px, 52vw); align-self: center; }
  .brand-awning { height: 6px; margin-inline: 8px; }
  .brand-face { height: 48px; gap: 8px; padding: 5px 9px; }
  .brand-face img { width: 34px; height: 34px; }
  .brand-face strong { font-size: 17px; }
  .brand-face small { font-size: 9px; white-space: nowrap; }
  .topbar-copy { display: none; }
  .top-actions { justify-content: flex-end; gap: 6px; min-width: 0; }
  .top-actions a { min-height: 38px; padding: 0 10px; border-radius: 6px; font-size: 11px; white-space: nowrap; }
  .top-actions svg { width: 14px; height: 14px; margin-right: 5px; }
  .top-actions .app-download { width: 38px; padding: 0; }
  .top-actions .app-download svg { margin: 0; }
  .top-actions .app-download span { display: none; }

  .map-shell {
    height: auto;
    min-height: calc(100svh - 72px);
    display: grid;
    grid-template-columns: 1fr;
    grid-template-areas:
      "map"
      "directory";
    overflow: visible;
  }
  .map-panel {
    grid-area: map;
    position: relative;
    min-height: clamp(330px, 48svh, 520px);
    border-bottom: 1px solid var(--line);
  }
  .map-canvas { min-height: inherit; }
  .directory {
    grid-area: directory;
    position: relative;
    z-index: 3;
    min-height: 0;
    max-width: none;
    display: block;
    border-right: 0;
    border-top: 1px solid var(--line);
    background: #fff;
  }
  .directory.is-collapsed { transform: none; }
  .directory-head { padding: 14px 12px 10px; }
  .mode-tabs { height: 40px; }
  .mode-tab { font-size: 12px; }
  .search-form { margin-top: 10px; grid-template-columns: minmax(0, 1fr) 58px; }
  .search-box { height: 41px; }
  .category-scroll { margin-top: 10px; padding-bottom: 7px; gap: 6px; }
  .category-chip { min-height: 32px; padding: 0 11px; }
  .source-legend { margin-top: 9px; }
  .result-summary { min-height: 60px; padding: 10px 12px; }
  .result-list { overflow: visible; overflow-x: hidden; padding: 9px 10px 18px; }
  .result-card { padding: 11px; grid-template-columns: 48px minmax(0, 1fr); gap: 10px; }
  .result-card:hover { transform: none; }
  .result-icon { width: 48px; height: 48px; }
  .result-name { font-size: 14px; }
  .result-address { font-size: 11px; }
  .result-actions a { min-height: 32px; flex: 1 1 0; }
  .location-context {
    top: 10px;
    left: 10px;
    right: 10px;
    min-height: 48px;
    grid-template-columns: 24px minmax(0, 1fr) auto;
    padding: 7px 8px;
  }
  .location-context > svg { width: 18px; }
  .location-context button { min-height: 32px; padding: 0 9px; font-size: 10px; }
  .map-status { left: 10px; right: 10px; bottom: 10px; max-width: none; justify-content: center; }
  .mobile-list-toggle { display: none; }
}

@media (max-width: 520px) {
  .topbar {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 8px;
  }
  .brand-sign { width: 100%; }
  .brand-face { justify-content: center; }
  .top-actions { display: grid; grid-template-columns: minmax(0, 1fr) 40px; }
  .top-actions a { width: 100%; }
  .map-panel { min-height: 360px; }
  .location-context { grid-template-columns: 20px minmax(0, 1fr); }
  .location-context button { grid-column: 1 / -1; width: 100%; }
  .result-row { display: block; }
  .distance { display: inline-block; margin-top: 4px; }
  .result-actions { gap: 6px; }
}

@media (max-width: 380px) {
  .brand-face small { display: none; }
  .top-actions a { font-size: 10px; padding: 0 8px; }
  .search-form { grid-template-columns: minmax(0, 1fr); }
  .search-form > button { min-height: 38px; }
}
