/* === Design tokens (새 팔레트: Panorama Blue + Sweet Aqua + Ivory) === */
:root {
  --brand: #3EBDC6;          /* Panorama Blue */
  --brand-hover: #2AA5AE;
  --brand-light: #A8EAD5;    /* Sweet Aqua */
  --brand-soft: #E8F7F4;     /* very light mint */
  --brand-ink: #0E7490;

  --accent-blue: #0096D1;    /* Blue Birds */

  --score-high: #10b981;
  --score-mid: #f59e0b;
  --score-low: #ef4444;
  --star: #fbbf24;

  --text: #111827;
  --text-muted: #6b7280;
  --text-light: #9ca3af;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --bg: #f8fafc;             /* 중성 연그레이 */
  --surface: #ffffff;
  --surface-alt: #f9fafb;
}

/* === Reset & Base === */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Pretendard', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  overflow: hidden;
  display: flex;
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; }

/* Focus / 자동완성 / 탭 하이라이트 — 연한 그레이 톤 */
*:focus { outline: none; }
*:focus-visible {
  outline: 2px solid #d1d5db;
  outline-offset: 2px;
  border-radius: 4px;
}
* { -webkit-tap-highlight-color: rgba(156,163,175,0.18); }

/* Chrome 자동완성(Autofill) 노란 배경 제거 → 연그레이 톤 유지 */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active,
textarea:-webkit-autofill,
select:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
  box-shadow: 0 0 0 1000px #ffffff inset !important;
  -webkit-text-fill-color: var(--text) !important;
  caret-color: var(--text) !important;
  transition: background-color 5000s ease-in-out 0s;
}

/* =========================================
   LEFT SIDE PANEL
   ========================================= */
.side-panel {
  width: 380px;
  min-width: 380px;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--border);
  z-index: 10;
  position: relative;
  overflow: hidden;
}

/* Resize handle */
.resize-handle {
  position: absolute;
  top: 0;
  right: 0;
  width: 6px;
  height: 100%;
  cursor: ew-resize;
  background: transparent;
  z-index: 15;
  transition: background 0.15s;
}
.resize-handle::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 1px;
  transform: translateY(-50%);
  width: 3px;
  height: 36px;
  background: var(--border-strong);
  border-radius: 3px;
  opacity: 0;
  transition: opacity 0.2s;
}
.resize-handle:hover { background: rgba(20,184,166,0.08); }
.resize-handle:hover::before { opacity: 0.6; }
.resize-handle.active {
  background: rgba(20,184,166,0.18);
}
.resize-handle.active::before { opacity: 1; background: var(--brand); }
body.resizing { cursor: ew-resize; user-select: none; }
body.resizing .resize-handle { background: rgba(20,184,166,0.18); }
body.resizing .resize-handle::before { opacity: 1; background: var(--brand); }

/* Panel view switching (list <-> detail) */
.panel-view {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}
.view-list { transform: translateX(0); }
.view-detail {
  transform: translateX(100%);
  z-index: 2;
}
.side-panel.detail-open .view-list { transform: translateX(-8%); }
.side-panel.detail-open .view-detail { transform: translateX(0); }

/* -- Panel Header -- */
.panel-header {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, var(--brand) 0%, #5eead4 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.panel-header::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 2px 2px, rgba(255,255,255,0.18) 1.5px, transparent 0);
  background-size: 22px 22px;
  opacity: 0.4;
  pointer-events: none;
}
.panel-header > * { position: relative; z-index: 1; }
.panel-header h1 {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo-emoji { font-size: 18px; }
.subtitle {
  font-size: 11.5px;
  color: rgba(255,255,255,0.95);
  margin-top: 6px;
  font-weight: 500;
}

/* =========================================
   MASCOT — 뽀글이 (청소 오리)
   ========================================= */
.mascot {
  display: inline-block;
  width: 46px;
  height: 38px;
  image-rendering: pixelated;
  filter: drop-shadow(0 3px 2px rgba(14,116,144,0.22)) drop-shadow(0 1px 0 rgba(0,0,0,0.08));
  flex-shrink: 0;
}
.mascot svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* 로고 뽀글이: 가끔씩 살랑 흔들기 */
@keyframes mascotWave {
  0%, 92%, 100% { transform: rotate(0deg); }
  94% { transform: rotate(-10deg); }
  96% { transform: rotate(10deg); }
  98% { transform: rotate(-5deg); }
}
.mascot-wave svg {
  transform-origin: 50% 80%;
  animation: mascotWave 5s ease-in-out infinite;
}

/* 빈 상태 뽀글이: 통통 */
@keyframes mascotBounce {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-8px) scale(1.04); }
}
.mascot-bounce svg {
  animation: mascotBounce 2.6s ease-in-out infinite;
}

/* 졸고있는 뽀글이 (미세한 up-down) */
@keyframes mascotSleep {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-2px) rotate(2deg); }
}
.mascot-sleep svg {
  animation: mascotSleep 3s ease-in-out infinite;
}

/* 사이즈 variants */
.mascot-lg { width: 96px; height: 80px; }
.mascot-md { width: 56px; height: 46px; }
.mascot-sm { width: 28px; height: 24px; }
.mascot-welcome { width: 64px; height: 54px; }

/* 클릭 가능한 경우 hover 인터랙션 */
.mascot.clickable { cursor: pointer; transition: transform 0.2s; }
.mascot.clickable:hover { transform: scale(1.12) rotate(-4deg); }

/* 뽀글이 주변 Zzz 표현 */
.mascot-sleep-wrap {
  position: relative;
  display: inline-block;
}
.mascot-sleep-wrap::after {
  content: 'z z Z';
  position: absolute;
  top: -8px;
  right: -14px;
  font-size: 12px;
  color: var(--text-light);
  font-weight: 800;
  letter-spacing: 3px;
  animation: zFloat 2s ease-in-out infinite;
}
@keyframes zFloat {
  0%, 100% { opacity: 0.3; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-4px); }
}

/* 말풍선 타이틀 (리뷰 모달 등) */
.modal-header-mascot {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.mascot-speak {
  width: 52px;
  height: 42px;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
}
.speech-bubble {
  position: relative;
  background: var(--brand-soft);
  border: 1.5px solid var(--brand-light);
  border-radius: 14px;
  padding: 9px 14px;
  flex: 1;
  min-width: 0;
}
.speech-bubble::before,
.speech-bubble::after {
  content: '';
  position: absolute;
  width: 0;
  height: 0;
}
.speech-bubble::before {
  left: -9px;
  top: 14px;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-right: 9px solid var(--brand-light);
}
.speech-bubble::after {
  left: -7px;
  top: 15px;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-right: 8px solid var(--brand-soft);
}
.speech-bubble h2 {
  font-size: 14px !important;
  font-weight: 800;
  color: var(--brand-ink);
  line-height: 1.3;
  padding: 2px 0;
}
.speech-bubble .speech-sub {
  display: none;
}

/* 상세 뷰 점수 블록 — 뽀덕이 + 반짝이 개수 (배경 없음) */
.detail-mascot {
  width: 50px;
  height: 42px;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.12));
  animation: mascotBounce 3s ease-in-out infinite;
}
.detail-score-block {
  align-items: center !important;
  gap: 12px !important;
  padding: 2px 0 !important;
  background: transparent !important;
}
.detail-score-block.score-high,
.detail-score-block.score-mid,
.detail-score-block.score-low {
  background: transparent !important;
}
.detail-score-block .score-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.detail-score-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.detail-score-block .score-sparkles {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 28px;
  line-height: 1;
  letter-spacing: 1px;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.08));
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}

/* 뽀덕이 + 말풍선 그룹 (우측) */
.mascot-speech-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.mascot-speech {
  position: relative;
  background: #fff;
  border: 1.5px solid var(--brand-light);
  color: var(--brand-ink);
  padding: 6px 11px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(14,116,144,0.08);
}
.mascot-speech::before,
.mascot-speech::after {
  content: '';
  position: absolute;
  right: -8px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
}
.mascot-speech::before {
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 8px solid var(--brand-light);
}
.mascot-speech::after {
  right: -6px;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 7px solid #fff;
}

/* 리뷰 섹션 — 연그레이 풀필 (스크롤 영역 끝까지) */
.review-section {
  background: #f8fafc;
  padding: 20px 20px 60px;
  margin: 24px -20px -24px;
  border: none;
  border-radius: 0;
  min-height: 320px;
}
.review-section .review-section-header {
  margin-bottom: 12px;
}
.review-section .review-item {
  border-bottom-color: #eceff3;
}
.review-section .no-reviews {
  background: #fff;
  border-color: #eceff3;
}

/* 모바일 좌우 여백 맞춤 */
@media (max-width: 480px) {
  .review-section {
    margin: 14px -18px -24px;
    padding: 16px 18px 36px;
  }
}

/* -- Panel Search -- */
.panel-search { padding: 12px 16px 0; }
.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.search-icon {
  position: absolute;
  left: 12px;
  font-size: 14px;
  pointer-events: none;
  opacity: 0.6;
}
.search-wrap input {
  width: 100%;
  padding: 10px 36px 10px 36px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 14px;
  font-family: inherit;
  background: var(--surface-alt);
  transition: border-color 0.15s, background 0.15s;
}
.search-wrap input:focus {
  outline: none;
  border-color: var(--brand);
  background: var(--surface);
}
.search-wrap input::placeholder { color: var(--text-light); }
.search-clear {
  position: absolute;
  right: 8px;
  background: var(--border);
  border: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.search-clear.hidden { display: none; }

/* -- Panel Filters -- */
.panel-filters {
  padding: 10px 16px 12px;
  border-bottom: 1px solid var(--border);
}
.filter-selects {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}
.select-wrap {
  flex: 1;
  position: relative;
}
.select-wrap select {
  width: 100%;
  padding: 8px 22px 8px 10px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: border-color 0.15s;
}
.select-wrap select:focus { outline: none; border-color: var(--brand); }
.select-wrap::after {
  content: '▾';
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 9px;
  color: var(--text-light);
  pointer-events: none;
}

.filter-chips-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.filter-chips {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  flex: 1;
}

.chip {
  padding: 5px 12px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.18s, border-color 0.18s, color 0.18s, transform 0.12s;
}
.chip:hover { border-color: var(--brand); color: var(--brand); transform: translateY(-1px); }
.chip:active { transform: translateY(0); }
.chip.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
  box-shadow: 0 2px 6px rgba(62, 189, 198, 0.3);
}
.chip.chip-hidden { display: none; }
.filter-chips.expanded .chip.chip-hidden { display: inline-block; }

.chip-more {
  padding: 5px 11px;
  border: 1.5px dashed var(--border-strong);
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 500;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.chip-more:hover { border-color: var(--brand); color: var(--brand); }
.chip-more .arrow { font-size: 9px; transition: transform 0.2s; }
.chip-more.expanded .arrow { transform: rotate(180deg); }

.chip-clear {
  padding: 5px 10px;
  border: none;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  background: #fee2e2;
  color: #dc2626;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.chip-clear:hover { background: #fecaca; }
.chip-clear.hidden { display: none; }

/* -- Result Count -- */
.panel-count {
  padding: 8px 16px;
  font-size: 12px;
  color: var(--text-light);
  font-weight: 500;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.filter-badge {
  background: var(--brand-soft);
  color: var(--brand-ink);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
}

/* -- Panel List (scrollable) -- */
.panel-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
}
.panel-list::-webkit-scrollbar { width: 4px; }
.panel-list::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 4px;
}

/* -- Panel Bottom -- */
.panel-bottom {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--surface);
}
.btn-report {
  display: block;
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--brand), #2AA5AE);
  color: #fff;
  border: none;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: -0.2px;
  transition: transform 0.12s, box-shadow 0.2s;
  box-shadow: 0 3px 10px rgba(62, 189, 198, 0.28);
}
.btn-report:hover { box-shadow: 0 6px 16px rgba(62, 189, 198, 0.4); transform: translateY(-1px); }
.btn-report:active { transform: translateY(0) scale(0.99); }

/* =========================================
   CARD
   ========================================= */
.card {
  background: var(--surface);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.2s ease, transform 0.15s ease;
  border: 1.5px solid var(--border);
}
.card:hover {
  background: var(--surface-alt);
  border-color: var(--border-strong);
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.05);
  transform: translateY(-1px);
}
.card.active {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: 0 0 0 3px rgba(62, 189, 198, 0.15), 0 4px 14px rgba(62, 189, 198, 0.12);
  transform: translateY(-1px);
}

/* "방금 등록한 카드" 펄스 강조 */
@keyframes justAddedPulse {
  0%   { box-shadow: 0 0 0 0 rgba(20,184,166,0.55), 0 0 0 0 rgba(20,184,166,0); }
  70%  { box-shadow: 0 0 0 14px rgba(20,184,166,0), 0 0 0 0 rgba(20,184,166,0); }
  100% { box-shadow: 0 0 0 0 rgba(20,184,166,0), 0 0 0 0 rgba(20,184,166,0); }
}
.card.just-added {
  animation: justAddedPulse 1.2s ease-out 2;
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}
.card-title {
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: -0.3px;
  line-height: 1.3;
}
.card-meta {
  font-size: 11.5px;
  color: var(--text-light);
  margin-top: 3px;
}

