/* ==========================================================================
   Facility Detail styles — components.css에서 분리 (fd- prefix)
   facility-detail 페이지에서만 로드된다. 공유되는 리뷰 버블 카드(.fd-review-card)는
   home/mypage에서도 쓰이므로 components.css에 그대로 남겨둠.
   ========================================================================== */

/* ==========================================================================
   Facility Detail — 케어닥 스타일 카드 기반 디자인 (fd- prefix)
   ========================================================================== */

/* ---- CSS Variables for Facility Detail ---- */
:root {
  --fd-gradient-start: #1E3A8A;
  --fd-gradient-end: #3B82F6;
  --fd-overlay: rgba(0,0,0,0.6);
  --fd-glass: rgba(255,255,255,0.95);
  --fd-grade-a: #166534;
  --fd-grade-b: #1E40AF;
  --fd-grade-c: #92400E;
  --fd-grade-d: #9A3412;
  --fd-grade-e: #991B1B;
}

/* ---- Hero Image Gallery (CareDoc Style - Centered & Clean) ---- */
.fd-hero {
  position: relative;
  background: #F8FAFC;
}
.fd-slider {
  position: relative;
  overflow: hidden;
  background: #F1F5F9;
  max-width: 1200px;
  margin: 0 auto;
  border-radius: 0;
}
/* 모바일: 4:3 비율 */
@media (max-width: 767px) {
  .fd-slider {
    aspect-ratio: 4 / 3;
    max-height: 320px;
  }
}
/* 태블릿/데스크탑: 16:9 비율, 중앙 정렬 */
@media (min-width: 768px) {
  .fd-hero {
    padding: 16px 16px 0;
  }
  .fd-slider {
    aspect-ratio: 16 / 9;
    max-height: 500px;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  }
}
@media (min-width: 1024px) {
  .fd-hero {
    padding: 24px 24px 0;
  }
  .fd-slider {
    max-height: 540px;
    border-radius: 20px;
  }
}
.fd-slider-track {
  display: flex;
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  height: 100%;
}
.fd-slide {
  flex: 0 0 100%;
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #F1F5F9;
}
.fd-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
.fd-slide-error img {
  object-fit: contain;
  background: #F1F5F9;
}

/* Hero Overlay with Gradient - CareDoc style */
.fd-slider-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 48px 20px 20px;
  background: linear-gradient(to top, rgba(0,0,0,0.65) 0%, rgba(0,0,0,0.3) 50%, transparent 100%);
  pointer-events: none;
  z-index: 5;
}
@media (min-width: 768px) {
  .fd-slider-overlay {
    padding: 60px 28px 24px;
    border-radius: 0 0 16px 16px;
  }
}
@media (min-width: 1024px) {
  .fd-slider-overlay {
    padding: 80px 32px 28px;
    border-radius: 0 0 20px 20px;
  }
}
.fd-hero-badges {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  pointer-events: auto;
}
.fd-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.fd-hero-badge-grade {
  background: rgba(255,255,255,0.95);
}
.fd-hero-badge-grade-a { color: var(--fd-grade-a); }
.fd-hero-badge-grade-b { color: var(--fd-grade-b); }
.fd-hero-badge-grade-c { color: var(--fd-grade-c); }
.fd-hero-badge-grade-d { color: var(--fd-grade-d); }
.fd-hero-badge-grade-e { color: var(--fd-grade-e); }
.fd-hero-badge-type {
  background: rgba(37, 99, 235, 0.9);
  color: #fff;
}
.fd-hero-title {
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  margin: 0 0 6px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
  line-height: 1.3;
}
.fd-hero-address {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: rgba(255,255,255,0.85);
  margin: 0;
}
.fd-hero-address svg {
  width: 14px;
  height: 14px;
  opacity: 0.8;
}

/* Slider Controls */
.fd-slider-counter {
  position: absolute;
  bottom: 12px;
  right: 12px;
  padding: 6px 14px;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  border-radius: 20px;
  letter-spacing: 0.5px;
  z-index: 10;
}
.fd-slider-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: #1E293B;
  font-size: 24px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
  opacity: 0;
  transition: all 0.25s;
  z-index: 10;
}
.fd-slider:hover .fd-slider-arrow { opacity: 1; }
.fd-slider-prev { left: 12px; }
.fd-slider-next { right: 12px; }
.fd-slider-arrow:hover {
  background: #fff;
  transform: translateY(-50%) scale(1.05);
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}
.fd-slider-arrow:active {
  transform: translateY(-50%) scale(0.95);
}

/* Slider Dots */
.fd-slider-dots {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 10;
}
.fd-slider-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  cursor: pointer;
  transition: all 0.2s;
}
.fd-slider-dot.active {
  background: #fff;
  width: 24px;
  border-radius: 4px;
}

/* Gallery Empty State */
.fd-gallery-empty {
  padding: var(--space-9) var(--space-4);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  color: #64748B;
  background: linear-gradient(135deg, #F1F5F9 0%, #E2E8F0 100%);
  aspect-ratio: 4 / 3;
  max-height: 50vh;
  justify-content: center;
}
.fd-gallery-empty svg {
  opacity: 0.5;
}
.fd-gallery-empty p {
  font-size: 15px;
  margin: 0;
  font-weight: 500;
}

/* Simple Hero (no photos) */
.fd-hero-simple {
  background: linear-gradient(135deg, #F8FAFC 0%, #EEF2FF 100%);
  padding: 36px 16px;
}
.fd-hero-simple-inner {
  max-width: 1200px;
  margin: 0 auto;
}
.fd-hero-simple .fd-hero-badges {
  margin-bottom: 14px;
}
.fd-hero-simple .fd-hero-badge-grade {
  background: #fff;
  border: 1px solid #E2E8F0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.fd-hero-simple .fd-hero-badge-type {
  background: var(--primary);
}
.fd-hero-simple .fd-hero-title {
  font-size: 24px;
  text-shadow: none;
  color: var(--text);
}
.fd-hero-simple .fd-hero-address {
  color: #64748B;
}
@media (min-width: 768px) {
  .fd-hero-simple { padding: 52px 24px; }
  .fd-hero-simple .fd-hero-title { font-size: 30px; }
}
@media (min-width: 1024px) {
  .fd-hero-simple { padding: 60px 32px; }
  .fd-hero-simple .fd-hero-title { font-size: 32px; }
}


/* ---- Multi-Image Gallery (CareDoc Style) ---- */
.fd-gallery-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  grid-template-rows: 180px 180px;
  gap: 4px;
  border-radius: 16px;
  overflow: hidden;
  max-width: 1200px;
  margin: 0 auto;
  background: #F1F5F9;
}
@media (max-width: 767px) {
  .fd-gallery-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 200px 120px;
  }
}
.fd-gallery-grid .fd-gallery-item {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}
.fd-gallery-grid .fd-gallery-item:first-child {
  grid-row: 1 / 3;
}
@media (max-width: 767px) {
  .fd-gallery-grid .fd-gallery-item:first-child {
    grid-row: 1 / 2;
    grid-column: 1 / 3;
  }
}
.fd-gallery-grid .fd-gallery-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease-out;
}
.fd-gallery-grid .fd-gallery-item:hover .fd-gallery-img {
  transform: scale(1.03);
}
.fd-gallery-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  gap: 8px;
  opacity: 0;
  transition: opacity 0.25s;
}
.fd-gallery-item:hover .fd-gallery-overlay,
.fd-gallery-overlay.fd-gallery-more {
  opacity: 1;
}
.fd-gallery-overlay.fd-gallery-more {
  background: rgba(0, 0, 0, 0.6);
}

