/* Shared reading and composer system. The extra root scope intentionally wins
 * over the legacy inline page/drawer rules without affecting the rest of the site. */
.fxm-ai-ui {
	--ai-ink: #252735;
	--ai-muted: #687080;
	--ai-subtle: #858b98;
	--ai-border: #e3e5eb;
	--ai-accent: #4f34d9;
	font-family: var(--font-body);
	font-size: 15px;
	line-height: 1.65;
	color: var(--ai-ink);
	-webkit-font-smoothing: antialiased;
}
.fxm-ai-ui .fxm-ai-semibold { font-family: var(--font-headline); font-weight: 600; }
.fxm-ai-ui .fxm-ai-regular { font-family: var(--font-body); font-weight: 400; }
.fxm-ai-ui :is(button, a, textarea):focus-visible {
	outline: 3px solid #bdb1f6;
	outline-offset: 3px;
}
.fxm-ai-ui button { -webkit-tap-highlight-color: transparent; }

/* The 52px layout slot preserves the 80px illustration and all its effects.
 * Only the wrapper is positioned; positioning ai-orb too would shift it twice. */
.fxm-ai-ui[data-fxm-ai-service-page] .fxm-ai-input-bot,
.fxm-ai-ui[data-fxm-ai-drawer] .fxm-ai-input-bot {
	position: relative;
	display: block;
	width: 52px;
	height: 48px;
	flex: 0 0 52px;
	align-self: flex-start;
	margin: 0;
	padding: 0;
	overflow: visible;
	pointer-events: none;
}
.fxm-ai-ui[data-fxm-ai-service-page] .fxm-ai-input-bot > .orbit-ai,
.fxm-ai-ui[data-fxm-ai-drawer] .fxm-ai-input-bot > .orbit-ai {
	position: absolute;
	left: 50%;
	top: 50%;
	width: 80px;
	height: 80px;
	max-width: none;
	margin: 0;
	transform: translate(-50%, -50%);
}
.fxm-ai-ui[data-fxm-ai-service-page] .fxm-ai-input-bot ai-orb,
.fxm-ai-ui[data-fxm-ai-drawer] .fxm-ai-input-bot ai-orb {
	display: block;
	width: 80px;
	height: 80px;
	max-width: none;
}

