/* Layout adapted from aiphapluat/widget/src/ChatWidget.css; standalone portal UI. */
.chat-launcher{display:flex;flex-direction:column;align-items:center;gap:8px;background:none;padding:0;width:164px;color:#263648;pointer-events:auto}.chat-launcher-icon{display:flex;align-items:center;justify-content:center;width:64px;height:64px;border-radius:50%;color:#fff;background:linear-gradient(135deg,#1689ef,#0561c6);box-shadow:0 4px 20px #137fe64d;transition:transform .2s,box-shadow .2s}.chat-launcher-icon .icon{width:31px;height:31px}.chat-launcher-label{font-size:13px;font-weight:600;background:#fff;padding:6px 13px;border-radius:30px;box-shadow:0 3px 15px #00000015;white-space:nowrap}.chat-launcher:hover{color:#075faf}.chat-launcher:hover .chat-launcher-icon{transform:scale(1.06);box-shadow:0 6px 26px #137fe675}.floating-actions{align-items:center;width:164px}.floating-actions .feedback-trigger{padding:9px 13px;font-size:11px;min-height:40px}.floating-actions .feedback-trigger .icon{width:19px;height:19px}.floating-actions #back-to-top{width:38px;height:38px}.chatbot-dialog{position:fixed;inset:auto 24px 24px auto;margin:0;width:min(80vw,1200px);height:80dvh;max-height:calc(100dvh - 48px);min-width:340px;padding:0;border:1px solid #dce4ed;border-radius:16px;background:#fff;color:#2b3442;box-shadow:0 15px 70px #00143c40;overflow:hidden;font-size:16px}.chatbot-dialog::backdrop{background:#00143c73;backdrop-filter:blur(2px)}.chatbot-dialog.fullscreen{inset:0;width:100vw;height:100dvh;max-width:none;max-height:none;min-width:0;border-radius:0;border:0}.chatbot-layout{display:flex;height:100%;min-height:0}.chatbot-history{width:250px;flex-shrink:0;background:#f5f7fa;border-right:1px solid #e7ebf0;display:flex;flex-direction:column;min-height:0}.chatbot-history-title{display:flex;align-items:center;justify-content:space-between;font-size:12px;letter-spacing:.06em;font-weight:600;padding:22px 18px;min-height:72px;background:#fff;border-bottom:1px solid #e7ebf0;color:#68717e}.chatbot-history-title>button{display:none}.chatbot-history-list{flex:1;min-height:0;overflow-y:auto;padding:12px}.chatbot-history-empty{text-align:center;color:#6e7887;font-size:13px;padding:35px 12px;line-height:1.8}.chatbot-history-empty .icon{width:34px;height:34px;color:#929eb0;display:block;margin:0 auto 17px}.chatbot-history-empty p+p{font-size:12px;margin-top:8px}.chatbot-history-entry{display:flex;align-items:flex-start;gap:10px;width:100%;padding:12px 10px;border:1px solid transparent;border-radius:7px;text-align:left;color:#566375;background:none}.chatbot-history-entry .icon{width:17px;height:17px;margin-top:3px}.chatbot-history-entry span{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px}.chatbot-history-entry small{display:block;font-size:10px;margin-top:4px;color:#738298}.chatbot-history-entry[aria-current="true"]{background:#e7f1ff;color:#075fae;border-color:#d0e4fc}.chatbot-history-entry:hover{background:#edf3fa;color:#075fae}.chatbot-history-footer{padding:12px;border-top:1px solid #e7ebf0;background:#fff}.chatbot-history-footer>p{font-size:10px;text-align:center;color:#717e91;margin-bottom:9px}.chatbot-new{display:flex;align-items:center;justify-content:center;gap:9px;width:100%;padding:12px;background:linear-gradient(120deg,#1689ef,#0561c6);color:#fff;border-radius:10px;font-size:13px;font-weight:600;box-shadow:0 3px 12px #137fe62b}.chatbot-new:hover{color:#fff;background:#075fae}.chatbot-new .icon{width:17px;height:17px}.chatbot-main{flex:1;display:flex;flex-direction:column;min-width:0;min-height:0;background:#f5f7fb}.chatbot-header{min-height:72px;background:linear-gradient(115deg,#1689ef,#0355b6);color:#fff;display:flex;align-items:center;gap:12px;padding:14px 19px;flex-shrink:0}.chatbot-header-icon{display:flex;align-items:center;justify-content:center;width:38px;height:38px;flex-shrink:0;border-radius:50%;background:#ffffff26;border:1px solid #ffffff38}.chatbot-header-icon .icon{width:22px;height:22px}.chatbot-header>div:not(.chatbot-header-actions){min-width:0;flex:1}.chatbot-header h2{font-size:16px;line-height:1.5;font-weight:600;color:#fff}.chatbot-header p{display:flex;align-items:center;gap:6px;font-size:11px;margin-top:3px;color:#fff}.chatbot-status-dot{width:6px;height:6px;background:#ffdf85;border-radius:50%;display:inline-block}.chatbot-header-actions{display:flex;align-items:center;gap:6px}.chatbot-header-button{display:flex;align-items:center;justify-content:center;width:34px;height:32px;border-radius:20px;background:#ffffff1a;border:1px solid #ffffff35;color:#fff;flex-shrink:0}.chatbot-header-button:hover{color:#fff;background:#ffffff36}.chatbot-header-button .icon{width:17px;height:17px}#chat-history-toggle{display:none}.chatbot-scroll{flex:1;overflow-y:auto;min-height:0;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#c7d5e6 transparent}.chatbot-welcome{min-height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:28px 32px;text-align:center;gap:14px}.chatbot-welcome-icon{width:76px;height:76px;display:flex;align-items:center;justify-content:center;border-radius:50%;background:#e5f3ff;color:#1483e7;flex-shrink:0}.chatbot-welcome-icon .icon{width:42px;height:42px}.chatbot-welcome h3{font-size:23px;line-height:1.5;color:#29364a}.chatbot-welcome>p{max-width:450px;font-size:15px;line-height:1.7;color:#5a697e}.chatbot-tools{width:100%;max-width:540px;margin-top:5px}.chatbot-tools h4{font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.055em;color:#65788e;margin:0 0 12px}.chatbot-tools>div{display:grid;grid-template-columns:1fr 1fr;gap:10px}.chatbot-tools button{display:flex;align-items:center;gap:10px;background:#f9fbfe;border:1px solid #dce5f0;border-radius:8px;padding:12px 13px;font-size:14px;text-align:left;color:#096cc1;min-width:0}.chatbot-tools button:hover{background:#e9f3ff;border-color:#a2c9ed;color:#065397}.chatbot-tools button>.icon{width:19px;height:19px}.chatbot-tools button>.icon:last-child{margin-left:auto;width:14px;height:14px}.chatbot-welcome .chatbot-demo-note{font-size:11px;max-width:540px;color:#66778e}.chatbot-messages{padding:26px;display:flex;flex-direction:column;gap:24px}.chatbot-message{display:flex;align-items:flex-start;gap:10px;max-width:85%}.chatbot-message.user{align-self:flex-end;flex-direction:row-reverse}.chatbot-message.assistant{align-self:flex-start}.chatbot-message-avatar{width:31px;height:31px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:#e1edfb;color:#1776c9;flex-shrink:0}.chatbot-message-avatar .icon{width:18px;height:18px}.chatbot-message.user .chatbot-message-avatar{background:#d9e4f2;color:#487098}.chatbot-bubble{padding:13px 17px;border-radius:13px;white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.75;font-size:16px;background:#fff;border:1px solid #e4eaf2}.chatbot-message.user .chatbot-bubble{background:#187ee0;border-color:#187ee0;color:#fff;border-top-right-radius:3px}.chatbot-message.assistant .chatbot-bubble{border-top-left-radius:3px;color:#3d4a5b}.chatbot-message-time{display:block;font-size:10px;margin-top:6px;color:#74839a}.chatbot-message.user .chatbot-message-time{text-align:right}.chatbot-footer{background:#fff;padding:13px 16px 10px;border-top:1px solid #e7ebf0;flex-shrink:0}.chatbot-footer #ai-form{display:flex;align-items:flex-end;gap:9px;background:#f4f6fa;border:1px solid #dce5f0;border-radius:24px;padding:7px 9px 7px 16px}.chatbot-footer textarea{flex:1;border:0;background:transparent;resize:none;padding:6px 0;margin:0;line-height:1.6;min-height:35px;max-height:140px;font-size:14px;color:#2e3e53;outline-offset:5px;width:100%}.chatbot-footer textarea::placeholder{font-size:12px;color:#64758c}.chatbot-footer button{width:35px;height:35px;flex-shrink:0;border-radius:50%;background:#1684e9;color:#fff;display:flex;align-items:center;justify-content:center}.chatbot-footer button:hover{color:#fff;background:#0969bc}.chatbot-footer button:disabled{opacity:.45}.chatbot-footer .icon{width:18px;height:18px}.chatbot-footer>p{font-size:10px;line-height:1.5;color:#6b7a8e;text-align:center;margin-top:8px}.chatbot-tools-after{display:flex;flex-wrap:wrap;gap:7px;margin-top:12px}.chatbot-tools-after button{padding:6px 10px;background:#eaf3fd;border:1px solid #cbdef1;border-radius:5px;font-size:12px;color:#0966b5}
@media(max-width:1050px){.chatbot-dialog{width:calc(100vw - 48px)}.chatbot-history{width:215px}.chatbot-welcome{padding:25px 22px}.chatbot-header h2{font-size:14px}.chatbot-tools button{font-size:13px}.chatbot-tools>div{gap:8px}}
@media(max-width:768px){.chatbot-dialog{inset:0;width:100vw;height:100dvh;max-height:100dvh;max-width:none;min-width:0;border-radius:0;border:0}.chatbot-history{display:none;position:absolute;inset:0 auto 0 0;width:min(290px,85vw);z-index:3;box-shadow:8px 0 30px #00143c33}.chatbot-dialog.history-open .chatbot-history{display:flex}.chatbot-history-title>button{display:flex;align-items:center;justify-content:center;width:30px;height:30px;border-radius:50%;background:#f0f3f7;color:#4c6380}#chat-history-toggle{display:flex}.chatbot-header{gap:9px;padding:12px;min-height:74px}.chatbot-header-icon{display:none}.chatbot-header h2{font-size:14px}.chatbot-header p{font-size:10px}.chatbot-header-actions{gap:4px}.chatbot-header-button{width:30px;height:30px}#chat-fullscreen{display:none}.chatbot-welcome{padding:24px 20px;gap:14px}.chatbot-welcome h3{font-size:21px}.chatbot-welcome-icon{width:64px;height:64px}.chatbot-welcome-icon .icon{width:35px;height:35px}.chatbot-welcome>p{font-size:15px}.chatbot-tools>div{grid-template-columns:1fr}.chatbot-tools button{font-size:15px;padding:12px}.chatbot-tools h4{margin-bottom:10px}.chatbot-messages{padding:20px 14px}.chatbot-message{max-width:95%}.chatbot-message-avatar{width:26px;height:26px}.chatbot-bubble{font-size:16px;padding:11px 13px}.chatbot-footer{padding:10px 12px calc(10px + env(safe-area-inset-bottom))}.chatbot-footer textarea{font-size:16px}.chatbot-footer textarea::placeholder{font-size:12px}.floating-actions{width:146px;right:14px;bottom:16px;gap:10px}.chat-launcher{width:146px;gap:6px}.chat-launcher-icon{width:56px;height:56px}.chat-launcher-label{font-size:12px;padding:5px 11px}.floating-actions .feedback-trigger{width:40px;height:40px;padding:0;min-height:0}.floating-actions .feedback-trigger span{display:none}.floating-actions #back-to-top{width:34px;height:34px}}
.chatbot-footer #ai-form:focus-within{border-color:#80b8ee;box-shadow:0 0 0 2px #c2dffd}.chatbot-footer textarea:focus-visible{outline:none}
@media(prefers-reduced-motion:reduce){.chat-launcher-icon{transition:none}}
.chatbot-sources-title {display:block;margin-top:14px;font-size:.85rem}
.chatbot-sources {padding-left:20px;margin:6px 0 0;font-size:.85rem}
.chatbot-sources li {margin-top:6px;overflow-wrap:anywhere}
.chatbot-sources a {color:#8a1515;text-decoration:underline}
.chatbot-header-button .icon{pointer-events:none}
.chatbot-tools button[aria-pressed="true"]{background:#e4f1ff;border-color:#84b6e8}
.chatbot-composer-tools{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:9px;font-size:12px;color:#465974}
.chatbot-composer-tools select{border:1px solid #c7d5e6;border-radius:6px;padding:6px 8px;background:#fff;color:#2e3e53;max-width:100%;font-size:12px}
.chatbot-footer .chatbot-upload-button{border-radius:6px;width:auto;height:32px;padding:0 10px;gap:5px;font-size:12px;background:#0869c3}
.chatbot-upload-help{font-size:10px;flex-basis:100%;color:#526275}
.chatbot-files{display:flex;gap:7px;flex-wrap:wrap;margin-bottom:8px;max-height:115px;overflow-y:auto}
.chatbot-file-chip{display:flex;align-items:center;min-width:0;max-width:100%;background:#eff5fd;border:1px solid #cfdeef;border-radius:7px}
.chatbot-footer .chatbot-file-name{display:block;width:auto;height:auto;min-width:0;border-radius:0;background:transparent;color:#075ca6;padding:6px 9px;text-align:left;overflow-wrap:anywhere;font-size:12px}
.chatbot-file-name small{display:block;color:#526275;font-size:10px}
.chatbot-footer .chatbot-file-remove{width:28px;height:28px;margin-right:4px;background:#dce9f7;color:#325778}
.chatbot-upload-status{color:#465974;font-size:12px;line-height:1.5;margin-bottom:8px;overflow-wrap:anywhere}
.chatbot-upload-status.is-error{color:#a31920}
.chatbot-file-preview{border:1px solid #cedceb;border-radius:7px;padding:8px;margin-bottom:9px;background:#f8fbff}
.chatbot-file-preview>div{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:12px;overflow-wrap:anywhere}
.chatbot-file-preview pre{max-height:130px;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere;font-family:inherit;font-size:12px;line-height:1.6;margin-top:6px;color:#34485e}
.chatbot-attached-note{display:block;margin-top:8px;font-size:11px;opacity:.9}
.chatbot-answer-actions{display:flex;gap:7px;flex-wrap:wrap;margin-top:7px}
.chatbot-answer-actions button,.chatbot-retry{border:1px solid #cbdef1;border-radius:5px;padding:5px 9px;background:#eaf3fd;color:#075da6;font-size:12px}
.chatbot-answer-actions button:hover,.chatbot-retry:hover{background:#dbeafb}
.chatbot-draft-note{display:block;margin-bottom:5px;font-size:11px;color:#526275}
@media(max-width:768px){.chatbot-composer-tools{gap:6px}.chatbot-composer-tools select{flex:1;min-width:0}.chatbot-upload-help{font-size:10px}.chatbot-welcome{justify-content:flex-start}.chatbot-file-preview pre{max-height:100px}}
.chatbot-message > div {min-width:0;max-width:100%}
.chatbot-bubble {overflow-wrap:anywhere}
.chatbot-error {border:1px solid #bd5151;background:#fff3f3}
.chatbot-pending {font-style:italic}

.chatbot-privacy{display:flex;align-items:flex-start;gap:6px;font-size:11px;line-height:1.5;margin-top:6px;color:#33465c}.chatbot-privacy input{flex:none;width:16px;height:16px}.chatbot-answer-actions select{max-width:160px;border:1px solid #cbdef1;padding:5px;border-radius:5px}.chatbot-ocr-review{max-width:720px;width:calc(100% - 32px);max-height:90dvh;padding:24px;border:1px solid #ccc;border-radius:10px;overflow:auto}.chatbot-ocr-review label{display:block;margin:12px 0}.chatbot-ocr-review textarea{width:100%;font:inherit;line-height:1.6;padding:8px}.chatbot-ocr-review button{background:#801c2c;color:#fff;padding:10px;margin:8px;border-radius:6px}
