/* 폴더 방명록(봇 채팅) — 우측 하단 봇 + 카카오톡풍 미니 채팅 */
.folder-chat { position: fixed; right: 22px; bottom: 22px; z-index: 60; }
.fc-fab { position: relative; width: 80px; height: 80px; border: none; background: transparent; cursor: pointer; padding: 0; display: grid; place-items: center; transition: transform 0.18s ease; }
.fc-fab:hover { transform: translateY(-2px) scale(1.04); }
.fc-fab .bot-av { width: 100%; height: 100%; }
/* 봇이 담기는 라운드 사각 블럭(레퍼런스 앱아이콘처럼 확대·마스킹) */
/* 다크 라운드 사각(블럭)은 fab보다 작은 64px 중앙 — 블럭만 작게 유지 */
.fc-block { position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; transform: translate(-50%, -50%); border-radius: 16px; overflow: hidden;
  background: radial-gradient(120% 120% at 32% 24%, #1c2942 0%, #0d1524 55%, #060b14 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.10), inset 0 0 22px rgba(120,150,220,0.10), 0 12px 26px rgba(4,10,22,0.34);
  transition: background 0.5s ease, border-radius 0.55s cubic-bezier(0.34,1.5,0.5,1), box-shadow 0.5s ease; }
.fc-block-face { position: absolute; inset: 0; transform-origin: 50% 50%;
  transition: transform 0.55s cubic-bezier(0.34,1.4,0.5,1); }
.fc-block-face .bot-svg { filter: none; } /* 배경 원형 회색 프레임(그림자·테두리) 제거 */
/* 기본(tuck): 봇 얼굴이 우하단(5시)에서 돔처럼 올라오고 상단(좌상)이 어둡게 비도록 확대·이동(레퍼런스 앱아이콘) */
.fc-fab.tuck .fc-block-face { transform: scale(1.35) translate(8%, 22%); }
/* 나옴(peek): 블럭이 사라지고, 봇이 블럭 밖으로 크게(20%↑) 튀어나온다 */
.fc-fab.peek .fc-block { overflow: visible; background: radial-gradient(120% 120% at 32% 24%, rgba(28,41,66,0), rgba(6,11,20,0)); border-radius: 50%; box-shadow: none; }
.fc-fab.peek .fc-block-face { transform: scale(1.44); }
.fc-head-av { width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,0.14); padding: 3px; box-sizing: border-box; flex: 0 0 auto; display: block; }
.fc-fab-badge { position: absolute; top: 4px; right: 4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: #f6b91a; color: #201800; font-size: 11px; font-weight: 800; display: grid; place-items: center; box-shadow: 0 0 0 2px #fff; z-index: 2; }
.fc-bubble { position: absolute; right: 8px; bottom: 90px; width: max-content; max-width: 230px; background: #fff; border: 1px solid #e2e6ee; border-radius: 14px 14px 4px 14px; padding: 9px 12px; box-shadow: 0 8px 24px rgba(23,50,77,0.22); cursor: pointer; animation: fcPop 0.25s ease; }
.fc-bubble b { display: block; font-size: 11px; color: #2f54eb; margin-bottom: 2px; }
.fc-bubble p { margin: 0; font-size: 12.5px; color: #33384a; line-height: 1.45; word-break: break-word; white-space: normal; }
.fc-status-slot:empty { display: none; }
.folder-chat > .fc-status-slot, .fc-status-only > .fc-result {
  position: absolute; right: 8px; bottom: 90px; width: max-content; max-width: min(300px, calc(100vw - 40px)); pointer-events: none;
}
.fc-result {
  box-sizing: border-box; padding: 10px 14px; border: 1px solid #cbd9f0; border-radius: 15px 15px 4px 15px;
  background: #fff; color: #172f50; text-align: start; box-shadow: 0 6px 22px rgba(23,50,77,.16); pointer-events: none;
}
.fc-result strong { display: block; margin: 0 0 3px; font-size: 11px; line-height: 1.4; color: #34569b; }
.fc-result p { margin: 0; color: inherit; font: inherit; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.fc-guide p { white-space: pre-line; }
.fc-panel > .fc-status-slot { flex: none; margin: 8px 10px 0; }
.fc-panel .fc-result { border-radius: 4px 12px 12px; box-shadow: none; }
.folder-chat.fc-status-only { width: 54px; height: 54px; pointer-events: none; }
.fc-status-only > img { display: block; width: 100%; height: 100%; }
.fc-status-only > .fc-result { right: 2px; bottom: calc(100% + 6px); }
/* 사람이 남긴 글 말풍선(방명록 최신 글)은 노란색 */
.fc-bubble.human { background: #f6d34a; border-color: #e7c24a; }
.fc-bubble.human b { color: #7a5c00; }
.fc-bubble.human p { color: #2a2410; }
/* 폴더 공지: 최우선·주황 말풍선(눈에 잘 띄게) */
.fc-bubble.notice { background: linear-gradient(180deg, #ff8a3a, #f9731d); border-color: #e2620c; box-shadow: 0 10px 26px rgba(230,100,10,0.38); }
.fc-bubble.notice b { color: #5c2400; }
.fc-bubble.notice p { color: #3a1c06; font-weight: 500; }
@keyframes fcPop { from { opacity: 0; transform: translateY(6px) scale(0.96); } to { opacity: 1; transform: none; } }
.fc-panel { position: absolute; right: 0; bottom: 0; width: min(340px, calc(100vw - 40px)); height: min(520px, calc(100vh - 90px)); background: #f2f5fb; border-radius: 18px; box-shadow: 0 20px 50px rgba(15,23,42,0.35); display: flex; flex-direction: column; overflow: hidden; animation: fcPop 0.2s ease; }
.fc-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: linear-gradient(135deg, #1f3a68, #17324d); color: #fff; }
.fc-head-t { flex: 1; min-width: 0; }
.fc-head-t b { display: block; font-size: 13px; }
.fc-head-t small { font-size: 11px; color: #b9c6dd; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 방명록 ↔ AI 대화 모드 전환 탭 */
.fc-modes { display: flex; gap: 6px; padding: 8px 10px 0; background: #fff; }
.fc-modes button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 7px 8px; font-size: 12px; font-weight: 700; color: #64707f; background: #f1f3f8; border: 1px solid #e2e6ee; border-radius: 9px; cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.fc-modes button.on { color: #fff; background: linear-gradient(135deg, #2f54eb, #1f3a68); border-color: transparent; }
/* AI가 생각 중일 때 표시하는 점 3개 애니메이션 */
.fc-typing { display: inline-flex; gap: 4px; align-items: center; }
.fc-typing i { width: 6px; height: 6px; border-radius: 50%; background: #9aa4b2; display: inline-block; animation: fcTyping 1s infinite ease-in-out; }
.fc-typing i:nth-child(2) { animation-delay: .15s; }
.fc-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes fcTyping { 0%, 60%, 100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
.fc-close { border: none; background: rgba(255,255,255,0.12); color: #fff; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; cursor: pointer; }
.fc-close:hover { background: rgba(255,255,255,0.22); }
.fc-list { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; scrollbar-width: thin; scrollbar-color: #c4cede transparent; }
.fc-list::-webkit-scrollbar { width: 8px; }
.fc-list::-webkit-scrollbar-thumb { background: #c4cede; border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
.fc-empty { margin: auto; text-align: center; color: #8b93a7; }
.fc-empty img { width: 78px; height: 78px; opacity: 0.92; margin-bottom: 8px; }
.fc-empty p { font-size: 13px; line-height: 1.55; margin: 0; }
.fc-msg { display: flex; flex-direction: column; gap: 3px; max-width: 82%; align-self: flex-start; }
.fc-msg.mine { align-self: flex-end; align-items: flex-end; }
.fc-who { font-size: 11px; color: #6b7280; padding-left: 4px; }
.fc-row { display: flex; align-items: flex-end; gap: 5px; }
.fc-msg.mine .fc-row { flex-direction: row-reverse; }
/* 사람이 남긴 말풍선 = 노란색(기본), 봇 말풍선 = 흰색 */
.fc-bub { background: #f6d34a; color: #2a2410; font-size: 13px; line-height: 1.45; padding: 8px 11px; border-radius: 4px 14px 14px 14px; box-shadow: 0 1px 2px rgba(15,23,42,0.08); word-break: break-word; white-space: pre-wrap; }
.fc-msg.mine .fc-bub { border-radius: 14px 4px 14px 14px; }
.fc-msg.bot .fc-bub { background: #fff; color: #23272f; }
.fc-row time { font-size: 10px; color: #9aa0ac; flex: 0 0 auto; margin-bottom: 1px; }
.fc-input { border-top: 1px solid #e2e6ee; background: #fff; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.fc-name { border: 1px solid #d8deea; border-radius: 8px; padding: 7px 10px; font-size: 12px; color: #23272f; }
.fc-name:focus { outline: none; border-color: #2f54eb; }
/* 등록된 이름 표시(입력 폼 위) + 지우기 버튼 */
.fc-name-tag { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 8px 6px 11px; background: #eef2fe; border: 1px solid #d5deff; border-radius: 8px; }
.fc-name-tag span { font-size: 12px; color: #64707f; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fc-name-tag b { color: #2f54eb; font-weight: 700; }
.fc-name-tag button { flex-shrink: 0; width: 22px; height: 22px; display: grid; place-items: center; border: 0; background: transparent; border-radius: 6px; color: #8a94a6; cursor: pointer; }
.fc-name-tag button:hover { background: #fff1f2; color: #e11d48; }
.fc-send-row { display: flex; gap: 6px; align-items: flex-end; }
.fc-send-row textarea { flex: 1; resize: none; border: 1px solid #d8deea; border-radius: 12px; padding: 9px 12px; font: inherit; font-size: 13px; line-height: 1.4; max-height: 96px; color: #23272f; }
.fc-send-row textarea:focus { outline: none; border-color: #2f54eb; }
.fc-send { flex: 0 0 auto; height: 40px; padding: 0 15px; border-radius: 12px; border: none; background: #2f54eb; color: #fff; font-size: 13px; font-weight: 700; cursor: pointer; }
.fc-send:disabled { opacity: 0.4; cursor: default; }
.fc-send:hover:not(:disabled) { background: #1e40c9; }

/* 리뷰 화면 등에서 좌측 하단 배치(우측 코멘트 패널을 가리지 않도록) */
.folder-chat.left { right: auto; left: 22px; }
.folder-chat.left .fc-bubble { right: auto; left: 8px; border-radius: 14px 14px 14px 4px; }
.folder-chat.left .fc-panel { right: auto; left: 0; }

/* 살아있는 봇 캐릭터 — 마우스 추적 눈 + 상태 애니메이션(대기/생각중/말하기/기뻐함) */
.bot-av { position: relative; display: block; width: 100%; height: 100%; }
.bot-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; overflow: visible; pointer-events: none; will-change: transform; }
.bot-think { position: absolute; left: 50%; bottom: 100%; transform: translate(-50%, 2px); display: none; gap: 3px; margin-bottom: 3px; }
.state-thinking .bot-think { display: flex; }
.bot-think b { width: 5px; height: 5px; border-radius: 50%; background: #cfe0ff; box-shadow: 0 1px 3px rgba(47,84,235,0.5); animation: botDot 1.05s ease-in-out infinite; }
.bot-think b:nth-child(2) { animation-delay: 0.15s; }
.bot-think b:nth-child(3) { animation-delay: 0.3s; }
/* 상태별 몸 애니메이션 */
.state-idle .bot-svg { animation: botFloat 3.6s ease-in-out infinite; }
.state-thinking .bot-svg { animation: botTilt 2.1s ease-in-out infinite alternate; }
.state-talking .bot-svg { animation: botBounce 0.6s ease-in-out infinite; }
.state-happy .bot-svg { animation: botJump 0.9s cubic-bezier(0.36,0,0.3,1) infinite; }
/* 말풍선 타이핑 캐럿 */
.fc-caret { display: inline-block; width: 1px; height: 0.95em; margin-left: 1px; vertical-align: -1px; background: #33384a; animation: fcCaret 0.75s steps(1) infinite; }
@keyframes fcCaret { 0%,50% { opacity: 1; } 51%,100% { opacity: 0; } }
@keyframes botFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes botTilt { 0% { transform: rotate(-3deg); } 100% { transform: rotate(3deg); } }
@keyframes botBounce { 0%,100% { transform: translateY(0) scaleY(1); } 50% { transform: translateY(-3px) scaleY(1.03); } }
@keyframes botJump { 0% { transform: translateY(0) scale(1,1); } 16% { transform: translateY(0) scale(1.07,0.9); } 44% { transform: translateY(-12px) scale(0.96,1.06); } 66% { transform: translateY(0) scale(1,1); } 76% { transform: translateY(0) scale(1.04,0.94); } 100% { transform: translateY(0) scale(1,1); } }
@keyframes botBlink { 0%,92%,100% { transform: scaleY(1); } 95% { transform: scaleY(0.1); } 98% { transform: scaleY(1); } }
@keyframes botDot { 0%,100% { transform: translateY(0); opacity: 0.6; } 50% { transform: translateY(-4px); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .bot-svg, .bot-think b, .fc-caret { animation: none !important; } }


/* ── Fluent 이모지: 인라인 렌더 + 선택창(포털·fixed) ───────────────── */
.fx-emoji { width: 1.35em; height: 1.35em; vertical-align: -0.28em; object-fit: contain; display: inline-block; margin: 0 1px; }
.fx-emoji.lg { width: 2.4em; height: 2.4em; vertical-align: -0.6em; margin: 1px 2px; }
.emoji-wrap { position: relative; display: inline-flex; align-items: center; }
/* 트리거 버튼 — 주변(리뷰 amber 등) 버튼 스타일이 번지지 않도록 확실히 지정 */
.emoji-wrap .emoji-trigger { flex: 0 0 auto; width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid #d8deea !important; border-radius: 11px !important; background: #fff !important; color: inherit; cursor: pointer; padding: 0 !important; box-shadow: none; }
.emoji-wrap .emoji-trigger img { width: 22px; height: 22px; display: block; }
.emoji-wrap .emoji-trigger:hover, .emoji-wrap .emoji-trigger.on { border-color: #2f54eb !important; background: #eef2ff !important; }
.emoji-wrap .emoji-trigger.dark { width: 32px; height: 32px; border-radius: 9px !important; border-color: #334155 !important; background: #16233b !important; }
.emoji-wrap .emoji-trigger.dark:hover, .emoji-wrap .emoji-trigger.dark.on { border-color: #f6b91a !important; background: #1f2f4d !important; }
.emoji-wrap .emoji-trigger.dark img { width: 20px; height: 20px; }

/* 선택창 — body로 포털, 좌표는 인라인 style(left/top/bottom)로 지정 */
.emoji-pop { position: fixed; z-index: 3000; box-sizing: border-box; background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; box-shadow: 0 16px 44px rgba(15,23,42,0.28); padding: 8px; }
.emoji-pop .emoji-search input { width: 100%; box-sizing: border-box; border: 1px solid #e2e8f0; border-radius: 9px; padding: 7px 10px; font: inherit; font-size: 13px; color: #23272f; background: #fff; }
.emoji-pop .emoji-search input:focus { outline: none; border-color: #2f54eb; }
.emoji-pop .emoji-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 7px 0 4px; }
.emoji-pop .emoji-tabs button { border: 0 !important; background: #eef1f6 !important; color: #475569 !important; font-size: 11.5px; font-weight: 600; padding: 4px 9px !important; border-radius: 999px !important; cursor: pointer; white-space: nowrap; box-shadow: none; }
.emoji-pop .emoji-tabs button.on { background: #2f54eb !important; color: #fff !important; }
.emoji-pop .emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, 38px); gap: 2px; justify-content: center; max-height: 220px; overflow-y: auto; padding-top: 2px; }
.emoji-pop .emoji-grid .emoji-cell { position: relative; width: 38px; height: 38px; border: 0 !important; background: none !important; border-radius: 8px !important; cursor: pointer; padding: 0 !important; display: inline-flex; align-items: center; justify-content: center; box-shadow: none; }
.emoji-pop .emoji-grid .emoji-cell:hover { background: #eef2ff !important; }
.emoji-pop .emoji-grid .emoji-cell img { width: 26px; height: 26px; object-fit: contain; display: block; }
.emoji-pop .emoji-anim-dot { position: absolute; right: 4px; top: 4px; width: 6px; height: 6px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 2px #fff; }
.emoji-pop .emoji-empty { grid-column: 1 / -1; text-align: center; color: #94a3b8; font-size: 12px; padding: 22px 0; }
/* 다크 변형(리뷰 코멘트 패널과 어울리게) */
.fc-ai-note { margin-top: 7px; text-align: center; font-size: 10.5px; font-weight: 700; letter-spacing: 0.02em; color: #9aa4b2; }
.fc-voc { padding:16px; display:flex; flex-direction:column; gap:12px; overflow:auto; flex:1; min-height:0; }
.fc-voc h3 { margin:0; font-size:15px; color:#17324d; }
.fc-voc p,.fc-voc small { font-size:12px; line-height:1.6; color:#64748b; margin:0; }
.fc-voc input,.fc-voc textarea { border:1px solid #cbd5e1; border-radius:9px; padding:10px; font:inherit; width:100%; box-sizing:border-box; }
.fc-voc textarea { min-height:140px; resize:vertical; }
.fc-voc input[hidden] { display:none; }
.voc-attachments > div { display:flex; gap:8px; align-items:center; font-size:12px; padding:6px 0; }
.voc-attachments img { width:44px; height:44px; object-fit:cover; border-radius:5px; }
.voc-attachments span { flex:1; min-width:0; overflow-wrap:anywhere; }
.folder-chat {font-family:inherit;color:#23272f}
.folder-chat button {font-family:inherit}
.folder-chat .fc-panel,.folder-chat .fc-panel * {box-sizing:border-box}
.folder-chat .fc-voc .button {border:1px solid #d8deea;border-radius:8px;background:white;color:#17324d;padding:9px 12px;cursor:pointer}
.folder-chat .fc-voc .primary {background:#2f54eb;color:white}
.folder-chat .fc-voc button:disabled {opacity:.55}
.folder-chat .fc-error {color:#942544;font-size:12px;margin:0}
.bot-setting-toggle {display:flex!important;align-items:center;gap:8px}
.form .bot-setting-toggle input {width:auto;min-height:auto}
.cd-review .folder-chat {z-index:90}
body:has(dialog.cd-review[open]) #app>.project-bot-host {visibility:hidden}
@media(max-width:680px){.folder-chat{right:12px;bottom:max(12px,env(safe-area-inset-bottom))}.fc-panel{max-height:76dvh}}
