/**
 * Identity / account switch modal — PC ≥1200.
 * Tall popup with top:50% + translateY(-50%) clips the top: «Уведомления»
 * is barely visible and profile options are hard to reach.
 * Lower the card under the header and allow scroll. Tablet/phone unchanged.
 * Does not edit custom.css.
 */
@media (min-width: 1200px) {
  html body #cotinder-identity-modal.cotinder-rating-popup-overlay:not(.cotinder-rating-popup-overlay--visible) {
    display: none !important;
    pointer-events: none !important;
    visibility: hidden !important;
  }

  html body #cotinder-identity-modal.cotinder-rating-popup-overlay--visible {
    display: flex !important;
    align-items: flex-start !important;
    justify-content: center !important;
    inset: 0 !important;
    padding: 24px 16px 32px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    pointer-events: auto !important;
    z-index: 10060 !important;
  }

  html body #cotinder-identity-modal.cotinder-rating-popup-overlay--visible .cotinder-rating-popup.cotinder-identity-modal,
  html body #cotinder-identity-modal.cotinder-rating-popup-overlay--visible .cotinder-identity-modal.cotinder-rating-popup {
    position: fixed !important;
    top: 120px !important;
    left: 50% !important;
    right: auto !important;
    bottom: auto !important;
    transform: translateX(-50%) !important;
    margin: 0 !important;
    width: min(400px, calc(100vw - 48px)) !important;
    max-width: calc(100vw - 48px) !important;
    max-height: calc(100vh - 140px) !important;
    max-height: calc(100dvh - 140px) !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior: contain !important;
    flex-direction: column !important;
    align-items: stretch !important;
    flex-shrink: 0 !important;
    z-index: 1 !important;
    box-sizing: border-box !important;
  }

  html:has(#bx-panel) body #cotinder-identity-modal.cotinder-rating-popup-overlay--visible .cotinder-rating-popup.cotinder-identity-modal,
  html:has(#bx-panel) body #cotinder-identity-modal.cotinder-rating-popup-overlay--visible .cotinder-identity-modal.cotinder-rating-popup,
  html.bx-panel-fixed body #cotinder-identity-modal.cotinder-rating-popup-overlay--visible .cotinder-rating-popup.cotinder-identity-modal,
  html.bx-panel-fixed body #cotinder-identity-modal.cotinder-rating-popup-overlay--visible .cotinder-identity-modal.cotinder-rating-popup {
    top: 160px !important;
    max-height: calc(100vh - 180px) !important;
    max-height: calc(100dvh - 180px) !important;
  }

  html body #cotinder-identity-modal.cotinder-rating-popup-overlay--visible .cotinder-identity-modal .cotinder-rating-popup__content {
    width: 100% !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
  }

  html body #cotinder-identity-modal.cotinder-rating-popup-overlay--visible .cotinder-identity-modal .cotinder-rating-popup__actions,
  html body #cotinder-identity-modal.cotinder-rating-popup-overlay--visible .cotinder-identity-modal .cotinder-rating-popup__actions--stacked {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 8px !important;
    width: 100% !important;
  }

  html body #cotinder-identity-modal.cotinder-rating-popup-overlay--visible .cotinder-identity-modal .js-cotinder-identity-option,
  html body #cotinder-identity-modal.cotinder-rating-popup-overlay--visible .cotinder-identity-modal .cotinder-identity-modal__cabinet,
  html body #cotinder-identity-modal.cotinder-rating-popup-overlay--visible .cotinder-identity-modal .cotinder-identity-modal__notifications {
    width: 100% !important;
    box-sizing: border-box !important;
  }
}

/* Notifications panel from identity / header: keep below chrome on PC */
@media (min-width: 1200px) {
  body.cotinder-notifications-open .js-cotinder-header-notifications:not([hidden]),
  body.cotinder-notifications-from-identity .cotinder-header-notifications:not([hidden]) {
    top: calc(var(--cotinder-identity-notif-top, 120px) + 16px) !important;
    max-height: calc(100dvh - var(--cotinder-identity-notif-top, 120px) - 40px) !important;
  }
}
