/* ── §5.16 rev2 하단 탭바 — P3.2 ──────────────────────────────────
   의존: tokens.css (vars)
   마크업: index.html <nav class="tab-bar"> (홈/작업실/글쓰기 FAB/대시보드/마무리)
   활성 클래스: .is-active (과도기 .active 병행 — Commit 5에서 단일화)
   ────────────────────────────────────────────────────────────── */

.tab-bar {
  /* 2026-05-01 ── #bottomNavGroup (flex 컨테이너) 안에 들어감. 부모가 fixed.
     사용자 보고 '옹졸맞다' — max-width 320 좁아서 펄이 작게 떠보임.
     flex:1 + max-width 키워서 가로 공간 거의 채우게. 펄 두께도 padding 키워 풍성하게. */
  position: static;
  pointer-events: auto;
  flex: 1 1 auto;
  max-width: 460px;
  min-width: 0;
  background: #ffffff;
  border: 1px solid rgba(15, 20, 25, 0.08);
  border-radius: 999px;
  display: grid;
  grid-template-columns: 1fr 64px 1fr;
  padding: 10px 20px 12px;
  z-index: 999;
  box-shadow: 0 12px 32px rgba(15, 20, 25, 0.12), 0 2px 6px rgba(15, 20, 25, 0.06);

  backface-visibility: hidden;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
[data-theme="dark"] .tab-bar {
  background: #1c1f24;
  border-color: rgba(255,255,255,0.08);
  box-shadow: 0 12px 32px rgba(0,0,0,0.45), 0 2px 6px rgba(0,0,0,0.25);
}

/* 가로형 / 키보드 올라온 상태(높이 매우 낮음) — 탭바 숨겨서 클릭 오작동 방지 */
@media (height <= 460px) and (orientation: portrait) {
  .tab-bar { display: none; }
}

.tab-bar__btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 2px 0 0;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-subtle);
  font-size: 11px;
  font-weight: 600;

  /* 2026-04-24 perf — 색상 0.15s → 0.08s */
  transition: color 0.08s ease-out;
  min-height: 56px;
  position: relative;
  font-family: inherit;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* 2026-05-01 ── 탭 흔들림 픽스: :active 시 transform 제거.
   글로벌 button:active scale(0.94) 가 grid 안에서 정렬 흔드는 문제 차단.
   시각 피드백은 색상 변화로 충분. */
.tab-bar__btn:active,
.tab-bar:has(.tab-bar__btn:active) .tab-bar__btn {
  transform: none !important;
}

.tab-bar__icon {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
}

/* Phase1: Phosphor <i> 탭바 아이콘 대응 */
i.tab-bar__icon {
  font-size: 22px;
  line-height: 1;
  display: block;
}

.tab-bar__label {
  font-size: 11px;
  line-height: 1;
}

/* 활성 상태 — app-core.js showTab() 이 .active 를 토글 */
.tab-bar__btn.active {
  color: var(--brand);
}

.tab-bar__btn.active::before {
  content: '';
  position: absolute;
  top: 6px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--brand);
}

/* 중앙 FAB (글쓰기) */
.tab-bar__fab {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin: -20px auto 0;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  box-shadow: var(--shadow-brand);
  color: #fff;
  cursor: pointer;

  /* 2026-04-24 perf — 0.1s → 0.05s */
  transition: transform 0.05s ease-out;
  place-self: center center;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  /* 2026-05-01 ── 클릭 hit area 보장: 부모 .tab-bar 밖으로 튀어나온 영역도
     z 인덱스로 위에 있어야 뒤 컨텐츠(고객관리 메뉴 등)에 눌림 안 빼앗김. */
  position: relative;
  z-index: 1;
}

.tab-bar__fab:active {
  /* 2026-05-01 ── 흔들림 픽스: scale 제거. 시각 피드백은 box-shadow 약화로 */
  box-shadow: 0 4px 12px rgba(213,138,149,.20);
  transform: none !important;  /* 글로벌 button:active scale(0.96) 차단 */
}

.tab-bar__fab.active {
  outline: 2px solid var(--brand-bg);
  outline-offset: 2px;
}

.tab-bar__fab svg {
  stroke: currentColor;
  fill: none;
}

/* 다크모드 — pill 그림자 강화 */
html[data-theme="dark"] .tab-bar {
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
}

/* 만들기 바텀시트 옵션 */
.nav-sheet-opt {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 56px;
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md, 14px);
  padding: 12px 16px;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  color: var(--text);
  transition: transform .05s ease-out;
  margin-bottom: 8px;
}

.nav-sheet-opt:active {
  transform: scale(.985);
}

.nav-sheet-ic {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--brand-bg, #F7EFF0);
  color: var(--brand);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.nav-sheet-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-sheet-t {
  font-size: 14px;
  font-weight: 700;
}

.nav-sheet-s {
  font-size: 11px;
  color: var(--text-subtle);
}
