/* ============================================================
   style.css - 병원 홍보 웹사이트 전체 스타일
   베이지/브라운 테마, 반응형 (모바일 + PC 동일 DOM)
   ============================================================ */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;500;600;700&family=Inter:wght@300;400;500;600;700&display=swap');

/* ── Lucide / Inline SVG 아이콘 ── */
.lc-icon {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}
.nav-icon .lc-icon    { width: 22px; height: 22px; }
.nav-icon [data-lucide] { width: 22px; height: 22px; }
[data-lucide] {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}
svg[data-lucide] {
  display: inline-block;
  vertical-align: middle;
}
.icon [data-lucide]   { width: 18px; height: 18px; }
.bottom-nav-item [data-lucide] { width: 22px; height: 22px; }
.mobile-header-btn [data-lucide] { width: 22px; height: 22px; }
.post-action-btn [data-lucide]   { width: 18px; height: 18px; }
.post-more-btn [data-lucide]     { width: 18px; height: 18px; }
.write-section-title [data-lucide] { width: 18px; height: 18px; }
.profile-contact-item [data-lucide] { width: 15px; height: 15px; }
.profile-tab [data-lucide] { width: 16px; height: 16px; }

/* 로고 아이콘 */
.logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  border-radius: 10px;
  flex-shrink: 0;
}
.logo-icon svg { color: white; }

/* ── CSS Variables ── */
:root {
  --bg:            #FAF8F4;
  --bg-2:          #F5F0E8;
  --bg-3:          #EDE8DC;
  --bg-4:          #E5DDD0;
  --border:        #D4C5A9;
  --border-light:  #E8E0D0;
  --accent:        #8B6E4F;
  --accent-dark:   #6B5040;
  --accent-light:  #C4B49A;
  --accent-pale:   #F0EAE0;
  --text:          #3D2B1F;
  --text-2:        #7A6553;
  --text-3:        #A89880;
  --white:         #FFFFFF;
  --error:         #C0392B;
  --success:       #27AE60;
  --info:          #2980B9;

  --sidebar-w:     240px;
  --right-w:       300px;
  --feed-w:        640px;
  --header-h:      56px;
  --bottom-nav-h:  60px;

  --radius-sm:     8px;
  --radius-md:     12px;
  --radius-lg:     20px;
  --radius-full:   9999px;

  --shadow-sm:     0 1px 4px rgba(61,43,31,.08);
  --shadow-md:     0 4px 16px rgba(61,43,31,.12);
  --shadow-lg:     0 8px 32px rgba(61,43,31,.16);

  --trans:         .2s ease;
  --font:          'Noto Sans KR', 'Inter', sans-serif;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; overflow-y: scroll !important; scrollbar-gutter: stable; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: var(--font); }
input, textarea, select { font-family: var(--font); }
img { display: block; max-width: 100%; }
ul, ol { list-style: none; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--accent-light); }

/* ================================================================
   LAYOUT
   ================================================================ */

/* 앱 래퍼 */
.app-layout {
  display: flex;
  min-height: 100vh;
  background: var(--bg);
}

/* ── 사이드바 (PC) ── */
.sidebar {
  width: var(--sidebar-w);
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  background: var(--white);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  padding: 20px 12px;
  z-index: 100;
  overflow-y: auto;
  transition: transform var(--trans);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  margin-bottom: 16px;
  cursor: pointer;
}
.sidebar-logo img { width: 32px; height: 32px; border-radius: var(--radius-sm); }
.sidebar-logo-text {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent-dark);
  letter-spacing: -0.5px;
}
.sidebar-logo-sub { font-size: 11px; color: var(--text-3); margin-top: -2px; }

.sidebar-nav { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.auth-only-menu, .auth-only-nav { display: none; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  color: var(--text-2);
  font-size: 14px;
  font-weight: 400;
  transition: background var(--trans), color var(--trans);
  cursor: pointer;
  white-space: nowrap;
}
.nav-item:hover { background: var(--bg-2); color: var(--text); }
.nav-item.active { background: var(--accent-pale); color: var(--accent-dark); font-weight: 600; }
.nav-item .nav-icon { font-size: 22px; width: 24px; text-align: center; flex-shrink: 0; }
.nav-item .nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: var(--white);
  font-size: 11px;
  font-weight: 700;
  border-radius: var(--radius-full);
  padding: 2px 7px;
  min-width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
  margin-top: 8px;
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--trans);
}
.sidebar-user:hover { background: var(--bg-2); }
.sidebar-user-avatar {
  width: 36px; height: 36px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 2px solid var(--border);
}
.sidebar-user-name { font-size: 13px; font-weight: 600; color: var(--text); }
.sidebar-user-handle { font-size: 12px; color: var(--text-3); }

/* ── 메인 콘텐츠 영역 ── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 16px;
  padding: 0 16px;
}

.feed-area {
  width: 100%;
  max-width: var(--feed-w);
  padding: 20px 0 40px;
  flex-shrink: 0;
}

/* ── 우측 패널 (PC) ── */
.right-panel {
  width: var(--right-w);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 20px 0 40px;
  flex-shrink: 0;
}

