/* LearnSpot 검색 화면 — ausedu search.html + search.css 패턴 참고 */

/* ----- 상단 검색 패널 (컴팩트 바 + 알약 필터 줄) ----- */
.learnspot-search-panel {
  position: sticky;
  top: 0;
  z-index: 120;
  background: var(--surface);
  border-top: 0px solid var(--border);
  border-bottom: 10px solid #f5f5f5;
  padding: 0;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  overflow: hidden;
}

.learnspot-search-bar {
  display: flex;
  align-items: center;
  gap: 0;
  padding-right: 10px;
  background: var(--surface);
  border-bottom: 0px solid rgba(0, 0, 0, 0.06);
}

.learnspot-search-magnify {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 10px;
  margin: 0;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--muted);
  border-radius: 10px;
  transition: background-color 0.2s, opacity 0.2s;
}

.learnspot-search-magnify:hover {
  background: rgba(0, 0, 0, 0.05);
}

.learnspot-search-magnify svg {
  display: block;
}

.learnspot-search-input-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
}

.learnspot-search-input {
  flex: 1;
  min-width: 0;
  padding: 10px 4px 10px 0;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  border: none;
  background: none;
  color: var(--text);
  outline: none;
}

/* 전역 input:focus-visible 링 제거 — 이 필드만 */
.learnspot-search-input:focus,
.learnspot-search-input:focus-visible {
  outline: none;
  box-shadow: none;
}

.learnspot-search-input::placeholder {
  color: #b0b0b0;
  font-weight: 500;
}

/* type=search 브라우저 기본 ×(작은 파란 취소) 숨김 — 우측 .learnspot-search-clear만 사용 */
.learnspot-search-input::-webkit-search-decoration,
.learnspot-search-input::-webkit-search-cancel-button,
.learnspot-search-input::-webkit-search-results-button,
.learnspot-search-input::-webkit-search-results-decoration {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}

.learnspot-search-input::-ms-clear {
  display: none;
}

.learnspot-search-input[type='search']::-moz-search-clear-button {
  display: none;
}

.learnspot-search-clear {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  background: none;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
  transition: background-color 0.2s, color 0.2s;
}

.learnspot-search-clear:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text);
}

.learnspot-search-clear.hidden {
  display: none !important;
}

/* 필터 알약 줄 (ausedu ls-distance-row-wrap 슬라이드 인 느낌) */
.learnspot-filter-pill-row {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 3px;
  padding: 12px 12px 12px 10px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  background: var(--surface);
  animation: learnspot-pill-row-in 0.7s ease-out forwards;
}

.learnspot-filter-pill-row::-webkit-scrollbar {
  display: none;
}

