/* Uses the existing paper / forest-green palette and the user's untouched transparent PNG. */
.companion-dock{position:absolute;right:12px;bottom:calc(78px + env(safe-area-inset-bottom,0px));width:112px;z-index:6;pointer-events:none}
.companion-dock[hidden]{display:none!important}
.companion-launch{position:relative;width:100%;padding:0;display:flex;flex-direction:column;align-items:center;pointer-events:auto;min-height:44px}
.companion-launch>img{width:102px;height:153px;object-fit:contain;filter:drop-shadow(0 6px 7px #694b3a22);transform-origin:50% 90%;animation:companion-sway 5s ease-in-out infinite}
.companion-bubble{background:#fffaf5;border:1px solid #e7d9cc;border-radius:14px 14px 3px 14px;color:#78584d;font-size:12px;font-weight:500;padding:9px 12px;margin-bottom:-3px;box-shadow:0 3px 12px #534f3510}
.companion-minimize{pointer-events:auto;position:absolute;right:-5px;top:40px;z-index:1;display:grid;place-items:center;width:44px;height:44px;border-radius:50%;color:#6d7367;background:#f7f6f0e8}
.companion-minimize svg{width:14px;height:14px}.companion-mini-label{display:none}
.companion-dock.minimized{width:52px;right:14px}.minimized .companion-minimize,.minimized .companion-bubble{display:none}.minimized .companion-launch{background:var(--paper);border:1px solid #d5ddcc;border-radius:24px;box-shadow:0 4px 18px #173c301c;padding:6px 4px}.minimized .companion-launch>img{width:36px;height:48px;animation:none}.minimized .companion-mini-label{display:block;font-size:10px;margin-top:1px}
body:not([data-page="chat"]) .page{padding-bottom:200px}body.companion-minimized:not([data-page="chat"]) .page{padding-bottom:90px}
.companion-chat-bar{display:flex;align-items:center;gap:8px;min-height:46px;color:var(--muted);font-size:12px}.companion-chat-bar>button:last-child{margin-left:auto}.companion-chat-bar #companion-stop-speech{color:var(--rose);order:1}.companion-chat-bar>button:last-child{order:2}
.companion-intro{display:flex;align-items:center;gap:12px;min-height:190px;margin:4px 0 12px;border-bottom:1px solid #e8e1d5;padding:6px 0 18px}.companion-portrait{width:112px;flex:none}.companion-portrait img{width:112px;height:168px;object-fit:contain;filter:drop-shadow(0 5px 6px #694b3a14);transform-origin:50% 90%;animation:companion-sway 5s ease-in-out infinite}.companion-intro h1{font-family:var(--serif);font-size:25px;line-height:1.5;font-weight:600;margin:6px 0 8px;letter-spacing:.3px}.companion-hello{color:#ac6d6d;font-size:12px;margin:0}.companion-intro #companion-mood{font-size:12px;color:var(--muted);line-height:1.8;margin:0}
.has-conversation .companion-intro{min-height:102px;padding:0 0 12px;margin:0 0 14px;gap:12px}.has-conversation .companion-portrait{width:62px}.has-conversation .companion-portrait img{width:62px;height:93px}.has-conversation .companion-intro h1{font-size:19px;margin:2px 0}.has-conversation .companion-intro h1 br{display:none}.has-conversation .companion-hello{font-size:10px}
#page-chat .chat-status{flex-wrap:wrap;gap:5px;margin:0 0 14px;min-height:40px}#page-chat .chat-status #chat-mode{flex:1;min-width:80px;font-size:10px}#page-chat .chat-status button{margin-left:0;min-height:44px;padding:3px 5px;font-size:11px}#page-chat .chat-status #companion-connect{color:var(--rose)}
.companion-avatar{display:inline-block;width:34px;height:34px;border-radius:50%;overflow:hidden;background:#f1e5d9;flex:none}.companion-avatar img{width:34px;height:51px;object-fit:cover;object-position:top;transform:translateY(-3px)}
#page-chat .messages{gap:22px}#page-chat .message{font-size:14px}#page-chat .message.assistant{border:1px solid #e5e6da;background:#fffdf8;border-radius:4px 18px 18px 18px;padding:14px 15px}#page-chat .message.user{border-radius:18px 18px 4px 18px}#page-chat .assistant-label{font-family:var(--font);font-size:13px;font-weight:600;margin-bottom:10px}
.reply-actions{display:flex;gap:20px;flex-wrap:wrap}.reply-actions:empty{display:none}.reply-actions .text-button{min-height:44px;font-size:12px;color:var(--green)}.reply-actions [data-connect-companion]{color:var(--rose)}
.companion-thinking{display:flex;align-items:center;justify-content:center;gap:5px;padding:16px 0;color:var(--muted);font-size:12px}.companion-thinking i{width:5px;height:5px;background:var(--rose);border-radius:50%;animation:companion-dot 1.2s ease-in-out infinite}.companion-thinking i:nth-child(2){animation-delay:.15s}.companion-thinking i:nth-child(3){animation-delay:.3s}.companion-thinking span{margin-left:6px}
.companion-busy .companion-portrait img{animation:companion-sway 2s ease-in-out infinite}.companion-speaking .companion-portrait img{animation:companion-sway 1.4s ease-in-out infinite}
.companion-storage{text-align:center;color:var(--muted);font-size:10px;margin:20px 0 0}#page-chat .suggestions button{min-height:46px;font-size:13px}.composer textarea{font-size:16px}.composer{padding:10px 16px}.composer button{min-width:46px;height:48px}
@keyframes companion-sway{0%,100%{transform:translateY(0) rotate(-1deg)}50%{transform:translateY(-4px) rotate(1deg)}}
@keyframes companion-dot{0%,70%,100%{opacity:.35;transform:translateY(0)}35%{opacity:1;transform:translateY(-4px)}}
@media(max-width:899px){.app-shell{height:var(--companion-vvh,100dvh);height:min(100dvh,var(--companion-vvh,100dvh))}}
@media(max-width:359px){.companion-intro h1{font-size:22px}.companion-portrait,.companion-portrait img{width:92px}.companion-portrait img{height:138px}.companion-intro{min-height:164px}.has-conversation .companion-intro h1{font-size:17px}.companion-dock:not(.minimized){width:96px}.companion-launch>img{width:88px;height:132px}}
@media(max-height:600px){body[data-page="chat"] .bottom-nav{display:none}.has-conversation .companion-intro{display:none}.companion-intro{min-height:100px}.companion-portrait img{height:100px}.companion-intro h1{font-size:20px}}
@media(prefers-reduced-motion:reduce){.companion-launch>img,.companion-portrait img,.companion-thinking i{animation:none!important}}

.companion-restore{display:none;pointer-events:auto;position:absolute;bottom:8px;right:56px;min-width:44px;min-height:44px;padding:5px;background:var(--paper);border:1px solid var(--line);border-radius:50%;font-size:11px}.minimized .companion-restore{display:block}
/* Voice controls use their own namespace; camera styles and permission flow stay unchanged. */
.voice-options{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:0 18px;border-top:1px solid var(--line);flex-shrink:0;min-height:44px}.voice-options label{display:flex;align-items:center;gap:7px;min-height:44px;font-size:12px;color:#60725f;cursor:pointer}.voice-options input{accent-color:var(--green);width:16px;height:16px;margin:0}.voice-options button{min-height:44px}.voice-panel{padding:8px 16px;background:#eef1e7;display:flex;align-items:center;gap:10px;flex-shrink:0}.voice-panel[hidden],.voice-panel button[hidden]{display:none}.voice-panel p{font-size:12px;line-height:1.6;margin:0;flex:1;overflow-wrap:anywhere}.voice-panel button{min-height:44px;color:var(--rose)}
.composer .voice-mic{min-width:46px;width:46px;height:54px;flex:none;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;background:var(--pale);border:1px solid #d6dfcf;border-radius:12px;color:var(--green)}.voice-mic svg{width:20px;height:20px}.voice-mic-label{font-size:10px;line-height:1.2}.composer .voice-mic.listening{background:#f9e4e4;border-color:#c47f85;color:#a44050}.voice-mic.listening svg{animation:voice-pulse 1s ease-in-out infinite}.composer{gap:8px}.composer textarea{min-width:0}.voice-listening .companion-portrait img{animation:companion-sway 2s ease-in-out infinite}#voice-dialog .voice-check{display:flex;flex-direction:row;align-items:center;min-height:44px;gap:10px;font-size:14px}#voice-dialog .voice-check input{width:18px;height:18px;min-width:18px;min-height:18px;accent-color:var(--green)}.voice-privacy{font-size:12px;color:var(--muted);line-height:1.8;margin:18px 0}.voice-options + .voice-panel + .composer{border-top:0;padding-top:6px}@keyframes voice-pulse{50%{opacity:.45}}
@media(max-width:359px){.composer{padding-left:12px;padding-right:12px;gap:7px}.composer textarea{padding-left:9px;padding-right:9px}.voice-options{padding:0 14px}}

/* 连接状态与网页地址提示 */
#open-connection.link-warn{color:var(--rose)}
.origin-note{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.origin-note #origin-value{font-weight:600;word-break:break-all;color:var(--green)}
.origin-note .text-button{min-height:32px;padding:0 6px;font-size:12px;color:var(--green)}
