/* 대민 챗봇 위젯 (riisAiChat.js) — riia 위젯(cmn/ai-chat.css)과 같은 디자인·마스코트. .riis-ai 로 전부 스코프 */
.riis-ai { position: fixed; right: 20px; bottom: 24px; z-index: 1050;
	font-family: "Noto Sans KR", "Malgun Gothic", sans-serif; font-size: 14px; line-height: 1.5; color: #1f2937; }

/* ── 런처 ── */
.riis-ai__fab { display: inline-flex; align-items: center; gap: 8px; padding: 12px 18px; border: 0; border-radius: 999px;
	background: #2f6fed; color: #fff; font: inherit; font-weight: 700; cursor: pointer;
	box-shadow: 0 6px 20px rgba(47,111,237,.35); transition: transform .12s ease, box-shadow .12s ease; }
.riis-ai__fab:hover, .riis-ai__fab:focus-visible { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(47,111,237,.45); }
.riis-ai.is-open .riis-ai__fab { display: none; }

/* ── 마스코트(귀여운 통통이) ── */
.riis-ai__bot { width: 1.25em; height: 1.25em; display: block; color: inherit; }
.riis-ai__fab .riis-ai__bot { width: 28px; height: 28px; }
.riis-ai__title .riis-ai__bot { width: 24px; height: 24px; }
.riis-ai__fab:hover .riis-ai__bot { animation: riis-ai-wiggle .6s ease-in-out; }
@keyframes riis-ai-wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-12deg); } 60% { transform: rotate(10deg); } }
.riis-ai__avatar { flex: 0 0 auto; width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
	border-radius: 50%; background: #eef2ff; color: #2f6fed; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.riis-ai__avatar .riis-ai__bot { width: 22px; height: 22px; }

/* ── 패널 ── */
.riis-ai__panel { display: none; flex-direction: column; width: 440px; max-width: calc(100vw - 40px);
	height: 620px; max-height: calc(100vh - 48px); background: #fff; border-radius: 14px;
	box-shadow: 0 18px 50px rgba(0,0,0,.22); overflow: hidden; }
.riis-ai.is-open .riis-ai__panel { display: flex; }
.riis-ai__head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; background: #2f6fed; color: #fff; }
.riis-ai__title { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; }
.riis-ai__close { width: 28px; height: 28px; border: 0; border-radius: 6px; background: transparent; color: #fff; font-size: 15px; line-height: 1; cursor: pointer; }
.riis-ai__close:hover { background: rgba(255,255,255,.18); }

/* ── 메시지 ── */
.riis-ai__body { flex: 1; overflow-y: auto; padding: 14px; background: #f4f6fb; display: flex; flex-direction: column; gap: 10px; }
.riis-ai__msg { display: flex; }
.riis-ai__msg--user { justify-content: flex-end; }
.riis-ai__msg--bot { justify-content: flex-start; align-items: flex-start; gap: 8px; }
.riis-ai__bubble { max-width: 84%; padding: 9px 12px; border-radius: 12px; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.06);
	word-break: keep-all; overflow-wrap: anywhere; }
.riis-ai__msg--bot .riis-ai__bubble { max-width: calc(88% - 42px); }
.riis-ai__msg--bot .riis-ai__bubble--wide { max-width: calc(100% - 42px); }
.riis-ai__msg--user .riis-ai__bubble { background: #2f6fed; color: #fff; }

.riis-ai__table { margin-top: 8px; max-height: 260px; overflow: auto; }
.riis-ai__table table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.riis-ai__table th, .riis-ai__table td { border: 1px solid #e5e7eb; padding: 5px 8px; white-space: nowrap; }
.riis-ai__table th { position: sticky; top: 0; background: #eef2ff; font-weight: 700; text-align: center; }
.riis-ai__table td.num { text-align: right; }

/* 참고 — 노란 상자 */
.riis-ai__notes { margin-top: 10px; padding: 8px 12px 8px 10px; background: #fffbeb; border: 1px solid #fde68a;
	border-left: 4px solid #f59e0b; border-radius: 8px; font-size: 12.5px; color: #78350f; line-height: 1.55; }
.riis-ai__notes-head { font-weight: 700; color: #b45309; margin-bottom: 2px; }
.riis-ai__notes-head::before { content: "⚠"; margin-right: 5px; }
.riis-ai__notes ul { margin: 0; padding: 0; }
.riis-ai__notes li { list-style: none; position: relative; padding-left: 12px; }
.riis-ai__notes li::before { content: "•"; position: absolute; left: 1px; color: #d97706; }

.riis-ai__link { display: block; margin-top: 8px; color: #2f6fed; font-weight: 600; text-decoration: underline; }
.riis-ai__link:hover { color: #1e4fd1; }
.riis-ai__examples { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.riis-ai__examples button { border: 1px solid #c7d2fe; background: #eef2ff; color: #3730a3; border-radius: 999px;
	padding: 5px 12px; font: inherit; font-size: 12.5px; cursor: pointer; }
.riis-ai__examples button:hover { background: #e0e7ff; }

/* 찾는 중 — 점 세 개 */
.riis-ai__typing .riis-ai__bubble { display: inline-flex; gap: 4px; }
.riis-ai__typing i { width: 6px; height: 6px; border-radius: 50%; background: #9ca3af; display: inline-block; animation: riis-ai-blink 1.2s infinite both; }
.riis-ai__typing i:nth-child(2) { animation-delay: .2s; }
.riis-ai__typing i:nth-child(3) { animation-delay: .4s; }
@keyframes riis-ai-blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

/* ── 입력 ── */
.riis-ai__form { display: flex; align-items: center; gap: 8px; padding: 10px 12px 12px; background: #fff; border-top: 1px solid #eef0f4; }
.riis-ai__form input { flex: 1; min-width: 0; padding: 8px 10px; border: 1px solid #d1d5db; border-radius: 10px; font: inherit; outline: none; }
.riis-ai__form input:focus { border-color: #2f6fed; }
.riis-ai__form button { width: 38px; height: 38px; flex: 0 0 auto; border: 0; border-radius: 10px; background: #2f6fed; color: #fff; font-size: 15px; cursor: pointer; }
.riis-ai__form button:disabled { background: #9db8f4; cursor: default; }

@media (max-width: 480px) {
	.riis-ai { right: 10px; bottom: 10px; }
	.riis-ai__panel { width: calc(100vw - 20px); height: calc(100vh - 20px); }
	.riis-ai__fab span { display: none; }
}
@media print { .riis-ai { display: none; } }
