/* ==========================================================================
   compact.css — 모바일 상·하단 컴팩트 · 하단 탭바 숨김 · 목차 컬러 아이콘
                · 사용법(목차) · 인사 칩 · 목소리 프리셋
   (2026-11-30 대표 지시)
   읽는 순서: app.css → design2.css → logo-pwa.css → chat-wm.css → 이 파일
   되돌리기: index.html 에서 이 파일을 부르는 <link> 한 줄만 지우면 된다.
   ========================================================================== */

/* ---------- 1. 실제 보이는 높이를 쓴다 (주소창·툴바 변화에 맞춤) ---------- */
html, body { height: 100%; }
.app, .main { height: 100vh; height: 100dvh; min-height: 0; }
@supports (height: 100dvh) { .app, .main { height: 100dvh; } }

/* ==========================================================================
   2. 모바일: 하단 5탭바를 화면에서 내린다
   · 대표 지시 2026-11-30: "제일 아래 거는 안 나와도 되거든."
   · 5개 화면은 모두 좌측 목차(≡) 안에서 들어간다 (index.html 목차 참고)
   · 그만큼 채팅 영역이 그대로 넓어진다
   ========================================================================== */
@media (max-width: 899px) {
  #tabbar { display: none !important; }

  /* 2-1. 상단 헤더 — 52 → 44px, 로고 22px, 아이콘 32px */
  #topbar { height: 44px !important; padding: 0 8px !important; }
  .topbar .tb-logo { height: 22px !important; }
  .topbar .tb-btn { width: 32px !important; height: 32px !important; }
  .topbar .tb-btn svg { width: 18px !important; height: 18px !important; }
  /* 채팅 첫 줄은 떠 있는 아이콘 줄 아래에서 시작 (60 → 50px) */
  #s-chat .chatlog { padding-top: 50px !important; }
  .screen > .scroll { padding-top: 54px !important; }

  /* 2-2. 입력창 — 아래 여백은 안전영역만, 좌우도 조금 줄인다 */
  .composer { padding: 4px 8px calc(4px + env(safe-area-inset-bottom)) !important; }
  #s-chat .chatlog { padding-bottom: 10px !important; }
}

/* ==========================================================================
   3. 목차(≡) 안 컬러 아이콘 세트 — 인라인 SVG(#ci-*) + 옅은 색 원판
   ========================================================================== */
.drawer .nav-i .cic,
.nav-i .cic {
  width: 28px; height: 28px; border-radius: 9px;
  display: grid; place-items: center; flex: 0 0 auto;
  background: rgba(154, 161, 178, .14);
  transition: background .2s ease, box-shadow .2s ease;
}
.drawer .nav-i .cic { flex: 0 0 auto; }
.nav-i .cic svg {
  width: 19px !important; height: 19px !important;
  display: block; color: inherit;
}
.nav-i .cic-chat   { background: rgba(3, 199, 90, .15); }
.nav-i .cic-gift   { background: rgba(228, 121, 140, .16); }
.nav-i .cic-box    { background: rgba(227, 169, 78, .17); }
.nav-i .cic-person { background: rgba(111, 168, 220, .17); }
.nav-i .cic-gear   { background: rgba(154, 161, 178, .16); }
.nav-i .cic-guide  { background: rgba(139, 123, 232, .17); }
html:not([data-theme="dark"]) .nav-i .cic-chat   { background: rgba(3, 199, 90, .12); }
html:not([data-theme="dark"]) .nav-i .cic-gift   { background: rgba(216, 96, 118, .12); }
html:not([data-theme="dark"]) .nav-i .cic-box    { background: rgba(205, 145, 40, .14); }
html:not([data-theme="dark"]) .nav-i .cic-person { background: rgba(70, 140, 200, .12); }
html:not([data-theme="dark"]) .nav-i .cic-gear   { background: rgba(120, 128, 148, .13); }
html:not([data-theme="dark"]) .nav-i .cic-guide  { background: rgba(120, 100, 220, .12); }

/* 선택된 항목: 색을 진하게 + 옅은 원판 하이라이트 + 살짝 커진 아이콘 */
.nav-i.on .cic { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); }
html:not([data-theme="dark"]) .nav-i.on .cic { box-shadow: inset 0 0 0 1px rgba(20, 24, 34, .05); }
.nav-i.on .cic svg { filter: saturate(1.18) brightness(1.08); }
.nav-i.on .cic-chat   { background: rgba(3, 199, 90, .28); }
.nav-i.on .cic-gift   { background: rgba(228, 121, 140, .30); }
.nav-i.on .cic-box    { background: rgba(227, 169, 78, .30); }
.nav-i.on .cic-person { background: rgba(111, 168, 220, .30); }
.nav-i.on .cic-gear   { background: rgba(154, 161, 178, .28); }
.nav-i.on .cic-guide  { background: rgba(139, 123, 232, .30); }
html:not([data-theme="dark"]) .nav-i.on .cic svg { filter: saturate(1.1) brightness(.96); }

/* 목차 안 보조 항목(맡긴 일·할 수 있는 일·사용법·설치)도 같은 리듬으로 */
.drawer .nav-i .cic { width: 26px; height: 26px; border-radius: 8px; }
.drawer .nav-i .cic svg { width: 18px !important; height: 18px !important; }
.drawer .nav-i { gap: 11px; }

/* ==========================================================================
   4. 사용법 화면 (#s-guide)
   ========================================================================== */
#app[data-view="guide"] { --s-accent: #2A2D33; --s-lit: #9AA1B2; }
html[data-theme="dark"] #app[data-view="guide"] .main { background-color: #0A0B0E; }

