/* ASK CN - assistant shell (interface only) */
.cn-chat{position:fixed;right:max(20px,env(safe-area-inset-right));bottom:max(20px,env(safe-area-inset-bottom));z-index:60;display:flex;flex-direction:column;align-items:flex-end;gap:12px;font:400 15px/1.5 var(--font,system-ui,sans-serif);color:var(--text,#eef4f1)}
.cn-chat-launcher{display:inline-flex;align-items:center;gap:8px;min-height:48px;padding:10px 18px 10px 14px;border:1px solid rgba(157,233,201,.5);border-radius:999px;background:#0f1713;color:var(--text,#eef4f1);font-size:14px;font-weight:650;letter-spacing:.02em;cursor:pointer;box-shadow:0 10px 30px rgba(0,0,0,.45);transition:background .15s,border-color .15s}
.cn-chat-launcher svg{width:20px;height:20px;color:var(--accent,#9de9c9)}
.cn-chat-launcher:hover{background:#15211b;border-color:var(--accent,#9de9c9)}
.cn-chat.is-open .cn-chat-launcher{display:none}
.cn-chat-panel{display:flex;flex-direction:column;width:min(380px,calc(100vw - 40px));height:min(540px,calc(100dvh - 120px));border:1px solid rgba(214,240,228,.18);border-radius:18px;overflow:hidden;background:#0d1411;box-shadow:0 24px 80px rgba(0,0,0,.6)}
.cn-chat-head{display:flex;align-items:center;gap:12px;padding:14px 12px 14px 16px;border-bottom:1px solid rgba(214,240,228,.1);background:#121a16}
.cn-chat-mark{display:grid;place-items:center;width:36px;height:36px;flex-shrink:0;border-radius:10px;background:var(--accent,#9de9c9);color:var(--accent-ink,#04241a);font-size:13px;font-weight:800;letter-spacing:-.03em}
.cn-chat-titles{flex:1;min-width:0}
.cn-chat-titles h2{margin:0;font-size:15px;font-weight:700;letter-spacing:.02em;line-height:1.3}
.cn-chat-sub{margin:2px 0 0;font-size:12px;color:var(--muted,#a9b6b0);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cn-chat-icon{display:grid;place-items:center;width:40px;height:40px;flex-shrink:0;border:0;border-radius:10px;background:transparent;color:var(--muted,#a9b6b0);cursor:pointer}
.cn-chat-icon svg{width:20px;height:20px}
.cn-chat-icon:hover{background:rgba(255,255,255,.06);color:var(--text,#eef4f1)}
.cn-chat-log{flex:1;overflow-y:auto;display:flex;flex-direction:column;gap:10px;padding:16px;overscroll-behavior:contain}
.cn-msg{max-width:88%;padding:10px 14px;border-radius:14px;font-size:14px;line-height:1.55;overflow-wrap:anywhere}
.cn-msg p{margin:0;white-space:pre-wrap}
.cn-msg-note{align-self:stretch;max-width:none;border:1px dashed rgba(214,240,228,.2);background:transparent;color:var(--muted,#a9b6b0)}
.cn-msg-user{align-self:flex-end;background:var(--accent,#9de9c9);color:var(--accent-ink,#04241a);border-bottom-right-radius:4px}
.cn-msg-bot{align-self:flex-start;background:#18221d;border-bottom-left-radius:4px}
.cn-msg-system{align-self:stretch;max-width:none;border:1px solid rgba(241,200,138,.3);background:rgba(241,200,138,.08);color:#f6dcb3;font-size:13px}
.cn-msg-link{display:inline-block;margin-top:8px;color:var(--accent,#9de9c9);font-weight:600}
.cn-msg-wait{align-self:flex-start;display:inline-flex;align-items:center;gap:10px;background:#18221d;color:var(--muted,#a9b6b0);font-size:13px}
.cn-dots{position:relative;width:28px;height:8px;background:radial-gradient(circle,currentColor 3px,transparent 3.5px) 0 50%/10px 8px repeat-x;animation:cn-dots 1s steps(3) infinite;opacity:.8}
@keyframes cn-dots{0%{clip-path:inset(0 66% 0 0)}100%{clip-path:inset(0 0 0 0)}}
.cn-chat-form{display:flex;align-items:flex-end;gap:8px;padding:12px;border-top:1px solid rgba(214,240,228,.1);background:#0f1713}
.cn-chat-input{flex:1;min-height:44px!important;max-height:120px;padding:11px 14px!important;border:1px solid rgba(214,240,228,.18)!important;border-radius:12px!important;background:#0a0f0d!important;color:var(--text,#eef4f1);font-size:15px!important;line-height:1.4;resize:none}
.cn-chat-input:focus{outline:none;border-color:var(--accent,#9de9c9)!important;box-shadow:0 0 0 3px rgba(157,233,201,.18)}
.cn-chat-send{display:grid;place-items:center;width:44px;height:44px;flex-shrink:0;border:0;border-radius:12px;background:var(--accent,#9de9c9);color:var(--accent-ink,#04241a);cursor:pointer}
.cn-chat-send svg{width:20px;height:20px}
.cn-chat-send:disabled{background:#1f2b25;color:#6f7d77;cursor:not-allowed}
.cn-chat-form[aria-busy=true] .cn-chat-input{opacity:.7}
.cn-chat-foot{margin:0;padding:0 14px 12px;background:#0f1713}
.cn-chat-status{display:inline-flex;align-items:center;gap:6px;font-size:12px;color:var(--warn,#f1c88a)}
.cn-chat-status::before{content:"";width:7px;height:7px;border-radius:50%;background:currentColor}
body.has-chat .cn-footer{padding-bottom:72px}
@media (max-width:639px){
 .cn-chat{right:12px;left:12px;bottom:max(12px,env(safe-area-inset-bottom));align-items:flex-end}
 .cn-chat.is-open{left:0;right:0;bottom:0}
 .cn-chat-panel{width:100%;height:min(78dvh,620px);border-radius:18px 18px 0 0;border-bottom:0}
 .cn-chat{left:auto}
 .cn-chat-launcher{width:52px;height:52px;min-height:0;padding:0;justify-content:center;border-radius:50%}
 .cn-chat-launcher span{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}
 .cn-chat-launcher svg{width:22px;height:22px}
}
@media (prefers-reduced-motion:reduce){.cn-dots{animation:none;clip-path:none}}