/* ── 상단 헤더 (모바일) ── */
.mobile-header {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: var(--white);
  border-bottom: 1px solid var(--border-light);
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 200;
}
.mobile-header-logo {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent-dark);
}
.mobile-header-actions { display: flex; gap: 12px; align-items: center; }
.mobile-header-btn {
  font-size: 22px;
  color: var(--text);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  transition: background var(--trans);
}
.mobile-header-btn:hover { background: var(--bg-2); }
.mobile-header-login-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--accent);
  color: #FFFFFF !important;
  font-size: 12.5px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(107, 80, 64, 0.25);
  transition: all var(--trans);
  white-space: nowrap;
}
.mobile-header-login-btn:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
}
.mobile-header-logout-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--bg-3);
  color: var(--text-2) !important;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-light);
  cursor: pointer;
  transition: all var(--trans);
  white-space: nowrap;
}
.mobile-header-logout-btn:hover {
  background: var(--border-light);
  color: var(--text) !important;
}

/* ── 하단 네비게이션 (모바일) ── */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--bottom-nav-h);
  background: var(--white);
  border-top: 1px solid var(--border-light);
  align-items: center;
  justify-content: space-around;
  z-index: 200;
  padding: 0 8px;
}
.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  color: var(--text-3);
  font-size: 20px;
  cursor: pointer;
  transition: color var(--trans);
  position: relative;
}
.bottom-nav-item.active { color: var(--accent-dark); }
.bottom-nav-item .bottom-nav-label { font-size: 10px; }
.bottom-nav-item .nav-dot {
  position: absolute;
  top: 6px; right: 12px;
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: var(--radius-full);
  border: 2px solid var(--white);
}

/* ================================================================
   COMPONENTS
   ================================================================ */

/* ── 카드 ── */
.card {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

/* ── 버튼 ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  transition: all var(--trans);
  cursor: pointer;
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent);
  color: var(--white);
}
.btn-primary:hover { background: var(--accent-dark); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-primary:active { transform: translateY(0); }

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent);
}
.btn-outline:hover { background: var(--accent-pale); }

.btn-ghost {
  background: transparent;
  color: var(--text-2);
}
.btn-ghost:hover { background: var(--bg-2); color: var(--text); }

.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-full { width: 100%; }
.btn-loading { pointer-events: none; opacity: 0.7; }

/* ── 입력 필드 ── */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.form-input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-2);
  color: var(--text);
  font-size: 14px;
  transition: border-color var(--trans), box-shadow var(--trans);
  outline: none;
}
.form-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(139,110,79,.12); background: var(--white); }
.form-input::placeholder { color: var(--text-3); }
.form-input.error { border-color: var(--error); }
.form-error { font-size: 12px; color: var(--error); }
.form-hint { font-size: 12px; color: var(--text-3); }

.form-select {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-2);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  outline: none;
  transition: border-color var(--trans);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24'%3E%3Cpath fill='%238B6E4F' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}
.form-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(139,110,79,.12); background-color: var(--white); }

textarea.form-input { resize: vertical; min-height: 100px; }

/* ── 아바타 ── */
.avatar {
  border-radius: var(--radius-full);
  object-fit: cover;
  flex-shrink: 0;
}
.avatar-sm  { width: 32px;  height: 32px;  }
.avatar-md  { width: 44px;  height: 44px;  }
.avatar-lg  { width: 64px;  height: 64px;  }
.avatar-xl  { width: 88px;  height: 88px;  }
.avatar-xxl { width: 120px; height: 120px; }

.avatar-ring {
  padding: 2px;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  border-radius: var(--radius-full);
}
.avatar-ring .avatar { border: 2px solid var(--white); }

/* ── 배지/태그 ── */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
  background: var(--bg-3);
  color: var(--text-2);
  transition: background var(--trans);
}
.tag:hover { background: var(--border); }
.tag-accent { background: var(--accent-pale); color: var(--accent-dark); }
.tag-outline { background: transparent; border: 1px solid var(--border); }

/* ── 섹션 헤더 ── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.section-title { font-size: 14px; font-weight: 700; color: var(--text); }
.section-action { font-size: 12px; font-weight: 600; color: var(--accent); cursor: pointer; }
.section-action:hover { color: var(--accent-dark); }

/* ── 구분선 ── */
.divider {
  height: 1px;
  background: var(--border-light);
  margin: 16px 0;
}

/* ── 로딩 스피너 ── */
.spinner {
  width: 28px; height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: var(--radius-full);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px;
}

/* ── 스켈레톤 로딩 ── */
@keyframes shimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--bg-3) 25%, var(--bg-2) 50%, var(--bg-3) 75%);
  background-size: 800px 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

/* ── 토스트 알림 ── */
.toast-container {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--text);
  color: var(--white);
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toastIn .3s ease forwards;
  pointer-events: all;
  white-space: nowrap;
}
.toast.success { background: var(--success); }
.toast.error   { background: var(--error); }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes toastOut {
  from { opacity: 1; }
  to   { opacity: 0; transform: translateY(-10px); }
}

/* ── 모달 ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(61,43,31,.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--trans);
}
.modal-overlay.show { opacity: 1; pointer-events: all; }
.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  transition: transform var(--trans);
}
.modal-overlay.show .modal { transform: translateY(0); }

/* ── 기간 빠른 선택 버튼 (1주일, 1개월, 3개월) ── */
.period-quick-btn {
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--trans);
}
.period-quick-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--bg-1);
}
.period-quick-btn.active {
  background: var(--accent);
  color: var(--white);
  border-color: var(--accent);
  box-shadow: 0 2px 4px rgba(107, 80, 64, 0.2);
}

