.ai-toggle{position:fixed;right:24px;bottom:24px;z-index:900;background:#e3b65c;color:#18130d;border:1px solid #ffe2a0;border-radius:28px;padding:14px 22px;font:700 15px system-ui;cursor:pointer;box-shadow:0 8px 30px #0008}
.ai-panel{position:fixed;right:24px;bottom:86px;width:min(410px,calc(100vw - 32px));max-height:calc(100dvh - 110px);z-index:901;display:flex;flex-direction:column;background:#191a20;color:#f3ede1;border:1px solid #8e7443;border-radius:16px;box-shadow:0 18px 70px #000a;font:14px/1.5 system-ui;overflow:hidden}
.ai-panel[hidden]{display:none}.ai-panel header{display:flex;align-items:center;gap:10px;padding:14px;border-bottom:1px solid #ffffff20}.ai-panel header strong{flex:1}.ai-panel button{cursor:pointer;background:#e3b65c;color:#18130d;border:0;border-radius:8px;padding:8px 12px;font:600 13px system-ui}.ai-panel header button{background:#ffffff12;color:#f3ede1}.ai-panel .ai-note{font-size:12px;color:#bbb5aa;padding:10px 14px;margin:0}.ai-messages{overflow-y:auto;min-height:80px;max-height:36dvh;padding:14px;overscroll-behavior:contain}.ai-bubble{white-space:pre-wrap;overflow-wrap:anywhere;padding:10px 12px;margin-bottom:12px;border-radius:10px;background:#ffffff0c}.ai-user{margin-left:28px;background:#b28c382b}.ai-assistant{margin-right:12px}.ai-status{padding:0 14px;margin:6px 0;font-size:13px;color:#e3b65c}.ai-panel form{display:grid;gap:8px;padding:14px}.ai-panel textarea{box-sizing:border-box;width:100%;resize:vertical;max-height:160px;min-height:72px;border:1px solid #716247;border-radius:8px;padding:10px;background:#101116;color:#fff;font:14px system-ui}.ai-panel button:disabled{opacity:.5;cursor:wait}.ai-panel :focus-visible,.ai-toggle:focus-visible{outline:2px solid #fff0bd;outline-offset:3px}@media(max-width:480px){.ai-panel{right:16px;bottom:78px}.ai-toggle{right:16px;bottom:16px}}

.ai-panel header{flex-wrap:wrap}.ai-panel header strong{min-width:160px}.ai-tabs{display:flex;gap:8px;padding:12px 14px;overflow-x:auto;border-bottom:1px solid #ffffff20}.ai-tabs button{flex-shrink:0;max-width:230px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;background:#ffffff10;color:#ddd;border:1px solid transparent}.ai-tabs button.active{background:#e3b65c;color:#18130d;border-color:#ffe2a0}.ai-usage{margin:0;padding:10px 14px;color:#d6cbb6;font-size:12px;border-bottom:1px solid #ffffff16}.ai-panel a{color:#e3b65c}.ai-panel input[type=file]{max-width:100%;color:#ccc}.ai-panel [data-attachments]{display:grid;gap:6px;font-size:13px;overflow-wrap:anywhere}.ai-panel [data-attachments] button{padding:3px 8px;background:#ffffff12;color:#ddd}@media(max-width:480px){.ai-panel header{gap:6px}.ai-panel header button{padding:7px;font-size:12px}}

.ai-library{box-sizing:border-box;width:min(720px,calc(100vw - 24px));max-height:85dvh;background:#191a20;color:#f3ede1;border:1px solid #8e7443;border-radius:14px;padding:22px}.ai-library::backdrop{background:#000b}.ai-library [data-library-list]{max-height:48dvh;overflow:auto;margin:12px 0}.ai-library label{display:flex;gap:8px;padding:8px;overflow-wrap:anywhere}.ai-library input[type=search]{box-sizing:border-box;width:100%;padding:10px;background:#101116;color:#fff;border:1px solid #716247;border-radius:8px}.ai-library button{padding:10px 15px;margin:4px;border:0;border-radius:8px;background:#e3b65c;color:#18130d;cursor:pointer}.ai-library [role=status]{color:#e3b65c}

.ai-theme-toggle{position:fixed;right:14px;top:12px;z-index:950;padding:9px 14px;border:1px solid #8e7443;border-radius:20px;background:#24242d;color:#f3ede1;cursor:pointer;font:600 13px system-ui}.ai-panel{margin-top:60px!important}.ai-citation{font-weight:600;text-decoration:underline}.ai-sources{white-space:normal;font-size:12px;padding-top:10px;border-top:1px solid #ffffff20;margin-top:10px}.ai-sources a{display:inline-block;margin:3px 8px 3px 0;overflow-wrap:anywhere}
html[data-theme=light]{color-scheme:light}html[data-theme=light] body{background:#f3f5f8;color:#202b3c}html[data-theme=light] .ai-panel,html[data-theme=light] .ai-auth,html[data-theme=light] .ai-library{background:#fff;color:#202b3c;border-color:#bdc8d8;box-shadow:0 12px 42px #10244518}html[data-theme=light] .ai-panel header,html[data-theme=light] .ai-tabs,html[data-theme=light] .ai-usage{border-color:#dce2eb}html[data-theme=light] .ai-panel textarea,html[data-theme=light] .ai-auth input,html[data-theme=light] .ai-library input[type=search]{background:#fff;color:#202b3c;border-color:#a7b6c9}html[data-theme=light] .ai-panel .ai-note{color:#53647a}html[data-theme=light] .ai-usage{color:#465870}html[data-theme=light] .ai-bubble{background:#f0f3f7}html[data-theme=light] .ai-user{background:#fff3d6}html[data-theme=light] .ai-status,html[data-theme=light] .ai-auth [role=status],html[data-theme=light] .ai-library [role=status]{color:#805000}html[data-theme=light] .ai-panel a{color:#725000}html[data-theme=light] .ai-panel header button,html[data-theme=light] .ai-tabs button,html[data-theme=light] .ai-panel [data-attachments] button{background:#eaf0f7;color:#273c56}html[data-theme=light] .ai-tabs button.active{background:#e3b65c;color:#18130d}html[data-theme=light] .ai-theme-toggle{background:#fff;color:#273c56;border-color:#a7b6c9}html[data-theme=light] .ai-panel input[type=file]{color:#273c56}html[data-theme=light] .ai-panel :focus-visible{outline-color:#315d96}html[data-theme=light] .ai-sources{border-color:#dce2eb}
