.agent-launcher{position:fixed;right:20px;bottom:20px;z-index:95;border:1px solid #1e40af;border-radius:30px;padding:13px 20px;background:#2046a7;color:white;font:700 15px system-ui,sans-serif;box-shadow:0 4px 18px #0003;cursor:pointer}
.agent-dialog{position:fixed;inset:auto 16px 80px auto;width:min(460px,calc(100vw - 24px));height:min(650px,calc(100dvh - 110px));max-width:none;max-height:none;margin:0;padding:0;border:1px solid var(--line,#cbd5e1);border-radius:14px;background:var(--card,#fff);color:var(--text,#16211c);box-shadow:0 12px 45px #0005;font:14px/1.5 system-ui,sans-serif}
.agent-dialog{box-sizing:border-box;overflow:hidden}
.agent-dialog[open]{display:flex;flex-direction:column}
.agent-dialog::backdrop{background:#0004}
.agent-dialog>header{display:flex;justify-content:space-between;align-items:center;padding:14px 16px;border-bottom:1px solid var(--line,#cbd5e1);background:#2046a7;color:#fff}
.agent-dialog h2{font:700 18px system-ui,sans-serif;margin:0;color:inherit}
.agent-dialog header p{font-size:12px;margin:3px 0 0;color:#fff}
.agent-dialog header button{background:transparent;border:1px solid #ffffff80;color:#fff;font-size:24px;line-height:1;width:32px;height:32px;border-radius:5px;cursor:pointer}
.agent-messages{flex:1;min-height:80px;overflow:auto;padding:14px}
.agent-message{margin:0 0 12px;background:var(--soft,#eff3f8);padding:10px 12px;border-radius:9px;white-space:pre-wrap;overflow-wrap:anywhere}
.agent-user-message{margin-left:24px;background:#dbeafe;color:#153763}
.agent-dialog .agent-answer{white-space:normal;line-height:1.65;min-width:0}
.agent-dialog .agent-answer :is(p,ul,ol,blockquote,pre,.agent-answer-table){margin:0 0 12px;color:inherit}
.agent-dialog .agent-answer>:last-child{margin-bottom:0}
.agent-dialog .agent-answer :is(h3,h4,h5,h6){font-family:inherit;font-weight:700;line-height:1.4;font-size:15px;color:inherit;margin:16px 0 8px}
.agent-dialog .agent-answer>:first-child{margin-top:0}
.agent-dialog .agent-answer :is(ul,ol){padding-left:24px;list-style-position:outside}
.agent-dialog .agent-answer ul{list-style-type:disc}
.agent-dialog .agent-answer ol{list-style-type:decimal}
.agent-dialog .agent-answer li{margin:5px 0}
.agent-dialog .agent-answer a{color:#1d4ed8;text-decoration:underline;overflow-wrap:anywhere}
[data-theme="dark"] .agent-dialog .agent-answer a{color:#facc15}
.agent-dialog .agent-answer blockquote{border-left:3px solid #7c93b3;padding-left:12px}
.agent-dialog .agent-answer code{font:12px/1.6 ui-monospace,monospace;background:#0001;border-radius:4px;padding:2px 4px}
.agent-dialog .agent-answer pre{overflow:auto;white-space:pre;padding:10px;background:#0001;border-radius:6px}
.agent-dialog .agent-answer pre code{padding:0;background:none}
.agent-dialog .agent-answer hr{border:0;border-top:1px solid #8495aa;margin:14px 0}
.agent-dialog .agent-answer-table{max-width:100%;overflow-x:auto;overscroll-behavior-x:contain}
.agent-dialog .agent-answer table{border-collapse:collapse;width:100%;font:inherit;font-size:13px;background:transparent;color:inherit;margin:0}
.agent-dialog .agent-answer :is(th,td){border:1px solid #8495aa;padding:8px;vertical-align:top;text-align:left;min-width:90px;white-space:normal;color:inherit;background:transparent}
.agent-dialog .agent-answer th{font-weight:700;background:#0001}
.agent-dialog .agent-message{color:#17212c;background:#edf2f8}
.agent-dialog .agent-user-message{color:#153763;background:#dbeafe}
[data-theme="dark"] .agent-dialog .agent-message{color:#f1f5f9;background:#334155}
[data-theme="dark"] .agent-dialog .agent-user-message{color:#e0efff;background:#1e40af}
.agent-choices{display:flex;flex-wrap:wrap;gap:7px;margin:0 0 14px}
.agent-choices :is(button,a),.agent-topics button{font:inherit;padding:7px 10px;background:transparent;color:var(--text,#173a66);border:1px solid #7791b8;border-radius:6px;text-decoration:none;cursor:pointer}
.agent-choices button:disabled{opacity:.5;cursor:default}
.agent-topics{display:flex;flex-wrap:wrap;gap:5px;padding:0 14px 10px}
.agent-topics button{font-size:12px;padding:4px 8px}
#agentQuestion{padding:10px 14px 14px;border-top:1px solid var(--line,#cbd5e1)}
#agentQuestion label{display:block;font-weight:600;font-size:13px;margin-bottom:5px}
#agentInput{display:block;resize:vertical;min-height:58px;max-height:130px;width:100%;padding:9px;border:1px solid #8a9fb8;border-radius:6px;background:var(--card,#fff);color:var(--text,#16211c);font:inherit;box-sizing:border-box}
.agent-form-actions{display:flex;align-items:center;gap:10px;justify-content:space-between;margin-top:8px}
#agentStatus{font-size:12px;color:var(--muted,#536478)}
#agentSend{border:0;background:#2046a7;color:white;border-radius:5px;padding:8px 15px;font:600 14px system-ui,sans-serif;cursor:pointer}
#agentSend:disabled{opacity:.5;cursor:default}
.agent-dialog :is(button,a,textarea):focus-visible,.agent-launcher:focus-visible{outline:2px solid #eab308;outline-offset:2px}
[data-theme="dark"] :is(.agent-launcher,#agentSend){background:#facc15;color:#211a04;border-color:#facc15}
[data-theme="dark"] .agent-choices :is(button,a),[data-theme="dark"] .agent-topics button{color:#facc15;border-color:#facc15}
@media(max-width:560px){.agent-dialog{inset:auto 12px 76px 12px;width:auto}.agent-launcher{bottom:15px;right:15px}}
@media print{.agent-launcher,.agent-dialog{display:none!important}}
