#ai-chat-button {position:fixed;right:24px;bottom:24px;z-index:60;border-radius:50%;box-shadow:0 6px 24px #0003;padding:0;width:58px;height:58px;min-height:58px;display:grid;place-items:center;background:var(--brand);color:#fff;}
#ai-chat-dialog {position:fixed;inset:auto 20px 20px auto;margin:0;width:min(680px,calc(100vw - 40px));height:min(820px,calc(100dvh - 40px));max-height:calc(100dvh - 40px);box-sizing:border-box;padding:24px;border-radius:22px;overflow:auto;}
#ai-chat-dialog::backdrop {background:rgb(0 0 0 / .18);}
#ai-chat-dialog .dialog-header {gap:16px;}
#ai-chat-dialog .organization-tabs {display:flex;flex-wrap:wrap;margin:16px 0;}
#ai-chat-dialog label {display:grid;gap:8px;}
#ai-question {width:100%;min-height:96px;resize:vertical;box-sizing:border-box;}
#ai-chat-form {display:grid;gap:12px;}
#ai-answer {min-height:240px;font-size:1rem;white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.55;margin-top:16px;}
#ai-status {overflow-wrap:anywhere;}
#ai-chat-dialog :focus-visible, #ai-chat-button:focus-visible {outline:3px solid var(--brand);outline-offset:3px;}
@media (max-width:600px) {#ai-chat-button {right:16px;bottom:max(16px,env(safe-area-inset-bottom));} #ai-chat-dialog {right:8px;bottom:8px;width:calc(100vw - 16px);height:calc(100dvh - 16px);max-height:calc(100dvh - 16px);box-sizing:border-box;padding:20px;}}

#ai-chat-dialog .organization-tab {white-space:normal;overflow-wrap:anywhere;}

#ai-chat-button > svg {display:block;width:60%;height:60%;pointer-events:none;}

/* Hidden help-mode question form must override its grid display. */
#ai-chat-form[hidden], #ai-help-topics[hidden] { display:none; }
#ai-help-topics { display:grid; gap:8px; }
#ai-help-topic { width:100%; min-width:0; max-width:100%; }
