/* AI 강의 도우미 화면(/ai, /ai/week-NN). 대화 화면은 v3 "조용한 대화창"(아래 ── 대화 화면 v3 ──).
   색·서체는 form.css 의 브랜드 토큰(--canvas, --ink, --orange-action …)과 Pretendard 를 그대로 쓴다.
   방향: taste-skill 앱 화면 규칙의 editorial-greeting(.taste-skill/app/direction.json) — 가운데 열, 바탕에서 한 단계 밝은
   톤 패널(테두리·그림자 없음), 강조색은 행동(보내기·질문하기)과 근거 번호에만. 떠 있는 입력창만 그림자를 갖는다.

   틀: 머리글과 같은 좌우 여백 max(24px, 50vw - 620px) → 1280px 화면에서 내용 폭 1232px.
   대화 화면 1232 = 220(주차) + 32 + 628(대화) + 32 + 320(근거 구절)
   목록 화면 12열: 1232 = 12 × 76 + 11 × 32 → 열린 주차 8열(800) + 32 + 안내 4열(400) */

.f-aiPage {
  --ai-panel: #fffaf5;          /* 톤 패널: 바탕(--canvas)에서 한 단계 밝게 */
  --ai-card: #fffdfa;           /* 패널 안의 줄 카드: 한 단계 더 */
  --ai-card-edge: #ebe1d9;      /* 줄 카드 테두리: 패널보다 한 단계 진하게 */
  --ai-muted: #5f554e;          /* 보조 글자(--ink-muted), 바탕 위 4.5:1 이상 */
  --ai-frame: max(24px, 50vw - 620px);
  --ai-gap: 32px;
  --ai-radius: 20px;
  --ai-radius-inner: 14px;
  font-variant-numeric: tabular-nums;
}
.f-aiPage .f-scene { opacity: .12; }   /* 공용 배경 장식은 두되, 읽는 화면에서는 한 단계 낮춘다 */

.f-aiNowrap { white-space: nowrap; }
.f-aiSrOnly { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* 첫 화면 머리글의 메뉴 링크(공개 모드에서만) */
.f-aiNav { margin-left: auto; }
.f-aiNavLink {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 999px;
  background: var(--ink); color: #fff; font: 700 14px/1 Pretendard Variable, Pretendard, sans-serif; text-decoration: none;
}
.f-aiNavLink:hover { background: var(--orange-deep); }

/* 공통: 버튼·포커스 */
.f-aiPrimary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 22px; border: 0;
  border-radius: 999px; background: var(--orange-action); color: #fff; font: 700 15px/1 Pretendard Variable, Pretendard, sans-serif;
  text-decoration: none; cursor: pointer; transition: background .15s, transform .1s;
}
.f-aiPrimary:hover { background: var(--orange-deep); }
.f-aiPrimary:active { transform: translateY(1px); }
.f-aiPrimary:disabled { background: var(--line-strong); color: var(--ink); cursor: wait; }
.f-aiGhost {
  min-height: 36px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 999px; background: transparent;
  color: var(--ink); font: 600 14px/1 Pretendard Variable, Pretendard, sans-serif; cursor: pointer; transition: background .15s;
}
.f-aiGhost:hover { background: var(--ai-card); }
.f-aiPage :is(a, button, summary, textarea):focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* 제목 줄: 앱 화면의 h1(28px)과 회색 한 줄 */
.f-aiTitleRow h1 { margin: 0; font-size: 28px; line-height: 1.25; font-weight: 700; letter-spacing: -.01em; }
.f-aiLead { margin: 8px 0 0; color: var(--ai-muted); font-size: 16px; line-height: 1.6; }
.f-aiLead strong { color: var(--ink); font-weight: 700; }
.f-aiPreview {
  display: inline-block; margin: 12px 0 0; padding: 4px 10px; border-radius: 999px; background: var(--ink); color: #fff;
  font-size: 12px; font-weight: 600; line-height: 1.4;
}

/* ── 목록 화면 ─────────────────────────────────────────────────── */
.f-aiHome { padding: 40px var(--ai-frame) 72px; }
.f-aiHomeGrid {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--ai-gap); margin-top: 32px; align-items: start;
}
.f-aiOpen { grid-column: 1 / span 8; display: grid; gap: 16px; }
.f-aiWaiting { grid-column: 1 / -1; }
.f-aiAbout {
  grid-column: 9 / span 4; align-self: stretch; display: flex; flex-direction: column; padding: 32px 28px 24px;
  border-radius: var(--ai-radius); background: var(--ai-panel);
}
.f-aiAbout h2 { margin: 0; font-size: 16px; font-weight: 700; }
.f-aiAbout > ul { margin: 12px 0 0; padding-left: 18px; font-size: 15px; line-height: 1.6; }
.f-aiAbout > ul li + li { margin-top: 6px; }
.f-aiAbout .f-aiNotice { margin-top: auto; padding: 16px 0 0; background: none; border-radius: 0; }
.f-aiAbout .f-aiNotice summary { font-size: 14px; color: var(--ai-muted); }