@keyframes learnspot-pill-row-in {
  from {
    opacity: 0;
    transform: translateX(74px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* 알약 + 드롭다운 화살표 (캡처 참고) */
.learnspot-pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-shrink: 0;
  padding: 6px 10px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  background: #fff;
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.2s, color 0.2s, background-color 0.2s, opacity 0.2s;
}

.learnspot-pill-btn--dropdown {
  gap: 3px;
 
  border: 1px solid #e5e7eb;
  color: #6b7280;
}

.learnspot-pill-btn--dropdown:hover {
  border-color: #d1d5db;
  color: #4b5563;
}

/* 선택 없음 = 비활성처럼 보이는 상태 (눌러서 시트는 열림) */
.learnspot-pill-btn--dropdown.learnspot-pill-btn--empty {
  color: #9ca3af;
  border-color: #e5e7eb;
  background: #fff;
  font-weight: 500;
}

.learnspot-pill-btn--dropdown.learnspot-pill-btn--empty .learnspot-pill-chevron {
  color: #9ca3af;
  opacity: 0.85;
}

/* 선택 있음 */
.learnspot-pill-btn--dropdown.has-selection {
  border-color: var(--primary);
  color: var(--primary);
  /*background: var(--primary-soft);*/
  font-weight: 600;
}

.learnspot-pill-btn--dropdown.has-selection .learnspot-pill-chevron {
  color: var(--primary);
  opacity: 1;
}

.learnspot-pill-text {
  font-size: 14px;
  letter-spacing: -0.01em;
}

/* 선택 라벨이 길 때 알약 안에서 말줄임 (지역·과목·시험준비) */
.learnspot-pill-btn--dropdown .learnspot-pill-text--dynamic {
  max-width: min(36vw, 140px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.learnspot-pill-btn .learnspot-pill-chevron {
  flex-shrink: 0;
  display: block;
  margin-top: 1px;
}

/* 필터 아이콘만 (화살표 없음) — 지역 알약 앞 */
.learnspot-pill-btn--filter-icon {
  position: relative;
  overflow: visible;
  padding: 8px 11px;
  border: 1px solid #e5e7eb;
  color: #6b7280;
  background: #fff;
}

.learnspot-filter-badge {
  position: absolute;
  top: -7px;
  left: -12px;
  min-width: 24px;
  height: 24px;
  
  border-radius: 999px;
  background: #0199d9;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 22px;
  text-align: center;
  border: 2px solid #fff;
  box-sizing: border-box;
  pointer-events: none;
  z-index: 1;
}

.learnspot-filter-badge[hidden] {
  display: none;
}

.learnspot-pill-btn--filter-icon:hover {
  border-color: #d1d5db;
  color: #4b5563;
}

.learnspot-pill-btn--filter-icon.learnspot-pill-btn--empty {
  color: #9ca3af;
  border-color: #e5e7eb;
  background: #fff;
}

.learnspot-pill-btn--filter-icon.has-selection {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}

.learnspot-pill-btn--filter-icon svg {
  display: block;
}

/* ----- 하단 필터 시트 (ausedu ls-location-modal 바텀 시트) ----- */
.learnspot-filter-sheet {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: block;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s ease, visibility 0.28s ease;
}

.learnspot-filter-sheet.is-open {
  pointer-events: auto;
  opacity: 1;
  visibility: visible;
}

.learnspot-filter-sheet-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
}

.learnspot-filter-sheet-panel {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translate(-50%, 100%);
  width: min(100vw, 560px);
  max-width: 100%;
  /* 상단 10% 정도는 남기고 멈추기 (모바일 vh 이슈 대응: dvh 우선) */
  max-height: 90vh;
  max-height: 90dvh;
  box-sizing: border-box;
  background: #fff;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.32s ease-out;
}

.learnspot-filter-sheet.is-open .learnspot-filter-sheet-panel {
  transform: translate(-50%, 0);
}

.learnspot-filter-sheet-handle {
  flex-shrink: 0;
  width: 40px;
  height: 4px;
  margin: 10px auto 0;
  border-radius: 999px;
  background: #e5e7eb;
}

.learnspot-filter-sheet-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px 16px;
  border-bottom: 1px solid var(--border);
  /* 타이틀 영역 아래에 은은한 섀도우 */
  box-shadow: 0 8px 14px -12px rgba(15, 23, 42, 0.26);
  z-index: 2;
}

.learnspot-filter-sheet-close {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 8px;
  margin: 0;
  border: none;
  background: none;
  font-size: 26px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  border-radius: 10px;
  transition: background-color 0.2s, color 0.2s;
}

.learnspot-filter-sheet-close:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text);
}

.learnspot-filter-sheet-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
}

.learnspot-filter-sheet-clear-all {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #f9fafb;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: 0.01em;
  color: #6b7280;
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.1s ease;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.learnspot-filter-sheet-clear-all-icon {
  flex-shrink: 0;
  display: block;
  opacity: 0.88;
}

.learnspot-filter-sheet-clear-all-text {
  line-height: 1;
}

.learnspot-filter-sheet-clear-all:hover:not(:disabled) {
  border-color: #fecaca;
  background: #fff5f5;
  color: #dc2626;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.1);
}

.learnspot-filter-sheet-clear-all:hover:not(:disabled) .learnspot-filter-sheet-clear-all-icon {
  stroke: #dc2626;
}

.learnspot-filter-sheet-clear-all:active:not(:disabled) {
  transform: translateY(-50%) scale(0.97);
}

.learnspot-filter-sheet-clear-all:focus-visible {
  outline: 2px solid #0199d9;
  outline-offset: 2px;
}

.learnspot-filter-sheet-clear-all:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  box-shadow: none;
}

