/**
 * Mobile + PWA only (≤1199.98 / .cotinder-in-pwa):
 * 1) Floating «Активность» chip → bottom-right, ABOVE the orange menu FAB
 *    (#cotinder-mobmenu-fab is right:12px / bottom:72px / z-index:2500).
 *    «Нашли ошибку» stays left.
 * 2) Card title ribbon «Любимец района» / pet titles → bottom-right on media
 *    (clear of author chip bottom-left).
 * Desktop ≥1200 untouched. Does not edit custom.css / mobile-card-fixes.
 */

@media (max-width: 1199.98px) {
  /* --- Engage chip: right side, above menu FAB --- */
  html body .cotinder-engage-chip {
    position: fixed !important;
    left: auto !important;
    right: max(12px, env(safe-area-inset-right, 0px)) !important;
    transform: translateX(0) !important;
    bottom: calc(128px + env(safe-area-inset-bottom, 0px)) !important;
    z-index: 2600 !important;
    max-width: min(200px, calc(100vw - 80px)) !important;
    pointer-events: auto !important;
    visibility: visible !important;
    opacity: 1;
  }

  html body .cotinder-engage-chip:not(.is-hidden) {
    display: inline-flex !important;
  }

  html body .cotinder-engage-chip.is-engage-promo,
  html body .cotinder-engage-chip.is-engage-nudge {
    animation: cotinderEngageChipPulseRight 2.8s ease-in-out infinite !important;
  }

  html body.cotinder-mnav-mobile .cotinder-engage-chip {
    left: auto !important;
    right: max(12px, env(safe-area-inset-right, 0px)) !important;
    transform: translateX(0) !important;
    bottom: calc(128px + env(safe-area-inset-bottom, 0px)) !important;
  }

  html body.cotinder-cookie-banner-open .cotinder-engage-chip {
    left: auto !important;
    right: max(12px, env(safe-area-inset-right, 0px)) !important;
    transform: translateX(0) !important;
    bottom: calc(188px + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* Toast stays above the chip; align to the same side */
  html body .cotinder-engage__toast {
    left: auto !important;
    right: max(12px, env(safe-area-inset-right, 0px)) !important;
    transform: none !important;
    bottom: calc(176px + env(safe-area-inset-bottom, 0px)) !important;
    z-index: 2610 !important;
  }

  /* --- Pet title ribbon on feed / owner cards --- */
  html body .index__post .card .card-img-wrap > .cotinder-boost-card__title-ribbon,
  html body .index__post .card .card__media-wrap > .cotinder-boost-card__title-ribbon,
  html body .another-pet .card .card-img-wrap > .cotinder-boost-card__title-ribbon,
  html body .another-pet .card .card__media-wrap > .cotinder-boost-card__title-ribbon,
  html body .cotinder-index-feed .card .card-img-wrap > .cotinder-boost-card__title-ribbon,
  html body .cotinder-index-feed .card .card__media-wrap > .cotinder-boost-card__title-ribbon,
  html body .tabs__content .card .card-img-wrap > .cotinder-boost-card__title-ribbon,
  html body .tabs__content .card .card__media-wrap > .cotinder-boost-card__title-ribbon {
    left: auto !important;
    right: 8px !important;
    bottom: 8px !important;
    max-width: calc(100% - 24px) !important;
  }
}

/* PWA shell: same rules even if iframe reports wider CSS width */
html.cotinder-in-pwa .cotinder-engage-chip {
  position: fixed !important;
  left: auto !important;
  right: max(12px, env(safe-area-inset-right, 0px)) !important;
  transform: translateX(0) !important;
  bottom: calc(128px + env(safe-area-inset-bottom, 0px)) !important;
  z-index: 2600 !important;
  max-width: min(200px, calc(100vw - 80px)) !important;
  pointer-events: auto !important;
  visibility: visible !important;
}

html.cotinder-in-pwa .cotinder-engage-chip:not(.is-hidden) {
  display: inline-flex !important;
}

html.cotinder-in-pwa .cotinder-engage-chip.is-engage-promo,
html.cotinder-in-pwa .cotinder-engage-chip.is-engage-nudge {
  animation: cotinderEngageChipPulseRight 2.8s ease-in-out infinite !important;
}

html.cotinder-in-pwa.cotinder-mnav-mobile .cotinder-engage-chip,
html.cotinder-in-pwa body.cotinder-mnav-mobile .cotinder-engage-chip,
html.cotinder-in-pwa body.cotinder-cookie-banner-open .cotinder-engage-chip {
  left: auto !important;
  right: max(12px, env(safe-area-inset-right, 0px)) !important;
  transform: translateX(0) !important;
}

html.cotinder-in-pwa body.cotinder-cookie-banner-open .cotinder-engage-chip {
  bottom: calc(188px + env(safe-area-inset-bottom, 0px)) !important;
}

html.cotinder-in-pwa .cotinder-engage__toast {
  left: auto !important;
  right: max(12px, env(safe-area-inset-right, 0px)) !important;
  transform: none !important;
  bottom: calc(176px + env(safe-area-inset-bottom, 0px)) !important;
  z-index: 2610 !important;
}

html.cotinder-in-pwa .index__post .card .card-img-wrap > .cotinder-boost-card__title-ribbon,
html.cotinder-in-pwa .index__post .card .card__media-wrap > .cotinder-boost-card__title-ribbon,
html.cotinder-in-pwa .another-pet .card .card-img-wrap > .cotinder-boost-card__title-ribbon,
html.cotinder-in-pwa .another-pet .card .card__media-wrap > .cotinder-boost-card__title-ribbon,
html.cotinder-in-pwa .cotinder-index-feed .card .card-img-wrap > .cotinder-boost-card__title-ribbon,
html.cotinder-in-pwa .cotinder-index-feed .card .card__media-wrap > .cotinder-boost-card__title-ribbon {
  left: auto !important;
  right: 8px !important;
  bottom: 8px !important;
  max-width: calc(100% - 24px) !important;
}

@keyframes cotinderEngageChipPulseRight {
  0%, 100% { opacity: 1; transform: translateX(0) scale(1); }
  50% { opacity: 0.96; transform: translateX(0) scale(1.03); }
}

@media (prefers-reduced-motion: reduce) {
  html body .cotinder-engage-chip.is-engage-promo,
  html body .cotinder-engage-chip.is-engage-nudge,
  html.cotinder-in-pwa .cotinder-engage-chip.is-engage-promo,
  html.cotinder-in-pwa .cotinder-engage-chip.is-engage-nudge {
    animation: none !important;
  }
}

/* PWA / standalone: NFC gadgets slide card (frozen FPC + /gadjet/ iframe) marker pwagadget20261129f */
@media (max-width: 1199.98px) {
  html.cotinder-in-pwa .main__banner .main__slide.main__slide--f1k-gadgets,
  html.cotinder-pwa-standalone .main__banner .main__slide.main__slide--f1k-gadgets,
  html.cotinder-pwa-standalone body.page-index .main__banner .main__slide.main__slide--f1k-gadgets {
    display: flex !important;
    flex-direction: column !important;
    min-height: 0 !important;
    height: auto !important;
    overflow: visible !important;
  }

  html.cotinder-in-pwa .main__banner .main__slide--f1k-gadgets .main__slide_right.sw-f1k-gadgets-spot__visual,
  html.cotinder-in-pwa .main__banner .main__slide--f1k-gadgets .sw-f1k-gadgets-spot__glow,
  html.cotinder-pwa-standalone .main__banner .main__slide--f1k-gadgets .main__slide_right.sw-f1k-gadgets-spot__visual,
  html.cotinder-pwa-standalone .main__banner .main__slide--f1k-gadgets .sw-f1k-gadgets-spot__glow,
  html.cotinder-in-pwa .main__banner .main__slide--f1k-gadgets img.sw-f1k-gadgets-spot__cover,
  html.cotinder-in-pwa .main__banner .main__slide--f1k-gadgets img.sw-f1k-gadgets-spot__hero-medal,
  html.cotinder-in-pwa .main__banner .main__slide--f1k-gadgets .sw-f1k-gadgets-spot__orbit,
  html.cotinder-pwa-standalone .main__banner .main__slide--f1k-gadgets img.sw-f1k-gadgets-spot__cover,
  html.cotinder-pwa-standalone .main__banner .main__slide--f1k-gadgets img.sw-f1k-gadgets-spot__hero-medal,
  html.cotinder-pwa-standalone .main__banner .main__slide--f1k-gadgets .sw-f1k-gadgets-spot__orbit {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
    position: absolute !important;
    width: 0 !important;
    pointer-events: none !important;
  }

  html.cotinder-in-pwa .main__banner .main__slide--f1k-gadgets .main__slide_left.sw-f1k-gadgets-spot__body,
  html.cotinder-pwa-standalone .main__banner .main__slide--f1k-gadgets .main__slide_left.sw-f1k-gadgets-spot__body {
    position: relative !important;
    z-index: 2 !important;
    width: calc(100% - 24px) !important;
    max-width: none !important;
    margin: 0 12px !important;
    padding: 14px 16px 16px !important;
    background: #fffbf7 !important;
    border-radius: 18px !important;
    box-shadow: 0 12px 36px rgba(26, 16, 40, 0.2) !important;
    box-sizing: border-box !important;
  }

  html.cotinder-in-pwa .main__banner .main__slide--f1k-gadgets .sw-f1k-gadgets-spot__title,
  html.cotinder-in-pwa .main__banner .main__slide--f1k-gadgets .sw-f1k-gadgets-spot__lead,
  html.cotinder-in-pwa .main__banner .main__slide--f1k-gadgets .sw-f1k-gadgets-spot__bullets li,
  html.cotinder-pwa-standalone .main__banner .main__slide--f1k-gadgets .sw-f1k-gadgets-spot__title,
  html.cotinder-pwa-standalone .main__banner .main__slide--f1k-gadgets .sw-f1k-gadgets-spot__lead,
  html.cotinder-pwa-standalone .main__banner .main__slide--f1k-gadgets .sw-f1k-gadgets-spot__bullets li {
    color: #1a1028 !important;
  }

  html.cotinder-in-pwa .main__banner .main__slide--f1k-gadgets .sw-f1k-btn,
  html.cotinder-pwa-standalone .main__banner .main__slide--f1k-gadgets .sw-f1k-btn {
    width: 100% !important;
    box-sizing: border-box !important;
  }

  html.cotinder-in-pwa .main__banner .main__slide--f1k-gadgets .main__slide_link,
  html.cotinder-pwa-standalone .main__banner .main__slide--f1k-gadgets .main__slide_link {
    display: none !important;
  }

  html.cotinder-in-pwa .main__banner .main__slide.main__slide--grow,
  html.cotinder-pwa-standalone .main__banner .main__slide.main__slide--grow {
    display: flex !important;
    flex-direction: column !important;
    background: transparent !important;
    min-height: 400px !important;
    height: auto !important;
    overflow: hidden !important;
  }

  html.cotinder-in-pwa .main__banner .main__slide--grow .main__slide_right,
  html.cotinder-pwa-standalone .main__banner .main__slide--grow .main__slide_right,
  html.cotinder-in-pwa .main__banner .main__slide--grow [data-cotinder-grow-visual],
  html.cotinder-pwa-standalone .main__banner .main__slide--grow [data-cotinder-grow-visual] {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    width: 0 !important;
    overflow: hidden !important;
    position: absolute !important;
    pointer-events: none !important;
  }

  html.cotinder-in-pwa .main__banner .main__slide--grow .main__slide_left.home-f1k-banner__card,
  html.cotinder-pwa-standalone .main__banner .main__slide--grow .main__slide_left.home-f1k-banner__card {
    width: calc(100% - 24px) !important;
    margin: 12px !important;
    padding: 1rem 1.1rem 1.15rem !important;
    background: rgba(255, 255, 255, 0.97) !important;
    border-radius: 22px !important;
    box-shadow: 0 16px 48px rgba(26, 16, 40, 0.18) !important;
    box-sizing: border-box !important;
    position: relative !important;
    z-index: 2 !important;
  }

  html.cotinder-in-pwa .main__banner .main__slide--grow .sw-grow__links,
  html.cotinder-pwa-standalone .main__banner .main__slide--grow .sw-grow__links {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  html.cotinder-in-pwa .main__banner .main__slide--grow .sw-grow__links a:first-child,
  html.cotinder-in-pwa .main__banner .main__slide--grow .sw-grow__quiet,
  html.cotinder-pwa-standalone .main__banner .main__slide--grow .sw-grow__links a:first-child,
  html.cotinder-pwa-standalone .main__banner .main__slide--grow .sw-grow__quiet {
    width: 100% !important;
    box-sizing: border-box !important;
  }
}