/* ================================================================
   STORIES (스토리 원형)
   ================================================================ */
.stories-wrap {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 16px;
  overflow-x: auto;
  scrollbar-width: none;
}
.stories-wrap::-webkit-scrollbar { display: none; }
.stories-list {
  display: flex;
  gap: 16px;
  width: max-content;
}
.story-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}
.story-ring {
  width: 58px; height: 58px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  padding: 2.5px;
  transition: transform var(--trans);
}
.story-ring:hover { transform: scale(1.05); }
.story-ring.seen { background: linear-gradient(135deg, var(--bg-3), var(--border)); }
.story-ring img {
  width: 100%; height: 100%;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 2px solid var(--white);
}
.story-name {
  font-size: 11px;
  color: var(--text-2);
  max-width: 58px;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ================================================================
   POST CARD (게시글 카드)
   ================================================================ */
.post-card {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--trans);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.post-card:hover { box-shadow: var(--shadow-md); }

/* 포스트 헤더 */
.post-header {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  gap: 10px;
}
.post-header-info { flex: 1; min-width: 0; }
.post-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 2px;
}
.post-hospital-badges {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.post-hospital-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
.post-hospital-name:hover { color: var(--accent); }
.post-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 1px;
  flex-wrap: wrap;
}
.post-region {
  font-size: 11px;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 3px;
}
.post-procedure-tag {
  font-size: 11px;
  background: var(--accent-pale);
  color: var(--accent-dark);
  padding: 1px 7px;
  border-radius: var(--radius-full);
  font-weight: 500;
}
.post-date { font-size: 11px; color: var(--text-3); margin-left: auto; }
.post-more-btn {
  color: var(--text-3);
  font-size: 18px;
  padding: 4px;
  border-radius: var(--radius-full);
  transition: background var(--trans), color var(--trans);
}
.post-more-btn:hover { background: var(--bg-2); color: var(--text); }

/* 포스트 더보기 드롭다운 메뉴 */
.post-more-dropdown-wrap {
  position: relative;
  display: inline-block;
}
.post-more-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
  min-width: 120px;
  z-index: 100;
  display: none;
  padding: 4px 0;
}
.post-more-menu.show {
  display: block;
}
.post-more-menu-item {
  width: 100%;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  background: transparent;
  border: none;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background var(--trans);
  white-space: nowrap;
}
.post-more-menu-item:hover {
  background: var(--bg-2);
}
.post-more-menu-item.danger {
  color: var(--error);
}
.post-more-menu-item.danger:hover {
  background: rgba(231,76,60,0.08);
}

/* 포스트 이미지 */
.post-image-wrap {
  position: relative;
  width: calc(100% - 28px);
  margin: 6px 14px 14px 14px;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: var(--bg-3);
  border: 1px solid var(--border-light);
  box-sizing: border-box;
}
.post-image-wrap.vertical-poster {
  aspect-ratio: 9 / 14;
  max-height: 580px;
}
.post-image-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: top center;
  border-radius: var(--radius-md);
  transition: transform .4s ease;
}
.post-image-wrap:hover img { transform: scale(1.02); }

/* ── 포스트 이미지 슬라이더 (카루셀) ── */
.post-carousel-container {
  user-select: none;
}
.carousel-track {
  position: relative;
  width: 100%;
  height: 100%;
}
.post-slide {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease-in-out, visibility 0.4s ease-in-out;
}
.post-slide.active {
  opacity: 1;
  visibility: visible;
  z-index: 1;
}
.post-slide img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: top center;
  border-radius: var(--radius-md);
}

/* 화살표 버튼 */
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.88);
  color: #1A1410;
  border: 1px solid rgba(0, 0, 0, 0.12);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  backdrop-filter: blur(4px);
  opacity: 0.85;
}
.carousel-btn:hover {
  background: #FFFFFF;
  opacity: 1;
  transform: translateY(-50%) scale(1.08);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}
.carousel-prev { left: 10px; }
.carousel-next { right: 10px; }

/* 카운터 배지 및 인디케이터 도트 */
.carousel-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 10;
  background: rgba(0, 0, 0, 0.65);
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 12px;
  backdrop-filter: blur(4px);
  letter-spacing: 0.5px;
}
.carousel-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  gap: 5px;
  background: rgba(0, 0, 0, 0.35);
  padding: 4px 8px;
  border-radius: 10px;
  backdrop-filter: blur(4px);
}
.carousel-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transition: all 0.25s ease;
  cursor: pointer;
}
.carousel-dot.active {
  width: 14px;
  border-radius: 4px;
  background: #FFFFFF;
}

.vertical-poster-badge {
  position: absolute; top: 12px; right: 12px; z-index: 5;
  background: rgba(61,43,31,.75); color: var(--white);
  padding: 4px 10px; border-radius: var(--radius-full);
  font-size: 11px; font-weight: 600; backdrop-filter: blur(4px);
  display: flex; align-items: center; gap: 4px;
}

/* 포스트 본문 */
.post-body {
  padding: 12px 14px;
  width: 100%;
  box-sizing: border-box;
}

.post-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  width: 100%;
  box-sizing: border-box;
  word-break: break-word;
}