.learnspot-filter-sheet-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 18px 8px;
  min-height: 0;
}

/* 단독 패널(Subjects / Exam Prep): 하단 칩이 footer와 붙지 않게 여백 추가 */
#filterSheetPanel[data-sheet-view='subjects'] .learnspot-filter-sheet-body,
#filterSheetPanel[data-sheet-view='course'] .learnspot-filter-sheet-body {
  padding-bottom: 28px;
}

/* 시트 안 필터 섹션 (ausedu ls-filter-chip / 섹션 타이틀) */
.learnspot-sheet-filters {
  display: grid;
  gap: 18px;
}

.learnspot-sheet-filters .filter-group {
  margin: 0;
}

.learnspot-sheet-filters .filter-group--suburbs .filter-group-label-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin: 10px 0 10px 0;
}

.learnspot-sheet-filters .filter-group--suburbs .filter-group-label-row label {
  display: block;
  margin: 0;
  flex-shrink: 0;
}

.learnspot-sheet-filters .filter-suburb-meta {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  text-align: right;
  color: var(--muted);
  word-break: break-word;
}

.learnspot-sheet-filters .filter-group label {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin: 10px 0 10px 0;
}

.learnspot-sheet-filters .chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

/* 지역: 전체 칩 → 인기지역(상위 5) → 구분선 → 나머지 */
.learnspot-sheet-filters .learnspot-chips--suburbs {
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  flex-wrap: nowrap;
}

.learnspot-sheet-filters .learnspot-chips--suburbs > .learnspot-suburb-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.learnspot-sheet-filters .filter-subsection-title {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.learnspot-sheet-filters .learnspot-suburbs-divider {
  margin: 4px 0 2px;
  border: 0;
  border-top: 1px solid var(--border);
}

/* 알약 칩 (ausedu .ls-filter-chip) */
.learnspot-sheet-filters .chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  border: 2px solid var(--border);
  border-radius: 24px;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.learnspot-sheet-filters .chip:hover {
  border-color: #cbd5e1;
}

.learnspot-sheet-filters .chip.active {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
}

/* 시험 준비: 결과 카드 .badge.exam 과 동일한 노란/앰버 패턴 (파랑 대신) */
#filterPillExam.learnspot-pill-btn--dropdown.has-selection {
  border-color: #d97706;
  color: #92400e;
  background: #fef3c7;
}

#filterPillExam.learnspot-pill-btn--dropdown.has-selection .learnspot-pill-chevron {
  color: #92400e;
}

.learnspot-sheet-filters .chips[data-group="exam_prep"] .chip.active {
  background: #fef3c7;
  border-color: #d97706;
  color: #92400e;
}

.learnspot-filter-sheet-footer {
  flex-shrink: 0;
  padding: 12px 18px calc(12px + env(safe-area-inset-bottom, 0));
  border-top: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  gap: 10px;
}

/* Search 필터 시트 하단 Cancel/Apply 버튼만 소형화 */
#filterSheetCancel.learnspot-btn-secondary,
#filterSheetApply.learnspot-btn-primary {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
  border-radius: 10px;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

#filterSheetApply.learnspot-btn-primary:active,
#filterSheetCancel.learnspot-btn-secondary:active {
  transform: scale(0.97);
}

.learnspot-btn-primary {
  flex: 1 1 0;
  display: block;
  padding: 14px 20px;
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  color: #fff;
  background: var(--primary);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.learnspot-btn-primary:hover {
  background: #1d4ed8;
}

.learnspot-btn-secondary {
  flex: 1 1 0;
  display: block;
  padding: 14px 20px;
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
}

.learnspot-btn-secondary:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

@media (min-width: 720px) {
  .learnspot-sheet-filters {
    grid-template-columns: 1fr 1fr;
  }

  .learnspot-sheet-filters .filter-group:last-child {
    grid-column: 1 / -1;
  }

  /* PC + 전체필터(all) 패널만: 섹션을 1열로 쭉 쌓기 */
  #filterSheetPanel[data-sheet-view='all'] .learnspot-sheet-filters {
    grid-template-columns: 1fr;
  }
  #filterSheetPanel[data-sheet-view='all'] .learnspot-sheet-filters .filter-group:last-child {
    grid-column: auto;
  }
}

