/* =========================================================================
   딜브릿지 — comments.css  (💬 물건 Q&A · AI 비서 · 면책 고지, 2026-11-30)
   -------------------------------------------------------------------------
   1) 상세 패널 Q&A 섹션
   2) 작성자 배지(human / ai_assistant / dealbridge_ai / admin)
   3) 스레드(답글) 들여쓰기·연결선
   4) 사이트 하단 면책 푸터 + 게이트(초기 안내) 면책 문구
   ========================================================================= */

/* ── 사이트 하단 면책 푸터 ─────────────────────────────────────────── */
:root { --foot-h: 32px; }

.app-body { height: calc(100vh - var(--header-h) - var(--tabs-h) - var(--foot-h)); }

.site-foot {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  height: var(--foot-h);
  display: flex; align-items: center; gap: 7px;
  padding: 0 12px;
  background: #0b2a4a; color: #cddcec;
  border-top: 1px solid rgba(255, 255, 255, .12);
  font-size: 10.5px; line-height: 1.35;
  overflow: hidden;
}
.site-foot .sf-ico { flex: none; font-size: 11px; }
.site-foot .sf-label {
  flex: none; font-weight: 800; color: #ffd8a8; letter-spacing: .02em;
}
.site-foot .sf-text {
  flex: 1; min-width: 0;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical;
  overflow: hidden; text-overflow: ellipsis;
}
.site-foot:hover .sf-text { -webkit-line-clamp: 3; }

