:root{color-scheme:dark;--ink:#f2edf8;--muted:#9692a6;--accent:#bca0f3;--surface:#191923;font:14px/1.5 'Segoe UI',system-ui,sans-serif}*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;background:transparent}body{color:var(--ink);overflow:hidden}button,input,select{font:inherit}button{border:0;color:inherit;background:transparent;cursor:pointer;border-radius:10px;transition:background .15s}button:hover{background:#ffffff0f}button:focus-visible,input:focus-visible,select:focus-visible{outline:2px solid var(--accent);outline-offset:3px}button:disabled{opacity:.5;cursor:wait}button[hidden],[hidden]{display:none!important}#shell{position:relative;width:100%;height:100%;display:flex;flex-direction:column;padding:20px 24px 18px;background:radial-gradient(ellipse at 50% 42%,#282336 0%,#181922 65%);border:1px solid #ffffff12;border-radius:22px;overflow:hidden}header{display:flex;align-items:center;min-height:28px;-webkit-app-region:drag}.brand{font-size:10px;font-weight:600;letter-spacing:2.8px;display:flex;align-items:center;gap:10px}.star{font-size:25px;color:var(--accent);line-height:1}.version{letter-spacing:1px;font-size:9px;color:#777384}.window-actions{display:flex;margin-left:auto;-webkit-app-region:no-drag}.window-actions button{width:26px;height:26px;color:var(--muted);font-size:20px}.connection{display:flex;align-items:center;gap:7px;margin-top:14px;color:var(--muted);font-size:10px;letter-spacing:.3px}.connection button{font-size:18px;width:26px}.dot{width:5px;height:5px;border-radius:50%;background:#8a748f}.dot.online{background:#b3c7a6;box-shadow:0 0 10px #b3c7a633}.spacer{flex:1}#stage{position:relative;flex:1;min-height:160px;display:flex;align-items:flex-end;justify-content:center}.halo{position:absolute;bottom:12%;width:76%;aspect-ratio:1;border:1px solid #c7b4ef0c;border-radius:50%;box-shadow:0 0 0 28px #c7b4ef03}.halo:before{content:'✧';position:absolute;top:20%;left:0;color:#c7b4ef60;font-size:14px}#avatar{width:100%;height:100%;position:absolute;inset:0;cursor:pointer;display:flex;align-items:flex-end;justify-content:center}#avatar canvas,#avatar svg{display:block;width:100%;height:100%;object-fit:contain;overflow:visible}#avatar svg{max-height:340px;filter:drop-shadow(0 15px 14px #0005)}.demo-body{transform-origin:160px 305px;animation:breathe 4s ease-in-out infinite}.demo-eye{transform-origin:center;transform-box:fill-box;animation:blink 6s infinite}.demo-mouth{transition:ry .1s}#bubble{position:absolute;top:10%;right:0;max-width:82%;background:#f0eaf8;color:#34313f;border:1px solid #fff8;box-shadow:0 10px 25px #0002;border-radius:16px 16px 4px 16px;padding:8px 10px;pointer-events:none;z-index:2}#bubble-module{font-size:8px;font-weight:700;letter-spacing:1.6px;color:#8b7b9d}#bubble p{font-size:12px;line-height:1.5;margin:3px 0 0;max-height:100px;overflow:auto;white-space:pre-wrap;pointer-events:auto}.bubble-tail{position:absolute;bottom:-8px;right:21px;width:13px;height:14px;background:#f0eaf8;clip-path:polygon(0 0,100% 0,100% 100%)}.identity{display:flex;align-items:center;justify-content:space-between;padding-top:8px}.identity h1{font-family:Georgia,serif;font-size:28px;font-weight:400;letter-spacing:-.6px;margin:0}.identity p{font-size:10px;letter-spacing:.4px;color:var(--muted);margin:2px 0 0}.chip{font-size:11px;color:var(--accent);border:1px solid #c7b4ef25;padding:6px 11px}.notice{font-size:9px;line-height:1.4;color:#817b91;min-height:25px;margin:10px 0 7px}footer{border-top:1px solid #ffffff0b;padding-top:10px}#command-form{display:flex;align-items:center;gap:8px;background:#ffffff04;border:1px solid #ffffff0b;border-radius:13px;padding:5px 6px 5px 12px}#command{background:transparent;border:0;min-width:0;padding:4px 0;color:var(--ink);flex:1;font-size:12px}#command::placeholder{color:#817a91}#command-form button{background:#bca0f3;color:#292335;border-radius:9px;width:30px;height:29px;font-size:19px}.dock{display:flex;justify-content:space-between;align-items:center;padding-top:8px;color:var(--muted)}#microphone{font-size:14px;display:flex;align-items:center;gap:7px;padding:4px 2px}#microphone span{font-size:10px}#microphone[aria-pressed=true]{color:#c5dfb5}#settings-button{font-size:19px;width:30px;height:28px}#mic-indicator{position:absolute;bottom:5px;left:50%;transform:translateX(-50%);font-size:10px;color:#c5dfb5;background:#171822c9;border-radius:20px;padding:3px 8px;pointer-events:none}#resize{position:absolute;bottom:0;right:2px;font-size:20px;color:#88819a;cursor:nwse-resize;touch-action:none}body.no-background #shell{background:transparent;border-color:transparent;box-shadow:none}body.no-background .halo{display:none}body.controls-hidden .chrome{display:none}body.controls-hidden #shell{padding:10px}body.controls-hidden #bubble{top:8%;right:5%}body.controls-hidden #avatar svg{max-height:none}dialog{background:#20202c;color:var(--ink);border:1px solid #ffffff15;border-radius:19px;padding:22px;width:calc(100% - 28px);max-width:500px;max-height:94%;box-shadow:0 30px 80px #0007;overflow:auto}dialog::backdrop{background:#10111bc4;backdrop-filter:blur(8px)}dialog h2{font:normal 27px Georgia,serif;margin:5px 0 10px}dialog p{font-size:12px;color:var(--muted)}.eyebrow{font-size:8px;font-weight:600;letter-spacing:1.6px;color:var(--accent)}.sheet-head{display:flex;align-items:center;justify-content:space-between}.sheet-head button{font-size:25px;color:var(--muted)}.tabs{display:flex;gap:5px;border-bottom:1px solid #ffffff0d;margin:8px 0 18px;padding-bottom:7px}.tabs button{flex:1;padding:7px 3px;font-size:11px;color:var(--muted)}.tabs .active{color:var(--accent);background:#bca0f310}label{display:flex;flex-direction:column;gap:6px;font-size:10px;color:#b8b1c7;margin:12px 0}input,select{background:#171720;border:1px solid #ffffff14;color:var(--ink);border-radius:8px;padding:9px 10px;width:100%;font-size:12px;min-width:0}input[type=color]{padding:3px;min-height:37px}input[type=checkbox]{width:16px;accent-color:var(--accent)}.toggle{flex-direction:row;align-items:center;gap:9px}.two-col{display:grid;grid-template-columns:1fr 1fr;gap:12px}.two-col label{min-width:0}.hint{font-size:10px!important;line-height:1.6;color:#91899f!important}.primary{background:var(--accent);color:#241d32;font-size:12px;font-weight:600;padding:10px 16px}.primary:hover{background:#d3bcfa}.secondary{border:1px solid #bca0f32b;color:var(--accent);font-size:11px;padding:9px 13px}.sheet-footer{position:sticky;bottom:-22px;background:#20202c;padding:15px 0 0;margin-top:16px;border-top:1px solid #ffffff0d;display:flex;align-items:center;justify-content:space-between;gap:10px}.sheet-footer span{font-size:9px;color:var(--muted)}.error{color:#f0b1b9;font-size:11px;white-space:pre-wrap}.test-row{display:flex;gap:10px;margin-top:15px}.test-row select{flex:1;min-width:0}pre{font-size:11px;white-space:pre-wrap;overflow-wrap:anywhere;background:#171720;border-radius:8px;padding:12px}#connect-dialog .primary{width:100%;margin-top:12px}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}@keyframes breathe{50%{transform:translateY(var(--idle-y,-4px)) rotate(var(--idle-angle,.7deg))}}@keyframes blink{0%,44%,48%,100%{transform:scaleY(1)}46%{transform:scaleY(.08)}}@media(prefers-reduced-motion:reduce){.demo-body,.demo-eye{animation:none}}@media(max-height:480px){#shell{padding:12px 18px}.connection{margin-top:5px}.notice{margin:4px 0;min-height:12px}#bubble{top:0;padding:6px 8px}.identity h1{font-size:23px}footer{padding-top:6px}.halo{display:none}}@media(max-width:320px){#shell{padding-left:14px;padding-right:14px}.brand{letter-spacing:2px}.version{display:none}dialog{padding:16px}.two-col{gap:8px}}
:root body.surface-overlay #shell{background:transparent;border:0;padding:8px}body.surface-overlay .chrome,body.surface-overlay .halo{display:none}body.surface-overlay #avatar svg{max-height:none}body.surface-overlay #bubble{top:3%}
.tabs{flex-wrap:wrap}.tabs button{min-width:54px}
#animation-preview{height:170px;position:relative;background:#171720;border:1px solid #ffffff14;border-radius:12px;overflow:hidden;margin:12px 0}
.animation-preview-stage{position:absolute;inset:0;display:flex;align-items:center;justify-content:center}
.animation-preview-stage canvas,.animation-preview-stage svg{display:block;width:100%;height:100%;object-fit:contain}
.animation-preview-stage iframe{width:100%;height:100%;border:0;display:block}
.animation-card{min-width:0;border:1px solid #ffffff14;border-radius:12px;padding:12px;margin:18px 0}
.animation-card legend{padding:0 5px;color:var(--ink);font-size:12px}.animation-card p{margin:5px 0}
.animation-choices{max-height:190px;overflow:auto;padding:2px}.animation-choices .toggle{margin:8px 0;min-height:30px}.animation-choices input{flex-shrink:0}
.animation-choices span,.animation-warning{overflow-wrap:anywhere}.animation-warning{font-size:10px;color:#f2c58c!important}
#animation-status.error{color:#f0b1b9!important}.animation-card .secondary{margin-top:9px}
@media(max-height:480px){#animation-preview{height:110px}}
@media(max-width:320px){.tabs{flex-wrap:nowrap;gap:2px}.tabs button{min-width:0;font-size:10px;padding:7px 1px}}
/* Speech overlays the stable avatar viewport; dismissal never reframes the model. */
body #bubble,body.controls-hidden #bubble,body.surface-overlay #bubble{top:auto;bottom:34px;max-height:38%;display:flex;flex-direction:column}
#bubble-module{flex:none}#bubble p{min-height:0}
#avatar{top:0;height:100%;bottom:0}

#bubble #bubble-english{font-size:10px;line-height:1.4;color:#6b6379;border-top:1px solid #8b7b9d33;padding-top:4px;margin-top:4px;max-height:56px;flex-shrink:0}
.bubble-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;flex:none}#replay{pointer-events:auto;width:22px;height:22px;line-height:18px;padding:0;color:#77608b;font-size:18px;border-radius:6px}#replay:disabled{opacity:.3;cursor:default}#replay:hover:not(:disabled){background:#8b7b9d22}
#bubble.bilingual{min-height:0}@media(max-height:480px){#bubble #bubble-english{max-height:42px}}
#avatar{touch-action:none;user-select:none;cursor:grab;overflow:hidden}#avatar:active{cursor:grabbing}#avatar svg{transform-origin:center center}#reset-view{position:absolute;bottom:4px;right:0;z-index:3;font-size:20px;color:var(--muted);width:28px;height:28px}

#close-bubble{pointer-events:auto;width:24px;height:24px;font-size:19px;color:#756580}#show-bubble{position:absolute;right:40px;bottom:4px;z-index:3;color:var(--muted);font-size:20px}

#voice-actions{position:absolute;bottom:3px;left:0;display:flex;gap:4px;z-index:3;background:#191923b8;border-radius:10px}#voice-actions button{width:32px;height:32px;font-size:18px;color:var(--accent)}
body.surface-overlay #voice-actions{display:flex}

#wake-status{position:absolute;top:8px;left:50%;transform:translateX(-50%);max-width:94%;padding:7px 12px;border:1px solid #bca0f355;border-radius:12px;background:#191923ee;color:#e7dbff;font-size:11px;text-align:center;pointer-events:none;z-index:5}

#voice-mute{width:auto;flex-shrink:0;font-size:10px;white-space:nowrap;padding:4px 7px}#voice-mute[aria-pressed="true"]{color:var(--accent);background:#ffffff12}.mute-options{display:grid;grid-template-columns:1fr 1fr;gap:8px}

.connection #connection-status{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.connection .spacer{display:none}.connection .dot,.connection button{flex-shrink:0}

.connection{position:relative;z-index:4}.halo{pointer-events:none}

.interaction-dialog{width:min(90vw,620px);max-height:85vh;overflow:auto}.interaction-dialog pre{white-space:pre-wrap;overflow-wrap:anywhere;font-size:.85rem}.interaction-dialog a{color:var(--accent,#86c8de)}

.memory-settings textarea,.interaction-dialog textarea{font:inherit;width:100%;color:var(--ink);background:#16161e;border:1px solid #ffffff18;border-radius:10px;padding:10px;resize:vertical}.memory-settings textarea:focus-visible,.interaction-dialog textarea:focus-visible{outline:2px solid var(--accent)}.memory-settings .secondary,.interaction-dialog .secondary{margin:4px 4px 4px 0}

.schedule-days{display:flex;flex-wrap:wrap;gap:.65rem}.schedule-days label{display:flex;align-items:center;gap:.3rem}.schedule-days input{width:auto}#schedule-preview:empty{display:none}#schedule-preview iframe{width:100%;height:240px;border:0}#schedule-dialog .mute-options{flex-wrap:wrap}#schedule-dialog fieldset{min-width:0}

#settings-form .sheet-footer{display:grid;grid-template-columns:1fr 1fr;gap:8px}#settings-form .sheet-footer>span,#settings-error{grid-column:1/-1}#settings-error{margin:0;max-height:7em;overflow:auto}#settings-error:empty{display:none}#settings-form .sheet-footer>span{font-size:10px}

.identity{gap:8px;flex-wrap:wrap}.identity>div{flex:1;min-width:110px}.identity .chip{white-space:nowrap}.character-choices{display:grid;grid-template-columns:1fr 1fr;gap:8px}.character-choices button{text-align:left;min-height:48px}.character-choices strong,.character-choices small{display:block}.character-choices small{font-size:10px;opacity:.7;overflow-wrap:anywhere}.character-choices [aria-pressed=true]{background:#ffffff14;border-color:var(--accent)}

.debug-status{font-size:10px;line-height:1.4;overflow-wrap:anywhere;max-height:4.2em;overflow:auto}.debug-status,#reply-timings{color:var(--muted,#a9a5ba)}#standalone-tools button{font-size:10px;padding:4px 8px}#reply-timings{display:block;font-size:10px}#reply-timings[hidden],#standalone-tools[hidden]{display:none}

#bubble:has(#reply-timings:not([hidden])){max-height:48%}#bubble-text{min-height:1.5em!important}#reply-timings{flex:none}

/* Keep both caption blocks inside the overlay, including 280x360 windows. */

#chat-attachments:empty{display:none}

.command-activity{position:fixed;bottom:7.5rem;left:1rem;right:1rem;z-index:20;max-height:35vh;overflow:auto;padding:.5rem .7rem;border-radius:.7rem;background:var(--surface,#20212d);border:1px solid #ffffff24;font-size:.8rem}.command-activity[hidden]{display:none}.command-activity>div{display:flex;justify-content:space-between;align-items:center;gap:.5rem}.command-activity details{margin-top:.3rem}.command-activity nav{display:grid;gap:.4rem}.command-activity a{color:var(--accent,#8ecde5);overflow-wrap:anywhere}.command-activity ol{padding-left:1.3rem}

/* Keep long speech at the feet without changing the camera or stage bounds. */
#bubble .bubble-tail{top:-8px;bottom:auto;transform:rotate(180deg)}

/* Minimal is a separate device preference; full-hide/tap-to-restore still works. */
body.minimal-ui header,body.minimal-ui .connection,body.minimal-ui .identity,body.minimal-ui #notice,body.minimal-ui #debug-status,body.minimal-ui #standalone-tools,body.minimal-ui #resize,body.minimal-ui #reply-timings,body.minimal-ui #schedule-button{display:none!important}
body.minimal-ui #shell{padding:10px 14px}
body.minimal-ui #microphone span{display:none}
body.minimal-ui footer{padding-top:6px}
body.minimal-ui .dock{justify-content:flex-end;gap:8px}
body.minimal-ui #microphone{margin-right:auto}
#view-mode,#server-connection{font-size:20px;min-width:30px;min-height:30px}

#minimal-character{display:none;position:absolute;right:4px;top:4px;z-index:3;font-size:20px}body.minimal-ui #minimal-character{display:block}body.controls-hidden #minimal-character{display:none}

#proposal-action{white-space:pre-wrap;max-height:45vh;overflow:auto;overflow-wrap:anywhere}

/* Explicit foreground talk panel; capture still requires its microphone control. */
body.surface-talk #stage,body.surface-talk .identity,body.surface-talk .brand,body.surface-talk #standalone-tools{display:none!important}
body.surface-talk #shell{min-height:0;height:auto;padding:12px}
body.surface-talk #bubble{position:relative;inset:auto;transform:none;max-width:100%;max-height:180px;overflow:auto;margin:8px 0}
body.surface-talk #command-form{margin-top:8px}