/* One writing baseline, one primary action, and quieter secondary tools. */
.fxm-ai-ui[data-fxm-ai-service-page] .fxm-ai-composer,
.fxm-ai-ui[data-fxm-ai-drawer] [data-fxm-ai-form] .fxm-ai-composer {
	width: 100%;
	min-height: 0;
	padding: 12px 14px;
	border: 1px solid #dcdde7;
	border-radius: 20px;
	background: #fff;
	box-shadow: 0 5px 22px -8px rgba(30, 28, 52, .13), 0 1px 3px rgba(30, 28, 52, .025);
	transition: border-color .18s ease, box-shadow .18s ease;
}
.fxm-ai-ui[data-fxm-ai-service-page] .fxm-ai-composer:focus-within,
.fxm-ai-ui[data-fxm-ai-drawer] [data-fxm-ai-form] .fxm-ai-composer:focus-within {
	border-color: #9888df;
	box-shadow: 0 0 0 3px rgba(79, 52, 217, .07), 0 8px 28px -14px rgba(30, 28, 52, .2);
}
.fxm-ai-ui[data-fxm-ai-service-page] .fxm-ai-input-line,
.fxm-ai-ui[data-fxm-ai-drawer] [data-fxm-ai-form] .fxm-ai-composer {
	display: flex;
	align-items: flex-start;
	gap: 14px;
}
.fxm-ai-ui[data-fxm-ai-service-page] [data-fxm-ai-input],
.fxm-ai-ui[data-fxm-ai-drawer] [data-fxm-ai-input] {
	flex: 1;
	min-width: 0;
	width: 100%;
	min-height: 48px;
	max-height: 120px;
	align-self: center;
	margin: 0;
	padding: 12px 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	font-family: var(--font-body);
	font-size: 16px;
	font-weight: 400;
	line-height: 24px;
	letter-spacing: 0;
	color: var(--ai-ink);
	caret-color: var(--ai-accent);
	resize: none;
	box-shadow: none;
	outline: none;
	scrollbar-width: thin;
}
.fxm-ai-ui [data-fxm-ai-input]::placeholder { color: #858593; opacity: 1; }
.fxm-ai-ui [data-fxm-ai-input]:placeholder-shown { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fxm-ai-ui[data-fxm-ai-service-page] [data-fxm-ai-send],
.fxm-ai-ui[data-fxm-ai-drawer] [data-fxm-ai-send] {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 44px;
	width: 44px;
	height: 44px;
	align-self: flex-end;
	margin: 2px 0;
	padding: 0;
	border: 0;
	border-radius: 14px;
	background: var(--ai-accent);
	color: #fff;
	opacity: 1;
	box-shadow: 0 3px 8px rgba(79, 52, 217, .16);
	transition: background .15s ease, transform .15s ease;
}
.fxm-ai-ui [data-fxm-ai-send] svg { width: 20px; height: 20px; stroke-width: 2; }
.fxm-ai-ui[data-fxm-ai-service-page] [data-fxm-ai-send]:hover:not(:disabled),
.fxm-ai-ui[data-fxm-ai-drawer] [data-fxm-ai-send]:hover:not(:disabled) { background: #3e27b4; }
.fxm-ai-ui[data-fxm-ai-service-page] [data-fxm-ai-send]:disabled,
.fxm-ai-ui[data-fxm-ai-drawer] [data-fxm-ai-send]:disabled {
	background: #eeecf5;
	color: #9b91b6;
	box-shadow: none;
	opacity: 1;
	cursor: not-allowed;
}
.fxm-ai-ui .fxm-ai-composer-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin: 2px 0 -4px 66px;
}
.fxm-ai-ui .fxm-ai-composer-tools { display: flex; align-items: center; gap: 4px; }
.fxm-ai-ui .fxm-ai-keyboard-hint { color: #8a8e99; font-size: 11px; line-height: 1.5; }
/* Today's quota (done.quota, v10.9): first in the latest answer's action
 * row, left of copy and the thumbs; one line, ellipsis on narrow drawers;
 * amber when ≤ 10% is left, rose once used up. */
.fxm-ai-ui .fxm-ai-message-controls > .fxm-ai-quota { flex: 0 1 auto; min-width: 0; margin-right: 4px; overflow: hidden; color: #8a8e99; font-size: 11px; line-height: 1.5; white-space: nowrap; text-overflow: ellipsis; }
.fxm-ai-ui .fxm-ai-quota[hidden] { display: none; }
.fxm-ai-ui .fxm-ai-message-controls > .fxm-ai-quota[data-tone="low"] { color: #b45309; }
.fxm-ai-ui .fxm-ai-message-controls > .fxm-ai-quota[data-tone="exhausted"] { color: #be123c; }
.fxm-ai-ui[data-fxm-ai-service-page] .fxm-ai-disclaimer,
.fxm-ai-ui[data-fxm-ai-drawer] [data-fxm-ai-form] > .fxm-ai-disclaimer {
	margin: 10px 0 0;
	padding: 0 8px;
	font-size: 11px;
	line-height: 1.6;
	color: #7b808d;
	text-align: center;
}

/* Full conversation: one centered reading column with room on both sides.
 * The content limit (--ai-content-width) excludes the gutters shared by
 * messages and composer. Gutters: 64px desktop, 40px tablet, 20px phone. */
.fxm-ai-ui[data-fxm-ai-service-page] { --ai-page-gutter: 64px; background: #fff; }
.fxm-ai-ui[data-fxm-ai-service-page] > header { height: 64px; gap: 16px; border-bottom: 1px solid #eeeef2; }
.fxm-ai-ui[data-fxm-ai-service-page] > header img { height: 25px; }
.fxm-ai-ui [data-fxm-ai-title] { font-size: 14px; font-weight: 500; color: #5d6270; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.fxm-ai-ui .fxm-ai-message-count { flex-shrink: 0; font-size: 12px; color: #858b96; }
.fxm-ai-ui[data-fxm-ai-service-page] [data-fxm-ai-sidebar] { top: 64px; width: 244px; background: #f8f9fb; border-color: #eeeef2; }
.fxm-ai-ui [data-fxm-ai-new-session] { min-height: 44px; border: 1px solid #ddd9ec; border-radius: 12px; background: #fff; color: var(--ai-accent); font-size: 14px; font-weight: 600; box-shadow: 0 1px 2px rgba(30,28,52,.025); }
.fxm-ai-ui [data-fxm-ai-new-session]:hover { background: #f0edf9; }
.fxm-ai-ui [data-fxm-ai-new-session] svg { width: 18px; height: 18px; }
.fxm-ai-ui [data-fxm-ai-session] { min-height: 58px; padding: 10px 12px; border-radius: 10px; }
.fxm-ai-ui [data-fxm-ai-session] > svg { width: 16px; height: 16px; }
.fxm-ai-ui [data-fxm-ai-session] > div > div:first-child { font-size: 13px; line-height: 1.5; }
.fxm-ai-ui [data-fxm-ai-session] > div > div:last-child { margin-top: 3px; font-size: 11px; color: #8a8e99; }
.fxm-ai-ui [data-fxm-ai-session]:focus-visible { outline: 2px solid var(--ai-accent); outline-offset: -2px; }
/* Delete shows on hover/focus where a pointer can hover; touch screens keep it visible. */
.fxm-ai-ui .fxm-ai-session-delete { min-width: 28px; min-height: 28px; }
@media (hover: hover) and (pointer: fine) {
	.fxm-ai-ui .fxm-ai-session-delete { opacity: 0; transition: opacity .15s; }
	.fxm-ai-ui [data-fxm-ai-session]:is(:hover, :focus-within) .fxm-ai-session-delete,
	.fxm-ai-ui .fxm-ai-session-delete:focus-visible { opacity: 1; }
}
.fxm-ai-ui .fxm-ai-session-delete:disabled { opacity: .4; cursor: wait; }
.fxm-ai-ui .fxm-ai-session-more { display: block; width: 100%; margin-top: 6px; padding: 8px 12px; border-radius: 8px; font-size: 12px; color: #7b808d; text-align: center; }
.fxm-ai-ui button.fxm-ai-session-more:hover { background: rgb(79 52 217 / 5%); color: var(--ai-accent); }
.fxm-ai-ui .fxm-ai-session-notice { margin-bottom: 6px; padding: 8px 12px; border-radius: 8px; background: #fff1f3; font-size: 12px; color: #be123c; }
.fxm-ai-ui .fxm-ai-history-state { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 48px 0; font-size: 13px; color: #7b808d; }
.fxm-ai-ui .fxm-ai-history-older { display: flex; justify-content: center; }
.fxm-ai-ui [data-fxm-ai-load-older] { padding: 6px 14px; border: 1px solid #e3e5eb; border-radius: 999px; background: #fff; font-size: 12px; color: #5d6270; }
.fxm-ai-ui [data-fxm-ai-load-older]:hover:not(:disabled) { border-color: var(--ai-accent); color: var(--ai-accent); }
.fxm-ai-ui [data-fxm-ai-load-older]:disabled { cursor: wait; opacity: .7; }
.fxm-ai-ui .fxm-ai-feedback-error { margin-left: 6px; font-size: 11px; color: #be123c; }
.fxm-ai-ui [data-fxm-ai-feedback]:disabled { cursor: wait; opacity: .6; }
.fxm-ai-ui [data-fxm-ai-sidebar] > div:last-child p { font-size: 11px; line-height: 1.65; color: #7b808d; }
.fxm-ai-ui[data-fxm-ai-service-page] [data-fxm-ai-messages],
.fxm-ai-ui[data-fxm-ai-service-page] .fxm-ai-composer-frame {
	width: 100%;
	max-width: calc(var(--ai-content-width) + var(--ai-page-gutter) + var(--ai-page-gutter));
	margin-inline: auto;
	padding-inline: var(--ai-page-gutter);
}
.fxm-ai-ui[data-fxm-ai-service-page] .fxm-ai-assistant-message { width: 100%; max-width: none; }
.fxm-ai-ui[data-fxm-ai-service-page] .fxm-ai-user-message { width: 80%; }
.fxm-ai-ui .fxm-ai-composer-dock { padding-top: 12px; background: #fff; }
.fxm-ai-ui .fxm-ai-composer-frame { padding-bottom: max(16px, env(safe-area-inset-bottom)); }
.fxm-ai-ui .fxm-ai-welcome { padding: clamp(28px, 6vh, 72px) 0 28px; }
.fxm-ai-ui .fxm-ai-welcome > div:first-child { width: 52px; height: 52px; border: 1px solid #ece8fa; border-radius: 17px; background: #f7f5fc; }
.fxm-ai-ui .fxm-ai-welcome > div:first-child svg { width: 26px; height: 26px; }
.fxm-ai-ui .fxm-ai-welcome h1 { margin-top: 20px; font-size: 28px; font-weight: 600; line-height: 1.35; letter-spacing: -.04em; color: #252735; }
.fxm-ai-ui .fxm-ai-welcome > p { max-width: 540px; margin-top: 10px; font-size: 14px; line-height: 1.8; color: var(--ai-muted); text-align: center; }
.fxm-ai-ui .fxm-ai-welcome > div:last-child { gap: 12px; margin-top: 28px; }
.fxm-ai-ui[data-fxm-ai-service-page] .yb-welcome-card { align-items: center; gap: 12px; min-height: 82px; padding: 16px; border: 1px solid #e7e7ef; border-radius: 14px; box-shadow: none; }
.fxm-ai-ui[data-fxm-ai-service-page] .yb-welcome-card:hover { background: #faf9fd; border-color: #cfc5eb; }
.fxm-ai-ui .yb-welcome-card > div:first-child { width: 36px; height: 36px; border-radius: 11px; background: #f2effb; }
.fxm-ai-ui .yb-welcome-card svg { width: 19px; height: 19px; color: #7760bd; }
.fxm-ai-ui .yb-welcome-card > div:last-child > div:first-child { color: #353441; font-size: 14px; font-weight: 600; line-height: 1.5; }
.fxm-ai-ui .yb-welcome-card > div:last-child > div:last-child { margin-top: 5px; color: #7d8290; font-size: 12px; line-height: 1.5; white-space: normal; }

/* Drawer: the same visual language in a bounded bottom sheet. */
.fxm-ai-ui[data-fxm-ai-drawer] [data-fxm-ai-panel] { width: min(94%, 1160px); height: 84dvh; border: 1px solid #e3e0ed; border-bottom: 0; border-radius: 24px 24px 0 0; background: #fff; box-shadow: 0 24px 80px rgba(28,24,46,.2); }
.fxm-ai-ui[data-fxm-ai-drawer] [data-fxm-ai-particles] { display: none; }
.fxm-ai-ui[data-fxm-ai-drawer] [data-fxm-ai-panel] > [data-fxm-ai-header].flex { flex-shrink: 0; min-height: 76px; padding: 14px 16px; background: #fff; border-bottom: 1px solid #eeeef2; box-shadow: none; }
.fxm-ai-ui[data-fxm-ai-drawer] #fxm-ai-drawer-title { font-size: 16px; font-weight: 600; line-height: 1.5; letter-spacing: 0; color: #252735; }
.fxm-ai-ui[data-fxm-ai-drawer] [data-fxm-ai-panel] > [data-fxm-ai-header].flex.items-center.justify-between p { margin-top: 3px; font-size: 12px; line-height: 1.5; color: #767c89; }
.fxm-ai-ui[data-fxm-ai-drawer] [data-fxm-ai-header] > div:first-child { min-width: 0; gap: 12px; }
.fxm-ai-ui[data-fxm-ai-drawer] [data-fxm-ai-header] > div:last-child { flex-shrink: 0; gap: 8px; }
.fxm-ai-ui[data-fxm-ai-drawer] [data-fxm-ai-header] :is(button, a) { min-height: 36px; border-radius: 10px; font-size: 12px; font-weight: 500; }
.fxm-ai-ui[data-fxm-ai-drawer] [data-fxm-ai-close] { width: 36px; color: #697080; background: #f4f5f7; }
.fxm-ai-ui[data-fxm-ai-drawer] [data-fxm-ai-close] svg { width: 20px; height: 20px; }
.fxm-ai-ui[data-fxm-ai-drawer] [data-fxm-ai-scroll] { min-height: 0; background: #fcfcfe; overscroll-behavior: contain; }
.fxm-ai-ui[data-fxm-ai-drawer] [data-fxm-ai-messages] { width: 100%; max-width: none; padding: 24px 16px; row-gap: 28px; }
.fxm-ai-ui[data-fxm-ai-drawer] :is(.fxm-ai-msg-row--assistant, .fxm-ai-msg-row--user) { padding-inline: 0; }
.fxm-ai-ui[data-fxm-ai-drawer] .fxm-ai-user-message { width: 86%; }
.fxm-ai-ui[data-fxm-ai-drawer] [data-fxm-ai-empty] { width: 100%; max-width: none; padding: 14px 0 22px; }
.fxm-ai-ui[data-fxm-ai-drawer] [data-fxm-ai-empty] > div:first-child { width: 60px; height: 60px; }
.fxm-ai-ui[data-fxm-ai-drawer] [data-fxm-ai-empty] h2 { margin-top: 16px; color: #252735; font-size: 24px; font-weight: 600; line-height: 1.4; }
.fxm-ai-ui[data-fxm-ai-drawer] [data-fxm-ai-empty] > p { margin-top: 8px; font-size: 14px; color: #747b89; text-align: center; }
.fxm-ai-ui[data-fxm-ai-drawer] [data-fxm-ai-empty] [data-fxm-ai-suggestions] { width: 100%; max-width: none; gap: 12px; margin-top: 24px; }
.fxm-ai-ui[data-fxm-ai-drawer] .fxm-ai-suggest-card { flex-direction: row; align-items: center; gap: 12px; min-height: 80px; padding: 16px; border: 1px solid #e7e7ef; border-radius: 14px; box-shadow: none; }
.fxm-ai-ui[data-fxm-ai-drawer] .fxm-ai-suggest-card:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(40,30,80,.04); }
.fxm-ai-ui[data-fxm-ai-drawer] .fxm-ai-suggest-label { font-size: 14px; line-height: 1.5; }
.fxm-ai-ui[data-fxm-ai-drawer] .fxm-ai-suggest-question { font-size: 12px; line-height: 1.6; color: #7d8290; }
.fxm-ai-ui[data-fxm-ai-drawer] .fxm-ai-suggest-icon svg { width: 19px; height: 19px; }
.fxm-ai-ui[data-fxm-ai-drawer] [data-fxm-ai-form] { flex-shrink: 0; padding: 14px 16px max(14px, env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid #f0f0f4; box-shadow: none; }
.fxm-ai-ui[data-fxm-ai-drawer] [data-fxm-ai-form] > * { max-width: none; }
.fxm-ai-ui[data-fxm-ai-drawer] [data-fxm-ai-form] .fxm-ai-composer { max-width: none; padding: 10px 14px; }
.fxm-ai-ui[data-fxm-ai-drawer] [data-fxm-ai-suggestion-rail] { margin-bottom: 12px; }

/* Message text and actions should be readable at the same scale in both views. */
.fxm-ai-ui[data-fxm-ai-service-page] .fxm-ai-markdown,
.fxm-ai-ui[data-fxm-ai-drawer] .fxm-ai-markdown,
.fxm-ai-ui[data-fxm-ai-drawer] .fxm-ai-assistant-message { font-size: 15px; line-height: 1.8; color: #303342; }
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-user-bubble { font-family: var(--font-body); font-size: 14px; line-height: 1.65; color: #303342; }
.fxm-ai-ui .fxm-ai-user-bubble > div,
.fxm-ai-ui .fxm-ai-user-bubble > p { font-size: inherit; line-height: inherit; }
.fxm-ai-ui .fxm-ai-assistant-body > div > p { font-size: 15px; line-height: 1.8; }
.fxm-ai-ui[data-fxm-ai-service-page] .fxm-ai-user-bubble,
.fxm-ai-ui[data-fxm-ai-drawer] .fxm-ai-user-bubble { padding: 12px 16px; background: #f1eff9; border: 1px solid #e9e4f4; box-shadow: none; }
.fxm-ai-ui[data-fxm-ai-service-page] .fxm-ai-badge,
.fxm-ai-ui[data-fxm-ai-drawer] .fxm-ai-badge { height: 21px; max-width: 176px; }
.fxm-ai-ui :is([data-fxm-ai-copy], [data-fxm-ai-feedback]) { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; min-height: 32px; padding: 6px; color: #7c8390; }
.fxm-ai-ui :is([data-fxm-ai-copy], [data-fxm-ai-feedback]) svg { width: 16px; height: 16px; }
.fxm-ai-ui [data-fxm-ai-feedback][aria-pressed="true"] { color: var(--ai-accent); }
.fxm-ai-ui .fxm-ai-message-controls > span:last-child { font-size: 11px; color: #858b96; }

@media (max-width: 1023px) {
	.fxm-ai-ui[data-fxm-ai-service-page] { --ai-page-gutter: 40px; }
	.fxm-ai-ui[data-fxm-ai-service-page] > header { height: 60px; padding-inline: 16px; }
	.fxm-ai-ui[data-fxm-ai-service-page] [data-fxm-ai-sidebar] { top: 60px; }
	.fxm-ai-ui [data-fxm-ai-title-mobile] { font-size: 13px; font-weight: 500; color: #697080; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
@media (max-width: 639px) {
	.fxm-ai-ui[data-fxm-ai-service-page] { --ai-page-gutter: 20px; }
	.fxm-ai-ui[data-fxm-ai-service-page] > header,
	.fxm-ai-ui[data-fxm-ai-service-page] div:has(> [data-fxm-ai-title-mobile]) { padding-inline: var(--ai-page-gutter); }
	.fxm-ai-ui[data-fxm-ai-service-page] .fxm-ai-user-message { width: 88%; }
	.fxm-ai-ui .fxm-ai-composer-frame { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
	.fxm-ai-ui[data-fxm-ai-service-page] .fxm-ai-composer,
	.fxm-ai-ui[data-fxm-ai-drawer] [data-fxm-ai-form] .fxm-ai-composer { padding: 10px 12px; border-radius: 18px; }
	.fxm-ai-ui .fxm-ai-composer-toolbar { margin-left: 66px; }
	.fxm-ai-ui .fxm-ai-keyboard-hint { display: none; }
	.fxm-ai-ui .fxm-ai-welcome { padding: 20px 0 12px; }
	.fxm-ai-ui .fxm-ai-welcome h1 { font-size: 24px; margin-top: 16px; }
	.fxm-ai-ui .fxm-ai-welcome > p { font-size: 13px; max-width: 300px; }
	.fxm-ai-ui .fxm-ai-welcome > div:last-child { margin-top: 22px; gap: 10px; }
	.fxm-ai-ui[data-fxm-ai-service-page] .yb-welcome-card { min-height: 74px; padding: 13px 14px; }
	.fxm-ai-ui[data-fxm-ai-drawer] [data-fxm-ai-panel] { width: 100%; height: 90dvh; border-radius: 20px 20px 0 0; }
	.fxm-ai-ui[data-fxm-ai-drawer] [data-fxm-ai-panel] > [data-fxm-ai-header].flex { min-height: 72px; padding: 12px; }
	.fxm-ai-ui[data-fxm-ai-drawer] [data-fxm-ai-panel] > [data-fxm-ai-header].flex.items-center.justify-between p { display: block; max-width: 210px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 11px; }
	.fxm-ai-ui[data-fxm-ai-drawer] .fxm-ai-status-dot { margin-right: 7px; box-shadow: none; }
	.fxm-ai-ui[data-fxm-ai-drawer] [data-fxm-ai-header] > div:last-child { gap: 4px; }
	.fxm-ai-ui[data-fxm-ai-drawer] [data-fxm-ai-new-chat] { width: 36px; padding: 0; justify-content: center; font-size: 0; gap: 0; }
	.fxm-ai-ui[data-fxm-ai-drawer] [data-fxm-ai-header] > div:first-child > div:last-child { min-width: 0; }
	.fxm-ai-ui[data-fxm-ai-drawer] [data-fxm-ai-messages] { padding: 20px 12px; }
	.fxm-ai-ui[data-fxm-ai-drawer] [data-fxm-ai-form] { padding: 12px 12px max(12px, env(safe-area-inset-bottom)); }
	.fxm-ai-ui[data-fxm-ai-drawer] [data-fxm-ai-empty] { padding-top: 4px; }
	.fxm-ai-ui[data-fxm-ai-drawer] [data-fxm-ai-empty] h2 { font-size: 22px; }
	.fxm-ai-ui[data-fxm-ai-drawer] [data-fxm-ai-empty] > p { font-size: 13px; }
	.fxm-ai-ui[data-fxm-ai-drawer] [data-fxm-ai-suggestions] { grid-template-columns: minmax(0, 1fr); }
	.fxm-ai-ui[data-fxm-ai-drawer] .fxm-ai-suggest-card { min-height: 70px; padding: 12px 14px; }
	.fxm-ai-ui[data-fxm-ai-service-page] .fxm-ai-disclaimer,
	.fxm-ai-ui[data-fxm-ai-drawer] [data-fxm-ai-form] > .fxm-ai-disclaimer { font-size: 11px; margin-top: 8px; }
	.fxm-ai-ui .fxm-ai-session-delete { opacity: 1; min-width: 32px; min-height: 32px; }
}
@media (prefers-reduced-motion: reduce) {
	.fxm-ai-ui .fxm-ai-composer, .fxm-ai-ui [data-fxm-ai-send], .fxm-ai-ui .fxm-ai-suggest-card { transition: none; }
}

/* ---- Chat v3 answer layout: details drawer, KPI score ring, explain tip ---- */
.fxm-ai-ui .fxm-ai-details {
	border: 1px solid var(--ai-border, #e3e5eb);
	border-radius: 12px;
	background: #fff;
}
.fxm-ai-ui .fxm-ai-details > summary {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 11px 14px;
	font-size: 13px;
	font-weight: 600;
	color: var(--ai-accent, #4f34d9);
	cursor: pointer;
	list-style: none;
	user-select: none;
}
.fxm-ai-ui .fxm-ai-details > summary::-webkit-details-marker { display: none; }
.fxm-ai-ui .fxm-ai-details > summary::before {
	content: "";
	flex: 0 0 5px;
	width: 5px;
	height: 5px;
	border-top: 4px solid transparent;
	border-bottom: 4px solid transparent;
	border-left: 6px solid var(--ai-accent, #4f34d9);
	transition: transform .18s ease;
}
.fxm-ai-ui .fxm-ai-details[open] > summary::before { transform: rotate(90deg); }
.fxm-ai-ui .fxm-ai-details-body {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 12px 14px 14px;
	border-top: 1px solid rgba(28, 16, 80, 0.06);
}
.fxm-ai-ui .fxm-ai-kpi-ring {
	position: relative;
	width: 46px;
	height: 46px;
	flex: 0 0 46px;
	border-radius: 50%;
}
.fxm-ai-ui .fxm-ai-kpi-ring::after {
	content: "";
	position: absolute;
	inset: 4px;
	border-radius: 50%;
	background: #fff;
}
.fxm-ai-ui .fxm-ai-kpi-ring-label {
	position: absolute;
	inset: 0;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: -0.02em;
}
.fxm-ai-ui .fxm-ai-kpi-info {
	position: relative;
	display: inline-flex;
	margin-left: 4px;
	cursor: help;
	outline: none;
	vertical-align: middle;
}
.fxm-ai-ui .fxm-ai-kpi-info-dot {
	display: inline-flex;
	width: 13px;
	height: 13px;
	align-items: center;
	justify-content: center;
	border: 1px solid rgba(39, 46, 66, 0.25);
	border-radius: 50%;
	font-size: 8px;
	font-style: italic;
	font-weight: 700;
	line-height: 1;
	color: rgba(39, 46, 66, 0.45);
}
.fxm-ai-ui .fxm-ai-kpi-info-pop {
	position: absolute;
	bottom: calc(100% + 6px);
	left: 50%;
	transform: translateX(-50%);
	display: none;
	width: 190px;
	max-width: 60vw;
	padding: 7px 9px;
	border-radius: 8px;
	background: #283044;
	color: #fff;
	font-size: 10px;
	font-weight: 400;
	font-style: normal;
	line-height: 1.6;
	text-align: left;
	box-shadow: 0 10px 24px -12px rgba(25, 18, 66, 0.5);
	z-index: 30;
}
.fxm-ai-ui .fxm-ai-kpi-info:hover .fxm-ai-kpi-info-pop,
.fxm-ai-ui .fxm-ai-kpi-info:focus .fxm-ai-kpi-info-pop { display: block; }

/* Current-page suggestions only. Keep the existing drawer shell, welcome and composer unchanged. */
.fxm-ai-ui[data-fxm-ai-drawer] .fxm-page-suggestions { width: 100%; max-width: 880px; margin: 0 auto; text-align: left; font-family: "Microsoft YaHei", "微软雅黑", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", sans-serif; }
.fxm-ai-ui[data-fxm-ai-drawer] .fxm-page-suggestions[hidden] { display: none; }
.fxm-ai-ui[data-fxm-ai-drawer] .fxm-page-suggestions-context { display: flex; align-items: center; gap: 9px; width: fit-content; max-width: 100%; margin: 0 0 16px; padding: 9px 12px; border: 1px solid #eae9f0; border-radius: 9px; background: #f8f8fb; font-size: 12px; line-height: 1.6; }
.fxm-ai-ui[data-fxm-ai-drawer] .fxm-page-context-icon { display: inline-flex; flex-shrink: 0; color: #766a9d; }
.fxm-ai-ui[data-fxm-ai-drawer] .fxm-page-context-label { flex-shrink: 0; color: #6b6e7c; }
.fxm-ai-ui[data-fxm-ai-drawer] [data-fxm-page-suggestions-page] { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #4b4c5a; font-weight: 500; }
.fxm-ai-ui[data-fxm-ai-drawer] .fxm-page-suggestions-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 10px; }
.fxm-ai-ui[data-fxm-ai-drawer] .fxm-page-suggestions-heading h3 { margin: 0; color: #343440; font-size: 13px; font-weight: 500; letter-spacing: .04em; }
.fxm-ai-ui[data-fxm-ai-drawer] .fxm-page-suggestions-refresh { display: inline-flex; flex-shrink: 0; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 6px 10px; border: 0; border-radius: 8px; background: transparent; color: #706786; font-size: 12px; font-weight: 400; cursor: pointer; transition: background .18s, color .18s; }
.fxm-ai-ui[data-fxm-ai-drawer] .fxm-page-suggestions-refresh:hover { background: #f2eff9; color: #513b98; }
.fxm-ai-ui[data-fxm-ai-drawer] .fxm-page-suggestions-refresh:disabled { opacity: .5; cursor: wait; }
.fxm-ai-ui[data-fxm-ai-drawer] .fxm-page-suggestions[aria-busy="true"] .fxm-page-suggestions-refresh svg { animation: fxm-context-turn 1.6s linear infinite; }
.fxm-ai-ui[data-fxm-ai-drawer] .fxm-page-suggestions-status { margin: 0 0 12px; color: #6b667a; font-size: 13px; line-height: 1.8; }
.fxm-ai-ui[data-fxm-ai-drawer] .fxm-page-suggestions-status--quiet { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; margin: 0; }
.fxm-ai-ui[data-fxm-ai-drawer] .fxm-page-suggestions[data-state="ERROR"] .fxm-page-suggestions-status { padding: 16px 18px; border: 1px solid #e9e5f1; border-radius: 12px; background: #f9f8fc; color: #655971; }
.fxm-ai-ui[data-fxm-ai-drawer] [data-fxm-ai-empty] .fxm-page-suggestions-items,
.fxm-ai-ui[data-fxm-ai-drawer] .fxm-page-suggestions-items { display: grid; grid-template-columns: minmax(0, 1fr); width: 100%; max-width: none; gap: 8px; margin: 0; }
.fxm-ai-ui[data-fxm-ai-drawer] .fxm-page-suggestion { display: grid; grid-template-columns: 22px minmax(0, 1fr) 30px; align-items: center; gap: 14px; min-width: 0; min-height: 68px; padding: 16px 18px; border: 1px solid #e9e8ee; border-radius: 12px; background: #fff; color: #343341; text-align: left; cursor: pointer; transition: border-color .18s, background .18s, box-shadow .18s; }
.fxm-ai-ui[data-fxm-ai-drawer] .fxm-page-suggestion:hover { border-color: #c5b9e8; background: #faf8ff; box-shadow: 0 2px 8px -6px rgba(55, 35, 94, .3); }
.fxm-ai-ui[data-fxm-ai-drawer] .fxm-page-suggestion-number { color: #8b849d; font-family: "Nunito", sans-serif; font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.fxm-ai-ui[data-fxm-ai-drawer] .fxm-page-suggestion-text { color: #33323f; font-size: 15px; font-weight: 400; line-height: 1.75; overflow-wrap: anywhere; }
.fxm-ai-ui[data-fxm-ai-drawer] .fxm-page-suggestion-arrow { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border: 1px solid #eeebf5; border-radius: 50%; background: #f7f5fc; color: #7a65ab; transition: background .18s, color .18s, border-color .18s; }
.fxm-ai-ui[data-fxm-ai-drawer] .fxm-page-suggestion-arrow svg { width: 15px; height: 15px; }
.fxm-ai-ui[data-fxm-ai-drawer] .fxm-page-suggestion:hover .fxm-page-suggestion-arrow { border-color: #5940b5; background: #5940b5; color: #fff; }
.fxm-ai-ui[data-fxm-ai-drawer] .fxm-page-suggestion:focus-visible,
.fxm-ai-ui[data-fxm-ai-drawer] .fxm-page-suggestions-refresh:focus-visible { outline: 2px solid #7054c8; outline-offset: 3px; }
.fxm-ai-ui[data-fxm-ai-drawer] .fxm-page-suggestion-skeleton { position: relative; height: 68px; overflow: hidden; border: 1px solid #eeedf3; border-radius: 12px; background: #fbfbfd; }
.fxm-ai-ui[data-fxm-ai-drawer] .fxm-page-suggestion-skeleton::before { content: ""; position: absolute; inset: 26px 64px 26px 55px; border-radius: 5px; background: linear-gradient(100deg, #eeecf3 20%, #f8f7fb 45%, #eeecf3 70%); background-size: 240% 100%; animation: fxm-suggestion-shimmer 1.8s linear infinite; }
.fxm-ai-ui[data-fxm-ai-drawer] .fxm-page-suggestion-skeleton:nth-child(2)::before { right: 26%; }
.fxm-ai-ui[data-fxm-ai-drawer] .fxm-page-suggestion-skeleton:nth-child(3)::before { right: 18%; }
@keyframes fxm-suggestion-shimmer { to { background-position: -170% 0; } }
@keyframes fxm-context-turn { to { transform: rotate(360deg); } }
@media (max-width: 639px) {
  .fxm-ai-ui[data-fxm-ai-drawer] .fxm-page-suggestions { margin-top: 0; }
  .fxm-ai-ui[data-fxm-ai-drawer] .fxm-page-suggestions-context { flex-wrap: wrap; column-gap: 7px; row-gap: 3px; margin-bottom: 14px; padding: 8px 10px; font-size: 11px; }
  .fxm-ai-ui[data-fxm-ai-drawer] [data-fxm-page-suggestions-page] { white-space: normal; overflow-wrap: anywhere; }
  .fxm-ai-ui[data-fxm-ai-drawer] .fxm-page-suggestions-heading { margin-bottom: 6px; }
  .fxm-ai-ui[data-fxm-ai-drawer] .fxm-page-suggestions-refresh { min-height: 44px; }
  .fxm-ai-ui[data-fxm-ai-drawer] .fxm-page-suggestion { grid-template-columns: 17px minmax(0, 1fr) 26px; gap: 10px; padding: 14px 12px; min-height: 72px; border-radius: 11px; }
  .fxm-ai-ui[data-fxm-ai-drawer] .fxm-page-suggestion-text { font-size: 14px; line-height: 1.8; }
  .fxm-ai-ui[data-fxm-ai-drawer] .fxm-page-suggestion-arrow { width: 26px; height: 26px; }
  .fxm-ai-ui[data-fxm-ai-drawer] .fxm-page-suggestion-skeleton { height: 80px; }
  .fxm-ai-ui[data-fxm-ai-drawer] .fxm-page-suggestion-skeleton::before { inset-block: 31px; }
}
@media (prefers-reduced-motion: reduce) {
  .fxm-ai-ui[data-fxm-ai-drawer] .fxm-page-suggestion,
  .fxm-ai-ui[data-fxm-ai-drawer] .fxm-page-suggestion-arrow,
  .fxm-ai-ui[data-fxm-ai-drawer] .fxm-page-suggestions-refresh { transition: none !important; }
  .fxm-ai-ui[data-fxm-ai-drawer] .fxm-page-suggestion-skeleton::before,
  .fxm-ai-ui[data-fxm-ai-drawer] .fxm-page-suggestions-refresh svg { animation: none !important; }
}


/* 2026-10-06 scope correction: retain the site font, colors and block rendering.
 * One parent owns the reading gutters; recommendations never add a second inset. */
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) { --ai-content-width: 920px; --ai-accent: var(--color-primary, #4f34d9); }
.fxm-ai-ui[data-fxm-ai-drawer] { --ai-message-gutter: 40px; }
.fxm-ai-ui[data-fxm-ai-drawer] [data-fxm-ai-messages],
.fxm-ai-ui[data-fxm-ai-drawer] [data-fxm-ai-form] {
  width: 100%;
  max-width: calc(var(--ai-content-width) + var(--ai-message-gutter) + var(--ai-message-gutter));
  margin-inline: auto;
  padding-inline: var(--ai-message-gutter);
  box-sizing: border-box;
}
.fxm-ai-ui[data-fxm-ai-drawer] [data-fxm-ai-empty] { max-width: none; padding-inline: 0; }
.fxm-ai-ui[data-fxm-ai-drawer] .fxm-page-suggestions {
  width: 100%; max-width: none; margin-inline: 0; padding-inline: 0;
  font-family: var(--font-body);
}
/* 2026-10-20 reading pass: same site font, a real heading scale, roomier
 * body, brand bullets / numbered badges, a soft quote panel. */
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-markdown {
  color: #2b2f3e; font-family: var(--font-body); font-size: 15px; line-height: 1.8; letter-spacing: .005em;
}
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-assistant-body > div > p { font-size: 15px; line-height: 1.8; }
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-assistant-body > div > p[data-fxm-ai-disclaimer] { font-size: 12px; line-height: 1.7; }
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-markdown p { margin-block: 0 12px; line-height: 1.8; }
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-markdown :is(h1, h2, h3, h4) {
  margin-block: 24px 10px; color: #2f2658; font-family: var(--font-headline); font-weight: 700; line-height: 1.45; letter-spacing: -.005em;
}
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-markdown h1 { font-size: 20px; }
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-markdown h2 { font-size: 18px; }
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-markdown h3 { display: flex; align-items: center; gap: 10px; font-size: 17px; }
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-markdown h3::before {
  content: ""; flex: 0 0 4px; width: 4px; height: 17px; border-radius: 4px; background: linear-gradient(180deg, #8b72e8, #4f34d9);
}
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-markdown h4 { font-size: 15px; }
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-markdown strong { color: #2f2658; font-weight: 700; background: linear-gradient(transparent 62%, rgb(79 52 217 / 11%) 62%); }
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-markdown > :first-child { margin-top: 0; }
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-markdown > :last-child { margin-bottom: 0; }
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-markdown :is(ul, ol) { margin: 8px 0 14px; padding: 0; list-style: none; }
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-markdown li { position: relative; margin-block: 8px; padding-left: 22px; line-height: 1.8; }
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-markdown ul > li::before {
  content: ""; position: absolute; top: calc(.9em - 3px); left: 6px; width: 6px; height: 6px; border-radius: 50%; background: #4f34d9; box-shadow: 0 0 0 3px rgb(79 52 217 / 12%);
}
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-markdown ol { counter-reset: fxm-ai-ol; }
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-markdown ol > li { padding-left: 34px; counter-increment: fxm-ai-ol; }
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-markdown ol > li::before {
  content: counter(fxm-ai-ol); position: absolute; top: calc(.9em - 11px); left: 0; width: 22px; height: 22px; border-radius: 7px;
  background: #f1edff; color: #4f34d9; font: 700 12px/22px var(--font-body); text-align: center; font-variant-numeric: tabular-nums;
}
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-markdown blockquote {
  margin: 14px 0; padding: 10px 14px 10px 16px; border: 0; border-left: 3px solid #8b72e8; border-radius: 0 12px 12px 0;
  background: linear-gradient(90deg, #f5f2ff, #faf9ff); color: #5b5f6e; font-size: 14px; line-height: 1.75;
}
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-markdown hr { margin: 20px 0; border: 0; border-top: 1px solid #eeebf6; }
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-markdown a { color: #4f34d9; text-decoration: underline; text-decoration-color: rgb(79 52 217 / 35%); text-underline-offset: 3px; }
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-markdown a:hover { text-decoration-color: currentColor; }
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-assistant-body > :not([hidden]) ~ :not([hidden]) { margin-top: 16px; }
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-assistant-body > .fxm-ai-section ~ .fxm-ai-section { margin-top: 26px; }
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-section > div + div { margin-top: 14px; }
.fxm-ai-ui[data-fxm-ai-drawer] .fxm-page-suggestions-context { margin-bottom: 10px; }
.fxm-ai-ui[data-fxm-ai-drawer] .fxm-page-suggestions-heading { margin-bottom: 6px; }
.fxm-ai-ui[data-fxm-ai-drawer] .fxm-page-suggestions-items { gap: 6px; }
.fxm-ai-ui[data-fxm-ai-drawer] .fxm-page-suggestion { min-height: 56px; padding: 12px 16px; gap: 12px; }
.fxm-ai-ui[data-fxm-ai-drawer] .fxm-page-suggestion-text { font-size: 14px; line-height: 1.65; }
.fxm-ai-ui[data-fxm-ai-drawer] .fxm-page-suggestion-number { font-family: var(--font-body); }
.fxm-ai-ui[data-fxm-ai-drawer] .fxm-page-suggestion-skeleton { height: 56px; }
.fxm-ai-ui[data-fxm-ai-drawer] .fxm-page-suggestion-skeleton::before { top: 20px; bottom: 20px; }
.fxm-ai-ui[data-fxm-ai-drawer] :is(.fxm-page-context-icon, .fxm-page-suggestions-refresh, .fxm-page-suggestion-arrow) { color: var(--color-primary); }
.fxm-ai-ui[data-fxm-ai-drawer] .fxm-page-suggestion-arrow { background: color-mix(in srgb, var(--color-primary) 5%, white); border-color: color-mix(in srgb, var(--color-primary) 14%, white); }
.fxm-ai-ui[data-fxm-ai-drawer] .fxm-page-suggestion:hover { border-color: color-mix(in srgb, var(--color-primary) 35%, white); background: color-mix(in srgb, var(--color-primary) 2%, white); }
.fxm-ai-ui[data-fxm-ai-drawer] .fxm-page-suggestion:hover .fxm-page-suggestion-arrow { background: var(--color-primary); border-color: var(--color-primary); color: var(--color-on-primary); }
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-assistant-message :is([data-fxm-ai-followup], button.group[data-fxm-ai-select]) {
  font-family: var(--font-body); font-size: 12px; line-height: 1.6;
  color: var(--color-primary); border-color: color-mix(in srgb, var(--color-primary) 22%, transparent);
  background: var(--color-surface); padding: 6px 12px; border-radius: 999px;
  white-space: normal; text-align: left;
}
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-assistant-message :is([data-fxm-ai-followup], button.group[data-fxm-ai-select]):hover:not(:disabled) {
  color: var(--color-primary); border-color: var(--color-primary);
  background: color-mix(in srgb, var(--color-primary) 5%, white);
}
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-assistant-message button.group[data-fxm-ai-select] :is(span,svg) { color: inherit; }
@media (max-width: 1023px) {
  .fxm-ai-ui[data-fxm-ai-drawer] { --ai-message-gutter: 32px; }
}
@media (max-width: 639px) {
  .fxm-ai-ui[data-fxm-ai-drawer] { --ai-message-gutter: 20px; }
  .fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-user-bubble { font-size: 13px; line-height: 1.7; }
  .fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-markdown { font-size: 14px; line-height: 1.75; }
  .fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-markdown :is(p, li) { line-height: 1.75; }
  .fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-markdown blockquote { font-size: 13px; }
  .fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-assistant-body > div > p { font-size: 14px; line-height: 1.75; }
  .fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-markdown :is(h1, h2) { font-size: 17px; }
  .fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-markdown h3 { font-size: 16px; }
  .fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-markdown h3::before { height: 15px; }
  .fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-markdown h4 { font-size: 14px; }
  .fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-assistant-body > .fxm-ai-section ~ .fxm-ai-section { margin-top: 22px; }
  .fxm-ai-ui[data-fxm-ai-drawer] .fxm-page-suggestion { padding: 11px 12px; gap: 10px; }
  .fxm-ai-ui[data-fxm-ai-drawer] .fxm-page-suggestion-text { font-size: 13px; line-height: 1.7; }
  .fxm-ai-ui[data-fxm-ai-drawer] [data-fxm-ai-header] button[data-fxm-ai-new-chat] { font-size: 0; }
}

.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) [data-fxm-ai-messages] > :not([hidden]) ~ :not([hidden]) { margin-block-start: 18px; }
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-chat-row--assistant { padding-block: 4px 8px; }
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-chat-row--user { padding-block: 4px 8px; }

/* 思维链折叠区（SSE reasoning 事件）。原生 <details> 无样式也能用，这里只补视觉：
 * 弱化到正文之下——它是过程材料，不该和回答争夺注意力。
 * 边界用中性色而非主题色，避免和「正在生成」的状态强调混同。 */
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-reasoning {
	border: 1px solid var(--ai-border);
	border-radius: 10px;
	background: color-mix(in srgb, var(--color-on-surface) 2%, white);
	padding: 0 12px;
	margin-block: 2px 10px;
}
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-reasoning-summary {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 9px 0;
	cursor: pointer;
	list-style: none;
	font-size: 12px;
	line-height: 1.5;
	color: var(--ai-muted);
	user-select: none;
}
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-reasoning-summary::-webkit-details-marker { display: none; }
/* 自绘三角：默认收起时朝右，展开后朝下 */
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-reasoning-summary::before {
	content: '';
	width: 0;
	height: 0;
	border-left: 4px solid currentColor;
	border-top: 3.5px solid transparent;
	border-bottom: 3.5px solid transparent;
	transition: transform .15s ease;
	flex: 0 0 auto;
}
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-reasoning[open] .fxm-ai-reasoning-summary::before {
	transform: rotate(90deg);
}
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-reasoning-summary:hover { color: var(--ai-ink); }
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-reasoning-body {
	padding: 0 0 10px 10px;
	margin-inline-start: 4px;
	border-inline-start: 2px solid var(--ai-border);
	max-height: 320px;
	overflow-y: auto;
	overflow-wrap: anywhere;
}
@media (max-width: 639px) {
	.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-reasoning-body { max-height: 220px; }
}

/* 处理过程（v10 status.detail）：与思维链同一套弱化外观。进行中展开，
 * 正文开始后收成一行；结束后只留「已完成 · 用时」一行，可点开回看。 */
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-process {
	border: 1px solid var(--ai-border);
	border-radius: 10px;
	background: color-mix(in srgb, var(--color-on-surface) 2%, white);
	padding: 0 12px;
	margin-block: 6px 10px;
}
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-process--settled { margin-block: 0 8px; }
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-process-head {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 8px 0;
	cursor: pointer;
	list-style: none;
	font-size: 12px;
	line-height: 1.5;
	color: var(--ai-muted);
	user-select: none;
}
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-process-head::-webkit-details-marker { display: none; }
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-process-head::before {
	content: '';
	border-left: 4px solid currentColor;
	border-top: 3.5px solid transparent;
	border-bottom: 3.5px solid transparent;
	transition: transform .15s ease;
	flex: 0 0 auto;
}
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-process[open] .fxm-ai-process-head::before { transform: rotate(90deg); }
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-process-steps {
	display: grid;
	gap: 6px;
	margin: 0;
	padding: 0 0 10px;
	list-style: none;
	font-size: 12px;
	line-height: 1.5;
	color: var(--ai-ink);
}
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-process-step {
	display: grid;
	grid-template-columns: 14px minmax(0, 1fr);
	column-gap: 8px;
	align-items: baseline;
}
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-process-mark {
	width: 8px;
	height: 8px;
	margin: 0 auto;
	border-radius: 50%;
	border: 1.5px solid #c9c4dc;
	background: #fff;
}
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-process-step--running .fxm-ai-process-mark { border-color: #4F34D9; background: #4F34D9; animation: fxm-ai-process-pulse 1.6s ease-in-out infinite; }
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-process-step--done .fxm-ai-process-mark { border-color: #0F9D73; background: #0F9D73; }
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-process-step--failed .fxm-ai-process-mark { border-color: #D97706; background: #FEF3C7; }
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-process-step--pending,
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-process-step--skipped { color: var(--ai-muted); }
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-process-summary { grid-column: 2; color: var(--ai-muted); font-size: 11px; }
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-process-items {
	grid-column: 2;
	display: flex;
	flex-wrap: wrap;
	gap: 4px 6px;
	margin: 4px 0 0;
	padding: 0;
	list-style: none;
}
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-process-item {
	border-radius: 999px;
	background: #f2f0f8;
	padding: 1px 8px;
	color: var(--ai-muted);
	font-size: 11px;
}
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-process-item--done { color: #0F7A5A; background: #E8F7F1; }
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-process-item--running { color: #4F34D9; background: #EEEBFC; }
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-process-item--failed { color: #92400E; background: #FEF3C7; }
/* v10.17: a step still running/pending when the turn ended (stopped, or
 * read back from history) is shown as ended: neutral mark, no pulse. */
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-process-step--ended { color: var(--ai-muted); }
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-process-step--ended .fxm-ai-process-mark { border-color: #b9b5c8; background: #ebe9f1; }
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-process-item--ended { color: var(--ai-muted); background: #f2f0f8; }
@keyframes fxm-ai-process-pulse { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }

/* v10.17 stop: 「正在停止…」 while waiting for the server's CANCELLED,
 * and 「暂时无法停止」 (46505) when the stop was refused. */
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-stop-note { margin: 4px 0 6px; font-size: 12px; line-height: 1.5; color: var(--ai-muted); }
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-stop-note--failed { color: #92400E; }

/* v10.17 sessions still generating on the server (polled list). */
.fxm-ai-ui [data-fxm-ai-session] > div > div.fxm-ai-session-generating { display: inline-flex; align-items: center; gap: 5px; color: var(--ai-accent); }
.fxm-ai-ui .fxm-ai-session-spinner { width: 9px; height: 9px; flex-shrink: 0; border: 1.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: fxm-ai-session-spin .9s linear infinite; }
@keyframes fxm-ai-session-spin { to { transform: rotate(360deg); } }

/* v10.17 guest local records (guide §7.17).
 * Memory reset: a quiet centred divider before the turn the server answered
 * without the earlier context; it is information, not a warning. */
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-memory-reset { display: flex; align-items: center; gap: 10px; margin: 4px 0 12px; font-size: 11.5px; line-height: 1.5; color: var(--ai-muted); }
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-memory-reset::before,
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-memory-reset::after { content: ''; flex: 1 1 24px; height: 1px; background: var(--ai-border); }
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-memory-reset span { flex: 0 1 auto; max-width: 80%; text-align: center; }
/* 「清除游客对话记录」: easy to find at the end of the list (shared devices),
 * styled as a low-emphasis destructive action. 40px tall for touch. */
.fxm-ai-ui .fxm-ai-guest-clear { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; min-height: 40px; margin-top: 8px; padding: 8px 12px; border: 1px dashed #e3e5eb; border-radius: 8px; background: transparent; font-size: 12px; color: #7b808d; cursor: pointer; transition: color .15s ease, border-color .15s ease, background-color .15s ease; }
.fxm-ai-ui .fxm-ai-guest-clear:hover { border-color: #fecdd3; background: #fff1f3; color: #be123c; }
.fxm-ai-ui .fxm-ai-guest-clear:focus-visible { outline: 2px solid var(--ai-accent); outline-offset: 2px; }
.fxm-ai-ui .fxm-ai-session-notice--ok { background: #ecfdf5; color: #0f7a5a; }

/* 「已停止」是用户自己的动作，不是故障：中性色而非红色错误条。 */
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-inline-error--stopped {
	border-color: var(--ai-border);
	background: color-mix(in srgb, var(--color-on-surface) 3%, white);
	color: var(--ai-muted);
}
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-inline-error--stopped span { display: inline-flex; align-items: center; gap: 6px; }
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-inline-error button:disabled { opacity: .45; cursor: not-allowed; }
/* Guest 46429 (v10.6): a sign-in link styled like the retry action. */
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) a.fxm-ai-login-link { flex-shrink: 0; text-decoration: none; }
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-inline-error button + a.fxm-ai-login-link { margin-left: 0; }
@media (prefers-reduced-motion: reduce) {
	.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-process-step--running .fxm-ai-process-mark { animation: none; }
	.fxm-ai-ui .fxm-ai-session-spinner { animation: none; border-right-color: currentColor; opacity: .7; }
}

/* ---- v10.11 – v10.15 attachments (fxm-ai-attachments.js) ---- */
.fxm-ai-ui [hidden].fxm-ai-att-tray, .fxm-ai-ui [hidden].fxm-ai-att-button, .fxm-ai-ui .fxm-ai-att-input { display: none !important; }
.fxm-ai-ui .fxm-ai-att-button { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; border: 0; background: transparent; color: #6b6f80; font-size: 12px; line-height: 1; padding: 4px 6px; border-radius: 8px; cursor: pointer; transition: color .15s, background-color .15s; }
.fxm-ai-ui .fxm-ai-att-button:hover:not(:disabled) { color: #4f34d9; background: rgba(79,52,217,.06); }
.fxm-ai-ui .fxm-ai-att-button:disabled { opacity: .4; cursor: not-allowed; }
.fxm-ai-ui .fxm-ai-att-button--icon { width: 36px; height: 36px; justify-content: center; padding: 0; border-radius: 12px; }
.fxm-ai-ui .fxm-ai-composer-toolbar .fxm-ai-keyboard-hint { margin-left: auto; }
.fxm-ai-ui .fxm-ai-att-tray { padding: 0 0 10px; }
.fxm-ai-ui .fxm-ai-att-tray--drawer { padding: 0 0 8px; }
.fxm-ai-ui .fxm-ai-att-tray-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.fxm-ai-ui .fxm-ai-att-tray-note { margin: 6px 0 0; font-size: 11.5px; line-height: 1.5; color: #8a5a00; }
.fxm-ai-ui .fxm-ai-att-chip { display: flex; align-items: center; gap: 8px; min-width: 0; max-width: 260px; padding: 6px 6px 6px 6px; border: 1px solid #e6e3ee; border-radius: 12px; background: #fbfafe; }
.fxm-ai-ui .fxm-ai-att-chip.is-unreadable, .fxm-ai-ui .fxm-ai-att-chip.is-unsafe, .fxm-ai-ui .fxm-ai-att-chip.is-failed { border-color: #f5d0d6; background: #fff7f8; }
.fxm-ai-ui .fxm-ai-att-chip.is-unreadable .fxm-ai-att-thumb, .fxm-ai-ui .fxm-ai-att-chip.is-unsafe .fxm-ai-att-thumb { filter: grayscale(1); opacity: .6; }
.fxm-ai-ui .fxm-ai-att-chip.is-confirmed { border-color: #e6e3ee; background: #fbfafe; }
.fxm-ai-ui .fxm-ai-att-thumb { width: 40px; height: 40px; flex-shrink: 0; border-radius: 8px; object-fit: cover; background: #f1eff9; }
.fxm-ai-ui .fxm-ai-att-icon { display: inline-flex; width: 40px; height: 40px; flex-shrink: 0; align-items: center; justify-content: center; border-radius: 8px; background: #f1eff9; color: #4f34d9; }
.fxm-ai-ui .fxm-ai-att-text { display: flex; min-width: 0; flex: 1 1 auto; flex-direction: column; gap: 2px; text-align: left; }
.fxm-ai-ui .fxm-ai-att-name { overflow: hidden; font-size: 12px; font-weight: 600; line-height: 1.35; color: #2b2838; text-overflow: ellipsis; white-space: nowrap; }
.fxm-ai-ui .fxm-ai-att-state, .fxm-ai-ui .fxm-ai-att-desc, .fxm-ai-ui .fxm-ai-att-note { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; font-size: 11px; line-height: 1.4; color: #6b6f80; }
.fxm-ai-ui .fxm-ai-att-chip.is-unreadable .fxm-ai-att-state, .fxm-ai-ui .fxm-ai-att-chip.is-unsafe .fxm-ai-att-state, .fxm-ai-ui .fxm-ai-att-chip.is-failed .fxm-ai-att-state { color: #9f1239; }
.fxm-ai-ui .fxm-ai-att-spinner { display: inline-block; width: 9px; height: 9px; margin-right: 5px; border: 1.5px solid rgba(79,52,217,.25); border-top-color: #4f34d9; border-radius: 50%; vertical-align: -1px; animation: fxm-ai-att-spin .8s linear infinite; }
@keyframes fxm-ai-att-spin { to { transform: rotate(360deg); } }
.fxm-ai-ui .fxm-ai-att-actions { display: flex; flex-shrink: 0; align-items: center; gap: 2px; }
.fxm-ai-ui .fxm-ai-att-actions button { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 26px; border: 0; border-radius: 7px; background: transparent; color: #8a8f9c; cursor: pointer; }
.fxm-ai-ui .fxm-ai-att-actions button:hover { color: #4f34d9; background: rgba(79,52,217,.06); }
.fxm-ai-ui .fxm-ai-att-actions .fxm-ai-att-confirm { padding: 0 8px; font-size: 11px; color: #4f34d9; white-space: nowrap; }

/* User bubble: attachments above the text, up to four. */
.fxm-ai-ui .fxm-ai-user-bubble--attachments { display: flex; flex-direction: column; gap: 8px; }
.fxm-ai-ui .fxm-ai-att-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 0; padding: 0; list-style: none; max-width: 340px; }
.fxm-ai-ui .fxm-ai-att-grid:has(> li:only-child) { grid-template-columns: minmax(0, 1fr); }
.fxm-ai-ui .fxm-ai-att-item { min-width: 0; }
.fxm-ai-ui .fxm-ai-att-open { position: relative; display: flex; width: 100%; align-items: center; gap: 8px; padding: 6px; border: 1px solid #e3def0; border-radius: 10px; background: #fff; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.fxm-ai-ui span.fxm-ai-att-open { cursor: default; }
.fxm-ai-ui button.fxm-ai-att-open:hover { border-color: rgba(79,52,217,.35); }
.fxm-ai-ui .fxm-ai-att-item.is-muted .fxm-ai-att-thumb { filter: grayscale(1); opacity: .6; }
.fxm-ai-ui .fxm-ai-att-badge { position: absolute; top: 4px; left: 4px; padding: 1px 6px; border-radius: 999px; background: rgba(43,40,56,.78); color: #fff; font-size: 10px; line-height: 1.6; }

/* Provenance on report cards and file citations under the answer. */
.fxm-ai-ui .fxm-ai-from-file { display: flex; align-items: center; gap: 5px; margin: 8px 0 0; font-size: 11px; line-height: 1.5; color: #6b6f80; }
.fxm-ai-ui .fxm-ai-chart-card .fxm-ai-from-file { padding: 0 16px 12px; }
.fxm-ai-ui .fxm-ai-cites { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 4px; }
.fxm-ai-ui .fxm-ai-cites-title { font-size: 11.5px; font-weight: 600; color: #5f6472; }
.fxm-ai-ui .fxm-ai-cite-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.fxm-ai-ui .fxm-ai-cite { display: inline-flex; max-width: 100%; align-items: center; gap: 5px; padding: 3px 9px; border: 1px solid #e6e3ee; border-radius: 999px; background: #fbfafe; font-size: 11px; line-height: 1.5; color: #4b4f5e; }
.fxm-ai-ui .fxm-ai-cite > span:first-of-type { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fxm-ai-ui .fxm-ai-cite--b, .fxm-ai-ui .fxm-ai-cite--c { border-color: #f4dfb3; background: #fffaf0; }
.fxm-ai-ui .fxm-ai-cite-flag { display: inline-flex; width: 14px; height: 14px; align-items: center; justify-content: center; border-radius: 50%; background: #d97706; color: #fff; font-size: 9px; font-weight: 700; }
.fxm-ai-ui .fxm-ai-cites-hint { flex-basis: 100%; margin: 0; font-size: 11px; color: #8a5a00; }

/* Preview / privacy dialog (mounted on <body>). */
.fxm-ai-att-dialog { position: fixed; inset: 0; z-index: 100000; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(20,18,36,.55); }
.fxm-ai-att-dialog-panel { display: flex; width: min(720px, 100%); max-height: calc(100vh - 32px); flex-direction: column; overflow: hidden; border-radius: 16px; background: #fff; box-shadow: 0 24px 60px -20px rgba(20,18,36,.45); }
.fxm-ai-att-dialog-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid #eff0f5; }
.fxm-ai-att-dialog-head h3 { flex: 1 1 auto; min-width: 0; margin: 0; overflow: hidden; font-size: 15px; font-weight: 600; color: #2b2838; text-overflow: ellipsis; white-space: nowrap; }
.fxm-ai-att-dialog-close { display: inline-flex; width: 32px; height: 32px; flex-shrink: 0; align-items: center; justify-content: center; border: 0; border-radius: 8px; background: transparent; color: #6b6f80; cursor: pointer; }
.fxm-ai-att-dialog-close:hover { background: #f4f2fa; color: #2b2838; }
.fxm-ai-att-dialog-body { overflow: auto; padding: 16px; font-size: 14px; line-height: 1.7; color: #303342; }
.fxm-ai-att-dialog-image { display: block; max-width: 100%; max-height: calc(100vh - 140px); margin: 0 auto; object-fit: contain; }
.fxm-ai-att-dialog-text { margin: 0; color: #4b4f5e; }
@media (max-width: 639px) {
	.fxm-ai-ui .fxm-ai-att-chip { max-width: 100%; flex: 1 1 100%; }
	.fxm-ai-ui .fxm-ai-composer-toolbar .fxm-ai-att-button span { display: none; }
	.fxm-ai-att-dialog { padding: 0; align-items: flex-end; }
	.fxm-ai-att-dialog-panel { max-height: 92vh; border-radius: 16px 16px 0 0; }
}
@media (prefers-reduced-motion: reduce) {
	.fxm-ai-ui .fxm-ai-att-spinner { animation: none; }
}

/* ---- Attachment presentation refinement ----
 * Sent attachments sit above the lavender text bubble as their own tiles
 * (image thumbnails / file cards) instead of being squeezed inside it. */
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-user-bubble.fxm-ai-user-bubble--attachments {
	display: flex; flex-direction: column; align-items: flex-end; gap: 8px;
	padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none;
}
.fxm-ai-ui:is([data-fxm-ai-drawer], [data-fxm-ai-service-page]) .fxm-ai-user-bubble--attachments > p {
	margin: 0; padding: 11px 15px; border: 1px solid #e9e4f4; border-radius: 18px 18px 6px 18px; background: #f1eff9;
}
.fxm-ai-ui .fxm-ai-user-bubble--attachments .fxm-ai-att-grid {
	display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; max-width: 100%;
}
.fxm-ai-ui .fxm-ai-user-bubble--attachments .fxm-ai-att-item { flex: 0 1 auto; min-width: 0; max-width: 100%; }
.fxm-ai-ui .fxm-ai-user-bubble--attachments .fxm-ai-att-open {
	width: 248px; max-width: 100%; min-height: 56px; gap: 10px; padding: 8px 12px 8px 8px;
	border: 1px solid #e6e3ee; border-radius: 14px; background: #fff; box-shadow: 0 1px 2px rgba(37,39,53,.04);
	transition: border-color .15s, box-shadow .15s;
}
.fxm-ai-ui .fxm-ai-user-bubble--attachments button.fxm-ai-att-open:hover { border-color: #cfc5ec; box-shadow: 0 4px 14px rgba(79,52,217,.08); }
.fxm-ai-ui .fxm-ai-user-bubble--attachments .fxm-ai-att-icon { width: 40px; height: 40px; border-radius: 10px; }
.fxm-ai-ui .fxm-ai-user-bubble--attachments .fxm-ai-att-name { font-size: 12.5px; line-height: 1.4; }
.fxm-ai-ui .fxm-ai-user-bubble--attachments :is(.fxm-ai-att-desc, .fxm-ai-att-note) { -webkit-line-clamp: 1; font-size: 11.5px; color: #858b98; }
/* Image with a local preview: a thumbnail tile, name underneath. */
.fxm-ai-ui .fxm-ai-user-bubble--attachments .fxm-ai-att-open:has(> .fxm-ai-att-thumb) {
	width: 168px; flex-direction: column; align-items: stretch; gap: 0; padding: 0; overflow: hidden;
}
.fxm-ai-ui .fxm-ai-user-bubble--attachments .fxm-ai-att-open > .fxm-ai-att-thumb {
	width: 100%; height: 112px; border-radius: 0; background: #f1eff9;
}
.fxm-ai-ui .fxm-ai-user-bubble--attachments .fxm-ai-att-open:has(> .fxm-ai-att-thumb) > .fxm-ai-att-text { padding: 7px 10px 8px; }
.fxm-ai-ui .fxm-ai-user-bubble--attachments .fxm-ai-att-badge { top: 6px; left: 6px; }

/* Composer tray: one consistent chip height, quieter status line. */
.fxm-ai-ui .fxm-ai-att-chip { width: 236px; max-width: 100%; min-height: 54px; padding: 6px 4px 6px 6px; border-color: #e8e5f0; background: #faf9fd; }
.fxm-ai-ui .fxm-ai-att-chip .fxm-ai-att-thumb,
.fxm-ai-ui .fxm-ai-att-chip .fxm-ai-att-icon { width: 40px; height: 40px; border-radius: 9px; }
.fxm-ai-ui .fxm-ai-att-chip .fxm-ai-att-state { -webkit-line-clamp: 1; }
.fxm-ai-ui .fxm-ai-att-chip.is-ready .fxm-ai-att-state { color: #858b98; }
.fxm-ai-ui .fxm-ai-att-actions .fxm-ai-att-confirm { height: 24px; margin-right: 2px; border: 1px solid #ddd5f6; border-radius: 999px; background: #fff; font-weight: 500; }
.fxm-ai-ui .fxm-ai-att-actions .fxm-ai-att-confirm:hover { border-color: #b9a8ee; background: #f7f5ff; }
.fxm-ai-ui .fxm-ai-att-tray-note { display: flex; align-items: center; gap: 6px; margin-top: 8px; color: #7d8392; }
.fxm-ai-ui .fxm-ai-att-tray-note::before { content: ""; width: 5px; height: 5px; flex: 0 0 5px; border-radius: 50%; background: #a594e6; }
.fxm-ai-ui .fxm-ai-att-tray:has(:is(.is-unreadable:not(.is-confirmed), .is-unsafe, .is-failed)) .fxm-ai-att-tray-note { color: #8a5a00; }
.fxm-ai-ui .fxm-ai-att-tray:has(:is(.is-unreadable:not(.is-confirmed), .is-unsafe, .is-failed)) .fxm-ai-att-tray-note::before { background: #d97706; }
.fxm-ai-ui[data-fxm-ai-service-page] .fxm-ai-composer > .fxm-ai-att-tray { margin: 0 0 6px; padding: 0 0 12px; border-bottom: 1px solid #f0eff5; }
@media (max-width: 639px) {
	/* One swipeable row instead of a stack that pushes the input off screen. */
	.fxm-ai-ui .fxm-ai-att-tray-list { flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; scroll-snap-type: x proximity; }
	.fxm-ai-ui .fxm-ai-att-tray-list::-webkit-scrollbar { display: none; }
	.fxm-ai-ui .fxm-ai-att-tray-list > .fxm-ai-att-chip { flex: 0 0 212px; max-width: 212px; scroll-snap-align: start; }
	.fxm-ai-ui .fxm-ai-user-bubble--attachments .fxm-ai-att-open { width: 228px; }
	.fxm-ai-ui .fxm-ai-user-bubble--attachments .fxm-ai-att-open:has(> .fxm-ai-att-thumb) { width: 132px; }
	.fxm-ai-ui .fxm-ai-user-bubble--attachments .fxm-ai-att-open > .fxm-ai-att-thumb { height: 92px; }
}
/* ---- 2026-11-10: upload = done, many attachments, paperclip alignment ---- */
/* Tray: equal columns (four across on the page, two to five in the drawer)
 * instead of fixed 236px chips that leave the fourth one alone on a row;
 * never more than four columns (the per-message limit). */
.fxm-ai-ui .fxm-ai-att-tray-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(max(176px, calc((100% - 24px) / 4)), 1fr)); gap: 8px; }
.fxm-ai-ui .fxm-ai-att-tray-list > .fxm-ai-att-chip { width: auto; min-width: 0; max-width: none; }
/* 已上传: a small green tick instead of a spinner; nothing is pending. */
.fxm-ai-ui .fxm-ai-att-ok { display: inline-flex; width: 13px; height: 13px; margin-right: 4px; align-items: center; justify-content: center; border-radius: 50%; background: #10b981; color: #fff; vertical-align: -2px; }
.fxm-ai-ui .fxm-ai-att-ok svg { width: 9px; height: 9px; stroke-width: 3; }
/* Sent bubble: image tiles share one row; files stack underneath at the
 * width of two tiles, so 2 + 2 and 3 + 1 read as two tidy groups. */
.fxm-ai-ui .fxm-ai-user-bubble--attachments .fxm-ai-att-grid { --fxm-att-tile: 168px; }
.fxm-ai-ui .fxm-ai-user-bubble--attachments .fxm-ai-att-grid:has(.fxm-ai-att-thumb) > .fxm-ai-att-item--document { display: flex; flex-basis: 100%; justify-content: flex-end; order: 1; }
.fxm-ai-ui .fxm-ai-user-bubble--attachments .fxm-ai-att-grid:has(.fxm-ai-att-thumb) > .fxm-ai-att-item--document > .fxm-ai-att-open { width: calc(var(--fxm-att-tile) * 2 + 8px); }
/* Paperclip on the send button's centre line. The drawer composer is a
 * top-aligned row: 36px clip + 6px bottom = 44px send + 2px margin. */
.fxm-ai-ui .fxm-ai-att-button svg { display: block; flex-shrink: 0; }
.fxm-ai-ui[data-fxm-ai-drawer] [data-fxm-ai-form] .fxm-ai-composer > .fxm-ai-att-button--icon { align-self: flex-end; margin-bottom: 6px; }
@media (max-width: 639px) {
	/* Phones keep the single swipeable row. */
	.fxm-ai-ui .fxm-ai-att-tray-list { display: flex; }
	.fxm-ai-ui .fxm-ai-att-tray-list > .fxm-ai-att-chip { flex: 0 0 212px; width: auto; max-width: 212px; }
	/* Two image tiles side by side in the narrowest column (drawer at 360px
	 * leaves ~237px): 132px at most, shrinking with the viewport. */
	.fxm-ai-ui .fxm-ai-user-bubble--attachments .fxm-ai-att-grid { --fxm-att-tile: min(132px, calc((100vw - 136px) / 2)); }
	.fxm-ai-ui .fxm-ai-user-bubble--attachments .fxm-ai-att-open:has(> .fxm-ai-att-thumb) { width: var(--fxm-att-tile); }
	.fxm-ai-ui .fxm-ai-user-bubble--attachments .fxm-ai-att-open > .fxm-ai-att-thumb { height: calc(var(--fxm-att-tile) * .7); }
}
