/* Shared EduLab tokens, local SVG icons, no third-party chat script. */
.ai-chat-toggle { position:fixed; right:24px; bottom:max(24px,env(safe-area-inset-bottom)); z-index:110; display:flex; align-items:center; gap:9px; min-height:52px; padding:12px 19px; border:0; border-radius:28px; background:var(--primary); color:var(--surface); font-weight:700; box-shadow:0 5px 24px #24435d30; }
.ai-chat-toggle:hover { background:#104974; }
.ai-chat-dialog { position:fixed; inset:auto 24px max(24px,env(safe-area-inset-bottom)) auto; margin:0; padding:0; width:390px; max-width:calc(100vw - 32px); height:620px; max-height:calc(100dvh - 40px); border:1px solid var(--line); border-radius:16px; color:var(--ink); background:var(--surface); box-shadow:0 16px 60px #24435d35; }
.ai-chat-dialog[open] { display:flex; flex-direction:column; }
.ai-chat-dialog::backdrop { background:#24435d20; }
.ai-chat-header { display:flex; align-items:center; gap:10px; padding:16px; border-bottom:1px solid var(--line); background:var(--soft-blue); flex-shrink:0; }
.ai-chat-avatar { display:grid; place-items:center; width:42px; height:42px; border-radius:12px; background:var(--primary); color:var(--surface); flex-shrink:0; }
.ai-chat-header h2 { font-size:16px; margin:0; }.ai-chat-header p { font-size:11px; color:var(--muted); margin:3px 0 0; }.ai-chat-header .icon-button { margin-left:auto; }
.ai-chat-messages { flex:1; min-height:100px; overflow-y:auto; overscroll-behavior:contain; padding:16px; display:flex; flex-direction:column; gap:14px; }
.ai-chat-message { max-width:94%; padding:12px 14px; border-radius:12px; background:var(--soft-blue); font-size:13px; overflow-wrap:anywhere; flex-shrink:0; }.ai-chat-message strong { display:block; font-size:11px; color:var(--primary); margin-bottom:5px; }.ai-chat-message p { margin:0; white-space:pre-wrap; line-height:1.75; }.ai-chat-message.user { align-self:flex-end; background:var(--primary); color:var(--surface); }.ai-chat-message.user strong { color:var(--surface); }
.ai-chat-links { display:flex; flex-wrap:wrap; gap:6px; margin-top:12px; }.ai-chat-links a { display:block; padding:8px 10px; border:1px solid #b6cddd; border-radius:7px; background:var(--surface); font-size:12px; }.ai-chat-links a:hover { text-decoration:underline; }
.ai-chat-suggestions { display:flex; flex-wrap:wrap; gap:6px; padding:0 16px 10px; }.ai-chat-suggestions[hidden] { display:none; }.ai-chat-suggestions button { padding:8px 10px; background:var(--surface); color:var(--primary); border:1px solid #b6cddd; border-radius:20px; font-size:11px; min-height:36px; }
.ai-chat-status { font-size:12px; color:var(--muted); padding:0 16px; margin:0; flex-shrink:0; }.ai-chat-status:not(:empty) { padding-bottom:10px; }
.ai-chat-form { padding:12px 16px; border-top:1px solid var(--line); flex-shrink:0; }.ai-chat-compose { display:flex; align-items:flex-end; gap:8px; }.ai-chat-compose textarea { width:100%; resize:none; border:1px solid var(--line); border-radius:9px; padding:10px 12px; font-size:14px; color:var(--ink); min-width:0; max-height:100px; }.ai-chat-compose .btn { display:grid; place-items:center; width:44px; height:44px; flex-shrink:0; padding:8px; }.ai-chat-form>p { font-size:10px; color:var(--muted); line-height:1.5; margin:8px 0 0; }
.ai-chat-footer { display:flex; justify-content:space-between; gap:8px; padding:0 16px 10px; font-size:10px; color:var(--muted); flex-shrink:0; }.ai-chat-footer button { background:none; border:0; padding:5px 0; color:var(--primary); text-decoration:underline; }.ai-chat-footer span { align-self:center; }
.ai-chat-dialog button:disabled { opacity:.6; cursor:wait; }
@media(max-width:575px) { .ai-chat-toggle { right:16px; bottom:max(16px,env(safe-area-inset-bottom)); }.ai-chat-dialog { inset:auto 8px max(8px,env(safe-area-inset-bottom)) auto; width:calc(100vw - 16px); max-width:none; height:640px; max-height:calc(100dvh - 16px); }.ai-chat-compose textarea { font-size:16px; }.ai-chat-suggestions button { min-height:44px; }.ai-chat-footer button { min-height:36px; } }
@media(prefers-reduced-motion:reduce) { .ai-chat-dialog * { scroll-behavior:auto; } }