/* ==========================================================================
   Search v2 filter UI (ported from filtering.html)
   - 섹션별 단독 시트 + 전체(all) 시트
   - Suburb 탭 레이아웃 + draft(Apply/Cancel) 지원을 위한 UI
   ========================================================================== */

/* 모든 필터 패널: 아래에서 수직으로만 슬라이드 (좌/우 기준 혼용 방지) */
#filterSheetPanel.learnspot-filter-sheet-panel {
  left: 0;
  right: 0;
  margin-left: auto;
  margin-right: auto;
  transform: translateY(100%);
}
.learnspot-filter-sheet.is-open #filterSheetPanel.learnspot-filter-sheet-panel {
  transform: translateY(0);
}

/* 알약별 단일 필터 시트 — 전체 시트(all)일 때만 모든 그룹 표시 */
.learnspot-sheet-filters .filter-group { display: none; }
.learnspot-sheet-filters[data-active-section='all'] .filter-group { display: block; }
.learnspot-sheet-filters[data-active-section='suburbs'] .filter-group--suburbs {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.learnspot-sheet-filters[data-active-section='subjects'] .filter-group[data-filter-section='subjects'],
.learnspot-sheet-filters[data-active-section='course'] .filter-group[data-filter-section='course'],
.learnspot-sheet-filters[data-active-section='class_mode'] .filter-group[data-filter-section='class_mode'],
.learnspot-sheet-filters[data-active-section='support_lang'] .filter-group[data-filter-section='support_lang'],
.learnspot-sheet-filters[data-active-section='target_years'] .filter-group[data-filter-section='target_years'] {
  display: block;
}

/* 단일 시트: 헤더 제목과 중복되는 그룹 라벨 숨김 */
.learnspot-sheet-filters:not([data-active-section='all']) .filter-group > label,
.learnspot-sheet-filters:not([data-active-section='all']) .filter-group--suburbs .filter-group-label-row {
  display: none;
}

.learnspot-filter-sheet-panel--single {
  min-height: 250px;
  max-height: min(80vh, 600px);
  max-height: min(80dvh, 600px);
}
#filterSheetPanel.learnspot-filter-sheet-panel--subjects {
  max-height: min(92vh, 760px);
  max-height: min(92dvh, 760px);
}
/* Suburb 단독 시트: 화면 높이 - 15px, 가로 전체 */
#filterSheetPanel.learnspot-filter-sheet-panel--suburbs {
  width: 100%;
  max-width: 100%;
  height: calc(100vh - 15px);
  max-height: calc(100vh - 15px);
  height: calc(100dvh - 15px);
  max-height: calc(100dvh - 15px);
}

/* PC에서 패널 너비를 Subjects 패널(560px) 기준으로 통일 (suburbs/all만) */
@media (min-width: 720px) {
  #filterSheetPanel.learnspot-filter-sheet-panel--suburbs {
    width: 560px;
    max-width: 560px;
  }
  #filterSheetPanel[data-sheet-view='all'] {
    width: min(100vw, 560px);
    max-width: 100%;
  }
}

