/* Hamrah 4.6.0 Beta — Voice Platform and Calls */
:root{--g9-call-green:#22c987;--g9-call-red:#ef4761;--g9-call-surface:rgba(10,25,42,.92);--g9-call-muted:#a7bacb}
#v4VideoCall{display:none!important}.v4-call-overlay{display:none!important}.v4-call-button.g9-call-button{font-size:0!important;position:relative}.v4-call-button.g9-call-button::before{content:"";width:19px;height:19px;display:block;background:currentColor;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M22 16.92v3a2 2 0 0 1-2.18 2A19.79 19.79 0 0 1 3.09 5.18 2 2 0 0 1 5.07 3h3a2 2 0 0 1 2 1.72c.12.9.33 1.78.62 2.63a2 2 0 0 1-.45 2.11L9 10.7a16 16 0 0 0 4.3 4.3l1.24-1.24a2 2 0 0 1 2.11-.45c.85.29 1.73.5 2.63.62A2 2 0 0 1 22 16.92z'/%3E%3C/svg%3E") center/contain no-repeat}
.g9-call-layer{position:fixed;inset:0;z-index:1800;display:grid;place-items:center;padding:max(18px,env(safe-area-inset-top)) 18px max(18px,env(safe-area-inset-bottom));background:radial-gradient(circle at 50% 16%,color-mix(in srgb,var(--primary) 38%,transparent),transparent 42%),linear-gradient(160deg,#07111f,#0c1c30 55%,#07131f);color:#fff;direction:rtl;overflow:auto}.g9-call-layer.hidden{display:none}.g9-call-card{width:min(100%,440px);min-height:min(720px,calc(100vh - 36px));display:flex;flex-direction:column;align-items:center;justify-content:space-between;padding:28px 22px 24px;border:1px solid rgba(255,255,255,.09);border-radius:34px;background:linear-gradient(180deg,rgba(22,43,69,.9),rgba(7,17,31,.94));box-shadow:0 32px 90px rgba(0,0,0,.48);position:relative;overflow:hidden}.g9-call-card::before{content:"";position:absolute;inset:-30% -20% auto;height:55%;background:radial-gradient(circle,color-mix(in srgb,var(--g9-profile-color,var(--primary)) 50%,transparent),transparent 70%);filter:blur(12px);pointer-events:none}.g9-call-top,.g9-call-main,.g9-call-controls{position:relative;z-index:1;width:100%}.g9-call-top{display:flex;align-items:center;justify-content:space-between}.g9-call-pill{display:inline-flex;align-items:center;gap:7px;padding:8px 12px;border-radius:999px;background:rgba(255,255,255,.08);font-size:12px;color:#c7d7e5}.g9-call-pill i{width:8px;height:8px;border-radius:50%;background:var(--g9-call-green);box-shadow:0 0 14px var(--g9-call-green)}.g9-call-minimize{width:42px;height:42px;border:0;border-radius:15px;background:rgba(255,255,255,.08);color:#fff;font-size:21px}.g9-call-main{text-align:center;display:grid;justify-items:center;gap:12px;margin-block:28px}.g9-call-avatar-wrap{position:relative;width:150px;height:150px;display:grid;place-items:center}.g9-call-rings,.g9-call-rings::before,.g9-call-rings::after{position:absolute;inset:0;border:1px solid color-mix(in srgb,var(--g9-profile-color,var(--primary)) 68%,white);border-radius:50%;content:"";animation:g9Ring 2.4s ease-out infinite;opacity:.1}.g9-call-rings::before{animation-delay:.8s}.g9-call-rings::after{animation-delay:1.6s}.g9-call-avatar{width:112px;height:112px;border-radius:38px;display:grid;place-items:center;overflow:hidden;background:linear-gradient(135deg,var(--g9-profile-color,var(--primary)),color-mix(in srgb,var(--g9-profile-color,var(--primary)) 60%,#25d7a2));font-size:42px;font-weight:900;box-shadow:0 22px 56px color-mix(in srgb,var(--g9-profile-color,var(--primary)) 30%,transparent)}.g9-call-avatar img{width:100%;height:100%;object-fit:cover}.g9-call-name{margin:5px 0 0;font-size:28px}.g9-call-status{margin:0;color:#bfd0df;min-height:25px}.g9-call-timer{font-variant-numeric:tabular-nums;font-size:18px;font-weight:800;letter-spacing:.5px}.g9-call-quality{display:flex;align-items:center;gap:8px;color:#adc0d0;font-size:13px}.g9-quality-bars{height:18px;display:flex;align-items:flex-end;gap:3px}.g9-quality-bars i{width:4px;border-radius:4px;background:#4dd9a7}.g9-quality-bars i:nth-child(1){height:6px}.g9-quality-bars i:nth-child(2){height:11px}.g9-quality-bars i:nth-child(3){height:16px}.g9-call-quality[data-quality="fair"] i:nth-child(3),.g9-call-quality[data-quality="poor"] i:nth-child(n+2){opacity:.18}.g9-call-quality[data-quality="poor"] .g9-quality-bars i{background:#ff9e4b}.g9-voice-activity{height:30px;display:flex;align-items:center;justify-content:center;gap:4px}.g9-voice-activity i{width:4px;height:7px;border-radius:5px;background:var(--g9-call-green);animation:g9Voice 1s ease-in-out infinite;animation-play-state:paused}.g9-voice-activity.active i{animation-play-state:running}.g9-voice-activity i:nth-child(2){animation-delay:.12s}.g9-voice-activity i:nth-child(3){animation-delay:.24s}.g9-voice-activity i:nth-child(4){animation-delay:.36s}.g9-call-controls{display:grid;grid-template-columns:repeat(3,1fr);gap:14px}.g9-call-control{border:0;background:rgba(255,255,255,.09);color:#fff;border-radius:22px;min-height:82px;padding:11px 6px;display:grid;place-items:center;gap:6px;font:inherit}.g9-call-control span:first-child{width:43px;height:43px;border-radius:16px;background:rgba(255,255,255,.08);display:grid;place-items:center;font-size:22px}.g9-call-control small{font-size:11px;color:#c3d1dc}.g9-call-control.active{background:rgba(34,201,135,.18);box-shadow:inset 0 0 0 1px rgba(34,201,135,.35)}.g9-call-control.danger{background:linear-gradient(135deg,#ef4761,#d9324d);grid-column:2;color:#fff}.g9-incoming-actions{display:grid;grid-template-columns:1fr 1fr;gap:16px;width:100%;position:relative;z-index:1}.g9-incoming-actions button{border:0;border-radius:24px;padding:18px 10px;color:#fff;font-weight:900;font-size:15px}.g9-call-accept{background:linear-gradient(135deg,#22c987,#0ca56a)}.g9-call-decline{background:linear-gradient(135deg,#ef4761,#cf2e48)}.g9-quick-replies{position:relative;z-index:1;width:100%;display:flex;gap:8px;overflow:auto;padding-top:14px;scrollbar-width:none}.g9-quick-replies button{white-space:nowrap;border:1px solid rgba(255,255,255,.1);background:rgba(255,255,255,.06);color:#dce8f1;border-radius:999px;padding:9px 13px}.g9-route-sheet .g9-route-list{display:grid;gap:9px}.g9-route-list button{display:flex;justify-content:space-between;align-items:center;border:1px solid var(--border);background:var(--surface-alt);color:var(--text);padding:15px;border-radius:18px}.g9-route-list button.active{border-color:var(--primary);box-shadow:0 0 0 2px color-mix(in srgb,var(--primary) 16%,transparent)}.g9-call-bar{position:fixed;z-index:1250;inset-inline:12px;top:calc(env(safe-area-inset-top) + 9px);min-height:52px;border-radius:17px;background:linear-gradient(135deg,#0f835f,#12a878);color:#fff;display:flex;align-items:center;gap:11px;padding:8px 12px;box-shadow:0 12px 35px rgba(0,0,0,.28);direction:rtl}.g9-call-bar.hidden{display:none}.g9-call-bar .dot{width:10px;height:10px;background:#8affd6;border-radius:50%;box-shadow:0 0 15px #8affd6;animation:g9Pulse 1.2s infinite}.g9-call-bar b{flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.g9-call-bar button{border:0;border-radius:12px;background:rgba(255,255,255,.15);color:#fff;padding:8px 10px}.g9-call-history-layer .g9-history-list{display:grid;gap:10px;max-height:60vh;overflow:auto}.g9-history-item{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:12px;padding:13px;border-radius:18px;background:var(--surface-alt);border:1px solid var(--border)}.g9-history-icon{width:42px;height:42px;border-radius:15px;display:grid;place-items:center;background:color-mix(in srgb,var(--primary) 14%,var(--surface));color:var(--primary)}.g9-history-item small{color:var(--muted)}.g9-settings-card{margin-block:12px}.g9-call-setting-grid{display:grid;gap:10px}.g9-mic-meter{height:12px;border-radius:999px;background:var(--surface-alt);overflow:hidden}.g9-mic-meter i{display:block;width:0;height:100%;background:linear-gradient(90deg,var(--primary),var(--secondary));transition:width .08s linear}.g9-system-call-bubble{display:flex!important;align-items:center;gap:10px!important;min-width:220px!important}.g9-system-call-bubble::before{content:"☎";width:36px;height:36px;border-radius:13px;display:grid;place-items:center;background:color-mix(in srgb,var(--primary) 18%,transparent);color:var(--primary);font-size:19px}.g9-record-preview{position:fixed;z-index:1500;inset-inline:12px;bottom:calc(82px + env(safe-area-inset-bottom));background:var(--surface);border:1px solid var(--border);border-radius:22px;padding:12px;box-shadow:0 18px 55px rgba(0,0,0,.35);display:grid;grid-template-columns:auto 1fr auto auto;align-items:center;gap:10px}.g9-record-preview.hidden{display:none}.g9-record-preview audio{width:100%;min-width:0}.g9-record-preview button{border:0;border-radius:14px;padding:10px 12px}.g9-record-preview .send{background:var(--primary);color:#fff}.g9-record-preview .delete{background:color-mix(in srgb,var(--danger) 16%,var(--surface));color:var(--danger)}
@keyframes g9Ring{0%{transform:scale(.72);opacity:.38}100%{transform:scale(1.32);opacity:0}}@keyframes g9Voice{0%,100%{height:7px}50%{height:25px}}@keyframes g9Pulse{50%{opacity:.35;transform:scale(.75)}}
@media(max-width:560px){.g9-call-layer{padding:0}.g9-call-card{width:100%;min-height:100vh;border:0;border-radius:0;padding-top:max(24px,env(safe-area-inset-top));padding-bottom:max(22px,env(safe-area-inset-bottom))}.g9-call-avatar-wrap{width:135px;height:135px}.g9-call-avatar{width:100px;height:100px}.g9-call-name{font-size:25px}.g9-call-control{min-height:76px;border-radius:20px}.g9-record-preview{grid-template-columns:auto 1fr auto;}.g9-record-preview audio{grid-column:1/-1}}
body.amoled .g9-call-layer{background:#000}.reduced-motion .g9-call-rings,.reduced-motion .g9-call-rings::before,.reduced-motion .g9-call-rings::after,.reduced-motion .g9-voice-activity i{animation:none!important}

/* Group 11.5B Dev1 R1 — Call Core Recovery */
.g9-call-status{max-width:34ch;line-height:1.75}
.g9-call-notice{margin:0;max-width:36ch;padding:9px 13px;border-radius:14px;background:rgba(255,255,255,.08);color:#dce8f1;font-size:12px;line-height:1.7}
.g9-call-notice[data-tone="warning"]{background:rgba(255,174,66,.14);color:#ffd7a0}
.g9-call-notice[data-tone="error"]{background:rgba(239,71,97,.16);color:#ffd4dc}
.g9-resume-audio{border:1px solid rgba(255,255,255,.18);border-radius:999px;background:rgba(255,255,255,.1);color:#fff;padding:10px 14px;font:inherit;font-size:12px}
.g9-call-controls{grid-template-columns:repeat(3,minmax(0,1fr))}
.g9-call-control.danger{grid-column:1/-1;min-height:64px}
.g9-call-control:disabled,.g9-incoming-actions button:disabled,.g9-quick-replies button:disabled{opacity:.55;cursor:wait;pointer-events:none}
.g9-call-control:focus-visible,.g9-incoming-actions button:focus-visible,.g9-call-minimize:focus-visible,.g9-call-bar button:focus-visible,.g9-resume-audio:focus-visible{outline:3px solid rgba(255,255,255,.9);outline-offset:3px}
.g9-call-layer[data-phase="connected"] .g9-call-rings,.g9-call-layer[data-phase="connected"] .g9-call-rings::before,.g9-call-layer[data-phase="connected"] .g9-call-rings::after,.g9-call-layer[data-phase="ended"] .g9-call-rings,.g9-call-layer[data-phase="ended"] .g9-call-rings::before,.g9-call-layer[data-phase="ended"] .g9-call-rings::after{animation:none;opacity:.04}
.g9-call-layer[data-phase="reconnecting"] .g9-call-pill i{background:#ffb454;box-shadow:0 0 14px #ffb454}
.g9-call-layer[data-phase="ended"] .g9-call-pill i{background:#8898a8;box-shadow:none}
@media(max-width:560px){.g9-call-card{min-height:100dvh}.g9-call-main{margin-block:18px}.g9-call-controls{gap:10px}.g9-call-control{min-height:70px}.g9-call-control.danger{min-height:58px}.g9-call-notice{font-size:11px}}
@media(prefers-reduced-motion:reduce){.g9-call-rings,.g9-call-rings::before,.g9-call-rings::after,.g9-voice-activity i,.g9-call-bar .dot{animation:none!important}.g9-call-layer *{scroll-behavior:auto!important}}

/* Group 11.9A Dev1 R2 — direct-call promotion control */
.g9-call-controls{grid-template-columns:repeat(4,minmax(0,1fr))}
.g9-call-control.add-person{border:1px solid rgba(91,198,255,.24);background:rgba(45,152,218,.12)}
.g9-call-control.add-person span:first-child{background:rgba(45,152,218,.17);color:#d8f3ff}
@media(max-width:420px){.g9-call-controls{grid-template-columns:repeat(2,minmax(0,1fr))}.g9-call-control.danger{grid-column:1/-1}}


/* E4 UI Consistency — optical-center the direct-call glyph in every chat header */
.v4-call-button.g9-call-button{
  display:grid!important;
  place-items:center!important;
  line-height:0!important;
}
.v4-call-button.g9-call-button::before{
  position:absolute!important;
  inset-block-start:50%!important;
  inset-inline-start:50%!important;
  margin:0!important;
  transform:translate(-50%,-50%)!important;
  transform-origin:center!important;
}
