:root{
  --pkpink:#CE8892; --pkblue:#31527E; --pkline:#e5e7eb; --pkmuted:#6b7280;
}

/* ===== Results mode scope ===== */
body.pk--results .hero.container{ overflow:hidden; }

/* ✅ 결과 컨테이너만 토글 (전체 섹션 숨김 금지) */
.pk-results{ display:none; }
body.pk--results .pk-results{ display:block; }

/* (안전장치) 이전 CSS가 전체 섹션을 숨겼던 경우를 무력화 */
body.pk--results main .section{ display:block !important; }

/* chips / meta */
.pk-chip{
  border:1px solid var(--pkline);
  border-radius:999px;
  padding:6px 10px;
  background:#fff;
  cursor:pointer;
  font-size:14px;
}
.pk-chip.active{
  border-color:var(--pkblue);
  box-shadow:0 0 0 2px rgba(49,82,126,.15);
}
.pk-meta{
  display:flex; align-items:center; justify-content:space-between;
  gap:10px; margin:4px 0 10px; color:#374151;
}

/* ===== Fallback grids (페이지가 그리드 안 정했을 때만) ===== */
.card-grid.pk-grid{ display:grid; grid-template-columns: repeat(3,1fr); gap:14px; }
@media (max-width:960px){ .card-grid.pk-grid{ grid-template-columns: repeat(2,1fr);} }
@media (max-width:560px){ .card-grid.pk-grid{ grid-template-columns: 1fr;} }

.doctor-grid.pk-grid{ display:grid; grid-template-columns: repeat(3,1fr); gap:14px; }
@media (max-width:960px){ .doctor-grid.pk-grid{ grid-template-columns: repeat(2,1fr);} }
@media (max-width:560px){ .doctor-grid.pk-grid{ grid-template-columns: 1fr;} }

/* 검색창 닫기 버튼 (결과 모드에서만) */
body.pk--results form.search .pk-close{
  display:inline-flex !important; margin-left:8px;
  border:1px solid var(--pkline); border-radius:999px; padding:6px 10px; background:#fff;
}

/* ===== Results layout ===== */
.pk-results{ position:relative; z-index:1; overflow:visible; }
.pk-results .pk-toolbar{ position:relative; z-index:2; }
.pk-results .pk-meta{ position:relative; z-index:1; }
.pk-results .pk-grid{ max-width:1200px; margin-left:auto; margin-right:auto; }

/* New grid breakpoints: 1→2→3→4 */
.card-grid.pk-grid{ display:grid; grid-template-columns: repeat(1, minmax(0,1fr)); gap:14px; }
@media (min-width:560px){ .card-grid.pk-grid{ grid-template-columns: repeat(2,1fr);} }
@media (min-width:960px){ .card-grid.pk-grid{ grid-template-columns: repeat(3,1fr);} }
@media (min-width:1200px){ .card-grid.pk-grid{ grid-template-columns: repeat(4,1fr);} }

.doctor-grid.pk-grid{ display:grid; grid-template-columns: repeat(1, minmax(0,1fr)); gap:14px; }
@media (min-width:560px){ .doctor-grid.pk-grid{ grid-template-columns: repeat(2,1fr);} }
@media (min-width:960px){ .doctor-grid.pk-grid{ grid-template-columns: repeat(3,1fr);} }

.card-grid.pk-grid > .pk-empty{ grid-column: 1 / -1; }

.pk-results .pk-toolbar,
.pk-results .pk-meta{
  max-width:1200px;
  margin-left:auto;
  margin-right:auto;
}

/* center the title + count row */
.pk-results .pk-meta{
  justify-content:center;
  gap:12px;
  text-align:center;
}

