/* The guide stays quiet until a conversation is opened. Voice behavior is unchanged. */
body .ai-guide,
body .ai-guide.has-host-panel {
  top:auto; left:auto; right:24px; bottom:34px; width:272px; z-index:30;
  font-family:"PingFang SC","Microsoft YaHei",sans-serif;
}
body .ai-guide .ai-guide-shell {
  color:#23463b; background:#fbfaf5fa; border:1px solid #e4e7dd;
  border-radius:8px; box-shadow:0 8px 28px #102e2620; backdrop-filter:blur(16px);
}
body .ai-guide .ai-guide-summary { min-height:80px; padding:12px 14px; gap:12px; }
body .ai-guide .ai-avatar-photo,
body .ai-guide.expanded .ai-avatar-photo {
  width:54px!important; height:64px!important; margin:0!important;
  border-radius:6px; box-shadow:none; filter:none;
}
body .ai-guide .ai-avatar-photo::before { display:none; }
body .ai-guide .ai-avatar-photo img { object-fit:cover; object-position:50% 16%; }
body .ai-guide .ai-guide-name {
  margin:0 0 5px; color:#23463b; font-size:20px; letter-spacing:.5px;
  font-family:"STSong","Songti SC","SimSun",serif; font-weight:500;
}
body .ai-guide .ai-guide-name small { font:11px/1.4 "PingFang SC","Microsoft YaHei",sans-serif; color:#69786c; padding:0; border:0; background:none; }
body .ai-guide .ai-guide-eyebrow { display:none; }
body .ai-guide .ai-guide-state-line { font-size:12px; line-height:1.55; color:#5f7065; }
body .ai-guide .ai-guide-state-dot { width:5px; height:5px; background:#678c73; box-shadow:none; }
body .ai-guide .ai-guide-open { margin-top:5px; font-size:12px!important; line-height:1.5; color:#315c48!important; min-height:24px; }
body .ai-guide:not(.expanded) .ai-guide-state-line,
body .ai-guide:not(.expanded) .ai-guide-expand { display:none; }
body .ai-guide .guide-realtime-entry { margin:0 14px 12px; padding:0; border:0; border-radius:0; background:none; }
body .ai-guide .guide-realtime-actions { gap:6px; }
body .ai-guide .guide-realtime-actions #guideRealtimeStart {
  min-height:40px; padding:9px 12px; font-size:13px; font-weight:500;
  color:#fff; background:#244c3e; border:0; border-radius:8px;
}
body .ai-guide .guide-realtime-actions #guideRealtimeStart:hover:not(:disabled) { background:#35654f; }
body .ai-guide .guide-realtime-actions #guideRealtimeEnd { border:1px solid #d8c8b8; background:#f2e9df; color:#76533c; font-size:13px; border-radius:8px; }
body .ai-guide:not(.expanded) .guide-realtime-entry:not([data-phase=idle]):not([data-phase=failed]) #guideRealtimeStart { display:none; }
body .ai-guide:not(.expanded) .guide-realtime-actions #guideRealtimeEnd { flex:1; }
body .ai-guide .guide-realtime-status,
body .ai-guide:not(.expanded) .guide-realtime-status {
  display:flex; gap:5px; margin-top:7px; color:#647669; font-size:11px; line-height:1.5;
}
body .ai-guide .guide-realtime-entry[data-phase=failed] .guide-realtime-status { color:#8a602e; }
body .ai-guide .guide-realtime-status i { background:#678c73; box-shadow:none; }
body .ai-guide .guide-realtime-status #guideRealtimeRefresh { color:#5c6f5d; background:#edf0e7; font-size:11px; min-height:24px; }
body .ai-guide .guide-realtime-entry #guideRealtimeHint { font-size:12px; color:#748074; line-height:1.65; margin-top:7px; }
body .ai-guide button:focus-visible, body .ai-guide textarea:focus-visible, body .ai-guide select:focus-visible {
  outline:2px solid #537e60; outline-offset:3px;
}

/* Expanded conversations keep their close control available while content scrolls. */
body .ai-guide.expanded,
body .ai-guide.expanded.has-host-panel { top:auto; right:24px; bottom:24px; left:auto; width:380px; max-width:calc(100vw - 48px); }
body .ai-guide.expanded .ai-guide-shell { max-height:calc(100dvh - 110px); overflow-y:auto; overscroll-behavior:contain; scrollbar-width:thin; }
body .ai-guide.expanded .ai-guide-summary { position:sticky; top:0; z-index:3; min-height:88px; padding:12px 50px 12px 16px; background:#fbfaf5; border-bottom:1px solid #e7e9e0; }
body .ai-guide.expanded .ai-guide-expand { display:grid; top:16px; right:14px; width:32px; height:32px; background:#eef1e9; color:#365540!important; border-radius:8px; }
body .ai-guide.expanded .ai-guide-greeting { padding:12px 16px; font-size:13px; line-height:1.7; color:#6b7669; }
body .ai-guide.expanded .guide-realtime-entry { margin:0 16px 14px; }
body .ai-guide.expanded .guide-realtime-status { font-size:12px; }
body .ai-guide .xiaoyi-mode-tabs { padding:0 16px 12px; gap:8px; }
body .ai-guide .xiaoyi-mode-tabs button { padding:10px; border:1px solid #dce2d6; border-radius:8px; background:#f6f7f0; color:#69776a; font-size:14px; }
body .ai-guide .xiaoyi-mode-tabs button.active { background:#e9efe4; border-color:#aabda5; color:#28523c; }
body .ai-guide .xiaoyi-mode-tabs small { display:none; }
body .ai-guide.expanded .ai-guide-body { max-height:none!important; overflow:visible; border-top:1px solid #e4e8dd; }
body .ai-guide .ai-guide-config { padding:12px 16px; background:#f0f3e9; border-color:#e0e7d7; }
body .ai-guide .ai-guide-config strong { font-size:13px; color:#4e654a; }
body .ai-guide .ai-guide-config p { font-size:12px; line-height:1.65; color:#74816e; }
body .ai-guide .ai-guide-messages { min-height:110px; max-height:240px; padding:8px 16px 12px; }
body .ai-guide .ai-guide-message-bubble { color:#3c5944; background:#edf2e8; border-color:#dce5d5; font-size:14px; line-height:1.8; }
body .ai-guide .ai-guide-message.user .ai-guide-message-bubble { color:#fff; background:#315b43; border-color:#315b43; }
body .ai-guide .ai-guide-message.error .ai-guide-message-bubble { color:#855338; background:#f7eee5; border-color:#e7d1bd; }
body .ai-guide .ai-guide-message-label { color:#788572; font-size:11px; }
body .ai-guide .ai-guide-welcome h3 { color:#34573d; font-size:18px; }
body .ai-guide .ai-guide-welcome p { color:#6e7f67; font-size:13px; }
body .ai-guide .ai-guide-toolbar { padding:10px 16px 5px; }
body .ai-guide .ai-guide-toolbar-title, body .ai-guide .ai-guide-toolbar-actions button { color:#6a8063!important; font-size:12px; }
body .ai-guide .ai-guide-examples { padding:10px 16px 12px; }
body .ai-guide .ai-guide-example { padding:7px 9px; border-radius:6px; font-size:12px!important; }
body .ai-guide .ai-guide-examples-label { font-size:11px; }
body .ai-guide .ai-guide-composer { padding:0 16px 10px; }
body .ai-guide .ai-guide-input-wrap { border-radius:8px; border-color:#cbd8c3; background:#fff; padding:12px; }
body .ai-guide textarea { min-height:52px; font-size:15px; color:#2b4d32; }
body .ai-guide .ai-guide-send, body .ai-guide .ai-guide-cancel { min-height:34px; border-radius:6px; padding:7px 12px; font-size:12px!important; }
body .ai-guide .ai-guide-character-count, body .ai-guide .ai-guide-voice-note, body .ai-guide .ai-guide-privacy { font-size:11px; line-height:1.7; color:#7a8771; }
body .ai-guide.expanded .xiaoyi-realtime-voice { max-height:none!important; overflow:visible; padding:14px 16px 16px; border-color:#e0e7d7; }
body .ai-guide .voice-service-kicker { font-size:11px; color:#7a846e; }
body .ai-guide .voice-service-line strong { font-size:14px; color:#3e603d; }
body .ai-guide .voice-connection-note, body .ai-guide .voice-privacy-note { font-size:12px; line-height:1.7; color:#74816c; }
body .ai-guide .voice-language-row { border-color:#e0e7d7; }
body .ai-guide .voice-language-row label { color:#5c7454; font-size:13px; }
body .ai-guide .voice-language-row select { color:#31552f; background:#fff; border-color:#c6d5ba; border-radius:6px; font-size:14px; }
body .ai-guide .voice-call-actions { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:6px; }
body .ai-guide .voice-call-actions button { min-height:40px; padding:8px 3px; border-radius:6px; font-size:12px; }
body .ai-guide .voice-session-line { font-size:12px; color:#677e5e; }
body .ai-guide .voice-captions { min-height:110px; max-height:240px; }
body .ai-guide .voice-caption p { font-size:14px; line-height:1.8; }
body .ai-guide .voice-caption-tools, body .ai-guide .voice-caption-tools button { font-size:11px; }
body .ai-guide .voice-call-notice { font-size:13px; line-height:1.7; background:#f5eddb; border-color:#e4d3ac; color:#806236; }

@media(max-width:760px) {
  body .ai-guide:not(.expanded), body .ai-guide.has-host-panel:not(.expanded) {
    left:12px; right:12px; top:auto; bottom:10px; width:auto; margin:0;
  }
  body .ai-guide:not(.expanded) .ai-guide-shell { display:grid; grid-template-columns:minmax(0,1fr) 126px; min-height:76px; }
  body .ai-guide:not(.expanded) .ai-guide-summary { min-height:76px; padding:9px 0 9px 10px; gap:9px; }
  body .ai-guide:not(.expanded) .ai-avatar-photo { display:block!important; width:44px!important; height:56px!important; margin:0!important; border-radius:5px; }
  body .ai-guide:not(.expanded) .ai-guide-name { display:block; font-size:18px; margin-bottom:1px; }
  body .ai-guide:not(.expanded) .ai-guide-name small { display:none; }
  body .ai-guide:not(.expanded) .ai-guide-open { font-size:12px!important; margin-top:1px; min-height:27px; white-space:nowrap; }
  body .ai-guide:not(.expanded) .ai-guide-open svg { display:none; }
  body .ai-guide:not(.expanded) .guide-realtime-entry { align-self:center; margin:7px 10px 7px 0; min-width:0; }
  body .ai-guide:not(.expanded) .guide-realtime-actions #guideRealtimeStart,
  body .ai-guide:not(.expanded) .guide-realtime-actions #guideRealtimeEnd { min-height:34px; padding:6px 7px; font-size:12px; line-height:1.5; }
  body .ai-guide:not(.expanded) .guide-realtime-actions #guideRealtimeStart svg { display:none; }
  body .ai-guide:not(.expanded) .guide-realtime-status { font-size:10px; line-height:12px; gap:3px; margin-top:4px; min-height:12px; }
  body .ai-guide:not(.expanded) .guide-realtime-status i { display:none; }
  body .ai-guide:not(.expanded) .guide-realtime-status #guideRealtimeRefresh { min-height:20px; font-size:10px; line-height:12px; padding:3px; }
  body .ai-guide.expanded, body .ai-guide.expanded.has-host-panel { top:auto; bottom:10px; left:12px; right:12px; width:auto; max-width:420px; margin-left:auto; }
  body .ai-guide.expanded .ai-guide-shell { max-height:calc(100dvh - 88px); }
  body .ai-guide.expanded .ai-guide-summary { min-height:84px; }
  body .ai-guide.expanded .ai-avatar-photo { width:48px!important; height:58px!important; }
  body .ai-guide.expanded .ai-guide-state-line { font-size:12px; }
  body .ai-guide textarea { font-size:16px; }
}
@media(max-width:350px) {
  body .ai-guide:not(.expanded) .ai-guide-shell { grid-template-columns:minmax(0,1fr) 118px; }
  body .ai-guide:not(.expanded) .ai-guide-summary { gap:6px; padding-left:8px; }
  body .ai-guide:not(.expanded) .ai-avatar-photo { width:38px!important; height:52px!important; }
}
@media(prefers-reduced-motion:reduce) { body .ai-guide, body .ai-guide * { animation:none!important; transition:none!important; } }
