/* =====================================================================
   chat.css — 말풍선 절 (파트너 문의 pages/partner.html + 홈 index.html 공통, 2026-10-06 chat-section 가지)
   시안: docs/design/chat_section.html(말풍선 네 장면) · docs/design/partner_chat.html(요금 문답·학생 한 명 값 대화)
   움직임은 js/common/chat.js: 화면에 보이면(.ch-group, 20~35%) 말풍선마다 data-d(밀리초) 간격으로 .on → 나타남, 다시 숨기지 않음
   - JS가 없거나 움직임 줄이기 설정이면 처음부터 다 보임 (숨기는 규칙은 html.ch-js일 때만)
   화면 디자인 규칙대로: 색은 theme.css 변수만 (점점 진해지는 파랑은 --acc와 --bg를 섞음 — color-mix), 글자 42·22·18·15·13·11px, 간격 8px 배수
   목차: 1) 말풍선  2) 장면(두 칸)·판정·열두 칩·검은 상자  3) 7년 맺음  4) 대화(왼쪽 sticky 제목)·연한 띠  5) 흐름 한 줄(홈)  6) 좁은 화면
   ===================================================================== */

/* ---------- 1) 말풍선 ---------- */
.ch-b { max-width: 86%; padding: 16px; border-radius: 10px; font-size: 15px; line-height: 1.6; margin-bottom: 8px; position: relative; }
.ch-js [data-d] { transition: opacity .28s ease, transform .28s cubic-bezier(.2, .7, .2, 1); }
.ch-js [data-d]:not(.on) { opacity: 0 !important; transform: translateY(14px) scale(.98); }
/* 왼쪽(강사가 AI·조교에게): 회색 — 아래로 갈수록 흐려짐 (힘 없는 질문) */
.ch-q { background: var(--bg2); color: var(--ink2); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.ch-q::before { content: ""; position: absolute; left: -7px; bottom: 0; width: 14px; height: 14px; background: var(--bg2); border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); clip-path: polygon(0 100%, 100% 100%, 100% 0); transform: skewX(20deg); }
.ch-q.d1 { opacity: .9; }
.ch-q.d2 { opacity: .75; }
.ch-q.d3 { opacity: .6; }
/* 오른쪽(퀘스핀): 파랑 — 아래로 갈수록 진해짐 */
.ch-a { margin-left: auto; background: var(--accbg); color: var(--ink); border-bottom-right-radius: 4px; }
.ch-a b { color: var(--acc2); font-weight: 700; }
.ch-a.l1 { background: color-mix(in srgb, var(--acc) 7%, var(--bg)); }
.ch-a.l2 { background: color-mix(in srgb, var(--acc) 15%, var(--bg)); }
.ch-a.l3 { background: color-mix(in srgb, var(--acc) 26%, var(--bg)); }
.ch-a.l4, .ch-a.hi { background: var(--acc); color: var(--bg); font-weight: 600; }
.ch-a.l4 b, .ch-a.hi b { color: var(--bg); }

/* ---------- 2) 장면: 왼쪽 질문 · 오른쪽 답 ---------- */
h2.ch-title { font-size: 42px; line-height: 1.22; font-weight: 900; letter-spacing: -0.045em; margin: 16px 0; }
.ch-sub { max-width: 720px; margin: 0 0 48px; font-size: 15px; line-height: 1.7; color: var(--muted); }
.ch-chat { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: start; }
.ch-chat + .ch-chat { margin-top: 96px; }
.ch-cap { font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.ch-cap b { color: var(--ink); font-weight: 700; }
.ch-verdict { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 18px; font-weight: 700; line-height: 1.5; letter-spacing: -0.02em; }
.ch-verdict em { font-style: normal; color: var(--acc); }
.ch-verdict small { display: block; font-size: 13px; font-weight: 400; color: var(--muted); margin-top: 8px; }
.ch-wide { grid-column: 1 / -1; }
/* 열두 칩: 줄바꿈으로 흐름 */
.ch-ask { display: flex; flex-wrap: wrap; gap: 8px; }
.ch-ask .ch-b { max-width: none; margin: 0; }
/* 검은 상자 (열두 칩 아래 "그럴 필요 없습니다." · 학생 한 명 값의 강조 두 개) */
.ch-no { margin-top: 24px; padding: 24px; border-radius: 10px; background: var(--ink); color: var(--bg); font-size: 22px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.45; }
.ch-no small { display: block; font-size: 13px; font-weight: 400; color: color-mix(in srgb, var(--bg) 70%, transparent); margin-top: 8px; letter-spacing: 0; }

/* ---------- 3) 7년 맺음 ---------- */
.ch-close { margin-top: 96px; border-top: 1px solid var(--line); padding-top: 48px; display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: start; }
.ch-close h3 { font-size: 22px; line-height: 1.4; font-weight: 800; letter-spacing: -0.03em; margin: 16px 0 0; }
.ch-close h3 em { font-style: normal; color: var(--acc); }
.ch-close p { font-size: 15px; line-height: 1.85; color: var(--ink2); margin: 0 0 16px; }

/* ---------- 4) 대화: 왼쪽 sticky 제목 + 오른쪽 말풍선 (요금 문답·학생 한 명 값) ---------- */
.ch-talk { display: grid; grid-template-columns: 200px 1fr; gap: 48px; align-items: start; }
.ch-side { position: sticky; top: 96px; }
.ch-thread { max-width: 760px; }
.ch-thread .ch-b { max-width: 78%; }
.ch-who { font-size: 11px; color: var(--muted); margin: 16px 0 8px; }
.ch-who.r { text-align: right; }
.ch-fine { font-size: 13px; line-height: 1.7; color: var(--muted); margin-top: 16px; }
/* 연한 배경 띠 (페이지 상자 밖까지 꽉 채움 — 가로 스크롤 없이 border-image로) */
.ch-band { position: relative; margin-top: 96px; padding: 96px 0; border-image: conic-gradient(var(--bg2) 0 0) fill 0 // 0 100vmax; }
.ch-band::before, .ch-band::after { content: ""; position: absolute; left: 0; right: 0; height: 1px; border-image: conic-gradient(var(--line) 0 0) fill 0 // 0 100vmax; }
.ch-band::before { top: 0; }
/* 띠 바탕이 --bg2라 회색 질문 말풍선이 묻히므로, 띠 안에서는 질문 말풍선을 흰 바탕(--bg) + 테두리(--line)로 */
.ch-band .ch-q, .ch-band .ch-q::before { background: var(--bg); }
.ch-band::after { bottom: 0; }

/* ---------- 5) 흐름 한 줄 (홈: 첫 장면 아래 — AI → 내용만 → 원문 대조 → 프로그램이 정답) ---------- */
.ch-flow { margin-top: 48px; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; color: var(--muted); }
.ch-flow span { border: 1px solid var(--line); background: var(--bg); border-radius: 6px; padding: 8px 16px; font-size: 13px; font-weight: 700; color: var(--ink); }
.ch-flow span.on { border-color: var(--acc); background: var(--accbg); color: var(--acc2); }

/* ---------- 6) 좁은 화면: 질문 → 판정 → 답 세로로, 제목은 위로 ---------- */
@media (max-width: 900px) {
  .ch-chat, .ch-close, .ch-talk { grid-template-columns: 1fr; gap: 32px; }
  .ch-side { position: static; }
  h2.ch-title { font-size: 22px; }
  .ch-no { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .ch-js [data-d] { transition: none; }
}
