/* hySocial Hypatia persistent voice escort — responsive to safe areas */
#hy-social-escort{position:relative;z-index:10040}
#hy-escort-bubble{--hy-escort-amplitude:0;position:fixed;z-index:10040;right:calc(15px + env(safe-area-inset-right));bottom:calc(16px + env(safe-area-inset-bottom));width:60px;height:60px;border:2px solid #35eaff;border-radius:50%;padding:0;cursor:pointer;touch-action:none;user-select:none;background:#071226;box-shadow:0 5px 26px #000b,0 0 calc(9px + var(--hy-escort-amplitude)*36px) rgba(53,234,255,.7);transition:box-shadow .14s ease}
#hy-escort-bubble img{width:100%;height:100%;object-fit:cover;border-radius:50%;display:block;pointer-events:none;position:relative;z-index:1}
#hy-escort-bubble .hy-escort-halo{position:absolute;inset:-5px;border:2px solid rgba(53,234,255,.4);border-radius:50%;transform:scale(calc(1 + var(--hy-escort-amplitude)*.23));box-shadow:0 0 calc(5px + var(--hy-escort-amplitude)*32px) #35eaff;transition:transform .11s linear;pointer-events:none}
#hy-escort-bubble.hy-escort-connected{border-color:#a657ff}
#hy-escort-bubble[data-voice="speaking"] .hy-escort-halo{border-color:#4deeff}
#hy-escort-panel[hidden],#hy-escort-voice[hidden],#hy-escort-confirm[hidden]{display:none!important}
#hy-escort-panel{position:fixed;z-index:10039;bottom:calc(87px + env(safe-area-inset-bottom));right:calc(16px + env(safe-area-inset-right));width:min(400px,calc(100vw - 28px));height:min(550px,calc(100dvh - 135px));min-height:260px;display:flex;flex-direction:column;overflow:hidden;background:color-mix(in srgb,var(--hs-surface,#101a32) 96%,#070515);border:1px solid var(--hs-border,#32647b);border-radius:20px;box-shadow:0 25px 80px #000b;color:var(--hs-text,#ecf5ff);font-family:var(--hs-font,system-ui);backdrop-filter:blur(22px)}
#hy-escort-panel header{display:flex;gap:10px;align-items:center;padding:10px 12px;border-bottom:1px solid var(--hs-border,#3d4555);min-height:62px}
#hy-escort-panel header img{width:36px;height:36px;object-fit:cover;border-radius:50%}
#hy-escort-panel header div{min-width:0;flex:1;display:flex;flex-direction:column}
#hy-escort-panel header strong{font-size:14px}
#hy-escort-context{font-size:10px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;opacity:.7}
#hy-escort-voice-status{font-size:10px;color:#35eaff}
#hy-escort-panel button{font:inherit;cursor:pointer;min-height:40px}
#hy-escort-minimize{border:1px solid var(--hs-border,#3d4555);border-radius:10px;width:40px;background:var(--hs-card,#101725);color:inherit;font-size:20px!important}
#hy-escort-voice{border-bottom:1px solid var(--hs-border,#3d4555);padding:8px;max-height:210px;overflow:hidden}
#hy-escort-voice-mount{min-height:102px;display:flex;justify-content:center;align-items:center}
#hy-escort-voice-mount .hv-still{max-height:100px!important}
#hy-escort-voice-mount .hv-still-face{max-width:100%}
.hy-escort-controls{display:flex;gap:7px;justify-content:center}
.hy-escort-controls button{min-height:36px!important;padding:6px 14px;background:var(--hs-card,#101725);color:inherit;border:1px solid var(--hs-border,#3d4555);border-radius:10px}
#hy-escort-log{flex:1;overflow:auto;overscroll-behavior:contain;padding:12px;display:flex;flex-direction:column;gap:7px;scrollbar-width:thin}
.hy-escort-message{padding:9px 11px;border-radius:12px;font-size:12px;line-height:1.45;white-space:pre-wrap;overflow-wrap:anywhere;max-width:94%;margin:0}
.hy-escort-message.bot{align-self:flex-start;background:var(--hs-card,#18243a);border:1px solid var(--hs-border,#32647b)}
.hy-escort-message.user{align-self:flex-end;background:var(--hs-accent-dim,#124658)}
.hy-escort-quick{display:flex;gap:5px;overflow-x:auto;padding:8px 10px}
.hy-escort-quick button{white-space:nowrap;background:var(--hs-card,#152138);color:inherit;border:1px solid var(--hs-border,#3d4555);padding:7px 10px;border-radius:10px;font-size:11px}
#hy-escort-form{display:flex;gap:6px;padding:9px;border-top:1px solid var(--hs-border,#32647b)}
#hy-escort-input{flex:1;min-width:0;min-height:42px;border:1px solid var(--hs-border,#32647b);background:var(--hs-bg,#060a15);color:var(--hs-text,#fff);border-radius:10px;font-size:12px;padding:10px;outline:none}
#hy-escort-form button{min-width:41px;border:1px solid var(--hs-border,#32647b);border-radius:10px;background:var(--hs-card,#152138);color:var(--hs-text,#fff)}
#hy-escort-confirm{display:flex;gap:6px;align-items:center;padding:9px;border-top:1px solid var(--hs-border,#32647b);font-size:11px}
#hy-escort-confirm span{flex:1}
#hy-escort-confirm button{padding:5px 10px;border-radius:9px;border:1px solid var(--hs-border,#32647b);background:var(--hs-card,#152138);color:inherit}
@media(max-width:768px){
 #hy-escort-bubble{width:54px;height:54px;bottom:calc(78px + env(safe-area-inset-bottom));right:calc(8px + env(safe-area-inset-right))}
 #hy-escort-panel{right:8px;bottom:calc(142px + env(safe-area-inset-bottom));width:calc(100vw - 16px);height:min(510px,calc(100dvh - 170px));border-radius:16px}
}
@media(max-width:390px){
 #hy-escort-panel{height:calc(100dvh - 160px)}
 #hy-escort-panel header{padding:7px 8px}
}
@media(prefers-reduced-motion:reduce){#hy-escort-bubble,#hy-escort-bubble .hy-escort-halo{transition:none}}

/* Full hyChat is the canonical rich renderer, not a fork of its state. */
#hy-escort-rich-wrap[hidden]{display:none!important}
#hy-escort-panel.hy-escort-rich-mode{
 width:min(660px,calc(100vw - 28px));height:min(760px,calc(100dvh - 115px));
}
#hy-escort-rich-wrap{flex:1;display:flex;flex-direction:column;min-height:0;overflow:hidden}
.hy-escort-rich-tools{display:flex;gap:5px;flex-wrap:wrap;align-items:center;padding:6px 8px;border-bottom:1px solid var(--hs-border,#3d4555)}
.hy-escort-rich-tools button{
 cursor:pointer;min-height:36px!important;padding:7px 9px;color:var(--hs-text,#fff);
 background:var(--hs-card,#152138);border:1px solid var(--hs-border,#32647b);border-radius:10px;font-size:11px!important;
}
.hy-escort-rich-tools span{flex:1;min-width:140px;font-size:10px;opacity:.65}
.hy-escort-rich-frame{flex:1;min-height:0;overflow:hidden}
.hy-escort-rich-frame iframe{display:block;width:100%;height:100%;border:0;background:#070c17}
#hy-escort-rich-toggle,#hy-escort-global-settings{
 flex:none;min-width:42px;min-height:38px;border:1px solid var(--hs-border,#32647b);
 border-radius:10px;background:var(--hs-card,#152138);color:var(--hs-text,#fff);
 padding:5px 8px;display:grid;place-items:center;text-decoration:none;font-size:11px;font-weight:600;
}
#hy-escort-global-settings{font-size:18px}
#hy-escort-panel [hidden]{display:none!important}
#hy-escort-panel.hy-escort-rich-mode .hy-escort-quick{display:none!important}
@media(max-width:768px){
 #hy-escort-panel.hy-escort-rich-mode{
   width:calc(100vw - 16px);height:calc(100dvh - 155px);right:8px;bottom:calc(138px + env(safe-area-inset-bottom));
 }
 #hy-escort-rich-toggle{min-width:40px;padding:5px 6px;font-size:10px}
 .hy-escort-rich-tools span{display:none}
}
@media(max-width:390px){
 #hy-escort-panel header{gap:5px}
 #hy-escort-panel header img{width:29px;height:29px}
 #hy-escort-panel header strong{font-size:12px}
 #hy-escort-global-settings{min-width:38px}
}

/* Native studio panels remain same-origin and preserve their own reference tools. */
.hy-escort-rich-frame iframe[hidden]{display:none!important}
#hy-escort-back-to-chat{font-weight:800;border-color:rgba(53,234,255,.5)}
#hy-escort-studio-frame{background:#070c17}
@media(max-width:768px){#hy-escort-panel.hy-escort-rich-mode .hy-escort-rich-tools{padding:5px;gap:4px}#hy-escort-panel.hy-escort-rich-mode .hy-escort-rich-tools button{font-size:10px!important;padding:5px 6px}}