/* 게이트(초기 안내) 면책 문구 */
.gate-law {
  margin: 10px 0 0; padding: 9px 11px;
  background: #fff8ef; border: 1px solid #f2ddbd; border-radius: 8px;
  font-size: 11px; line-height: 1.55; color: #6b4b1e;
}
.gate-law b { color: #8a5a12; }
.gate-public .gp-law {
  margin: 10px 0 0; padding: 10px 12px;
  background: #f6f9fd; border-left: 3px solid #0b6bcb; border-radius: 0 8px 8px 0;
  font-size: 12px; line-height: 1.6; color: var(--text-2);
}

/* ── 상세 패널 Q&A 섹션 ───────────────────────────────────────────── */
.qa-block {
  padding: 12px 14px 16px;
  border-top: 1px solid var(--line);
  background: linear-gradient(#fcfdff, #fff 120px);
}
.qa-head { display: flex; align-items: center; gap: 8px; }
.qa-title { margin: 0; font-size: 13px; font-weight: 800; color: var(--navy); letter-spacing: -.01em; }
.qa-title .qa-sub { margin-left: 4px; font-size: 10.5px; font-weight: 600; color: var(--muted); }
.qa-head-r { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.qa-count {
  min-width: 22px; height: 18px; padding: 0 6px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #e8f0fb; color: #1d4f8f; border-radius: 9px;
  font-size: 10.5px; font-weight: 800;
}
.qa-ico {
  width: 22px; height: 22px; border-radius: 6px;
  border: 1px solid var(--line); background: #fff; color: var(--muted);
  font-size: 12px; line-height: 1; cursor: pointer;
}
.qa-ico:hover { color: var(--navy); border-color: #b9c9dc; }

/* 면책 고지 (① 목록·입력 상단 / ② AI 답변 하단) */
.qa-law {
  margin: 8px 0 0; padding: 7px 9px;
  background: #fff8ef; border: 1px solid #f0dcbd; border-radius: 7px;
  font-size: 10.5px; line-height: 1.55; color: #6b4b1e;
}
.qa-law b { color: #8a5a12; font-weight: 800; }
.qa-law-ai {
  margin: 7px 0 0; background: #f5f7fb; border-color: #dbe4f0; color: #41536b;
}
.qa-law-ai b { color: #2b4a72; }
.qa-law-slim { font-size: 10px; }

/* 안내(성공/경고) 박스 */
.qa-notice {
  margin: 8px 0 0; padding: 8px 10px;
  border-radius: 7px; font-size: 11px; line-height: 1.6;
  background: #eef7ee; border: 1px solid #cfe6cf; color: #1f5d2a;
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
}
.qa-notice.warn { background: #fff4f4; border-color: #f0cfcf; color: #8a2626; }
.qa-notice .qa-btn { padding: 3px 8px; font-size: 10.5px; }

/* 목록 */
.qa-list { margin-top: 10px; }
.qa-empty {
  padding: 14px 12px; text-align: center;
  border: 1px dashed #d9e2ee; border-radius: 9px;
  background: #fbfcfe; color: var(--muted); font-size: 11.5px; line-height: 1.7;
}
.qa-empty.qa-err { border-color: #f0cfcf; background: #fff7f7; color: #8a2626; }
.qa-empty .qa-btn { margin-top: 8px; }
.qa-thread + .qa-thread { margin-top: 10px; }
.qa-muted { color: var(--muted); font-size: 10.5px; }

/* 댓글 카드 */
.qa-item {
  border: 1px solid var(--line); border-radius: 9px;
  padding: 9px 10px 8px; background: #fff;
  box-shadow: 0 1px 0 rgba(15, 35, 60, .02);
}
.qa-item.qa-hidden { background: #f9fafc; border-style: dashed; }
.qa-line { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.qa-nm { font-size: 11.5px; font-weight: 750; color: var(--text); }
.qa-when { font-size: 10px; color: var(--muted); }
.qa-chip {
  padding: 1px 5px; border-radius: 5px; font-size: 9.5px; font-weight: 700;
  background: #eef2f7; color: #4c5d72;
}
.qa-chip.warn { background: #fdecec; color: #a12b2b; }
.qa-chip.soft { background: #f3eefc; color: #5b3fa8; }

/* 작성자 배지 — 유형별로 색을 확실히 구분 */
.qa-badge {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 1.5px 6px; border-radius: 6px;
  font-size: 9.5px; font-weight: 800; letter-spacing: -.01em;
  border: 1px solid transparent;
}
.qa-b-human      { background: #eef4ff; color: #1d4f8f; border-color: #d5e3f8; }   /* 👤 방문객 — 파랑 */
.qa-b-assistant  { background: #f1ecfd; color: #5b3fa8; border-color: #e0d3fa; }   /* 🤖 AI 비서 — 보라 */
.qa-b-dbai       { background: #e7f7f1; color: #0b6b45; border-color: #c9ecdd; }   /* ✨ 딜브릿지 AI — 초록 */
.qa-b-admin      { background: #fff4e5; color: #8a4b00; border-color: #f6ddb8; }   /* 🛡️ 관리자 — 주황 */

.qa-t-assistant, .qa-t-dbai { background: #fdfdff; }
.qa-t-dbai { border-color: #d5ece2; }
.qa-t-admin { border-color: #f3e0c4; background: #fffdf8; }

.qa-body { margin-top: 6px; font-size: 12px; line-height: 1.68; color: var(--text-2); word-break: break-word; overflow-wrap: anywhere; }
.qa-body p { margin: 0 0 6px; }
.qa-body p:last-child { margin-bottom: 0; }
.qa-body ul, .qa-body ol { margin: 4px 0 6px; padding-left: 18px; }
.qa-body li { margin: 2px 0; }
.qa-body .qa-h { margin: 8px 0 4px; font-size: 12px; font-weight: 800; color: var(--navy); }
.qa-body code { background: #eef2f8; border-radius: 4px; padding: 0 3px; font-size: 11px; }
.qa-body .qa-code { background: #0f1c2b; color: #d6e4f5; border-radius: 7px; padding: 8px 10px; overflow-x: auto; font-size: 10.5px; }
.qa-body blockquote { margin: 5px 0; padding: 2px 9px; border-left: 3px solid #d5e0ee; color: #55657a; }
.qa-body .qa-table-wrap { overflow-x: auto; margin: 6px 0; }
.qa-table { width: 100%; border-collapse: collapse; font-size: 10.5px; }
.qa-table th, .qa-table td { border: 1px solid var(--line); padding: 3px 6px; text-align: left; vertical-align: top; }
.qa-table th { background: #f5f8fc; font-weight: 750; }
.qa-ai-body { color: #1d3b2f; }
.qa-blinded { color: #8a8f98; font-style: italic; background: #f6f7f9; border-radius: 6px; padding: 7px 9px; }
.qa-body.qa-blinded-admin { color: #8a2626; background: #fff5f5; border-radius: 6px; padding: 6px 8px; }

/* 동작 버튼 */
.qa-acts { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 8px; }
.qa-link {
  border: 0; background: none; padding: 0; cursor: pointer;
  font-size: 10.5px; font-weight: 700; color: #2b5f9e;
}
.qa-link:hover { text-decoration: underline; }
.qa-link.adm { color: #7a5a1e; }
.qa-link.del { color: #a52c2c; }
.qa-mini-note {
  margin-top: 7px; padding: 6px 8px; border-radius: 6px;
  background: #fffaf2; border: 1px solid #f1e2c8; color: #7a5a1e;
  font-size: 10.5px; line-height: 1.55;
}

/* 스레드(답글) — 들여쓰기 + 세로 연결선 */
.qa-children {
  margin: 8px 0 0 9px; padding-left: 11px;
  border-left: 2px solid #e2e9f2;
}
.qa-children .qa-item { background: #fcfdff; }
.qa-children .qa-children { margin-left: 6px; border-left-color: #edf1f6; }
.qa-children .qa-item + .qa-item { margin-top: 7px; }
.qa-reply-wrap { margin: 8px 0 0 9px; padding-left: 11px; border-left: 2px dashed #cfdcec; }
.qa-children > .qa-reply-wrap { margin-left: 0; }

/* 작성 폼 */
.qa-form {
  margin: 12px 0 0; padding: 10px;
  border: 1px solid #dfe7f1; border-radius: 10px; background: #fbfdff;
}
.qa-form-reply { margin: 0; background: #fff; border-color: #e3ebf5; padding: 8px; }
.qa-form-top { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 7px; }
.qa-f { display: flex; align-items: center; gap: 5px; min-width: 0; }
.qa-f span { font-size: 10px; font-weight: 750; color: var(--muted); white-space: nowrap; flex: none; }
.qa-f input, .qa-f select {
  height: 27px; padding: 0 7px; font-size: 11.5px;
  border: 1px solid #d8e2ee; border-radius: 6px; background: #fff; color: var(--text);
  font-family: inherit;
}
.qa-f-nick { flex: 1 1 140px; min-width: 0; }
.qa-f-nick input { width: 100%; min-width: 0; }
.qa-f-type { flex: 0 0 auto; }
.qa-form textarea {
  width: 100%; resize: vertical; min-height: 56px;
  padding: 7px 9px; font-size: 12px; line-height: 1.6;
  border: 1px solid #d8e2ee; border-radius: 7px; background: #fff; color: var(--text);
  font-family: inherit;
}
.qa-form textarea:focus, .qa-f input:focus, .qa-f select:focus {
  outline: none; border-color: #7fadde; box-shadow: 0 0 0 3px rgba(11, 107, 203, .10);
}
.qa-form-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 7px; }
.qa-cc { font-size: 10px; color: var(--muted); font-variant-numeric: tabular-nums; }
.qa-ai-opt { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; color: #2b5f9e; font-weight: 700; }
.qa-ai-opt input { accent-color: #0b6bcb; }
.qa-form-btns { margin-left: auto; display: inline-flex; gap: 6px; }
.qa-btn {
  border: 1px solid #cfdaea; background: #fff; color: #2b4a72;
  padding: 5px 10px; border-radius: 7px; font-size: 11px; font-weight: 750; cursor: pointer;
  text-decoration: none; display: inline-flex; align-items: center; gap: 3px;
}
.qa-btn:hover { border-color: #a9bfd9; }
.qa-btn.primary { background: #0b6bcb; border-color: #0b6bcb; color: #fff; }
.qa-btn.primary:hover { background: #0a5fb5; }
.qa-btn.primary[disabled] { background: #9fb9d6; border-color: #9fb9d6; cursor: default; }
.qa-btn.ghost { background: #fff; }
.qa-form-hint { margin: 7px 0 0; font-size: 10px; line-height: 1.6; color: var(--muted); }
.qa-foot { margin: 9px 0 0; font-size: 9.5px; line-height: 1.5; color: #93a1b3; }

/* ── 모바일 ─────────────────────────────────────────────────────────── */
@media (max-width: 720px) {
  :root { --foot-h: 42px; }
  .site-foot { font-size: 9.5px; padding: 0 9px; gap: 5px; align-items: center; }
  .site-foot .sf-text { -webkit-line-clamp: 2; line-height: 1.35; }
  .site-foot .sf-label { display: none; }
  .qa-block { padding: 11px 11px 14px; }
  .qa-f-nick { flex: 1 1 100%; }
  .qa-form-top { gap: 6px; }
  .qa-form-foot { gap: 6px; }
  .qa-form-btns { margin-left: 0; width: 100%; justify-content: flex-end; }
  .qa-f input, .qa-f select { height: 30px; font-size: 12px; }
  .qa-form textarea { font-size: 16px; }   /* iOS 확대 방지 */
  .qa-link { font-size: 11px; padding: 3px 0; }
  .qa-body { font-size: 12.5px; }
}

/* ── 모바일 상세 헤더 축소 (2026-11-30) ───────────────────────────────────
   바텀시트(76vh)에서 상세 헤더(제목·배지·액션·AI CTA)가 본문을 덮어
   Q&A·기본 정보가 답답하던 문제를 CSS 만으로 줄입니다.
   · 시트를 76vh → 86vh 로 세워 본문 공간을 더 줍니다.
   · 배지·액션 버튼은 한 줄 가로 스크롤(줄바꿈으로 쌓이지 않게).
   · 여백·폰트·버튼 크기를 한 단계 줄이고 AI CTA 안내문은 2줄로 제한.
   app.js·style.css 는 건드리지 않습니다. */
@media (max-width: 720px) {
  .detail-panel { max-height: 86vh; }

  .detail-head { padding: 8px 12px 7px; }
  .detail-top { gap: 6px; }
  .detail-title { font-size: 14.5px; line-height: 1.3; }
  .detail-close { width: 24px; height: 24px; font-size: 15px; line-height: 1; }

  .detail-sub {
    margin: 2px 0 0 16px; font-size: 10.5px; line-height: 1.4;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }

  /* 배지 — 한 줄 가로 스크롤 */
  .detail-head .badges {
    flex-wrap: nowrap; margin: 6px 0 0; padding: 0 0 2px;
    overflow-x: auto; overflow-y: hidden;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .detail-head .badges::-webkit-scrollbar { display: none; }
  .detail-head .badge { flex: none; font-size: 9.5px; padding: 2px 6px; }

  /* 액션 버튼 — 한 줄 가로 스크롤 */
  .detail-head .detail-actions {
    flex-wrap: nowrap; gap: 5px; margin: 7px 0 0; padding: 0 0 2px;
    overflow-x: auto; overflow-y: hidden;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .detail-head .detail-actions::-webkit-scrollbar { display: none; }
  .detail-head .action-btn { flex: none; padding: 5px 8px; font-size: 11px; white-space: nowrap; }

  /* AI 심층분석 CTA — 1행(심층분석·Gemini·Claude) + 2행(인라인 AI) 얇은 구성, 안내문 생략 */
  .detail-head .ai-cta { margin-top: 7px; padding: 6px 7px; border-radius: 9px; }
  .detail-head .ai-cta-row { gap: 4px; flex-wrap: wrap; }
  .detail-head .ai-btn-main { flex: 1 1 140px; min-width: 0; padding: 6px 8px; font-size: 10.8px; }
  .detail-head .ai-btn-main .ai-btn-sub { font-size: 9.4px; }
  /* 모바일에서는 '모바일 전용' 배지를 숨깁니다(이미 모바일 · 설명은 title 유지) */
  .detail-head .ai-btn-main .ai-mo-badge { display: none; }
  .detail-head .ai-btn-alt { flex: 0 0 auto; padding: 5px 7px; font-size: 10px; }
  .detail-head .aii-cta-btn {
    flex: 1 1 100%; margin-top: 5px; padding: 6px 8px; font-size: 10.5px;
  }
  .detail-head .aii-cta-btn .aii-cta-sub { font-size: 9.5px; }
  .detail-head .ai-cta-note { display: none; }

  /* IM 링크·보유 안내 */
  .detail-head .im-btn { margin-top: 7px; padding: 7px 9px; }
  .detail-head .im-hold { margin-top: 7px; padding: 7px 9px; font-size: 10.5px; }
}

/* 아주 좁은 화면(≤380px)은 한 번 더 */
@media (max-width: 380px) {
  .detail-head { padding: 7px 10px 6px; }
  .detail-title { font-size: 13.5px; }
  .detail-head .action-btn { padding: 4px 7px; font-size: 10.5px; }
}
