/* =====================================================================
   그린대로 챗봇 — XD 디자인 반영 (아트보드 2–5 PC / 7–9 모바일)
   PC: 좌측 사이드바 + 메인 / 모바일(≤820px): 헤더 + 우측 드로어
   ===================================================================== */

:root {
  --green: #1f704c;
  --green-hover: #185a3d;
  --green-deep: #1f704c;
  --green-tint: #e7f6ee;
  --green-tint-strong: #e1f1e8;
  --green-border: #cde9da;
  --bg: #ffffff;
  --surface: #ffffff;
  --border: #e6eaed;
  --border-soft: #eef1f3;
  --text: #1f2933;
  --text-2: #52606d;
  --text-3: #9aa5b1;
  --pill-dark: #22313f; /* 글자크기 활성 필(디자인: 다크 채움) */
  --sidebar-w: 256px;
  --content-w: 960px;
  --shadow-card: 0 1px 3px rgba(31, 41, 51, 0.06);
  --shadow-pop: 0 8px 32px rgba(0, 0, 0, 0.18);
  --radius: 14px;
  --font: "Pretendard Variable", Pretendard, -apple-system, "Apple SD Gothic Neo",
    "Noto Sans KR", "Malgun Gothic", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--text); }
[hidden] { display: none !important; }
button { font-family: inherit; cursor: pointer; }
img { display: block; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }

.app { display: flex; height: 100vh; height: 100dvh; overflow: hidden; }

