/* Existing compact call chrome, bounded by the mobile page that owns it. */
@media (max-width: 768px) {
  /* Home stays mounted to preserve its state; its widget must leave with it. */
  ._pageFlightPanel_7kyn7_34[data-active="false"] [data-call-widget="true"] {
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }

  /* Calls/Contacts: match their 24px page inset, 44px controls and 10px gap. */
  html[data-rm-call-header-route] [data-call-widget="true"][data-placement="global"] {
    top: calc(env(safe-area-inset-top, 0px) + 17px) !important;
    left: 78px !important;
    width: calc(100% - 156px) !important;
  }

  /* Settings has no flanking controls: reuse the same header chrome once. */
  [data-call-widget="true"][data-placement="settings"] {
    position: fixed;
    z-index: 2200;
    top: calc(env(safe-area-inset-top, 0px) + 17px);
    left: 24px;
    width: calc(100% - 48px);
    height: 44px;
  }
  html:has([data-call-widget="true"][data-placement="settings"])
    ._pageFlightPanel_7kyn7_34[data-active="true"] [data-mobile-page-title] {
    visibility: hidden;
    opacity: 0 !important;
    pointer-events: none;
  }

  /* Reserve space above pins/history, including when the keyboard is open. */
  ._chatSheet_12xvp_316 > [data-mobile-chat-call-widget-host] {
    position: relative;
    top: auto;
    right: auto;
    left: auto;
    height: 44px;
    flex: 0 0 44px;
    margin: 8px 14px;
  }
  [data-mobile-chat-call-widget-host]:empty { display: none; }
}

/* Preserve the original title behind the frosted search during a call. */
@media (max-width: 768px) {
  html[data-rm-call-header-search-open]
    ._pageFlightPanel_7kyn7_34[data-active="true"] [data-mobile-page-title] {
    opacity: 1 !important;
  }
}

/* Keep the original search backdrop inside its moving glass, not on the call. */
@media (max-width: 768px) {
  [data-call-search-backdrop] {
    position: absolute;
    inset: 0;
    pointer-events: none;
    clip-path: inset(0 calc(100% - 44px) 0 0 round 22px);
    transition: clip-path .36s cubic-bezier(.2, .82, .2, 1);
  }
  [data-search-open="true"] > [data-call-search-backdrop] {
    clip-path: inset(0 56px 0 0 round 22px);
  }
}
@media (prefers-reduced-motion: reduce) {
  [data-call-search-backdrop] { transition-duration: 1ms; }
}