/* Minimal card score — 배경 없이 아이콘 + 숫자만 (제목 크기와 매칭) */
.card-score {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  background: transparent;
  line-height: 1;
  flex-shrink: 0;
  height: fit-content;
  white-space: nowrap;
}
.card-score .score-icon {
  font-size: 20px;
  line-height: 1;
}
.card-score .score-num {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.3px;
}
.card-score.score-high { color: #059669; }
.card-score.score-mid  { color: #d97706; }
.card-score.score-low  { color: #dc2626; }

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}
.tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: -0.1px;
}
.tag-good { background: #d1fae5; color: #047857; }
.tag-bad { background: #fee2e2; color: #b91c1c; }
.tag-neutral { background: #f3f4f6; color: var(--text-muted); }

.card-note {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
  font-style: italic;
}
.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}
.card-reviews-count {
  font-size: 10.5px;
  color: var(--brand);
  font-weight: 700;
}
.card-last-review {
  font-size: 10.5px;
  color: var(--text-light);
}

/* =========================================
   DETAIL VIEW (inline in sidebar)
   ========================================= */
.detail-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}
.btn-back {
  background: var(--surface-alt);
  border: 1.5px solid var(--border);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.12s;
}
.btn-back:hover { background: var(--brand-soft); color: var(--brand-ink); border-color: var(--brand-light); transform: translateX(-2px); }
.btn-back:active { transform: translateX(0); }

.detail-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px 24px;
}
.detail-scroll::-webkit-scrollbar { width: 4px; }
.detail-scroll::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }

