#maandao-chat-root[hidden],.maandao-chat-panel[hidden],.maandao-chat-launcher[hidden],.maandao-chat-confirm[hidden]{display:none!important}
#maandao-chat-root{--chat-plum:#382449;--chat-cream:#f7f0e7;--chat-gold:#e4c995;position:relative;z-index:45;font-family:var(--sans,'Noto Sans Thai',sans-serif)}
.maandao-chat-launcher{position:fixed;right:25px;bottom:22px;width:76px;height:82px;display:flex;align-items:center;justify-content:center;background:transparent;border:0;padding:2px;cursor:pointer;color:#fff3df;border-radius:16px;transition:transform .18s}
.maandao-chat-launcher>img{width:72px;height:72px;object-fit:contain;filter:drop-shadow(0 5px 8px #140d2670)}
.maandao-chat-launcher>.maandao-chat-invitation{position:absolute;right:84px;bottom:10px;width:224px;max-width:calc(100vw - 130px);background:#fff7e9;border:1px solid #cfb6df;border-radius:17px 17px 5px 17px;padding:11px 15px;color:#4d315f;box-shadow:0 5px 22px #170d2338;text-align:left;white-space:normal;cursor:pointer}
.maandao-chat-invitation::after{content:'';position:absolute;right:-6px;top:calc(50% - 6px);width:10px;height:10px;transform:rotate(45deg);background:#fff7e9;border-top:1px solid #cfb6df;border-right:1px solid #cfb6df}
.maandao-chat-invitation strong{display:block;font:500 13px/1.7 var(--sans,'Noto Sans Thai',sans-serif)}.maandao-chat-invitation small{display:block;margin-top:2px;font:400 11px/1.6 var(--sans,'Noto Sans Thai',sans-serif);color:#886495}
.maandao-chat-launcher[aria-expanded="true"]>.maandao-chat-invitation{display:none}.maandao-chat-launcher:hover{transform:translateY(-3px)}
#maandao-chat-root button:focus-visible,#maandao-chat-root textarea:focus-visible,#maandao-chat-root summary:focus-visible,.maandao-chat-feed:focus-visible{outline:3px solid #b48bcc;outline-offset:3px}
.maandao-chat-panel{position:fixed;right:28px;bottom:112px;width:min(394px,calc(100% - 32px));height:min(660px,calc(100dvh - 140px));min-height:270px;background:var(--chat-cream);color:var(--chat-plum);border:1px solid #cdb6d1;border-radius:23px;box-shadow:0 18px 65px #120b2650;overflow:hidden;display:flex;flex-direction:column;text-align:left;isolation:isolate}
.maandao-chat-header{display:flex;align-items:center;gap:11px;padding:15px 17px;background:linear-gradient(120deg,#453057,#2b1d3b);color:#f8eddf;flex-shrink:0}
.maandao-chat-portrait{height:49px;width:49px;flex:0 0 49px}.maandao-chat-portrait img{width:100%;height:100%;object-fit:contain}
.maandao-chat-header h2{font-family:var(--serif);font-size:19px;line-height:1.6;font-weight:500;margin:0}.maandao-chat-header h2 span{color:var(--chat-gold)}.maandao-chat-header p{font-size:11px;line-height:1.7;margin:1px 0 0;color:#decae9}
.maandao-chat-close{width:36px;height:36px;border:1px solid #c9acdb40;border-radius:50%;margin-left:auto;background:#ffffff08;color:#f7e8d8;cursor:pointer;flex-shrink:0;font-size:16px}
.maandao-chat-tools{padding:9px 16px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #dbcddd;color:#7d6588;font-size:10px;flex-shrink:0}.maandao-chat-tools button{font:inherit;color:#755385;padding:4px 0;background:none;border:0;text-decoration:underline;text-underline-offset:3px;cursor:pointer}
.maandao-chat-confirm{background:#e8ddec;padding:12px 16px;flex-shrink:0;font-size:12px}.maandao-chat-confirm p{margin:0 0 8px}.maandao-chat-confirm button{padding:8px 12px;border:1px solid #9d7faf;border-radius:9px;background:#fff9f0;color:#4a315b;font:inherit;cursor:pointer;margin-right:5px;min-height:36px}
.maandao-chat-feed{min-height:65px;flex:1;overflow-y:auto;overscroll-behavior:contain;padding:17px 15px;scrollbar-width:thin;scrollbar-color:#b8a1c2 transparent}
.maandao-chat-message{display:flex;flex-direction:column;align-items:flex-start;margin-bottom:15px;overflow-wrap:anywhere}.maandao-chat-message:last-child{margin-bottom:0}.maandao-chat-speaker{font-size:10px;color:#816b8c;margin:0 0 5px 5px}.maandao-chat-message.user{align-items:flex-end}.maandao-chat-message.user .maandao-chat-speaker{margin:0 5px 5px 0}
.maandao-chat-bubble{max-width:94%;background:#fffcf7;border:1px solid #e6dce8;border-radius:3px 16px 16px 16px;padding:12px 14px;font-size:13px;line-height:1.95;color:#483153;box-shadow:0 2px 4px #52355e04;white-space:pre-wrap}
.maandao-chat-bubble p{margin:0 0 10px}.maandao-chat-bubble p:last-child{margin-bottom:0}.maandao-chat-message.user .maandao-chat-bubble{background:#644479;border-color:#644479;color:#fff8ef;border-radius:16px 3px 16px 16px}
.maandao-chat-bubble small{display:block;margin-top:12px;padding-top:10px;border-top:1px solid #ddcede;font-size:10px;line-height:1.9;color:#806888}
.maandao-chat-menu-actions{display:grid;gap:7px;margin-top:12px;white-space:normal}.maandao-chat-menu-actions button{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;border:1px solid #ccb5da;background:#f3eaf8;border-radius:9px;color:#5a3672;padding:10px 11px;font:500 12px/1.7 var(--sans,'Noto Sans Thai',sans-serif);text-align:left;cursor:pointer;min-height:42px}.maandao-chat-menu-actions button:hover{background:#e8d8f1}.maandao-chat-menu-actions button span{color:#9770ae;font-size:16px}
.maandao-chat-suggestions{display:flex;flex-wrap:wrap;gap:6px;padding:5px 15px 12px;flex-shrink:0;border-top:1px solid #e5dbe6;padding-top:12px}.maandao-chat-suggestions button{border:1px solid #cbb5d6;border-radius:30px;background:#fcf8f1;color:#69487b;font:400 11px/1.6 var(--sans,'Noto Sans Thai',sans-serif);padding:7px 11px;cursor:pointer;min-height:34px}.maandao-chat-suggestions button:hover{background:#eaddf2}
.maandao-chat-form{padding:0 14px 4px;margin:0;flex-shrink:0}.maandao-chat-form>div{display:flex;align-items:center;gap:7px;border:1px solid #bba1c7;border-radius:14px;background:#fffdf9;padding:6px 7px 6px 12px}.maandao-chat-input-label{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.maandao-chat-form textarea{display:block;flex:1;width:0;min-width:0;max-height:96px;min-height:38px;resize:vertical;padding:7px 0;margin:0;border:0;border-radius:0;background:transparent;color:#382449;font:400 14px/1.7 var(--sans,'Noto Sans Thai',sans-serif);box-shadow:none}.maandao-chat-form textarea::placeholder{color:#99839f}.maandao-chat-form button{width:39px;height:39px;border:0;border-radius:11px;background:#6f478b;color:#fff6e7;cursor:pointer;flex-shrink:0}.maandao-chat-form button:disabled{background:#e7dfeb;color:#aa96b4;cursor:default}.maandao-chat-form button svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linejoin:round;stroke-linecap:round;vertical-align:middle}.maandao-chat-counter{font-size:10px;margin:0;text-align:right;color:#82648f;min-height:3px}
.maandao-chat-about{font-size:10px;padding:4px 17px 11px;color:#82688d;flex-shrink:0}.maandao-chat-about summary{cursor:pointer;width:fit-content}.maandao-chat-about p{font-size:11px;line-height:1.9;margin:6px 0 0;max-height:75px;overflow:auto}
.sidebar-chat-button{margin-top:17px;width:100%;display:flex;align-items:center;gap:10px;padding:9px 12px;border:1px solid #c2a1d742;background:#c4a0d70c;border-radius:12px;color:#dfc7eb;font:400 12px var(--sans);text-align:left;cursor:pointer}.sidebar-chat-button img{width:37px;height:37px;object-fit:contain}.sidebar-chat-button:hover{background:#c4a0d71c}
@media(max-width:650px){.maandao-chat-launcher{right:13px;bottom:calc(84px + env(safe-area-inset-bottom));width:64px;height:68px}.maandao-chat-launcher>img{width:60px;height:60px}.maandao-chat-launcher>.maandao-chat-invitation{right:72px;bottom:5px;width:206px;max-width:calc(100vw - 112px);padding:10px 12px}.maandao-chat-invitation strong{font-size:12px}.maandao-chat-invitation small{font-size:10px}.maandao-chat-panel{right:12px;bottom:calc(86px + env(safe-area-inset-bottom));width:calc(100% - 24px);height:min(620px,calc(100dvh - 108px - env(safe-area-inset-bottom)));border-radius:20px}.maandao-chat-launcher[aria-expanded="true"]{visibility:hidden}.maandao-chat-header{padding:12px 14px}.maandao-chat-feed{padding:14px 12px}.maandao-chat-bubble{font-size:13px}.maandao-chat-form textarea{font-size:16px}.maandao-chat-suggestions{padding-left:12px;padding-right:12px}.maandao-chat-header h2{font-size:18px}}
@media(prefers-reduced-motion:reduce){.maandao-chat-launcher{transition:none}}

.maandao-chat-history[hidden],.maandao-chat-typing[hidden],.maandao-chat-feedback[hidden]{display:none!important}.maandao-chat-history{display:flex;gap:7px;padding:8px 13px;border-bottom:1px solid #ddcfdf;flex-shrink:0}.maandao-chat-history select{flex:1;min-width:0;border:1px solid #cbb5d6;border-radius:8px;background:#fffaf3;color:#664477;padding:7px;font:400 12px var(--sans)}.maandao-chat-history button{min-width:34px;min-height:34px;border:1px solid #cbb5d6;border-radius:8px;color:#765086;background:#f7effb;cursor:pointer;font:400 12px var(--sans)}.maandao-chat-history button:disabled{opacity:.45;cursor:default}.maandao-chat-typing{padding:5px 16px 9px;color:#9167a3;font-size:11px;flex-shrink:0}.maandao-chat-feedback{padding:9px 14px;background:#f5e1e5;color:#8b3654;font-size:11px;line-height:1.8;flex-shrink:0;max-height:100px;overflow:auto}.maandao-chat-feedback p{margin:0}.maandao-chat-feedback button{margin-top:5px;padding:5px 10px;border:1px solid #bc91a9;border-radius:7px;background:#fff7f1;color:#8b3654;cursor:pointer;font:inherit}.maandao-chat-gate{text-align:center;padding:12px 6px;color:#654476}.maandao-chat-gate>img{height:88px;width:88px;object-fit:contain;margin:0 auto}.maandao-chat-gate h3{font:500 20px/1.8 var(--serif);margin:12px 0}.maandao-chat-gate p{font-size:13px;line-height:2;margin:10px 0 18px}.maandao-chat-gate button{background:#78528e;color:#fff6e5;border:0;border-radius:11px;padding:11px 16px;font:400 13px var(--sans);cursor:pointer}.maandao-chat-suggestions button:disabled{opacity:.45;cursor:wait}.maandao-chat-form textarea:disabled{opacity:.6;resize:none}
