/* ============================================================
   K-Beauty Visit — base styles
   Inspired by Toss / Apple / Airbnb: calm, spacious, rounded.
   ============================================================ */

:root {
  --bg: #ffffff;
  --surface: #f7f8fa;
  --surface-2: #f1f3f5;
  --text: #191f28;
  --text-2: #4e5968;
  --text-3: #8b95a1;
  --border: #e5e8eb;
  --border-strong: #d1d6db;
  --primary: #3182f6;
  --primary-ink: #1b64da;
  --primary-wash: #e8f1ff;
  --danger: #e5484d;
  --ok: #12b886;
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(0, 19, 43, .06), 0 1px 3px rgba(0, 19, 43, .05);
  --shadow-md: 0 6px 20px rgba(0, 19, 43, .08);
  --shadow-lg: 0 16px 40px rgba(0, 19, 43, .12);
  --maxw: 1650px;
  --font: "Pretendard", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { line-height: 1.25; letter-spacing: -0.02em; margin: 0 0 .5em; }
h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); font-weight: 800; }
h2 { font-size: clamp(1.3rem, 2.4vw, 1.6rem); font-weight: 700; }
p { margin: 0 0 1rem; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 720px; }
.muted { color: var(--text-3); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.link { color: var(--primary-ink); font-weight: 600; }
.link:hover { text-decoration: underline; }
.link-reset { color: var(--text-3); font-weight: 600; font-size: .9rem; }
.link-reset:hover { color: var(--text); }

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--surface-2);
  --btn-fg: var(--text);
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  padding: 0 20px; height: 48px; border-radius: 14px;
  font: inherit; font-weight: 700; font-size: .98rem;
  background: var(--btn-bg); color: var(--btn-fg);
  border: none; cursor: pointer; white-space: nowrap;
  transition: transform .06s ease, background .15s ease, box-shadow .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn--primary { --btn-bg: var(--primary); --btn-fg: #fff; box-shadow: 0 6px 16px rgba(49, 130, 246, .28); }
.btn--primary:hover { --btn-bg: var(--primary-ink); }
.btn--ghost { --btn-bg: transparent; --btn-fg: var(--text-2); border: 1px solid var(--border-strong); }
.btn--ghost:hover { --btn-bg: var(--surface); color: var(--text); }
.btn--block { width: 100%; }
.btn--sm { height: 38px; border-radius: 11px; font-size: .88rem; padding: 0 14px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .8);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.site-header.is-scrolled { box-shadow: var(--shadow-sm); }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; height: 66px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.02em; }
.brand__mark {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: var(--primary); color: #fff; font-size: 20px; line-height: 1; font-weight: 700;
}
.brand__name { font-size: 1.08rem; }
.brand--footer { color: #fff; }
.brand--footer .brand__mark { background: #fff; color: var(--text); }
.lang-switch { display: flex; align-items: center; gap: 4px; }
.lang-switch__item {
  padding: 5px 10px; border-radius: 999px; font-size: .82rem; font-weight: 700; color: var(--text-3);
  transition: background .12s ease, color .12s ease;
}
.lang-switch__item:hover { color: var(--text); }
.lang-switch__item.is-active { background: var(--primary-wash); color: var(--primary); }
.site-nav { display: flex; align-items: center; gap: 26px; font-weight: 600; color: var(--text-2); font-size: .95rem; }
.site-nav a:hover { color: var(--text); }
.site-nav__admin {
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border-strong); color: var(--text-2);
}
.site-nav__admin:hover { background: var(--surface); }

/* ---------- Hero ---------- */
.hero { padding: 64px 0 28px; background: linear-gradient(180deg, var(--surface) 0%, #fff 100%); }
.hero__title { margin-bottom: 16px; }
.hero__subtitle { font-size: 1.12rem; color: var(--text-2); max-width: 560px; }

.searchbar {
  margin-top: 28px; display: flex; gap: 10px; flex-wrap: wrap;
  background: #fff; padding: 10px; border-radius: 18px;
  box-shadow: var(--shadow-md); border: 1px solid var(--border);
  max-width: 760px;
}
.searchbar__field {
  flex: 1 1 220px; display: flex; align-items: center; gap: 10px;
  padding: 0 14px; background: var(--surface); border-radius: 12px; color: var(--text-3);
}
.searchbar__field input, .searchbar__field select {
  border: none; background: transparent; font: inherit; color: var(--text);
  width: 100%; height: 48px; outline: none;
}
.searchbar__field--select { flex: 0 1 190px; }
.searchbar .btn { flex: 0 0 auto; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 22px; }
.chip {
  padding: 9px 16px; border-radius: 999px; background: #fff; border: 1px solid var(--border-strong);
  font-size: .9rem; font-weight: 600; color: var(--text-2); transition: all .15s ease;
}
.chip:hover { border-color: var(--text-3); color: var(--text); }
.chip.is-active { background: var(--text); color: #fff; border-color: var(--text); }

/* ---------- Results grid ---------- */
.results { padding: 40px 20px 10px; }
.results__head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 20px; }
.results__head h2 { margin: 0; }

.grid {
  display: grid; gap: 24px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
@media (max-width: 1200px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 860px)  { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px)  { .grid { grid-template-columns: 1fr; } }

.card {
  border-radius: var(--radius-lg); background: #fff; border: 1px solid var(--border);
  overflow: hidden; transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: transparent; }
.card__media {
  position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--surface-2);
}
.card__media > a { display: block; width: 100%; height: 100%; }
.card__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card__swiper, .card__swiper .swiper-wrapper,
.card__swiper .swiper-slide, .card__swiper .swiper-slide > a { height: 100%; }
.card__swiper .swiper-pagination-bullet { background: #fff; opacity: .65; }
.card__swiper .swiper-pagination-bullet-active { opacity: 1; }
.card__dist {
  position: absolute; right: 12px; top: 12px; padding: 5px 10px; border-radius: 999px;
  background: rgba(25, 31, 40, .82); color: #fff; font-size: .74rem; font-weight: 800;
  backdrop-filter: blur(4px);
}
.card__badge {
  position: absolute; left: 12px; top: 12px; padding: 6px 10px; border-radius: 999px;
  background: rgba(255, 255, 255, .92); font-size: .76rem; font-weight: 700; color: var(--text);
  backdrop-filter: blur(4px);
}
.card__body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card__titlelink { display: block; color: inherit; }
.card__titlelink:hover .card__title { color: var(--primary-ink); }
.card__title { font-size: 1.05rem; font-weight: 700; margin: 0; }
.card__ko { color: var(--text-3); font-size: .88rem; margin: 2px 0 0; }
.card__addr { color: var(--text-2); font-size: .9rem; margin: 6px 0 12px; }
.card__actions { margin-top: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.card__btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px; border-radius: 10px; border: 1px solid var(--border-strong);
  font-size: .82rem; font-weight: 700; color: var(--text-2); background: #fff;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.card__btn:hover { background: var(--primary-wash); border-color: var(--primary-wash); color: var(--primary-ink); }
.card__btn svg { flex: 0 0 auto; }

.tag {
  font-size: .78rem; font-weight: 600; color: var(--primary-ink);
  background: var(--primary-wash); padding: 5px 10px; border-radius: 8px;
}
.tag--muted { color: var(--text-3); background: var(--surface-2); }
.tag--lg { font-size: .9rem; padding: 8px 13px; border-radius: 10px; }
.taglist { display: flex; gap: 8px; flex-wrap: wrap; }

.pager { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 40px 0; }
.pager__status { color: var(--text-3); font-weight: 600; font-size: .9rem; }

.empty { text-align: center; padding: 60px 20px; color: var(--text-2); }
.empty__hint { color: var(--text-3); font-size: .92rem; }

/* ---------- How it works ---------- */
.howto { padding: 60px 20px 80px; }
.howto__steps { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin-top: 24px; }
.howto__step { background: var(--surface); border-radius: var(--radius); padding: 24px; }
.howto__num {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  background: var(--primary); color: #fff; font-weight: 800; margin-bottom: 12px;
}
.howto__step h3 { font-size: 1.05rem; }
.howto__step p { margin: 0; color: var(--text-2); font-size: .94rem; }

/* ---------- Homepage promo carousel (admin-managed "about us" slides) ---------- */
.promo-carousel { margin: 28px auto 8px; }
.promo-carousel .swiper { border-radius: 20px; overflow: hidden; }
.promo-slide {
  position: relative; min-height: 240px; display: flex; align-items: flex-end;
  background-size: cover; background-position: center; background-color: var(--surface);
}
.promo-slide__scrim {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 30%, rgba(0, 0, 0, .62));
}
.promo-slide__inner { position: relative; padding: 30px 28px; max-width: 640px; color: #fff; }
.promo-slide__inner h2 { margin: 0 0 8px; color: #fff; }
.promo-slide__inner p { margin: 0 0 14px; color: rgba(255, 255, 255, .9); }
.promo-carousel .swiper-pagination-bullet { background: #fff; opacity: .6; }
.promo-carousel .swiper-pagination-bullet-active { opacity: 1; }

/* ---------- Homepage filter panel (search + region + department checkboxes) ---------- */
.filter-panel { padding-top: 20px; }
.filter-form {
  background: #fff; padding: 20px 22px; border-radius: 18px;
  box-shadow: var(--shadow-md); border: 1px solid var(--border);
}
.filter-form .searchbar { margin-top: 0; box-shadow: none; border: none; padding: 0; max-width: none; }

.filter-form__row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 18px; }
.filter-select { display: flex; flex-direction: column; gap: 6px; font-size: .78rem; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .02em; flex: 1 1 200px; }
.filter-select select {
  height: 44px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--border-strong);
  background: var(--surface); font: inherit; font-weight: 600; font-size: .92rem; color: var(--text);
  text-transform: none; letter-spacing: normal; cursor: pointer;
}
.filter-select select:disabled { opacity: .45; cursor: not-allowed; }
.filter-select select:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }

/* Collapsible department picker */
.filter-details { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.filter-details summary {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  font-size: .82rem; font-weight: 700; color: var(--text); text-transform: uppercase; letter-spacing: .02em;
  list-style: none; user-select: none;
}
.filter-details summary::-webkit-details-marker { display: none; }
.filter-details summary::before {
  content: ''; flex: 0 0 auto; width: 7px; height: 7px;
  border-right: 2px solid var(--text-3); border-bottom: 2px solid var(--text-3);
  transform: rotate(-45deg); transition: transform .15s ease;
}
.filter-details[open] summary::before { transform: rotate(45deg); margin-top: 2px; }
.filter-details__count {
  background: var(--primary); color: #fff; border-radius: 999px;
  padding: 2px 9px; font-size: .74rem; font-weight: 700; text-transform: none; letter-spacing: normal;
}
.filter-details .filter-checkgrid { margin-top: 14px; }

.filter-checkgrid { display: flex; flex-wrap: wrap; gap: 8px; max-height: 260px; overflow-y: auto; padding: 2px; }
.filter-check {
  position: relative; display: inline-flex; align-items: center;
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border-strong);
  background: #fff; font-size: .85rem; font-weight: 600; color: var(--text-2);
  cursor: pointer; transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.filter-check:hover { border-color: var(--primary); color: var(--text); }
.filter-check input {
  position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0,0,0,0);
}
.filter-check:has(input:checked), .filter-check.is-checked { background: var(--primary); border-color: var(--primary); color: #fff; }
.filter-check:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }

.filter-form__actions { display: flex; align-items: center; gap: 16px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }

/* Search-name autocomplete dropdown */
.search-suggest-anchor { position: relative; }
.search-suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 20;
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow-md); overflow: hidden; max-height: 320px; overflow-y: auto;
}
.search-suggest__item { display: flex; flex-direction: column; gap: 1px; padding: 10px 14px; color: var(--text); }
.search-suggest__item:hover, .search-suggest__item.is-active { background: var(--surface); }
.search-suggest__en { font-weight: 700; font-size: .92rem; }
.search-suggest__ko { font-size: .8rem; color: var(--text-3); }

/* ---------- Share bar (hospital detail page) ---------- */
.share-bar { display: flex; align-items: center; gap: 10px; padding: 14px 20px; }
.share-bar__label { font-size: .82rem; font-weight: 700; color: var(--text-3); margin-right: 2px; }
.share-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 999px; border: 1px solid var(--border-strong);
  background: #fff; color: var(--text-2); cursor: pointer; transition: transform .12s ease, background .12s ease;
}
.share-btn:hover { transform: translateY(-1px); }
.share-btn--fb:hover { background: #1877F2; border-color: #1877F2; color: #fff; }
.share-btn--li:hover { background: #0A66C2; border-color: #0A66C2; color: #fff; }
.share-btn--kakao { background: #FEE500; border-color: #FEE500; color: #3C1E1E; }
.share-btn--kakao:hover { filter: brightness(.96); }
.share-btn--copy:hover { background: var(--surface); }
.share-btn__msg { font-size: .82rem; font-weight: 600; color: var(--primary); }

/* ---------- Detail page ---------- */
.crumbs { display: flex; gap: 8px; align-items: center; color: var(--text-3); font-size: .88rem; padding-top: 20px; }
.crumbs a:hover { color: var(--text); }

.detail-hero {
  margin-top: 14px; min-height: 300px; display: flex; align-items: flex-end;
  background-size: cover; background-position: center; border-radius: 0;
}
.detail-hero__inner { padding: 34px 20px; width: 100%; max-width: var(--maxw); margin: 0 auto; }
.detail-hero__inner--onphoto { color: #fff; }
.detail-hero__inner--onphoto .detail-hero__alt,
.detail-hero__inner--onphoto .detail-hero__loc { color: rgba(255, 255, 255, .88); }
.detail-hero h1 { margin: 10px 0 6px; }
.detail-hero__alt { margin: 0; color: var(--text-3); }
.detail-hero__loc { margin: 2px 0 0; color: var(--text-2); }
.pill {
  display: inline-block; padding: 6px 12px; border-radius: 999px; font-size: .8rem; font-weight: 700;
  background: rgba(255, 255, 255, .9); color: var(--text); backdrop-filter: blur(4px);
}

.detail-layout {
  display: grid; grid-template-columns: 1fr 380px; gap: 40px; padding: 40px 20px 80px;
  align-items: start;
}
.lede { font-size: 1.12rem; color: var(--text-2); margin-bottom: 28px; }
.panel { padding: 26px 0; border-top: 1px solid var(--border); }
.panel:first-child { border-top: none;}
.panel h2 { font-size: 1.2rem; }
.prose { color: var(--text-2); }

.facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px 24px; margin: 0; }
.facts > div { margin: 0; }
.facts dt { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); font-weight: 700; }
.facts dd { margin: 4px 0 0; color: var(--text); }

/* HIRA data section */
.panel h3.sub { font-size: 1rem; font-weight: 700; margin: 26px 0 12px; }
.panel h3.sub:first-of-type { margin-top: 14px; }
.stat-line { color: var(--text-2); margin: 0 0 12px; }
.stat-line strong { color: var(--text); font-size: 1.15rem; }
.tablewrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; margin-bottom: 8px; }
.datatable { width: 100%; border-collapse: collapse; font-size: .92rem; min-width: 380px; }
.datatable th, .datatable td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); }
.datatable th { font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); font-weight: 800; background: var(--surface); }
.datatable tr:last-child td { border-bottom: none; }
.datatable td + td, .datatable th + th { text-align: right; }
.datatable td:first-child, .datatable th:first-child { text-align: left; }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px 24px; margin: 8px 0 4px; }
.kv > div { margin: 0; }
.kv dt { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--text-3); font-weight: 700; }
.kv dd { margin: 3px 0 0; color: var(--text); }
.rawjson { margin-top: 22px; border-top: 1px dashed var(--border); padding-top: 14px; }
.rawjson summary { cursor: pointer; font-weight: 700; color: var(--text-2); font-size: .9rem; }
.rawjson h4 { margin: 14px 0 6px; font-size: .82rem; color: var(--text-3); }
.rawjson pre {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 14px; overflow-x: auto; font-size: .8rem; line-height: 1.5;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

.btn--light { --btn-bg: rgba(255,255,255,.92); --btn-fg: var(--text); backdrop-filter: blur(4px); }
.btn--light:hover { --btn-bg: #fff; }
.detail-hero__cta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

.morelike { padding: 10px 20px 80px; }
.morelike .results__head { margin-top: 20px; }
.related-strip.is-loading .grid { opacity: .5; pointer-events: none; }

/* ---------- Windowed pager (same look as /admin — see admin.css .apager) ---------- */
.apager {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 4px; margin-top: 20px;
}
.apager__item {
  min-width: 34px; height: 34px; padding: 0 9px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-strong); border-radius: 9px;
  font-size: .88rem; font-weight: 700; color: var(--text-2); background: #fff;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}
a.apager__item:hover { background: var(--surface); color: var(--text); }
.apager__item.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }
.apager__item.is-disabled { opacity: .38; }
.apager__total { margin-left: 8px; color: var(--text-3); font-size: .85rem; font-weight: 600; }

/* Booking / inquiry card (Airbnb-style sticky) */
.detail-aside { position: sticky; top: 90px; }
.booking {
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 24px; box-shadow: var(--shadow-md); background: #fff;
}
.booking__title { font-size: 1.15rem; margin-bottom: 4px; }
.booking__sub { color: var(--text-3); font-size: .9rem; margin-bottom: 18px; }
.booking__form { display: flex; flex-direction: column; gap: 12px; }
.booking__row { display: grid; grid-template-columns: 1fr 90px; gap: 12px; }
.booking__fineprint { color: var(--text-3); font-size: .78rem; text-align: center; margin: 4px 0 0; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

label { display: block; font-weight: 600; font-size: .9rem; color: var(--text-2); }
input, select, textarea {
  width: 100%; font: inherit; color: var(--text);
  margin-top: 6px; padding: 12px 14px; border: 1px solid var(--border-strong);
  border-radius: 12px; background: #fff; outline: none;
  transition: border-color .12s ease, box-shadow .12s ease;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-wash);
}
textarea { resize: vertical; }

.notice { border-radius: 12px; padding: 12px 14px; font-size: .9rem; margin-bottom: 14px; }
.notice ul { margin: 6px 0 0; padding-left: 18px; }
.notice--ok { background: #e7f8f1; color: #0b7a55; }
.notice--err { background: #fdecec; color: #b42318; }

/* ---------- Footer ---------- */
.site-footer { background: var(--text); color: rgba(255, 255, 255, .72); margin-top: 40px; }
.site-footer__inner { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 40px 20px; }
.site-footer__note { max-width: 640px; font-size: .86rem; margin: 4px 0 0; }
.site-footer__copy { font-size: .82rem; margin: 0; color: rgba(255, 255, 255, .55); }

/* ---------- Visitor filters & badges ---------- */
.searchbar { max-width: 920px; align-items: center; }
.searchbar > .btn { align-self: center; }
.searchbar > .searchbar__field:first-child { flex: 2 1 240px; } /* keyword field keeps priority width */
.searchbar__field--select { flex: 1 1 150px; }

/* Second filter row — always breaks to its own full-width line. */
.searchbar__toggles {
  flex: 1 0 100%;                 /* grow, never shrink below 100% => own row */
  display: flex; flex-wrap: wrap; gap: 8px;
  align-items: center;
  margin-top: 4px; padding-top: 12px;
  border-top: 1px solid var(--border);
}
.searchbar__toggles::before {
  content: "Filters";
  align-self: center;
  font-size: .78rem; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--text-3);
  margin-right: 2px;
}
.toggle-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border: 1px solid var(--border-strong); border-radius: 999px;
  font-size: .85rem; font-weight: 600; line-height: 1; white-space: nowrap;
  color: var(--text-2); background: #fff; cursor: pointer; user-select: none;
  transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}
.toggle-chip:hover { border-color: var(--text-3); color: var(--text); }
.toggle-chip input {
  width: 15px; height: 15px; margin: 0; accent-color: var(--primary); cursor: pointer;
}
/* Checked state (progressive — older browsers just show the native checkbox). */
.toggle-chip:has(input:checked) {
  background: var(--primary-wash); border-color: var(--primary); color: var(--primary-ink);
}
@media (max-width: 600px) {
  .searchbar__toggles::before { flex-basis: 100%; margin-bottom: 2px; }
  .toggle-chip { flex: 1 1 auto; justify-content: center; }
}
.card__meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 10px; }
.is-hidden { display: none !important; }

