.global-ai-assistant {
    --gai-accent: #5b5ce2;
    --gai-accent-2: #8a65e8;
    --gai-ink: #172033;
    --gai-muted: #697386;
    --gai-line: rgba(74, 85, 109, .13);
    --gai-surface: rgba(255, 255, 255, .96);
    position: fixed;
    right: 22px;
    bottom: 20px;
    z-index: 6100;
    color: var(--gai-ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    transition: bottom .28s cubic-bezier(.2,.75,.2,1), right .28s ease;
}

.global-ai-assistant.is-batch-overlay-open:not(.is-open) {
    right: 244px;
    bottom: 21px;
}
.global-ai-assistant.is-batch-overlay-open:not(.is-open) .global-ai-orb { width: 54px; min-width: 54px; padding: 0 8px; }
.global-ai-assistant.is-batch-overlay-open:not(.is-open) .global-ai-orb-label { display: none; }

.global-ai-assistant [hidden] { display: none !important; }
.global-ai-assistant * { box-sizing: border-box; }
.global-ai-assistant button,
.global-ai-assistant textarea { font: inherit; }
.global-ai-assistant svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.global-ai-orb {
    position: relative;
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 124px;
    height: 54px;
    padding: 0 17px 0 9px;
    border: 1px solid rgba(255, 255, 255, .82);
    border-radius: 999px;
    color: #fff;
    background: linear-gradient(135deg, #353a66 0%, #4d4fb8 48%, #7257ca 100%);
    box-shadow: 0 15px 42px rgba(45, 48, 98, .28), 0 4px 12px rgba(27, 31, 55, .18), inset 0 1px rgba(255, 255, 255, .22);
    cursor: pointer;
    isolation: isolate;
    transition: transform .24s ease, box-shadow .24s ease, opacity .2s ease;
}

.global-ai-orb:hover { transform: translateY(-3px); box-shadow: 0 20px 48px rgba(45, 48, 98, .34), 0 6px 14px rgba(27, 31, 55, .2); }
.global-ai-orb:active { transform: translateY(-1px) scale(.98); }
.global-ai-orb:focus-visible { outline: 3px solid rgba(109, 94, 229, .25); outline-offset: 3px; }
.global-ai-orb-halo { position: absolute; inset: -7px; z-index: -1; border-radius: inherit; background: conic-gradient(from 90deg, transparent, rgba(113, 96, 230, .42), transparent 38%); opacity: 0; }
.is-thinking .global-ai-orb-halo { opacity: 1; animation: gai-spin 2s linear infinite; }
.global-ai-orb-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; color: #fff; background: rgba(255, 255, 255, .13); box-shadow: inset 0 1px rgba(255, 255, 255, .18); }
.global-ai-orb-icon svg { width: 21px; height: 21px; }
.global-ai-orb-label { font-size: 14px; font-weight: 720; letter-spacing: .01em; }
.global-ai-unread { position: absolute; top: 3px; right: 3px; width: 10px; height: 10px; border: 2px solid #fff; border-radius: 50%; background: #ff4d67; opacity: 0; transform: scale(.5); transition: .2s ease; }
.has-unread .global-ai-unread { opacity: 1; transform: scale(1); }
.is-minimizing .global-ai-orb { animation: gai-orb-return .38s cubic-bezier(.2,.8,.2,1); }
.is-activating .global-ai-brand-mark svg { animation: gai-spark-pop .42s ease; }

.global-ai-panel {
    position: absolute;
    right: 0;
    bottom: 0;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto auto;
    width: min(462px, calc(100vw - 32px));
    height: min(760px, calc(100vh - 34px));
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .88);
    border-radius: 27px;
    background:
        radial-gradient(circle at 12% -2%, rgba(112, 101, 224, .16), transparent 29%),
        radial-gradient(circle at 92% 74%, rgba(127, 157, 230, .08), transparent 31%),
        linear-gradient(180deg, rgba(253, 253, 255, .985), rgba(246, 247, 251, .985));
    box-shadow: 0 30px 90px rgba(30, 35, 66, .25), 0 9px 28px rgba(27, 33, 58, .12), inset 0 1px rgba(255,255,255,.9);
    opacity: 0;
    visibility: hidden;
    transform: translate(10px, 19px) scale(.94);
    transform-origin: 90% 100%;
    transition: opacity .2s ease, transform .34s cubic-bezier(.16,.86,.24,1), visibility .22s;
    backdrop-filter: blur(22px) saturate(1.12);
}

.is-open .global-ai-panel { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
.is-open .global-ai-orb { opacity: 0; visibility: hidden; pointer-events: none; transform: scale(.85); }

.global-ai-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 78px;
    padding: 14px 13px 12px 17px;
    border-bottom: 1px solid rgba(72, 83, 112, .09);
    background: rgba(255, 255, 255, .6);
}
.global-ai-brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.global-ai-brand-mark,
.global-ai-avatar { display: grid; place-items: center; flex: 0 0 auto; color: #fff; background: linear-gradient(145deg, #5054bf, #795cd3); box-shadow: 0 7px 18px rgba(81, 76, 178, .25), inset 0 1px rgba(255,255,255,.22); }
.global-ai-brand-mark { width: 39px; height: 39px; border-radius: 13px; }
.global-ai-brand-mark svg { width: 21px; height: 21px; }
.global-ai-brand h2 { margin: 0; font-size: 16px; line-height: 1.25; letter-spacing: -.01em; }
.global-ai-brand p { margin: 4px 0 0; color: var(--gai-muted); font-size: 11px; white-space: nowrap; }
.global-ai-brand p span { color: #5054b6; font-weight: 700; }
.global-ai-head-actions { display: flex; gap: 3px; }
.global-ai-head-actions button { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 11px; color: #6d7588; background: transparent; cursor: pointer; transition: .18s ease; }
.global-ai-head-actions button:hover { color: #343a50; background: rgba(79, 86, 116, .08); }
.global-ai-head-actions button:disabled { opacity: .38; cursor: not-allowed; }
.global-ai-head-actions .global-ai-new-chat { display: inline-flex; width: auto; padding: 0 10px; gap: 5px; color: #5655ad; background: rgba(90, 87, 187, .075); font-size: 10px; font-weight: 720; }
.global-ai-head-actions .global-ai-new-chat:hover { color: #4543a3; background: rgba(90, 87, 187, .13); }
.global-ai-head-actions .global-ai-new-chat svg { width: 14px; height: 14px; }
.global-ai-head-actions .global-ai-minimize svg { transition: transform .18s ease; }
.global-ai-head-actions .global-ai-minimize:hover svg { transform: translateY(2px); }

.global-ai-context-bar { display: flex; align-items: center; gap: 7px; min-height: 32px; padding: 7px 18px; color: #788195; background: rgba(245, 246, 251, .78); border-bottom: 1px solid rgba(72, 83, 112, .07); font-size: 11px; }
.global-ai-context-dot { width: 6px; height: 6px; border-radius: 50%; background: #52af85; box-shadow: 0 0 0 3px rgba(82,175,133,.12); }
.is-thinking .global-ai-context-dot { background: #6c63da; box-shadow: 0 0 0 3px rgba(108,99,218,.12); animation: gai-pulse 1.4s ease infinite; }
.has-context-notice .global-ai-context-bar { color: #555e74; }
[data-notice="success"] .global-ai-context-dot { background: #3ea877; box-shadow: 0 0 0 3px rgba(62,168,119,.13); }
[data-notice="warning"] .global-ai-context-dot { background: #dd9334; box-shadow: 0 0 0 3px rgba(221,147,52,.13); }
[data-notice="error"] .global-ai-context-dot { background: #d65b6c; box-shadow: 0 0 0 3px rgba(214,91,108,.13); }

.global-ai-messages { min-height: 0; overflow: auto; padding: 19px 17px 25px; background: linear-gradient(180deg, rgba(248,249,253,.38), rgba(247,248,252,.13)); overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(88, 96, 122, .18) transparent; }
.global-ai-messages::-webkit-scrollbar { width: 5px; }
.global-ai-messages::-webkit-scrollbar-thumb { border-radius: 99px; background: rgba(88, 96, 122, .18); }

.global-ai-welcome { display: flex; flex-direction: column; align-items: center; min-height: 100%; padding: 34px 7px 20px; text-align: center; }
.global-ai-welcome-mark { display: grid; place-items: center; width: 58px; height: 58px; margin-bottom: 15px; border: 1px solid rgba(102, 91, 205, .14); border-radius: 20px; color: #5e58c8; background: linear-gradient(145deg, #fff, #efeffd); box-shadow: 0 13px 35px rgba(72, 68, 153, .14); }
.global-ai-welcome-mark svg { width: 28px; height: 28px; }
.global-ai-welcome-kicker { margin-bottom: 8px; color: #6761c9; font-size: 11px; font-weight: 800; letter-spacing: .12em; }
.global-ai-welcome h3 { margin: 0; font-size: 22px; letter-spacing: -.04em; }
.global-ai-welcome p { max-width: 340px; margin: 11px 0 22px; color: var(--gai-muted); font-size: 13px; line-height: 1.75; }
.global-ai-suggestions { display: grid; width: 100%; gap: 8px; }
.global-ai-suggestions button { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 11px 12px; border: 1px solid var(--gai-line); border-radius: 15px; color: #4d566b; background: rgba(255,255,255,.76); text-align: left; cursor: pointer; transition: .18s ease; }
.global-ai-suggestions button:hover { color: #4e4caf; border-color: rgba(89, 83, 192, .2); background: #fff; transform: translateY(-1px); box-shadow: 0 7px 18px rgba(53, 57, 92, .07); }
.global-ai-suggestions i { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; color: #6561c3; background: #f0effd; font-size: 9px; font-style: normal; font-weight: 800; }
.global-ai-suggestions span { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.global-ai-suggestions b { color: #3d4557; font-size: 11px; }
.global-ai-suggestions small { overflow: hidden; color: #8990a0; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.global-ai-suggestions em { color: #a2a7b3; font-size: 14px; font-style: normal; transition: transform .18s ease; }
.global-ai-suggestions button:hover em { color: #5b57bb; transform: translateX(2px); }

.global-ai-message { display: flex; align-items: flex-start; gap: 9px; margin: 0 0 17px; }
.global-ai-message:last-child { animation: gai-message-enter .28s cubic-bezier(.2,.75,.25,1) both; }
.global-ai-message.user { justify-content: flex-end; }
.global-ai-avatar { width: 29px; height: 29px; margin-top: 2px; border-radius: 10px; }
.global-ai-avatar svg { width: 16px; height: 16px; }
.global-ai-message-stack { display: flex; flex-direction: column; align-items: flex-start; max-width: calc(100% - 38px); }
.global-ai-message.user .global-ai-message-stack { align-items: flex-end; max-width: 88%; }
.global-ai-bubble { max-width: 100%; padding: 11px 13px; border: 1px solid rgba(75, 85, 109, .1); border-radius: 7px 17px 17px 17px; color: #2d3547; background: rgba(255, 255, 255, .94); box-shadow: 0 6px 18px rgba(33, 39, 66, .055); font-size: 13px; line-height: 1.72; }
.global-ai-message.user .global-ai-bubble { border: 0; border-radius: 17px 7px 17px 17px; color: #fff; background: linear-gradient(135deg, #5558bd, #7256c6); box-shadow: 0 7px 20px rgba(78, 73, 171, .18); }
.global-ai-text { overflow-wrap: anywhere; }
.global-ai-text p { margin: 0; }
.global-ai-text p + p { margin-top: 6px; }
.global-ai-text h3 { margin: 2px 0 7px; color: #222b3e; font-size: 13px; line-height: 1.45; }
.global-ai-text h3:not(:first-child) { margin-top: 12px; }
.global-ai-message.user .global-ai-text h3 { color: inherit; }
.global-ai-text ul,
.global-ai-text ol { display: grid; gap: 5px; margin: 5px 0 2px; padding-left: 19px; }
.global-ai-text li { padding-left: 1px; }
.global-ai-text-gap { display: block; height: 5px; }
.global-ai-text strong { font-weight: 750; }
.global-ai-text code { padding: 2px 5px; border-radius: 5px; color: inherit; background: rgba(83, 86, 128, .09); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92em; }
.global-ai-text pre { overflow: auto; margin: 9px 0; padding: 11px; border-radius: 10px; color: #e9edff; background: #24283b; white-space: pre-wrap; }
.global-ai-text pre code { padding: 0; background: none; }
.global-ai-text pre.is-plain { color: #3c4264; background: linear-gradient(145deg, #f4f3ff, #f0f2fb); border: 1px solid #e2e2f3; font-family: inherit; line-height: 1.68; }

.global-ai-message-images { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; margin-bottom: 6px; }
.global-ai-message-images button { position: relative; width: 72px; height: 72px; overflow: hidden; padding: 0; border: 1px solid rgba(70, 78, 99, .12); border-radius: 12px; background: #fff; cursor: zoom-in; }
.global-ai-message-images img { width: 100%; height: 100%; object-fit: cover; }
.global-ai-message-images span { position: absolute; inset: auto 3px 3px; overflow: hidden; padding: 3px 5px; border-radius: 5px; color: #fff; background: rgba(22, 26, 42, .7); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.global-ai-message-actions { display: flex; gap: 3px; margin-top: 5px; opacity: 0; transform: translateY(-2px); transition: .18s ease; }
.global-ai-message:hover .global-ai-message-actions,
.global-ai-message:focus-within .global-ai-message-actions { opacity: 1; transform: translateY(0); }
.global-ai-message-actions button { display: inline-flex; align-items: center; gap: 4px; padding: 4px 7px; border: 0; border-radius: 7px; color: #7a8294; background: transparent; font-size: 10px; cursor: pointer; }
.global-ai-message-actions button:hover { color: #5552b5; background: rgba(91, 88, 190, .07); }
.global-ai-message-actions button.is-done { color: #2f9167; background: rgba(47,145,103,.08); }
.global-ai-message-actions svg { width: 12px; height: 12px; }
.global-ai-sources { margin-top: 9px; padding-top: 8px; border-top: 1px solid rgba(74, 84, 108, .09); }
.global-ai-sources summary { color: #6964bd; font-size: 10px; cursor: pointer; }
.global-ai-sources a { display: block; overflow: hidden; margin-top: 5px; color: #687188; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.global-ai-message.is-failed .global-ai-bubble { color: #9a4250; border-color: rgba(205, 76, 96, .18); background: #fff7f8; }
.global-ai-message.is-failed p { margin: 0; }

.global-ai-thinking { display: flex; align-items: center; gap: 5px; min-width: 230px; color: #747d91; font-size: 11px; }
.global-ai-thinking i,
.global-ai-loading-card span { width: 5px; height: 5px; border-radius: 50%; background: #6861d1; animation: gai-dot 1.15s ease-in-out infinite; }
.global-ai-thinking i:nth-child(2), .global-ai-loading-card span:nth-child(2) { animation-delay: .14s; }
.global-ai-thinking i:nth-child(3), .global-ai-loading-card span:nth-child(3) { animation-delay: .28s; }
.global-ai-thinking span { margin-left: 4px; }

.global-ai-loading-card,
.global-ai-state-card { display: flex; align-items: center; justify-content: center; min-height: 100%; color: var(--gai-muted); text-align: center; }
.global-ai-loading-card { gap: 5px; flex-wrap: wrap; }
.global-ai-loading-card p { flex-basis: 100%; margin: 8px 0; font-size: 12px; }
.global-ai-state-card { flex-direction: column; padding: 40px; }
.global-ai-state-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; color: #b34e5e; background: #fff0f2; }
.global-ai-state-card h3 { margin: 13px 0 6px; color: var(--gai-ink); font-size: 16px; }
.global-ai-state-card p { margin: 0 0 14px; font-size: 12px; line-height: 1.6; }
.global-ai-state-card button { padding: 8px 13px; border: 0; border-radius: 10px; color: #fff; background: #5958bd; cursor: pointer; }

.global-ai-attachment-strip { display: flex; gap: 7px; overflow-x: auto; padding: 8px 14px 0; background: rgba(249,250,253,.97); scrollbar-width: none; }
.global-ai-attachment-strip::-webkit-scrollbar { display: none; }
.global-ai-attachment { position: relative; flex: 0 0 78px; height: 62px; overflow: hidden; border: 1px solid rgba(73, 83, 107, .13); border-radius: 11px; background: #fff; animation: gai-attachment-enter .22s ease both; }
.global-ai-attachment img { width: 100%; height: 100%; object-fit: cover; }
.global-ai-attachment > span { position: absolute; inset: auto 3px 3px; overflow: hidden; padding: 3px 4px; border-radius: 5px; color: #fff; background: rgba(26, 29, 44, .72); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.global-ai-attachment button { position: absolute; top: 3px; right: 3px; display: grid; place-items: center; width: 18px; height: 18px; padding: 0; border: 0; border-radius: 50%; color: #fff; background: rgba(24, 27, 40, .78); cursor: pointer; }
.global-ai-attachment button svg { width: 10px; height: 10px; }
.global-ai-attachment.is-uploading::after { content: ''; position: absolute; inset: 0; background: rgba(255,255,255,.45); animation: gai-shimmer 1.2s ease infinite; }

.global-ai-drop-overlay { position: absolute; inset: 111px 13px 116px; z-index: 12; display: grid; place-items: center; border: 1.5px dashed rgba(89, 83, 193, .48); border-radius: 21px; background: rgba(247,247,255,.91); box-shadow: inset 0 0 0 5px rgba(255,255,255,.58), 0 16px 45px rgba(53,50,122,.12); opacity: 0; visibility: hidden; transform: scale(.985); pointer-events: none; backdrop-filter: blur(13px); transition: opacity .16s ease, transform .2s ease, visibility .16s; }
.is-dragover .global-ai-drop-overlay { opacity: 1; visibility: visible; transform: scale(1); }
.global-ai-drop-card { display: flex; align-items: center; flex-direction: column; padding: 28px; text-align: center; }
.global-ai-drop-card > span { display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: 14px; border-radius: 18px; color: #fff; background: linear-gradient(145deg, #5558c2, #8062d4); box-shadow: 0 13px 28px rgba(73,67,168,.24); animation: gai-drop-float 1.6s ease-in-out infinite; }
.global-ai-drop-card svg { width: 25px; height: 25px; }
.global-ai-drop-card strong { color: #34394d; font-size: 16px; }
.global-ai-drop-card small { margin-top: 7px; color: #81899a; font-size: 10px; }

.global-ai-confirm-layer { position: absolute; inset: 0; z-index: 30; display: grid; place-items: center; padding: 20px; background: rgba(30,35,57,.3); opacity: 0; visibility: hidden; pointer-events: none; backdrop-filter: blur(5px); transition: opacity .18s ease, visibility .18s; }
.global-ai-confirm-layer.is-visible { opacity: 1; visibility: visible; pointer-events: auto; }
.global-ai-confirm-card { width: min(330px, 100%); padding: 24px; border: 1px solid rgba(255,255,255,.9); border-radius: 21px; background: rgba(255,255,255,.985); box-shadow: 0 24px 70px rgba(26,31,55,.24); text-align: center; transform: translateY(10px) scale(.97); transition: transform .24s cubic-bezier(.2,.78,.2,1); }
.global-ai-confirm-layer.is-visible .global-ai-confirm-card { transform: translateY(0) scale(1); }
.global-ai-confirm-mark { display: grid; place-items: center; width: 46px; height: 46px; margin: 0 auto 13px; border-radius: 15px; color: #625bc5; background: #efeffd; }
.global-ai-confirm-mark svg { width: 20px; height: 20px; }
.global-ai-confirm-card h3 { margin: 0; color: #293044; font-size: 17px; letter-spacing: -.02em; }
.global-ai-confirm-card p { margin: 8px 0 19px; color: #7d8596; font-size: 11px; }
.global-ai-confirm-card > div { display: grid; grid-template-columns: 1fr 1.25fr; gap: 8px; }
.global-ai-confirm-card button { min-height: 38px; border: 0; border-radius: 11px; color: #626b7d; background: #f0f2f6; font-size: 11px; font-weight: 700; cursor: pointer; transition: .18s ease; }
.global-ai-confirm-card button:last-child { color: #fff; background: linear-gradient(135deg, #5859bf, #7358c9); box-shadow: 0 7px 16px rgba(75,70,167,.2); }
.global-ai-confirm-card button:hover:not(:disabled) { transform: translateY(-1px); }
.global-ai-confirm-card button:disabled { opacity: .55; cursor: wait; }
.global-ai-confirm-layer.is-busy .global-ai-confirm-mark svg { animation: gai-spin 1s linear infinite; }

.global-ai-composer { position: relative; margin: 10px 12px 12px; padding: 11px 10px 9px; border: 1px solid rgba(72, 82, 107, .14); border-radius: 20px; background: rgba(255,255,255,.985); box-shadow: 0 10px 27px rgba(31, 37, 65, .09), inset 0 1px rgba(255,255,255,.9); }
.global-ai-composer:focus-within { border-color: rgba(88, 83, 190, .28); box-shadow: 0 9px 26px rgba(50, 49, 113, .1), 0 0 0 3px rgba(91,88,190,.06); }
.global-ai-composer textarea { display: block; width: 100%; min-height: 64px; max-height: 164px; resize: none; padding: 5px 6px 8px; border: 0; outline: 0; color: var(--gai-ink); background: transparent; font-size: 13.5px; line-height: 1.62; }
.soft-workbench .global-ai-composer textarea:focus,
.global-ai-assistant .global-ai-composer textarea:focus { border: 0 !important; outline: 0 !important; background: transparent !important; box-shadow: none !important; }
.global-ai-composer textarea::placeholder { color: #9aa1af; }
.global-ai-composer-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.global-ai-composer-tools { display: flex; align-items: center; gap: 9px; min-width: 0; }
.global-ai-composer-tools > button { display: inline-flex; align-items: center; gap: 5px; padding: 6px 8px; border: 0; border-radius: 9px; color: #676f82; background: transparent; font-size: 11px; cursor: pointer; }
.global-ai-composer-tools > button:hover,
.global-ai-composer-tools > button[aria-expanded="true"] { color: #5552b6; background: rgba(90,86,190,.08); }
.global-ai-composer-tools svg { width: 14px; height: 14px; }
.global-ai-composer-tools svg:last-child { width: 10px; height: 10px; }
#globalAiCount { color: #a0a6b3; font-size: 9px; }
.global-ai-send { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 72px; height: 34px; padding: 0 12px; border: 0; border-radius: 11px; color: #fff; background: linear-gradient(135deg, #5759bf, #7659cd); box-shadow: 0 6px 15px rgba(77,72,173,.22); font-size: 11px; font-weight: 700; cursor: pointer; transition: .18s ease; }
.global-ai-send:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(77,72,173,.27); }
.global-ai-send:disabled { opacity: .38; cursor: not-allowed; box-shadow: none; }
.global-ai-send.is-stop { background: #34394c; }
.global-ai-send svg { width: 14px; height: 14px; }

.global-ai-asset-menu { position: absolute; right: 0; bottom: calc(100% + 9px); width: min(360px, calc(100vw - 44px)); max-height: 390px; overflow: auto; padding: 11px; border: 1px solid rgba(255,255,255,.9); border-radius: 17px; background: rgba(255,255,255,.98); box-shadow: 0 20px 55px rgba(28,33,60,.2), 0 5px 15px rgba(28,33,60,.08); backdrop-filter: blur(16px); }
.global-ai-asset-menu-head { display: flex; align-items: baseline; justify-content: space-between; padding: 3px 4px 9px; }
.global-ai-asset-menu-head strong { font-size: 13px; }
.global-ai-asset-menu-head span { color: #8d94a3; font-size: 9px; }
.global-ai-upload-choice { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px; border: 1px solid rgba(75, 84, 107, .11); border-radius: 12px; color: #4d5669; background: #f8f9fc; text-align: left; cursor: pointer; }
.global-ai-upload-choice > svg { width: 22px; height: 22px; color: #5d59be; }
.global-ai-upload-choice span { display: flex; flex-direction: column; gap: 2px; }
.global-ai-upload-choice b { font-size: 11px; }
.global-ai-upload-choice small { color: #8c93a3; font-size: 9px; }
.global-ai-current-title { margin: 12px 2px 7px; color: #767e90; font-size: 10px; font-weight: 700; }
.global-ai-current-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.global-ai-current-grid button { position: relative; aspect-ratio: 1; overflow: hidden; padding: 0; border: 1px solid rgba(71,80,103,.12); border-radius: 10px; background: #f3f4f7; cursor: pointer; }
.global-ai-current-grid button:hover { border-color: rgba(85,80,187,.5); box-shadow: 0 0 0 2px rgba(91,87,193,.09); }
.global-ai-current-grid img { width: 100%; height: 100%; object-fit: cover; }
.global-ai-current-grid span { position: absolute; inset: auto 3px 3px; overflow: hidden; padding: 3px 4px; border-radius: 4px; color: #fff; background: rgba(25,28,42,.72); font-size: 7px; text-overflow: ellipsis; white-space: nowrap; }
.global-ai-no-assets { margin: 11px 3px 2px; color: #8b92a1; font-size: 10px; }

@keyframes gai-spin { to { transform: rotate(360deg); } }
@keyframes gai-pulse { 50% { opacity: .45; transform: scale(.82); } }
@keyframes gai-dot { 0%, 65%, 100% { opacity: .35; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
@keyframes gai-shimmer { 50% { opacity: .25; } }
@keyframes gai-drop-float { 50% { transform: translateY(-4px); } }
@keyframes gai-orb-return { 0% { opacity: 0; transform: translateY(5px) scale(.82); } 65% { opacity: 1; transform: translateY(-2px) scale(1.025); } 100% { transform: none; } }
@keyframes gai-spark-pop { 50% { transform: rotate(9deg) scale(1.12); } }
@keyframes gai-message-enter { from { opacity: 0; transform: translateY(7px) scale(.99); } to { opacity: 1; transform: none; } }
@keyframes gai-attachment-enter { from { opacity: 0; transform: translateY(5px) scale(.96); } to { opacity: 1; transform: none; } }

@media (max-width: 700px) {
    .global-ai-assistant { right: 14px; bottom: max(14px, env(safe-area-inset-bottom)); }
    .global-ai-assistant.is-batch-overlay-open:not(.is-open) { top: 26px; right: auto; bottom: auto; left: 124px; }
    .global-ai-assistant.is-batch-overlay-open:not(.is-open) .global-ai-orb { width: 44px; min-width: 44px; height: 44px; padding: 3px; }
    .global-ai-assistant.is-batch-overlay-open:not(.is-open) .global-ai-orb-icon { width: 32px; height: 32px; }
    .global-ai-assistant.is-refine-context:not(.is-open) { bottom: calc(170px + env(safe-area-inset-bottom)); }
    .global-ai-orb { min-width: 54px; width: 54px; padding: 0 8px; }
    .global-ai-orb-label { display: none; }
    .global-ai-panel { position: fixed; inset: 0; width: 100%; height: 100dvh; border: 0; border-radius: 0; transform: translateY(28px); }
    .is-open .global-ai-panel { transform: translateY(0); }
    .global-ai-head { padding-top: max(13px, env(safe-area-inset-top)); }
    .global-ai-messages { padding-inline: 13px; }
    .global-ai-composer { margin-bottom: max(10px, env(safe-area-inset-bottom)); }
    .global-ai-message-actions { opacity: 1; transform: none; }
}

@media (max-width: 380px) {
    .global-ai-brand p { max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
    .global-ai-head-actions button { width: 31px; height: 31px; }
    .global-ai-head-actions .global-ai-new-chat { width: 31px; padding: 0; }
    .global-ai-head-actions .global-ai-new-chat span { display: none; }
    .global-ai-current-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
    .global-ai-assistant *, .global-ai-assistant *::before, .global-ai-assistant *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .001ms !important; }
}
