/* Chat widget: restrained single-surface layout, consistent across desktop and mobile. */
.ai-launcher{position:fixed;z-index:901;right:24px;bottom:24px;width:62px;height:62px;border:1px solid #ffffffbd;border-radius:20px;background:linear-gradient(145deg,#75a5ee,#476bd1 62%,#6659b8);box-shadow:0 12px 32px #415fad47,inset 0 1px 1px #fff8;color:#fff;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:1px;cursor:pointer;user-select:none;font-size:11px;font-weight:650}.ai-launcher-spark{font-size:23px;line-height:24px}
.ai-float[hidden]{display:none!important}.ai-float{position:fixed;z-index:902;box-sizing:border-box;width:410px;height:540px;display:flex;flex-direction:column;overflow:hidden;border:1px solid var(--jx-ui-border,#dce5ee);border-radius:20px;background:var(--jx-ui-surface,#fff);color:var(--jx-ui-text,#20334c);box-shadow:0 22px 65px #19314e30,0 5px 15px #19314e0c;font-family:inherit}
.ai-float-header{display:flex;align-items:center;gap:10px;flex:none;padding:14px 16px;border-bottom:1px solid var(--jx-ui-border,#e9edf4);cursor:move;touch-action:none;user-select:none}.ai-float-emblem{display:grid;place-items:center;flex:none;width:35px;height:35px;border-radius:11px;font-size:19px;color:var(--jx-ui-accent,#416fd3);background:var(--jx-ui-soft,#edf3fd)}.ai-float-heading{flex:1;min-width:0;display:flex;flex-direction:column;gap:4px}.ai-float-heading strong{font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ai-float-online{color:var(--jx-ui-muted,#8694a4);font-size:11px}.ai-float-close{width:32px;height:32px;padding:0;border:0;border-radius:10px;background:transparent;color:var(--jx-ui-muted,#8491a0);font:inherit;font-size:24px;line-height:1;cursor:pointer}.ai-float-close:hover{background:var(--jx-ui-soft,#edf3fd)}
.ai-float-answer{flex:1;min-height:0;overflow:auto;padding:18px 15px;scrollbar-width:thin;scrollbar-color:color-mix(in srgb,var(--jx-ui-muted,#8c9aac) 25%,transparent) transparent;overscroll-behavior:contain}.ai-float-answer::-webkit-scrollbar{width:5px}.ai-float-answer::-webkit-scrollbar-thumb{background:#99abc052;border-radius:10px}.ai-answer-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;min-height:100%;padding:25px 10px;box-sizing:border-box;gap:8px}.ai-answer-icon{display:grid;place-items:center;border-radius:16px;background:var(--jx-ui-soft,#edf3fd);color:var(--jx-ui-accent,#416fd3);font-size:25px;width:54px;height:54px;margin-bottom:10px}.ai-answer-empty strong{font-size:14px}.ai-answer-empty p{color:var(--jx-ui-muted,#8393a6);font-size:12px;margin:0}
.ai-chat-entry{display:flex;margin-bottom:18px;max-width:100%}.ai-chat-user{justify-content:flex-end}.ai-chat-assistant{justify-content:flex-start}.ai-chat-bubble{min-width:0;max-width:100%;overflow-wrap:anywhere;white-space:pre-wrap;font-size:13px;line-height:1.75}.ai-chat-user .ai-chat-bubble{background:var(--jx-ui-soft,#edf3fd);padding:10px 13px;border-radius:15px 15px 5px 15px;max-width:85%}.ai-chat-assistant .ai-chat-bubble{padding:1px 3px;flex:1}.ai-md-title{font-size:13px;font-weight:750;margin:9px 0 4px}.ai-md-list{position:relative;padding-left:14px}.ai-md-list::before{content:'•';position:absolute;left:2px;color:var(--jx-ui-muted,#8e9cad)}.ai-md-line{min-height:.4em}.ai-chat-bubble strong{font-weight:750}.ai-chat-bubble code{font:12px/1.6 ui-monospace,SFMono-Regular,Consolas,monospace;background:var(--jx-ui-soft,#f0f4fb);border-radius:4px;padding:2px 4px}.ai-chat-bubble pre{padding:12px;border-radius:9px;background:var(--jx-ui-soft,#f0f4fb);white-space:pre-wrap;overflow-wrap:anywhere}.ai-chat-error{font-size:12px;margin-top:10px;color:#d55255}.ai-typing{display:inline-flex;align-items:center;gap:5px;height:22px}.ai-typing i{width:6px;height:6px;display:block;background:var(--jx-ui-muted,#8c9aab);border-radius:50%;animation:ai-pulse 1s ease-in-out infinite}.ai-typing i:nth-child(2){animation-delay:.17s}.ai-typing i:nth-child(3){animation-delay:.34s}@keyframes ai-pulse{0%,80%,100%{opacity:.3;transform:translateY(0)}40%{opacity:1;transform:translateY(-3px)}}
.ai-float-compose{margin:0 12px 12px;padding:9px 11px 7px;flex:none;min-width:0;border:1px solid var(--jx-ui-border,#dce5ee);border-radius:17px;background:var(--jx-ui-surface,#fff);box-shadow:0 3px 12px #24416b0c;transition:border-color .15s,box-shadow .15s}.ai-float-compose:focus-within{border-color:var(--jx-ui-accent,#416fd3);box-shadow:0 0 0 3px #578fe819}.ai-float-compose textarea{display:block;box-sizing:border-box;width:100%;min-height:34px;max-height:138px;padding:7px 2px 4px;margin:0;resize:none;border:0!important;border-radius:0;background:transparent!important;color:inherit;outline:none!important;box-shadow:none!important;font:inherit;font-size:13px;line-height:1.5;overflow-y:auto;scrollbar-width:none}.ai-float-compose textarea::-webkit-scrollbar{display:none}.ai-float-compose textarea::placeholder{color:var(--jx-ui-muted,#8d9aaa)}.ai-float-actions{display:flex;align-items:center;justify-content:space-between;gap:9px;min-height:36px}.ai-float-status{font-size:10px;color:var(--jx-ui-muted,#8493a4);line-height:1.4}.ai-float-actions .ai-send{display:grid;place-items:center;width:34px;height:34px;min-width:34px;padding:0;border:0;border-radius:11px;background:var(--jx-ui-accent,#416fd3);color:#fff;cursor:pointer;transition:transform .12s,opacity .12s}.ai-float-actions .ai-send:hover:not(:disabled){transform:translateY(-1px)}.ai-float-actions .ai-send:disabled{cursor:not-allowed;opacity:.36}.ai-float-actions .ai-send.is-busy{opacity:.5}.ai-float button:focus-visible,.ai-launcher:focus-visible{outline:2px solid var(--jx-ui-accent,#416fd3)!important;outline-offset:2px}.ai-float .ai-float-compose textarea:focus-visible{outline:none!important;box-shadow:none!important}
.ai-resize{position:absolute;touch-action:none;z-index:3}.ai-resize-n,.ai-resize-s{left:12px;right:12px;height:10px;cursor:ns-resize}.ai-resize-n{top:-5px}.ai-resize-s{bottom:-5px}.ai-resize-e,.ai-resize-w{top:12px;bottom:12px;width:10px;cursor:ew-resize}.ai-resize-e{right:-5px}.ai-resize-w{left:-5px}.ai-resize-ne,.ai-resize-nw,.ai-resize-se,.ai-resize-sw{width:16px;height:16px}.ai-resize-ne{right:-5px;top:-5px;cursor:nesw-resize}.ai-resize-nw{left:-5px;top:-5px;cursor:nwse-resize}.ai-resize-se{right:-5px;bottom:-5px;cursor:nwse-resize}.ai-resize-sw{left:-5px;bottom:-5px;cursor:nesw-resize}
@media(max-width:560px){.ai-launcher{right:14px;bottom:14px}.ai-float{border-radius:15px}.ai-float-header{padding:11px 12px}.ai-float-compose{margin:0 9px 9px}}@media(prefers-reduced-motion:reduce){.ai-typing i{animation:none}}
/* Chat history and image attachments. Use existing theme variables. */
.ai-float .ai-icon-button{flex:none;width:29px;height:29px;border:0;border-radius:9px;background:transparent;color:var(--jx-ui-muted,#6c7b8f);font-size:18px;cursor:pointer}.ai-float .ai-icon-button:hover{background:var(--jx-ui-soft,#edf3fd);color:var(--jx-ui-accent,#416fd3)}
.ai-chat-history[hidden],.ai-image-previews[hidden]{display:none!important}
.ai-chat-history{position:absolute;inset:65px 0 91px;z-index:2;padding:14px;display:flex;flex-direction:column;background:var(--jx-ui-surface,#fff);border-bottom:1px solid var(--jx-ui-border,#e3ebf5);min-height:0}
.ai-history-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:13px;margin-bottom:10px}.ai-history-hide{border:0;background:var(--jx-ui-soft,#edf3fd);color:var(--jx-ui-accent,#416fd3);border-radius:9px;padding:7px 10px;cursor:pointer}
.ai-history-list{flex:1;min-height:0;overflow:auto}.ai-history-item{display:flex;align-items:center;gap:4px;padding:4px;border-bottom:1px solid var(--jx-ui-border,#e9edf4)}.ai-history-item.is-current{background:var(--jx-ui-soft,#edf3fd);border-radius:9px}.ai-history-link{min-width:0;flex:1;padding:9px 7px;border:0;background:transparent;color:inherit;text-align:left;font:inherit;font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:pointer}.ai-history-delete{flex:none;border:0;border-radius:8px;background:transparent;color:var(--jx-ui-muted,#8694a4);padding:7px;cursor:pointer}.ai-history-delete:hover{color:#cf5355;background:var(--jx-ui-soft,#edf3fd)}.ai-history-note{font-size:10px;color:var(--jx-ui-muted,#8393a6);margin:9px 2px 0}
.ai-image-previews{display:flex;gap:8px;margin-bottom:7px}.ai-preview-item{position:relative;width:55px;height:55px}.ai-preview-item img{width:100%;height:100%;object-fit:cover;border:1px solid var(--jx-ui-border,#dce5ee);border-radius:10px}.ai-preview-item button{position:absolute;right:-6px;top:-7px;border:0;width:18px;height:18px;line-height:18px;padding:0;background:#34445d;color:#fff;border-radius:50%;cursor:pointer}
.ai-float .ai-left-actions{display:flex;min-width:0;align-items:center;gap:8px}.ai-float .ai-attach{width:31px;height:31px;flex:none;border:0;background:var(--jx-ui-soft,#edf3fd);color:var(--jx-ui-accent,#416fd3);border-radius:10px;font-size:22px;line-height:1;cursor:pointer}.ai-float .ai-attach:disabled{opacity:.5;cursor:not-allowed}.ai-chat-images{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px}.ai-chat-images img{max-width:135px;max-height:140px;object-fit:contain;border-radius:10px;border:1px solid var(--jx-ui-border,#dce5ee)}
@media(max-width:560px){.ai-chat-history{inset-block-start:59px}.ai-history-note{font-size:10px}}

/* AI newcomer guide: calm, platform-independent button inspection. */
.ai-float-header .ai-guide-pick{flex:none;border:1px solid color-mix(in srgb,currentColor 18%,transparent);border-radius:9px;padding:6px 9px;background:transparent;color:inherit;font:inherit;font-size:12px;line-height:1.2;white-space:nowrap;cursor:pointer;transition:background .16s,border-color .16s}
.ai-float-header .ai-guide-pick:hover,.ai-float-header .ai-guide-pick:focus-visible{background:color-mix(in srgb,currentColor 9%,transparent);border-color:color-mix(in srgb,currentColor 32%,transparent)}
.ai-guide-overlay{position:fixed;inset:0;z-index:2147483640;cursor:help;background:rgba(12,30,55,.08)}
.ai-guide-highlight{display:none;position:fixed;z-index:2147483641;pointer-events:none;border:2px solid #3283fa;border-radius:8px;box-shadow:0 0 0 4px rgba(50,131,250,.16),0 6px 24px rgba(15,45,80,.12);transition:top .06s,left .06s,width .06s,height .06s}
.ai-guide-bar{position:fixed;z-index:2147483642;left:50%;top:max(12px,env(safe-area-inset-top,0px));transform:translateX(-50%);display:flex;align-items:center;justify-content:space-between;gap:16px;padding:9px 10px 9px 16px;background:#f8fbff;color:#1b3353;border:1px solid #c9daef;border-radius:13px;box-shadow:0 12px 35px rgba(11,30,55,.18);max-width:calc(100vw - 24px);font:13px/1.45 system-ui,-apple-system,'Microsoft YaHei',sans-serif}
.ai-guide-bar span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ai-guide-bar button{flex:none;color:#fff;background:#245caa;border:0;border-radius:8px;padding:7px 10px;font:inherit;cursor:pointer}
@media(max-width:440px){.ai-float-header .ai-guide-pick{padding:5px 7px;font-size:11px}.ai-guide-bar{font-size:12px;gap:8px;padding-left:10px}}
@media(max-width:420px){.ai-float-header{gap:5px;padding:10px 9px}.ai-float-emblem{display:none}.ai-float .ai-icon-button{width:27px;height:27px}.ai-float-close{width:27px;height:27px}}

/* V2.3.7: uniform, centered vector controls across platforms and skins. */
.ai-float .ai-float-header .ai-icon-button,
.ai-float .ai-float-header .ai-float-close{display:grid;place-items:center;box-sizing:border-box;flex:0 0 32px;width:32px;height:32px;min-width:32px;min-height:32px;padding:0;border:0;border-radius:10px;background:transparent;color:var(--jx-ui-muted,#6c7b8f);font-size:inherit;line-height:normal;cursor:pointer}
.ai-float .ai-float-header .ai-icon-button:hover{color:var(--jx-ui-accent,#416fd3);background:var(--jx-ui-soft,#edf3fd)}
.ai-float .ai-float-header .ai-icon-button svg{display:block;width:17px;height:17px;flex:none;overflow:visible}
.ai-float .ai-left-actions .ai-attach{box-sizing:border-box;display:grid;place-items:center;flex:0 0 32px;width:32px;height:32px;padding:0;line-height:normal;border-radius:10px;font-size:inherit}
.ai-float .ai-left-actions .ai-attach svg{width:18px;height:18px;display:block}
.ai-float .ai-float-header{gap:7px}
.ai-float .ai-float-status{min-width:0;flex:1;max-height:34px;overflow:hidden;text-overflow:ellipsis}
.ai-float .ai-normal-retry{flex:none;padding:5px 7px;border:1px solid var(--jx-ui-border,#dae3ed);border-radius:8px;background:var(--jx-ui-soft,#edf3fd);color:var(--jx-ui-accent,#416fd3);font:inherit;font-size:10px;cursor:pointer}
.ai-float .ai-normal-retry[hidden]{display:none!important}
@media(max-width:420px){.ai-float .ai-float-header{gap:5px}.ai-float .ai-float-status{font-size:9px}}

.ai-float .ai-guide-pick[hidden],.ai-float .ai-attach[hidden]{display:none!important}

/* Repositionable assistant launcher: the user's coordinates override the fallback. */
.ai-launcher{touch-action:none;-webkit-user-select:none;user-select:none;will-change:left,top}
.ai-launcher.is-dragging{cursor:grabbing;box-shadow:0 15px 40px #415fad4d,inset 0 1px 1px #fff8}
.ai-form-chat-card{display:flex;flex-direction:column;gap:8px;padding:13px;border:1px solid var(--jx-ui-border,#dce5ee);border-radius:15px;background:var(--jx-ui-surface,#fff)}
.ai-form-chat-title{font-weight:750;font-size:13px}.ai-form-chat-subtitle{margin:0;color:var(--jx-ui-muted,#728296);font-size:11px}
.ai-form-chat-change{margin:0;padding:7px 9px;border-radius:8px;background:var(--jx-ui-soft,#edf3fd);font-size:12px;overflow-wrap:anywhere}
.ai-form-chat-warning{margin:0;font-size:11px;color:var(--jx-ui-muted,#728296)}
.ai-form-chat-actions{display:flex;gap:7px;flex-wrap:wrap;margin-top:3px}
.ai-form-chat-actions button{padding:8px 12px;border-radius:9px;font:inherit;font-size:12px;cursor:pointer;border:1px solid var(--jx-ui-border,#dce5ee);background:var(--jx-ui-surface,#fff);color:inherit}
.ai-form-chat-actions .ai-form-chat-apply{background:var(--jx-ui-accent,#416fd3);color:#fff;border-color:var(--jx-ui-accent,#416fd3)}
.ai-form-chat-actions button:disabled{opacity:.5;cursor:default}
.ai-form-chat-success{margin:0;color:var(--jx-ui-accent,#416fd3)}
.ai-form-chat-editor{display:inline-block;margin-left:8px;text-decoration:underline;color:inherit}
.ai-form-chat-error{color:#ce5058;font-size:11px;margin:0}


/* Theme-owned assistant launcher: the floating AI is part of the current skin,
   not a permanently blue/purple sticker above every theme. Structure is shared. */
html[data-theme="spring"] .ai-launcher{
 background:linear-gradient(140deg,#79ad7d 0%,#4e875b 60%,#386a50 100%);
 border-color:#cae2c8;color:#fffefa;
 box-shadow:0 12px 31px #47795336,inset 0 1px 1px #ffffff99;
}
html[data-theme="summer"] .ai-launcher{
 background:linear-gradient(140deg,#76c8d1 0%,#328d9e 53%,#1c697f 100%);
 border-color:#c3e8e6;color:#fffefa;
 box-shadow:0 12px 31px #287e9238,inset 0 1px 1px #ffffff99;
}
html[data-theme="autumn"] .ai-launcher{
 background:linear-gradient(140deg,#e2b67b 0%,#af7946 58%,#865a3a 100%);
 border-color:#edddbe;color:#fffdf7;
 box-shadow:0 12px 31px #926b4336,inset 0 1px 1px #ffffff88;
}
html[data-theme="winter"] .ai-launcher{
 background:linear-gradient(140deg,#a2c0e6 0%,#6088c8 55%,#3d659e 100%);
 border-color:#d4e7ff;color:#fff;
 box-shadow:0 12px 31px #4d79ac38,inset 0 1px 1px #ffffffaa;
}
html[data-theme="classic"] .ai-launcher{
 background:linear-gradient(145deg,#75a5ee,#476bd1 62%,#6659b8);
}
.ai-launcher:hover:not(.is-dragging){filter:saturate(1.04) brightness(1.025);transform:translateY(-1px)}
.ai-launcher.is-dragging{transform:none;filter:none}
@media(prefers-reduced-motion:reduce){.ai-launcher:hover:not(.is-dragging){transform:none}}