.detail-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 2px;
  line-height: 1.25;
}
.detail-meta {
  font-size: 12.5px;
  color: var(--text-light);
  margin-bottom: 6px;
}
.detail-score-block {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 14px;
  margin-bottom: 14px;
}
.detail-score-block.score-high { background: #d1fae5; color: #047857; }
.detail-score-block.score-mid { background: #fef3c7; color: #b45309; }
.detail-score-block.score-low { background: #fee2e2; color: #b91c1c; }
.detail-score-block .big-score {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1;
}
.detail-score-block .stars {
  font-size: 18px;
  color: var(--star);
  letter-spacing: 1px;
}
.detail-score-block .avg-label {
  font-size: 11px;
  opacity: 0.8;
  margin-left: auto;
  font-weight: 600;
}

.detail-info {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.detail-note {
  background: var(--brand-soft);
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 14px;
  color: var(--brand-ink);
  font-style: italic;
  margin-bottom: 28px;
  line-height: 1.5;
  border-left: 4px solid var(--brand);
}
/* 한줄평 색상 — 평점 단계와 통일 */
.detail-note.score-high {
  background: #E8F7F4;
  color: #0E7490;
  border-left-color: #14b8a6;
}
.detail-note.score-mid {
  background: #FEF4E0;
  color: #92600D;
  border-left-color: #E8A33F;
}
.detail-note.score-low {
  background: #FDE8E8;
  color: #9C2626;
  border-left-color: #E05A5A;
}

.extras-block {
  background: var(--surface-alt);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 20px;
}
.extras-block .rating-row { padding: 4px 0; }

/* Review section */
.review-section {
  margin-top: 4px;
}
.review-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.review-section-header h3 { font-size: 15px; font-weight: 800; color: var(--text); }
.btn-add-review {
  padding: 7px 14px;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.btn-add-review:hover { background: var(--brand-hover); }

.review-sort {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}
.review-sort button {
  padding: 4px 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 14px;
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.review-sort button.active {
  background: var(--brand-soft);
  color: var(--brand-ink);
  border-color: var(--brand-light);
  font-weight: 700;
}

.review-item { padding: 12px 0; border-bottom: 1px solid var(--border); }
.review-item:last-child { border-bottom: none; }

/* 리뷰 아바타 (좌측) + 본문 (우측) — 채팅 스타일 */
.review-body-wrap {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.review-avatar {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  padding: 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.review-avatar svg { width: 100%; height: 100%; display: block; }
.review-main { flex: 1 1 auto; min-width: 0; }
.review-item.mine .review-avatar {
  border-color: var(--brand-light);
  background: var(--brand-soft);
}

/* 내가 작성한 리뷰 강조 */
.review-item.mine {
  background: #fff;
  border: 1px solid var(--brand-light);
  border-left: 3px solid var(--brand);
  border-radius: 10px;
  padding: 12px 14px;
  margin: 4px 0 10px;
  box-shadow: 0 2px 8px rgba(62, 189, 198, 0.1);
}
.review-item.mine + .review-item { border-top: none; }
.mine-badge {
  display: inline-block;
  background: var(--brand);
  color: #fff;
  font-size: 9.5px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  margin-left: 5px;
  vertical-align: middle;
  letter-spacing: 0.2px;
}
.review-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.review-user { font-size: 13px; font-weight: 700; color: var(--text); }
.review-date { font-size: 11px; color: var(--text-light); }
.review-stars { font-size: 12px; color: var(--star); margin-bottom: 4px; letter-spacing: 1px; }
.review-text { font-size: 13.5px; color: #374151; line-height: 1.5; margin-bottom: 8px; }
.review-actions { display: flex; gap: 8px; align-items: center; }
.review-actions .review-date { margin-left: auto; }
.review-views {
  font-size: 10.5px;
  color: var(--text-light);
  font-weight: 600;
}
.btn-helpful {
  padding: 4px 10px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.btn-helpful:hover { border-color: var(--brand); color: var(--brand); }
.btn-helpful.voted { background: var(--brand-soft); border-color: var(--brand-light); color: var(--brand-ink); font-weight: 700; }

.btn-delete-review {
  margin-left: auto;
  padding: 2px 6px;
  background: transparent;
  border: none;
  font-size: 10.5px;
  color: var(--text-light);
  cursor: pointer;
  font-family: inherit;
  transition: color 0.12s;
}
.btn-delete-review:hover {
  color: var(--score-low);
  text-decoration: underline;
}

/* Sparkle rating display (5 filled/empty) */
.sparkle {
  display: inline-block;
  opacity: 0.3;
  filter: grayscale(100%);
  margin-right: 1px;
  transition: opacity 0.12s, filter 0.12s;
}
.sparkle.filled {
  opacity: 1;
  filter: none;
}

.label-hint {
  font-size: 10.5px;
  color: var(--text-light);
  font-weight: 500;
  margin-left: 4px;
}
.no-reviews {
  text-align: center;
  padding: 28px 20px;
  background: var(--surface-alt);
  border-radius: 14px;
  border: 1.5px dashed var(--border);
}
.no-reviews-icon { font-size: 32px; margin-bottom: 8px; opacity: 0.6; }
.no-reviews-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.no-reviews-text {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 14px;
  line-height: 1.5;
}
.btn-first-review {
  padding: 10px 20px;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, transform 0.1s;
  box-shadow: 0 2px 8px rgba(20, 184, 166, 0.25);
}
.btn-first-review:hover { background: var(--brand-hover); }
.btn-first-review:active { transform: scale(0.97); }

.ghost-detail-cta {
  text-align: center;
  padding: 36px 20px;
  background: var(--brand-soft);
  border: 1.5px dashed var(--brand-light);
  border-radius: 16px;
  margin-top: 10px;
}
.ghost-detail-icon {
  font-size: 44px;
  margin-bottom: 12px;
  opacity: 0.85;
}
.ghost-detail-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--brand-ink);
  margin-bottom: 8px;
}
.ghost-detail-text {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 18px;
}

/* =========================================
   MAP AREA
   ========================================= */
.map-area {
  flex: 1;
  position: relative;
  height: 100vh;
}
#map {
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* Fallback map — Kakao 미로드 시 임시 배경 */
#map.fallback-map {
  background:
    linear-gradient(135deg, #ecfdf5 0%, #f0f9ff 50%, #eff6ff 100%);
  background-image:
    radial-gradient(circle at 2px 2px, rgba(20,184,166,0.12) 1.5px, transparent 0),
    linear-gradient(135deg, #ecfdf5 0%, #f0f9ff 50%, #eff6ff 100%);
  background-size: 28px 28px, 100% 100%;
  position: relative;
  overflow: hidden;
}
.fallback-river {
  position: absolute;
  top: 52%;
  left: -10%;
  right: -10%;
  height: 9%;
  background: linear-gradient(180deg, rgba(125,211,252,0.45), rgba(125,211,252,0.6));
  transform: rotate(-4deg);
  border-radius: 50%;
  pointer-events: none;
}
.fallback-label {
  position: absolute;
  font-size: 15px;
  font-weight: 800;
  color: rgba(6, 95, 70, 0.28);
  letter-spacing: 2px;
  pointer-events: none;
  user-select: none;
}
.fallback-notice {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(31,41,55,0.85);
  color: #fff;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  z-index: 5;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  backdrop-filter: blur(6px);
}
.fallback-markers {
  position: absolute;
  inset: 0;
  pointer-events: auto;
}
.fallback-marker {
  position: absolute !important;
  z-index: 2;
  cursor: pointer;
}

/* Custom markers — 반짝이 모양 */
.marker-icon {
  position: relative;
  width: 54px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  filter: drop-shadow(0 3px 6px rgba(0,0,0,0.22));
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), filter 0.2s;
  color: #10b981;
}
.marker-icon:hover {
  transform: scale(1.18) rotate(10deg);
  filter: drop-shadow(0 5px 10px rgba(0,0,0,0.28));
  z-index: 100;
}
.marker-icon.score-low  { color: #e05a5a; }  /* muted coral */
.marker-icon.score-mid  { color: #e8a33f; }  /* muted amber */
.marker-icon.score-high { color: #14b8a6; }  /* brand teal */

.marker-sparkle {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.marker-icon .marker-num {
  position: relative;
  z-index: 1;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.3px;
  line-height: 1;
  text-shadow: 0 1px 1.5px rgba(0,0,0,0.18);
}

.marker-icon.selected {
  transform: scale(1.3) rotate(-8deg);
  z-index: 1000 !important;
}
@keyframes sparkleRotate {
  0%, 100% { transform: scale(1.3) rotate(-8deg); }
  50% { transform: scale(1.35) rotate(-14deg); }
}
.marker-icon.selected { animation: sparkleRotate 2s ease-in-out infinite; }

/* Review count badge on marker — 반짝이 꼭지 위 민트 뱃지 */
.marker-review-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  background: var(--brand);
  color: #fff;
  border: 1.5px solid #fff;
  border-radius: 9px;
  font-size: 9.5px;
  font-weight: 800;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
  z-index: 2;
}

/* Marker name label — shown only at close zoom */
.marker-label {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255,255,255,0.97);
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 10px;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
  display: none;
  pointer-events: none;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
}
body.map-zoomed .marker-label { display: block; }
.marker-icon:hover .marker-label,
.marker-ghost:hover .marker-label { display: block; }

/* Ghost markers — unreported real places from Kakao */
.marker-ghost {
  position: relative;
  background: rgba(255,255,255,0.96);
  border: 2px dashed var(--text-light);
  color: var(--text-muted);
  border-radius: 50%;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
  opacity: 0.85;
  transition: all 0.15s;
}
.marker-ghost:hover {
  opacity: 1;
  transform: scale(1.2);
  z-index: 100;
  border-color: var(--brand);
  border-style: solid;
  color: var(--brand);
  background: var(--brand-soft);
  box-shadow: 0 3px 10px rgba(20,184,166,0.3);
}
.marker-ghost .ghost-icon { font-size: 15px; line-height: 1; }
.marker-ghost .ghost-plus {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--brand);
  color: #fff;
  border-radius: 50%;
  width: 15px;
  height: 15px;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  border: 1.5px solid #fff;
}
.ghost-label {
  border: 1.5px dashed var(--border-strong);
  color: var(--text-muted);
  background: rgba(255,255,255,0.96);
}

/* Map preview popup */
.map-popup {
  background: #fff;
  border-radius: 16px;
  padding: 18px 18px 16px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.18), 0 2px 6px rgba(0,0,0,0.06);
  min-width: 240px;
  max-width: 280px;
  font-family: 'Pretendard', sans-serif;
  position: relative;
  animation: popupFade 0.18s ease-out;
}
@keyframes popupFade {
  from { opacity: 0; transform: translateY(4px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.popup-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text-light);
  cursor: pointer;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s;
  font-family: inherit;
  line-height: 1;
}
.popup-close:hover { background: var(--surface-alt); color: var(--text-muted); }
.popup-name {
  font-size: 15.5px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
  padding-right: 24px;
  letter-spacing: -0.3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.popup-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.popup-score-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  font-weight: 700;
}
.popup-star { color: var(--star); font-size: 14px; }
.popup-score-num { color: var(--text); font-size: 14px; font-weight: 800; }
.popup-review-count {
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 600;
  margin-left: 4px;
}
.popup-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 10px;
}
.popup-note {
  font-size: 12px;
  color: #374151;
  font-style: italic;
  line-height: 1.5;
  margin-bottom: 12px;
  background: var(--surface-alt);
  padding: 9px 11px;
  border-radius: 9px;
  border-left: 3px solid var(--brand-light);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.popup-ghost-note {
  font-size: 12px;
  color: var(--brand-ink);
  text-align: center;
  margin-bottom: 12px;
  padding: 9px;
  background: var(--brand-soft);
  border-radius: 9px;
  border: 1px dashed var(--brand-light);
  font-weight: 600;
}
.popup-btn {
  display: block;
  width: 100%;
  padding: 11px;
  background: linear-gradient(135deg, var(--brand), #0891b2);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: box-shadow 0.15s, transform 0.1s;
  box-shadow: 0 2px 6px rgba(20, 184, 166, 0.25);
}
.popup-btn:hover { box-shadow: 0 4px 10px rgba(20, 184, 166, 0.35); }
.popup-btn:active { transform: scale(0.98); }

/* Empty-area popup — click any location on map */
.map-popup-empty {
  text-align: center;
  padding: 22px 20px 18px;
  min-width: 220px;
  max-width: 260px;
  border: 1.5px dashed var(--brand-light);
}
.popup-empty-icon {
  font-size: 36px;
  margin-bottom: 8px;
  opacity: 0.85;
}
.popup-empty-title {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--brand-ink);
  margin-bottom: 6px;
  padding-right: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.4;
}
.popup-empty-title strong {
  display: inline;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.popup-ghost-note strong {
  display: inline;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.popup-empty-text {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 14px;
  line-height: 1.55;
}

/* Mobile toggle (legacy) — replaced by mobile-tabs */
.mobile-toggle { display: none !important; }

/* Mobile floating search bar (지도 위 오버레이) */
.mobile-search {
  display: none;
  position: fixed;
  top: calc(12px + env(safe-area-inset-top, 0px));
  left: 12px;
  right: 12px;
  z-index: 55;
  background: #fff;
  border-radius: 999px;
  padding: 10px 14px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12), 0 1px 3px rgba(0,0,0,0.06);
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
}
.mobile-search-icon { font-size: 15px; opacity: 0.7; flex-shrink: 0; }
.mobile-search input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-size: 14px;
  font-family: inherit;
  font-weight: 500;
  color: var(--text);
  padding: 2px 0;
}
.mobile-search input::placeholder { color: var(--text-light); font-weight: 400; }
.mobile-search-clear {
  background: var(--surface-alt);
  border: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 15px;
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  line-height: 1;
}
.mobile-search-clear.hidden { display: none; }

/* Mobile bottom tab bar (iOS-style, icon-on-top) */
.mobile-tabs {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(64px + env(safe-area-inset-bottom, 0px));
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px));
  background: #fff;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
  z-index: 60;
  gap: 0;
  border-top: 1px solid var(--border);
}
.mobile-tab {
  flex: 1;
  padding: 4px 6px 2px;
  border: none;
  background: transparent;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
  transition: color 0.18s, transform 0.12s;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  line-height: 1;
  letter-spacing: -0.1px;
  position: relative;
}
.mobile-tab .tab-icon {
  font-size: 22px;
  line-height: 1;
  transition: transform 0.18s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
}
.mobile-tab .tab-icon svg { display: block; width: 22px; height: 22px; }
.mobile-tab.active { color: var(--brand-ink); font-weight: 800; }
.mobile-tab.active .tab-icon { transform: translateY(-1px); }
.mobile-tab:active .tab-icon { transform: scale(0.88); }
.mobile-tab.active::before {
  content: '';
  position: absolute;
  top: -7px;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--brand);
}

/* =========================================
   TOAST
   ========================================= */
.toast {
  position: fixed;
  bottom: -60px;
  left: 50%;
  transform: translateX(-50%);
  background: #1f2937;
  color: #fff;
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  z-index: 200;
  transition: bottom 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}
.toast.show { bottom: 32px; }

/* =========================================
   REVIEW CELEBRATION — 리뷰 완료 축하 오버레이
   ========================================= */
.review-celebration {
  position: fixed;
  inset: 0;
  background: rgba(14,116,144,0.35);
  backdrop-filter: blur(4px);
  z-index: 250;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease-out;
  cursor: pointer;
}
.review-celebration.show { opacity: 1; }

.celebration-content {
  background: #fff;
  border-radius: 24px;
  padding: 28px 28px 26px;
  text-align: center;
  max-width: 320px;
  width: 86%;
  transform: scale(0.7) rotate(-3deg);
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 20px 60px rgba(14,116,144,0.3), 0 6px 20px rgba(0,0,0,0.12);
  position: relative;
}
.review-celebration.show .celebration-content {
  transform: scale(1) rotate(0deg);
}

.celebration-sparkles-top {
  font-size: 20px;
  letter-spacing: 6px;
  margin-bottom: 4px;
  animation: sparkleFloat 1.6s ease-in-out infinite;
}

.celebration-mascot {
  width: 120px;
  height: 100px;
  margin: 0 auto 14px;
  image-rendering: pixelated;
  filter: drop-shadow(0 4px 8px rgba(14,116,144,0.25));
  animation: celebrateBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 2;
}
.celebration-mascot svg { width: 100%; height: 100%; display: block; }

@keyframes celebrateBounce {
  0%   { transform: translateY(0) scale(1) rotate(0deg); }
  30%  { transform: translateY(-14px) scale(1.08) rotate(-6deg); }
  60%  { transform: translateY(-18px) scale(1.12) rotate(6deg); }
  100% { transform: translateY(0) scale(1) rotate(0deg); }
}
@keyframes sparkleFloat {
  0%, 100% { transform: translateY(0); opacity: 0.7; }
  50%      { transform: translateY(-6px); opacity: 1; }
}

.celebration-content h3 {
  font-size: 20px;
  font-weight: 800;
  color: var(--brand-ink);
  margin-bottom: 8px;
  letter-spacing: -0.3px;
}
.celebration-content p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  font-weight: 500;
}

/* 파티클 (배경에 떠다니는 반짝이) */
.celebration-particle {
  position: absolute;
  bottom: 0;
  font-size: 22px;
  opacity: 0;
  pointer-events: none;
  animation: particleRise 1.6s ease-out forwards;
}
@keyframes particleRise {
  0%   { transform: translateY(0) rotate(0deg); opacity: 0; }
  20%  { opacity: 1; }
  100% { transform: translateY(-120vh) rotate(180deg); opacity: 0; }
}

/* =========================================
   MODALS (form / review only)
   ========================================= */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 100;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(2px);
}
/* 확인(로그아웃 등) 모달은 뒤 컨텐츠가 비쳐 보이지 않도록 더 진하게 + 블러 강화 */
#logoutConfirmOverlay {
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(8px);
  z-index: 200;
}
.modal-overlay.open { display: flex; }

.modal {
  background: #fff;
  width: 90%;
  max-width: 480px;
  max-height: 85vh;
  max-height: 85dvh;
  border-radius: 20px;
  padding: 24px 20px 40px;
  padding-bottom: calc(40px + env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  animation: fadeIn 0.2s ease-out;
}
@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.modal-header h2 { font-size: 18px; font-weight: 800; }
.modal-close {
  background: var(--surface-alt);
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Form steps */
.form-steps {
  display: flex;
  gap: 4px;
  margin-bottom: 18px;
}
.form-step-dot {
  flex: 1;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  transition: background 0.2s;
}
.form-step-dot.active { background: var(--brand); }
.form-step-dot.done { background: var(--brand-light); }

.form-step { display: none; }
.form-step.active { display: block; }

.form-step-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.form-step-hint {
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 16px;
}

.form-nav {
  display: flex;
  gap: 8px;
  margin-top: 20px;
}
.form-nav .btn-prev {
  flex: 0 0 auto;
  padding: 13px 18px;
  background: var(--surface-alt);
  color: var(--text);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}
.form-nav .btn-next,
.form-nav .btn-submit {
  flex: 1;
}

.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.form-hint { font-size: 11px; color: var(--text-light); margin-bottom: 8px; }
.req { color: var(--score-low); }
.form-row { display: flex; gap: 10px; }
.form-row .form-group { flex: 1; }
.form-divider { height: 1px; background: var(--border); margin: 8px 0 16px; }

#form input:not([type="radio"]):not([type="hidden"]),
#form select,
#reviewForm input:not([type="radio"]):not([type="hidden"]),
#reviewForm select {
  display: block; width: 100%; padding: 11px 12px;
  border: 1.5px solid var(--border); border-radius: 10px;
  font-size: 14px; font-family: inherit;
  background: #fff; transition: border-color 0.15s;
}
#form input:focus, #form select:focus,
#reviewForm input:focus { outline: none; border-color: var(--brand); }

/* Address search */
.addr-search-wrap {
  position: relative;
}
.addr-search-input {
  width: 100%;
  padding: 11px 12px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  transition: border-color 0.15s;
}
.addr-search-input:focus { outline: none; border-color: var(--brand); }
.addr-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1.5px solid var(--border);
  border-top: none;
  border-radius: 0 0 10px 10px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.addr-results.hidden { display: none; }
.addr-item {
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
.addr-item:last-child { border-bottom: none; }
.addr-item:hover { background: var(--surface-alt); }
.addr-item-name { font-size: 13px; font-weight: 600; color: var(--text); }
.addr-item-addr { font-size: 11px; color: var(--text-light); margin-top: 2px; }
.addr-selected {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--brand-soft);
  border-radius: 10px;
  font-size: 13px;
  color: var(--brand-ink);
  font-weight: 600;
  margin-top: 6px;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}
.addr-selected > span:first-child,
.addr-selected #addrSelectedText {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
  line-height: 1.5;
}
.addr-selected .addr-remove {
  flex-shrink: 0;
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
}

/* Optional extras section */
.extras-section {
  margin-top: 4px;
}
.extras-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
  transition: color 0.15s;
}
.extras-toggle:hover { color: var(--brand); }
.extras-toggle .arrow { transition: transform 0.2s; display: inline-block; }
.extras-toggle .arrow.open { transform: rotate(180deg); }
.extras-body { display: none; }
.extras-body.open { display: block; }

.rating-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
}
.rating-label { font-size: 13px; color: #374151; }
.mini-stars { display: flex; gap: 2px; }
.mini-stars .star {
  font-size: 22px;
  color: var(--border-strong);
  cursor: pointer;
  transition: color 0.1s;
}
.mini-stars .star.active { color: var(--star); }

.btn-group { display: flex; gap: 6px; flex-wrap: wrap; }
.btn-option { flex: 1; min-width: 0; }
.btn-option input { display: none; }
.btn-option span {
  display: block; text-align: center; padding: 10px 8px;
  border: 1.5px solid var(--border); border-radius: 10px;
  font-size: 13px; font-weight: 500; color: #374151;
  cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.btn-option input:checked + span {
  border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); font-weight: 700;
}

.star-input { display: flex; gap: 4px; }
.star-input .star {
  font-size: 34px; color: var(--border-strong); cursor: pointer; transition: color 0.1s, transform 0.1s;
}
.star-input .star:hover { transform: scale(1.15); }
.star-input .star.active { color: var(--star); }

.btn-submit {
  display: block; width: 100%; padding: 14px;
  background: linear-gradient(135deg, var(--brand), #0891b2);
  color: #fff; border: none; border-radius: 14px;
  font-size: 15px; font-weight: 700; cursor: pointer;
  margin-top: 8px; font-family: inherit;
  box-shadow: 0 2px 8px rgba(20, 184, 166, 0.25);
  transition: box-shadow 0.15s, transform 0.1s;
}
.btn-submit:hover { box-shadow: 0 4px 12px rgba(20, 184, 166, 0.35); }
.btn-submit:active { transform: scale(0.99); }

/* Empty state */
.empty {
  text-align: center;
  padding: 44px 20px;
  color: var(--text-light);
  font-size: 13px;
}
.empty-icon { font-size: 44px; margin-bottom: 12px; opacity: 0.5; }
.empty-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}
.empty-text {
  margin-bottom: 16px;
  line-height: 1.5;
  color: var(--text-muted);
}
.empty-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}
.empty-cta {
  display: inline-block;
  padding: 9px 18px;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.empty-cta:hover { background: var(--brand-hover); }
.empty-cta.secondary {
  background: var(--surface);
  color: var(--brand-ink);
  border: 1.5px solid var(--brand-light);
}
.empty-cta.secondary:hover { background: var(--brand-soft); }

/* Welcome empty — 첫 진입 시 아예 비어있는 상태 */
.empty-welcome {
  padding: 56px 24px 48px;
  background: var(--brand-soft);
  border: 1.5px dashed var(--brand-light);
  border-radius: 16px;
  margin: 12px 6px;
}
.empty-welcome .empty-icon {
  font-size: 56px;
  opacity: 0.85;
  margin-bottom: 14px;
}
.empty-welcome .empty-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--brand-ink);
  margin-bottom: 8px;
}
.empty-welcome .empty-text {
  font-size: 13px;
  color: #374151;
  line-height: 1.55;
  margin-bottom: 20px;
}
.empty-welcome .empty-cta {
  padding: 12px 22px;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(20, 184, 166, 0.25);
}
.empty-hint {
  font-size: 11.5px;
  color: var(--text-light);
  margin-top: 14px;
  font-weight: 500;
}