/* Subjects / Exam prep 섹션 구분선 (공통) */
.learnspot-subjects-divider {
  width: 100%;
  flex-basis: 100%;
  height: 1px;
  border: 0;
  background: rgba(15, 23, 42, 0.06);
  margin: 12px 0 10px;
}
.learnspot-sheet-filters .learnspot-chips--subjects > .learnspot-suburb-chips-row,
.learnspot-sheet-filters .chips[data-group="course"] > .learnspot-suburb-chips-row,
.learnspot-sheet-filters .chips[data-group="class_mode"] > .learnspot-suburb-chips-row,
.learnspot-sheet-filters .chips[data-group="support_lang"] > .learnspot-suburb-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.learnspot-sheet-filters .chips[data-group="course"] > .learnspot-suburb-chips-row,
.learnspot-sheet-filters .chips[data-group="class_mode"] > .learnspot-suburb-chips-row,
.learnspot-sheet-filters .chips[data-group="support_lang"] > .learnspot-suburb-chips-row,
.learnspot-sheet-filters .learnspot-chips--subjects > .learnspot-suburb-chips-row {
  margin-top: 6px;
  width: 100%;
}
.learnspot-chips--subjects .filter-subsection-title {
  margin-top: 12px;
  width: 100%;
  flex-basis: 100%;
}
.chips[data-group="course"] .filter-subsection-title {
  margin-top: 12px;
  width: 100%;
  flex-basis: 100%;
}

.chips[data-group="class_mode"] .filter-subsection-title {
  width: 100%;
  flex-basis: 100%;
}
/* Subjects / Class Mode / Exam prep / Year Group: All 버튼은 1줄 차지 */
.learnspot-sheet-filters .chips[data-group="subjects"] .chip[data-value=""],
.learnspot-sheet-filters .chips[data-group="class_mode"] .chip[data-value=""],
.learnspot-sheet-filters .chips[data-group="support_lang"] .chip[data-value=""],
.learnspot-sheet-filters .chips[data-group="course"] .chip[data-value=""],
.learnspot-sheet-filters .chips[data-group="target_years"] .chip[data-value=""] {
  flex-basis: 100%;
  width: 100%;
  margin-bottom: 6px;
  margin-right: 5px;
}

/* 전체 필터 아이콘 고정 + 나머지 알약만 가로 스크롤 */
.learnspot-filter-pill-row--pinned {
  display: flex;
  align-items: stretch;
  gap: 0;
  padding: 12px 0 12px 10px;
  overflow: hidden;
  background: var(--surface);
}
.learnspot-filter-pill-row-anchor {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding-right: 6px;
  background: var(--surface);
  z-index: 2;
  box-shadow: 6px 0 10px -6px rgba(15, 23, 42, 0.12);
}
.learnspot-filter-pill-row-scroll {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 3px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding-right: 12px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.learnspot-filter-pill-row-scroll::-webkit-scrollbar { display: none; }

/* ── Suburb: 선택 줄 + 탭 레이아웃 ───────────────────────────── */
.filter-group--suburbs {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.suburb-selected-row {
  flex: 0 0 40px;
  height: 40px;
  max-height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding-left: 0;
  padding-right: 0;
  overflow: hidden;
  box-sizing: border-box;
}
.suburb-selected-placeholder {
  display: none;
  font-size: 13px;
  font-weight: 400;
  color: #9ca3af;
  white-space: nowrap;
}
.suburb-selected-row.is-empty { justify-content: center; }
.suburb-selected-row.is-empty .suburb-selected-placeholder {
  display: block;
  text-align: center;
}
.suburb-selected-row.is-empty .suburb-selected-chips { display: none; }
.suburb-selected-row:not(.is-empty) .suburb-selected-placeholder { display: none; }

.suburb-selected-chips {
  flex: 1;
  min-width: 0;
  height: 36px;
  max-height: 36px;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 4px 0 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  touch-action: pan-x;
}
.suburb-selected-chips::-webkit-scrollbar { display: none; }
.suburb-chip-selected {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px 5px 10px;
  background: var(--primary-soft);
  border: 1.5px solid var(--primary);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  white-space: nowrap;
}
.suburb-chip-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.12);
  border: none;
  font-size: 11px;
  line-height: 1;
  color: var(--primary);
  cursor: pointer;
  padding: 0;
}
.suburb-chip-remove:hover { background: rgba(37, 99, 235, 0.22); }

.suburb-tab-layout {
  flex: 0 0 320px;
  height: 320px;
  max-height: 320px;
  min-height: 320px;
  display: flex;
  border: 1px solid #e5e7eb;
  overflow: hidden;
  background: #fff;
  box-sizing: border-box;
}