/* -- results cards (clean) -- */
.pk-results .card-head{position:relative;}
.pk-results .card-head .thumb img{display:block;width:100%;height:100%;object-fit:cover;}
.pk-results .card-head .fav-btn{
  position:absolute;right:12px;top:12px;background:transparent;border:0;padding:0;box-shadow:none;cursor:pointer;
}
.pk-results .card-head .fav-btn .heart{
  width:clamp(24px,6vw,28px);height:clamp(24px,6vw,28px);
  fill:transparent;stroke:#999;stroke-width:1;transition:fill .25s,stroke .25s;
}
.pk-results .card-head .fav-btn.active .heart{fill:var(--primary,#CE8892);stroke:var(--primary,#CE8892);}

.pk-results .card-body{padding:1rem 0;}
.pk-results .card-body a{text-decoration:none;color:inherit;}
.pk-results .card-body h4{margin:0 0 .25rem;font-size:.9rem;font-weight:700;line-height:1.25;}
.pk-results .card-body .desc{margin:0;color:var(--muted);font-size:.8rem;}

.pk-results .meta{list-style:none;margin:.35rem 0 0;padding:0;display:grid;gap:.2rem;color:var(--muted);font-size:.85rem;}
.pk-results .meta li{display:flex;align-items:center;gap:.2rem;line-height:1.5;}
.pk-results .meta li img{display:block;width:14px;height:14px;}
.pk-results .score{color:var(--text);font-weight:600;}

.pk-results .treat-tags{display:flex;flex-wrap:wrap;gap:.35rem .3rem;margin-top:.25rem;}
.pk-results .treat-tags .tag{
  display:inline-block;padding:.22rem .45rem;font-size:.75rem;font-weight:500;line-height:1;
  white-space:nowrap;color:#444;background:#fff;border:1px solid #e5e7eb;border-radius:6px;
}
.pk-results .clinic-tags{margin-top:.4rem;}
.pk-results .clinic-tags .tag{
  display:inline-flex;align-items:center;gap:.25rem;
  padding:clamp(.18rem,.6vw,.25rem) clamp(.35rem,1.2vw,.5rem);
  font-size:clamp(.70rem,1.8vw,.875rem);font-weight:600;line-height:1;white-space:nowrap;max-width:100%;
}
.pk-results .clinic-tags .tag--same{background:var(--primary,#CE8892);color:#fff;border:1px solid var(--primary,#CE8892);}
@media (max-width:560px){
  .pk-results .treat-tags .tag{font-size:.74rem;padding:.2rem .4rem;}
  .pk-results .clinic-tags .tag{gap:.2rem;}
}

/* grid responsiveness fix */
.pk-results .pk-grid{
  max-width:1200px;
  margin:0 auto;
  display:grid;
  gap:1.25rem;
  grid-template-columns:repeat(4, minmax(0,1fr));
}
@media (max-width:1200px){ .pk-results .pk-grid{ grid-template-columns:repeat(3, 1fr); } }
@media (max-width:960px){  .pk-results .pk-grid{ grid-template-columns:repeat(2, 1fr); } }
@media (max-width:360px){  .pk-results .pk-grid{ grid-template-columns:1fr; } }
.pk-results .card{ width:100%; }

/* heart polish */
.pk-results .card-head .fav-btn{background-color:transparent!important;border:0!important;box-shadow:none!important;border-radius:0!important;padding:0!important;}
.pk-results .card-head .fav-btn .heart{
  width:clamp(24px,6vw,28px);height:clamp(24px,6vw,28px);
  fill:transparent;stroke:#999;stroke-width:1;transition:fill .25s ease, stroke .25s ease;
}
.pk-results .card-head .fav-btn.active .heart{fill:var(--primary,#CE8892);stroke:var(--primary,#CE8892);}

/* meta icon size */
.pk-results .meta li img{ width:14px; height:14px; display:block; }

/* hero fold: remove bottom margin when collapsed */
.pk-hero{ transition: margin-bottom .25s ease; }
.pk-hero.is-collapsed,
.pk-hero[hidden],
.pk-hero[aria-hidden="true"]{ margin-bottom:0 !important; }

/* results empty state layout */
.pk-results .pk-grid.is-empty{ grid-template-columns: 1fr; }
.pk-results .pk-grid > .empty,
.pk-results .pk-grid > .no-results,
.pk-results .pk-grid > .results-empty,
.pk-results .pk-grid > .empty-state{
  grid-column: 1 / -1;
  justify-self: center;
  width: min(720px, 100%);
}

/* results header bar */
.pk-results .results-head{
  max-width:1200px;
  margin:0 auto 1.5rem;
  display:flex;align-items:center;justify-content:flex-start;
  gap:.75rem;
  font-size:1rem;
  border-bottom:1px solid var(--border,#eee);
  padding-bottom:.5rem;
}
.pk-results .results-head .label{ font-weight:700; }
.pk-results.hidden,
.pk-results[hidden]{ display:none; }

/* responsive results map above header */
.pk-results .results-map{
  max-width:1200px;
  margin:0 auto 1.5rem;
}
.pk-results .results-map .map-inner{
  position:relative; width:100%;
  height:clamp(220px, 30vw, 360px);
  border-radius:12px; overflow:hidden; background:#f7f7f7;
  border:1px solid var(--border,#eee);
  box-shadow:0 1px 4px rgba(0,0,0,.04);
}
.pk-results .results-map iframe.gmap{
  position:absolute; inset:0; width:100%; height:100%; border:0;
}
@media (max-width:480px){
  .pk-results .results-map .map-inner{ height:clamp(180px, 42vw, 260px); }
}

/* map visibility hardening */
.pk-results .results-map{ display:block; }
.pk-results .results-map .map-inner{ min-height:180px; }
.pk-results .results-map.hidden{ display:none !important; }

/* v104: icons padding shrink when mids-only */
.mid-only-icons .icons{ padding-bottom: 0rem !important; }

/* v1.06: Selected subcategory (pk-chip.active) uses main color */
.pk-chip.active{
  color: var(--primary, var(--pkblue));
  border-color: var(--primary, var(--pkblue));
}

/* v1.07: remove chip shadow + active chevron follows primary */
.pk-chip, .pk-chip.active{ box-shadow: none !important; }
.pk-chip.active::after{ color: var(--primary, var(--pkblue)) !important; }

/* Surgery cards (no thumbnail) */
.pk-results .surgery-card {
  border: 1px solid var(--pkline,#e5e7eb);
  border-radius: 12px;
  background: #fff;
  padding: .75rem 1rem;
}

/* Remove chevron on category chip for surgery cards */
.pk-results .surgery-card .pk-chip::after { content: none !important; }

/* Category chip: softer look */
.pk-results .surgery-card .pk-chip{
  background: #f7f8fb;
  border-color: transparent;
  font-weight: 600;
  padding: .22rem .6rem;
  border-radius: 999px;
  color: #444;
}

/* Title / Price / Meta spacing */
.pk-results .surgery-card .title{ margin: .25rem 0 .35rem; font-size: .95rem; font-weight: 800; line-height: 1.3; }
.pk-results .surgery-card .price{ margin: 0 0 .25rem; font-weight: 800; color: var(--text,#111); }

/* Hospital / address */
.pk-results .surgery-card .desc{ margin: .1rem 0; color: var(--muted,#6b7280); }

/* Rating row */
.pk-results .surgery-card .meta{ list-style:none; margin:.35rem 0 0; padding:0; display:grid; gap:.2rem; color:var(--muted,#6b7280); font-size:.85rem; }
.pk-results .surgery-card .meta li{ display:flex; align-items:center; gap:.3rem; line-height:1.4; }
.pk-results .surgery-card .meta .star-icon{ width:14px; height:14px; display:block; }
.pk-results .surgery-card .meta .score{ color: var(--text,#111); font-weight: 700; }

/* spacing between surgeries grid and doctors grid */
.pk-results #pk-surgeries{
  margin-bottom: 18px;   /* 카드 군 사이 여백 */
}

/* 의사 그리드가 바로 따라올 때 상단 여백 보정 */
.pk-results #pk-surgeries + .doctor-grid.pk-grid{
  margin-top: 6px;
}

/* (선택) 수술 카드 내부 간격 보정: 이미 추가하셨다면 중복 불필요 */
.pk-results .surgery-card{
  border: 1px solid var(--pkline,#e5e7eb);
  border-radius: 12px;
  background: #fff;
  padding: .75rem 1rem;
}

/* results summary row */
.pk-results .results-summary{
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  padding: 8px 0 12px;
  border-bottom: 1px solid var(--pkline,#e5e7eb);
  margin-bottom: 8px;
}
.pk-results .results-summary .sum-key{
  color: var(--muted,#6b7280);
  font-size: .9rem;
}
.pk-results .results-summary .sum-key .kw{ color: var(--text,#111); }
.pk-results .results-summary .sum-key .kw strong{ font-weight: 800; }

.pk-results .results-summary .sum-chips{
  display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center;
  font-size: .92rem;
}
.pk-results .results-summary .sum-chips .sum-link{
  display:inline-flex; align-items:center; gap: .4rem;
  padding: .24rem .6rem; border-radius: 999px; text-decoration:none;
  background:#f7f8fb; color:#222; border:1px solid transparent;
}
.pk-results .results-summary .sum-chips .sum-link:hover{
  background:#f0f2f7; border-color: #e5e7eb;
}
.pk-results .results-summary .sum-chips .sum-link b{ font-weight: 800; }
.pk-results .results-summary .sum-chips .dot{ color: var(--pkline,#e5e7eb); }


