/* Yapper audio calls: incoming, ringing (outgoing) and call history UI.
   Uses Yapper's existing theme variables, so light and dark mode both work. */

.ycall-overlay {
  position: fixed; inset: 0; z-index: 10050;
  display: flex; align-items: center; justify-content: center;
  background: var(--glass-overlay, rgba(40,40,40,.3));
  opacity: 0; transition: opacity .28s var(--glass-ease, ease);
}
.ycall-overlay.is-open { opacity: 1; }

.ycall-card {
  width: min(360px, calc(100vw - 32px));
  padding: 36px 24px 28px; text-align: center; color: var(--text, #111);
  background: var(--card, #fff);
  border: 1px solid var(--glass-border-soft, var(--border, #ccc));
  border-radius: var(--ui-radius-surface, 42px);
  box-shadow: 0 24px 60px var(--glass-shadow-deep, rgba(0,0,0,.25));
  transform: translateY(16px) scale(.97);
  transition: transform .36s var(--glass-ease, ease);
}
.ycall-overlay.is-open .ycall-card { transform: none; }

.ycall-label { font-size: 13px; font-weight: 600; letter-spacing: .02em; color: var(--secondary-text, #666); margin-bottom: 22px; }

.ycall-avatar-wrap { position: relative; width: 112px; height: 112px; margin: 0 auto 18px; }
.ycall-avatar {
  position: relative; z-index: 1; width: 100%; height: 100%; border-radius: 50%;
  overflow: hidden; display: flex; align-items: center; justify-content: center;
  font-size: 40px; font-weight: 700;
}
/* Fill colors come from Yapper's own .profile-avatar.is-fallback-avatar rule. */
.ycall-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }
.ycall-avatar-wrap::before {
  content: ""; position: absolute; inset: -10px; border-radius: 50%; will-change: transform, opacity;
  background: color-mix(in srgb, var(--primary, #5C77FF) 18%, transparent);
  animation: ycall-breathe 2.4s ease-in-out infinite;
}
@keyframes ycall-breathe { 0%, 100% { transform: scale(.94); opacity: .6; } 50% { transform: scale(1.06); opacity: 1; } }

.ycall-name { font-size: 22px; font-weight: 700; margin: 0 0 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ycall-status { font-size: 14px; color: var(--secondary-text, #666); min-height: 20px; }
.ycall-dots::after { content: ""; animation: ycall-dots 1.4s steps(4) infinite; }
@keyframes ycall-dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }

.ycall-actions { margin-top: 28px; }
.ycall-actions:not(.modal-buttons) { display: flex; }
.ycall-actions:not(.modal-buttons) > button { flex: 1; }
/* Buttons use Yapper's own button and primary-button styles; this only lays out the icon. */
.ycall-pill { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.ycall-pill svg { width: 18px !important; height: 18px !important; flex: none; }

/* Small banner used when the app is in the middle of something (e.g. typing in a DM). */
.ycall-banner {
  position: fixed; top: max(12px, env(safe-area-inset-top)); left: 50%; z-index: 10050;
  transform: translate(-50%, -140%); transition: transform .36s var(--glass-ease, ease);
  display: flex; align-items: center; gap: 12px; width: min(420px, calc(100vw - 24px));
  padding: 10px 10px 10px 12px; color: var(--text, #111);
  background: var(--card, #fff);
  border: 1px solid var(--glass-border-soft, var(--border, #ccc));
  border-radius: var(--ui-radius-surface, 42px);
  box-shadow: 0 12px 32px var(--glass-shadow-deep, rgba(0,0,0,.25));
}
.ycall-banner.is-open { transform: translate(-50%, 0); }
.ycall-banner .ycall-avatar { width: 44px; height: 44px; font-size: 18px; flex: none; }
.ycall-banner-text { flex: 1; min-width: 0; text-align: left; }
.ycall-banner-text .ycall-name { font-size: 15px; margin: 0; }
.ycall-banner-text .ycall-status { font-size: 12px; min-height: 0; }
.ycall-banner .ycall-pill { flex: none; }

/* Call history */
.ycall-history { color: var(--text, #111); }
.ycall-history-day { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted-text, #888); margin: 18px 4px 6px; }
.ycall-history-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 8px;
  border-radius: var(--ui-radius-surface, 42px); transition: background .15s ease;
}
.ycall-history-row:hover { background: var(--glass-control-hover, var(--button, #ddd)); }
.ycall-history-row .ycall-avatar { width: 44px; height: 44px; font-size: 17px; flex: none; }
.ycall-history-main { flex: 1; min-width: 0; }
.ycall-history-name { font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ycall-history-row.is-missed .ycall-history-meta { color: var(--primary, #5C77FF); font-weight: 600; }
.ycall-history-meta { display: flex; align-items: center; gap: 5px; font-size: 13px; color: var(--secondary-text, #666); }
.ycall-history-meta svg { width: 14px; height: 14px; flex: none; }
.ycall-history-time { font-size: 12px; color: var(--muted-text, #888); white-space: nowrap; }
.ycall-history-callback {
  width: 40px; height: 40px; padding: 0 !important; min-width: 0; border-radius: 50% !important; flex: none;
  display: flex; align-items: center; justify-content: center; color: var(--primary, #5C77FF); cursor: pointer;
}
.ycall-history .ycall-history-callback svg { width: 18px !important; height: 18px !important; }
.ycall-history-callback:focus-visible { outline: 3px solid var(--highlight-hover, #aab8ff); outline-offset: 2px; }
.ycall-history-empty { text-align: center; padding: 48px 16px; color: var(--secondary-text, #666); font-size: 14px; }

@media (prefers-reduced-motion: reduce) {
  .ycall-avatar-wrap::before, .ycall-dots::after { animation: none; }
  .ycall-overlay, .ycall-card, .ycall-banner { transition: none; }
}

/* ---------- Full-screen in-call screen ---------- */
.ycall-live {
  position: fixed; inset: 0; z-index: 10040;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: max(28px, env(safe-area-inset-top)) 24px max(28px, env(safe-area-inset-bottom));
  background: var(--background, #101010); color: var(--text, #f5f5f5);
  opacity: 0; transform: scale(1.02);
  transition: opacity .32s var(--glass-ease, ease), transform .32s var(--glass-ease, ease);
  --ycall-accent: var(--primary, #5C77FF);
  --ycall-level: 0;
  font-family: Arial, sans-serif;
}
.ycall-live.is-open { opacity: 1; transform: none; }
.ycall-live::before { /* soft accent wash behind the avatar, also follows the voice */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--primary, #5C77FF) 14%, transparent) 0%, transparent 60%);
}
.ycall-live-top { position: relative; width: 100%; max-width: 520px; display: flex; align-items: center; justify-content: space-between; }
.ycall-live-icon, .ycall-live-control > button {
  background: color-mix(in srgb, var(--text, #fff) 8%, transparent) !important;
  border: 1px solid color-mix(in srgb, var(--text, #fff) 16%, transparent) !important;
  color: var(--text, #f5f5f5) !important; box-shadow: none !important;
}
.ycall-live-icon { width: 44px; height: 44px; min-width: 0; padding: 0 !important; border-radius: 50% !important; display: flex; align-items: center; justify-content: center; }
.ycall-live-icon svg { width: 22px; height: 22px; }
.ycall-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px;
  font-size: 13px; color: var(--secondary-text, #aaa);
  background: color-mix(in srgb, var(--text, #fff) 6%, transparent);
  border: 1px solid color-mix(in srgb, var(--text, #fff) 16%, transparent);
}
.ycall-chip > svg { width: 14px; height: 14px; }
.ycall-live-id { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 52px; }
.ycall-live-timer { font-size: 18px; font-variant-numeric: tabular-nums; color: var(--text, #f5f5f5); }
.ycall-bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.ycall-bars i { width: 3px; border-radius: 999px; background: var(--primary, #5C77FF); }
.ycall-bars i:nth-child(1) { height: 4px; } .ycall-bars i:nth-child(2) { height: 7px; }
.ycall-bars i:nth-child(3) { height: 10px; } .ycall-bars i:nth-child(4) { height: 12px; }
.ycall-quality[data-q="poor"] .ycall-bars i:nth-child(n+3) { background: color-mix(in srgb, var(--text, #fff) 25%, transparent); }
.ycall-wave { display: inline-flex; align-items: center; gap: 2px; height: 14px; }
.ycall-wave i { width: 3px; height: 6px; border-radius: 999px; background: var(--primary, #5C77FF); }
.ycall-live.is-speaking .ycall-wave i { animation: ycall-wave .9s ease-in-out infinite; }
.ycall-wave i:nth-child(2) { animation-delay: -.2s !important; } .ycall-wave i:nth-child(3) { animation-delay: -.4s !important; }
.ycall-wave i:nth-child(4) { animation-delay: -.6s !important; } .ycall-wave i:nth-child(5) { animation-delay: -.8s !important; }
@keyframes ycall-wave { 50% { transform: scaleY(2.3); } }
.ycall-speaking { opacity: 0; transition: opacity .2s ease; }
.ycall-live.is-speaking .ycall-speaking { opacity: 1; }
.ycall-live-center { position: relative; display: flex; flex-direction: column; align-items: center; gap: 22px; }
.ycall-live-avatar { position: relative; width: min(44vw, 200px); height: min(44vw, 200px); }
.ycall-live-avatar .ycall-avatar { font-size: 72px; }
.ycall-live-avatar::before { /* the outline that breathes with their voice */
  content: ""; position: absolute; inset: -8px; border-radius: 50%;
  border: 3px solid var(--primary, #5C77FF); /* fixed; only transform/opacity animate */
  box-shadow: 0 0 36px 4px color-mix(in srgb, var(--primary, #5C77FF) 45%, transparent);
  will-change: transform, opacity;
  transform: scale(calc(1 + var(--ycall-level) * .1));
  opacity: calc(.35 + var(--ycall-level) * .65);
  transition: transform 90ms linear, opacity 90ms linear;
}
.ycall-live-avatar::after { /* echo ring, only above level 0.5 */
  content: ""; position: absolute; inset: -20px; border-radius: 50%; pointer-events: none;
  border: 2px solid var(--primary, #5C77FF);
  opacity: clamp(0, (var(--ycall-level) - .5) * 1.2, .6);
  transform: scale(calc(1 + var(--ycall-level) * .14));
  transition: transform 120ms linear, opacity 120ms linear;
}
.ycall-live .ycall-name { font-size: 28px; margin: 0; }
.ycall-live-note { min-height: 20px; font-size: 14px; color: var(--secondary-text, #aaa); }
.ycall-live-tray {
  position: relative; display: flex; gap: 18px; justify-content: center; align-items: flex-start;
  padding: 18px 22px 14px; border-radius: var(--ui-radius-surface, 42px);
  background: color-mix(in srgb, var(--card, #1c1c1c) 85%, transparent);
  border: 1px solid color-mix(in srgb, var(--text, #fff) 14%, transparent);
}
.ycall-live-control > button.is-on { background: var(--primary, #5C77FF) !important; color: var(--primary-text, #fff) !important; }
/* Compact call: a real row in the existing sticky header, below the brand. */
body > .site-header.has-active-call {
  flex-wrap: wrap;
  row-gap: 8px !important;
}
.ycall-mini { display: none; }
.ycall-live.is-minimized {
  position: relative;
  inset: auto;
  z-index: auto;
  flex: 0 0 100%;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  background: none;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transform: none;
  transition: none;
}
/* If a host page has no Yapper header, reserve space in normal page flow. */
.ycall-live.is-minimized.is-call-fallback {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 100;
  padding: 8px 0;
}
.ycall-live.is-minimized::before, .ycall-live.is-minimized > :not(.ycall-mini) { display: none; }
.ycall-live.is-minimized .ycall-mini {
  display: flex;
  align-items: center;
  gap: 6px;
  box-sizing: border-box;
  width: min(100%, 460px);
  min-width: 0;
  padding: 6px 7px 6px 10px;
  border: 1px solid color-mix(in srgb, var(--primary, #5C77FF) 28%, var(--glass-border-soft, #ffffff20));
  border-radius: 999px;
  background: color-mix(in srgb, var(--card, #1c1c1c) 94%, var(--primary, #5C77FF));
  color: var(--text, #f5f5f5);
  box-shadow: inset 0 1px 0 #ffffff0a, 0 3px 12px #00000012;
  animation: ycallMiniIn 160ms ease both;
}
@keyframes ycallMiniIn { from { opacity: 0; } to { opacity: 1; } }
.ycall-mini-open {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px; padding: 0 4px 0 0 !important;
  border: 0 !important; border-radius: 999px !important; background: none !important; box-shadow: none !important;
  color: inherit !important; text-align: left; transform: none !important;
}
.ycall-mini-btn {
  width: 40px; height: 40px; min-width: 0; flex: none; padding: 0 !important; border-radius: 50% !important;
  display: flex; align-items: center; justify-content: center; box-shadow: none !important;
  background: color-mix(in srgb, var(--text, #fff) 7%, transparent) !important;
  border: 1px solid color-mix(in srgb, var(--text, #fff) 12%, transparent) !important; color: inherit !important;
}
.ycall-mini-btn.is-end { background: var(--primary, #5C77FF) !important; border-color: transparent !important; color: var(--primary-text, #fff) !important; }
.ycall-mini-btn.is-on { background: color-mix(in srgb, var(--primary, #5C77FF) 18%, var(--card, #1c1c1c)) !important; border-color: color-mix(in srgb, var(--primary, #5C77FF) 45%, transparent) !important; color: var(--primary, #5C77FF) !important; }
.ycall-mini-btn svg { width: 20px; height: 20px; }
.ycall-mini .ycall-wave i { background: var(--primary, #5C77FF); }
.ycall-live-control { display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 12px; color: var(--secondary-text, #aaa); }
.ycall-live-control > button {
  width: 68px; height: 68px; padding: 0 !important; min-width: 0; border-radius: 50% !important;
  display: flex; align-items: center; justify-content: center;
}
.ycall-live-control > button svg { width: 26px !important; height: 26px !important; }
.ycall-live-control > button[hidden] { display: none; }
.ycall-live-control.is-hidden { display: none; }

@media (prefers-reduced-motion: reduce) {
  .ycall-live, .ycall-live-avatar::before, .ycall-live-avatar::after { transition: none; }
  .ycall-live.is-speaking .ycall-wave i { animation: none; height: 10px; }
}
/* Minimized bar: keep the app's global button styles off the inner layout. */
.ycall-mini-open > .ycall-mini-text { display: flex !important; flex-direction: column !important; align-items: flex-start; gap: 3px; min-width: 0; font-size: 13px; line-height: 1.2; }
.ycall-mini-open > .ycall-mini-text b { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ycall-mini-open > .ycall-mini-text small { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--secondary-text, #aaa); font-size: 11px; font-weight: 400; }
.ycall-mini-open > .ycall-mini-avatar { display: block; width: 32px !important; height: 32px !important; flex: 0 0 32px; }
.ycall-mini-open > .ycall-mini-avatar .ycall-avatar { font-size: 15px !important; width: 32px; height: 32px; }
.ycall-mini-open > .ycall-wave { margin-left: auto; flex: none; }
.ycall-mini-open .ycall-mini-text small .ycall-live-timer { font-size: 11px !important; color: inherit !important; }

/* Round call buttons are always perfect circles, never stretched pills, whatever Yapper's global button rules say. */
.ycall-live-control > button,
.ycall-live-icon,
.ycall-mini-btn,
.ycall-history-callback {
  --ycall-btn: 68px;
  box-sizing: border-box !important;
  width: var(--ycall-btn) !important; height: var(--ycall-btn) !important;
  min-width: var(--ycall-btn) !important; max-width: var(--ycall-btn) !important;
  min-height: var(--ycall-btn) !important; max-height: var(--ycall-btn) !important;
  aspect-ratio: 1 / 1 !important; flex: 0 0 var(--ycall-btn) !important;
  padding: 0 !important; margin: 0 !important; line-height: 1 !important;
  border-radius: 50% !important;
  display: flex !important; align-items: center !important; justify-content: center !important;
}
.ycall-live-icon { --ycall-btn: 44px; }
.ycall-mini-btn, .ycall-history-callback { --ycall-btn: 40px; }
.ycall-live-control > button:is(:hover, :active, :focus), .ycall-live-icon:is(:hover, :active, :focus),
.ycall-mini-btn:is(:hover, :active, :focus), .ycall-history-callback:is(:hover, :active, :focus) {
  transform: none !important; width: var(--ycall-btn) !important; height: var(--ycall-btn) !important;
}
.ycall-live-control { flex: 0 0 auto !important; }
@media (max-width: 380px) {
  .ycall-live-control > button { --ycall-btn: 60px; }
  .ycall-live-tray { gap: 12px; padding: 16px 14px 12px; }
}

/* Controls: icon-only circles inside one horizontal pill. Labels live in aria-label. */
.ycall-live-tray { border-radius: 999px !important; padding: 12px !important; gap: 14px !important; align-items: center !important; }
.ycall-live-control { gap: 0 !important; }
@media (max-width: 380px) { .ycall-live-tray { gap: 10px !important; padding: 10px !important; } }
/* Stacy's tray spec: 56px circles, 12px gap, 8px padding, End in Yapper's dark #303030. */
.ycall-live-control > button { --ycall-btn: 56px; }
.ycall-live-tray, .ycall-live-tray[class] { padding: 8px !important; gap: 12px !important; }
.ycall-live-control > button[data-act="end"] { background: #303030 !important; border-color: transparent !important; color: #fff !important; }
@media (max-width: 380px) { .ycall-live-control > button { --ycall-btn: 56px; } .ycall-live-tray { gap: 12px !important; padding: 8px !important; } }

/* Performance: the voice ring only animates transform and opacity (GPU), never shadow size,
   border width or gradients, and the level variable lives on the call screen, not <html>. */
.ycall-live::before {
  background: radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--primary, #5C77FF) 28%, transparent) 0%, transparent 60%) !important;
  opacity: calc(.35 + var(--ycall-level) * .65); will-change: opacity; transition: opacity 120ms linear;
}
.ycall-live-avatar { contain: layout style; }
.ycall-live-avatar::before {
  border-width: 3px !important;
  box-shadow: 0 0 34px 6px color-mix(in srgb, var(--primary, #5C77FF) 55%, transparent) !important;
  will-change: transform, opacity; transition: transform 90ms linear, opacity 90ms linear !important;
}
.ycall-live-avatar::after { will-change: transform, opacity; }
.ycall-wave i { height: 6px !important; will-change: transform; }
.ycall-live.is-speaking .ycall-wave i, .ycall-live .ycall-wave i { transform-origin: center; }
.ycall-live.is-minimized .ycall-live-avatar::before, .ycall-live.is-minimized::before { display: none; }

/* Safety: a call screen that is closing or never opened must never block taps on the app below. */
.ycall-overlay:not(.is-open), .ycall-live:not(.is-open), .ycall-banner:not(.is-open) { pointer-events: none !important; }
/* "Couldn't connect": dark Close pill and a still avatar (no breathing). */
.ycall-pill.is-dark { background: #303030 !important; color: #fff !important; border-color: transparent !important; }
.ycall-avatar-wrap.is-still::before { animation: none; opacity: .6; }
/* Call message in the chat (frame F2): a centered pill; tap to call back. */
.ycall-chat-event { display: flex; justify-content: center; margin: 10px 0; }
.ycall-chat-pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--glass-border-soft, var(--border, #ccc)); background: var(--card, #fff); color: var(--text, #111); font: 600 14px/1.2 Arial, sans-serif; cursor: pointer; }
.ycall-chat-pill svg { width: 16px; height: 16px; flex: none; color: var(--secondary-text, #666); }
.ycall-chat-pill.is-missed svg { color: var(--primary, #5C77FF); }
.ycall-chat-time { font-weight: 400; color: var(--secondary-text, #666); }

/* Hide the app dock while the full call screen is open, so the two docks never overlap. */
body:has(.ycall-live.is-open:not(.is-minimized)) #mobileDock { visibility: hidden !important; pointer-events: none !important; }

/* v6.01-12: Yapper's own glass depth (from yapper-motion-v527 dock and buttons). Static paint only, no blur. */
.ycall-live-tray, .ycall-live-tray[class] {
  border: 1px solid color-mix(in srgb, var(--glass-border, rgba(255,255,255,.14)) 92%, white 8%) !important;
  background-color: color-mix(in srgb, var(--card, #1c1c1c) 72%, transparent) !important;
  background-image: linear-gradient(150deg, var(--ym-glass-wash, rgba(255,255,255,.065)), transparent 48%) !important;
  box-shadow: inset 0 1px 0 var(--ym-glass-glint, rgba(255,255,255,.22)),
    inset 0 -1px 0 var(--ym-glass-contact, rgba(0,0,0,.24)), 0 8px 20px var(--ym-glass-contact, rgba(0,0,0,.24)) !important;
}
/* Buttons use Yapper's real secondary-button / primary-button classes for the shine.
   Keep them perfect circles whatever those classes set. */
.ycall-live-control > button[class] { width: var(--ycall-btn, 56px) !important; height: var(--ycall-btn, 56px) !important; min-width: 0 !important; min-height: 0 !important; padding: 0 !important; border-radius: 50% !important; }
.ycall-live-icon[class] { width: 44px !important; height: 44px !important; min-width: 0 !important; min-height: 0 !important; padding: 0 !important; border-radius: 50% !important; }

/* No focus ring on autofocus or tap; keep it for keyboard users only. */
[class*="ycall-"] button:focus:not(:focus-visible), .ycall-pill:focus:not(:focus-visible) { outline: none !important; }
[class*="ycall-"] [data-autofocus]:focus:not(:focus-visible) { outline: none !important; }

/* "Name is muted" pill: shares the speaking chip's spot, only one shows (Stacy's spec). */
.ycall-chip-slot { display: grid; justify-items: center; }
.ycall-chip-slot > .ycall-chip { grid-area: 1 / 1; }
.ycall-muted { opacity: 0; transform: scale(.96); pointer-events: none; transition: opacity .2s cubic-bezier(.22,1,.36,1), transform .2s cubic-bezier(.22,1,.36,1); }
.ycall-live.is-remote-muted .ycall-muted { opacity: 1; transform: none; }
.ycall-live.is-remote-muted .ycall-speaking { opacity: 0 !important; }
.ycall-muted svg { width: 14px; height: 14px; color: var(--primary, #5C77FF); flex: none; }
@media (prefers-reduced-motion: reduce) { .ycall-muted { transform: none; transition: opacity .2s ease; } }

/* Call buttons have their own layout, independent of confirmation dialogs. */
.ycall-card .ycall-pill { height: 44px !important; min-height: 44px !important; padding: 0 10px !important; margin: 0 !important; font-size: 14px !important; border-radius: 999px !important; }
.ycall-card .ycall-pill svg { width: 16px !important; height: 16px !important; }

/* Keep controls easy to hit; text is the only part allowed to shrink. */
.ycall-live.is-minimized .ycall-mini-btn { --ycall-btn: 44px; }
.ycall-mini-open { min-height: 44px; }
.ycall-mini-open:focus-visible, .ycall-mini-btn:focus-visible {
  outline: 2px solid var(--primary, #5C77FF);
  outline-offset: 2px;
}
@media (max-width: 350px), (orientation: landscape) and (max-height: 500px) {
  .ycall-mini-open > .ycall-wave { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .ycall-live.is-minimized .ycall-mini { animation: none; }
}

/* The same call shelf follows you into Messages, inside the visible toolbar.
   One slim row: no avatar/wave, with enough room for names and touch controls. */
#dmModal :is(.dm-modal-header, .dm-conversation-header, .dm-contact-info-header, .dm-theme-header).has-active-call {
  flex-wrap: wrap;
  row-gap: 4px !important;
  flex-shrink: 0;
}
.ycall-live.is-in-messages { grid-column: 1 / -1; }
.ycall-live.is-minimized.is-in-messages .ycall-mini {
  width: 100%;
  max-width: 460px;
  padding: 0 1px 0 11px;
  box-shadow: none;
  animation: none;
}
.ycall-live.is-in-messages .ycall-mini-open > :is(.ycall-mini-avatar, .ycall-wave) { display: none !important; }
.ycall-live.is-in-messages .ycall-mini-open > .ycall-mini-text { flex: 1; }
.ycall-live.is-in-messages .ycall-mini-open > .ycall-mini-text small { font-size: 10px; }

/* The restore target is transparent: the app-wide pill overflow mask must not
   shave off the left edge of its two text lines, including while pressed. */
.ycall-live .ycall-mini-open {
  overflow: visible !important;
  justify-content: flex-start !important;
  box-sizing: border-box;
  padding-inline: 5px 4px !important;
  height: auto;
  text-indent: 0;
}
.ycall-mini-open > .ycall-mini-text {
  flex: 1 1 0;
  min-width: 0;
  max-width: 100%;
  text-align: start;
}
.ycall-mini-open > .ycall-mini-text b {
  display: block;
  width: 100%;
  line-height: 1.35;
}
.ycall-mini-open > .ycall-mini-text small {
  display: flex !important;
  align-items: baseline;
  gap: 4px;
  width: 100%;
  min-width: 0;
  overflow: visible;
  line-height: 1.35;
}
.ycall-mini-open .ycall-mini-text small .ycall-live-timer {
  display: block;
  flex: 0 0 auto;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.ycall-mini-hint {
  display: block;
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* One full-screen call language for incoming, ringing, connecting and retry.
   The existing active-call screen and compact busy banner stay independent. */
.ycall-overlay {
  box-sizing: border-box;
  padding: 0;
  background: var(--background, #101010);
  color: var(--text, #f5f5f5);
  overflow: auto;
  overscroll-behavior: contain;
}
.ycall-overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 42%, color-mix(in srgb, var(--primary, #5C77FF) 18%, transparent), transparent 65%);
}
.ycall-overlay .ycall-card {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(100px, 1fr) auto auto minmax(76px, 1fr);
  justify-items: center;
  gap: 12px;
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  min-height: 100%;
  min-height: 100dvh;
  padding: max(28px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(28px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  transform: none;
  text-align: center;
}
.ycall-overlay .ycall-label {
  margin: 0;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--text, #fff) 12%, transparent);
  background: color-mix(in srgb, var(--text, #fff) 5%, transparent);
  font: 500 13px/1.3 system-ui, sans-serif;
}
.ycall-overlay .ycall-avatar-wrap {
  align-self: end;
  width: clamp(96px, 32vw, 164px);
  height: clamp(96px, 32vw, 164px);
  margin: 12px 0 16px;
}
.ycall-overlay .ycall-avatar { font-size: 54px; }
.ycall-overlay .ycall-name {
  width: min(100%, 520px);
  margin: 0;
  font: 700 clamp(24px, 6vw, 32px)/1.2 system-ui, sans-serif;
  white-space: normal;
  overflow-wrap: anywhere;
}
.ycall-overlay .ycall-status {
  max-width: 340px;
  font: 400 14px/1.5 system-ui, sans-serif;
  color: var(--secondary-text, #aaa);
}
.ycall-overlay .ycall-card .ycall-actions {
  align-self: end;
  justify-self: center;
  display: flex !important;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 12px !important;
  width: max-content !important;
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box;
  margin: 24px 0 0 !important;
  /* Material, padding and gap are shared with the active-call tray. */
}
/* A lone cancel/close button needs no second capsule around its circle. */
.ycall-overlay .ycall-card .ycall-actions.is-single {
  padding: 0 !important;
  border: 0 !important;
  background: none !important;
  box-shadow: none !important;
}
body:has(.ycall-overlay.is-open) #mobileDock { visibility: hidden !important; pointer-events: none !important; }
@media (max-height: 500px) {
  .ycall-overlay .ycall-card { grid-template-rows: auto minmax(60px, 1fr) auto auto auto; gap: 6px; padding-top: max(12px, env(safe-area-inset-top)); padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  .ycall-overlay .ycall-avatar-wrap { width: 72px; height: 72px; margin: 6px 0; }
  .ycall-overlay .ycall-name { font-size: 23px; }
  .ycall-overlay .ycall-card .ycall-actions { margin-top: 6px !important; }
}

/* Call actions are glyph-only everywhere, with names kept for screen readers. */
.ycall-overlay .ycall-actions > button.ycall-action-icon,
.ycall-banner > button.ycall-action-icon {
  --call-action-size: 56px;
  box-sizing: border-box !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  flex: 0 0 var(--call-action-size) !important;
  width: var(--call-action-size) !important;
  height: var(--call-action-size) !important;
  min-width: var(--call-action-size) !important;
  max-width: var(--call-action-size) !important;
  min-height: var(--call-action-size) !important;
  max-height: var(--call-action-size) !important;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 50% !important;
  line-height: 1;
}
.ycall-banner > button.ycall-action-icon { --call-action-size: 44px; }
.ycall-overlay .ycall-actions .ycall-action-icon svg {
  display: block;
  width: 25px !important;
  height: 25px !important;
}
.ycall-banner .ycall-action-icon svg {
  display: block;
  width: 21px !important;
  height: 21px !important;
}
.ycall-action-icon:focus-visible {
  outline: 2px solid var(--primary, #5C77FF);
  outline-offset: 3px;
}