/* Certification badges (detail hero + list card) */
.hosp-badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
.hosp-badge {
  display: inline-block; padding: 4px 11px; border-radius: 999px;
  font-size: .74rem; font-weight: 800; line-height: 1.25; white-space: nowrap;
  background: #111827; color: #fff;
}
.hosp-badges--hero { margin: 10px 0 6px; }
.hosp-badges--hero .hosp-badge {
  font-size: .82rem; padding: 5px 13px; box-shadow: 0 1px 6px rgba(0, 0, 0, .25);
}

/* Google Maps embed on the hospital detail page */
.mapembed {
  position: relative; width: 100%; aspect-ratio: 16 / 5;
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; background: var(--surface-2);
}
.mapembed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
@media (max-width: 640px) { .mapembed { aspect-ratio: 16 / 9; } }
[data-toggle-rows] { margin: 6px 0 2px; }
.panel--highlight {
  background: var(--primary-wash); border-top: none; border-radius: var(--radius);
  padding: 22px; margin: 0 0 4px;
}
.panel--highlight h2 { color: var(--primary-ink); }
/* item 5 — keep the highlight card tight under the hero / lede */
.detail-layout { padding-top: 28px; }
.lede { margin-bottom: 20px; }
.lede + .panel--highlight, .detail-main > .panel--highlight:first-child { margin-top: 0; }