.guidebar {
  display: flex; align-items: center; gap: 10px; margin: 0 2px 14px;
}
.guidebar .btn { flex: 0 0 auto; }
.guidetip { margin: 0; font-size: 11.5px; line-height: 1.45; color: var(--faint); }

.gcard {
  position: relative;
  padding: 14px 14px 13px;
  border-radius: 16px;
  background: rgba(255, 255, 255, .035);
  border: 1px solid rgba(255, 255, 255, .06);
  margin-bottom: 10px;
}
html:not([data-theme="dark"]) .gcard { background: #fff; border-color: rgba(20, 24, 34, .07); }
.gcard-h { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; }
.gcard-h .cic { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; flex: 0 0 auto; }
.gcard-h .cic svg { width: 18px; height: 18px; display: block; }
.gcard-h h2 { flex: 1; margin: 0; font-size: .98rem; font-weight: 750; letter-spacing: -.02em; }
.gcard-b { font-size: .86rem; line-height: 1.62; color: var(--muted); }
html[data-theme="dark"] .gcard-b { color: #B4BAC8; }
.gcard-b p { margin: 0 0 7px; }
.gcard-b p:last-child { margin-bottom: 0; }
.gcard-b b { color: var(--text); font-weight: 700; }
.gex {
  margin: 6px 0 0 !important; padding: 8px 10px; border-radius: 11px;
  background: rgba(3, 199, 90, .08); border: 1px solid rgba(3, 199, 90, .16);
  color: #8FE3B4; font-size: .82rem; line-height: 1.55;
}
html:not([data-theme="dark"]) .gex { background: rgba(3, 199, 90, .07); color: #136B41; border-color: rgba(3, 199, 90, .2); }

/* '듣기' 버튼 — 최소 44px 터치 영역 */
.glisten {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 5px;
  min-height: 34px; padding: 6px 11px 6px 9px; border-radius: 999px;
  font-size: .74rem; font-weight: 700; letter-spacing: -.01em;
  color: #9AA1B2; background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .09);
  position: relative;
}
.glisten::after { content: ""; position: absolute; inset: -6px; }  /* 실제 터치 영역 44px */
html:not([data-theme="dark"]) .glisten { color: #5B6072; background: #F2F4FA; border-color: rgba(20, 24, 34, .08); }
.glisten svg { width: 14px; height: 14px; stroke-width: 1.9; }
.glisten.on { color: #0B0D12; background: linear-gradient(160deg, #6FE3A6, #03C75A); border-color: rgba(3, 199, 90, .5); }
html[data-theme="dark"] .glisten.on { color: #06120C; }
.glisten:active { transform: scale(.96); }

.gfoot { margin: 16px 2px 4px; font-size: 11.5px; line-height: 1.6; color: var(--faint); }

/* ==========================================================================
   5. 첫 화면 인사 칩 (인사 듣기 · 홈 화면에 추가)
   ========================================================================== */
.greetrow { display: flex; flex-wrap: wrap; gap: 8px; margin: -2px 0 14px 42px; }
.gchip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 13px 0 11px; border-radius: 999px;
  font-size: .78rem; font-weight: 700; letter-spacing: -.01em;
  color: #CFE9DA; background: rgba(3, 199, 90, .12);
  border: 1px solid rgba(3, 199, 90, .26);
}
html:not([data-theme="dark"]) .gchip { color: #136B41; background: rgba(3, 199, 90, .09); border-color: rgba(3, 199, 90, .26); }
.gchip svg { width: 15px; height: 15px; stroke-width: 1.9; }
.gchip.ghost { color: #9AA1B2; background: rgba(255, 255, 255, .045); border-color: rgba(255, 255, 255, .1); }
html:not([data-theme="dark"]) .gchip.ghost { color: #5B6072; background: #F2F4FA; border-color: rgba(20, 24, 34, .08); }
.gchip:active { transform: scale(.97); }
.gchip.pulse { animation: gchipPulse 1.9s ease-in-out infinite; }
@keyframes gchipPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(3, 199, 90, .0); } 50% { box-shadow: 0 0 0 5px rgba(3, 199, 90, .12); } }
@media (prefers-reduced-motion: reduce) { .gchip.pulse { animation: none; } }

/* ==========================================================================
   6. 목소리 프리셋 (바텀시트 · 설정)
   ========================================================================== */
.vpset-note { margin: 0 0 10px; font-size: 12px; line-height: 1.5; color: var(--faint); }
.vpgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 359px) { .vpgrid { grid-template-columns: 1fr; } }
.vprow {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 10px; border-radius: 13px; text-align: left;
  background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .07);
  min-height: 52px;
}
html:not([data-theme="dark"]) .vprow { background: #F5F7FC; border-color: rgba(20, 24, 34, .08); }
.vprow .vpn { flex: 1; min-width: 0; }
.vprow .vpn b { display: block; font-size: .82rem; font-weight: 700; letter-spacing: -.01em; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vprow .vpn small { display: block; font-size: 10.5px; color: var(--faint); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vpprev {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; color: #0B120D;
  background: linear-gradient(160deg, #6FE3A6, #03C75A);
  border: 1px solid rgba(3, 199, 90, .45);
}
.vpprev svg { width: 15px; height: 15px; stroke-width: 2; }
.vprow.on { border-color: rgba(3, 199, 90, .55); background: rgba(3, 199, 90, .1); }
.vprow.pick { box-shadow: 0 0 0 2px rgba(3, 199, 90, .35); }
.vpprev.playing { background: linear-gradient(160deg, #FFE1A6, #E9A93C); border-color: rgba(233, 169, 60, .5); }
.vpfoot { margin: 12px 0 0; font-size: 11.5px; line-height: 1.55; color: var(--faint); }