/* ---- Staff Section (CareDoc Style) ---- */
.fd-staff-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.fd-staff-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
.fd-staff-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  background: #DBEAFE;
  color: #1E40AF;
  transition: all 0.2s;
}
.fd-staff-tag:hover {
  background: #BFDBFE;
  transform: translateY(-1px);
}
.fd-staff-tag--green {
  background: #DCFCE7;
  color: #166534;
}
.fd-staff-category {
  margin-bottom: 20px;
}
.fd-staff-category:last-child {
  margin-bottom: 0;
}
.fd-staff-cat-header {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 12px;
  padding-left: 12px;
  border-left: 3px solid var(--primary);
}
.fd-staff-cat-header--medical { color: #059669; border-left-color: #10B981; }
.fd-staff-cat-header--care { color: #1E40AF; border-left-color: #3B82F6; }
.fd-staff-cat-header--rehab { color: #7C3AED; border-left-color: #8B5CF6; }
.fd-staff-cat-header--admin { color: #64748B; border-left-color: #94A3B8; }
.fd-staff-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
}
.fd-staff-table thead th {
  background: #F8FAFC;
  color: #64748B;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 10px 14px;
  border-bottom: 2px solid #E2E8F0;
  text-align: left;
}
.fd-staff-table thead th:last-child {
  text-align: center;
  width: 100px;
}
.fd-staff-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid #F1F5F9;
  vertical-align: middle;
}
.fd-staff-table tbody tr:last-child td {
  border-bottom: none;
}
.fd-staff-table tbody tr:hover td {
  background: #F8FAFC;
}
.fd-staff-table tbody td:last-child {
  text-align: center;
  font-weight: 700;
  color: var(--primary);
}

/* ---- Facility Status Section (CareDoc Style) ---- */
.fd-facility-status {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.fd-fs-category {
  margin-bottom: 16px;
}
.fd-fs-category:last-child {
  margin-bottom: 0;
}
.fd-fs-cat-header {
  font-size: 14px;
  font-weight: 700;
  color: #0891B2;
  margin-bottom: 12px;
  padding-left: 12px;
  border-left: 3px solid #22D3EE;
}
.fd-fs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
@media (min-width: 640px) {
  .fd-fs-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (min-width: 1024px) {
  .fd-fs-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
.fd-fs-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 12px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  text-align: center;
  transition: all 0.2s;
}
.fd-fs-item:hover {
  border-color: #BFDBFE;
  background: #F0F7FF;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.08);
}
.fd-fs-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #DBEAFE;
  color: #1E40AF;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}
.fd-fs-icon svg {
  width: 20px;
  height: 20px;
}
.fd-fs-name {
  font-size: 13px;
  color: #64748B;
  font-weight: 500;
  margin-bottom: 4px;
}
.fd-fs-count {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
}
.fd-fs-count small {
  font-size: 13px;
  font-weight: 500;
  color: #94A3B8;
}

/* ---- Transportation/Parking (CareDoc Style) ---- */
.fd-access-card {
  background: linear-gradient(135deg, #FAFBFC 0%, #F8FAFC 100%);
  border: 1px solid #E8ECF1;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
}
.fd-access-card:last-child {
  margin-bottom: 0;
}
.fd-access-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #E8ECF1;
}
.fd-access-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.fd-access-icon svg {
  width: 18px;
  height: 18px;
}
.fd-access-icon--transport { background: #DBEAFE; color: #1E40AF; }
.fd-access-icon--parking { background: #DCFCE7; color: #166534; }
.fd-access-icon--direction { background: #FEF3C7; color: #92400E; }
.fd-access-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.fd-access-content {
  font-size: 14px;
  color: #64748B;
  line-height: 1.7;
  white-space: pre-line;
}

/* ---- Map Section (CareDoc Style) ---- */
.fd-map-card {
  background: var(--card);
  border: 1px solid #E8ECF1;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}
.fd-card.fd-map-card {
  padding: 0;
}
.fd-card.fd-map-card .fd-card-title {
  padding: 18px 20px;
  margin: 0;
  border-bottom: 1px solid #F1F5F9;
}
.fd-map-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid #F1F5F9;
}
.fd-map-card-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #FEE2E2;
  color: #DC2626;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fd-map-card-icon svg {
  width: 16px;
  height: 16px;
}
.fd-map-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.fd-map-card .fd-map {
  border-radius: 0;
  height: 280px;
}
@media (min-width: 1024px) {
  .fd-map-card .fd-map {
    height: 320px;
  }
}

/* Map Card - New Structure */
.fd-map-wrapper {
  border-bottom: 1px solid #F1F5F9;
  padding: 16px;
  background: #F8FAFC;
}
.fd-map-wrapper .fd-map {
  width: 100%;
  height: 300px;
  border: none;
  border-radius: 12px;
  display: block;
}
@media (min-width: 768px) {
  .fd-map-wrapper .fd-map {
    height: 360px;
  }
}
@media (min-width: 1024px) {
  .fd-map-wrapper .fd-map {
    height: 420px;
  }
}
.fd-map-info {
  padding: 16px 20px;
  background: #FAFBFC;
  border-bottom: 1px solid #F1F5F9;
}
.fd-map-addr-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}
.fd-map-addr-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #FEE2E2;
  color: #DC2626;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.fd-map-addr-text {
  flex: 1;
  min-width: 0;
}
.fd-map-addr-main {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.5;
}
.fd-map-actions {
  display: flex;
  gap: 10px;
}
.fd-map-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 42px;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: #475569;
  background: white;
  text-decoration: none;
  transition: all 0.2s;
}
.fd-map-btn:hover {
  background: #F8FAFC;
  border-color: #CBD5E1;
}
.fd-map-btn-primary {
  background: linear-gradient(135deg, #3B82F6, #1E40AF);
  border: none;
  color: white;
}
.fd-map-btn-primary:hover {
  background: linear-gradient(135deg, #2563EB, #1E3A8A);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Access Grid */
.fd-access-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 16px 20px;
}
.fd-access-grid .fd-access-card {
  background: #F8FAFC;
  border: 1px solid #E8ECF1;
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}
.fd-access-grid .fd-access-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
}
.fd-access-icon--bus {
  background: #DBEAFE;
  color: #1E40AF;
}
.fd-access-icon--car {
  background: #DCFCE7;
  color: #166534;
}
.fd-access-grid .fd-access-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.fd-access-grid .fd-access-title {
  font-size: 12px;
  font-weight: 600;
  color: #64748B;
}
.fd-access-grid .fd-access-desc {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fd-access-grid .fd-access-desc--detail {
  white-space: pre-line;
  overflow: visible;
  text-overflow: unset;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.6;
  color: #475569;
}
.fd-access-card--detail {
  grid-column: 1 / -1;
}
.fd-access-card--detail .fd-access-icon {
  align-self: flex-start;
  margin-top: 2px;
}
@media (max-width: 479px) {
  .fd-access-grid {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 14px 16px;
  }
  .fd-map-info {
    padding: 14px 16px;
  }
  .fd-map-actions {
    flex-direction: column;
    gap: 8px;
  }
  .fd-map-btn {
    height: 40px;
  }
}

/* ---- Quick Stats Section ---- */
.fd-quick-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 16px;
  background: var(--card);
  border-bottom: 1px solid var(--border-light);
  max-width: 1200px;
  margin: 0 auto;
}
@media (min-width: 768px) {
  .fd-quick-stats {
    margin: 20px auto;
    border-radius: 20px;
    border: 1px solid #E2E8F0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    padding: 24px;
  }
}
@media (min-width: 1024px) {
  .fd-quick-stats {
    margin: 24px auto;
    padding: 28px 32px;
  }
}
.fd-qs-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18px 14px;
  background: linear-gradient(135deg, #FAFBFC 0%, #F8FAFC 100%);
  border-radius: 14px;
  border: 1px solid #E2E8F0;
  text-align: center;
  transition: all 0.25s;
}
.fd-qs-card:hover {
  border-color: #BFDBFE;
  background: linear-gradient(135deg, #F0F7FF 0%, #F8FAFC 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.08);
}

/* Circular Gauge for Grade */
.fd-gauge {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: conic-gradient(var(--gauge-color, var(--primary)) calc(var(--pct, 0) * 1%), #E2E8F0 0);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}
.fd-gauge-inner {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.06);
}
.fd-gauge-letter {
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}
.fd-gauge-score {
  font-size: 10px;
  font-weight: 600;
  color: #64748B;
  margin-top: 2px;
}
.fd-gauge-grade-a { --gauge-color: #22C55E; }
.fd-gauge-grade-a .fd-gauge-letter { color: var(--fd-grade-a); }
.fd-gauge-grade-b { --gauge-color: #3B82F6; }
.fd-gauge-grade-b .fd-gauge-letter { color: var(--fd-grade-b); }
.fd-gauge-grade-c { --gauge-color: #F59E0B; }
.fd-gauge-grade-c .fd-gauge-letter { color: var(--fd-grade-c); }
.fd-gauge-grade-d { --gauge-color: #F97316; }
.fd-gauge-grade-d .fd-gauge-letter { color: var(--fd-grade-d); }
.fd-gauge-grade-e { --gauge-color: #EF4444; }
.fd-gauge-grade-e .fd-gauge-letter { color: var(--fd-grade-e); }

/* Grade Hero Card — Enhanced Evaluation Display */
.fd-qs-grade-hero {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, #F0F7FF 0%, #FAFBFC 100%);
  border: 1.5px solid #BFDBFE;
  padding: 20px;
}
.fd-qs-grade-hero:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.12);
}

.fd-grade-top {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 4px;
}

.fd-grade-score-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.fd-grade-score-big {
  font-size: 32px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.fd-grade-score-big small {
  font-size: 16px;
  font-weight: 600;
  color: #64748B;
}

.fd-grade-compare {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #E2E8F0;
}

.fd-grade-bar-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fd-grade-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fd-grade-bar-label {
  font-size: 12px;
  font-weight: 600;
  color: #64748B;
  min-width: 64px;
  flex-shrink: 0;
  white-space: nowrap;
}

.fd-grade-bar-track {
  flex: 1;
  height: 8px;
  background: #E2E8F0;
  border-radius: 4px;
  overflow: hidden;
}

.fd-grade-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease-out;
}

.fd-grade-bar-fill--facility {
  background: linear-gradient(90deg, var(--primary) 0%, #60A5FA 100%);
}

.fd-grade-bar-fill--region {
  background: #CBD5E1;
}

.fd-grade-bar-val {
  font-size: 13px;
  font-weight: 700;
  color: #94A3B8;
  min-width: 32px;
  text-align: right;
  flex-shrink: 0;
}

.fd-grade-bar-val--facility {
  color: var(--primary);
}

.fd-grade-diff {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 10px;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
}

.fd-grade-diff--up {
  background: #DCFCE7;
  color: #15803D;
}

.fd-grade-diff--down {
  background: #FEF2F2;
  color: #DC2626;
}

@media (min-width: 768px) {
  .fd-qs-grade-hero {
    grid-column: span 2;
    padding: 24px;
  }
  .fd-grade-score-big {
    font-size: 36px;
  }
  .fd-grade-bar-label {
    min-width: 80px;
    font-size: 13px;
  }
}

@media (min-width: 1200px) {
  .fd-qs-grade-hero {
    grid-column: span 2;
  }
}

.fd-qs-number {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 4px;
}
.fd-qs-number small {
  font-size: 14px;
  font-weight: 600;
  color: #94A3B8;
}
.fd-qs-label {
  font-size: 12px;
  font-weight: 600;
  color: #64748B;
}
.fd-qs-sub {
  font-size: 11px;
  color: #94A3B8;
  margin-top: 2px;
}
.fd-qs-sub.fd-vacancy {
  color: var(--primary);
  font-weight: 600;
}

/* Vacancy Pulse Animation */
@keyframes fd-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(37, 99, 235, 0); }
}
.fd-vacancy-pulse {
  animation: fd-pulse 2s ease-in-out infinite;
}
.fd-qs-card.fd-qs-vacancy {
  border-color: #BFDBFE;
  background: #EFF6FF;
}
.fd-qs-card.fd-qs-vacancy .fd-qs-number {
  color: var(--primary);
}

/* ---- Header ---- */
.fd-header-wrap {
  background: var(--card);
  padding: 20px 16px 16px;
  border-bottom: 1px solid #E8ECF1;
}
.fd-header-wrap .container {
  max-width: 1200px;
  margin: 0 auto;
}
@media (min-width: 768px) {
  .fd-header-wrap {
    padding: 28px 24px 24px;
  }
}
@media (min-width: 1024px) {
  .fd-header-wrap {
    padding: 32px 32px 28px;
  }
}
.fd-header-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: 10px;
}
.fd-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.fd-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}
.fd-badge-type {
  background: var(--primary-light);
  color: var(--primary);
}
.fd-badge-grade {
  background: var(--border-light);
  color: var(--text);
}
.fd-badge-grade em { font-style: normal; font-weight: 600; opacity: 0.7; }
.fd-badge-grade-a { background: #DCFCE7; color: #166534; }
.fd-badge-grade-b { background: #DBEAFE; color: #1E40AF; }
.fd-badge-grade-c { background: #FEF3C7; color: #92400E; }
.fd-badge-grade-d { background: #FFEDD5; color: #9A3412; }
.fd-badge-grade-e { background: #FEE2E2; color: #991B1B; }
.fd-badge-grade-none { background: var(--border-light); color: var(--subtext); }
.fd-badge-year {
  background: #F1F5F9;
  color: #64748B;
}
.fd-badge-premium {
  background: linear-gradient(135deg, #F59E0B, #D97706);
  color: #fff;
}
.fd-updated {
  font-size: 11px;
  color: #94A3B8;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Title Row */
.fd-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}
.fd-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.35;
  letter-spacing: -0.02em;
  margin: 0;
  flex: 1;
  min-width: 0;
}
.fd-title-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  margin-top: 2px;
}
.fd-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  color: #94A3B8;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}
.fd-icon-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}
.fd-icon-btn.active {
  color: #EF4444;
  border-color: #FCA5A5;
  background: #FEF2F2;
}

/* Address */
.fd-address {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #64748B;
  margin: 10px 0 0;
  line-height: 1.5;
}
.fd-address svg { flex-shrink: 0; color: #94A3B8; }


/* ---- Feature Tags ---- */
.fd-features-wrap {
  background: var(--card);
  border-bottom: 1px solid var(--border-light);
  padding: 0 16px 16px;
}
.fd-features-wrap .container {
  max-width: 1200px;
  margin: 0 auto;
}
@media (min-width: 768px) {
  .fd-features-wrap {
    padding: 0 24px 20px;
  }
}
.fd-features {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding: 0 0 4px;
}
.fd-features::-webkit-scrollbar { display: none; }
.fd-feat {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding: 10px 16px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  transition: all 0.2s;
}
.fd-feat:hover {
  border-color: #CBD5E1;
  background: #F1F5F9;
}
.fd-feat-accent {
  background: #EFF6FF;
  border-color: #BFDBFE;
  color: #1D4ED8;
}
.fd-feat-accent:hover {
  background: #DBEAFE;
}
.fd-feat-good {
  background: #F0FDF4;
  border-color: #BBF7D0;
  color: #166534;
}
.fd-feat-good:hover {
  background: #DCFCE7;
}
.fd-feat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #E2E8F0;
  color: #475569;
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
}
.fd-feat-icon svg { width: 16px; height: 16px; }
.fd-feat-accent .fd-feat-icon { background: #BFDBFE; color: #1E40AF; }
.fd-feat-good .fd-feat-icon { background: #BBF7D0; color: #166534; }
.fd-feat-grade-a { background: #DCFCE7; color: #166534; }
.fd-feat-grade-b { background: #DBEAFE; color: #1E40AF; }
.fd-feat-grade-c { background: #FEF3C7; color: #92400E; }
.fd-feat-grade-d { background: #FFEDD5; color: #9A3412; }
.fd-feat-grade-e { background: #FEE2E2; color: #991B1B; }
.fd-feat-grade-none { background: #E2E8F0; color: #64748B; }
.fd-feat-text {
  font-weight: 600;
}


/* ---- Sticky Navigation with Animated Underline ---- */
.fd-nav {
  position: sticky;
  top: 56px;
  z-index: 90;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.fd-nav .container {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}
@media (min-width: 768px) {
  .fd-nav .container {
    padding: 0 24px;
  }
}
.fd-nav-scroll {
  display: flex;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}
.fd-nav-scroll::-webkit-scrollbar { display: none; }
.fd-nav-item {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 16px 20px;
  font-size: 14px;
  font-weight: 600;
  color: #94A3B8;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.25s;
  position: relative;
}
.fd-nav-item::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 18px;
  right: 18px;
  height: 3px;
  background: var(--primary);
  border-radius: 3px 3px 0 0;
  transform: scaleX(0);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.fd-nav-item:hover {
  color: var(--primary);
}
.fd-nav-item.active {
  color: var(--primary);
}
.fd-nav-item.active::after {
  transform: scaleX(1);
}
.fd-nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 11px;
  background: linear-gradient(135deg, #2563EB 0%, #3B82F6 100%);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  font-style: normal;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}


/* ---- Body / Layout ---- */
.fd-body {
  padding: 16px 0 100px;
  background: #F8FAFC;
}
.fd-body .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}
@media (min-width: 768px) {
  .fd-body {
    padding: 24px 0 80px;
  }
  .fd-body .container {
    padding: 0 24px;
  }
}
.fd-layout {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}
.fd-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}


/* ---- Card (main content container) ---- */
.fd-card {
  background: var(--card);
  border-radius: 20px;
  padding: 24px 20px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
  border: 1px solid #E8ECF1;
  transition: box-shadow 0.2s, transform 0.2s;
}
.fd-card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}
.fd-card-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 24px;
  letter-spacing: -0.02em;
  padding-bottom: 16px;
  border-bottom: 1px solid #F1F5F9;
}
.fd-card-title svg {
  width: 22px;
  height: 22px;
  color: var(--primary);
  flex-shrink: 0;
}
.fd-card-count {
  font-size: 14px;
  font-weight: 600;
  color: #94A3B8;
  margin-left: auto;
}

/* Glass Card Style */
.fd-glass-card {
  background: var(--fd-glass);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 16px;
}


/* ---- Info Grid with Icons ---- */
.fd-info-grid {
  display: flex;
  flex-direction: column;
}
.fd-info-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid #F1F5F9;
}
.fd-info-item:last-child { border-bottom: none; }
.fd-info-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--primary);
}
.fd-info-icon svg {
  width: 20px;
  height: 20px;
}
.fd-info-icon-green { background: #DCFCE7; color: #166534; }
.fd-info-icon-amber { background: #FEF3C7; color: #92400E; }
.fd-info-icon-blue { background: #DBEAFE; color: #1E40AF; }
.fd-info-icon-slate { background: #F1F5F9; color: #475569; }
.fd-info-content {
  flex: 1;
  min-width: 0;
}
.fd-info-label {
  font-size: 12px;
  color: #94A3B8;
  font-weight: 500;
  margin-bottom: 2px;
}
.fd-info-value {
  font-size: 15px;
  color: var(--text);
  font-weight: 600;
  word-break: break-all;
}
.fd-info-value a {
  color: var(--primary);
  text-decoration: none;
}
.fd-info-value a:hover {
  text-decoration: underline;
}

/* Legacy Info Row (for backward compatibility) */
.fd-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid #F1F5F9;
  gap: 16px;
}
.fd-info-row:first-child { padding-top: 4px; }
.fd-info-row:last-child { border-bottom: none; padding-bottom: 4px; }
.fd-info-key {
  font-size: 14px;
  color: #64748B;
  font-weight: 500;
  flex-shrink: 0;
  min-width: 80px;
}
.fd-info-val {
  font-size: 14px;
  color: var(--text);
  font-weight: 600;
  text-align: right;
  word-break: break-all;
}
.fd-info-val a { color: var(--primary); text-decoration: none; font-weight: 600; }
.fd-info-val a:hover { text-decoration: underline; }


/* ---- Status Grid (입소현황) ---- */
.fd-status-grid {
  display: flex;
  gap: 0;
  text-align: center;
  margin-bottom: 16px;
}
.fd-status-item {
  flex: 1;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-right: 1px solid #F1F5F9;
}
.fd-status-item:last-child { border-right: none; }
.fd-status-num {
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}
.fd-status-num small {
  font-size: 14px;
  font-weight: 600;
  color: #94A3B8;
}
.fd-status-label {
  font-size: 12px;
  color: #94A3B8;
  font-weight: 500;
}
.fd-status-avail .fd-status-num { color: var(--primary); }
.fd-status-avail .fd-status-label { color: var(--primary); }

/* Occupancy Bar */
.fd-occ-bar-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.fd-occ-bar {
  flex: 1;
  height: 8px;
  background: #E2E8F0;
  border-radius: 4px;
  overflow: hidden;
}
.fd-occ-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--primary);
  transition: width 0.6s ease;
}
.fd-occ-pct {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  flex-shrink: 0;
  min-width: 38px;
  text-align: right;
}

/* Cost Inline (inside status card) */
.fd-cost-inline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: #F8FAFC;
  border-radius: 10px;
  border: 1px solid #E2E8F0;
}
.fd-cost-inline-label {
  font-size: 14px;
  color: #64748B;
  font-weight: 500;
}
.fd-cost-inline-val {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
}
.fd-cost-inline-val small {
  font-size: 13px;
  font-weight: 500;
  color: #94A3B8;
}


/* ---- Staff Section with Bar Chart ---- */
.fd-staff-header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px 18px;
  background: linear-gradient(135deg, #F8FAFC 0%, #F1F5F9 100%);
  border-radius: 12px;
  border: 1px solid #E2E8F0;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.fd-staff-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.fd-staff-stat-num {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
}
.fd-staff-stat-label {
  font-size: 11px;
  color: #94A3B8;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.fd-staff-badge {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  margin-left: auto;
}
.fd-staff-badge-good { background: #DCFCE7; color: #166534; }
.fd-staff-badge-warn { background: #FEE2E2; color: #991B1B; }

/* Staff Bar Chart */
.fd-staff-chart {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.fd-staff-chart-row {
  display: grid;
  grid-template-columns: 90px 1fr 40px;
  align-items: center;
  gap: 12px;
}
.fd-staff-chart-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fd-staff-bar {
  height: 28px;
  background: #F1F5F9;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}
.fd-staff-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, #60A5FA 100%);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 10px;
  min-width: 32px;
  transition: width 0.5s ease-out;
}
.fd-staff-bar-fill span {
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.fd-staff-chart-count {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  text-align: right;
}

/* Legacy Staff Table (for backward compatibility) */
.fd-staff-table {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.fd-staff-cat {
  border-bottom: 1px solid #F1F5F9;
  padding-bottom: 8px;
  margin-bottom: 8px;
}
.fd-staff-cat:last-child { border-bottom: none; margin-bottom: 0; }
.fd-staff-cat-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0 6px;
}
.fd-staff-cat-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.fd-staff-cat-total {
  font-size: 13px;
  font-weight: 600;
  color: #94A3B8;
}
.fd-staff-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0 8px 12px;
}
.fd-staff-type {
  font-size: 14px;
  color: #475569;
  font-weight: 500;
}
.fd-staff-count {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

/* Staff Detail Accordion */
.fd-staff-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 20px;
}
.fd-staff-detail-group {
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  overflow: hidden;
  transition: box-shadow 0.2s;
}
.fd-staff-detail-group[open] {
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.fd-staff-detail-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  cursor: pointer;
  user-select: none;
  list-style: none;
  background: #FAFBFC;
  transition: background 0.15s;
}
.fd-staff-detail-summary::-webkit-details-marker { display: none; }
.fd-staff-detail-summary:hover { background: #F1F5F9; }
.fd-staff-detail-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.fd-staff-detail-cat {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.fd-staff-detail-total {
  font-size: 13px;
  font-weight: 600;
  color: #94A3B8;
  margin-left: auto;
}
.fd-staff-detail-arrow {
  flex-shrink: 0;
  color: #94A3B8;
  transition: transform 0.2s;
}
.fd-staff-detail-group[open] .fd-staff-detail-arrow {
  transform: rotate(180deg);
}
.fd-staff-detail-list {
  padding: 4px 16px 12px;
  background: #fff;
}
.fd-staff-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 8px 9px 20px;
  border-bottom: 1px solid #F1F5F9;
}
.fd-staff-detail-row:last-child {
  border-bottom: none;
}
.fd-staff-detail-type {
  font-size: 14px;
  color: #475569;
  font-weight: 500;
}
.fd-staff-detail-count {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  min-width: 50px;
  text-align: right;
}
/* Color accents for summary borders */
.fd-staff-detail-summary--medical { border-left: 3px solid #10B981; }
.fd-staff-detail-summary--care { border-left: 3px solid #3B82F6; }
.fd-staff-detail-summary--rehab { border-left: 3px solid #8B5CF6; }
.fd-staff-detail-summary--admin { border-left: 3px solid #94A3B8; }


/* ---- Amenity List ---- */
.fd-amenity-list {
  display: flex;
  flex-direction: column;
}
.fd-amenity-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #F1F5F9;
}
.fd-amenity-row:last-child { border-bottom: none; }
.fd-amenity-name {
  font-size: 14px;
  font-weight: 500;
  color: #475569;
}
.fd-amenity-val {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}


/* ---- Program Section (CareDoc Style) ---- */
.fd-prog-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 640px) {
  .fd-prog-container {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1024px) {
  .fd-prog-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}
.fd-prog-group {
  background: linear-gradient(135deg, #FAFBFC 0%, #F8FAFC 100%);
  border: 1px solid #E8ECF1;
  border-radius: 16px;
  padding: 20px;
  transition: all 0.25s;
}
.fd-prog-group:hover {
  border-color: #DBEAFE;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.08);
  transform: translateY(-2px);
}
.fd-prog-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid #E8ECF1;
}
.fd-prog-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.fd-prog-icon svg {
  width: 22px;
  height: 22px;
}
/* Category-specific colors */
.fd-prog-group[data-category="인지기능"] .fd-prog-icon { background: #DBEAFE; color: #1E40AF; }
.fd-prog-group[data-category="신체기능"] .fd-prog-icon { background: #DCFCE7; color: #166534; }
.fd-prog-group[data-category="정서지원"] .fd-prog-icon { background: #FEF3C7; color: #92400E; }
.fd-prog-group[data-category="여가활동"] .fd-prog-icon { background: #FCE7F3; color: #9D174D; }
.fd-prog-group[data-category="일상생활"] .fd-prog-icon { background: #E0E7FF; color: #4338CA; }
.fd-prog-group[data-category="기타"] .fd-prog-icon,
.fd-prog-group:not([data-category]) .fd-prog-icon { background: #F1F5F9; color: #475569; }

.fd-prog-label {
  flex: 1;
}
.fd-prog-label-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 2px;
}
.fd-prog-label-count {
  font-size: 12px;
  font-weight: 500;
  color: #94A3B8;
}
.fd-prog-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.fd-prog-chip {
  padding: 8px 14px;
  border-radius: 10px;
  background: #fff;
  color: #334155;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid #E2E8F0;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.fd-prog-chip:hover {
  border-color: #BFDBFE;
  background: #F0F7FF;
  color: #1E40AF;
}
.fd-prog-chip::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.4;
}
/* Legacy fallback for old structure (without fd-prog-container) */
.fd-card > .fd-prog-group {
  margin-bottom: 20px;
  background: linear-gradient(135deg, #FAFBFC 0%, #F8FAFC 100%);
  border: 1px solid #E8ECF1;
  border-radius: 16px;
  padding: 20px;
}
.fd-card > .fd-prog-group:last-child { margin-bottom: 0; }
.fd-card > .fd-prog-group > h4.fd-prog-label {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid #E8ECF1;
  display: flex;
  align-items: center;
  gap: 8px;
}
.fd-card > .fd-prog-group > h4.fd-prog-label span {
  font-size: 12px;
  font-weight: 500;
  color: #94A3B8;
  background: #F1F5F9;
  padding: 2px 8px;
  border-radius: 10px;
}


/* ---- Cost Section ---- */
.fd-cost-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.fd-cost-box {
  padding: 16px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.fd-cost-box-label {
  font-size: 12px;
  color: #64748B;
  font-weight: 500;
}
.fd-cost-box-val {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}
.fd-cost-box-val small {
  font-size: 13px;
  font-weight: 500;
  color: #94A3B8;
}

/* Fee List */
.fd-fee-list {
  display: flex;
  flex-direction: column;
}
.fd-fee-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #F1F5F9;
}
.fd-fee-row:last-child { border-bottom: none; }
.fd-fee-name {
  font-size: 14px;
  color: #475569;
  font-weight: 500;
}
.fd-fee-val {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}
.fd-fee-val small {
  font-size: 12px;
  font-weight: 500;
  color: #94A3B8;
  margin-left: 2px;
}
.fd-fee-total {
  background: #F0FDF4;
  border-radius: 8px;
  padding: 12px;
  margin-top: 4px;
  border-bottom: none;
}
.fd-fee-total .fd-fee-name { color: #166534; font-weight: 700; }
.fd-fee-total .fd-fee-val { color: #166534; }


/* ---- Map Section ---- */
.fd-map {
  width: 100%;
  height: 240px;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(135deg, #F1F5F9, #E2E8F0);
}
.fd-map-addr {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  font-size: 13px;
  color: var(--text);
}
.fd-map-addr svg { flex-shrink: 0; color: #94A3B8; }
.fd-map-addr span { flex: 1; }
.fd-map-addr a {
  margin-left: auto;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  flex-shrink: 0;
}
.fd-map-addr a:hover { text-decoration: underline; }


/* ---- Review Section with Bubble Cards ---- */
.fd-review-summary {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 28px;
  background: linear-gradient(135deg, #FAFBFF 0%, #F8FAFC 100%);
  border: 1px solid #E8ECF1;
  border-radius: 20px;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}
.fd-rs-score {
  text-align: center;
  padding: 20px 0;
}
.fd-rs-num {
  font-size: 56px;
  font-weight: 800;
  color: var(--text);
  display: block;
  line-height: 1;
  background: linear-gradient(135deg, #1E3A8A 0%, #3B82F6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.fd-rs-stars {
  color: #FBBF24;
  font-size: 22px;
  letter-spacing: 3px;
  margin-top: 8px;
}
.fd-rs-total {
  display: block;
  font-size: 13px;
  color: #94A3B8;
  margin-top: 8px;
  font-weight: 500;
}
.fd-rs-bars {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.fd-rb-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.fd-rb-label {
  font-size: 13px;
  font-weight: 500;
  color: #64748B;
  width: 70px;
  flex-shrink: 0;
}
.fd-rb-bar {
  flex: 1;
  height: 8px;
  background: #E2E8F0;
  border-radius: 4px;
  overflow: hidden;
}
.fd-rb-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, #60A5FA 100%);
  border-radius: 4px;
  transition: width 0.6s ease-out;
}
.fd-rb-val {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  width: 28px;
  text-align: right;
  flex-shrink: 0;
}

.fd-review-actions { margin-bottom: 20px; }
.fd-write-review-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  background: var(--primary);
  color: #fff;
  text-decoration: none;
  transition: all 0.2s;
}
.fd-write-review-btn:hover {
  background: var(--primary-dark);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}
.fd-write-review-outline {
  background: var(--card);
  color: var(--primary);
  border: 2px solid var(--primary);
}
.fd-write-review-outline:hover {
  background: var(--primary-light);
  color: var(--primary);
  transform: translateY(-1px);
  box-shadow: none;
}

.fd-review-form-wrap {
  padding: 24px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 16px;
  margin-bottom: 20px;
}

/* Simple Review Form */
.fd-simple-review-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.fd-rating-select {
  text-align: center;
}
.fd-rating-select label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #64748B;
  margin-bottom: 12px;
}
.fd-stars {
  display: flex;
  justify-content: center;
  gap: 8px;
}
.fd-star {
  width: 44px;
  height: 44px;
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
  transition: transform 0.15s;
}
.fd-star svg {
  width: 100%;
  height: 100%;
  fill: #E2E8F0;
  stroke: #E2E8F0;
  transition: all 0.15s;
}
.fd-star.active svg,
.fd-star:hover svg {
  fill: #FBBF24;
  stroke: #FBBF24;
}
.fd-star:hover {
  transform: scale(1.15);
}
.fd-rating-text {
  display: block;
  margin-top: 8px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.fd-review-textarea textarea {
  width: 100%;
  padding: 16px;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  font-size: 15px;
  line-height: 1.6;
  resize: vertical;
  min-height: 120px;
  transition: border-color 0.2s;
}
.fd-review-textarea textarea:focus {
  outline: none;
  border-color: var(--primary);
}
.fd-review-textarea textarea::placeholder {
  color: #94A3B8;
}
.fd-submit-review {
  width: 100%;
  padding: 14px 24px;
  border: none;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}
.fd-submit-review:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

/* Grade Colors */
.fd-text-grade-a { color: var(--grade-a); }
.fd-text-grade-b { color: var(--grade-b); }
.fd-text-grade-c { color: var(--grade-c); }
.fd-text-grade-d { color: var(--grade-d); }
.fd-text-grade-e { color: var(--grade-e); }
.fd-text-grade-none { color: var(--subtext); }


/* ---- Sidebar (aside) ---- */
.fd-aside { display: none; }
.fd-aside-sticky {
  position: sticky;
  top: 110px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.fd-aside-card {
  background: var(--card);
  border: 1px solid #E8ECF1;
  border-radius: 20px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.05);
  transition: box-shadow 0.2s, transform 0.2s;
}
.fd-aside-card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}
.fd-aside-cta-card {
  background: linear-gradient(135deg, #FAFBFF 0%, #FFFFFF 100%);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.1);
  border-color: #DBEAFE;
}
.fd-aside-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 4px;
}
.fd-aside-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 12px;
  border-radius: 8px;
}
.fd-aside-open { background: #F0FDF4; color: #166534; }
.fd-aside-open strong { color: #166534; }
.fd-aside-closed { background: #FEE2E2; color: #991B1B; }
@keyframes fdPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.fd-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22C55E;
  animation: fdPulse 2s infinite;
}
.fd-aside-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 18px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all 0.15s;
  width: 100%;
}
.fd-aside-btn-primary {
  background: linear-gradient(135deg, #2563EB 0%, #1E40AF 100%);
  color: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}
.fd-aside-btn-primary:hover {
  background: linear-gradient(135deg, #1D4ED8 0%, #1E3A8A 100%);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3);
}
.fd-aside-btn-secondary {
  background: var(--card);
  color: var(--text);
  border: 1.5px solid #E2E8F0;
  border-radius: 12px;
}
.fd-aside-btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: #F8FAFF;
}
.fd-aside-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #F1F5F9;
}
.fd-aside-row:last-child { border-bottom: none; }
.fd-aside-label {
  font-size: 13px;
  color: #64748B;
}
.fd-aside-val {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.fd-aside-val em {
  font-style: normal;
  font-weight: 500;
  color: #94A3B8;
  font-size: 12px;
}
.fd-aside-val a { color: var(--primary); text-decoration: none; }


/* ---- Mobile CTA Bar with Pulse Effect ---- */
.fd-mobile-cta {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 950;
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 -6px 24px rgba(0,0,0,0.12);
  transform: translateY(0);
  transition: transform 0.3s ease-out;
}

/* 모바일에서 하단 CTA 바 높이만큼 여백 추가 */
@media (max-width: 1023px) {
  body.facility-detail-page,
  body.match-request-page {
    padding-bottom: 90px;
  }
}
/* CTA bar always visible on mobile - do not auto-hide */
.fd-mob-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 18px 16px;
  border-radius: 14px;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all 0.2s;
  letter-spacing: -0.02em;
  min-height: 56px;
}
.fd-mob-call {
  background: var(--card);
  color: var(--primary);
  border: 2px solid var(--primary);
  flex: 0 0 auto;
  padding: 16px 24px;
}
.fd-mob-call:hover {
  background: var(--primary-light);
  color: var(--primary);
}
.fd-mob-consult {
  background: linear-gradient(135deg, #2563EB 0%, #3B82F6 100%);
  color: #fff;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);
}
.fd-mob-consult:hover {
  background: linear-gradient(135deg, #1D4ED8 0%, #2563EB 100%);
  color: #fff;
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
  transform: translateY(-1px);
}
.fd-mob-consult.fd-vacancy-pulse {
  animation: fd-cta-pulse 2s ease-in-out infinite;
}
@keyframes fd-cta-pulse {
  0%, 100% { box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3); }
  50% { box-shadow: 0 4px 20px rgba(37, 99, 235, 0.5), 0 0 0 6px rgba(37, 99, 235, 0.1); }
}
.fd-mob-vacancy-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: rgba(255,255,255,0.2);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}


/* ---- Lightbox ---- */
.fd-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.fd-lightbox.open {
  opacity: 1;
  pointer-events: auto;
}
.fd-lb-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  transition: background 0.15s;
}
.fd-lb-close:hover { background: rgba(255,255,255,0.3); }
.fd-lb-prev,
.fd-lb-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  transition: background 0.15s;
}
.fd-lb-prev { left: 12px; }
.fd-lb-next { right: 12px; }
.fd-lb-prev:hover,
.fd-lb-next:hover { background: rgba(255,255,255,0.3); }
.fd-lb-img {
  max-width: 92%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 4px;
}
.fd-lb-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.7);
  font-size: 14px;
  font-weight: 600;
}


/* ---- Responsive: Tablet (768px) ---- */
@media (min-width: 768px) {
  .fd-hero-title { font-size: 28px; }
  .fd-title { font-size: 26px; }
  .fd-card { padding: 28px 24px; border-radius: 20px; }
  .fd-card-title { font-size: 19px; margin-bottom: 28px; padding-bottom: 18px; }
  .fd-quick-stats { grid-template-columns: repeat(4, 1fr); gap: 16px; }
  .fd-qs-card { padding: 22px 18px; border-radius: 16px; }
  .fd-gauge { width: 80px; height: 80px; }
  .fd-gauge-inner { width: 64px; height: 64px; }
  .fd-gauge-letter { font-size: 24px; }
  .fd-review-summary { flex-direction: row; align-items: flex-start; gap: 24px; }
  .fd-rs-score { min-width: 130px; flex-shrink: 0; padding: 0; }
  .fd-rs-bars { flex: 1; }
  .fd-map { height: 320px; border-radius: 16px; }
  .fd-staff-chart-row { grid-template-columns: 100px 1fr 50px; }
}


/* ---- Responsive: Desktop (1024px) ---- */
@media (min-width: 1024px) {
  .fd-hero-title { font-size: 32px; }
  .fd-slider-overlay { padding: 100px 32px 28px; }
  .fd-title { font-size: 28px; }
  .fd-card { padding: 32px 28px; border-radius: 24px; }
  .fd-card-title { font-size: 20px; gap: 14px; margin-bottom: 32px; padding-bottom: 20px; }
  .fd-body { padding: 28px 0 60px; }
  .fd-layout { gap: 32px; }
  .fd-map { height: 380px; border-radius: 20px; }
  .fd-qs-card { padding: 26px 22px; border-radius: 18px; }
  .fd-gauge { width: 88px; height: 88px; }
  .fd-gauge-inner { width: 72px; height: 72px; }
  .fd-gauge-letter { font-size: 28px; }
  .fd-qs-number { font-size: 32px; }

  .fd-aside {
    display: block;
    width: 340px;
    flex-shrink: 0;
  }

  .fd-mobile-cta { display: none; }
}

/* ---- Responsive: Large Desktop (1280px) ---- */
@media (min-width: 1280px) {
  .fd-layout { gap: 40px; }
  .fd-aside { width: 360px; }
  .fd-card { padding: 36px 32px; }
  .fd-card-title { font-size: 21px; }
}


/* ==========================================================================
   공지사항 & 시설현황(방 정보) 스타일
   ========================================================================== */

/* 공지사항 리스트 */
.fd-notice-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.fd-notice-item {
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.fd-notice-item:hover {
  background: var(--bg);
}

.fd-notice-item:last-child {
  border-bottom: none;
}

.fd-notice-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 0;
}

.fd-notice-badge {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--subtext);
}

.fd-notice-badge.fd-notice-pinned {
  background: var(--primary-light);
  color: var(--primary);
}

.fd-notice-title {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fd-notice-date {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--subtext);
}

.fd-notice-arrow {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: var(--subtext);
  transition: transform var(--transition-fast);
}

.fd-notice-item.expanded .fd-notice-arrow {
  transform: rotate(180deg);
}

.fd-notice-content {
  padding: 0 0 16px 0;
  border-top: 1px solid var(--border-light);
  margin-top: -1px;
  background: var(--bg);
  padding: 16px;
  margin: 0 -20px;
  width: calc(100% + 40px);
}

.fd-notice-body {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-light);
  white-space: pre-wrap;
}

.fd-notice-meta {
  display: flex;
  gap: 16px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--subtext);
}

.fd-notice-attach {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  font-size: 13px;
  color: var(--primary);
}


/* 시설현황 방 정보 */
.fd-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}

.fd-subtitle {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 14px;
}

.fd-room-group {
  margin-bottom: 16px;
}

.fd-room-group:last-child {
  margin-bottom: 0;
}

.fd-room-cat {
  font-size: 13px;
  font-weight: 600;
  color: var(--subtext);
  margin-bottom: 8px;
  padding-left: 2px;
}

.fd-room-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px;
}

.fd-room-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: var(--radius-md);
  font-size: 13px;
}

.fd-room-name {
  color: var(--text-light);
}

.fd-room-val {
  font-weight: 600;
  color: var(--text);
}

/* 반응형 조정 */
@media (min-width: 768px) {
  .fd-notice-content {
    margin: 0;
    width: 100%;
    border-radius: var(--radius-md);
  }

  .fd-room-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
}