.hidden { display: none !important; }

/* =========================================
   AD SLOTS (Kakao AdFit 등 외부 광고 영역)
   ========================================= */
.ad-slot {
  display: none; /* 기본 숨김, 광고 로드되면 CSS :has로 노출 또는 inline 교체 */
  margin: 10px 12px;
  min-height: 50px;
  border-radius: 12px;
  overflow: hidden;
  text-align: center;
  background: transparent;
}
/* 광고가 실제로 삽입되면 표시 */
.ad-slot:has(ins) { display: block; }
.ad-slot:has(.ad-placeholder) { display: block; }

/* 리스트 중간에 삽입되는 Native ad 카드 */
.ad-slot.ad-card {
  margin-bottom: 8px;
}

/* 미리보기 모드 (URL에 ?ads=preview 붙였을 때) */
body.ad-preview .ad-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  background: repeating-linear-gradient(
    45deg,
    #f9fafb, #f9fafb 10px,
    #f3f4f6 10px, #f3f4f6 20px
  );
  border: 1.5px dashed var(--border-strong);
  color: var(--text-light);
  font-size: 12px;
  font-weight: 600;
}
body.ad-preview .ad-slot::before {
  content: '[광고 영역] ' attr(data-ad-slot);
}

/* 상세뷰 하단 슬롯 */
.ad-slot[data-ad-slot="detail-bottom"] {
  margin: 20px 0 0;
  min-height: 100px;
}

/* AdFit 반응형 대응 */
.ad-slot .kakao_ad_area {
  max-width: 100%;
}

/* =========================================
   Compact form modals — both 제보 & 리뷰
   ========================================= */
.modal-form { padding: 24px 18px; }
.modal-form .modal-header { margin-bottom: 12px; }
.modal-form .modal-header h2 { font-size: 16px; }
.modal-form .form-steps { margin-bottom: 12px; }
.modal-form .form-step-title { font-size: 13px; margin-bottom: 16px; }
.modal-form .form-step-hint { font-size: 11.5px; margin-bottom: 12px; }
.modal-form .form-group { margin-bottom: 10px; }
.modal-form .form-label { font-size: 12px; margin-bottom: 5px; }
.modal-form .star-input { gap: 3px; }
.modal-form .star-input .star { font-size: 26px; }
.modal-form .btn-option span { padding: 7px 6px; font-size: 12px; }
.modal-form .form-divider { margin: 4px 0 10px; }
.modal-form .extras-section { margin-top: 0; }
.modal-form .extras-toggle { padding: 4px 0; font-size: 12px; }
.modal-form .rating-row { padding: 3px 0; }
.modal-form .mini-stars .star { font-size: 20px; }
.modal-form #form input:not([type="radio"]):not([type="hidden"]),
.modal-form #form select,
.modal-form #reviewForm input:not([type="radio"]):not([type="hidden"]),
.modal-form #reviewForm select {
  padding: 9px 11px;
  font-size: 13px;
}
.modal-form .btn-submit {
  padding: 12px;
  font-size: 14px;
  margin-top: 6px;
}
/* Prev/Next/Submit 버튼 높이 완전 일치 */
.modal-form .form-nav {
  align-items: stretch;
}
.modal-form .form-nav .btn-prev,
.modal-form .form-nav .btn-next,
.modal-form .form-nav .btn-submit {
  min-height: 50px;
  padding: 0 20px;
  font-size: 14px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  margin: 0;
}
.modal-form .form-nav .btn-prev { font-weight: 600; }

/* Sparkle ratings — use opacity/grayscale since emojis are native-colored */
.star-input .star,
.mini-stars .star {
  color: initial !important;
  opacity: 0.3;
  filter: grayscale(100%);
  transition: opacity 0.12s, filter 0.12s, transform 0.12s;
}
.star-input .star.active,
.mini-stars .star.active {
  opacity: 1;
  filter: none;
}
.star-input .star:hover { transform: scale(1.12); }

/* Per-review toilet tags */
.review-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 6px 0 8px;
}
.review-tags .tag {
  font-size: 10px;
  padding: 2px 7px;
}

/* =========================================
   RESPONSIVE
   ========================================= */

/* Tablet (769px ~ 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
  .side-panel { width: 360px; min-width: 360px; }
  .resize-handle { display: none; }
}

/* Mobile (≤768px) */
@media (max-width: 768px) {
  body {
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
  }

  .side-panel {
    width: 100% !important;
    min-width: 100% !important;
    /* 상/하 24px 여유 + 상단 검색바(~56) + 탭바(64) + safe-area */
    height: calc(100dvh - 64px - env(safe-area-inset-bottom, 0px) - 24px - 56px - 24px - env(safe-area-inset-top, 0px));
    position: fixed;
    top: auto;
    bottom: calc(64px + env(safe-area-inset-bottom, 0px) + 24px);
    left: 0;
    z-index: 50;
    /* 기본 = peek 상태. 하단에서 260px만 올라와 있는 상태 */
    transform: translateY(calc(100% - 260px));
    transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1);
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
  }
  .side-panel.open { transform: translateY(0); }
  /* closed = 시트 완전 숨김 (핸들도 시트 내부에 있으므로 별도 재노출) */
  .side-panel.closed { transform: translateY(100%); }
  /* closed 상태에서도 드래그 핸들만 시트 위로 띄워 노출 — 탭바 위 24px 영역에 */
  .side-panel.closed .sheet-handle {
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(64px + env(safe-area-inset-bottom, 0px));
    top: auto;
    height: 24px;
    background: #fff;
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.08);
    z-index: 51;
  }

  /* 실제 drag handle 요소 (제스처 입력 받는 영역) */
  .sheet-handle {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    cursor: grab;
    touch-action: none;
  }
  .sheet-handle span {
    display: block;
    width: 40px;
    height: 4px;
    border-radius: 2px;
    background: #d1d5db; /* peek 상태 = 흰 카드 목록 위 → 밝은 회색 */
  }
  .side-panel.open .sheet-handle span {
    background: rgba(255,255,255,0.6); /* open 상태 = 헤더 teal 위 → 반투명 흰색 */
  }
  /* 리스트 페이지(full page)에선 handle 숨김 */
  body[data-mobile-page="list"] .sheet-handle { display: none; }
  /* 과거 ::before drag 인디케이터는 실제 요소 .sheet-handle로 대체 */
  .resize-handle { display: none; }

  .map-area {
    width: 100%;
    padding-top: 0;
    padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
    height: 100vh;
    height: 100dvh;
    box-sizing: border-box;
  }
  .mobile-tabs { display: flex; }

  /* ===== 모바일 페이지 상태 (body[data-mobile-page]) ===== */

  /* [지도 탭] = 지도만 (바텀시트 제거: 리스트는 "리스트" 탭에서 전용 페이지로 확인) */
  body[data-mobile-page="map"] .mobile-search { display: flex; }
  body[data-mobile-page="map"] .map-area { display: block; }
  body[data-mobile-page="map"] .side-panel { display: none !important; }

  /* [리스트 탭] = 정식 리스트 페이지 (PC 좌측 패널 레이아웃 그대로) */
  body[data-mobile-page="list"] .mobile-search { display: none; }
  body[data-mobile-page="list"] .map-area { display: none; }
  body[data-mobile-page="list"] .share-fab { display: none; }
  body[data-mobile-page="list"] .side-panel {
    top: 0 !important;
    bottom: calc(64px + env(safe-area-inset-bottom, 0px)) !important;
    height: auto !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    transform: none !important;
  }
  body[data-mobile-page="list"] .sheet-handle { display: none; }
  body[data-mobile-page="list"] .side-panel .panel-header { padding: 20px 18px 14px; min-height: auto; }
  body[data-mobile-page="list"] .side-panel .panel-header h1,
  body[data-mobile-page="list"] .side-panel .panel-header .subtitle { display: block; }
  body[data-mobile-page="list"] .side-panel .panel-search { display: block; }

  /* 리스트 탭: 필터 토글 버튼 */
  .panel-filter-toggle {
    display: none;
    width: 100%;
    border: none;
    border-bottom: 1px solid var(--border);
    background: #fff;
    padding: 8px 0;
    cursor: pointer;
    font-family: inherit;
    color: var(--text-muted);
    justify-content: center;
    align-items: center;
    transition: color 0.15s;
  }
  body[data-mobile-page="list"] .panel-filter-toggle { display: flex; }
  .panel-filter-toggle:hover { color: var(--brand-ink); }
  .panel-filter-toggle svg { transition: transform 0.28s ease; }
  /* 펼쳐진 상태(=scroll-hidden 없음)면 화살표 뒤집힘 */
  body[data-mobile-page="list"] .side-panel:not(.scroll-hidden) .panel-filter-toggle svg {
    transform: rotate(180deg);
  }

  /* 리스트 탭: scroll-hidden 상태 = 헤더/검색/필터 접힘 */
  body[data-mobile-page="list"] .side-panel .panel-header,
  body[data-mobile-page="list"] .side-panel .panel-search,
  body[data-mobile-page="list"] .side-panel .panel-filters {
    max-height: 400px;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease, opacity 0.22s ease, border-width 0.2s ease;
  }
  body[data-mobile-page="list"] .side-panel.scroll-hidden .panel-header,
  body[data-mobile-page="list"] .side-panel.scroll-hidden .panel-search,
  body[data-mobile-page="list"] .side-panel.scroll-hidden .panel-filters {
    max-height: 0;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    opacity: 0;
    border-bottom-width: 0;
  }

  /* [기록 탭] = 프로필을 full-page로 (하단 탭바 영역 제외하고 덮기) */
  body[data-mobile-page="profile"] .mobile-search,
  body[data-mobile-page="profile"] .map-area,
  body[data-mobile-page="profile"] .side-panel,
  body[data-mobile-page="profile"] .share-fab { display: none !important; }
  #profileOverlay.as-page {
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    padding: 0;
    top: 0;
    left: 0;
    right: 0;
    bottom: calc(64px + env(safe-area-inset-bottom, 0px)); /* 하단 탭바 가리지 않음 */
    background: var(--surface);
    backdrop-filter: none;
    z-index: 55; /* mobile-tabs(z:60)보다 아래 */
  }
  #profileOverlay.as-page .modal {
    width: 100%;
    max-width: 100%;
    max-height: 100%;
    height: 100%;
    margin: 0;
    border-radius: 0;
    padding: 22px 18px 24px;
    overflow-y: auto;
  }

  /* ===== 공유 FAB (지도 페이지 우하단) ===== */
  .share-fab {
    display: none;
    position: fixed;
    right: 14px;
    bottom: calc(80px + env(safe-area-inset-bottom, 0px));
    z-index: 55;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--brand), #0891b2);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(20, 184, 166, 0.35), 0 1px 4px rgba(0,0,0,0.08);
    transition: transform 0.15s, box-shadow 0.2s;
    font-family: inherit;
    align-items: center;
    justify-content: center;
  }
  body[data-mobile-page="map"] .share-fab { display: inline-flex; }
  .share-fab:hover { box-shadow: 0 6px 18px rgba(20, 184, 166, 0.45); }
  .share-fab:active { transform: scale(0.92); }

  /* ===== 내 위치 FAB (지도 탭 우하단, 공유 FAB 위 10px 간격) ===== */
  .locate-fab {
    display: none;
    position: fixed;
    right: 14px;
    bottom: calc(138px + env(safe-area-inset-bottom, 0px));
    z-index: 55;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.06);
    background: #fff;
    color: #1f2937;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(0,0,0,0.14), 0 1px 3px rgba(0,0,0,0.06);
    transition: transform 0.15s, box-shadow 0.2s, color 0.18s;
    align-items: center;
    justify-content: center;
    font-family: inherit;
  }
  body[data-mobile-page="map"] .locate-fab { display: inline-flex; }
  .locate-fab:hover { box-shadow: 0 5px 14px rgba(0,0,0,0.18); color: var(--brand); }
  .locate-fab:active { transform: scale(0.92); }
  .locate-fab.active { color: var(--brand); }
  .locate-fab.loading svg { animation: locateSpin 1s linear infinite; }
  @keyframes locateSpin { to { transform: rotate(360deg); } }

  /* ===== 모바일 panel-header 기본 스타일 (리스트 탭/peek 공용) ===== */
  .side-panel .panel-header h1,
  .side-panel .panel-header .subtitle { display: none; }
  .side-panel .panel-header {
    padding: 22px 14px 10px;
    min-height: 52px;
  }
  .side-panel .panel-header .header-actions {
    position: absolute;
    top: 20px;
    right: 14px;
    margin-top: 0;
  }

  /* Header — 바텀시트 drag 핸들(8px) 고려하여 상단 여유 */
  .panel-header { padding: 22px 18px 14px; }
  .panel-header h1 { font-size: 19px; }
  .subtitle { font-size: 11.5px; }

  /* Filters — horizontal scroll on mobile */
  .filter-selects { gap: 5px; }
  .select-wrap select { font-size: 11.5px; padding: 9px 20px 9px 9px; }
  .filter-chips-row { gap: 5px; }
  .chip {
    padding: 7px 12px;
    font-size: 12px;
    min-height: 30px;
  }

  /* Touch-friendly cards */
  .card { padding: 14px; }
  .card-title { font-size: 15px; }

  /* Detail view (바텀시트 drag 핸들 고려) */
  .detail-header { padding: 20px 16px 14px; }
  .side-panel.detail-open .sheet-handle span { background: var(--border-strong); } /* 상세뷰 흰 배경용 진한 회색 */
  .detail-scroll { padding: 16px 18px 24px; }
  .detail-title { font-size: 19px; }
  .detail-score-block { padding: 12px 14px; }
  .detail-score-block .big-score { font-size: 34px; }

  /* Marker / ghost — larger touch targets */
  .marker-icon { width: 44px; height: 44px; }
  .marker-ghost { width: 38px; height: 38px; }
  .marker-icon .marker-num { font-size: 14px; }

  /* Map preview popup — fit within screen */
  .map-popup {
    min-width: 200px;
    max-width: calc(100vw - 60px);
    padding: 14px 14px 12px;
  }
  .map-popup-empty { max-width: calc(100vw - 80px); }

  /* Modal bottom sheet — 하단에 마진 고정 */
  .modal {
    width: calc(100% - 16px);
    max-width: calc(100% - 16px);
    border-radius: 20px;
    max-height: 82vh;
    max-height: 82dvh;
    margin-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    padding-bottom: 32px;
  }
  .modal-overlay { align-items: flex-end; }
  /* 확인 모달은 모바일에서도 중앙 유지 (작아서 바텀시트 어색함) */
  #logoutConfirmOverlay,
  #gachaResultOverlay,
  #reviewDeleteOverlay { align-items: center; }
  #logoutConfirmOverlay .modal,
  #gachaResultOverlay .modal,
  #reviewDeleteOverlay .modal { border-radius: 20px; max-width: 320px; width: 90%; margin-bottom: 0; }
  .modal-form { padding: 18px 16px 20px; }

  /* Form on mobile */
  .form-row { flex-direction: column; gap: 0; }
  .form-row .form-group { margin-bottom: 10px; }
  .btn-option span { padding: 10px 6px; font-size: 12.5px; }
  .star-input .star { font-size: 30px; }

  /* Toast */
  .toast {
    bottom: -80px;
    padding: 11px 18px;
    font-size: 13px;
    max-width: calc(100vw - 32px);
    white-space: normal;
    text-align: center;
  }
  .toast.show { bottom: 90px; }
}