/* Infinite-scroll sentinel */
.feed-sentinel {
  grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 32px 0; color: var(--text-3); font-weight: 600; font-size: .9rem;
}
.feed-spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--border-strong); border-top-color: var(--primary);
  animation: kbvspin .7s linear infinite;
}
@keyframes kbvspin { to { transform: rotate(360deg); } }
.grid.is-loading-more { opacity: .96; }

/* Detail-page photo gallery (Swiper) */
.detail-gallery .swiper {
  position: relative; border-radius: var(--radius); overflow: hidden;
  aspect-ratio: 16 / 9; background: var(--surface-2);
}
.detail-gallery .swiper-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.detail-gallery .swiper-button-prev, .detail-gallery .swiper-button-next { color: #fff; }
.detail-gallery .swiper-pagination-bullet { background: #fff; opacity: .7; }
.detail-gallery .swiper-pagination-bullet-active { opacity: 1; }

/* Google reviews grid (hospital detail) */
.review-grid {
  display: grid; gap: 16px; margin: 6px 0 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
@media (max-width: 1100px) { .review-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px)  { .review-grid { grid-template-columns: 1fr; } }
.review-card {
  display: flex; flex-direction: column; color: inherit;
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: #fff;
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}
.review-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: transparent; }
.review-card__img { aspect-ratio: 16 / 9; overflow: hidden; background: var(--surface-2); }
.review-card--square .review-card__img { aspect-ratio: 1 / 1; }   /* Naver Posts: 1:1 thumbnails */
.review-card__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.review-card__body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; }
.review-card__stars { color: #ffb400; font-size: .95rem; letter-spacing: 1px; }
.review-card__meta { margin: 0; font-size: .84rem; color: var(--text-3); }
.review-card__meta strong { color: var(--text-2); }
.review-card__text {
  margin: 2px 0 0; font-size: .88rem; color: var(--text-2); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3;
  -webkit-box-orient: vertical; overflow: hidden;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .detail-layout { grid-template-columns: 1fr; }
  .detail-aside { position: static; }
  .facts { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .hero { padding-top: 40px; }
  .site-nav { gap: 14px; font-size: .88rem; }
  .site-nav a[href*="how"] { display: none; }
  .searchbar { padding: 8px; }
}

/* ---------- Claim bar + correction-request modal (hospital.php) ---------- */
.claim-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 120;
  background: var(--text); color: #fff;
  transform: translateY(100%); transition: transform .28s ease;
  box-shadow: 0 -6px 24px rgba(0,0,0,.18);
}
.claim-bar.is-visible { transform: translateY(0); }
.claim-bar__inner {
  max-width: 1100px; margin: 0 auto; padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.claim-bar__text { display: flex; flex-direction: column; gap: 2px; font-size: .92rem; }
.claim-bar__text strong { font-size: .98rem; }
.claim-bar__text span { opacity: .8; }
.claim-bar .btn--primary { flex: none; }

.modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(15,18,24,.55); }
.modal__panel {
  position: relative; background: #fff; border-radius: var(--radius-lg);
  max-width: 480px; width: 100%; max-height: 90vh; overflow-y: auto;
  padding: 28px 24px 24px; box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.modal__panel h2 { margin: 0 0 4px; }
.modal__close {
  position: absolute; top: 10px; right: 12px; width: 32px; height: 32px; border-radius: 999px;
  border: none; background: none; font-size: 1.5rem; line-height: 1; cursor: pointer; color: var(--text-2);
}
.modal__close:hover { background: var(--surface-2); }
.modal__intro {
  font-size: .88rem; color: var(--text-2); background: var(--surface-2);
  border-radius: 10px; padding: 12px 14px; margin: 10px 0 16px;
}
body.modal-open { overflow: hidden; }
@media (max-width: 600px) {
  .claim-bar__inner { justify-content: center; text-align: center; }
}