.post-content {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.6;
  white-space: pre-line;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  width: 100%;
  box-sizing: border-box;
  word-break: break-word;
}

.post-info-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.post-price {
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
  background: var(--accent-pale);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.post-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.post-tag {
  font-size: 12px;
  color: var(--accent);
  cursor: pointer;
}
.post-tag:hover { color: var(--accent-dark); text-decoration: underline; }

/* 포스트 액션 버튼 */
.post-actions {
  display: flex;
  align-items: center;
  padding: 8px 14px 10px;
  gap: 4px;
}
.post-action-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: var(--radius-md);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--trans), color var(--trans);
}
.post-action-btn:hover { background: var(--bg-2); color: var(--text); }
.post-action-btn .icon { font-size: 18px; }

.post-action-btn.liked .icon { color: var(--error); }
.post-action-btn.liked { color: var(--error); }
.post-action-btn.saved .icon { color: var(--accent); }

.post-action-btn.like-btn:active { animation: heartPop .2s ease; }
@keyframes heartPop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.3); }
  100% { transform: scale(1); }
}

.post-likes {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-3);
}

/* ================================================================
   PACKAGE ITEM BOX (10종 패키지 혜택 세부 시술 표)
   ================================================================ */
.pkg-box {
  margin: 12px 0;
  background: #F8F5EE;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
}
.pkg-box-header {
  font-weight: 700;
  font-size: 13px;
  color: var(--accent-dark);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 6px;
}
.pkg-box-title {
  display: flex;
  align-items: center;
  gap: 6px;
}
.pkg-box-title .lc-icon,
.pkg-box-title svg {
  width: 15px;
  height: 15px;
  color: var(--accent);
}
.pkg-box-badge {
  font-size: 10.5px;
  color: var(--error);
  font-weight: 700;
  background: #FDEDEC;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
}
.pkg-list-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pkg-more-btn {
  width: 100%;
  margin-top: 8px;
  padding: 8px 12px;
  background: var(--bg-2);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
.pkg-more-btn:hover {
  background: var(--border-light);
  border-color: var(--accent);
  color: var(--accent);
}
.pkg-item-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  background: var(--white);
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--border-light);
  font-size: 12px;
  gap: 6px 10px;
}
.pkg-item-left {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
  min-width: 150px;
  word-break: break-word;
}
.pkg-item-num {
  color: var(--accent);
  font-weight: 700;
  flex-shrink: 0;
}
.pkg-item-name {
  line-height: 1.35;
  flex: 1;
}
.pkg-item-count {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--accent-dark);
  background: var(--accent-pale);
  border: 1px solid var(--border-light);
  padding: 1px 6px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}
.pkg-item-gender {
  font-size: 10px;
  color: var(--text-3);
  background: var(--bg-2);
  padding: 1px 5px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}
.pkg-item-right {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  flex-shrink: 0;
}
.pkg-item-nprice {
  text-decoration: line-through;
  color: var(--text-3);
  font-size: 11px;
}
.pkg-item-eprice {
  color: var(--accent-dark);
  font-weight: 700;
  font-size: 12.5px;
}
.pkg-item-discount {
  background: var(--error);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  white-space: nowrap;
}

/* ================================================================
   RIGHT PANEL - 추천 병원
   ================================================================ */
.right-panel-section { margin-bottom: 24px; }

.suggested-list { display: flex; flex-direction: column; gap: 10px; }
.suggested-item {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.suggested-item-info { flex: 1; min-width: 0; }
.suggested-item-name { font-size: 13px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.suggested-item-sub  { font-size: 12px; color: var(--text-3); }
.suggested-follow-btn {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--accent);
  transition: all var(--trans);
  white-space: nowrap;
}
.suggested-follow-btn:hover { background: var(--accent); color: var(--white); }
.suggested-follow-btn.following { background: var(--bg-3); color: var(--text-3); border-color: var(--border); }

.right-panel-footer {
  font-size: 11px;
  color: var(--text-3);
  line-height: 1.8;
  margin-top: 20px;
}
.right-panel-footer a { color: var(--text-3); }
.right-panel-footer a:hover { text-decoration: underline; }

/* ================================================================
   FILTER BAR (피드 필터)
   ================================================================ */
/* ================================================================
   FILTER PANEL (구조화된 고급 맞춤 필터)
   ================================================================ */
.filter-panel {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.filter-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.filter-search-box {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-full);
  padding: 6px 14px;
  flex: 1;
  min-width: 160px;
  transition: border-color var(--trans);
}
.filter-search-box:focus-within {
  border-color: var(--accent);
  background: var(--white);
}
.filter-search-box input {
  border: none;
  background: none;
  font-size: 13px;
  color: var(--text);
  outline: none;
  width: 100%;
}
.filter-search-box input::placeholder { color: var(--text-3); }

.filter-reset-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  background: var(--bg-3);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--trans);
  white-space: nowrap;
}
.filter-reset-btn:hover {
  background: var(--border);
  color: var(--text);
}

.filter-grid-wrap {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 10px 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.col-span-3 { grid-column: span 3; }
.col-span-4 { grid-column: span 4; }
.col-span-5 { grid-column: span 5; }
.col-span-6 { grid-column: span 6; }
.col-span-7 { grid-column: span 7; }
.col-span-12 { grid-column: span 12; }

.filter-group-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 4px;
  letter-spacing: -0.2px;
}

