/* 독자 AI 채팅 — 마스코트 K (plugins/wia-news-cms/includes/class-kt-ask.php, 2026-10-30)
   밤 모드: --kt-* 변수가 html.kt-dark 에서 같이 바뀜 */
#kt-ask-root { --a-bg: var(--kt-bg, #fff); --a-ink: var(--kt-ink, #111418); --a-line: var(--kt-line, #e6e7e9); --a-soft: var(--kt-soft, #f5f6f7); --a-sub: var(--kt-sub, #5a6068); --a-main: #0b6f73; }
html.kt-dark #kt-ask-root { --a-main: #3fb5ba; }
.kt-ask-fab { position: fixed; right: 16px; bottom: 18px; z-index: 9980; width: 64px; height: 64px; padding: 0; border: 0; border-radius: 50%; background: var(--a-bg); cursor: pointer;
	box-shadow: 0 6px 18px rgba(7,56,58,.28), 0 0 0 2px var(--a-main); display: grid; place-items: center; transition: transform .2s, opacity .2s; animation: kt-ask-float 3.2s ease-in-out infinite; }
.kt-ask-fab:hover { transform: scale(1.06); }
.kt-ask-fab img { width: 52px; height: 52px; display: block; pointer-events: none; }
.kt-ask-fab:focus-visible, .kt-ask-x:focus-visible, .kt-ask-send:focus-visible, .kt-ask-chip:focus-visible { outline: 3px solid var(--a-main); outline-offset: 2px; }
.kt-ask-fab .kt-ask-tip { position: absolute; right: 70px; bottom: 14px; white-space: nowrap; padding: 6px 11px; border-radius: 14px; background: var(--a-main); color: #fff; font: 700 13px/1.2 var(--kt-sans, system-ui, sans-serif); pointer-events: none; opacity: 0; transition: opacity .3s; }
.kt-ask-fab.is-hint .kt-ask-tip { opacity: 1; }
@keyframes kt-ask-float { 50% { transform: translateY(-4px); } }
.kt-ask-open .kt-ask-fab { display: none; }
/* 맨 아래 듣기 막대(.kt-lc)·번역 중 K(.kt-k)가 떠 있는 동안은 비켜 줌 */
body:has(.kt-k.is-on) .kt-ask-fab, body:has(.kt-lc) .kt-ask-fab, body:has(.wia-popup-layer) .kt-ask-fab, body:has(.wia-popup-notice) .kt-ask-fab { opacity: 0; pointer-events: none; }

.kt-ask-win { position: fixed; right: 16px; bottom: 18px; z-index: 9985; width: 360px; max-width: calc(100vw - 24px); height: min(520px, calc(100vh - 36px)); height: min(520px, calc(100dvh - 36px));
	display: none; flex-direction: column; overflow: hidden; border-radius: 18px; background: var(--a-bg); color: var(--a-ink); border: 1px solid var(--a-line); box-shadow: 0 14px 40px rgba(0,0,0,.28);
	font: 15px/1.5 var(--kt-sans, system-ui, sans-serif); }
.kt-ask-open .kt-ask-win { display: flex; }
.kt-ask-head { flex: none; display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--a-main); color: #fff; }
.kt-ask-head img { width: 38px; height: 38px; border-radius: 50%; background: #fff; }
.kt-ask-head b { flex: 1; font-size: 15px; }
.kt-ask-x { border: 0; background: transparent; color: #fff; font-size: 26px; line-height: 1; width: 36px; height: 36px; cursor: pointer; border-radius: 8px; }
.kt-ask-log { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 12px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; }
.kt-ask-m { max-width: 88%; padding: 8px 12px; border-radius: 14px; background: var(--a-soft); overflow-wrap: anywhere; white-space: pre-wrap; }
.kt-ask-m.u { align-self: flex-end; background: var(--a-main); color: #fff; }
.kt-ask-m.wait { color: var(--a-sub); }
.kt-ask-src { align-self: flex-start; max-width: 96%; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.kt-ask-src a { color: var(--kt-link, #0b4ea2); overflow-wrap: anywhere; text-decoration: underline; }
html.kt-dark .kt-ask-src a { color: #8ec5ff; }
.kt-ask-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.kt-ask-chip { border: 1px solid var(--a-main); background: transparent; color: var(--a-main); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 13.5px; cursor: pointer; text-align: start; }
.kt-ask-chip:hover { background: var(--a-main); color: #fff; }
.kt-ask-left { flex: none; padding: 2px 12px; font-size: 12px; color: var(--a-sub); text-align: end; }
.kt-ask-form { flex: none; display: flex; gap: 8px; padding: 8px 12px 12px; border-top: 1px solid var(--a-line); }
.kt-ask-form input { flex: 1; min-width: 0; font: inherit; font-size: 16px; padding: 9px 12px; border-radius: 999px; border: 1px solid var(--a-line); background: var(--a-bg); color: var(--a-ink); }
.kt-ask-send { flex: none; border: 0; border-radius: 999px; padding: 0 16px; background: var(--a-main); color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.kt-ask-send:disabled { opacity: .5; cursor: default; }
html[dir="rtl"] .kt-ask-fab, html[dir="rtl"] .kt-ask-win { right: auto; left: 16px; }
html[dir="rtl"] .kt-ask-fab .kt-ask-tip { right: auto; left: 70px; }

@media (max-width: 600px) {
	.kt-ask-win { inset: 0; width: auto; max-width: none; height: auto; border-radius: 0; border: 0; }
	.kt-ask-open { overflow: hidden; }
	.kt-ask-fab { right: 12px; bottom: 14px; width: 58px; height: 58px; }
	.kt-ask-fab img { width: 46px; height: 46px; }
	html[dir="rtl"] .kt-ask-fab { left: 12px; }
}
@media (prefers-reduced-motion: reduce) { .kt-ask-fab { animation: none; } }