.f-aiOpen .f-aiCoachCard {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 300px); gap: 32px; padding: 32px;
  border-radius: var(--ai-radius); background: var(--ai-panel);
}
.f-aiCoachMain h3 { margin: 0; font-size: 28px; line-height: 1.25; letter-spacing: -.01em; }
.f-aiCoachMain p { margin: 12px 0 0; font-size: 16px; line-height: 1.6; }
.f-aiCoachMain .f-aiCoachFacts { color: var(--ai-muted); font-size: 14px; }
.f-aiCoachAction { display: flex; flex-direction: column; justify-content: space-between; gap: 20px; }
.f-aiCoachAction .f-aiPrimary { align-self: flex-start; }
.f-aiCoachStarter {
  margin: 0; padding: 16px; border-radius: var(--ai-radius-inner); background: var(--ai-card); font-size: 15px; line-height: 1.55;
}
.f-aiCoachStarter span, .f-aiStarter span { display: block; margin-bottom: 4px; color: var(--ai-muted); font-size: 12px; font-weight: 600; }
.f-aiEmpty { margin: 0; padding: 24px; border: 1px dashed var(--line-strong); border-radius: var(--ai-radius); color: var(--ai-muted); }

.f-aiWaiting { padding: 24px; border-radius: var(--ai-radius); background: var(--ai-panel); }
.f-aiWaiting h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 16px; font-size: 16px; font-weight: 700; }
.f-aiCount {
  min-width: 22px; padding: 2px 7px; border-radius: 999px; background: var(--canvas); color: var(--ai-muted);
  font-size: 12px; font-weight: 600; text-align: center;
}
.f-aiWaiting ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.f-aiWaiting .f-aiCoachCard {
  display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; align-items: center; gap: 16px; min-height: 63px;
  padding: 10px 16px; border: 1px solid var(--ai-card-edge); border-radius: var(--ai-radius-inner); background: var(--ai-card);
  box-sizing: border-box;
}
.f-aiWaitingTitle { font-size: 15px; font-weight: 700; }
.f-aiWaitingScope { overflow: hidden; color: var(--ai-muted); font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.f-aiCoachState { color: var(--ai-muted); font-size: 13px; font-weight: 600; white-space: nowrap; }

.f-aiBack { margin: 24px 0 0; font-size: 14px; }
.f-aiBack a { color: var(--ai-muted); text-underline-offset: 3px; }
.f-aiBack a:hover { color: var(--ink); }

.f-aiClosed .f-aiCoachState { margin: 12px 0 0; font-size: 16px; }

/* 고지: 톤 패널 안의 접는 목록 */
.f-aiNotice { border-radius: var(--ai-radius); background: var(--ai-panel); padding: 16px 20px; }
.f-aiNotice summary { cursor: pointer; font-size: 15px; font-weight: 700; list-style-position: inside; }
.f-aiNotice ul { margin: 12px 0 0; padding-left: 18px; color: var(--ai-muted); font-size: 14px; line-height: 1.6; }
.f-aiNotice li + li { margin-top: 6px; }

/* ── 대화 화면 v3: 조용한 대화창 ──────────────────────────────────
   taste-skill 앱 화면 규칙(open-plane 셸): 사이드바는 바탕과 한 단계 차이 + 머리카락 선 한 줄, 강조색(주황)은
   보내기·근거 번호·지금 단계 점에만. 그림자는 떠 있는 것(입력창·근거 서랍·시트)에만. 제목 15px, 본문 16px.
   1440 화면: 260(사이드바) + 대화 열 760 가운데 + (근거를 열면) 400 서랍. 휴대폰: 48px 윗줄, 메뉴는 덮는 시트, 근거는 반 높이 시트. */
.f-aiApp {
  --ai-side: #efe8e1; --ai-bubble: #e8dfd6; --ai-edge: #e2d8cf; --ai-control: #cfc2b7; --ai-surface: #fffdfa;
  --ai-muted: #5f554e; --ai-faint: #6b6159; --ai-col: 760px; --ai-sheet: 50svh;
  display: grid; grid-template-columns: 260px minmax(0, 1fr) 0; grid-template-rows: minmax(0, 1fr); height: 100vh; height: 100svh; overflow: hidden;
  background: var(--canvas); color: var(--ink); font-variant-numeric: tabular-nums;
}
.f-aiApp[data-side="closed"] { grid-template-columns: 0 minmax(0, 1fr) 0; }
.f-aiApp[data-drawer="open"] { grid-template-columns: 260px minmax(0, 1fr) 400px; }
.f-aiApp[data-side="closed"][data-drawer="open"] { grid-template-columns: 0 minmax(0, 1fr) 400px; }
/* :where 로 낮춰 둔다(보내기 단추처럼 제 색이 있는 단추가 이긴다) */
:where(.f-aiApp) button { font: inherit; color: inherit; }
.f-aiApp :is(a, button, summary, textarea):focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.f-aiSrOnly { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* 상표: form.css .f-brandMark 와 같은 모양(주황 둥근 네모 + 흰 점 셋), 그림자 없이 */
.f-aiMark {
  --m: 28px; flex: none; display: inline-grid; grid-auto-flow: column; place-content: center; gap: calc(var(--m) * .1);
  width: var(--m); height: var(--m); border-radius: calc(var(--m) * .28); background: var(--orange-action);
}
.f-aiMark i { width: calc(var(--m) * .14); height: calc(var(--m) * .14); border-radius: 50%; background: #fff; }
.f-aiMark i:nth-child(2) { opacity: .8; }

.f-aiIconBtn {
  flex: none; display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 10px;
  background: transparent; color: var(--ai-muted); cursor: pointer;
}
.f-aiIconBtn:hover { background: #e6ddd4; color: var(--ink); }
.f-aiGhost {
  height: 34px; padding: 0 12px; border: 0; border-radius: 999px; background: transparent; color: var(--ai-muted);
  font-size: 13px; font-weight: 500; cursor: pointer;
}
.f-aiGhost:hover { background: #e6ddd4; color: var(--ink); }
.f-aiGhost[hidden] { display: none; }
.f-aiLink { padding: 0; border: 0; background: none; color: inherit; font-size: inherit; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }

/* 사이드바 */
.f-aiSide {
  display: flex; flex-direction: column; min-width: 0; overflow: hidden auto; padding: 12px 10px; background: var(--ai-side);
  border-right: 1px solid var(--ai-edge);
}
.f-aiApp[data-side="closed"] .f-aiSide { visibility: hidden; padding: 0; border: 0; }
.f-aiBrandRow { display: flex; align-items: center; gap: 6px; padding: 4px 4px 14px 6px; }
.f-aiBrand { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--ink); text-decoration: none; }
.f-aiBrand .f-aiMark { --m: 30px; }
.f-aiBrand b { display: block; color: var(--orange-deep); font-size: 12px; font-weight: 800; line-height: 1.2; }
.f-aiBrand span span { display: block; font-size: 14px; font-weight: 600; line-height: 1.3; white-space: nowrap; }
.f-aiSideClose { margin-left: auto; }
.f-aiNavList { display: flex; flex-direction: column; gap: 2px; }
.f-aiNavItem {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 36px; padding: 0 10px; border: 0; border-radius: 10px;
  background: transparent; color: var(--ink); font-size: 14px; line-height: 1.3; text-align: left; text-decoration: none; white-space: nowrap; cursor: pointer;
}
a.f-aiNavItem:hover, button.f-aiNavItem:hover { background: #e6ddd4; }
.f-aiNew { margin-bottom: 14px; font-weight: 600; }
.f-aiNavLabel { margin: 0; padding: 0 10px 6px; color: var(--ai-muted); font-size: 12px; }
.f-aiWeek[aria-current="page"] { background: #e4dad0; font-weight: 600; }
.f-aiWeek[aria-disabled="true"] { color: var(--ai-muted); cursor: default; }
.f-aiWeek small { margin-left: auto; color: var(--ai-faint); font-size: 12px; }
.f-aiSideFoot { margin-top: auto; padding-top: 8px; border-top: 1px solid var(--ai-edge); }
.f-aiSideScrim { display: none; }

/* 이용 안내(고지): 사이드바 아래에 접어 둔다 */
.f-aiSide .f-aiNotice { padding: 0; background: none; border-radius: 0; }
.f-aiSide .f-aiNotice summary {
  display: flex; align-items: center; min-height: 36px; padding: 0 10px; border-radius: 10px; font-size: 14px; font-weight: 400;
  list-style: none; cursor: pointer;
}
.f-aiSide .f-aiNotice summary::-webkit-details-marker { display: none; }
.f-aiSide .f-aiNotice summary::before { content: "ⓘ"; width: 16px; margin-right: 10px; color: var(--ai-muted); text-align: center; }
.f-aiSide .f-aiNotice summary:hover { background: #e6ddd4; }
.f-aiSide .f-aiNotice ul { margin: 6px 4px 10px; padding: 12px 14px 12px 28px; border-radius: 12px; background: var(--ai-surface); font-size: 13px; white-space: normal; }

/* 본문 열 */
.f-aiMain { position: relative; display: flex; flex-direction: column; min-width: 0; height: 100%; }
.f-aiTop { flex: none; display: flex; align-items: center; gap: 8px; height: 52px; padding: 0 12px; }
.f-aiTopStart { display: none; align-items: center; gap: 8px; }
.f-aiApp[data-side="closed"] .f-aiTopStart { display: flex; }
.f-aiTopMark { --m: 24px; }
.f-aiTitle { min-width: 0; margin: 0; overflow: hidden; font-size: 15px; font-weight: 600; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.f-aiTitle small { margin-left: 8px; color: var(--ai-muted); font-size: 13px; font-weight: 400; }
.f-aiTopEnd { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.f-aiPreview { padding: 4px 10px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 12px; font-weight: 600; white-space: nowrap; }

.f-aiScroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.f-aiCol { max-width: var(--ai-col); margin: 0 auto; padding: 8px 24px 28px; }
.f-aiMessages { display: flex; flex-direction: column; }

/* 질문: 오른쪽 말풍선 / 답: 상표 + 바탕 위 본문 */
.f-aiMessage { min-width: 0; font-size: 16px; line-height: 1.78; overflow-wrap: anywhere; }
.f-aiMessage[data-role="user"] {
  align-self: flex-end; max-width: 78%; margin: 28px 0 22px; padding: 11px 18px; border-radius: 22px 22px 6px 22px;
  background: var(--ai-bubble); line-height: 1.6;
}
.f-aiMessage[data-role="user"] p { margin: 0; }
.f-aiTurn { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 16px; margin-bottom: 8px; }
.f-aiTurn > .f-aiMark { margin-top: 3px; }
.f-aiMessage p, .f-aiMessage ul, .f-aiMessage ol, .f-aiMessage blockquote { margin: 0 0 14px; }
.f-aiMessage ul, .f-aiMessage ol { padding-left: 22px; }
.f-aiMessage li { margin: 0 0 6px; padding-left: 2px; }
.f-aiMessage li::marker { color: var(--ai-muted); }
.f-aiMessage strong { font-weight: 700; }
.f-aiMessage h3 { margin: 24px 0 8px; font-size: 17px; font-weight: 700; line-height: 1.4; }
.f-aiMessage > h3:first-child { margin-top: 0; }
.f-aiMessage blockquote { padding: 12px 16px; border-radius: 14px; background: var(--ai-surface); }
.f-aiTurn[data-status="no_evidence"] .f-aiMessage, .f-aiTurn[data-status="blocked"] .f-aiMessage,
.f-aiTurn[data-status="failed"] .f-aiMessage, .f-aiTurn[data-status="withdrawn"] .f-aiMessage { color: var(--ai-muted); }

.f-aiCites { display: inline-flex; gap: 3px; margin-left: 4px; white-space: nowrap; vertical-align: 2px; }
.f-aiCite {
  display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border: 0;
  border-radius: 5px; background: var(--orange-wash); color: var(--orange-action); font-size: 11px; font-weight: 700; line-height: 1; cursor: pointer;
}
.f-aiCite:hover { background: #ffe0cf; }
.f-aiCite[aria-pressed="true"] { background: var(--orange-action); color: #fff; }

/* 답 아래: 복사·도움됨·아쉬움(아이콘), 이어서 물어보기(칩) */
.f-aiAnswerBar { display: flex; align-items: center; gap: 2px; margin: -4px 0 12px -8px; }
.f-aiFeedback { display: flex; gap: 2px; }
.f-aiTool {
  display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 8px; background: transparent;
  color: var(--ai-muted); cursor: pointer;
}
.f-aiTool:hover { background: #e6ddd4; color: var(--ink); }
.f-aiTool[aria-pressed="true"] { background: var(--ink); color: #fff; }
.f-aiFollowups { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; }
.f-aiChip, .f-aiFollowup {
  display: inline-flex; align-items: center; min-height: 38px; padding: 8px 16px; border: 1px solid var(--ai-control); border-radius: 999px;
  background: transparent; color: var(--ink); font-size: 14px; line-height: 1.35; text-align: left; cursor: pointer;
}
.f-aiChip:hover, .f-aiFollowup:hover { background: var(--ai-surface); border-color: var(--ai-muted); }

/* 생각 중: 점 셋 + 조용한 단계 줄(자료 찾기 · 답 정리 · 근거 확인) */
.f-aiThinking { padding-top: 3px; }
.f-aiDots { display: inline-flex; align-items: center; gap: 5px; height: 24px; }
.f-aiDots i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink); animation: f-aiDot 1.2s ease-in-out infinite; }
.f-aiDots i:nth-child(2) { animation-delay: .15s; }
.f-aiDots i:nth-child(3) { animation-delay: .3s; }
@keyframes f-aiDot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.f-aiSteps { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0 0; padding: 0; list-style: none; color: var(--ai-faint); font-size: 13px; }
.f-aiSteps li + li::before { content: "·"; margin-right: 8px; color: var(--ai-control); }
.f-aiSteps li[data-state="done"] { color: var(--ai-muted); }
.f-aiSteps li[data-state="done"]::after { content: " ✓"; }
.f-aiSteps li[data-state="now"] { color: var(--ink); font-weight: 600; }
.f-aiSteps li[data-state="now"] > span::before {
  content: ""; display: inline-block; width: 6px; height: 6px; margin: 0 6px 2px 0; border-radius: 50%; background: var(--orange-action); vertical-align: middle;
}
.f-aiLive { display: flex; align-items: center; gap: 8px; margin: 2px 0 0; color: var(--ai-muted); font-size: 13px; }
.f-aiLive .f-aiDots { height: 12px; gap: 3px; }
.f-aiLive .f-aiDots i { width: 5px; height: 5px; }
.f-aiStopped { margin: 2px 0 0; color: var(--ai-muted); font-size: 13px; }

/* 아래: 입력창(유일하게 떠 있는 것)과 한 줄 고지 */
.f-aiDock { flex: none; padding: 0 24px 12px; }
.f-aiStatus { max-width: calc(var(--ai-col) - 48px); margin: 0 auto 8px; color: var(--ai-muted); font-size: 14px; text-align: center; }
.f-aiStatus:empty { display: none; }
.f-aiStatus[data-tone="error"] { color: var(--danger); }
.f-aiComposer {
  display: flex; align-items: flex-end; gap: 8px; max-width: calc(var(--ai-col) - 48px); margin: 0 auto; padding: 8px 8px 8px 22px;
  border: 1px solid var(--ai-edge); border-radius: 28px; background: var(--ai-surface);
  box-shadow: 0 10px 28px #2019151a; /* taste-skill-ignore: 떠 있는 입력창 */
}
.f-aiComposer:focus-within { border-color: var(--ai-muted); }
.f-aiComposer textarea {
  flex: 1; display: block; min-width: 0; height: 40px; max-height: 30vh; padding: 8px 0; border: 0; background: transparent; color: var(--ink);
  font: 400 16px/24px Pretendard Variable, Pretendard, sans-serif; resize: none; overflow-y: hidden;
}
.f-aiComposer textarea::placeholder { color: var(--ai-faint); }
.f-aiComposer textarea:focus { outline: none; }
.f-aiCounter { align-self: center; color: var(--ai-muted); font-size: 12px; white-space: nowrap; }
.f-aiCounter[hidden] { display: none; }
.f-aiSend {
  flex: none; display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%;
  background: var(--orange-action); color: #fff; cursor: pointer; transition: background .15s;
}
.f-aiSend:hover { background: var(--orange-deep); }
.f-aiSend:disabled { background: #d9cdc2; cursor: default; }
.f-aiSend .f-aiStopIcon { display: none; }
.f-aiSend[data-mode="stop"] { background: var(--ink); }
.f-aiSend[data-mode="stop"] .f-aiStopIcon { display: block; }
.f-aiSend[data-mode="stop"] .f-aiSendIcon { display: none; }
/* 내 사업 정보: 첫 화면에 펼치는 짧은 질문(최대 3개)과, 고칠 때 쓰는 작은 창. 같은 조용한 카드 모양. */
.f-aiIntake {
  display: grid; gap: 16px; width: min(100%, 560px); margin: 0 auto; padding: 20px 22px; border: 1px solid var(--ai-edge);
  border-radius: 20px; background: var(--ai-surface); text-align: left;
}
.f-aiIntakeLead { margin: 0; font-size: 16px; font-weight: 700; line-height: 1.4; }
.f-aiIntakeLead span { display: block; margin-top: 4px; color: var(--ai-muted); font-size: 13px; font-weight: 500; }
.f-aiIntakeRow { display: grid; gap: 8px; }
.f-aiIntakeQ { display: flex; align-items: baseline; gap: 8px; font-size: 14px; font-weight: 600; line-height: 1.45; }
.f-aiIntakeQ b {
  flex: none; display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--ai-side);
  border: 1px solid var(--ai-edge); color: var(--ai-muted); font-size: 11px; font-weight: 700;
}
.f-aiIntakeQ small { color: var(--ai-muted); font-size: 12px; font-weight: 500; }
.f-aiStageChips { display: flex; flex-wrap: wrap; gap: 8px; }
.f-aiStageChip[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: #fff; }
.f-aiIntake input[type="text"] {
  width: 100%; min-height: 42px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 12px; background: #fff;
  color: var(--ink); font: 500 15px/1.4 Pretendard Variable, Pretendard, sans-serif;
}
.f-aiIntake input[type="text"]::placeholder { color: #9a8f87; }
.f-aiIntake input[type="text"]:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
.f-aiIntakeActions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.f-aiIntakeSave {
  min-height: 40px; padding: 0 18px; border: 0; border-radius: 999px; background: var(--orange-action); color: #fff;
  font: 700 14px/1 Pretendard Variable, Pretendard, sans-serif; cursor: pointer;
}
.f-aiIntakeSave:disabled { opacity: .6; cursor: default; }
.f-aiProfileLine { margin: -8px auto 0; color: var(--ai-muted); font-size: 14px; line-height: 1.6; text-align: center; }
.f-aiProfileLabel { margin-right: 4px; padding: 2px 8px; border-radius: 999px; background: var(--ai-side); border: 1px solid var(--ai-edge); font-size: 12px; font-weight: 600; }
.f-aiProfileBtn { display: inline-flex; align-items: center; gap: 6px; }
.f-aiDialog { width: min(92vw, 560px); margin: auto; padding: 0; overflow: visible; border: 0; border-radius: 20px; background: transparent; }
.f-aiDialog::backdrop { background: rgba(38, 30, 25, .32); }
.f-aiDialog .f-aiIntake { box-shadow: 0 18px 48px rgba(38, 30, 25, .18); }
@media (max-width: 760px) {
  .f-aiTopEnd .f-aiGhost.f-aiProfileBtn { display: inline-flex; width: 40px; min-height: 40px; padding: 0; justify-content: center; border-color: transparent; }
  .f-aiProfileBtn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .f-aiIntake { padding: 18px 16px; }
}

.f-aiHello[data-compact] { padding-bottom: 18px; }
/* 첫 화면에 사업 정보 질문이 펼쳐져 있으면 입력창을 아래로 붙이고 질문 칸에 자리를 준다(질문 칩은 건너뛴 뒤에 보인다). */
.f-aiMain[data-empty][data-intake] .f-aiScroll { flex: 1 1 auto; }
.f-aiMain[data-empty][data-intake] .f-aiDock { flex: 0 0 auto; padding-bottom: 44px; }
.f-aiHello[data-compact] h2 { margin: 12px 0 0; font-size: 24px; }
.f-aiHello[data-compact] .f-aiMark { --m: 36px; }
/* 음성 받아적기: 보내기 옆의 조용한 원형 단추. 듣는 동안은 오렌지 점이 천천히 숨 쉰다(움직임 줄이기면 멈춤). */
.f-aiMic {
  position: relative; flex: none; display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%;
  background: transparent; color: var(--ai-muted); cursor: pointer; transition: background .15s, color .15s;
}
.f-aiMic[hidden] { display: none; }
.f-aiMic:hover { background: var(--ai-bubble); color: var(--ink); }
.f-aiMic:focus-visible { outline: 2px solid var(--ai-muted); outline-offset: 2px; }
.f-aiMic[data-state="listening"] { background: #fbe9dc; color: var(--orange-deep); }
.f-aiMic[data-state="listening"]::after {
  content: ""; position: absolute; top: 7px; right: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--orange-action);
  animation: f-aiMicPulse 1.4s ease-in-out infinite;
}
@keyframes f-aiMicPulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.7); } }
@media (prefers-reduced-motion: reduce) { .f-aiMic[data-state="listening"]::after { animation: none; } }
.f-aiComposer textarea[data-interim="true"] { color: var(--ai-muted); }
.f-aiChips { display: none; }
.f-aiFine { max-width: calc(var(--ai-col) - 48px); margin: 8px auto 0; color: var(--ai-muted); font-size: 12px; line-height: 1.5; text-align: center; }

/* 첫 화면: 가운데 인사 + 입력창 + 질문 칩 */
.f-aiMain[data-empty] .f-aiScroll { flex: 1 1 0; display: flex; flex-direction: column; }
.f-aiMain[data-empty] .f-aiScroll > .f-aiCol { margin-top: auto; width: 100%; box-sizing: border-box; } /* 아래로 붙이되, 넘치면 위가 잘리지 않고 스크롤된다 */
.f-aiMain[data-empty] .f-aiDock { flex: 1 1 0; }
.f-aiMain[data-empty] .f-aiChips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 712px; margin: 18px auto 0; }
.f-aiMain[data-empty] .f-aiFine { position: absolute; left: 0; right: 0; bottom: 12px; padding: 0 24px; max-width: none; }
.f-aiHello { display: flex; flex-direction: column; align-items: center; padding: 0 0 28px; text-align: center; }
.f-aiHello .f-aiMark { --m: 48px; }
.f-aiHello h2 { margin: 18px 0 8px; font-size: 30px; font-weight: 700; line-height: 1.3; letter-spacing: -.02em; }
.f-aiHello p { max-width: 560px; margin: 0; color: var(--ai-muted); font-size: 15px; line-height: 1.6; }

/* 근거 서랍(데스크톱) — 휴대폰은 아래 반 높이 시트 */
.f-aiSources {
  display: flex; flex-direction: column; min-width: 0; overflow: hidden; background: var(--ai-surface); border-left: 1px solid var(--ai-edge);
  box-shadow: -12px 0 32px #2019150f; /* taste-skill-ignore: 떠 있는 서랍 */
}
.f-aiSources[hidden] { display: none; }
.f-aiSheetHandle { display: none; }
.f-aiSourceHead { display: flex; align-items: flex-start; gap: 12px; padding: 16px 16px 14px 24px; border-bottom: 1px solid var(--ai-edge); }
.f-aiSourceHead > div { flex: 1; min-width: 0; }
.f-aiSourceHead h2 { margin: 0; font-size: 16px; font-weight: 700; line-height: 1.45; }
.f-aiSourceNo {
  flex: none; display: inline-grid; place-items: center; min-width: 24px; height: 22px; margin-top: 2px; padding: 0 6px; border-radius: 6px;
  background: var(--orange-action); color: #fff; font-size: 12px; font-weight: 700;
}
.f-aiSourceMeta { margin: 2px 0 0; color: var(--ai-muted); font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.f-aiSourceBody { flex: 1; overflow-y: auto; padding: 20px 24px 24px; }
.f-aiQuote { margin: 0; padding: 16px 18px; border-radius: 14px; background: #f6efe8; font-size: 15px; line-height: 1.75; overflow-wrap: anywhere; }
.f-aiSourceBody h3 { margin: 26px 0 6px; color: var(--ai-muted); font-size: 13px; font-weight: 600; }
.f-aiSourceList { margin: 0; padding: 0; list-style: none; }
.f-aiSourceList button {
  display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 8px; width: 100%; padding: 10px 0; border: 0; border-top: 1px solid #efe6de;
  background: none; color: var(--ink); font-size: 14px; line-height: 1.45; text-align: left; cursor: pointer;
}
.f-aiSourceList button > span:first-child { padding-top: 2px; color: var(--orange-action); font-size: 12px; font-weight: 700; }
.f-aiSourceList small { display: block; margin-top: 2px; color: var(--ai-muted); font-size: 12px; }
.f-aiSourceFoot { margin: 18px 0 0; color: var(--ai-muted); font-size: 12px; }

/* 1100px 아래: 서랍을 열면 사이드바를 접은 것처럼 본문을 넓힌다 */
@media (max-width: 1100px) and (min-width: 761px) {
  .f-aiApp[data-drawer="open"] { grid-template-columns: 0 minmax(0, 1fr) 360px; }
  .f-aiApp[data-drawer="open"] .f-aiSide { visibility: hidden; padding: 0; border: 0; }
  .f-aiApp[data-drawer="open"] .f-aiTopStart { display: flex; }
}

/* 휴대폰 */
@media (max-width: 760px) {
  .f-aiApp, .f-aiApp[data-side], .f-aiApp[data-drawer="open"], .f-aiApp[data-side="closed"][data-drawer="open"] { grid-template-columns: minmax(0, 1fr); }
  .f-aiSide, .f-aiApp[data-side="closed"] .f-aiSide {
    position: fixed; inset: 0 auto 0 0; z-index: 30; width: min(300px, 86vw); padding: 12px 10px; visibility: hidden; border-right: 1px solid var(--ai-edge);
    transform: translateX(-100%); transition: transform .22s var(--ease-out), visibility 0s .22s;
  }
  .f-aiApp[data-side="open"] .f-aiSide { visibility: visible; transform: none; transition: transform .22s var(--ease-out); }
  .f-aiApp[data-side="open"] .f-aiSideScrim { display: block; position: fixed; inset: 0; z-index: 29; background: #20191552; }
  .f-aiTop { height: 48px; padding: 0 4px; border-bottom: 1px solid var(--ai-edge); }
  .f-aiTopStart, .f-aiApp[data-side="closed"] .f-aiTopStart { display: flex; }
  .f-aiTopMark { display: none; }
  .f-aiTitle { position: absolute; left: 56px; right: 56px; text-align: center; }
  .f-aiTitle small, .f-aiTopEnd .f-aiGhost { display: none; }
  .f-aiIconBtn { width: 44px; height: 44px; }
  .f-aiCol { padding: 4px 16px 16px; }
  .f-aiMessage[data-role="user"] { max-width: 86%; margin: 20px 0 16px; }
  .f-aiTurn { grid-template-columns: 24px minmax(0, 1fr); gap: 10px; }
  .f-aiTurn > .f-aiMark { --m: 24px; }
  .f-aiDock { padding: 0 12px 10px; }
  .f-aiComposer { padding-left: 18px; }
  .f-aiFineLong { display: none; }
  .f-aiMain[data-empty] .f-aiScroll { justify-content: flex-start; flex: 0 0 auto; padding-top: 10svh; }
  .f-aiMain[data-empty] .f-aiDock { flex: 1 1 auto; display: flex; flex-direction: column; }
  .f-aiMain[data-empty] .f-aiComposer { box-sizing: border-box; width: 100%; }
  .f-aiMain[data-empty] .f-aiChips { flex-direction: column; align-items: stretch; margin-top: 14px; }
  .f-aiMain[data-empty] .f-aiFine { position: static; margin-top: auto; padding: 12px 0 0; }
  .f-aiHello h2 { font-size: 24px; }
  /* 근거: 아래 반 높이 시트. 본문을 덮지 않게 대화 열 아래에 시트 높이만큼 여백을 두고, 흘러나오는 낱말은 시트 위로 따라 올린다 */
  .f-aiSources {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; height: var(--ai-sheet); border: 0; border-radius: 20px 20px 0 0;
    box-shadow: 0 -12px 32px #20191524; /* taste-skill-ignore: 떠 있는 시트 */
  }
  .f-aiSheetHandle { display: block; flex: none; width: 40px; height: 4px; margin: 8px auto 0; border-radius: 2px; background: var(--ai-control); }
  .f-aiSourceHead { padding: 8px 4px 10px 16px; }
  .f-aiSourceBody { padding: 14px 16px 20px; }
  .f-aiApp[data-drawer="open"] .f-aiCol { padding-bottom: calc(var(--ai-sheet) + 16px); }
}

/* 답이 흘러나오듯: 낱말마다 짧게 떠오른다(지연은 스크립트가 정한다) */
.f-aiWord { animation: f-aiWordIn 180ms ease-out both; }
@keyframes f-aiWordIn { from { opacity: 0; filter: blur(2px); } to { opacity: 1; filter: none; } }
.f-aiCites.f-aiWord, .f-aiAnswerBar.f-aiWord, .f-aiFollowups.f-aiWord { animation-duration: 260ms; }

@media (prefers-reduced-motion: reduce) {
  .f-aiWord, .f-aiDots i { animation: none !important; }
  .f-aiApp *, .f-aiPage * { transition: none !important; }
}

@media (max-width: 900px) {
  .f-aiHomeGrid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .f-aiOpen, .f-aiWaiting, .f-aiAbout { grid-column: 1; grid-row: auto; }
  .f-aiAbout { padding: 20px; }
  .f-aiOpen .f-aiCoachCard { grid-template-columns: minmax(0, 1fr); gap: 20px; }
}
@media (max-width: 760px) {
  .f-aiPage { --ai-frame: 16px; --ai-gap: 16px; }
  .f-aiHome { padding-top: 24px; }
  .f-aiTitleRow h1 { font-size: 24px; }
  .f-aiLead { font-size: 15px; }
  .f-aiOpen .f-aiCoachCard { padding: 20px; }
  .f-aiCoachMain h3 { font-size: 22px; }
  .f-aiCoachAction .f-aiPrimary { align-self: stretch; }
  .f-aiWaiting { padding: 16px; }
  .f-aiWaiting .f-aiCoachCard { grid-template-columns: minmax(0, 1fr) auto; row-gap: 2px; }
  .f-aiWaitingScope { grid-column: 1 / -1; grid-row: 2; white-space: normal; }
}
