/* Companion chat presentation. All messages, recovery and voice actions retain their original IDs and handlers. */
.chat-focus .companion-web{--companion-thread:#f3f3f6;--companion-surface:#fff;--companion-user:#eadff0;--companion-ink:#38313f;--companion-muted:#95889f;--companion-border:#ece9f0}
[data-theme="night"] .chat-focus .companion-web{--companion-thread:#1d202a;--companion-surface:#282c37;--companion-user:#493e56;--companion-ink:#eee8f4;--companion-muted:#b6a8c1;--companion-border:#393b48}

.chat-focus .companion-web .message-avatar{border-radius:50%;overflow:hidden}

.chat-focus .companion-web .chat-messages{background-color:var(--companion-thread);padding:20px 14px;gap:18px;scrollbar-width:thin;scrollbar-color:var(--companion-border) transparent}
.chat-focus .companion-web .message{max-width:87%;gap:8px}.chat-focus .companion-web .message-avatar{width:29px;height:29px;margin-top:0}.chat-focus .companion-web .message-author,.chat-focus .companion-web .player-avatar{display:none}
.chat-focus .companion-web .message-bubble{padding:9px 12px;font-size:14px;line-height:1.75;border:1px solid var(--companion-border);border-radius:5px 15px 15px 15px;background:var(--companion-surface);color:var(--companion-ink);box-shadow:none}
.chat-focus .companion-web .message.user .message-bubble{background:var(--companion-user);border-color:transparent;border-radius:15px 5px 15px 15px;color:var(--companion-ink)}
.chat-focus .companion-web .message-continuation{margin-top:-12px}.chat-focus .companion-web .message-action{font-size:12px;color:var(--companion-muted)}
.chat-focus .companion-web .message-toolbar{min-height:0;margin:0;justify-content:flex-end;gap:2px}.chat-focus .companion-web .message-toolbar>[aria-label="更多消息操作"]{font-size:16px;letter-spacing:2px;min-height:28px;min-width:36px;padding:0 6px;color:var(--companion-muted)}
.chat-focus .companion-web .message-toolbar .message-voice{margin-right:auto}.chat-focus .companion-web .message-toolbar .voice-strip{border:1px solid var(--companion-border);border-radius:5px 15px 15px 15px;background:var(--companion-surface);padding:7px 10px;margin-top:6px;max-width:260px;color:var(--companion-muted)}
.chat-focus .companion-web .message.assistant .message-content:has(.voice-strip){background:transparent;border:0;overflow:visible}.chat-focus .companion-web .message-content:has(.voice-strip)>.message-toolbar{padding:0;margin:0}.chat-focus .companion-web .message.assistant .message-content:has(.voice-strip)>.message-bubble{background:var(--companion-surface);border:1px solid var(--companion-border)}
.chat-focus .companion-web .inner-message{margin:5px 0 0;font-size:11px}.chat-focus .companion-web .inner-message summary{min-height:26px;font-size:11px;color:var(--companion-muted);background:var(--companion-user)}
.chat-focus .companion-web .chat-composer{padding:10px 12px max(10px,env(safe-area-inset-bottom,0px));background:var(--companion-surface);border-color:var(--companion-border)}
.chat-focus .companion-web .composer-form{gap:6px;align-items:center;flex-wrap:wrap}.chat-focus .companion-web .composer-form>[role="alert"]{flex-basis:100%;font-size:12px}
.chat-focus .companion-web .composer-form textarea{font-size:16px!important;min-height:44px;line-height:24px;padding:9px 12px;border-radius:22px;background:var(--companion-thread);border-color:var(--companion-border);color:var(--companion-ink)}
.chat-focus .companion-web .chat-plus{border:0;background:transparent;color:var(--companion-muted);width:40px;min-width:40px;height:44px}.chat-focus .companion-web .send-button{width:40px;min-width:40px;height:44px;min-height:44px;border-radius:14px;background:#927aa2;color:#fff}.chat-focus .companion-web .send-button:disabled{background:var(--companion-user);color:var(--companion-muted)}
.chat-identity-error{margin:0;padding:7px 14px;font-size:12px;color:var(--color-text-primary);background:var(--color-bg-surface)}.chat-settings-quota{font-size:12px;padding:10px 14px;border:1px solid var(--color-border);border-radius:14px}.chat-settings-quota summary{cursor:pointer;min-height:28px;display:flex;align-items:center}
@media(min-width:769px){.chat-focus .chat-workspace:has(.companion-web){max-width:1000px}.chat-focus .companion-web .chat-messages{padding:28px clamp(24px,6vw,90px)}.chat-focus .companion-web .message{max-width:78%}.chat-focus .companion-web .chat-composer{padding:14px clamp(24px,6vw,90px)}}
@media(max-width:600px){.chat-focus .companion-web .chat-messages{padding:18px 12px}.chat-focus .companion-web .chat-composer{padding:8px max(8px,env(safe-area-inset-right,0px)) calc(8px + env(safe-area-inset-bottom,0px)) max(8px,env(safe-area-inset-left,0px))}.chat-focus .companion-web .message-toolbar>[aria-label="更多消息操作"]{min-height:32px;min-width:44px}}

/* Scope above the legacy palette's global important rules. */
html[data-xinyu-theme] .chat-focus .chat-container.companion-web .chat-composer{background:var(--companion-surface)!important;border-color:var(--companion-border)!important}

html[data-xinyu-theme] .chat-focus .chat-container.companion-web .message-bubble{font-size:14px;line-height:1.75;padding:9px 12px;background:var(--companion-surface)!important;color:var(--companion-ink)!important;border:1px solid var(--companion-border)!important;border-radius:5px 15px 15px 15px;box-shadow:none}
html[data-xinyu-theme] .chat-focus .chat-container.companion-web .message.user .message-bubble{background:var(--companion-user)!important;border-color:transparent!important;border-radius:15px 5px 15px 15px}
html[data-xinyu-theme] .chat-focus .chat-container.companion-web .composer-form textarea{background:var(--companion-thread)!important;color:var(--companion-ink)!important;border-color:var(--companion-border)!important}
html[data-xinyu-theme] .chat-focus .chat-container.companion-web .send-button{background:#927aa2!important;color:#fff!important;border:0!important}html[data-xinyu-theme] .chat-focus .chat-container.companion-web .send-button:disabled{background:var(--companion-user)!important;color:var(--companion-muted)!important}
@media(max-width:600px){html[data-xinyu-theme] .chat-focus .chat-container.companion-web .chat-composer{padding:8px max(8px,env(safe-area-inset-right,0px)) calc(8px + env(safe-area-inset-bottom,0px)) max(8px,env(safe-area-inset-left,0px))}}
