/* Shared tool conversations, based on the Assistant. No API or tier rules here. */
body:has(.fx-chat-page) { background: radial-gradient(ellipse at 15% 0%, rgba(var(--fx-ac1-rgb),.10), transparent 60%), var(--fx-bg-main); }
.fx-chat-page { --chat-width: 900px; color: var(--fx-text-main); }
.fx-chat-page [hidden] { display: none !important; }
.fx-chat-page :focus-visible { outline: 2px solid var(--fx-ac2); outline-offset: 3px; }
.fx-chat-page :is(.ac-wrap,.ss-wrap,.pg-wrap) { max-width: 1200px; }
.fx-chat-page :is(.ac-hero,.ss-hero,.pg-hero,.chat-tool-heading) { max-width: var(--chat-width); margin: 18px auto 24px; padding: 0 16px; text-align: left; }
.fx-chat-page :is(.ac-hero,.ss-hero,.pg-hero,.chat-tool-heading) h2 { margin: 0 0 8px; font-size: clamp(23px,3vw,32px); letter-spacing: -.7px; line-height: 1.2; }
.fx-chat-page :is(.ac-hero,.ss-hero,.pg-hero,.chat-tool-heading) p { margin: 0; max-width: 720px; color: var(--fx-text-muted); font-size: 13px; line-height: 1.65; }
.fx-chat-page :is(.ac-chat,.ss-chat,.pg-ai-box) { position: relative; max-width: var(--chat-width); margin: 0 auto; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; overflow: visible; }
.fx-chat-page :is(.chat-head,.pg-ai-head) { padding: 14px 16px; border: 0; background: transparent; }
.fx-chat-page :is(.assistant-avatar,.message-mini-avatar) { background: none; border: 0; box-shadow: none; color: var(--fx-ac1); }
.fx-chat-page :is(.chat-feed,.pg-ai-chat) { background: transparent; padding: 24px 16px; min-height: 220px; max-height: min(60dvh,640px); overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--fx-border-strong) transparent; }
.fx-chat-page :is(.message,.pg-ai-msg,.msg-wrapper) { animation: tool-chat-enter .22s ease-out; }
.fx-chat-page :is(.message.assistant .bubble,.pg-ai-msg.bot) { border: 0; background: transparent; box-shadow: none; padding: 0; color: var(--fx-text-main); }
.fx-chat-page :is(.message.user .bubble,.pg-ai-msg.user) { border: 1px solid var(--fx-border); border-radius: var(--fx-radius-md); background: var(--fx-bg-subtle); padding: 14px 18px; color: var(--fx-text-main); }
.fx-chat-page :is(.composer,.pg-ai-input,.input-box,.support-reply) { position: relative; border: 1px solid var(--fx-border-strong); border-radius: var(--fx-radius-md); background: var(--fx-bg-elevated); box-shadow: 0 12px 38px rgba(0,0,0,.10); padding: 14px; }
.fx-chat-page :is(.composer,.pg-ai-input,.input-box,.support-reply):focus-within { border-color: var(--fx-ac1); }
.fx-chat-page :is(.input-box,.pg-ai-input) { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.fx-chat-page :is(.input-box,.pg-ai-input,.support-reply) textarea { width: 100%; flex: 1 0 100%; min-width: 0; min-height: 52px; max-height: 180px; padding: 4px; border: 0; border-radius: 0; box-shadow: none; background: transparent; color: var(--fx-text-main); font: inherit; font-size: 16px; line-height: 1.5; resize: none; }
.fx-chat-page :is(.input-box,.pg-ai-input,.support-reply) textarea:focus { outline: none; box-shadow: none; }
.fx-chat-page :is(.send-btn,.pg-ai-send) { margin-left: auto; flex: 0 0 44px; width: 44px; min-height: 44px; height: 44px; padding: 11px; border: 0; border-radius: 50%; background: var(--fx-ac1); color: #fff; box-shadow: none; }
.fx-chat-page .pg-ai-send-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.fx-chat-page .pg-ai-send svg { display: block; width: 21px; height: 21px; }
.fx-chat-page .chat-chip { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 8px 12px; border: 1px solid var(--fx-border); border-radius: var(--fx-radius-pill); background: transparent; color: var(--fx-text-muted); font: inherit; font-size: 12px; cursor: pointer; }
.fx-chat-page .chat-chip:hover { background: var(--fx-bg-hover); color: var(--fx-text-main); }
.fx-chat-page .chat-chip[aria-pressed="true"] { color: var(--fx-ac2); background: var(--fx-ac2-soft); border-color: var(--fx-ac2); }
.fx-chat-page .chat-chip:disabled { opacity: .45; cursor: not-allowed; }
.fx-chat-page .chat-chip svg { width: 20px; height: 20px; }
.fx-chat-page .chat-popup { position: absolute; bottom: calc(100% + 10px); left: 0; z-index: 60; width: min(430px,100%); max-height: min(420px,55dvh); overflow-y: auto; padding: 18px; border: 1px solid var(--fx-border-strong); border-radius: var(--fx-radius-md); background: var(--fx-bg-elevated); box-shadow: var(--fx-shadow-lg); animation: tool-chat-enter .16s ease-out; }
.fx-chat-page .chat-popup h3 { margin: 0 0 14px; font-size: 15px; }
.fx-chat-page .chat-popup .settings-bar { display: flex; flex-direction: column; align-items: stretch; width: 100%; margin: 0; padding: 0; border: 0; background: none; box-shadow: none; gap: 14px; }
.fx-chat-page .chat-popup .setting-control { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; border: 0; background: none; }
.fx-chat-page .chat-popup .setting-label { width: 100%; }
.fx-chat-page .chat-popup .cw-spacer { display: none; }
.fx-chat-page .chat-popup .clear-btn { width: auto; align-self: flex-start; padding: 8px 12px; }
.fx-chat-page .chat-popup .clear-btn span { display: inline; }
.fx-chat-page .chat-popup .mode-group { flex-wrap: wrap; }
.fx-chat-page .chat-popup .fx-custom-select { max-width: 100%; }
.fx-chat-page .chat-suggestions { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.fx-chat-page .chat-attach-row { display: flex; align-items: center; gap: 12px; min-width: 0; }
.fx-chat-page .chat-attach-copy { flex: 1; color: var(--fx-text-muted); font-size: 14px; line-height: 1.5; }
.fx-chat-page .chat-attachment { display: flex; align-items: center; gap: 10px; padding: 12px 16px; margin: 16px 0; border: 1px solid var(--fx-border); border-radius: var(--fx-radius-md); background: var(--fx-bg-subtle); overflow-wrap: anywhere; animation: tool-chat-enter .25s ease-out; }
.fx-chat-page .chat-file { animation: tool-chat-enter .25s ease-out; }
.fx-chat-page .composer-note { padding: 12px 2px 0; font-size: 11px; line-height: 1.6; }
.fx-chat-page .chat-drop-overlay { position: fixed; inset: 12px; z-index: 10040; display: grid; place-content: center; gap: 10px; padding: 24px; border: 2px dashed var(--fx-ac2); border-radius: var(--fx-radius-lg); background: color-mix(in srgb, var(--fx-bg-main) 94%, transparent); color: var(--fx-text-main); text-align: center; pointer-events: none; font-size: 24px; }
.fx-chat-page .chat-drop-overlay small { font-size: 14px; color: var(--fx-text-muted); }
.fx-chat-page.is-chat-active [data-chat-seo] { display: none; }
.fx-chat-page [data-chat-seo] { max-width: var(--chat-width); margin: 48px auto 24px; }
/* The rhyme conversation keeps its composer in view; settings now live above it. */
main.fx-chat-page.cw-content { overflow: visible; }
.fx-chat-page.cw-content .chat-tool-heading { width: min(var(--chat-width),100%); flex-shrink: 0; }
.fx-chat-page.cw-content .chat-history { width: min(var(--chat-width),100%); margin: 0 auto; padding: 12px 16px 24px; }
.fx-chat-page.cw-content .input-container { position: relative; inset: auto; transform: none; max-width: var(--chat-width); width: min(var(--chat-width),calc(100% - 24px)); padding: 0; margin: 0 auto max(16px,env(safe-area-inset-bottom)); flex-shrink: 0; background: none; }
.fx-chat-page .ss-chat { min-height: 340px; padding: 16px; }
.fx-chat-page .ss-welcome { margin: 16px 0 36px; color: var(--fx-text-muted); line-height: 1.7; }
.fx-chat-page .ss-upload { margin: 0; }
.fx-chat-page .ss-upload .drop-zone { display: flex; flex-direction: row; align-items: center; gap: 12px; min-height: 76px; width: 100%; padding: 16px; border: 1px solid var(--fx-border-strong); border-radius: var(--fx-radius-md); background: var(--fx-bg-elevated); text-align: left; }
.fx-chat-page .ss-upload .ss-upload-icon { width: 24px; height: 24px; flex: 0 0 24px; margin: 0; }
.fx-chat-page .ss-upload .ss-upload-title { font-size: 14px; }
.fx-chat-page .ss-upload .ss-upload-desc { display: block; }
.fx-chat-page .ss-process { position: relative; inset: auto; padding: 24px 16px; background: transparent; border-radius: var(--fx-radius-md); }
.fx-chat-page .ss-footnotes { max-width: var(--chat-width); margin-inline: auto; }
.fx-chat-page .support-workspace { display: flex; flex-direction: column; overflow: visible; border: 0; box-shadow: none; background: none; max-width: var(--chat-width); margin: auto; }
.fx-chat-page .support-main { border: 0; background: transparent; min-width: 0; }
.fx-chat-page .support-archive { margin: 0 0 18px; color: var(--fx-text-muted); font-size: 12px; }
.fx-chat-page .support-archive > summary { cursor: pointer; padding: 10px 0; }
.fx-chat-page .support-sidebar { width: 100%; border: 1px solid var(--fx-border); border-radius: var(--fx-radius-md); background: var(--fx-bg-elevated); }
.fx-chat-page .support-thread { min-height: 200px; max-height: 55dvh; padding: 20px 8px; }
.fx-chat-page .support-message { max-width: 88%; border-radius: var(--fx-radius-md); box-shadow: none; }
.fx-chat-page .support-message:is(.assistant,.admin) { background: transparent; border: 0; padding-left: 0; }
.fx-chat-page .support-form { padding: 20px 0; background: transparent; }
.fx-chat-page .support-shortcuts { margin: 20px 0; grid-template-columns: repeat(2,minmax(0,1fr)); }
.fx-chat-page .support-shortcut { border-radius: var(--fx-radius-md); background: var(--fx-bg-subtle); }
.fx-chat-page .support-reply { margin: 12px 0; }
.fx-chat-page .support-shell { max-width: var(--chat-width); margin: auto; }
.fx-chat-page .support-hero { display: flex; align-items: flex-start; flex-direction: column; gap: 12px; max-width: none; padding: 18px 0; border: 0; background: transparent; box-shadow: none; text-align: left; }
.fx-chat-page .support-hero-actions { justify-content: flex-start; }
.fx-chat-page .support-hero p { margin: 0; }
.fx-chat-page .support-hero h2 { font-size: clamp(23px,3vw,32px); }
.fx-chat-page .support-main-head { background: none; padding-inline: 0; }
.fx-chat-page .support-compose { padding: 14px; border: 1px solid var(--fx-border-strong); border-radius: var(--fx-radius-md); background: var(--fx-bg-elevated); }
.fx-chat-page .support-compose textarea { border: 0; background: transparent; min-height: 90px; font-size: 16px; resize: vertical; }
.fx-chat-page .support-compose .support-submit { display: block; margin: 8px 0 0 auto; border-radius: var(--fx-radius-pill); background: var(--fx-ac1); color: #fff; font-size: 12px; }
.fx-chat-page .support-reply { display: flex; flex-direction: column; }
.fx-chat-page .support-reply-actions { display: flex; flex-wrap: wrap; align-self: flex-end; }
.fx-chat-page .support-reply-actions button { border-radius: var(--fx-radius-pill); font-size: 12px; }
.fx-chat-page .support-form textarea:focus-visible { outline: 2px solid var(--fx-ac2); }
@keyframes tool-chat-enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media(max-width:700px) {
    .fx-chat-page :is(.ac-hero,.ss-hero,.pg-hero,.chat-tool-heading) { margin-block: 16px; padding-inline: 12px; }
    .fx-chat-page :is(.chat-feed,.pg-ai-chat) { padding: 16px 8px; }
    .fx-chat-page :is(.composer,.pg-ai-input,.input-box,.support-reply) { padding: 12px; }
    .fx-chat-page .chat-head { flex-wrap: wrap; gap: 10px; padding-inline: 4px; }
    .fx-chat-page .ss-chat { padding: 8px 0; }
    .fx-chat-page .chat-attach-copy { font-size: 12px; }
    .fx-chat-page .support-message { max-width: 96%; }
}
@media(prefers-reduced-motion:reduce) { .fx-chat-page *, .fx-chat-page *::before { animation: none !important; scroll-behavior: auto !important; transition: none !important; } }
