/* ============================================================
   carpriceflow - 공통 반응형 스타일
   모든 페이지 공용. 모바일 우선 (375px~) + 태블릿/데스크탑 대응
   ============================================================ */

/* ── 0. 전역 가드 ──────────────────────────────────────────── */
html, body { max-width: 100vw; overflow-x: hidden; -webkit-text-size-adjust: 100%; }
img, canvas, svg { max-width: 100%; height: auto; }
/* 폰트 fallback 통일 (Times 유입 방지) */
button, input, select, textarea { font-family: inherit; }

/* ── 공통 유틸리티 (벨류카 브랜드) ────────────────────────── */
.num { font-variant-numeric: tabular-nums; font-weight: 600; }
.semantic-up { color: var(--orange, #ea580c); }
.semantic-down { color: var(--green, #059669); }
.eyebrow {
  display: inline-block;
  padding: 5px 14px;
  background: var(--accent-dim, rgba(37,99,235,.1));
  color: var(--accent, #2563eb);
  border: 1px solid rgba(37,99,235,.25);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .3px;
}

/* 연식 from/to 그룹 (항상 2열 나란히) */
.filter-group-pair {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
  align-items: flex-end;
}
.filter-group-pair .filter-group { flex: 1 1 0; }

/* ── 1. 태블릿 이하 (≤1024px) ─────────────────────────────── */
@media (max-width: 1024px) {
  main { padding: 20px 16px !important; }
  header { padding: 16px 20px !important; flex-wrap: wrap; gap: 8px !important; }
  header h1 { font-size: 18px !important; }
  .header-sub { font-size: 11px !important; margin-left: 0 !important; }
  .page-header { padding: 12px 16px !important; flex-wrap: wrap; gap: 8px !important; }
  .page-header h1 { font-size: 16px !important; }
  .page-header .header-sub { font-size: 11px !important; margin-left: 0 !important; }

  .filter-card { padding: 16px !important; }
  .filter-bar { padding: 12px 16px !important; }
  .filter-row { gap: 8px !important; }
  .filter-group { flex: 1 1 calc(50% - 4px) !important; min-width: 0 !important; }
  .fg { flex: 1 1 calc(50% - 4px) !important; min-width: 0 !important; }
  .fg select, .filter-group select, .filter-group input { min-width: 0 !important; width: 100% !important; }
  select, input[type="text"], input[type="number"] { min-width: 0 !important; max-width: 100% !important; }
}

/* ── 2. 모바일 (≤768px) ───────────────────────────────────── */
@media (max-width: 768px) {
  body { font-size: 13px !important; }
  main { padding: 16px 12px !important; }

  /* 헤더 */
  header, .page-header { padding: 12px 14px !important; }
  header h1, .page-header h1 { font-size: 16px !important; }
  .header-sub, .page-header .header-sub { font-size: 10px !important; width: 100%; }

  /* 페이지 탭 (상단 네비) */
  .tabs, .page-tabs {
    padding: 0 12px !important;
    gap: 0 !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .tabs::-webkit-scrollbar, .page-tabs::-webkit-scrollbar { display: none; }
  .tab-btn, .page-tab { padding: 10px 14px !important; font-size: 12px !important; white-space: nowrap !important; flex-shrink: 0; }
  .inner-tabs { padding: 0 12px !important; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .inner-tabs::-webkit-scrollbar { display: none; }
  .inner-tab { padding: 8px 14px !important; font-size: 12px !important; white-space: nowrap !important; flex-shrink: 0; }

  /* 필터 */
  .filter-card { padding: 12px !important; margin-bottom: 16px !important; }
  .filter-bar { padding: 10px 12px !important; }
  .filter-row { flex-direction: column; align-items: stretch !important; }
  .filter-group, .fg {
    flex: 1 1 100% !important;
    width: 100% !important;
    min-width: 0 !important;
  }
  /* 연식 from/to 그룹: 모바일에서도 2열 유지 */
  .filter-group-pair {
    flex: 1 1 100% !important;
    width: 100% !important;
    gap: 10px !important;
  }
  .filter-group-pair .filter-group {
    flex: 1 1 50% !important;
    width: auto !important;
    min-width: 0 !important;
  }
  .filter-group label, .fg label { font-size: 11px !important; }
  select, input[type="text"], input[type="number"] {
    width: 100% !important;
    min-width: 0 !important;
    font-size: 16px !important; /* iOS 자동확대 방지 + 가독성 */
    padding: 12px 14px !important;
    min-height: 48px !important;
    line-height: 1.3 !important;
  }
  select option { font-size: 16px !important; }
  .filter-group label, .fg label { font-size: 12px !important; margin-bottom: 6px !important; }
  .btn, .btn-primary, .btn-ghost, .btn-search, .btn-sm, .btn-neutral, .btn-danger, .btn-success {
    width: 100% !important;
    padding: 12px 16px !important;
    font-size: 14px !important;
  }
  .filter-opts, .filter-options { flex-wrap: wrap; gap: 12px !important; font-size: 12px !important; }

  /* 카드 / 통계 */
  .stats-row { grid-template-columns: 1fr 1fr !important; gap: 8px !important; }
  .stat-card { padding: 12px 14px !important; }
  .stat-card .svalue { font-size: 18px !important; }
  .stat-card .slabel { font-size: 11px !important; }
  .cards { flex-direction: column; gap: 10px !important; }
  .card { padding: 12px 14px !important; min-width: 0 !important; }
  .card-value { font-size: 1.1rem !important; }
  .summary-bar { flex-direction: column; gap: 8px !important; }
  .summary-card { width: 100% !important; padding: 10px 16px !important; }
  .summary-card .sc-value { font-size: 1.05rem !important; }
  .action-bar { width: 100% !important; margin-left: 0 !important; }

  /* 섹션 / 제목 */
  .section-title, .section-head { font-size: 13px !important; padding: 10px 14px !important; }
  .result-title { font-size: 14px !important; }

  /* 차트 컨테이너 */
  .chart-card { padding: 14px !important; margin-bottom: 16px !important; }
  .chart-header { flex-direction: column; align-items: flex-start !important; gap: 8px !important; }
  .chart-header h2 { font-size: 14px !important; }
  .chart-container { height: 280px !important; }
  .chart-wrap { padding: 14px !important; height: 280px !important; }
  .legend-row { gap: 10px !important; }
  .legend-item { font-size: 11px !important; }

  /* 테이블 */
  .table-wrap, .trend-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -12px;
    padding: 0 12px;
  }
  table { min-width: 520px; font-size: 11px !important; }
  table th { padding: 8px 6px !important; font-size: 10px !important; white-space: nowrap; }
  table td { padding: 7px 6px !important; font-size: 11px !important; }
  table.depr thead th, table.depr tbody td { padding: 7px 8px !important; font-size: 11px !important; }
  table.mile { min-width: 560px; }
  table.main-tbl { min-width: 520px; }
  .vehicle-table thead th, .vehicle-table tbody td { padding: 6px 8px !important; font-size: 11px !important; }

  /* two-charts (askprice) */
  .two-charts { grid-template-columns: 1fr !important; gap: 14px !important; }

  /* forecast / empty state */
  .forecast-banner { flex-direction: column; gap: 10px !important; padding: 14px 16px !important; }
  .empty-state { padding: 32px 16px !important; }
  .empty-state .icon { font-size: 36px !important; }
  .empty-state p { font-size: 13px !important; }
  .prompt { padding: 28px 16px !important; }
  .prompt-icon { font-size: 28px !important; }
  .prompt p { font-size: 13px !important; }

  /* 로직 설명 블록 */
  .logic-info, .logic-block { font-size: 11px !important; padding: 12px !important; }
  .logic-formula { font-size: 10px !important; overflow-x: auto; }
  .footnote { font-size: 10px !important; }

  /* yearstats 필터바 */
  .grade-filter-bar { flex-wrap: wrap; gap: 8px !important; padding: 12px !important; }
  .grade-filter-bar input { width: 80px !important; }

  /* rawdata 연도 블록 */
  .year-head { flex-wrap: wrap; padding: 10px 14px !important; }
  .year-label { font-size: 13px !important; }
  .year-stats { font-size: 11px !important; width: 100%; }
  .year-actions { margin-left: 0 !important; width: 100%; justify-content: flex-end; }

}

/* ── 3. 초소형 모바일 (≤400px) ────────────────────────────── */
@media (max-width: 400px) {
  main { padding: 12px 10px !important; }
  header h1, .page-header h1 { font-size: 15px !important; }
  .tab-btn, .page-tab, .inner-tab { padding: 8px 12px !important; font-size: 11px !important; }
  .stats-row { grid-template-columns: 1fr !important; }
  .stat-card .svalue { font-size: 16px !important; }
  .chart-container, .chart-wrap { height: 240px !important; }
  table { font-size: 10px !important; }
  .btn, .btn-primary, .btn-ghost, .btn-search { padding: 11px 14px !important; font-size: 13px !important; }
}

/* ── 3.5. 터치 타겟 + 타이포 수정 (Design Audit Quick Wins) ─ */
input[type="checkbox"] { width: 22px; height: 22px; min-width: 22px; }
.filter-opt, .filter-options label { padding: 6px 4px; cursor: pointer; }
select { min-height: 44px; }
h2 { font-size: 19px !important; }
footer { font-size: 12px !important; }
footer p { font-size: 12px !important; }
/* ============================================================
   모바일 3-Step 검색 바텀시트 (mobile-search.js)
   ============================================================ */
.cf-search-entry { display: none; }
@media (max-width: 768px) {
  .cf-search-entry {
    display: block;
    padding: 16px 16px 0;
  }
  /* 모바일에서 기존 filter-card 숨김 */
  .filter-card { display: none !important; }
}
.cf-search-cta {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%;
  padding: 18px 20px;
  background: linear-gradient(135deg, #4f8ef7 0%, #7c5cfc 100%);
  color: #fff; border: none; border-radius: 14px;
  font-size: 17px; font-weight: 700;
  box-shadow: 0 8px 24px rgba(79,142,247,.28);
  cursor: pointer;
  transition: transform .15s ease;
}
.cf-search-cta:active { transform: scale(.98); }
.cf-search-cta-icon { font-size: 18px; }
.cf-search-cta-arrow { font-size: 18px; }
.cf-recent-wrap { margin-top: 14px; }
.cf-recent-title { font-size: 11px; color: var(--text2, #5b6478); margin-bottom: 8px; letter-spacing: .3px; font-weight: 600; }
.cf-recent-chip {
  display: block; width: 100%; text-align: left;
  padding: 10px 14px;
  background: var(--surface2, #eef1f5);
  border: 1px solid var(--border, #e3e7ee);
  border-radius: 10px;
  color: var(--text, #0f1117);
  font-size: 13px;
  margin-bottom: 6px;
  cursor: pointer;
}
.cf-recent-chip:active { background: rgba(79,142,247,.15); }

.cf-ms-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.6);
  opacity: 0; pointer-events: none;
  transition: opacity .2s ease;
  z-index: 10000;
}
.cf-ms-backdrop.open { opacity: 1; pointer-events: auto; }

.cf-ms-sheet {
  position: fixed; left: 0; right: 0; bottom: 0;
  height: 92vh; max-height: 92vh;
  background: var(--bg, #f7f8fa);
  border-radius: 20px 20px 0 0;
  display: flex; flex-direction: column;
  transform: translateY(100%);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 -20px 60px rgba(0,0,0,.6);
  z-index: 10001;
}
.cf-ms-sheet.open { transform: translateY(0); }

.cf-ms-header {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border, #e3e7ee);
}
.cf-ms-back, .cf-ms-close {
  width: 36px; height: 36px;
  background: transparent; border: none;
  color: var(--text, #0f1117);
  font-size: 22px; line-height: 1;
  cursor: pointer; padding: 0;
  border-radius: 8px;
}
.cf-ms-back:active, .cf-ms-close:active { background: rgba(255,255,255,.08); }
.cf-ms-title { flex: 1; font-size: 15px; font-weight: 700; color: var(--text, #0f1117); }
.cf-ms-step { font-size: 12px; color: var(--accent, #2563eb); font-weight: 600; }

.cf-ms-progress {
  height: 3px;
  background: var(--surface2, #eef1f5);
}
.cf-ms-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4f8ef7, #7c5cfc);
  transition: width .3s ease;
  width: 33.33%;
}

.cf-ms-chips {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border, #e3e7ee);
  background: rgba(79,142,247,.04);
}
.cf-ms-chip {
  display: inline-flex; align-items: center;
  padding: 5px 11px;
  background: var(--accent-dim, rgba(79,142,247,.15));
  color: var(--accent, #2563eb);
  border: 1px solid rgba(79,142,247,.3);
  border-radius: 999px;
  font-size: 12px; font-weight: 600;
  cursor: pointer;
}
.cf-ms-chip:active { background: rgba(79,142,247,.25); }

.cf-ms-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 0 80px;
}

.cf-ms-sec-title {
  font-size: 11px; font-weight: 700; color: var(--text2, #5b6478);
  letter-spacing: 1px; text-transform: uppercase;
  padding: 20px 16px 10px;
}

.cf-ms-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  padding: 0 16px;
}
.cf-ms-grid-cell {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px;
  padding: 16px 8px;
  background: var(--surface, #ffffff);
  border: 1px solid var(--border, #e3e7ee);
  border-radius: 10px;
  color: var(--text, #0f1117);
  cursor: pointer;
  min-height: 72px;
}
.cf-ms-grid-cell:active { background: rgba(79,142,247,.15); border-color: var(--accent, #2563eb); }
.cf-ms-grid-cell:disabled { opacity: .3; cursor: not-allowed; }
.cf-ms-grid-name { font-size: 14px; font-weight: 600; }
.cf-ms-grid-cnt { font-size: 11px; color: var(--text2, #5b6478); }

.cf-ms-list {
  list-style: none; margin: 0; padding: 0;
}
.cf-ms-li {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border, #e3e7ee);
  font-size: 15px;
  color: var(--text, #0f1117);
  cursor: pointer;
  min-height: 52px;
}
.cf-ms-li:active { background: rgba(79,142,247,.12); }
.cf-ms-li.disabled { opacity: .4; cursor: not-allowed; }
.cf-ms-li.selected { background: rgba(79,142,247,.1); color: var(--accent, #2563eb); font-weight: 600; }
.cf-ms-li-name { flex: 1; }
.cf-ms-li-cnt { font-size: 12px; color: var(--text2, #5b6478); }

.cf-ms-li-model.selected::after {
  content: "▼";
  margin-left: 6px;
  font-size: 10px;
  color: var(--accent, #2563eb);
}

.cf-ms-sub-acc {
  list-style: none;
  background: var(--surface2, #eef1f5);
  border-bottom: 1px solid var(--border, #e3e7ee);
}
.cf-ms-sub-inner { padding: 8px 0; }
.cf-ms-sub-title {
  font-size: 11px; color: var(--text2, #5b6478);
  padding: 6px 16px 8px;
  letter-spacing: .5px;
}
.cf-ms-sub-list { list-style: none; margin: 0; padding: 0; }
.cf-ms-sub-item {
  padding-left: 32px !important;
  min-height: 44px !important;
  padding-top: 10px !important;
  padding-bottom: 10px !important;
}

.cf-ms-radio .cf-ms-radio-dot {
  width: 18px; height: 18px;
  border: 2px solid var(--text2, #5b6478);
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
}
.cf-ms-radio.selected .cf-ms-radio-dot {
  border-color: var(--accent, #2563eb);
}
.cf-ms-radio.selected .cf-ms-radio-dot::after {
  content: "";
  position: absolute;
  inset: 3px;
  background: var(--accent, #2563eb);
  border-radius: 50%;
}

.cf-ms-year { padding: 0 16px; }
.cf-ms-year-labels {
  display: flex; align-items: center; justify-content: center;
  gap: 16px; margin: 12px 0 20px;
}
.cf-ms-year-val {
  font-size: 24px; font-weight: 700;
  color: var(--accent, #2563eb);
  min-width: 60px; text-align: center;
}
.cf-ms-year-sep { color: var(--text2, #5b6478); font-size: 16px; }

.cf-ms-year-slider {
  position: relative; height: 40px;
  --p1: 0%; --p2: 100%;
}
.cf-ms-year-slider::before {
  content: ""; position: absolute;
  left: 8px; right: 8px; top: 50%;
  height: 4px; transform: translateY(-50%);
  background: var(--surface2, #eef1f5);
  border-radius: 2px;
}
.cf-ms-year-slider::after {
  content: ""; position: absolute;
  top: 50%; transform: translateY(-50%);
  left: calc(8px + var(--p1));
  width: calc(var(--p2) - var(--p1));
  height: 4px;
  background: var(--accent, #2563eb);
  border-radius: 2px;
  pointer-events: none;
}
.cf-ms-year-range {
  position: absolute; left: 0; right: 0; top: 0;
  width: 100%; height: 40px;
  background: transparent;
  pointer-events: none;
  -webkit-appearance: none; appearance: none;
  outline: none; padding: 0; margin: 0;
}
.cf-ms-year-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 22px; height: 22px;
  background: #fff;
  border: 2px solid var(--accent, #2563eb);
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0,0,0,.3);
  pointer-events: auto; cursor: pointer;
}
.cf-ms-year-range::-moz-range-thumb {
  width: 22px; height: 22px;
  background: #fff;
  border: 2px solid var(--accent, #2563eb);
  border-radius: 50%;
  pointer-events: auto; cursor: pointer;
}

.cf-ms-footer {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--bg, #f7f8fa);
  border-top: 1px solid var(--border, #e3e7ee);
}
.cf-ms-next {
  width: 100%;
  padding: 16px;
  background: var(--accent, #2563eb);
  color: #fff;
  border: none; border-radius: 12px;
  font-size: 16px; font-weight: 700;
  cursor: pointer;
}
.cf-ms-next:active { background: #3a7ee8; }

.cf-ms-loading { padding: 40px; text-align: center; color: var(--text2, #5b6478); }

/* ============================================================
   모바일 커스텀 select 피커 (mobile-select.js)
   ============================================================ */
.cf-sel-modal {
  position: fixed; inset: 0; z-index: 10000;
  opacity: 0; pointer-events: none;
  transition: opacity .2s ease;
}
.cf-sel-modal.open { opacity: 1; pointer-events: auto; }
.cf-sel-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.6); }
.cf-sel-sheet {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: var(--surface, var(--white, #ffffff));
  border-top: 1px solid var(--border, #e3e7ee);
  border-radius: 16px 16px 0 0;
  max-height: 80vh;
  display: flex; flex-direction: column;
  transform: translateY(100%);
  transition: transform .25s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 -10px 30px rgba(0,0,0,.5);
}
.cf-sel-modal.open .cf-sel-sheet { transform: translateY(0); }
.cf-sel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border, #e3e7ee);
  position: sticky; top: 0;
  background: inherit;
}
.cf-sel-title {
  font-size: 16px; font-weight: 700;
  color: var(--accent, #2563eb);
}
.cf-sel-close {
  background: transparent; border: none;
  color: var(--text2, #5b6478);
  font-size: 22px; line-height: 1;
  padding: 4px 10px; cursor: pointer;
  border-radius: 6px;
}
.cf-sel-close:active { background: rgba(255,255,255,.08); }
.cf-sel-list {
  list-style: none; margin: 0; padding: 4px 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
}
.cf-sel-opt {
  padding: 14px 20px;
  font-size: 16px;
  color: var(--text, #0f1117);
  border-bottom: 1px solid rgba(46,50,71,.4);
  cursor: pointer;
  min-height: 52px;
  display: flex; align-items: center;
  transition: background .12s ease;
}
.cf-sel-opt:active { background: rgba(79,142,247,.15); }
.cf-sel-opt.selected {
  background: rgba(79,142,247,.12);
  color: var(--accent, #2563eb);
  font-weight: 600;
}
.cf-sel-opt.selected::before {
  content: "✓";
  margin-right: 10px;
  color: var(--accent, #2563eb);
  font-weight: 700;
}
.cf-sel-opt.disabled {
  opacity: .4; cursor: not-allowed;
}
/* 데스크탑에서는 모달 숨김 */
@media (min-width: 769px) {
  .cf-sel-modal { display: none !important; }
}

/* ── 4. 터치 친화 (호버 없는 기기) ────────────────────────── */
@media (hover: none) {
  .tab-btn:hover, .page-tab:hover, .inner-tab:hover,
  .btn:hover, .btn-primary:hover, .btn-search:hover { background-color: inherit; }
}

/* ============================================================
   5. 모바일 햄버거 네비게이션 (mobile-nav.js 동작용)
   ============================================================ */

/* 기본: 데스크탑에서는 cf-nav-header와 overlay 숨김 */
.cf-nav-header { display: none; }
.cf-nav-overlay { display: none; }
.cf-nav-toggle { display: none; }

/* 모바일 (≤768px): 햄버거 드로어 모드 */
@media (max-width: 768px) {
  /* 상단 헤더 바 (햄버거 + 현재 페이지 라벨) */
  .cf-nav-header {
    display: flex !important;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--surface, var(--white, #ffffff));
    border-bottom: 1px solid var(--border, #e3e7ee);
    position: sticky;
    top: 0;
    z-index: 100;
  }
  .cf-nav-current {
    font-size: 14px;
    font-weight: 700;
    color: var(--accent, var(--blue, #2563eb));
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
  }

  /* 햄버거 버튼 */
  .cf-nav-toggle {
    display: flex !important;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 22px;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    flex-shrink: 0;
  }
  .cf-nav-toggle span {
    display: block;
    width: 100%;
    height: 2.5px;
    background: var(--text, #0f1117);
    border-radius: 2px;
    transition: transform .25s ease, opacity .2s ease;
    transform-origin: center;
  }
  .cf-nav-toggle.cf-nav-open span:nth-child(1) {
    transform: translateY(9.5px) rotate(45deg);
  }
  .cf-nav-toggle.cf-nav-open span:nth-child(2) {
    opacity: 0;
  }
  .cf-nav-toggle.cf-nav-open span:nth-child(3) {
    transform: translateY(-9.5px) rotate(-45deg);
  }

  /* 드로어 오버레이 */
  .cf-nav-overlay {
    display: block !important;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
    z-index: 998;
  }
  .cf-nav-overlay.cf-nav-open {
    opacity: 1;
    pointer-events: auto;
  }

  /* 탭 영역을 드로어로 전환 */
  .cf-nav {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    height: 100vh !important;
    width: 78vw !important;
    max-width: 320px !important;
    background: var(--surface, var(--white, #ffffff)) !important;
    flex-direction: column !important;
    padding: 0 0 24px !important;
    margin: 0 !important;
    border-right: 1px solid var(--border, #e3e7ee) !important;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.4);
    transform: translateX(-100%);
    transition: transform .28s cubic-bezier(.4, 0, .2, 1);
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
    z-index: 999;
    gap: 0 !important;
  }

  /* 드로어 상단 브랜드 */
  .cf-nav-brand {
    display: flex; align-items: center; gap: 12px;
    padding: 22px 20px 20px;
    border-bottom: 1px solid var(--border, #e3e7ee);
    text-decoration: none;
    background: var(--surface2, #eef1f5);
    flex-shrink: 0;
  }
  .cf-nav-brand-mark {
    width: 40px; height: 40px;
    display: grid; place-items: center;
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    color: #fff;
    border-radius: 10px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 800; font-size: 20px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(37, 99, 235, .25);
  }
  .cf-nav-brand-txt { display: flex; flex-direction: column; gap: 2px; }
  .cf-nav-brand-text {
    font-size: 17px; font-weight: 800;
    color: var(--text, #0f1117);
    letter-spacing: -.3px; line-height: 1;
  }
  .cf-nav-brand-sub {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 11px; font-weight: 500;
    color: var(--text2, #5b6478);
    letter-spacing: .5px; line-height: 1;
  }
  .cf-nav.cf-nav-open {
    transform: translateX(0);
  }

  /* 드로어 내부 탭 (세로 스택) */
  .cf-nav .tab-btn,
  .cf-nav .page-tab {
    width: 100% !important;
    text-align: left !important;
    padding: 16px 24px !important;
    font-size: 15px !important;
    border-radius: 0 !important;
    border-bottom: 1px solid var(--border, #e3e7ee) !important;
    margin: 0 !important;
    background: transparent !important;
    white-space: normal !important;
    flex-shrink: 0 !important;
    justify-content: flex-start !important;
  }
  .cf-nav .tab-btn.active,
  .cf-nav .page-tab.active {
    background: var(--blue-light, rgba(79, 142, 247, 0.12)) !important;
    border-left: 3px solid var(--accent, var(--blue, #2563eb)) !important;
    color: var(--accent, var(--blue, #2563eb)) !important;
  }
}