.filter-select {
  width: 100%;
  padding: 7px 28px 7px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-2);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24'%3E%3Cpath fill='%238B6E4F' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  transition: border-color var(--trans), background-color var(--trans);
}
.filter-select:hover {
  border-color: var(--accent-light);
}
.filter-select:focus {
  border-color: var(--accent);
  background-color: var(--white);
}

.filter-input {
  width: 100%;
  padding: 7px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-2);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font);
  outline: none;
  background-image: none;
  transition: border-color var(--trans), background-color var(--trans);
}
.filter-input:hover {
  border-color: var(--accent-light);
}
.filter-input:focus {
  border-color: var(--accent);
  background-color: var(--white);
}

@media (max-width: 768px) {
  html, body {
    max-width: 100% !important;
    overflow-x: hidden !important;
  }
  .filter-panel {
    padding: 12px 10px;
    border-radius: 0;
    border-left: none;
    border-right: none;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }
  .filter-header-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .filter-header-row > div[style*="display:flex"] {
    width: 100%;
    justify-content: flex-end;
  }
  .filter-search-box {
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
  }
  .filter-select {
    min-width: 0;
    font-size: 12px;
    padding: 6px 18px 6px 6px;
    box-sizing: border-box;
    text-overflow: ellipsis;
  }
  .filter-grid-wrap {
    grid-template-columns: repeat(12, 1fr);
    gap: 8px 6px;
  }
  .filter-grid-wrap .filter-group {
    grid-column: span 12 !important;
  }
  .filter-group div[style*="display:flex"] {
    gap: 4px !important;
    flex-wrap: wrap !important;
  }
  .filter-group div[style*="display:flex"] > select {
    min-width: 0 !important;
    flex: 1 1 30% !important;
  }
  .filter-group input[type="date"] {
    min-width: 0;
    flex: 1;
    font-size: 11px;
    padding: 4px;
    box-sizing: border-box;
  }
  .filter-action-btns {
    margin-left: 0 !important;
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
  }
}
@media (max-width: 480px) {
  .filter-panel { padding: 12px 10px; }
  .filter-grid-wrap .filter-group { grid-column: span 12; }
  .filter-select { font-size: 12px; padding-left: 6px; }
  .filter-group div[style*="display:flex"] > select {
    flex: 1 1 100% !important;
  }
}

/* ================================================================
   PROFILE PAGE
   ================================================================ */
.profile-page {
  width: 100%;
  max-width: var(--feed-w);
  margin: 0;
  padding: 20px 0 60px;
  box-sizing: border-box;
}

.profile-header {
  display: flex;
  gap: 32px;
  align-items: flex-start;
  margin-bottom: 32px;
  padding: 24px;
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.profile-avatar-wrap { flex-shrink: 0; }
.profile-avatar-wrap .avatar-ring { cursor: pointer; }

.profile-info { flex: 1; min-width: 0; }

.profile-username-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.profile-username { font-size: 22px; font-weight: 400; color: var(--text); }
.profile-verified { color: var(--info); font-size: 18px; }

.profile-stats-row {
  display: flex;
  gap: 28px;
  margin-bottom: 14px;
}
.profile-stat { text-align: center; }
.profile-stat-num { font-size: 16px; font-weight: 700; color: var(--text); display: block; }
.profile-stat-label { font-size: 12px; color: var(--text-3); }

.profile-bio-section { margin-bottom: 14px; }
.profile-hospital-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.profile-bio { font-size: 13px; color: var(--text-2); margin-bottom: 8px; line-height: 1.6; }

.profile-contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}
.profile-contact-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-2);
  background: var(--bg-2);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
}
.profile-contact-item .icon { color: var(--accent); font-size: 15px; }
.profile-contact-item a { color: var(--accent); font-weight: 500; }
.profile-contact-item a:hover { text-decoration: underline; }

.profile-specialty-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 14px;
  background: var(--accent);
  color: var(--white);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 8px;
}

/* 프로필 탭 */
.profile-tabs {
  display: flex;
  border-top: 1px solid var(--border-light);
  margin-bottom: 16px;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
}
.profile-tabs::-webkit-scrollbar { display: none; }
.profile-tab {
  flex: 1 1 0;
  width: 33.333%;
  min-width: 0;
  text-align: center;
  padding: 14px 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-3);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
  border-top: 2px solid transparent;
  margin-top: -1px;
  transition: color var(--trans), border-color var(--trans);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.profile-tab.active { color: var(--text); border-top-color: var(--text); }
.profile-tab:hover { color: var(--text-2); }

/* 프로필 그리드 */
.profile-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  position: relative;
  min-height: 200px;
}
.profile-grid-item {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  cursor: pointer;
  background: var(--bg-3);
}
.profile-grid-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
}
.profile-grid-item:hover img { transform: scale(1.05); }
.profile-grid-item-overlay {
  position: absolute; inset: 0;
  background: rgba(61,43,31,.4);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  opacity: 0;
  transition: opacity var(--trans);
}
.profile-grid-item:hover .profile-grid-item-overlay { opacity: 1; }
.profile-grid-stat {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--white);
  font-size: 14px;
  font-weight: 700;
}

