/* Completing an action does not leave shortcuts open through restored focus. */
/* Hover greets; shortcuts open only after explicit activation. */
.studio-page #floating-companion .companion-tools{opacity:0!important;visibility:hidden!important;pointer-events:none!important;top:calc(100% + 4px);bottom:auto;transform:none}
.studio-page #floating-companion.tools-open .companion-tools{opacity:1!important;visibility:visible!important;pointer-events:auto!important}
.studio-page #floating-companion.tools-above .companion-tools{top:auto;bottom:calc(100% + 4px)}
.studio-page #floating-companion.is-dragging .companion-tools{opacity:0!important;visibility:hidden!important;pointer-events:none!important}
.studio-page #floating-companion:focus-within:not(:hover) .companion-hint{opacity:0;visibility:hidden}
@media(pointer:coarse){.studio-page #floating-companion .companion-tools>button{flex-basis:35px;width:35px}}
.companion-voice-done{display:block;margin:8px 0 0 auto;padding:4px 12px;border:1px solid var(--line);border-radius:3px;color:var(--ink)}
/* Chat workspace: one scale, scoped controls, responsive conversation area. */
body.studio-page #yabao-hub{--hub-surface:#fff;--hub-sidebar:#f5f7f7;--hub-line:#e3e8e8;--hub-text:#243631;--hub-muted:#65736f;--hub-soft:#f1f5f3;--hub-accent:#356754;--hub-user:#eaf2ee;--hub-field:#fff;--hub-hover:#e8eeeb;box-sizing:border-box;width:min(1000px,calc(100vw - 64px));height:min(660px,calc(100vh - 64px));height:min(660px,calc(100dvh - 64px));max-width:none;max-height:none;padding:0;margin:auto;overflow:hidden;border:1px solid #d6deda;border-radius:6px;background:var(--hub-surface);color:var(--hub-text);box-shadow:0 24px 80px #071d2838,0 2px 12px #071d2820;font-size:14px;text-align:left}
body.studio-page.dark #yabao-hub{--hub-surface:#172620;--hub-sidebar:#14221c;--hub-line:#304138;--hub-text:#e7eee9;--hub-muted:#a4b4ab;--hub-soft:#1e3026;--hub-accent:#a8cdb7;--hub-user:#294235;--hub-field:#1b2d23;--hub-hover:#293c30;border-color:#405549;box-shadow:0 24px 80px #0008}
#yabao-hub::backdrop{background:#172b3969;backdrop-filter:blur(5px)}
#yabao-hub *,#yabao-hub *::before,#yabao-hub *::after{box-sizing:border-box}
#yabao-hub button,#yabao-hub textarea{font:inherit;letter-spacing:0}
#yabao-hub button{cursor:pointer;box-shadow:none;background-image:none;transition:background-color .15s,color .15s}
#yabao-hub button:disabled{opacity:.45;cursor:default}
#yabao-hub button:focus-visible{outline:2px solid var(--hub-accent);outline-offset:3px}
#yabao-hub .icon{width:18px;height:18px;flex:none}
#yabao-hub .hub-layout{height:100%;min-height:0;display:grid;grid-template-columns:212px minmax(0,1fr)}
#yabao-hub .hub-sidebar{display:flex;flex-direction:column;min-height:0;min-width:0;padding:22px 14px 16px;background:var(--hub-sidebar);border-right:1px solid var(--hub-line)}
#yabao-hub .hub-identity{display:flex;align-items:center;gap:10px;padding:0 2px 24px}
#yabao-hub .hub-avatar{display:grid;place-items:center;flex:none}
#yabao-hub .hub-avatar img{display:block;width:100%;height:100%;object-fit:contain}
#yabao-hub .hub-avatar .yabao-skin-art{width:100%}
#yabao-hub .hub-portrait{width:64px;height:64px}
#yabao-hub .hub-identity>div:last-child{display:flex;flex-direction:column;gap:6px;min-width:0}
#yabao-hub .hub-identity b{font-size:18px;font-weight:600;color:var(--hub-text)}
#yabao-hub .hub-identity small{font-size:11px;color:var(--hub-muted);white-space:nowrap}
#yabao-hub .hub-new-chat{display:flex;align-items:center;gap:9px;width:100%;min-height:40px;padding:9px 11px;border:1px solid var(--hub-line);border-radius:4px;background:var(--hub-surface);color:var(--hub-text);font-size:13px;font-weight:500}
#yabao-hub .hub-new-chat>span:last-child{margin-left:auto;font-size:19px;color:var(--hub-muted);font-weight:400}
#yabao-hub .hub-new-chat:hover{background:var(--hub-hover)}
#yabao-hub .hub-history-label{margin:28px 10px 10px;font-size:11px;font-weight:500;color:var(--hub-muted)}
#yabao-hub .hub-topic-list{display:flex;flex:1;min-height:0;flex-direction:column;gap:4px;overflow:auto;scrollbar-width:thin;padding:0;background:transparent}
#yabao-hub .hub-topic-list:empty{flex:0}
#yabao-hub .hub-topic{display:flex;align-items:center;gap:9px;flex:none;min-width:0;min-height:37px;width:100%;padding:8px 10px;border:0;border-radius:3px;background:transparent;color:var(--hub-muted);text-align:left;font-size:12px}
#yabao-hub .hub-topic .icon{width:15px;height:15px}
#yabao-hub .hub-topic>span{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
#yabao-hub .hub-topic:hover,#yabao-hub .hub-topic[aria-current]{background:var(--hub-hover);color:var(--hub-text)}
#yabao-hub .hub-topic[aria-current]{font-weight:500}
#yabao-hub .hub-history-empty{margin:6px 10px auto;font-size:12px;line-height:1.9;color:var(--hub-muted)}
#yabao-hub .hub-history-empty[hidden]{display:none}
#yabao-hub .hub-storage-note{margin:auto 10px 0;padding-top:22px;font-size:10px;line-height:1.6;color:var(--hub-muted)}
#yabao-hub .hub-chat-pane{display:flex;flex-direction:column;min-width:0;min-height:0;background:var(--hub-surface)}
#yabao-hub .yabao-hub-header{display:flex;align-items:center;justify-content:space-between;gap:16px;flex:none;min-height:82px;padding:19px 24px;border-bottom:1px solid var(--hub-line)}
#yabao-hub .yabao-hub-header>div:first-child{min-width:0}
#yabao-hub-title{margin:0;color:var(--hub-text);font-size:17px;font-weight:600;line-height:1.5;overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1;overflow-wrap:anywhere}
#yabao-hub .yabao-hub-header p{margin:4px 0 0;font-size:11px;line-height:1.5;color:var(--hub-muted)}
#yabao-hub .hub-header-actions{display:flex;align-items:center;gap:15px;flex:none;max-width:48%}
#yabao-hub .hub-demo-note{display:flex;align-items:center;gap:6px;max-width:190px;font-size:11px;line-height:1.5;color:var(--hub-muted);text-align:right}
#yabao-hub .hub-demo-note::before{content:'';width:5px;height:5px;border-radius:50%;background:#b29b6f;flex:none}
#yabao-hub .hub-demo-note[data-state=online]::before{background:#649978}
#yabao-hub .hub-header-actions>button{display:grid;place-items:center;flex:none;width:32px;height:32px;padding:0;border:0;border-radius:3px;background:transparent;color:var(--hub-muted)}
#yabao-hub .hub-header-actions>button:hover{background:var(--hub-soft);color:var(--hub-text)}
#yabao-hub .chat-log{flex:1;min-height:0;height:auto;overflow:auto;scrollbar-width:thin;padding:25px 28px 12px;background:transparent;border:0;border-radius:0}
#yabao-hub .chat-log.is-empty{display:flex;align-items:center;justify-content:center;padding:14px 24px 20px}
#yabao-hub .hub-welcome{display:flex;align-items:center;flex-direction:column;width:100%;max-width:490px;text-align:center}
#yabao-hub .hub-welcome-avatar{width:92px;height:92px;margin-bottom:6px}
#yabao-hub .hub-welcome-label{font-size:11px;letter-spacing:2px;color:var(--hub-muted)}
#yabao-hub .hub-welcome h3{margin:10px 0 7px;font-size:25px;line-height:1.5;font-weight:500;letter-spacing:.3px;color:var(--hub-text)}
#yabao-hub .hub-welcome p{padding:0;margin:0;max-width:none;background:none;border:0;color:var(--hub-muted);font-size:13px;line-height:1.8}
#yabao-hub .hub-suggestions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));width:100%;gap:5px;padding-top:18px;margin-top:24px;border-top:1px solid var(--hub-line)}
#yabao-hub .hub-suggestions button{display:flex;justify-content:center;align-items:center;gap:7px;min-height:38px;min-width:0;padding:7px 4px;border:0;border-radius:3px;background:transparent;color:var(--hub-text);font-size:12px;font-weight:400}
#yabao-hub .hub-suggestions .icon{width:17px;height:17px;color:var(--hub-accent)}
#yabao-hub .hub-suggestions button:hover{background:var(--hub-soft);color:var(--hub-accent)}
#yabao-hub .hub-message{display:flex;gap:10px;align-items:flex-start;margin-bottom:20px}
#yabao-hub .hub-message-avatar{width:30px;height:34px;margin-top:3px}
#yabao-hub .hub-message{flex-wrap:wrap}
#yabao-hub .hub-message>p{flex:1;min-width:0}
#yabao-hub .hub-reply-speech{margin-left:40px;padding:4px 8px;border:1px solid var(--hub-line);border-radius:4px;color:var(--hub-accent);background:var(--hub-soft);font:inherit}
#yabao-hub .hub-mic{display:flex;align-items:center;gap:6px;min-height:36px;padding:6px 8px;border:0;border-radius:4px;background:transparent;color:var(--hub-muted)}
#yabao-hub .hub-mic:hover,#yabao-hub .hub-mic[aria-pressed=true]{background:var(--hub-soft);color:var(--hub-accent)}
#yabao-hub .hub-voice-status{color:var(--hub-muted);font:inherit;line-height:1.6}
#yabao-hub .hub-voice-status:not(:empty){padding-top:6px}
#yabao-hub .chat-log p{width:fit-content;max-width:calc(100% - 40px);margin:0;padding:10px 13px;border:0;border-radius:4px;background:var(--hub-soft);color:var(--hub-text);font-size:14px;line-height:1.85;white-space:pre-wrap;overflow-wrap:anywhere}
#yabao-hub .chat-log>p.user{margin:0 0 20px auto;max-width:84%;background:var(--hub-user);color:var(--hub-text)!important}
#yabao-hub .hub-welcome>p{max-width:none;width:auto;padding:0;background:none;font-size:13px;color:var(--hub-muted)}
#yabao-hub .yabao-hub-form{flex:none;width:100%;padding:12px 24px 16px;margin:0;background:var(--hub-surface);border:0}
#yabao-hub .hub-composer{padding:0;background:var(--hub-field);border:1px solid #cdd9d2;border-radius:5px;box-shadow:0 2px 5px #142c2610;overflow:hidden}
#yabao-hub .hub-composer:focus-within{border-color:#799d89;box-shadow:0 0 0 2px #729c8010}
#yabao-hub textarea{display:block;width:100%;min-width:0;min-height:67px;max-height:160px;margin:0;padding:13px 14px 4px;border:0;outline:none;border-radius:0;resize:none;background:transparent;color:var(--hub-text);font-size:14px;line-height:1.7;box-shadow:none}
#yabao-hub textarea:focus-visible{outline:none}
#yabao-hub textarea::placeholder{color:var(--hub-muted);opacity:.85}
#yabao-hub .hub-composer-tools{display:flex;align-items:center;gap:10px;padding:5px 8px 8px}
#yabao-hub .hub-upload{display:flex;align-items:center;gap:6px;min-height:32px;width:auto;height:auto;padding:5px 7px;border:0;border-radius:3px;background:transparent;color:var(--hub-muted);font-size:12px}
#yabao-hub .hub-upload:hover{background:var(--hub-soft);color:var(--hub-text)}
#yabao-hub .hub-key-hint{margin-left:auto;font-size:10px;color:var(--hub-muted)}
#yabao-hub .hub-send{display:grid;place-items:center;flex:none;width:34px;height:32px;min-height:32px;padding:0;border:1px solid #356754;border-radius:4px;background:#356754;color:#fff}
#yabao-hub .hub-send:hover{background:#285340}
#yabao-hub .yabao-hub-form>small{display:block;margin-top:8px;font-size:10px;line-height:1.5;color:var(--hub-muted)}
#yabao-hub .hub-attachments{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:7px}
#yabao-hub .hub-attachments:empty{display:none}
#yabao-hub .hub-attachments>span{display:flex;align-items:center;gap:6px;max-width:100%;padding:3px 6px 3px 9px;background:var(--hub-soft);border:1px solid var(--hub-line);border-radius:3px;color:var(--hub-text);font-size:12px}
#yabao-hub .hub-attachments>span>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#yabao-hub .hub-attachments button{display:grid;place-items:center;min-width:26px;min-height:26px;border:0;background:transparent;color:var(--hub-muted)}
#yabao-hub .hub-file-input[hidden]{display:none!important}
#yabao-hub .hub-request-status{font-size:12px;line-height:1.6;color:var(--hub-muted);overflow-wrap:anywhere}
#yabao-hub .hub-request-status:not(:empty){padding-top:8px}
#yabao-hub .hub-request-status button{margin-left:8px;padding:3px 8px;border:1px solid var(--hub-line);border-radius:3px;background:var(--hub-soft);color:var(--hub-text)}
@media(max-width:720px){body.studio-page #yabao-hub{width:calc(100vw - 24px);height:calc(100vh - 32px);height:calc(100dvh - 32px)}#yabao-hub .hub-layout{grid-template-columns:176px minmax(0,1fr)}#yabao-hub .hub-sidebar{padding:18px 10px 14px}#yabao-hub .hub-portrait{width:48px;height:48px}#yabao-hub .hub-identity{gap:7px}#yabao-hub .hub-identity small{font-size:10px}#yabao-hub .hub-header-actions{gap:7px}#yabao-hub .yabao-hub-header{padding:15px 18px}#yabao-hub .chat-log{padding:20px 18px 12px}#yabao-hub .yabao-hub-form{padding:10px 18px 13px}#yabao-hub .hub-key-hint{display:none}#yabao-hub .hub-send{margin-left:auto}}
@media(max-width:560px){body.studio-page #yabao-hub{width:calc(100vw - 16px);height:calc(100vh - 16px);height:calc(100dvh - 16px);border-radius:5px}#yabao-hub .hub-layout{grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr)}#yabao-hub .hub-sidebar{display:grid;grid-template-columns:1fr auto;align-items:center;gap:7px;padding:10px 12px;border-right:0;border-bottom:1px solid var(--hub-line)}#yabao-hub .hub-identity{padding:0;gap:6px}#yabao-hub .hub-portrait{width:34px;height:34px}#yabao-hub .hub-identity b{font-size:14px}#yabao-hub .hub-identity small,#yabao-hub .hub-history-label,#yabao-hub .hub-history-empty,#yabao-hub .hub-storage-note{display:none}#yabao-hub .hub-new-chat{width:auto;min-height:34px;padding:6px 9px;font-size:12px}#yabao-hub .hub-new-chat>span:last-child{display:none}#yabao-hub .hub-topic-list{grid-column:1/-1;flex-direction:row;max-height:34px;padding:0;gap:5px}#yabao-hub .hub-topic-list:empty{display:none}#yabao-hub .hub-topic{width:auto;max-width:180px;min-height:30px;padding:5px 8px;font-size:11px}#yabao-hub .yabao-hub-header{min-height:67px;padding:11px 14px;gap:9px}#yabao-hub-title{font-size:15px}#yabao-hub .hub-header-actions{max-width:49%;gap:4px}#yabao-hub .hub-demo-note{font-size:10px}#yabao-hub .hub-header-actions>button{width:28px;height:32px}#yabao-hub .chat-log{padding:18px 14px 10px}#yabao-hub .chat-log.is-empty{padding:12px 16px 20px}#yabao-hub .hub-welcome-avatar{width:82px;height:82px}#yabao-hub .hub-welcome h3{font-size:22px}#yabao-hub .hub-welcome>p{font-size:12px}#yabao-hub .hub-suggestions{gap:2px;margin-top:21px;padding-top:12px}#yabao-hub .hub-suggestions button{font-size:11px;gap:5px}#yabao-hub .hub-suggestions .icon{width:15px;height:15px}#yabao-hub .chat-log p{font-size:14px}#yabao-hub .yabao-hub-form{padding:8px 12px 12px}#yabao-hub textarea{font-size:16px;min-height:64px;padding:10px 12px 3px}#yabao-hub .hub-composer-tools{padding:4px 7px 7px}#yabao-hub .hub-upload{min-height:36px;padding:6px 7px}#yabao-hub .hub-send{width:36px;height:36px}#yabao-hub .yabao-hub-form>small{font-size:9px}}
@media(max-height:560px) and (min-width:561px){#yabao-hub .hub-welcome-avatar{width:58px;height:58px}#yabao-hub .hub-welcome h3{font-size:21px;margin-top:5px}#yabao-hub .hub-suggestions{margin-top:12px;padding-top:8px}#yabao-hub .yabao-hub-header{min-height:65px;padding-top:10px;padding-bottom:10px}}
@media(prefers-reduced-motion:reduce){#yabao-hub button{transition:none}}