/* Suburb 단독 시트: 선택 줄(고정) + 탭(높이 유지, 내부만 스크롤) */
#filterSheetPanel[data-sheet-view='suburbs'] .learnspot-filter-sheet-body {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
  padding-left: 0;
  padding-right: 0;
}
#filterSheetPanel[data-sheet-view='suburbs'] .filter-group--suburbs {
  padding-left: 0;
  padding-right: 0;
}
#filterSheetPanel[data-sheet-view='suburbs'] .suburb-selected-row {
  flex: 0 0 40px;
  height: 40px;
  min-height: 40px;
  max-height: 40px;
  padding-left: 0;
  padding-right: 0;
  margin-bottom: 8px;
}
#filterSheetPanel[data-sheet-view='suburbs'] .suburb-tab-layout {
  border-left: none;
  border-right: none;
  border-radius: 0;
}
#filterSheetPanel[data-sheet-view='suburbs'] .learnspot-sheet-filters {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
#filterSheetPanel[data-sheet-view='suburbs'] .suburb-tab-layout {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
  max-height: none;
}

/* ── 전체(all) 시트 전용 튜닝 (filtering.html에서 이식) ───────────── */
#filterSheetPanel[data-sheet-view='all'] .filter-group--suburbs {
  overflow: hidden;
}
#filterSheetPanel[data-sheet-view='all'] {
  width: min(100vw, 680px);
  max-width: 100%;
  height: calc(100vh - 15px);
  max-height: calc(100vh - 15px);
  height: calc(100dvh - 15px);
  max-height: calc(100dvh - 15px);
}

/* PC 큰 화면에서만: 전체 필터 패널 너비 560 고정 */
@media (min-width: 720px) {
  #filterSheetPanel[data-sheet-view='all'] {
    width: 560px;
    max-width: 560px;
  }
}
#filterSheetPanel[data-sheet-view='all'] .learnspot-sheet-filters .filter-group > label,
#filterSheetPanel[data-sheet-view='all'] .learnspot-sheet-filters .filter-group--suburbs .filter-group-label-row > label {
  font-size: 17px;
}
#filterSheetPanel[data-sheet-view='all'] .learnspot-sheet-filters .filter-group > label::before,
#filterSheetPanel[data-sheet-view='all'] .learnspot-sheet-filters .filter-group--suburbs .filter-group-label-row > label::before {
  content: '';
  display: block;
  height: 5px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  margin-top: 10px;
  margin-bottom: 20px;
}
/* Suburb 타이틀 위 라인은 제거 */
#filterSheetPanel[data-sheet-view='all'] .learnspot-sheet-filters .filter-group--suburbs .filter-group-label-row > label::before {
  content: none;
  display: none;
}
/* Subjects 타이틀 위 라인은 제거 */
#filterSheetPanel[data-sheet-view='all'] #filter-section-subjects > label::before {
  content: none;
  display: none;
}
#filterSheetPanel[data-sheet-view='all'] .learnspot-sheet-filters .filter-group--suburbs .filter-group-label-row {
  justify-content: flex-start;
  padding-bottom: 10px;
}
/* Suburbs 타이틀 줄 아래 1px 연한 회색 라인 */
#filterSheetPanel[data-sheet-view='all'] #filter-section-suburbs .filter-group-label-row {
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  padding-bottom: 12px;
  margin-bottom: 10px;
}
#filterSheetPanel[data-sheet-view='all'] .learnspot-sheet-filters .filter-group--suburbs .filter-group-label-row > label {
  text-align: left;
  margin-left: 0;
}
/* Suburbs 타이틀만 좌측 25px 여백 */
#filterSheetPanel[data-sheet-view='all'] #filter-section-suburbs .filter-group-label-row > label {
  margin-left: 25px;
}
/* 맨 아래 Parent Support Languages 칩이 footer에 붙지 않게 */
#filterSheetPanel[data-sheet-view='all'] #filter-section-support_lang .chips {
  margin-bottom: 50px;
}
#filterSheetPanel[data-sheet-view='all'] .suburb-tab-layout {
  width: 100%;
  max-width: 100%;
  height: 420px;
  min-height: 420px;
  max-height: 420px;
}
#filterSheetPanel[data-sheet-view='all'] .suburb-tab-panel {
  overflow-x: hidden;
}
/* all: body 패딩 */
#filterSheetPanel[data-sheet-view='all'] .learnspot-filter-sheet-body {
  padding-left: 22px;
  padding-right: 22px;
  padding-top: 0 !important;
}
/* all: Suburbs 섹션만 좌우 풀블리드 */
#filterSheetPanel[data-sheet-view='all'] #filter-section-suburbs {
  margin-left: -22px;
  margin-right: -22px;
  padding-left: 0;
  padding-right: 0;
}
#filterSheetPanel[data-sheet-view='all'] #filter-section-suburbs .suburb-selected-row,
#filterSheetPanel[data-sheet-view='all'] #filter-section-suburbs .suburb-tab-layout,
#filterSheetPanel[data-sheet-view='all'] #filter-section-suburbs .filter-group-label-row {
  padding-left: 0;
  padding-right: 0;
}
#filterSheetPanel[data-sheet-view='all'] #filter-section-suburbs .suburb-tab-layout {
  border-left: none;
  border-right: none;
  border-radius: 0;
}

