/* The video-call view (call.js): Winston's painted portrait in a frame beside the talk panel, his name and title over it, a small
   live dot, and the Call / Minis switch. The dashboard's glass and type; the portrait in a warm, slightly vignetted frame. */
#as-call {
  position: fixed; left: calc(12px + min(440px, calc(100vw - 24px)) + 12px); bottom: 12px; z-index: 6; width: min(340px, calc(100vw - 24px));
  padding: 12px; display: flex; flex-direction: column; gap: 10px; opacity: 0; transform: translateY(8px) scale(0.985); pointer-events: none;
  transition: opacity var(--t) var(--ease), transform var(--t) var(--ease);
}
#as-call.open { opacity: 1; transform: none; pointer-events: auto; }
#as-call .call-head { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; }
#as-call .live { width: 0.6em; height: 0.6em; border-radius: 50%; background: var(--red); box-shadow: 0 0 8px rgba(255, 90, 78, 0.7); }
#as-call .name { font-weight: 600; font-size: 1.05em; }
#as-call .title { color: var(--dim); font-size: 0.8em; }
#as-call .views { display: inline-flex; border: 1px solid var(--line-2); border-radius: 9px; overflow: hidden; }
#as-call .views button { border: 0; background: transparent; color: var(--dim); padding: 0.3em 0.8em; cursor: pointer; font-size: 0.8em; }
#as-call .views button.on { background: rgba(255, 176, 0, 0.16); color: var(--amber-2); }
#as-call .frame { position: relative; border-radius: 12px; overflow: hidden; aspect-ratio: 1 / 1; background: #14110f;
  box-shadow: inset 0 0 0 1px rgba(255, 228, 180, 0.18), 0 10px 30px rgba(0, 0, 0, 0.45); }
#as-call .frame::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 50% 42%, transparent 58%, rgba(0, 0, 0, 0.45)); }
#as-call canvas { width: 100%; height: 100%; display: block; }
#as-call .call-status { display: none; align-items: center; gap: 10px; font-size: 0.84em; color: var(--dim); min-height: 1.6em; }
#as-call.has-status .call-status { display: flex; }
#as-call .call-status .msg { flex: 1; }
#as-call.failed .call-status .msg { color: #ffb4aa; }
#as-call .call-status .retry { padding: 0.25em 0.8em; font-size: 0.95em; }
#as-call .call-bar { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; }
#as-call .call-lbl { font-size: 0.9em; min-width: 8.5em; color: var(--dim); }
#as-call .meter { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
#as-call .meter i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #7ed99a, #ffd27a); transition: width 60ms linear; }
#as-call .call-go { font-size: 1.05em; font-weight: 600; padding: 0.55em 1.1em; border-radius: 12px; background: rgba(90, 200, 120, 0.2); border-color: rgba(120, 220, 150, 0.55); }
#as-call .call-go.hang { background: rgba(255, 90, 78, 0.26); border-color: rgba(255, 120, 110, 0.6); color: #ffe2de; }
/* in a call: a ring on the portrait, swelling with the mic level; it pulses while listening, holds amber while he speaks */
#as-call .frame::before { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; pointer-events: none; opacity: 0;
  box-shadow: inset 0 0 0 calc(2px + var(--lvl, 0) * 6px) rgba(126, 217, 154, 0.85); transition: opacity 200ms; }
#as-call:is([data-call="listening"], [data-call="hearing"]) .frame::before { opacity: 1; }
#as-call[data-call="listening"] .frame::before { animation: as-call-ring 1.6s ease-in-out infinite; }
#as-call[data-call="hearing"] .call-lbl { color: #9be8b2; }
#as-call[data-call="speaking"] .frame::before { opacity: 1; box-shadow: inset 0 0 0 3px rgba(255, 196, 92, 0.8); }
#as-call[data-call="thinking"] .frame::before { opacity: 1; box-shadow: inset 0 0 0 2px rgba(255, 228, 180, 0.5); animation: as-call-ring 0.9s ease-in-out infinite; }
#as-call[data-call="muted"] .frame::before { opacity: 1; box-shadow: inset 0 0 0 3px rgba(255, 90, 78, 0.8); }
#as-call[data-call="muted"] .call-lbl { color: #ffb4aa; }
@keyframes as-call-ring { 50% { opacity: 0.45; } }
#as-talk .call-chip { padding: 0.25em 0.7em; font-size: 0.82em; }
@media (prefers-reduced-motion: reduce) { #as-call { transition: none; } #as-call .frame::before { animation: none !important; } }
/* a portrait screen: the call sits at the top, over the lot (below the 3D page's mode switch: modeswitch.js sets --ms-bottom), the talk panel below it */
@media (max-aspect-ratio: 999/1000) {
  #as-call { left: 50%; right: auto; top: max(calc(10px + 3.2em), calc(var(--ms-bottom, 0px) + 8px)); bottom: auto; transform: translate(-50%, -8px); width: min(420px, calc(100vw - 20px)); }
  #as-call.open { transform: translateX(-50%); }
  #as-call .frame { aspect-ratio: auto; height: min(26vh, 320px); }
  /* the talk sheet stops under the call window, so the call's bar (Hang up) is never under it (call.js sets --call-bottom) */
  body.as-call-open #as-talk { max-height: min(62vh, calc(100vh - var(--sheet-b) - var(--call-bottom, 0px) - 8px)); }
  #as-call canvas { object-fit: cover; }
}