/* Small phones (≤480px) */
@media (max-width: 480px) {
  .panel-header { padding: 14px 16px 12px; }
  .panel-header h1 { font-size: 18px; }
  .subtitle { font-size: 11px; line-height: 1.4; }

  .panel-search { padding: 10px 14px 0; }
  .panel-filters { padding: 10px 14px 12px; }
  .panel-list { padding: 8px 10px; }
  .panel-bottom { padding: 10px 14px; }

  .card { padding: 12px; border-radius: 12px; }
  .card-title { font-size: 14.5px; }
  .card-meta { font-size: 11px; }
  .card-score { min-width: 46px; }
  .card-score .score-num { font-size: 18px; }
  .tag { font-size: 10px; padding: 2px 6px; }

  .btn-report { padding: 12px; font-size: 13.5px; }

  .map-popup {
    min-width: 180px;
    max-width: calc(100vw - 40px);
    padding: 12px 12px 10px;
  }
  .popup-name { font-size: 14.5px; }
  .popup-btn { padding: 10px; font-size: 12.5px; }

  .modal-form { padding: 16px 14px 18px; }
  .modal-form .modal-header h2 { font-size: 15px; }
  .modal-form .form-step-title { font-size: 12.5px; }
  .modal-form .form-step-hint { font-size: 11px; margin-bottom: 10px; }

  .detail-title { font-size: 18px; }
  .detail-score-block .big-score { font-size: 30px; }
  .review-text { font-size: 13px; }
}

/* Very small (≤360px) */
@media (max-width: 360px) {
  .filter-selects { flex-wrap: wrap; }
  .select-wrap { flex: 1 1 calc(50% - 3px); }
  .btn-option { flex: 1 1 calc(50% - 3px); }
  .panel-header h1 { font-size: 17px; }
}

/* Landscape mobile — save vertical space */
@media (max-width: 900px) and (max-height: 500px) and (orientation: landscape) {
  .panel-header { padding: 10px 16px 8px; }
  .subtitle { display: none; }
  .panel-search { padding: 8px 14px 0; }
  .panel-filters { padding: 8px 14px; }
  .modal { max-height: 96vh; max-height: 96dvh; }
  .modal-form .form-step-title { margin-bottom: 2px; }
  .modal-form .form-step-hint { margin-bottom: 8px; }
}

/* Prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* =========================================================================
   MOBILE OVERFLOW SAFETY — 한글 긴 문장/이름 좌우 삐져나감 방지
   ========================================================================= */
@media (max-width: 768px) {
  /* 컨테이너 안전 너비 */
  .side-panel, .map-area, .modal, .panel-view,
  .panel-header, .panel-search, .panel-filters,
  .panel-count, .panel-list, .panel-bottom,
  .detail-header, .detail-scroll {
    max-width: 100%;
    box-sizing: border-box;
  }
  /* 텍스트 줄바꿈 허용 */
  .card, .card-title, .card-meta, .card-note,
  .review-item, .review-text, .review-user,
  .review-tags,
  .detail-title, .detail-meta, .detail-note,
  .ghost-detail-title, .ghost-detail-text,
  .popup-name, .popup-note, .popup-ghost-note, .popup-meta,
  .popup-empty-title, .popup-empty-text,
  .mission-name, .mission-desc,
  .empty-title, .empty-text,
  .no-reviews-title, .no-reviews-text,
  .sticker-detail-name, .sticker-detail-story, .sticker-detail-condition,
  .speech-bubble h2, .mascot-speech,
  .profile-title, .nickname-text,
  .signup-lead, .onboarding-sub, .confirm-sub,
  .share-card-title, .share-card-cta, .share-hint {
    overflow-wrap: anywhere;
    word-break: break-word;
    min-width: 0;
  }
  /* 말풍선 등 nowrap 해제 */
  .mascot-speech {
    white-space: normal;
    max-width: 140px;
  }
  /* flex children 안전 — 긴 텍스트가 컨테이너 넘지 않도록 */
  .card > div,
  .card-top,
  .card-top > div,
  .review-header,
  .detail-score-block > *,
  .mascot-speech-group > * {
    min-width: 0;
  }
  /* 폼/입력 요소도 안전 */
  input, select, textarea, button { max-width: 100%; }
  .addr-selected { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
}

/* =========================================================================
   USER PROFILE · ONBOARDING · STICKER COLLECTION
   ========================================================================= */

/* Profile button — 헤더 우상단 */
.profile-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(255,255,255,0.22);
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  backdrop-filter: blur(6px);
  transition: background 0.18s ease, transform 0.15s ease;
  z-index: 2;
}
.profile-btn:hover { background: rgba(255,255,255,0.32); transform: translateY(-1px); }
.profile-btn:active { transform: translateY(0); }
.profile-name { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-left: 4px; }
.profile-sticker-count {
  background: #fff;
  color: var(--brand-ink);
  font-size: 10px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 10px;
  margin-left: 2px;
}
.profile-streak-badge { display: none !important; } /* deprecated */

/* 헤더 액션 그룹 (메인 사이드바 우상단) */
.header-actions {
  position: absolute;
  top: 14px;
  right: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 2;
}
.header-actions .profile-btn {
  position: static;
}
.header-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.22);
  border: 1px solid rgba(255,255,255,0.4);
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  transition: background 0.18s, transform 0.12s;
}
.header-icon-btn:hover { background: rgba(255,255,255,0.35); transform: translateY(-1px); }
.header-icon-btn:active { transform: translateY(0); }
.header-icon-btn svg { display: block; }

/* Onboarding modal */
.modal-onboarding {
  text-align: center;
  padding: 32px 28px;
  max-width: 340px;
}
.onboarding-mascot {
  width: 80px;
  height: 68px;
  margin: 0 auto 14px;
  image-rendering: pixelated;
  filter: drop-shadow(0 3px 6px rgba(14,116,144,0.2));
  animation: mascotBounce 2.6s ease-in-out infinite;
}
.onboarding-mascot svg { width: 100%; height: 100%; }
.onboarding-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--brand-ink);
  margin-bottom: 4px;
}
.onboarding-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
}
#onboardingForm input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 14px;
  margin-bottom: 10px;
  text-align: center;
  font-family: inherit;
  background: var(--surface-alt);
}
#onboardingForm input:focus {
  outline: none;
  border-color: var(--brand);
  background: #fff;
}
.btn-skip {
  width: 100%;
  margin-top: 8px;
  padding: 10px;
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 12.5px;
  cursor: pointer;
  font-family: inherit;
  text-decoration: underline;
}

/* Profile / Sticker book modal */
.modal-profile {
  max-width: 400px;
  padding: 22px 20px 40px;
  padding-bottom: calc(40px + env(safe-area-inset-bottom, 0px));
}

/* 프로필 헤더 — 동적 타이틀 + 액션 아이콘 (정렬 통일) */
.modal-header-profile {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 0;
}
.profile-title {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 16px !important;
  font-weight: 800;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: -0.3px;
  line-height: 1.3;
  margin: 0;
}
.profile-header-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}
.profile-icon-btn,
.modal-header-profile .modal-close {
  background: transparent;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background 0.15s, color 0.15s, transform 0.12s;
  padding: 0;
}
.profile-icon-btn:hover,
.modal-header-profile .modal-close:hover {
  background: var(--brand-soft);
  color: var(--brand-ink);
}
.profile-icon-btn:active,
.modal-header-profile .modal-close:active { transform: scale(0.94); }
.modal-header-profile .modal-close { font-size: 18px; font-weight: 400; }

/* 작은 모달 (닉네임 편집 등) */
.modal-small {
  max-width: 320px;
  padding: 22px 22px 20px;
}
.modal-small #nicknameEditForm input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  background: var(--surface-alt);
  margin-bottom: 10px;
}
.modal-small #nicknameEditForm input:focus {
  outline: none;
  border-color: var(--brand);
  background: #fff;
}
.modal-small .btn-submit {
  width: 100%;
  padding: 12px;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}
.modal-small .btn-submit:hover { background: var(--brand-hover); }

/* 확인 모달 (로그아웃 등) */
.modal-confirm {
  text-align: center;
  max-width: 320px;
  padding: 28px 24px 22px;
}
.confirm-icon {
  font-size: 34px;
  margin-bottom: 8px;
}
.confirm-mascot {
  width: 72px;
  height: 72px;
  margin: 0 auto 10px;
  display: block;
}
.confirm-mascot svg { width: 100%; height: 100%; display: block; }
.confirm-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
}
.confirm-sub {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 18px;
}
.confirm-actions {
  display: flex;
  gap: 8px;
}
.btn-cancel, .btn-danger {
  flex: 1;
  padding: 11px;
  border: none;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}
.btn-cancel {
  background: var(--surface-alt);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-cancel:hover { background: var(--border); }
.btn-danger {
  background: #dc2626;
  color: #fff;
}
.btn-danger:hover { background: #b91c1c; }

/* 온보딩 "이미 계정 있어요" 링크 */
.btn-link {
  width: 100%;
  margin-top: 10px;
  padding: 8px;
  background: none;
  border: none;
  color: var(--brand-ink);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  text-decoration: underline;
}
.btn-link:hover { color: var(--brand); }
.profile-stats {
  display: flex;
  justify-content: space-around;
  align-items: stretch;
  padding: 14px 0;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--brand-soft), rgba(62, 189, 198, 0.06));
  border-radius: 14px;
  border: 1px solid rgba(62, 189, 198, 0.15);
}
.profile-stat {
  position: relative;
  flex: 1 1 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  padding: 0 8px;
}
.profile-stat + .profile-stat::before {
  content: '';
  position: absolute;
  left: 0;
  top: 18%;
  bottom: 18%;
  width: 1px;
  background: rgba(62, 189, 198, 0.22);
}
.profile-stat-num {
  font-size: 20px;
  font-weight: 800;
  color: var(--brand-ink);
  line-height: 1;
  letter-spacing: -0.5px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
}
.profile-stat-label {
  font-size: 10.5px;
  color: var(--text-muted);
  font-weight: 500;
  line-height: 1;
}