/* 얇은 스크롤바 (대화목록·메시지·출처) */
.conv-list::-webkit-scrollbar, .messages::-webkit-scrollbar,
.source-panel .body::-webkit-scrollbar { width: 8px; }
.conv-list::-webkit-scrollbar-thumb, .messages::-webkit-scrollbar-thumb,
.source-panel .body::-webkit-scrollbar-thumb { background: #d8dee3; border-radius: 8px; }
.conv-list::-webkit-scrollbar-track, .messages::-webkit-scrollbar-track,
.source-panel .body::-webkit-scrollbar-track { background: transparent; }

/* ===================== 사이드바 (PC 기본 / 모바일 드로어) ===================== */
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0; background: #f5faf7;
  border-right: 1px solid var(--border); display: flex; flex-direction: column;
}
.sb-head {
  background: var(--surface); padding: 16px 14px 16px 22px; border-bottom: 1px solid var(--border-soft);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.brand img { height: 36px; width: auto; }
.brand .brand-mark { display: none; height: 32px; width: 32px; border-radius: 8px; }

.icon-btn {
  width: 36px; height: 36px; border: none; background: transparent; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center; color: var(--text-2);
}
.icon-btn:hover { background: var(--border-soft); color: var(--text); }
.icon-btn svg { width: 20px; height: 20px; }

.sb-scroll { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.sb-section { padding: 16px 14px 4px; flex-shrink: 0; }
.sb-title { font-size: 13px; font-weight: 700; color: var(--text); margin: 0 4px 10px; }

/* 탐색부터 정착까지 이어지는 단계 안내 */
.stage-flow { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 22px auto 0; }
.stage-path { position: absolute; top: 0; left: 0; width: 100%; height: 100px; pointer-events: none; }
.stage-path path { fill: none; stroke: #cde5d6; stroke-width: 2; stroke-dasharray: 6 6; vector-effect: non-scaling-stroke; }
.stage-chip {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px;
  border: 0; background: transparent; padding: 0 8px; color: var(--text-2); text-align: center;
}
.stage-chip:nth-of-type(even) { margin-top: 30px; }
.stage-chip-icon { display: flex; align-items: center; justify-content: center; width: 54px; height: 54px; border: 2px solid #cde5d6; border-radius: 50%; background: var(--surface); color: var(--green-deep); }
.stage-chip-icon svg { width: 21px; height: 21px; }
.stage-step { margin-top: 2px; font-size: 12px; font-weight: 700; letter-spacing: 0.04em; color: var(--green-deep); }
.stage-chip strong { font-size: 15px; color: var(--text); }
.stage-chip small { max-width: 190px; font-size: 12px; line-height: 1.5; color: var(--text-2); word-break: keep-all; }
.stage-chip:hover .stage-chip-icon, .stage-chip.active .stage-chip-icon { border-color: var(--green); background: var(--green-tint); }
.stage-chip:hover strong, .stage-chip.active strong { color: var(--green-deep); }

/* 그린대로 AI — 새 대화 (2026-09-10 디자인: 흰 배경 + 초록 테두리) */
.new-btn {
  width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--green); color: #fff; border: 1px solid var(--green);
  border-radius: 8px; padding: 12px; font-size: 14px; font-weight: 700;
}
.new-btn:hover { background: var(--green-hover); }
.new-btn:active { transform: translateY(1px); }
.new-btn svg { width: 16px; height: 16px; }

/* 최근 채팅 */
.sb-grow { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.conv-list { flex: 1; overflow-y: auto; padding: 0 8px 8px; }
.conv-item {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 12px; border-radius: 10px; cursor: pointer; font-size: 13px;
  color: var(--text-2); margin-bottom: 2px;
}
.conv-item .title-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-item:hover { background: #f0f4f5; }
.conv-item.active { background: var(--green-tint); color: var(--green-deep); font-weight: 600; }
.conv-item .del { flex: none; color: #bcc4cc; opacity: 0; font-size: 12px; }
.conv-item:hover .del { opacity: 1; }
.conv-item .del:hover { color: #e5484d; }

/* 사이드바 하단 — 로그인 배너(미로그인) / 사용자명(로그인) + 도움말·나가기 (2026-09-10 디자인) */
.sb-foot {
  border-top: 1px solid var(--border-soft); padding: 12px 14px;
  display: flex; flex-direction: column; gap: 10px;
}
.foot-link {
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none;
  font-size: 13px; font-weight: 600; color: var(--text-2); padding: 6px; border-radius: 8px;
}
.foot-link:hover { background: var(--border-soft); color: var(--text); }
.foot-link svg { width: 16px; height: 16px; }
.login-banner { padding: 4px 2px; }
.login-banner-title { display: block; font-size: 14px; font-weight: 700; color: var(--green-deep); }
.login-banner-desc { margin-top: 4px; font-size: 12px; line-height: 1.5; color: var(--text-2); word-break: keep-all; }
.login-banner-cta {
  display: block; margin-top: 10px; padding: 9px 0; border-radius: 8px;
  background: #edf5ef; color: var(--green-deep); text-align: center;
  font-size: 13.5px; font-weight: 600; text-decoration: none;
}
.login-banner-cta:hover { background: var(--green-tint); }
.sb-foot-links { display: flex; align-items: center; gap: 2px; }
.help-link { margin-right: auto; color: var(--text-3); font-weight: 500; }
.help-link:hover { color: var(--text-2); }
.help-icon {
  width: 16px; height: 16px; border-radius: 50%; background: var(--green); color: #fff;
  font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
}
.user-box { display: flex; align-items: center; gap: 8px; min-width: 0; }
.user-avatar {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  background: var(--green-tint); color: var(--green-deep); font-weight: 700; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
}
.user-name {
  font-size: 13.5px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 130px;
}
.drawer-close { display: none; margin-left: auto; }

/* 축소 레일 전용 버튼(최근 채팅 — 시계 아이콘) — 펼친 상태에선 숨김 */
.rail-history {
  display: none; width: 44px; height: 44px; margin: 8px auto 0; border-radius: 12px;
}
.rail-history svg { width: 22px; height: 22px; }

/* PC: 사이드바 축소 → 아이콘 레일 (아트보드 3 — 로고마크·햄버거·+·시계·사용자·나가기) */
.main { position: relative; }
@media (min-width: 821px) {
  .app.sidebar-collapsed .sidebar { width: 64px; }
  .app.sidebar-collapsed #menuBtn svg path { transform: scaleX(-1); transform-box: fill-box; transform-origin: center; } /* 접힘: 셰브론 < → > (펼치기 방향) */
  .app.sidebar-collapsed .sb-head { flex-direction: column; align-items: center; justify-content: flex-start; gap: 10px; padding: 14px 0; }
  .app.sidebar-collapsed .brand .brand-word { display: none; }
  .app.sidebar-collapsed .brand .brand-mark { display: block; }
  .app.sidebar-collapsed .sb-section { padding: 14px 0 0; display: flex; flex-direction: column; align-items: center; }
  .app.sidebar-collapsed .sb-title,
  .app.sidebar-collapsed .stage-grid,
  .app.sidebar-collapsed .conv-list { display: none; }
  .app.sidebar-collapsed .new-btn { width: 44px; height: 44px; padding: 0; border-radius: 12px; }
  .app.sidebar-collapsed .new-btn span { display: none; }
  .app.sidebar-collapsed .rail-history { display: inline-flex; }
  .app.sidebar-collapsed .sb-foot { gap: 4px; padding: 12px 0; align-items: center; }
  .app.sidebar-collapsed .login-banner,
  .app.sidebar-collapsed .help-link { display: none; }
  .app.sidebar-collapsed .foot-link span,
  .app.sidebar-collapsed .user-name { display: none; }
  .app.sidebar-collapsed .foot-link { padding: 8px; justify-content: center; }
  .app.sidebar-collapsed .user-box { justify-content: center; }
}

/* 모바일 드로어 오버레이 */
.drawer-overlay {
  position: fixed; inset: 0; background: rgba(15, 23, 20, 0.45); z-index: 50;
}
@media (min-width: 821px) {
  .drawer-overlay { display: none; }
}

/* ===================== 메인 ===================== */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

/* 모바일 헤더 (데스크톱에서는 숨김) */
.mobile-header {
  display: none; align-items: center; justify-content: space-between;
  padding: 10px 14px; background: var(--surface); border-bottom: 1px solid var(--border-soft);
}

/* 글자 크기 조절 — 라벨 + 연결 캡슐(−/+) (2026-09-10 디자인) */
.topbar { display: flex; justify-content: flex-end; align-items: center; gap: 12px; padding: 12px 24px 0; }
.topbar-help { flex: none; display: inline-flex; align-items: center; gap: 6px; border: none; background: none; cursor: pointer; padding: 6px 0; font-size: 12px; color: var(--text-2); }
.topbar-help:hover { color: var(--text); }
.topbar-div { width: 1px; height: 12px; background: var(--text-3); }
.fs-group { display: flex; align-items: center; gap: 8px; }
.fs-label { font-size: 12px; color: var(--text-2); }
.fs-capsule {
  display: inline-flex; align-items: center; background: var(--surface);
  border: 1px solid var(--border); border-radius: 999px; padding: 2px;
}
.fs-btn {
  width: 28px; height: 26px; border: none; background: none; border-radius: 999px;
  color: var(--text-2); display: inline-flex; align-items: center; justify-content: center;
}
.fs-btn svg { width: 14px; height: 14px; }
.fs-btn:hover { color: var(--green-deep); background: var(--green-tint); }
.fs-btn:disabled { color: #c3ccd3; background: none; cursor: default; }
.fs-div { width: 1px; height: 14px; background: var(--border); }

/* 글자 크기 모드 — 메인(대화·입력)만 비례 확대/축소 (기본 1.1배, 각 방향 2단계: 0.85/0.95/1.1/1.25/1.4) */
body.fs-sm2 .main { zoom: 0.85; }
body.fs-sm .main { zoom: 0.95; }
body:not(.fs-sm):not(.fs-sm2):not(.fs-lg):not(.fs-lg2) .main { zoom: 1.1; }
body.fs-lg .main { zoom: 1.25; }
body.fs-lg2 .main { zoom: 1.4; }

/* 대화 영역 */
.messages { flex: 1; overflow-y: auto; padding: 20px 24px 12px; }
body.hero-on .messages { padding-top: 0; }

/* 새 대화 화면 — 참고 캡처의 입력 카드와 두 단계 시작 안내 */
.placeholder { min-height: 100%; }
.greeting { text-align: center; width: 100%; max-width: 910px; margin: 0 auto; padding: 0 0 28px; }
.hero-brand { display: inline-flex; align-items: center; gap: 7px; color: var(--green-deep); font-size: 14px; font-weight: 800; }
.hero-brand svg { width: 18px; height: 18px; }
.hero-title { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0 10px; margin-top: 12px; font-size: 30px; line-height: 1.4; font-weight: 800; letter-spacing: -0.02em; }
.hero-title-end { color: var(--green-deep); }
.hero-rotator { display: inline-block; height: 1.4em; width: 6.7em; overflow: hidden; color: #e56b0b; background: linear-gradient(transparent 72%, #ffe3cc 72%, #ffe3cc 92%, transparent 92%); }
.hero-rotator-track { display: flex; flex-direction: column; animation: hero-topic-roll 8s cubic-bezier(0.4, 0, 0.2, 1) infinite; }
.hero-rotator-track > span { display: block; height: 1.4em; line-height: 1.4; flex-shrink: 0; white-space: nowrap; }
@keyframes hero-topic-roll {
  0%, 20% { transform: translateY(0); }
  25%, 45% { transform: translateY(-20%); }
  50%, 70% { transform: translateY(-40%); }
  75%, 95% { transform: translateY(-60%); }
  100% { transform: translateY(-80%); }
}
.hero-sub { margin-top: 10px; font-size: 14px; line-height: 1.6; color: var(--text-2); word-break: keep-all; }
.hero-input { margin-top: 24px; }
.hero-divider { display: flex; align-items: center; gap: 14px; margin-top: 36px; font-size: 12px; line-height: 1.6; color: var(--text-2); }
.hero-divider::before, .hero-divider::after { content: ""; height: 1px; flex: 1; background: var(--border); }
.hero-divider strong { color: var(--green-deep); }
.hero-diag-block { margin-top: 32px; }
.hero-step-label { display: flex; align-items: center; justify-content: center; gap: 7px; color: var(--green-deep); font-size: 12px; font-weight: 700; }
.hero-step-label > span { display: inline-flex; align-items: center; justify-content: center; width: 21px; height: 21px; background: #edf5ef; border-radius: 50%; }
.hero-diag-h, .hero-h { margin-top: 10px; font-size: 18px; font-weight: 800; line-height: 1.5; }
.hero-diag-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 18px auto 0; }
.hero-diag-card, .hero-playground-card { min-width: 0; display: flex; align-items: center; gap: 12px; padding: 16px; border: 1px solid #e0e7e2; border-radius: 13px; background: var(--surface); text-align: left; color: var(--text); transition: border-color 0.15s, background 0.15s; }
.hero-diag-card:hover, .hero-playground-card:hover { border-color: var(--green); background: #f5faf7; }
.hero-diag-card:focus-visible, .hero-playground-card:focus-visible { outline: 3px solid var(--green-deep); outline-offset: 3px; }
.hero-diag-icon { display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 36px; height: 36px; font-size: 30px; }
.hero-diag-icon img { width: 36px; height: 36px; object-fit: contain; }
.hero-diag-icon svg { width: 36px; height: 36px; }
.hero-diag-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.hero-diag-txt strong { font-size: 14px; }
.hero-diag-txt small { color: var(--text-2); font-size: 12px; line-height: 1.5; word-break: keep-all; }
.hero-diag-cta { display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%; background: #edf5ef; color: var(--green-deep); }
.hero-diag-cta svg { width: 15px; height: 15px; }
.hero-connector { position: relative; display: flex; align-items: center; justify-content: center; height: 58px; margin: 16px auto; }
.hero-connector::before { content: ""; position: absolute; top: 0; bottom: 0; border-left: 1px dashed #bfdcc9; }
.hero-connector svg { position: relative; width: 30px; height: 30px; padding: 6px; color: var(--green-deep); background: var(--surface); border: 1px solid #cde5d6; border-radius: 50%; }
.hero-section { margin-top: 0; }
.hero-disclaimer { margin-top: 38px; color: var(--text-2); font-size: 16px; font-weight: 700; line-height: 1.6; }

/* 추천 주제는 새 대화 입력 카드의 하단에 함께 놓는다. */
.svc-topics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid #eaf0ec; }
.svc-chip { min-width: 0; display: flex; align-items: center; gap: 8px; padding: 9px 10px; border: 0; border-radius: 11px; background: #f5f8f5; color: var(--text); text-align: left; transition: background 0.15s; }
.svc-chip:hover { background: var(--green-tint); }
.svc-chip:focus-visible { outline: 2px solid var(--green-deep); outline-offset: 2px; }
.svc-icon { display: flex; align-items: center; justify-content: center; width: 26px; height: 26px; flex-shrink: 0; background: var(--surface); border-radius: 7px; color: var(--green-deep); }
.svc-icon svg { width: 14px; height: 14px; }
.svc-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.svc-text strong { font-size: 12px; }
.svc-text small { color: var(--text-2); font-size: 11px; line-height: 1.4; word-break: keep-all; }
.svc-arrow { display: inline-flex; margin-left: auto; flex-shrink: 0; color: #6a8476; }
.svc-arrow svg { width: 12px; height: 12px; }
/* 모션 줄이기 설정과 무관하게 히어로 단어 롤링은 항상 동작 (아래 전역 * 킬보다 클래스 선택자+important가 이김) */
@media (prefers-reduced-motion: reduce) {
  .hero-rotator-track { animation: hero-topic-roll 8s cubic-bezier(0.4, 0, 0.2, 1) infinite !important; }
}

/* 추천 질문 칩 — 답변 카드 밖, 대화 흐름의 독립 행. 클릭하면 다음 질문 전송 */
.followup-row {
  display: flex; flex-wrap: wrap; gap: 8px; max-width: var(--content-w);
  margin: 0 auto 14px; animation: fadeUp 0.18s ease both;
}
.followup-chip {
  display: inline-flex; align-items: center; background: var(--surface); color: var(--text);
  border: 1px solid var(--green-border); border-radius: 999px; padding: 8px 14px;
  font-size: 13px; font-weight: 600;
}
.followup-chip:hover { background: var(--green-tint); }

/* DB 카탈로그 목록 — "다음 10건 보기" 버튼 (답변 말풍선 안, 목록 아래) */
.db-next-btn {
  display: inline-flex; align-items: center; gap: 7px; margin-top: 12px;
  background: var(--green-tint); color: var(--green-deep);
  border: 1.5px solid var(--green-border); border-radius: 12px;
  padding: 11px 18px; font-size: 13.5px; font-weight: 700;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.db-next-btn:hover { background: var(--green-tint-strong); border-color: var(--green); }

/* --- 역질문(조건 좁히기) 선택지 카드 — airun guided-question 마커 렌더 --- */
.guided-q {
  position: relative; margin-top: 12px; padding: 16px 18px 18px;
  border: 1px solid var(--green-border); border-radius: 16px;
  background: var(--surface); box-shadow: var(--shadow-card);
  overflow: hidden;
}
/* 카드 상단 브랜드 액센트 바 */
.guided-q::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--green) 0%, #7ed4ab 55%, var(--green-tint) 100%);
}
.guided-q.empty { border-color: var(--border); }
.guided-q.empty::before { background: linear-gradient(90deg, var(--text-3), var(--border)); }
/* 헤더: 건수 배지 + 질문 문장 */
.guided-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 4px; }
.guided-count {
  display: inline-flex; align-items: center; gap: 5px; flex: none;
  background: var(--green); color: #fff; border-radius: 999px;
  padding: 4px 12px 4px 9px; font-size: 13px; font-weight: 800; letter-spacing: 0.01em;
  box-shadow: 0 2px 6px rgba(43, 182, 115, 0.28);
}
.guided-count svg { flex: none; }
.guided-lead { font-size: 13.5px; font-weight: 600; color: var(--text-2); padding-top: 3px; }
.guided-lead > *:last-child { margin-bottom: 0; }
.guided-applied { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 2px; }
.guided-applied-tag {
  font-size: 12px; font-weight: 600; color: var(--text-2);
  background: var(--border-soft); border-radius: 999px; padding: 3px 10px;
}
/* 그룹: 📍 라벨 + 칩 */
.guided-group { animation: fadeUp 0.18s ease both; }
.guided-group + .guided-group {
  margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--green-border);
  animation-delay: 0.06s;
}
.guided-label {
  display: flex; align-items: center; gap: 7px; margin-bottom: 9px;
  font-size: 13.5px; font-weight: 800; color: var(--green-deep);
}
.guided-label span[aria-hidden] { font-size: 15px; line-height: 1; }
.guided-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.guided-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface); color: var(--text);
  border: 1.5px solid var(--green-border); border-radius: 999px;
  padding: 9px 16px; font-size: 13.5px; font-weight: 600;
  transition: background 0.13s ease, border-color 0.13s ease, transform 0.08s ease, box-shadow 0.13s ease;
}
.guided-chip:hover {
  background: var(--green-tint); border-color: var(--green);
  transform: translateY(-1px); box-shadow: 0 2px 8px rgba(43, 182, 115, 0.14);
}
.guided-chip:active { transform: scale(0.97); }
.guided-chip:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
/* 선택 상태 — 칩 자체를 진초록으로 채워 글자(흰색)가 또렷하게. 대비 ≈4.9:1 */
.guided-chip.on {
  background: var(--green-deep); border-color: var(--green-deep); color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3), 0 2px 8px rgba(28, 122, 79, 0.24);
}
.guided-chip.on::before { content: "✓"; font-size: 12px; font-weight: 800; }
.guided-chip.on:hover { background: var(--green-deep); border-color: var(--green-deep); }
.guided-chip.skip { color: var(--text-2); border-style: dashed; border-width: 1px; font-weight: 500; } /* "~ 상관없어요" */
.guided-chip.skip:hover { color: var(--text); box-shadow: none; }
.guided-chip.skip.on { background: #e3e8ec; border-color: var(--text-2); color: var(--text); }
/* 액션: 확인(전송) + 전체보기 — 세로 풀폭, 큰 터치 타깃 */
.guided-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.guided-send {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  background: var(--green); color: #fff; border: none; border-radius: 12px;
  padding: 13px 16px; font-size: 14.5px; font-weight: 800;
  box-shadow: 0 3px 10px rgba(43, 182, 115, 0.25);
  transition: background 0.12s ease, transform 0.07s ease, box-shadow 0.12s ease;
}
.guided-send svg { flex: none; }
.guided-send:hover:not(:disabled) { background: var(--green-hover); box-shadow: 0 4px 14px rgba(43, 182, 115, 0.32); }
.guided-send:active:not(:disabled) { transform: scale(0.985); }
.guided-send:focus-visible { outline: 2px solid var(--green-deep); outline-offset: 2px; }
.guided-send:disabled {
  background: var(--border-soft); color: var(--text-3); cursor: not-allowed; box-shadow: none;
}
.guided-chip.all {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  background: var(--surface); border: 1.5px dashed var(--green-border);
  color: var(--green-deep); border-radius: 12px; padding: 11px 16px;
  font-size: 13.5px; font-weight: 700; transform: none; box-shadow: none;
}
.guided-chip.all:hover { background: var(--green-tint); border-color: var(--green); border-style: solid; transform: none; box-shadow: none; }
/* 제출 완료 카드 — 선택지 비활성, 확인 버튼 숨김(전체보기는 유지) */
.guided-q.done .guided-choices .guided-chip { pointer-events: none; opacity: 0.5; }
.guided-q.done .guided-send { display: none; }
.guided-note { margin-top: 10px; font-size: 12.5px; color: var(--text-3); }
.guided-note > *:last-child { margin-bottom: 0; }

/* --- 말풍선 --- */
.msg-row { max-width: var(--content-w); margin: 0 auto 14px; display: flex; animation: fadeUp 0.18s ease both; }
.msg-row.user { justify-content: flex-end; }
.msg-row.assistant { flex-direction: column; align-items: stretch; }
.bubble {
  max-width: 80%; padding: 13px 16px; border-radius: var(--radius); font-size: 14.5px;
  line-height: 1.65; word-break: break-word;
}
.bubble.user {
  background: var(--green); color: #fff; border-bottom-right-radius: 4px; white-space: pre-wrap;
}
.bubble.assistant {
  background: var(--surface); border: 1px solid var(--border);
  border-bottom-left-radius: 4px; box-shadow: var(--shadow-card); max-width: 100%;
}

/* 마크다운 렌더링 */
.bubble.assistant > *:first-child { margin-top: 0; }
.bubble.assistant > *:last-child { margin-bottom: 0; }
.bubble.assistant p { margin: 0 0 8px; }
.bubble.assistant ul, .bubble.assistant ol { margin: 0 0 8px; padding-left: 20px; }
.bubble.assistant li { margin: 2px 0; }
.bubble.assistant pre { background: #f3f5f6; border-radius: 8px; padding: 10px 12px; overflow-x: auto; margin: 0 0 8px; }
.bubble.assistant code { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: 13px; }
.bubble.assistant pre code { background: none; padding: 0; }
.bubble.assistant :not(pre) > code { background: var(--border-soft); padding: 1px 5px; border-radius: 4px; }
.bubble.assistant a { color: var(--green-deep); }
.bubble.assistant h1, .bubble.assistant h2, .bubble.assistant h3 { margin: 12px 0 6px; line-height: 1.3; }
.bubble.assistant table { border-collapse: collapse; margin: 0 0 8px; }
.bubble.assistant th, .bubble.assistant td { border: 1px solid var(--border); padding: 4px 8px; font-size: 13.5px; }

/* 일반 답변: 본문 → 비교 표·안내 → 관련 정보 → 피드백 순서 */
.msg-row.chat-answer-row { position: relative; isolation: isolate; max-width: calc(var(--content-w) + 46px); padding: 20px 42px 20px 66px; }
.chat-answer-row::before { content: ''; position: absolute; inset: 0 22px 0 24px; z-index: -1; border-radius: 16px; background: var(--surface); pointer-events: none; }
.chat-avatar { position: absolute; top: 0; left: 0; display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; background: var(--green-tint); color: var(--green-deep); font-size: 11px; font-weight: 800; }
.bubble.assistant.chat-answer { width: 100%; min-width: 0; padding: 0; border: 0; border-radius: 0; box-shadow: none; background: transparent; color: #293d54; font-size: 15px; line-height: 1.85; overflow-wrap: anywhere; }
.bubble.chat-answer p { margin-bottom: 12px; }
.bubble.chat-answer h1, .bubble.chat-answer h2, .bubble.chat-answer h3 { margin: 20px 0 10px; font-size: 17px; }
.chat-table-scroll { max-width: 100%; overflow-x: auto; margin: 14px 0; border: 1px solid #d7e0ea; border-radius: 6px; }
.bubble.chat-answer table { width: 100%; margin: 0; border-style: hidden; line-height: 1.65; }
.bubble.chat-answer img, .bti-ai-body img { max-width: 100%; height: auto; border-radius: 10px; margin: 8px 0; }
.bubble.chat-answer th, .bubble.chat-answer td { min-width: 90px; padding: 10px 14px; border-color: #d7e0ea; vertical-align: top; }
.bubble.chat-answer th { background: #f2f5f9; font-weight: 700; }
.bubble.chat-answer tbody tr:nth-child(even) { background: #fafbfd; }
.bubble.chat-answer > blockquote { position: relative; margin: 14px 0; padding: 12px 16px 12px 42px; border-radius: 6px; background: #eaf7ef; color: #215c43; font-size: 14px; }
.bubble.chat-answer > blockquote::before { content: 'i'; position: absolute; left: 14px; top: 16px; width: 17px; height: 17px; border-radius: 50%; background: var(--green-deep); color: #fff; font: 700 12px/17px sans-serif; text-align: center; }
.bubble.chat-answer > blockquote p:last-child { margin-bottom: 0; }
.stage-guide-answer { color: #293d54; }
.stage-guide-answer .stage-guide-heading { display: flex; align-items: center; gap: 10px; margin: 22px 0 8px; padding-top: 16px; border-top: 1px solid #e4ece7; font-size: 16px; color: #1f5140; }
.stage-guide-answer > .stage-guide-heading:first-child { margin-top: 2px; padding-top: 0; border-top: 0; }
.stage-guide-answer .stage-guide-heading::before { content: attr(data-step); flex: 0 0 23px; width: 23px; height: 23px; border-radius: 50%; background: #2b9a5c; color: #fff; font-size: 12px; line-height: 23px; text-align: center; }
.stage-guide-answer .stage-guide-details { list-style: none; margin: 0 0 4px; padding: 0 0 8px 33px; }
.stage-guide-answer .stage-guide-details > li { margin: 6px 0; line-height: 1.7; }
.stage-guide-answer .stage-guide-details > li::before { content: '•'; margin-right: 7px; color: #e49a2e; font-weight: 800; }
.stage-guide-answer .stage-guide-details > li strong { color: #237c50; }
.stage-guide-answer .stage-guide-details > li.stage-guide-관련-서비스 { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.stage-guide-answer .stage-guide-details > li.stage-guide-관련-서비스::before { content: ''; margin: 0; }
.stage-guide-answer .stage-guide-details > li.stage-guide-관련-서비스 a { display: inline-flex; padding: 4px 11px; border: 1px solid #b8dfc7; border-radius: 999px; background: #f1faf4; color: #237c50; font-size: 13px; font-weight: 700; text-decoration: none; }
.stage-guide-answer .stage-guide-details > li.stage-guide-관련-서비스 a:hover { background: #e4f5ea; }
.chat-answer-row .nextstep-card { padding: 0; margin-top: 18px; border: 0; border-radius: 0; background: transparent; }
.chat-answer-row .ns-title { color: #293d54; font-size: 14px; }
.chat-answer-row .ns-chip { min-height: 40px; justify-content: center; padding: 8px 18px; border-color: #94d7b2; border-radius: 6px; }
.chat-answer-row .msg-actions { margin-top: 12px; }
.chat-answer-row .act-btn { min-width: 40px; min-height: 40px; color: #52687e; }
.msg-row.thinking-row { position: relative; isolation: isolate; max-width: calc(var(--content-w) + 46px); padding: 20px 42px 20px 66px; }
.thinking-row::before { content: ''; position: absolute; inset: 0 22px 0 24px; z-index: -1; border-radius: 16px; background: var(--surface); pointer-events: none; }
.thinking-row > .bubble.assistant { max-width: none; padding: 0; border: 0; border-radius: 0; box-shadow: none; background: transparent; }
@media (max-width: 600px) {
  .msg-row.chat-answer-row { width: 100%; padding: 14px 24px 14px 50px; }
  .msg-row.chat-answer-row, .msg-row.thinking-row { max-width: none; }
  .chat-answer-row::before { left: 38px; right: 12px; }
  .chat-avatar { width: 28px; height: 28px; font-size: 10px; }
  .bubble.assistant.chat-answer { font-size: 14px; }
  .bubble.chat-answer th, .bubble.chat-answer td { padding: 8px 10px; }
  .chat-answer-row .ns-chip { min-height: 44px; flex: 1 1 130px; }
  .msg-row.thinking-row { width: 100%; padding: 14px 24px 14px 50px; }
  .thinking-row::before { left: 38px; right: 12px; }
}

/* 답변 대기 인디케이터 */
.thinking { display: inline-flex; align-items: center; gap: 8px; color: var(--text-3); font-size: 14px; }
.thinking .spinner {
  width: 14px; height: 14px; border: 2px solid #e2e7ea; border-top-color: var(--green);
  border-radius: 50%; display: inline-block; animation: spin 0.8s linear infinite;
}
.verify-ind { margin-top: 6px; font-size: 13px; color: var(--text-3); }

/* --- 답변 하단 액션 행: [복사][👍][👎][출처(N)] --- */
.msg-actions { margin-top: 8px; display: flex; gap: 2px; align-items: center; flex-wrap: wrap; }
.act-btn {
  background: none; border: none; font-size: 16px; line-height: 1;
  padding: 5px 7px; border-radius: 8px; color: var(--text-3);
}
.act-btn:hover { background: #f0f4f5; color: var(--text-2); }
.act-btn.selected { color: var(--green); }
.act-btn:disabled { cursor: default; opacity: 0.55; }
.act-btn svg { display: block; }
.src-btn {
  margin-left: 4px; background: none; border: none; border-radius: 999px; padding: 5px 10px;
  font-size: 12.5px; font-weight: 600; color: var(--text-2);
}
.src-btn:hover { background: var(--green-tint); color: var(--green-deep); }

/* --- 다음 스텝 카드 (아트보드 4 — dashed) --- */
.nextstep-card {
  margin-top: 10px; padding: 12px 14px; border: 1.5px dashed var(--green-border);
  border-radius: 12px; background: #f7fcf9;
}
.nextstep-card .ns-title {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 700; color: var(--green-deep); margin-bottom: 8px;
}
.nextstep-card .ns-title svg { flex-shrink: 0; }
.nextstep-card .ns-body { display: flex; flex-wrap: wrap; gap: 6px; }
.ns-chip {
  display: inline-flex; align-items: center; background: #fff; color: var(--green-deep);
  border: 1px solid var(--green-border); border-radius: 999px; padding: 6px 14px;
  font-size: 13px; font-weight: 600; text-decoration: none;
}
.ns-chip:hover { background: var(--green-tint); }

/* --- 자가진단 위저드 — 선택 행(공식 자가진단 라디오 패턴 → 챗 팔레트) + 리포트 카드 --- */
.diag-progress {
  height: 4px; border-radius: 999px; background: var(--border-soft); overflow: hidden; margin-top: 8px;
}
.diag-progress-fill {
  display: block; height: 100%; background: var(--green); border-radius: 999px;
}
.diag-grid { display: grid; gap: 6px; margin-top: 8px; }
.diag-chip {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 11px 14px; font-size: 14px; font-weight: 600; color: var(--text); text-align: left;
  box-shadow: var(--shadow-card);
  transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s, transform 0.1s;
}
/* 라디오 링 — 미선택: 회색 링 / 선택: 초록 채움 + 흰 점 */
.diag-chip::before {
  content: ""; width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid #c6d0d8; background: #fff;
  transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
}
.diag-chip:hover {
  border-color: var(--green); background: var(--green-tint); color: var(--green-deep); box-shadow: none;
}
.diag-chip:hover::before { border-color: var(--green); }
.diag-chip:active { transform: translateY(1px); }
.diag-chip.picked {
  border-color: var(--green); background: var(--green-tint); color: var(--green-deep);
}
.diag-chip.picked::before {
  border-color: var(--green); background: var(--green);
  box-shadow: inset 0 0 0 3px #fff; /* 링 안 흰 점 = 라디오 선택 표시 */
}
.diag-grid.answered .diag-chip { cursor: default; opacity: 0.5; box-shadow: none; }
.diag-grid.answered .diag-chip.picked { opacity: 1; }

/* 리포트 카드 — 준비도·영역별 바·링크는 전부 로컬 룰 산출 */
.diag-card {
  margin-top: 10px; padding: 14px 16px; border: 1.5px solid var(--green-border);
  border-radius: 12px; background: #f7fcf9;
}
.diag-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.diag-score { display: flex; align-items: baseline; gap: 2px; color: var(--green-deep); }
.diag-score .num { font-size: 34px; font-weight: 800; line-height: 1; }
.diag-score .unit { font-size: 15px; font-weight: 700; }
.diag-title { display: flex; align-items: center; gap: 6px; font-size: 14.5px; font-weight: 700; color: var(--text); }
.diag-title svg { flex-shrink: 0; color: var(--green); }
.diag-note { margin-top: 3px; font-size: 12px; color: var(--text-3); }
.diag-radar { max-width: 380px; margin: 4px auto 10px; }
.diag-radar svg { display: block; width: 100%; height: auto; }
.diag-bar-row { display: flex; align-items: center; gap: 8px; margin: 5px 0; }
.diag-bar-label { width: 96px; flex-shrink: 0; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.diag-bar {
  flex: 1; height: 8px; border-radius: 999px; background: var(--border-soft); overflow: hidden;
}
.diag-bar-fill { display: block; height: 100%; border-radius: 999px; }
.diag-bar-fill.good { background: var(--green); }
.diag-bar-fill.warn { background: #f0a13a; }
.diag-bar-fill.bad { background: #e5484d; }
.diag-bar-pct { width: 34px; flex-shrink: 0; text-align: right; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.diag-risk { margin-top: 10px; font-size: 13px; font-weight: 600; color: #b25f00; }
.diag-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

/* --- 입력창 카드 (아트보드 2 — placeholder + 하단 액션 행) --- */
.composer { padding: 10px 24px calc(16px + env(safe-area-inset-bottom, 0px)); }
.composer-notice { max-width: var(--content-w); margin: 0 auto 8px; color: var(--text-2); font-size: 16px; font-weight: 700; line-height: 1.6; text-align: center; word-break: keep-all; }
.composer-card {
  max-width: var(--content-w); margin: 0 auto; background: var(--surface);
  border: 1px solid var(--border); border-radius: 16px; padding: 13px 14px 10px;
  box-shadow: var(--shadow-card);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.composer-card:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(43, 182, 115, 0.12);
}
.composer-card textarea {
  width: 100%; border: none; resize: none; outline: none; background: transparent;
  font-family: inherit; font-size: 15px; line-height: 1.55; color: var(--text);
  max-height: 160px; padding: 0 2px;
}
.composer-card textarea::placeholder { color: var(--text-3); }
.composer-card textarea:disabled { cursor: not-allowed; opacity: 0.6; }
.composer-row { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.ghost-btn {
  display: inline-flex; align-items: center; gap: 6px; background: none; border: none;
  border-radius: 8px; padding: 6px 8px; font-size: 13.5px; font-weight: 600; color: var(--text);
}
.ghost-btn:hover { background: #f0f4f5; }
.ghost-btn svg { width: 16px; height: 16px; }

/* 히어로(새 대화 화면) 모드 — 입력창이 인사 블록 안으로 이동했을 때의 모습 */
.composer.hero { padding: 0; }
.composer.hero .composer-notice { display: none; }
.composer.hero .composer-card { max-width: none; padding: 18px; border-color: #dce4de; border-radius: 18px; box-shadow: 0 4px 18px rgba(31, 70, 48, 0.05); }
.composer.hero .composer-card:focus-within { border-color: #adcdb9; box-shadow: 0 4px 18px rgba(31, 70, 48, 0.07); }
.composer.hero .send-btn { width: 40px; height: 40px; border-radius: 12px; }
.composer.hero .composer-card textarea { display: block; min-height: 24px; }
.composer.hero .ghost-btn { display: none; }

.send-btn {
  width: 42px; height: 34px; border-radius: 9px; border: none;
  background: var(--green); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  margin-left: auto; /* composer-row의 남은 자식이 이 버튼 하나뿐이어도 우측 유지 */
}
.send-btn:hover { background: var(--green-hover); }
.send-btn.stop { background: var(--pill-dark); }
.send-btn svg { width: 18px; height: 18px; }

/* ===================== 출처 패널 (아트보드 5) ===================== */
.source-panel {
  width: 340px; flex-shrink: 0; background: var(--surface);
  border-left: 1px solid var(--border); display: none; flex-direction: column;
  animation: slideIn 0.2s ease;
}
.source-panel.open { display: flex; }
.source-panel header {
  padding: 15px 16px; border-bottom: 1px solid var(--border-soft);
  display: flex; align-items: center; justify-content: space-between;
}
.source-panel header .t { font-weight: 700; font-size: 15px; }
.source-panel .close-btn {
  width: 32px; height: 32px; background: none; border: none; border-radius: 8px;
  color: var(--text-3); display: inline-flex; align-items: center; justify-content: center;
}
.source-panel .close-btn:hover { color: var(--text-2); background: var(--border-soft); }
.source-panel .close-btn svg { width: 18px; height: 18px; }
.source-panel .body { flex: 1; overflow-y: auto; padding: 14px; }
.src-item {
  padding: 13px 14px; border: 1px solid var(--border-soft); border-radius: 12px; margin-bottom: 10px;
}
.src-item .src-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.src-item .filename {
  flex: 1; min-width: 0; font-weight: 600; font-size: 13.5px; color: var(--text); word-break: break-word;
}
.src-item .pages { margin-top: 6px; font-size: 12px; color: var(--text-2); }
.src-empty { color: var(--text-3); font-size: 13px; text-align: center; margin-top: 28px; }

/* ===================== 세션 만료 오버레이 ===================== */
.session-modal {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45);
  display: flex; align-items: center; justify-content: center; z-index: 9999;
}
.session-box {
  background: var(--surface); border-radius: var(--radius); padding: 28px 32px; max-width: 420px;
  text-align: center; box-shadow: var(--shadow-pop);
}
.session-msg { font-size: 15px; color: var(--text); line-height: 1.6; margin-bottom: 18px; }
.session-link {
  display: inline-block; background: var(--green); color: #fff; text-decoration: none;
  border-radius: 10px; padding: 10px 22px; font-weight: 600; font-size: 14px;
}
.session-link:hover { background: var(--green-hover); }

/* ===================== 애니메이션 ===================== */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes slideIn { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }

/* ===================== 모바일 (≤820px) — 아트보드 7·8·9 ===================== */
@media (max-width: 820px) {
  /* 사이드바 → 우측 드로어 */
  .sidebar {
    position: fixed; top: 0; right: 0; bottom: 0; width: min(320px, 86vw);
    border-right: none; border-left: 1px solid var(--border);
    transform: translateX(100%); transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
    z-index: 60;
  }
  .sidebar.open { transform: none; box-shadow: var(--shadow-pop); }
  .drawer-close { display: inline-flex; }
  .rail-history { display: none !important; }

  /* 모바일 전용 헤더 */
  .mobile-header { display: flex; }
  .mobile-header .brand img { height: 24px; }

  .topbar { padding: 10px 14px 0; }
  .fs-label { font-size: 11px; }
  .fs-btn { width: 26px; height: 24px; }

  .messages { padding: 16px 14px 8px; }
  .msg-row { margin-bottom: 12px; }
  .bubble { max-width: 88%; }

  .hero-title { font-size: 24px; gap: 0 5px; }
  .greeting { padding: 6px 0 24px; }
  .hero-sub { font-size: 13px; }
  .hero-divider { margin-top: 28px; }
  .hero-diag-block { margin-top: 26px; }
  .hero-diag-h, .hero-h { font-size: 17px; }
  .hero-diag-row { grid-template-columns: 1fr; gap: 9px; }
  .hero-diag-card, .hero-playground-card { padding: 14px; }
  .svc-topics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .svc-chip { gap: 6px; padding: 8px; }
  .svc-arrow { display: none; }
  .composer.hero .composer-card { padding: 14px; }
  .composer.hero .composer-card textarea { min-height: 46px; }
  body.hero-on .messages { padding-top: 16px; }
  .stage-flow { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 12px; }
  .stage-path { display: none; }
  .stage-chip:nth-of-type(even) { margin-top: 0; }
  .stage-chip-icon { width: 48px; height: 48px; }
  .stage-chip small { max-width: 160px; }
  .hero-disclaimer { margin-top: 30px; }

  .composer { padding: 8px 14px calc(12px + env(safe-area-inset-bottom, 0px)); }

  .nextstep-card { padding: 11px 12px; }
  .diag-card { padding: 12px; }

  /* 출처 패널 → 전체 오버레이 시트 */
  .source-panel {
    position: fixed; top: 0; right: 0; bottom: 0; width: min(360px, 92vw);
    z-index: 70; box-shadow: var(--shadow-pop);
  }
}

/* 모션 최소화 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* 3지표 세트(farmingV5) 머리 — 총점 링 대신 마음/정착/실행 3값 */
.diag-score-3 { display: flex; flex-direction: column; gap: 4px; min-width: 128px; }
.diag-score-3 .ind { display: flex; align-items: baseline; gap: 6px; }
.diag-score-3 .ind b { font-size: 22px; font-weight: 800; color: var(--green-deep); line-height: 1.1; }
.diag-score-3 .ind b::after { content: "%"; font-size: 12px; font-weight: 700; }
.diag-score-3 .ind em { font-style: normal; font-size: 12px; color: var(--text-2); }

/* 진단 질문 버블 — 일반 답변보다 1px 크고 진하게 */
.bubble.assistant.diag-question { font-size: 15.5px; font-weight: 600; }

/* 최근 채팅 제목 행 — 전체 삭제 버튼 */
.sb-title-row { display: flex; align-items: center; justify-content: space-between; margin: 0 4px 10px; }
.sb-title-row .sb-title { margin: 0; }
.sb-clear { border: none; background: none; font-size: 11.5px; font-weight: 600; color: var(--text-3); padding: 2px 4px; border-radius: 6px; }
.sb-clear:hover { color: #e5484d; background: #fdf0f0; }

/* ===================== 귀농귀촌 놀이터 (재미 테스트) ===================== */
/* 오버레이 — 채팅 흐름과 독립된 모달 (목록 → 문항 → 결과) */
.pg-overlay {
  position: fixed; inset: 0; background: rgba(15, 23, 20, 0.45);
  display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 9990;
}
.pg-box {
  position: relative; width: min(460px, 100%); max-height: min(640px, 92vh); overflow-y: auto;
  background: var(--surface); border-radius: 18px; padding: 26px 24px 22px;
  box-shadow: var(--shadow-pop); animation: fadeUp 0.18s ease both;
}
.pg-close {
  position: absolute; top: 12px; right: 12px; width: 34px; height: 34px;
  border: none; background: none; border-radius: 10px; color: var(--text-3);
  display: flex; align-items: center; justify-content: center;
}
.pg-close:hover { background: var(--border-soft); color: var(--text); }
.pg-close svg { width: 18px; height: 18px; }
.pg-eyebrow { display: inline-flex; align-items: center; font-size: 12px; font-weight: 800; color: var(--green); }
.pg-h { margin-top: 8px; font-size: 20px; font-weight: 800; color: var(--text); }
.pg-sub { margin-top: 6px; font-size: 13.5px; color: var(--text-2); }

/* 테스트 목록 카드 */
.pg-list { margin-top: 18px; display: grid; gap: 10px; }
.pg-test {
  display: flex; align-items: center; gap: 14px; text-align: left;
  border: 1px solid var(--border); border-radius: 14px; padding: 15px 16px;
  background: var(--surface); transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.pg-test:hover { border-color: var(--green); background: #f7fcf9; transform: translateY(-1px); }
.pg-test-icon {
  width: 42px; height: 42px; border-radius: 12px; background: var(--green-tint);
  color: var(--green-deep); display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  font-size: 21px; line-height: 1;
}
.pg-test-icon svg { width: 21px; height: 21px; }
.pg-test-info { flex: 1; min-width: 0; }
.pg-test-info strong { display: block; font-size: 15px; color: var(--text); }
.pg-test-info span { display: block; margin-top: 3px; font-size: 12.5px; color: var(--text-2); line-height: 1.5; word-break: keep-all; }
.pg-test em { font-style: normal; flex-shrink: 0; font-size: 12px; font-weight: 600; color: var(--text-3); }

/* 문항 화면 */
.pg-progress { display: flex; gap: 5px; margin-top: 12px; }
.pg-progress i { flex: 1; height: 4px; border-radius: 999px; background: var(--border-soft); }
.pg-progress i.done { background: var(--green); }
.pg-q { margin-top: 16px; font-size: 17px; font-weight: 700; line-height: 1.5; color: var(--text); word-break: keep-all; }
.pg-count { margin-top: 6px; font-size: 12px; color: var(--text-3); font-weight: 600; }
.pg-opts { margin-top: 14px; display: grid; gap: 8px; }
.pg-opt {
  border: 1px solid var(--border); background: var(--surface); border-radius: 12px;
  padding: 13px 14px; font-size: 14px; font-weight: 600; color: var(--text); text-align: left;
  transition: border-color 0.12s, background 0.12s, transform 0.08s;
}
.pg-opt:hover { border-color: var(--green); background: var(--green-tint); color: var(--green-deep); }
.pg-opt:active { transform: translateY(1px); }

/* 결과 화면 */
.pg-result { text-align: center; }
.pg-badge {
  width: 64px; height: 64px; margin: 6px auto 0; border-radius: 50%;
  background: var(--green-tint); color: var(--green-deep);
  display: flex; align-items: center; justify-content: center; font-size: 27px; font-weight: 800;
}
.pg-emoji { margin-top: 6px; font-size: 46px; line-height: 1.2; }
.pg-result h3 { margin-top: 14px; font-size: 21px; font-weight: 800; color: var(--text); word-break: keep-all; }
.pg-code {
  display: inline-block; margin-top: 10px; padding: 4px 13px; border-radius: 999px;
  background: var(--green-tint); color: var(--green-deep);
  font-size: 13px; font-weight: 800; letter-spacing: 0.05em;
}
.pg-tagline { margin-top: 14px; font-size: 15.5px; font-weight: 700; color: var(--text); }
.pg-result p { margin-top: 10px; font-size: 14px; line-height: 1.75; color: var(--text-2); word-break: keep-all; }
.pg-sec { margin: 22px 0 9px; font-size: 13px; font-weight: 800; color: var(--text-2); }
.pg-result-note { margin-top: 10px; font-size: 12px; color: var(--text-3); }

/* 촌 성향 축 바 — 왼쪽 성향 %만큼 마커 이동 */
.pg-axes { display: grid; gap: 11px; text-align: left; }
.pg-axis { display: flex; align-items: center; gap: 9px; }
.ax-name { flex: 0 0 88px; font-size: 12px; font-weight: 700; color: var(--text-2); }
.ax-name.right { flex: 0 0 88px; text-align: right; }
.ax-name b { font-size: 13px; color: var(--text); font-variant-numeric: tabular-nums; }
.ax-track {
  position: relative; flex: 1; height: 6px; border-radius: 999px;
  background: linear-gradient(90deg, #bfe6cf 0%, #bfe6cf 50%, #e7ebef 50%, #e7ebef 100%);
}
.ax-track i {
  position: absolute; top: 50%; width: 14px; height: 14px; transform: translate(-50%, -50%);
  border-radius: 50%; background: var(--surface); border: 3px solid var(--green); box-sizing: border-box;
}

/* 키워드 칩 / 어울리는 하루 / AI 추천질문 */
.pg-kws { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.pg-kws span {
  padding: 5px 12px; border-radius: 999px; background: var(--green-tint);
  color: var(--green-deep); font-size: 12.5px; font-weight: 700;
}
.pg-day {
  text-align: left; padding: 12px 14px; border-radius: 10px;
  background: #f7fcf9; border: 1px solid var(--green-border);
  font-size: 13.5px; line-height: 1.7; color: var(--text-2); word-break: keep-all;
}
.pg-asks { display: grid; gap: 8px; text-align: left; }
.pg-ask {
  border: 1px solid var(--green-border); background: var(--surface); border-radius: 10px;
  padding: 11px 13px; font-size: 13.5px; font-weight: 600; color: var(--text); text-align: left;
  transition: border-color 0.12s, background 0.12s;
}
.pg-ask:hover { background: var(--green-tint); color: var(--green-deep); border-color: var(--green); }

.pg-actions { margin-top: 18px; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.pg-btn {
  border-radius: 999px; padding: 9px 16px; font-size: 13.5px; font-weight: 700;
  border: 1px solid var(--green-border); background: var(--surface); color: var(--green-deep);
}
.pg-btn:hover { background: var(--green-tint); }
.pg-btn.primary { background: var(--green); border-color: var(--green); color: #fff; }
.pg-btn.primary:hover { background: var(--green-hover); }

@media (max-width: 820px) {
  .pg-box { padding: 22px 18px 18px; }
}

/* ===================== 도움말 · 이용안내 오버레이 ===================== */
button.foot-link { border: none; background: none; }
.hlp-box { width: min(740px, 100%); }
/* 데스크톱(>820px): 상단 안내 카드 2장을 나란히 — 줄 길이는 좁은 채로 레이어만 크게 */
@media (min-width: 821px) {
  .hlp-box { display: grid; grid-template-columns: 1fr 1fr; column-gap: 12px; align-items: stretch; max-height: min(760px, 92vh); }
  .hlp-box > .pg-eyebrow, .hlp-box > .pg-h, .hlp-box > .hlp-det, .hlp-box > .hlp-more { grid-column: 1 / -1; }
  .hlp-card { margin-top: 16px; }
  .hlp-card.hlp-intro, .hlp-card.hlp-remember { grid-column: 1 / -1; } /* 서비스 소개·마무리 당부는 전체 폭 */
}
.hlp-card { margin-top: 14px; background: var(--bg); border-radius: 12px; padding: 14px 16px; }
.hlp-card h3 { font-size: 14.5px; font-weight: 800; color: var(--text); }
.hlp-card ul, .hlp-det ul { list-style: none; margin-top: 8px; }
.hlp-card li, .hlp-det li {
  position: relative; padding-left: 14px; margin: 5px 0;
  font-size: 13.5px; line-height: 1.65; color: var(--text-2); word-break: keep-all;
}
.hlp-card li::before, .hlp-det li::before {
  content: ""; position: absolute; left: 1px; top: 0.62em;
  width: 5px; height: 5px; border-radius: 50%; background: var(--green);
}
/* 마무리 당부 카드 — 연한 그린 강조 */
.hlp-card.hlp-remember { background: var(--green-tint); border: 1px solid var(--green-border); }
/* FAQ 답변 중첩 목록 — 질문(strong) 아래 들여쓰기 + 가는 불릿 */
.hlp-det li ul { margin: 4px 0 2px; }
.hlp-det li li { margin: 3px 0; font-size: 12.5px; }
.hlp-det li li::before { width: 4px; height: 4px; top: 0.68em; background: var(--green-border); }
.hlp-card strong, .hlp-det strong { color: var(--text); font-weight: 700; }
.hlp-card em { font-style: normal; color: var(--green-deep); font-weight: 600; }
.hlp-det { margin-top: 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.hlp-det summary {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 13px 16px; cursor: pointer; list-style: none;
  font-size: 14px; font-weight: 700; color: var(--text);
}
.hlp-det summary::-webkit-details-marker { display: none; }
.hlp-det summary svg { flex: none; width: 16px; height: 16px; color: var(--text-3); transition: transform 0.15s; }
.hlp-det[open] summary { color: var(--green-deep); border-bottom: 1px solid var(--border-soft); }
.hlp-det[open] summary svg { transform: rotate(90deg); color: var(--green); }
.hlp-det[open] ul { padding: 6px 16px 13px; }
.hlp-more {
  margin-top: 16px; display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 13px; font-weight: 600; color: var(--green-deep); text-decoration: none;
}
.hlp-more:hover { text-decoration: underline; }
.hlp-more svg { width: 14px; height: 14px; }

/* ===================== 촌BTI 대화창 진행(자가진단 위저드 방식) ===================== */
/* 질문 버블 + 2택 보기 — 보기 카드는 .pg-opt(오버레이) 스타일 재사용 */
.bubble.assistant.bti-question { font-size: 15px; }
.bti-count { display: block; font-size: 11.5px; font-weight: 700; color: var(--green); margin-bottom: 4px; }
.bti-qtext { font-weight: 700; margin: 0; }
.bti-opts { display: grid; gap: 8px; margin-top: 10px; min-width: 300px; }
.bti-opts .pg-opt:disabled { opacity: 0.45; cursor: default; }
.bti-opts .pg-opt.picked { border-color: var(--green); background: var(--green-tint); color: var(--green-deep); }
.bti-opts .pg-opt.picked:disabled { opacity: 1; }

/* 결과 카드 — 유형/축/키워드는 로컬 확정, AI 해석 섹션은 스트리밍으로 채워진다 */
.bti-report {
  position: relative; /* 카드 우측 상단 이미지 저장 버튼(.card-dl)의 앵커 */
  max-width: 620px; margin: 0 auto; padding: 26px 26px 22px;
  background: var(--surface); border: 1px solid var(--green-border);
  border-radius: 16px; box-shadow: var(--shadow-card); text-align: center;
  animation: fadeUp 0.18s ease both;
}
/* 이미지 저장 버튼 — 캡처 클론에서는 onclone 으로 숨겨진다 */
.card-dl {
  position: absolute; top: 12px; right: 12px; z-index: 1;
  border: 1px solid var(--green-border); background: var(--surface); color: var(--green-deep);
  border-radius: 999px; padding: 6px 12px; font-size: 12px; font-weight: 700;
}
.card-dl:hover { background: var(--green-tint); }
.card-dl:disabled { opacity: 0.6; cursor: default; }
.bti-emoji { font-size: 44px; line-height: 1.2; }
.bti-type-visual { display: flex; justify-content: center; width: 100%; margin-bottom: 14px; }
.bti-type-image { display: block; width: min(340px, 100%); height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 20px; }
@media (max-width: 820px) { .bti-type-image { width: min(280px, 100%); } }
.bti-name { margin-top: 6px; font-size: 21px; font-weight: 800; color: var(--text); }
.bti-report .pg-code { margin-top: 10px; }
.bti-tagline { margin-top: 12px; font-size: 15px; font-weight: 700; color: var(--text); }
.bti-desc { margin-top: 10px; font-size: 14px; line-height: 1.75; color: var(--text-2); word-break: keep-all; }
.bti-axes { margin-top: 14px; display: grid; gap: 11px; }
.bti-report .pg-axis { max-width: 430px; width: 100%; margin: 0 auto; }
.bti-report .pg-kws { margin-top: 14px; }
.bti-ai { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border-soft); text-align: left; }
.bti-ai-title { font-size: 14px; font-weight: 800; color: var(--text); }
.bti-ai-body { margin-top: 10px; font-size: 14px; line-height: 1.8; color: #293d54; }
.bti-ai-body h3 { margin: 18px 0 6px; font-size: 15px; color: #1f5140; }
.bti-ai-body h3:first-child { margin-top: 2px; }
.bti-ai-body p { margin: 0 0 8px; word-break: keep-all; }
.bti-ai-err { color: var(--text-3); font-size: 13px; }

/* ===================== 촌생존력 결과 카드(.bti-report 셸 재사용, 차이만 오버라이드) ===================== */
.sv-report { text-align: center; }
.sv-head { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.sv-emoji { font-size: 46px; line-height: 1.2; }
.sv-score { margin: 2px 0 0; font-size: 15px; color: var(--text-2); }
.sv-score b { font-size: 24px; font-weight: 800; color: var(--green-deep); }
.sv-level { margin: 0; font-size: 20px; font-weight: 800; color: var(--text); }
.sv-bars { margin-top: 18px; display: grid; gap: 9px; max-width: 430px; width: 100%; margin-left: auto; margin-right: auto; }
.sv-bar { display: grid; grid-template-columns: 118px 1fr 30px; align-items: center; gap: 10px; }
.sv-bar-label { font-size: 13px; font-weight: 700; color: var(--text); text-align: left; white-space: nowrap; }
.sv-bar-track { display: block; height: 8px; border-radius: 999px; background: var(--border-soft); overflow: hidden; }
.sv-bar-track i { display: block; height: 100%; border-radius: inherit; background: var(--green); }
.sv-bar-num { font-size: 13px; font-weight: 800; color: var(--green-deep); text-align: right; }
.sv-badge {
  display: inline-block; margin-top: 14px; padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--green-border); background: var(--green-tint);
  font-size: 13px; font-weight: 800; color: var(--green-deep);
}
.sv-ai-body .sv-headline { font-size: 15.5px; font-weight: 800; color: #1f5140; }
.sv-ai-body .sv-summary { color: #293d54; }
.sv-ai-sec { margin-top: 16px; }
.sv-ai-sec h5 { margin: 0 0 8px; font-size: 14px; font-weight: 800; color: var(--text); }
.sv-ai-item { padding: 10px 12px; border: 1px solid var(--border-soft); border-radius: 12px; background: var(--surface); }
.sv-ai-item + .sv-ai-item { margin-top: 8px; }
.sv-ai-item b { display: block; font-size: 13.5px; color: var(--text); }
.sv-ai-item p { margin: 4px 0 0; font-size: 13.5px; line-height: 1.7; color: var(--text-2); word-break: keep-all; }
.sv-item {
  display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px;
  border: 1px solid var(--green-border); border-radius: 12px; background: var(--green-tint);
}
.sv-item-emoji { font-size: 28px; line-height: 1.2; }
.sv-item b { display: block; font-size: 14px; color: var(--green-deep); }
.sv-item p { margin: 4px 0 0; font-size: 13.5px; line-height: 1.7; color: var(--text-2); word-break: keep-all; }
@media (max-width: 820px) {
  .sv-bar { grid-template-columns: 104px 1fr 26px; gap: 8px; }
  .sv-bar-label { font-size: 12px; }
}