/* ================================================================
   AUTH PAGES (로그인, 회원가입, 비밀번호찾기)
   ================================================================ */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 20px;
}

.auth-container {
  width: 100%;
  max-width: 860px;
  display: flex;
  gap: 0;
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light);
}

.auth-visual {
  width: 420px;
  flex-shrink: 0;
  background: linear-gradient(145deg, var(--accent) 0%, var(--accent-dark) 60%, #4A3020 100%);
  padding: 48px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.auth-visual::before {
  content: '';
  position: absolute;
  top: -80px; right: -80px;
  width: 300px; height: 300px;
  background: rgba(255,255,255,.06);
  border-radius: var(--radius-full);
}
.auth-visual::after {
  content: '';
  position: absolute;
  bottom: -60px; left: -60px;
  width: 220px; height: 220px;
  background: rgba(255,255,255,.05);
  border-radius: var(--radius-full);
}
.auth-visual-logo {
  font-size: 30px;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -1px;
  margin-bottom: 12px;
  position: relative; z-index: 1;
}
.auth-visual-sub { font-size: 15px; color: rgba(255,255,255,.75); margin-bottom: 40px; position: relative; z-index: 1; }
.auth-visual-features { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 14px; }
.auth-feature-item {
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(255,255,255,.9);
  font-size: 13px;
}
.auth-feature-item .feature-icon {
  width: 36px; height: 36px;
  background: rgba(255,255,255,.15);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}

.auth-form-wrap {
  flex: 1;
  padding: 48px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow-y: auto;
}
.auth-form-header { margin-bottom: 28px; }
.auth-form-title { font-size: 24px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.auth-form-sub { font-size: 14px; color: var(--text-3); }

.auth-form { display: flex; flex-direction: column; gap: 16px; }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1;
  height: 1px; background: var(--border-light);
}
.auth-divider-text { font-size: 12px; color: var(--text-3); white-space: nowrap; }

.auth-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-3);
}
.auth-links a { color: var(--accent); font-weight: 600; }
.auth-links a:hover { color: var(--accent-dark); text-decoration: underline; }

/* 비밀번호 입력 래퍼 */
.password-wrap { position: relative; }
.password-wrap .form-input { padding-right: 44px; }
.password-toggle {
  position: absolute;
  right: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
}
.password-toggle:hover { color: var(--text); }

/* 회원가입 단계 */
.signup-steps {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
}
.signup-step {
  height: 4px;
  flex: 1;
  background: var(--bg-3);
  border-radius: var(--radius-full);
  transition: background .3s ease;
}
.signup-step.done,
.signup-step.active { background: var(--accent); }

.signup-step-label {
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 20px;
}
.signup-step-label span { color: var(--accent); font-weight: 600; }

/* ================================================================
   WRITE PAGE (게시글 작성)
   ================================================================ */
.write-page {
  max-width: 700px;
  margin: 0 auto;
  padding: 20px 16px 80px;
}

.write-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.write-title { font-size: 20px; font-weight: 700; color: var(--text); }

.write-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.write-section {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-light);
}
.write-section:last-child { border-bottom: none; }

.write-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.write-section-title .icon { color: var(--accent); font-size: 16px; }

/* 이미지 업로드 */
.image-upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: all var(--trans);
  background: var(--bg-2);
  position: relative;
  overflow: hidden;
}
.image-upload-area:hover { border-color: var(--accent); background: var(--accent-pale); }
.image-upload-area.drag-over { border-color: var(--accent); background: var(--accent-pale); }
.upload-icon { font-size: 40px; margin-bottom: 10px; color: var(--accent-light); }
.upload-text { font-size: 14px; font-weight: 600; color: var(--text-2); margin-bottom: 4px; }
.upload-hint { font-size: 12px; color: var(--text-3); }
#image-input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.image-preview-wrap {
  position: relative;
  margin-top: 12px;
  border-radius: var(--radius-md);
  overflow: hidden;
  display: none;
}
.image-preview-wrap img {
  width: 100%;
  max-height: 360px;
  object-fit: cover;
}
.image-preview-remove {
  position: absolute;
  top: 10px; right: 10px;
  background: rgba(0,0,0,.6);
  color: var(--white);
  border-radius: var(--radius-full);
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  cursor: pointer;
  transition: background var(--trans);
}
.image-preview-remove:hover { background: rgba(0,0,0,.8); }

/* 필터 그리드 */
.filter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* 태그 입력 */
.tags-input-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-2);
  min-height: 48px;
  cursor: text;
  transition: border-color var(--trans);
}
.tags-input-wrap:focus-within { border-color: var(--accent); background: var(--white); }
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--accent-pale);
  color: var(--accent-dark);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
}
.tag-chip-remove {
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  color: var(--accent-light);
}
.tag-chip-remove:hover { color: var(--accent-dark); }
.tags-input {
  border: none;
  background: none;
  outline: none;
  font-size: 13px;
  color: var(--text);
  flex: 1;
  min-width: 80px;
}

/* ================================================================
   VIRTUAL SCROLL SENTINEL
   ================================================================ */
.scroll-sentinel {
  height: 1px;
  width: 100%;
}
.scroll-end-msg {
  text-align: center;
  padding: 20px;
  color: var(--text-3);
  font-size: 13px;
}
.fetch-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  font-size: 13px;
  color: var(--text-3);
}