/* 스티커 그리드 위 다음 목표 라벨 */
.sticker-grid-label {
  font-size: 11.5px;
  color: var(--text-muted);
  padding: 8px 4px 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.sticker-grid-label strong { color: var(--brand-ink); font-weight: 800; }
.sticker-grid-label .mini-bar {
  flex: 1;
  max-width: 80px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  display: inline-block;
}
.sticker-grid-label .mini-fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--brand), #0891b2);
  border-radius: 2px;
  transition: width 0.3s;
}

/* Profile stat — streak 강조 */
.profile-stat.streak-stat .profile-stat-num { color: #ea580c; }

/* 주간 미션 카드 (슬림) */
.mission-card {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 11px 13px;
  margin-bottom: 6px;
}
.mission-card.completed {
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  border-color: #6ee7b7;
}
.mission-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.mission-label { font-size: 11px; font-weight: 700; color: var(--brand-ink); letter-spacing: 0.5px; }
.mission-days-left { font-size: 10.5px; font-weight: 700; color: #ea580c; }
.mission-name { font-size: 14px; font-weight: 800; color: var(--text); margin-bottom: 2px; }
.mission-desc { font-size: 11.5px; color: var(--text-muted); margin-bottom: 10px; }
.mission-progress-bar {
  background: var(--surface-alt);
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 4px;
}
.mission-fill {
  background: linear-gradient(90deg, var(--brand), #0891b2);
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease-out;
}
.mission-card.completed .mission-fill { background: linear-gradient(90deg, #10b981, #059669); }
.mission-progress-text { font-size: 10.5px; color: var(--text-muted); font-weight: 700; text-align: right; }

/* 다음 스티커 카드 */
.next-sticker-card {
  background: var(--brand-soft);
  border: 1px dashed var(--brand-light);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 14px;
}
.next-sticker-label { font-size: 11px; font-weight: 700; color: var(--brand-ink); margin-bottom: 8px; letter-spacing: 0.3px; }
.next-sticker-row { display: flex; align-items: center; gap: 12px; }
.next-sticker-thumb {
  width: 44px;
  height: 40px;
  flex-shrink: 0;
  filter: grayscale(70%) opacity(0.7);
  image-rendering: pixelated;
}
.next-sticker-thumb svg { width: 100%; height: 100%; }
.next-sticker-info { flex: 1; min-width: 0; }
.next-sticker-name { font-size: 13px; font-weight: 800; color: var(--text); margin-bottom: 4px; }
.next-progress-bar {
  background: #fff;
  height: 5px;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 3px;
}
.next-fill {
  background: linear-gradient(90deg, var(--brand), #0891b2);
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease-out;
}
.next-progress-text { font-size: 10.5px; color: var(--text-muted); font-weight: 600; }

/* Sync banner — 하단, 심플 */
.profile-sync-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  margin-top: 14px;
}
.profile-sync-banner .sync-title { font-size: 12px; }
.profile-sync-banner .sync-sub { font-size: 10.5px; }
.profile-sync-banner.hidden { display: none; }
.profile-sync-banner .sync-copy { flex: 1; min-width: 0; }
.profile-sync-banner .sync-title { font-size: 13px; font-weight: 800; color: var(--brand-ink); margin-bottom: 2px; }
.profile-sync-banner .sync-sub { font-size: 11px; color: #475569; line-height: 1.5; }
.btn-sync {
  padding: 9px 14px;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  box-shadow: 0 2px 6px rgba(20,184,166,0.3);
}
.btn-sync:hover { background: var(--brand-hover); }
.profile-sync-banner.connected {
  background: var(--brand-soft);
  border-color: var(--brand-light);
}
.profile-sync-banner.connected .sync-title::before { content: '✓ '; color: var(--brand); }

/* Signup modal */
.modal-signup { max-width: 340px; text-align: center; padding: 28px 26px; }
.signup-lead { font-size: 13px; color: var(--text-muted); line-height: 1.6; margin-bottom: 18px; }
.signup-lead strong { color: var(--brand-ink); font-weight: 800; }

/* 데모 안내 배너 */
.demo-notice {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #78350f;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 11.5px;
  font-weight: 600;
  text-align: center;
  margin: 0 0 16px;
  border: 1px solid rgba(217, 119, 6, 0.2);
  line-height: 1.4;
}

/* 이메일 폼 인라인 에러 메시지 */
.signup-form-error {
  font-size: 12.5px;
  color: #dc2626;
  font-weight: 600;
  margin: -4px 0 10px;
  min-height: 16px;
  text-align: center;
  transition: opacity 0.18s;
}
.signup-form-error:empty { min-height: 0; margin: 0; }

/* 프로필 모달 푸터: 문의 버튼 */
.profile-footer {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
  display: flex;
  justify-content: center;
}
.btn-inquiry {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  border-radius: 8px;
  transition: color 0.15s, background 0.15s;
}
.btn-inquiry:hover { color: var(--brand-ink); background: var(--brand-soft); }
.btn-inquiry svg { opacity: 0.8; }

/* 문의 모달 */
.modal-inquiry { max-width: 440px; }
.modal-inquiry textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  background: var(--surface-alt);
  min-height: 110px;
  line-height: 1.5;
  box-sizing: border-box;
}
.modal-inquiry textarea:focus {
  outline: none;
  border-color: var(--brand);
  background: #fff;
}
.modal-inquiry input[type="text"],
.modal-inquiry input[type="email"],
.modal-inquiry input:not([type]) {
  width: 100%;
  padding: 11px 12px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  background: var(--surface-alt);
  box-sizing: border-box;
}
.modal-inquiry input:focus { outline: none; border-color: var(--brand); background: #fff; }

.inquiry-history {
  margin-top: 18px;
}
.inquiry-history:empty { display: none; }
.inquiry-history-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-muted);
  margin-bottom: 8px;
  letter-spacing: -0.2px;
}
.inquiry-item {
  padding: 10px 12px;
  background: var(--surface-alt);
  border-radius: 10px;
  margin-bottom: 6px;
  border-left: 3px solid var(--brand-light);
}
.inquiry-item-subject {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}
.inquiry-item-date {
  font-size: 10.5px;
  color: var(--text-light);
}

/* 이용약관 · 개인정보 미니 버튼 (가입 폼 체크 옆) */
.terms-group { margin-top: 4px; }
.terms-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  color: var(--text);
  line-height: 1.5;
  cursor: pointer;
}
.terms-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 2px;
  accent-color: var(--brand);
  cursor: pointer;
}
.terms-link {
  background: transparent;
  border: none;
  padding: 0;
  color: var(--brand-ink);
  text-decoration: underline;
  font-size: inherit;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}
.terms-link:hover { color: var(--brand); }

/* 약관/개인정보 정책 모달 */
.modal-policy { max-width: 460px; }
.policy-body {
  max-height: 60vh;
  overflow-y: auto;
  font-size: 13px;
  color: var(--text);
  line-height: 1.6;
  padding-right: 4px;
}
.policy-body h4 {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--brand-ink);
  margin: 14px 0 4px;
}
.policy-body h4:first-child { margin-top: 0; }
.policy-body p { margin: 0 0 6px; color: var(--text-muted); }
.policy-footer {
  margin-top: 16px !important;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  font-size: 11.5px;
  color: var(--text-light);
  font-style: italic;
}
.policy-list {
  padding-left: 18px;
  margin: 0 0 8px;
  color: var(--text-muted);
}
.policy-list li {
  margin-bottom: 4px;
  line-height: 1.6;
}
.policy-list li strong { color: var(--brand-ink); font-weight: 700; }
.policy-note {
  background: var(--surface-alt);
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12px !important;
  color: var(--text-muted) !important;
  line-height: 1.6;
  word-break: break-word;
}
.policy-note a { color: var(--brand-ink); text-decoration: underline; }

/* 문의 모달: 탭 + FAQ + 답변 상태 */
.inquiry-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--surface-alt);
  border-radius: 10px;
  margin-bottom: 14px;
}
.inquiry-tab {
  flex: 1;
  padding: 8px 6px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.inquiry-tab.active {
  background: #fff;
  color: var(--brand-ink);
  font-weight: 800;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.inquiry-panel { display: none; }
.inquiry-panel.active { display: block; }

/* FAQ accordion */
.faq-list { display: flex; flex-direction: column; gap: 8px; }
.faq-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}
.faq-item[open] { border-color: var(--brand-light); background: var(--brand-soft); }
.faq-q {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  padding: 11px 14px;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.4;
  letter-spacing: -0.2px;
}
.faq-q::-webkit-details-marker { display: none; }
.faq-q::after {
  content: '▾';
  margin-left: auto;
  color: var(--text-muted);
  transition: transform 0.18s;
  font-size: 11px;
}
.faq-item[open] .faq-q::after { transform: rotate(180deg); }
.faq-q-mark {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}
.faq-a {
  padding: 2px 14px 14px 40px;
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.65;
  display: flex;
  gap: 8px;
}
.faq-a-mark {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fde68a;
  color: #92400e;
  font-size: 10px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: -30px;
  margin-top: 1px;
}

/* 문의 항목 답변 상태 */
.inquiry-item-head {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
  margin-bottom: 2px;
}
.inquiry-status {
  flex-shrink: 0;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.inquiry-status.pending {
  background: #fef3c7;
  color: #92400e;
}
.inquiry-status.done {
  background: #d1fae5;
  color: #065f46;
}
.inquiry-item-body {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: 6px;
  word-break: break-word;
}
.inquiry-item.answered {
  border-left-color: #10b981;
}
.inquiry-answer {
  margin-top: 10px;
  padding: 10px 12px;
  background: #ecfdf5;
  border-radius: 8px;
  border: 1px solid rgba(16, 185, 129, 0.2);
}
.inquiry-answer-label {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 800;
  color: #065f46;
  background: #a7f3d0;
  padding: 2px 8px;
  border-radius: 999px;
  margin-bottom: 6px;
}
.inquiry-answer-body {
  font-size: 12.5px;
  color: var(--text);
  line-height: 1.6;
  word-break: break-word;
}
.inquiry-empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-muted);
  font-size: 13px;
  background: var(--surface-alt);
  border-radius: 10px;
  line-height: 1.6;
}
.signup-options {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-bottom: 14px;
}
.signup-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  background: #fff;
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
}
.signup-btn:hover { border-color: var(--brand); background: var(--brand-soft); }
.signup-btn em { font-style: normal; color: var(--text-light); font-weight: 500; font-size: 11px; margin-left: 4px; }
.signup-btn .signup-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
}
.signup-kakao { border-color: #fae100; }
.signup-kakao .signup-icon { background: #fae100; color: #3c1e1e; }
.signup-google .signup-icon { background: #fff; border: 1px solid #e5e7eb; }
.signup-email .signup-icon {
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-family: Arial, sans-serif;
  font-size: 17px;
  font-weight: 800;
}
.signup-skip-hint { font-size: 10.5px; color: var(--text-light); line-height: 1.5; }

/* 이메일 가입 폼 (유일한 패널, 항상 표시) */
.signup-panel-email { display: block; }
.signup-back {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 0 12px;
  font-family: inherit;
  display: block;
  margin-right: auto;
}
.signup-back:hover { color: var(--brand-ink); }
.signup-panel-email .form-group {
  margin-bottom: 12px;
  text-align: left;
}
.signup-panel-email .form-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text);
  display: block;
  margin-bottom: 5px;
}
.signup-panel-email input[type="email"],
.signup-panel-email input[type="password"] {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 13px;
  font-family: inherit;
  background: var(--surface-alt);
}
.signup-panel-email input:focus {
  outline: none;
  border-color: var(--brand);
  background: #fff;
}
.email-check-row {
  display: flex;
  gap: 6px;
}
.email-check-row input { flex: 1; }
.btn-check {
  padding: 0 12px;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}
.btn-check:hover { background: var(--brand-hover); }
.email-check-result, .pw-match-result {
  font-size: 10.5px;
  margin-top: 4px;
  font-weight: 600;
  min-height: 14px;
  text-align: left;
}
.email-check-result.success, .pw-match-result.success { color: #059669; }
.email-check-result.error, .pw-match-result.error { color: #dc2626; }
.signup-panel-email .btn-submit {
  width: 100%;
  padding: 12px;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  margin-top: 6px;
  transition: opacity 0.15s, background 0.15s;
}
.signup-panel-email .btn-submit:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.signup-panel-email .btn-submit:not(:disabled):hover { background: var(--brand-hover); }

.signup-switch-row {
  text-align: center;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  margin-top: 16px;
}
.signup-switch-row .btn-link {
  display: inline-block;
  width: auto;
  padding: 6px 4px;
  margin-top: 0;
  font-size: 13px;
}

/* Sticker grid */
.sticker-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.sticker-item {
  aspect-ratio: 1;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 6px 6px;
  position: relative;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.22s ease;
}
.sticker-item:hover {
  transform: translateY(-3px);
  border-color: var(--brand-light);
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
}
.sticker-item:active { transform: translateY(-1px); }
.sticker-item .sticker-svg {
  width: 70%;
  height: 60%;
  image-rendering: pixelated;
}
.sticker-item .sticker-svg svg { width: 100%; height: 100%; }
.sticker-item .sticker-name {
  font-size: 9.5px;
  font-weight: 700;
  color: var(--text);
  margin-top: 3px;
  text-align: center;
  line-height: 1.2;
}
.sticker-item.locked {
  background: #f3f4f6;
  border-style: dashed;
}
.sticker-item.locked .sticker-svg {
  opacity: 0.75;
}
.sticker-item.locked .sticker-name {
  color: var(--text-light);
}
.sticker-item.locked::before {
  content: '🔒';
  position: absolute;
  top: 4px;
  right: 5px;
  font-size: 11px;
}
.sticker-item.tier-2 { background: linear-gradient(135deg, #fff, #f0fdfa); border-color: var(--brand-light); }
.sticker-item.tier-3 { background: linear-gradient(135deg, #fff, #fef3c7); border-color: #fbbf24; }
.sticker-item.tier-4 { background: linear-gradient(135deg, #fff, #fce7f3); border-color: #ec4899; }
.sticker-item.tier-4::after {
  content: 'HIDDEN';
  position: absolute;
  top: 4px;
  right: 5px;
  font-size: 8px;
  font-weight: 800;
  color: #ec4899;
  letter-spacing: 0.5px;
}
.sticker-item.tier-4.locked::after { display: none; }
.sticker-item.just-unlocked {
  animation: stickerShine 1.2s ease-out;
}
@keyframes stickerShine {
  0%, 100% { box-shadow: 0 0 0 0 rgba(20,184,166,0); }
  50% { box-shadow: 0 0 0 6px rgba(20,184,166,0.4); transform: scale(1.08); }
}

/* Sticker share modal */
.modal-share {
  max-width: 360px;
  padding: 22px 22px 20px;
}
.share-preview-card {
  background: linear-gradient(135deg, #E8F7F4 0%, #A8EAD5 100%);
  border-radius: 18px;
  padding: 20px 18px;
  margin-bottom: 18px;
  position: relative;
  overflow: hidden;
}
.share-preview-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 2px 2px, rgba(255,255,255,0.25) 1.5px, transparent 0);
  background-size: 16px 16px;
  opacity: 0.6;
  pointer-events: none;
}
.share-card-inner {
  position: relative;
  text-align: center;
  z-index: 1;
}
.share-card-mascot {
  width: 72px;
  height: 72px;
  margin: 0 auto 10px;
  background: #fff;
  border-radius: 50%;
  padding: 6px;
  border: 2px solid var(--brand);
  box-shadow: 0 3px 10px rgba(20,184,166,0.25);
}
.share-card-mascot svg { width: 100%; height: 100%; display: block; }
.share-card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--brand-ink);
  margin-bottom: 4px;
  letter-spacing: -0.2px;
}
.share-card-count {
  font-size: 28px;
  font-weight: 800;
  color: var(--brand-ink);
  margin-bottom: 10px;
  letter-spacing: -1px;
}
.share-card-stickers {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 10px;
  min-height: 50px;
  align-items: center;
}
.share-mini-sticker {
  width: 48px;
  height: 42px;
  image-rendering: pixelated;
  filter: drop-shadow(0 2px 3px rgba(14,116,144,0.2));
}
.share-mini-sticker svg { width: 100%; height: 100%; }
.share-empty {
  font-size: 12px;
  color: var(--brand-ink);
  opacity: 0.6;
}
.share-card-cta {
  font-size: 11px;
  font-weight: 700;
  color: var(--brand-ink);
  opacity: 0.8;
}

.share-methods {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.share-method {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 6px;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  transition: border-color 0.15s, transform 0.12s, background 0.15s;
}
.share-method:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
  transform: translateY(-2px);
}
.share-method:active { transform: translateY(0); }
.share-method .share-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
}
.share-method .share-icon.kakao-bg { background: #fae100; }
.share-hint {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  font-weight: 600;
  padding: 10px 0 2px;
  border-top: 1px solid var(--border);
}

/* Sticker detail modal (클릭 시 스토리 열림) */
.sticker-detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(14,116,144,0.5);
  backdrop-filter: blur(4px);
  z-index: 350;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.sticker-detail-overlay.show { display: flex; animation: fadeIn 0.22s; }
.sticker-detail-card {
  background: #fff;
  border-radius: 22px;
  padding: 24px 28px 24px;
  text-align: center;
  width: 100%;
  max-width: 340px;
  position: relative;
  box-shadow: 0 16px 50px rgba(14,116,144,0.35);
  animation: stickerPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.sticker-detail-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  border: none;
  background: var(--surface-alt);
  border-radius: 50%;
  font-size: 18px;
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
  line-height: 1;
}
.sticker-detail-tier {
  font-size: 10.5px;
  font-weight: 800;
  color: var(--brand-ink);
  letter-spacing: 1.5px;
  margin-bottom: 4px;
}
.sticker-detail-tier.tier-2 { color: #b45309; }
.sticker-detail-tier.tier-3 { color: #b91c1c; }
.sticker-detail-svg {
  width: 110px;
  height: 95px;
  margin: 4px auto 14px;
  image-rendering: pixelated;
  filter: drop-shadow(0 4px 8px rgba(14,116,144,0.22));
}
.sticker-detail-svg.locked { opacity: 0.8; }
.sticker-detail-svg svg { width: 100%; height: 100%; }
.sticker-detail-name {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 10px;
  letter-spacing: -0.3px;
}
.sticker-detail-story {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 14px;
  padding: 0 4px;
}
.sticker-detail-condition {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 10px 14px;
  background: var(--surface-alt);
  border-radius: 10px;
}
.sticker-detail-condition span {
  color: var(--brand-ink);
  font-weight: 700;
}
.sticker-detail-captured {
  padding: 8px 4px;
}
.sticker-detail-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}
.sticker-action-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  background: var(--brand-soft);
  border: 1px solid var(--brand-light);
  color: var(--brand-ink);
  font-size: 12.5px;
  font-weight: 700;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, transform 0.12s;
}
.sticker-action-btn:hover { background: var(--brand-light); transform: translateY(-1px); }
.sticker-action-btn:active { transform: translateY(0); }
.sticker-action-btn svg { display: block; }

/* Sticker unlock popup */
.sticker-unlock-overlay {
  position: fixed;
  inset: 0;
  background: rgba(14,116,144,0.5);
  backdrop-filter: blur(4px);
  z-index: 400;
  display: none;
  align-items: center;
  justify-content: center;
}
.sticker-unlock-overlay.show { display: flex; animation: fadeIn 0.3s; }
.sticker-unlock-card {
  background: #fff;
  border-radius: 24px;
  padding: 28px 44px 26px;
  text-align: center;
  width: 86%;
  max-width: 360px;
  min-width: 300px;
  box-shadow: 0 20px 60px rgba(14,116,144,0.4);
  animation: stickerPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-sizing: border-box;
}
@keyframes stickerPop {
  0% { transform: scale(0.5) rotate(-10deg); opacity: 0; }
  60% { transform: scale(1.05) rotate(4deg); }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}
.sticker-unlock-card .unlock-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--brand-ink);
  letter-spacing: 1px;
  margin-bottom: 6px;
}
.sticker-unlock-card .unlock-svg {
  width: 100px;
  height: 85px;
  margin: 4px auto 14px;
  image-rendering: pixelated;
  filter: drop-shadow(0 4px 10px rgba(14,116,144,0.3));
  animation: celebrateBounce 0.6s ease-out 2;
}
.sticker-unlock-card .unlock-svg svg { width: 100%; height: 100%; }
.sticker-unlock-card h3 {
  font-size: 19px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
}
.sticker-unlock-card p {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.sticker-unlock-card .unlock-close {
  padding: 10px 24px;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

/* Mobile adjustments */
@media (max-width: 480px) {
  .profile-btn { top: 12px; right: 12px; padding: 4px 8px 4px 4px; font-size: 11.5px; }
  .profile-mascot-mini { width: 20px; height: 20px; }
  .sticker-grid { grid-template-columns: repeat(3, 1fr); }
}
/* 초소형(≤360px): 3열은 너무 빽빽 → 2열로 넓혀 탭 영역 확보 */
@media (max-width: 360px) {
  .sticker-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .sticker-item .sticker-name { font-size: 11px; }
}

/* =========================================================================
   TYPOGRAPHY DESIGN SYSTEM
   스케일: Display · T1 · T2 · S1 · S2 · B1 · B2 · C1 · C2
   ========================================================================= */

:root {
  /* Size tokens */
  --type-display: 32px;
  --type-t1: 22px;
  --type-t2: 18px;
  --type-s1: 15px;
  --type-s2: 13px;
  --type-b1: 14px;
  --type-b2: 13px;
  --type-c1: 12px;
  --type-c2: 11px;
}

/* Utility classes — 필요시 임의 요소에 적용 */
.ts-display { font-size: var(--type-display); font-weight: 800; line-height: 1.1;  letter-spacing: -1px; }
.ts-t1      { font-size: var(--type-t1);      font-weight: 800; line-height: 1.25; letter-spacing: -0.5px; }
.ts-t2      { font-size: var(--type-t2);      font-weight: 800; line-height: 1.3;  letter-spacing: -0.3px; }
.ts-s1      { font-size: var(--type-s1);      font-weight: 700; line-height: 1.35; letter-spacing: -0.2px; }
.ts-s2      { font-size: var(--type-s2);      font-weight: 700; line-height: 1.4;  letter-spacing: -0.1px; }
.ts-b1      { font-size: var(--type-b1);      font-weight: 500; line-height: 1.5; }
.ts-b2      { font-size: var(--type-b2);      font-weight: 400; line-height: 1.5; }
.ts-c1      { font-size: var(--type-c1);      font-weight: 500; line-height: 1.45; }
.ts-c2      { font-size: var(--type-c2);      font-weight: 600; line-height: 1.4;  letter-spacing: 0.1px; }

/* ── Display (큰 숫자 강조) ── */
.detail-score-block .big-score {
  font-size: var(--type-display);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -1px;
}

/* ── Title 1 (메인 타이틀) ── */
.detail-title {
  font-size: var(--type-t1);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.5px;
}

/* ── Title 2 (섹션/모달 타이틀) ── */
.panel-header h1,
.modal-header h2 {
  font-size: var(--type-t2);
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.3px;
}
/* 메인 헤더는 살짝 더 크게 (브랜드 강조) */
.panel-header h1 {
  font-size: 21px;
  letter-spacing: -0.5px;
}
.panel-header .subtitle {
  font-size: 13px;
  line-height: 1.5;
}

/* ── Subtitle 1 (카드 제목, 팝업 제목, 버튼 메인) ── */
.card-title,
.popup-name,
.review-section-header h3,
.empty-title,
.no-reviews-title,
.ghost-detail-title,
.popup-empty-title {
  font-size: var(--type-s1);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.2px;
}

/* ── Subtitle 2 (폼 라벨, 리뷰어, 스텝 타이틀) ── */
.form-label,
.review-user,
.form-step-title,
.speech-bubble h2 {
  font-size: var(--type-s2);
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: -0.1px;
}

/* ── Body 1 (인풋, CTA 버튼, 긴 설명) ── */
#form input:not([type="radio"]):not([type="hidden"]),
#form select,
#reviewForm input:not([type="radio"]):not([type="hidden"]),
#reviewForm select,
.addr-search-input,
.detail-note,
.btn-submit,
.btn-report,
.btn-option span,
.empty-cta,
.btn-first-review {
  font-size: var(--type-b1);
}
.btn-submit, .btn-report, .btn-option input:checked + span {
  font-weight: 700;
}

/* ── Body 2 (리뷰 본문, 한줄 설명, 보조 문구) ── */
.review-text,
.card-note,
.popup-note,
.popup-ghost-note,
.no-reviews-text,
.empty-text,
.rating-label,
.ghost-detail-text,
.popup-empty-text,
.addr-selected,
.speech-sub {
  font-size: var(--type-b2);
  font-weight: 400;
  line-height: 1.5;
}
.speech-sub { font-weight: 500; }

/* ── Caption 1 (메타, 드롭다운, 칩, 힌트) ── */
.subtitle,
.card-meta,
.detail-meta,
.select-wrap select,
.chip,
.chip-more,
.form-step-hint,
.form-hint,
.review-date,
.panel-count,
.popup-meta,
.popup-score-num,
.popup-review-count,
.addr-item-name,
.empty-hint,
.review-sort button,
.avg-label {
  font-size: var(--type-c1);
  font-weight: 500;
}

/* ── Caption 2 (태그, 뱃지, 작은 라벨) ── */
.tag,
.card-reviews-count,
.card-last-review,
.filter-badge,
.btn-helpful,
.btn-delete-review,
.btn-add-review,
.addr-item-addr,
.label-hint,
.review-stars,
.chip-clear {
  font-size: var(--type-c2);
  font-weight: 600;
  letter-spacing: 0.1px;
}

/* 특수 케이스 (시스템 내에서 미세 조정) */
.card-score .score-num { font-size: 14px; font-weight: 800; }
.card-score .score-icon { font-size: 16px; }
.marker-icon .marker-num { font-size: var(--type-s2); font-weight: 800; }
.marker-review-badge { font-size: 10px; font-weight: 800; }

/* .ts-t2가 form-step-title에 얹히면 T2로 강제 (compact 규칙보다 specificity 높게) */
.modal-form .form-step-title.ts-t2 {
  font-size: var(--type-t2);
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.3px;
  margin-bottom: 18px;
}

/* =========================================================================
   PROFILE — 상단 뽀덕이 프리뷰 카드
   ========================================================================= */
.profile-mascot-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 16px;
  background: linear-gradient(135deg, var(--brand-soft), rgba(255,255,255,0.4));
  border: 1px solid rgba(62, 189, 198, 0.2);
  border-radius: 14px;
  margin-bottom: 14px;
}
.profile-mascot-preview {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  background: #fff;
  border-radius: 12px;
  padding: 6px;
  border: 1px solid rgba(62, 189, 198, 0.15);
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}
.profile-mascot-preview svg { width: 100%; height: 100%; display: block; }
.profile-mascot-hint {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  letter-spacing: -0.2px;
}

/* 꾸미기 아이템 카드 (장착중 하이라이트) */
.cosmetic-item { cursor: pointer; }
.cosmetic-item.equipped {
  border: 2px solid var(--brand);
  background: linear-gradient(135deg, #ecfeff, #fff);
  box-shadow: 0 3px 10px rgba(20, 184, 166, 0.18);
}
.cosmetic-item.equipped::before { display: none; }
.equipped-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background: var(--brand);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 999px;
  letter-spacing: 0.5px;
  z-index: 2;
}

/* 내 리뷰 카드 좌측 미니 뽀덕이 아바타 */
.my-review-avatar {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 50%;
  padding: 2px;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.my-review-avatar svg { width: 100%; height: 100%; display: block; }
.my-review-top { display: flex; align-items: center; gap: 8px; }

/* =========================================================================
   PROFILE MODAL TABS (스티커북 / 내 리뷰 / 뽀복권)
   ========================================================================= */
.profile-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--surface-alt);
  border-radius: 12px;
  margin-bottom: 14px;
  position: sticky;
  top: -4px;  /* 모달 상단 padding 흡수 */
  z-index: 5;
  box-shadow: 0 8px 8px -8px rgba(0,0,0,0.08);
}
.profile-tab {
  flex: 1 1 0;
  padding: 9px 6px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 600;
  font-family: inherit;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
  white-space: nowrap;
  letter-spacing: -0.2px;
}
.profile-tab[aria-selected="true"] {
  background: #fff;
  color: var(--brand-ink);
  font-weight: 800;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.profile-tab:hover:not([aria-selected="true"]) {
  color: var(--text);
}
.profile-tab-panel { display: none; }
.profile-tab-panel.active { display: block; }

/* =========================================================================
   MY REVIEWS LIST (프로필 > 내 리뷰 탭)
   ========================================================================= */
.my-review-item {
  position: relative;
  padding: 12px 40px 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}
.my-review-delete {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-light);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
  padding: 0;
}
.my-review-delete:hover {
  background: #fee2e2;
  color: #dc2626;
}
.my-review-delete:active { transform: scale(0.92); }
.my-review-item:hover {
  border-color: var(--brand-light);
  box-shadow: 0 2px 8px rgba(62, 189, 198, 0.12);
}
.my-review-item:active { transform: scale(0.99); }
.my-review-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.my-review-place {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text);
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: -0.2px;
}
.my-review-score {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 800;
  color: var(--star);
}
.my-review-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.my-review-text {
  font-size: 12.5px;
  color: var(--text);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}
.my-reviews-empty {
  text-align: center;
  padding: 40px 16px;
  color: var(--text-muted);
  font-size: 13px;
}
.my-reviews-empty .empty-emoji {
  font-size: 38px;
  display: block;
  margin-bottom: 10px;
  opacity: 0.85;
}

/* =========================================================================
   GACHA UI (뽀복권)
   ========================================================================= */
.gacha-header {
  text-align: center;
  padding: 12px 12px 14px;
  background: linear-gradient(135deg, #fff7e6, #ffe9c7);
  border-radius: 14px;
  border: 1px solid rgba(255, 183, 77, 0.35);
  margin-bottom: 14px;
}
.gacha-ticket-count {
  font-size: 15px;
  font-weight: 800;
  color: #b45309;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  letter-spacing: -0.3px;
}
.gacha-ticket-count strong { color: #7c2d12; font-size: 20px; }
.gacha-ticket-icon { font-size: 18px; }
.gacha-hint {
  font-size: 11px;
  color: #92400e;
  margin-top: 6px;
  opacity: 0.9;
}
.gacha-machine {
  text-align: center;
  padding: 24px 16px 20px;
  background: linear-gradient(180deg, var(--brand-soft), rgba(255,255,255,0.6));
  border-radius: 16px;
  border: 1.5px dashed var(--brand-light);
  margin-bottom: 16px;
}
.gacha-illust {
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  display: block;
  animation: gachaIdle 3s ease-in-out infinite;
  transform-origin: 50% 80%;
}
.gacha-illust svg { display: block; width: 100%; height: 100%; }
@keyframes gachaIdle {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-4px) rotate(2deg); }
}
.gacha-draw-btn {
  padding: 13px 28px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand), #0891b2);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 3px 8px rgba(20, 184, 166, 0.3);
  transition: transform 0.1s, box-shadow 0.15s, opacity 0.2s;
  letter-spacing: -0.2px;
}
.gacha-draw-btn:not(:disabled):hover { box-shadow: 0 5px 14px rgba(20, 184, 166, 0.42); }
.gacha-draw-btn:not(:disabled):active { transform: scale(0.97); }
.gacha-draw-btn:disabled {
  background: var(--border);
  color: var(--text-muted);
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.75;
}
.gacha-section-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: -0.2px;
}
.gacha-inventory {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}
.gacha-inv-item {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 11.5px;
  position: relative;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.15s, border-color 0.15s;
}
.gacha-inv-item:hover {
  border-color: var(--brand-light);
  box-shadow: 0 3px 10px rgba(0,0,0,0.08);
}
.gacha-inv-item:active { transform: scale(0.98); }
.gacha-inv-item.tier-rare { border-color: #f59e0b; background: linear-gradient(135deg, #fff7e6, #fff); }
.gacha-inv-item.tier-legend { border-color: #a855f7; background: linear-gradient(135deg, #faf5ff, #fff); }
.gacha-inv-emoji { font-size: 22px; display: block; margin-bottom: 4px; }
.gacha-inv-name { font-weight: 800; color: var(--text); font-size: 12px; line-height: 1.3; letter-spacing: -0.2px; }
.gacha-inv-brand { color: var(--text-muted); font-size: 10.5px; margin-top: 2px; }
.gacha-inv-date { color: var(--text-light); font-size: 10px; margin-top: 4px; }
.gacha-inv-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
  font-size: 12px;
  background: var(--surface-alt);
  border-radius: 10px;
  border: 1px dashed var(--border);
}
.gacha-disclaimer {
  font-size: 10.5px;
  color: var(--text-light);
  text-align: center;
  font-style: italic;
}

/* 가챠 결과 모달 */
.gacha-result-modal {
  text-align: center;
  padding: 28px 22px 22px;
}
.gacha-result-anim {
  font-size: 72px;
  line-height: 1;
  margin-bottom: 12px;
  animation: gachaPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes gachaPop {
  0% { transform: scale(0.2) rotate(-30deg); opacity: 0; }
  60% { transform: scale(1.15) rotate(8deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}
.gacha-result-tier {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.gacha-result-tier.tier-rare { color: #d97706; }
.gacha-result-tier.tier-legend { color: #9333ea; }
.gacha-result-tier.tier-miss { color: var(--text-light); }
.gacha-result-name {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
  letter-spacing: -0.3px;
}
.gacha-result-brand {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.gacha-result-code {
  background: var(--surface-alt);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-family: 'Monaco', 'Courier New', monospace;
  color: var(--text);
  margin-bottom: 16px;
  letter-spacing: 1.5px;
  font-weight: 700;
}
.gacha-result-modal .btn-submit {
  width: 100%;
  padding: 12px;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

/* =========================================================================
   커스텀 줌 컨트롤 (+/-) — 위치 FAB 바로 위에 세로로 스택
   ========================================================================= */
.zoom-control {
  display: none;
  position: fixed;
  right: 20px;
  bottom: 80px; /* 위치 FAB(bottom 24 + 46 height + 10 gap) 위 */
  z-index: 20;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.14), 0 1px 3px rgba(0,0,0,0.06);
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.06);
  flex-direction: column;
}
.zoom-btn {
  width: 46px;
  height: 40px;
  border: none;
  background: #fff;
  color: #1f2937;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
}
.zoom-btn:hover { background: var(--brand-soft); color: var(--brand); }
.zoom-btn:active { background: var(--brand-soft); transform: scale(0.97); }
.zoom-divider { height: 1px; background: var(--border); }

/* PC에서만 커스텀 줌 컨트롤 표시 (모바일은 핀치줌) */
@media (min-width: 769px) {
  .zoom-control { display: flex; }
}

/* 필터 토글 버튼: 기본 숨김 (모바일 미디어 쿼리에서 display:flex로 활성화) */
.panel-filter-toggle { display: none; }

/* =========================================================================
   PC 데스크톱: 위치 FAB 표시 + 사이드바 공유 아이콘 숨김
   ========================================================================= */
@media (min-width: 769px) {
  /* PC에선 접기/펼치기 토글 버튼 강제 숨김 */
  .panel-filter-toggle { display: none !important; }
  .locate-fab {
    display: inline-flex;
    position: fixed;
    right: 20px;
    bottom: 24px;
    z-index: 20;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.06);
    background: #fff;
    color: #1f2937;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(0,0,0,0.14), 0 1px 3px rgba(0,0,0,0.06);
    transition: transform 0.15s, box-shadow 0.2s, color 0.18s;
    align-items: center;
    justify-content: center;
    font-family: inherit;
  }
  .locate-fab:hover { box-shadow: 0 5px 14px rgba(0,0,0,0.18); color: var(--brand); }
  .locate-fab:active { transform: scale(0.94); }
  .locate-fab.loading svg { animation: locateSpin 1s linear infinite; }
  @keyframes locateSpin { to { transform: rotate(360deg); } }
  /* 사이드바의 공유 아이콘은 PC에선 숨김 (프로필 모달 내부 공유 버튼으로 충분) */
  .panel-header .header-actions #btnShareMain { display: none; }
  /* 공유 FAB는 모바일 전용 */
  .share-fab { display: none !important; }
}

/* =========================================================================
   내 위치 마커 (geolocation)
   ========================================================================= */
.my-location-dot {
  width: 16px;
  height: 16px;
  position: relative;
}
.my-location-dot::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #3b82f6;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(59,130,246,0.5);
  z-index: 2;
}
.my-location-dot::after {
  content: '';
  position: absolute;
  inset: -14px;
  border-radius: 50%;
  background: rgba(59,130,246,0.2);
  animation: locationPulse 1.8s ease-out infinite;
  z-index: 1;
}
@keyframes locationPulse {
  0% { transform: scale(0.5); opacity: 0.9; }
  100% { transform: scale(1.4); opacity: 0; }
}

/* === Social login buttons === */
.social-login-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}
.btn-social {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.btn-social:hover { background: #f9fafb; border-color: var(--border-strong); }
.btn-social:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-social .social-icon {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  font-weight: 700;
  font-size: 12px;
}
.btn-social-kakao { background: #FEE500; border-color: #FEE500; color: #181600; }
.btn-social-kakao:hover { background: #FDD835; border-color: #FDD835; }
.btn-social-kakao .social-icon { background: transparent; font-size: 16px; }

.btn-social-google { background: #fff; color: #3c4043; border-color: #dadce0; }
.btn-social-google:hover { background: #f1f3f4; }
.btn-social-google .social-icon { background: #4285F4; color: #fff; }

.social-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0;
  color: var(--text-muted);
  font-size: 12px;
}
.social-divider::before,
.social-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* === Toast === */
.toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: rgba(17,24,39,0.92);
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  animation: toastIn 0.2s ease, toastOut 0.3s ease 2.7s forwards;
  max-width: 320px;
  pointer-events: auto;
}
.toast.toast-error { background: rgba(220,38,38,0.92); }
.toast.toast-success { background: rgba(16,185,129,0.92); }
@keyframes toastIn { from { opacity:0; transform:translateY(-8px); } to { opacity:1; transform:translateY(0); } }
@keyframes toastOut { to { opacity:0; transform:translateY(-8px); } }