.suburb-tab-nav {
  position: relative;
  flex: 0 0 40%;
  max-width: 152px;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #f3f4f6;
}
.suburb-tab-nav::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 6px;
  background: linear-gradient(to left, rgba(15, 23, 42, 0.10), rgba(15, 23, 42, 0));
  pointer-events: none;
  z-index: 1;
}
.suburb-tab-btn + .suburb-tab-btn { border-top: 1px solid rgba(15, 23, 42, 0.06); }
.suburb-tab-btn {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  width: 100%;
  padding: 8px 2px 8px 2px;
  border: none;
  border-left: 3px solid transparent;
  background: transparent;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
  color: #4b5563;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  box-sizing: border-box;
}
.suburb-tab-btn:hover { background: rgba(255, 255, 255, 0.55); }
.suburb-tab-btn.is-active {
  background: #fff;
  color: #0199D9;
  font-weight: 600;
}
.suburb-tab-btn.has-selection:not(.is-active) { color: #2e2e2e; }
.suburb-tab-btn-label { flex: 1; min-width: 0; word-break: break-word; }
.suburb-tab-badge {
  position: absolute;
  right: 3px;
  top: 50%;
  transform: translateY(-50%);
  min-width: 18px;
  height: 18px;
  padding: 0 5px 0 5px;
  border-radius: 999px;
  background: #0199D9;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  display: none;
  pointer-events: none;
  z-index: 2;
}
.suburb-tab-badge.visible { display: inline-block; }
.suburb-tab-panel {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 14px 16px;
  background: #fff;
}
.suburb-tab-panel-title {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 700;
  color: #111827;
  letter-spacing: -0.02em;
}
.suburb-tab-panel-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.suburb-tab-panel-empty { margin: 0; font-size: 13px; color: #9ca3af; }
.suburb-check-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 5px;
  border: 1.5px solid #e5e7eb;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.suburb-all-box {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 1.5px solid #9ca3af;
  background: #fff;
  margin-right: 6px;
  flex-shrink: 0;
  box-sizing: border-box;
  position: relative;
}
.suburb-check-chip.is-checked .suburb-all-box {
  border-color: #0199D9;
  background: rgba(1, 153, 217, 0.12);
}
.suburb-check-chip.is-checked .suburb-all-box::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 6px;
  height: 3px;
  border-left: 2px solid #0199D9;
  border-bottom: 2px solid #0199D9;
  transform: rotate(-45deg);
}
.suburb-check-chip:hover { border-color: #9ca3af; }
.suburb-check-chip.is-checked {
  background: #e0f2fe;
  border-color: #0199D9;
  color: #0199D9;
  font-weight: 500;
}