/* ================================================================
   MEDIA QUERIES - 반응형
   ================================================================ */

/* ── 태블릿 / 작은 PC (1024px 이하) ── */
@media (max-width: 1024px) {
  .right-panel { display: none !important; }
  .main-content { margin-left: var(--sidebar-w); justify-content: flex-start; padding: 0 12px; gap: 0; }
  .feed-area { width: 100%; max-width: 100%; flex-shrink: 1; }
}

/* ── 모바일 (768px 이하) ── */
@media (max-width: 768px) {
  html, body {
    overflow-x: hidden;
    max-width: 100%;
    width: 100%;
  }

  .sidebar { display: none !important; }
  .right-panel { display: none !important; }
  .mobile-header { display: flex; }
  .bottom-nav { display: flex; }

  /* ── 모바일 기본 폰트 크기 상향 ── */
  body { font-size: 15px; }

  .app-layout {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .main-content, .profile-wrap, .edit-wrap, .group-wrap, .write-wrap {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    padding-top: var(--header-h) !important;
    padding-bottom: var(--bottom-nav-h) !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }

  .feed-area {
    width: 100% !important;
    max-width: 100% !important;
    flex-shrink: 1 !important;
    padding: 8px 0 24px !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }

  /* ── 포스트 카드 ── */
  .post-card {
    border-radius: 0;
    border-left: none;
    border-right: none;
    margin-bottom: 10px;
    box-shadow: none;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .post-header {
    padding: 14px 16px;
    gap: 12px;
  }

  /* 아바타 크기 모바일에서 더 크게 */
  .post-header .avatar-md { width: 48px; height: 48px; }

  .post-hospital-name { font-size: 15px; }
  .post-title-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .post-hospital-badges {
    width: 100%;
    margin-top: 1px;
    margin-bottom: 2px;
  }

  .post-meta { gap: 6px; margin-top: 3px; }
  .post-region       { font-size: 13px; }
  .post-procedure-tag { font-size: 12px; padding: 2px 9px; }
  .post-date         { font-size: 12px; }

  .post-body { padding: 14px 16px; }
  .post-title   { font-size: 16px; line-height: 1.5; margin-bottom: 6px; }
  .post-content { font-size: 14px; line-height: 1.7; }

  .post-info-row { margin-top: 10px; gap: 8px; }
  .post-price   { font-size: 13px; padding: 3px 10px; }
  .tag          { font-size: 13px; padding: 4px 12px; }
  .tag-accent   { font-size: 13px; }

  .post-tags { margin-top: 10px; gap: 6px; }
  .post-tag  { font-size: 13px; }

  .post-actions { padding: 10px 12px 14px; gap: 4px; }
  .post-action-btn {
    font-size: 14px;
    padding: 8px 12px;
    gap: 6px;
  }
  .post-action-btn .lc-icon,
  .post-action-btn svg.lc-icon { width: 20px; height: 20px; }

  /* ── 스토리 ── */
  .stories-wrap {
    border-radius: 0;
    border-left: none;
    border-right: none;
    margin-bottom: 10px;
    padding: 14px 16px;
  }
  .story-ring { width: 64px; height: 64px; }
  .story-name { font-size: 12px; max-width: 64px; }

  /* ── 필터 바 ── */
  .filter-bar {
    border-radius: 0;
    border-left: none;
    border-right: none;
    margin-bottom: 10px;
    padding: 10px 14px;
    gap: 8px;
  }
  .filter-bar select,
  .filter-search input { font-size: 14px; }
  .filter-bar-label { font-size: 13px; }

  /* ── Auth ── */
  .auth-container { max-width: 100%; }
  .auth-visual { display: none; }
  .auth-form-wrap { padding: 36px 24px; }
  .auth-form-title  { font-size: 24px; }
  .auth-form-sub    { font-size: 14px; }
  .form-label       { font-size: 14px; }
  .form-input       { font-size: 15px; padding: 13px 14px; }
  .form-error       { font-size: 13px; }
  .btn-lg           { font-size: 16px; padding: 14px 20px; }

  /* ── 모바일 헤더 ── */
  .mobile-header { height: 56px; }
  .mobile-header-logo { font-size: 17px; }

  /* ── 하단 네비 ── */
  .bottom-nav-label { font-size: 11px; margin-top: 4px; }
  .bottom-nav-item [data-lucide] { width: 24px; height: 24px; }

  /* ── Profile ── */
  .profile-page { padding: 12px 16px 80px; }
  .profile-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    border-radius: var(--radius-md);
    margin: 0 0 16px;
    padding: 24px 16px;
  }
  .profile-tabs { margin: 0 0 16px; }
  .profile-username     { font-size: 20px; }
  .profile-stat-num     { font-size: 20px; }
  .profile-stat-label   { font-size: 13px; }
  .profile-stats-row    { justify-content: center; gap: 32px; }
  .profile-contact-grid { grid-template-columns: 1fr; }
  .profile-username-row { justify-content: center; }
  .profile-contact-item { font-size: 14px; }
  .profile-bio          { font-size: 14px; line-height: 1.7; }

  /* ── Write ── */
  .write-page { padding: 16px 16px 80px; }
  .write-header { padding: 0 16px; }
  .write-card { border-radius: 0; }
  .write-section { padding: 18px 16px; }
  .write-section-title { font-size: 15px; }
  .filter-grid { grid-template-columns: 1fr; }
  .form-select { font-size: 15px; padding: 13px 14px; }

  .event-top-bar,
  .write-top-bar,
  .edit-top-bar { display: none !important; }

  .toast-container { bottom: calc(var(--bottom-nav-h) + 16px); }
  .toast { font-size: 14px; padding: 12px 20px; }
}

/* ── 소형 모바일 (480px 이하) ── */
@media (max-width: 480px) {
  .profile-header { padding: 16px; }
  .auth-form-wrap { padding: 24px 18px; }
  .post-title   { font-size: 15px; }
  .post-content { font-size: 14px; }
  .post-action-btn { padding: 8px 10px; font-size: 13px; }
}

/* ── 대형 PC (1440px 이상) ── */
@media (min-width: 1440px) {
  :root { --feed-w: 680px; --right-w: 320px; }
}

/* ================================================================
   PAGE TRANSITION
   ================================================================ */
.page-enter {
  animation: pageIn .25s ease forwards;
}
@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ================================================================
   UTILITY CLASSES
   ================================================================ */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-4  { gap: 4px; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.mt-4   { margin-top: 4px; }
.mt-8   { margin-top: 8px; }
.mt-12  { margin-top: 12px; }
.mt-16  { margin-top: 16px; }
.mb-8   { margin-bottom: 8px; }
.mb-16  { margin-bottom: 16px; }
.text-center { text-align: center; }
.text-sm { font-size: 12px; }
.text-muted { color: var(--text-3); }
.font-bold { font-weight: 700; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.visible { display: block !important; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ================================================================
   GLOBAL MODAL POPUP STYLES (popupCall 전용)
   ================================================================ */
.modal-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(20, 16, 12, 0.55);
  backdrop-filter: blur(6px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-backdrop.show {
  opacity: 1;
  visibility: visible;
}
.modal-box {
  background: #FFFFFF !important;
  width: 100%;
  max-width: 500px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  border: 1px solid #D4C5A9;
  box-shadow: 0 24px 48px rgba(0,0,0,0.22);
  overflow: hidden;
  transform: scale(0.92) translateY(10px);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-backdrop.show .modal-box {
  transform: scale(1) translateY(0);
}
.modal-header {
  padding: 20px 24px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #E8E0D0;
  background: #FFFFFF;
  flex-shrink: 0;
}
.modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}
.modal-title {
  font-size: 16.5px;
  font-weight: 700;
  color: #1A1410 !important;
}
.modal-close-btn {
  background: none;
  border: none;
  color: #524336;
  cursor: pointer;
  padding: 4px;
  border-radius: 8px;
  transition: all 0.2s ease;
}
.modal-close-btn:hover {
  color: #1A1410;
  background: #F5F0E8;
}
.modal-body {
  padding: 24px;
  font-size: 14px;
  color: #1A1410 !important;
  line-height: 1.65;
  background: #FFFFFF;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
}
.modal-notice-box {
  background: #FAF6F0 !important;
  border: 1px solid #C4B49A !important;
  border-radius: 12px;
  padding: 16px 18px;
  margin: 16px 0;
  font-size: 13px;
  color: #1A1410 !important;
}

/* 기본 시술 등록 테이블 모바일 개행 반응형 */
@media (max-width: 768px) {
  .responsive-form-table,
  .responsive-form-table thead,
  .responsive-form-table tbody,
  .responsive-form-table tr,
  .responsive-form-table td {
    display: block !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .responsive-form-table thead {
    display: none !important;
  }
  .responsive-form-table tr {
    margin-bottom: 0;
  }
  .responsive-form-table td {
    padding: 8px 12px !important;
    border: none !important;
    text-align: left !important;
  }
  .responsive-form-table td .field-label-mobile {
    display: block !important;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--text-2);
    margin-bottom: 6px;
  }
  .responsive-form-table td.btn-td {
    margin-top: 8px;
    text-align: right !important;
  }
  .responsive-form-table td.btn-td .btn {
    width: 100% !important;
    justify-content: center !important;
    padding: 10px !important;
    font-size: 13px !important;
  }
}

@media (min-width: 769px) {
  .responsive-form-table .field-label-mobile {
    display: none !important;
  }
}
.modal-email-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #6B5040 !important;
  color: #FFFFFF !important;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 8px;
  font-family: monospace;
  font-size: 13px;
  margin-top: 6px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.modal-footer {
  padding: 16px 24px 20px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  border-top: 1px solid #E8E0D0;
  background: #FAF8F4;
}

/* 로그인/미로그인 버튼 깜빡임 방지 (Anti-Flicker) CSS */
html.is-authenticated .unauth-only-btn,
html.is-authenticated .unauth-only-nav,
html.is-authenticated .unauth-only-menu {
  display: none !important;
}

html.is-authenticated .auth-only-btn,
html.is-authenticated .auth-only-nav,
html.is-authenticated .auth-only-menu {
  display: flex !important;
}

html.is-unauthenticated .auth-only-btn,
html.is-unauthenticated .auth-only-nav,
html.is-unauthenticated .auth-only-menu {
  display: none !important;
}

html.is-unauthenticated .unauth-only-btn,
html.is-unauthenticated .unauth-only-nav,
html.is-unauthenticated .unauth-only-menu {
  display: flex !important;
}
