/**
 * Mobile / PWA pet card fixes (anotherpetgap20260807a).
 * Loaded after merged CSS — wins over cotinder-mobile-sidebar.css via !important.
 * Desktop ≥1200px untouched.
 */

@media (max-width: 1199.98px) {
    /*
     * «Питомцы данного автора» (.another-pet): size to content.
     * Culprits (desktop-only intent — leave ≥1200 alone):
     *   .another-pet .user-slide { min-height: 525px; height: 100% }
     *   .another-pet .user-slide > .card-desc { margin-top: auto }
     *   .card / tablet lock height 446|524 — stretch + auto-margin void
     *   between .card-user and .card-desc.
     */
    .another-pet__swiper .swiper-wrapper {
        align-items: flex-start !important;
    }

    .another-pet__swiper .swiper-slide {
        height: auto !important;
        align-self: flex-start !important;
    }

    .another-pet .user-slide,
    .another-pet .card.user-slide,
    .another-pet .card:not(.card__advice) {
        height: auto !important;
        min-height: 0 !important;
        flex: 0 0 auto !important;
        align-self: flex-start !important;
        overflow: hidden !important;
    }

    .another-pet .user-slide > .card-desc {
        margin-top: 0 !important;
    }

    /*
     * Pet channels (≤1199.98, incl. 1024×1366): size to content.
     * Do NOT force min-height 575 — that left large voids between blocks
     * when cards were stretched by the row / taller siblings.
     * Desktop ≥1200px untouched.
     */
    .tabs__content[data-target="canals"] .index__posts,
    .cotinder-index-feed[data-cotinder-feed-tab="canals"] .index__posts {
        align-items: flex-start !important;
    }

    /* Pack pet posts only — leave curator advice free to stretch to row height. */
    .tabs__content[data-target="canals"] .index__posts > .index__post:not(.index__post_curator-advice),
    .cotinder-index-feed[data-cotinder-feed-tab="canals"] .index__posts > .index__post:not(.index__post_curator-advice) {
        align-self: flex-start !important;
    }

    .tabs__content[data-target="canals"] .index__posts > .index__post:not(.index__post_curator-advice) > .card,
    .cotinder-index-feed[data-cotinder-feed-tab="canals"] .index__posts > .index__post:not(.index__post_curator-advice) > .card,
    .tabs__content[data-target="canals"] .index__post > .card.user-slide:not(.index__events_event):not(.index__events_article):not(.index__collaborations_card):not(.index__community-card),
    .cotinder-index-feed[data-cotinder-feed-tab="canals"] .index__post > .card.user-slide:not(.index__events_event):not(.index__events_article):not(.index__collaborations_card):not(.index__community-card) {
        height: auto !important;
        min-height: 0 !important;
        flex: 0 0 auto !important;
        align-self: flex-start !important;
        overflow: hidden !important;
    }

    /* Three-line preview; no margin-top:auto (creates voids in tall flex cards). */
    .tabs__content[data-target="canals"] .index__post > .card.user-slide:not(.index__events_event):not(.index__events_article):not(.index__collaborations_card):not(.index__community-card) > .card-desc,
    .cotinder-index-feed[data-cotinder-feed-tab="canals"] .index__post > .card.user-slide:not(.index__events_event):not(.index__events_article):not(.index__collaborations_card):not(.index__community-card) > .card-desc {
        display: -webkit-box !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        -webkit-box-orient: vertical !important;
        -webkit-line-clamp: 3 !important;
        line-height: 17px !important;
        max-height: 54px !important;
        min-height: 54px !important;
        margin-top: 0 !important;
    }

    /*
     * Curator advice (≤1199.98): stretch to tallest sibling card in the row.
     * Restores prior equal-height. Desktop ≥1200 untouched.
     */
    .index__posts > .index__post.index__post_curator-advice,
    .tabs__content[data-target="canals"] .index__posts > .index__post.index__post_curator-advice,
    .cotinder-index-feed[data-cotinder-feed-tab="canals"] .index__posts > .index__post.index__post_curator-advice,
    .tabs__content[data-target="last"] .index__posts > .index__post.index__post_curator-advice,
    .cotinder-index-feed[data-cotinder-feed-tab="last"] .index__posts > .index__post.index__post_curator-advice,
    .tabs__content[data-target="comunity"] .index__posts > .index__post.index__post_curator-advice,
    .cotinder-index-feed[data-cotinder-feed-tab="comunity"] .index__posts > .index__post.index__post_curator-advice,
    .tabs__content[data-target="nko"] .index__posts > .index__post.index__post_curator-advice,
    .cotinder-index-feed[data-cotinder-feed-tab="nko"] .index__posts > .index__post.index__post_curator-advice,
    .pet .pet-detail-page .index__posts > .index__post.index__post_curator-advice,
    .pet .tabs__content_pet .index__posts > .index__post.index__post_curator-advice {
        align-self: stretch !important;
        display: flex !important;
        flex-direction: column !important;
    }

    .index__posts > .index__post.index__post_curator-advice > .card.card__advice,
    .tabs__content[data-target="canals"] .index__posts > .index__post.index__post_curator-advice > .card.card__advice,
    .cotinder-index-feed[data-cotinder-feed-tab="canals"] .index__posts > .index__post.index__post_curator-advice > .card.card__advice,
    .tabs__content[data-target="last"] .index__posts > .index__post.index__post_curator-advice > .card.card__advice,
    .cotinder-index-feed[data-cotinder-feed-tab="last"] .index__posts > .index__post.index__post_curator-advice > .card.card__advice,
    .tabs__content[data-target="comunity"] .index__posts > .index__post.index__post_curator-advice > .card.card__advice,
    .cotinder-index-feed[data-cotinder-feed-tab="comunity"] .index__posts > .index__post.index__post_curator-advice > .card.card__advice,
    .tabs__content[data-target="nko"] .index__posts > .index__post.index__post_curator-advice > .card.card__advice,
    .cotinder-index-feed[data-cotinder-feed-tab="nko"] .index__posts > .index__post.index__post_curator-advice > .card.card__advice,
    .pet .pet-detail-page .index__posts > .index__post.index__post_curator-advice > .card.card__advice,
    .pet .tabs__content_pet .index__posts > .index__post.index__post_curator-advice > .card.card__advice {
        --advice-card-min-h: 0 !important;
        height: 100% !important;
        min-height: 0 !important;
        flex: 1 1 auto !important;
        align-self: stretch !important;
    }

    /* Level badge: bottom of photo, readable plaque */
    .card-img-wrap > .cotinder-level-badge,
    .pet__top_image > .cotinder-level-badge {
        top: auto !important;
        bottom: 10px !important;
        left: 10px !important;
        right: auto !important;
        margin: 0 !important;
        max-width: calc(100% - 20px) !important;
        padding: 5px 10px 5px 7px !important;
        font-size: 11px !important;
        line-height: 1.25 !important;
        color: #fff !important;
        background: rgba(18, 22, 28, 0.78) !important;
        border: 1px solid rgba(255, 255, 255, 0.22) !important;
        border-radius: 999px !important;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.28) !important;
        -webkit-backdrop-filter: blur(6px) !important;
        backdrop-filter: blur(6px) !important;
    }

    /*
     * «Ищет дом» sits above bottom-left (tablet ~68px); level stays on the edge
     * under the icon — no horizontal shove needed when bottoms differ.
     */
    .card-img-wrap:has(> .pet-photo-badge_search-home) > .cotinder-level-badge,
    .pet__top_image:has(> .pet-photo-badge_search-home) > .cotinder-level-badge {
        z-index: 3 !important;
    }

    .card-img-wrap .pet-photo-badge_search-home,
    .pet__top_image .pet-photo-badge_search-home,
    .pet-item__top .pet-photo-badge_search-home--list {
        top: auto !important;
        bottom: 68px !important;
        left: 8px !important;
        z-index: 4 !important;
        max-width: 64px !important;
    }

    .pet__top_image .pet-photo-badge_search-home {
        left: 12px !important;
        max-width: 96px !important;
        z-index: 5 !important; /* above pet-detail stars strip (z-index 4) */
    }

    .pet-item__top .pet-photo-badge_search-home--list {
        left: 10px !important;
        max-width: 64px !important;
    }

    .card-img-wrap > .cotinder-level-badge.cotinder-level-badge--champ,
    .card-img-wrap > .cotinder-level-badge.cotinder-level-badge--legend,
    .card-img-wrap > .cotinder-level-badge.cotinder-level-badge--pack,
    .card-img-wrap > .cotinder-level-badge.cotinder-level-badge--icon,
    .pet__top_image > .cotinder-level-badge.cotinder-level-badge--champ,
    .pet__top_image > .cotinder-level-badge.cotinder-level-badge--legend,
    .pet__top_image > .cotinder-level-badge.cotinder-level-badge--pack,
    .pet__top_image > .cotinder-level-badge.cotinder-level-badge--icon {
        background: rgba(18, 22, 28, 0.82) !important;
        border-color: rgba(255, 193, 7, 0.45) !important;
    }

    .card-img-wrap > .cotinder-level-badge .cotinder-level-badge__lvl,
    .pet__top_image > .cotinder-level-badge .cotinder-level-badge__lvl {
        color: #ffb86c !important;
    }

    .card-img-wrap > .cotinder-level-badge .cotinder-level-badge__name,
    .pet__top_image > .cotinder-level-badge .cotinder-level-badge__name {
        color: rgba(255, 255, 255, 0.92) !important;
    }

    /* Feed + «Другие питомцы»: stars left, hearts/actions right — no overlap */
    .index__post .card.user-slide:not(.index__events_event):not(.index__events_article):not(.index__collaborations_card) > .card-stars__wrapper,
    .index__post .user-slide.index__community-card > .card-stars__wrapper,
    .profiles-flex__item .card-stars__wrapper,
    .another-pet .user-slide > .card-stars__wrapper,
    html.cotinder-in-pwa .index__post .card.user-slide:not(.index__events_event):not(.index__events_article):not(.index__collaborations_card) > .card-stars__wrapper,
    html.cotinder-in-pwa .index__post .user-slide.index__community-card > .card-stars__wrapper,
    html.cotinder-in-pwa .profiles-flex__item .card-stars__wrapper,
    html.cotinder-in-pwa .another-pet .user-slide > .card-stars__wrapper {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 8px !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        position: relative !important;
        left: auto !important;
        right: auto !important;
        top: auto !important;
        bottom: auto !important;
        max-height: none !important;
        height: auto !important;
        min-height: 28px !important;
        overflow: visible !important;
        padding: 4px 0 !important;
    }

    .index__post .card.user-slide .card-stars__wrapper > .cotinder-level-badge,
    .profiles-flex__item .card-stars__wrapper > .cotinder-level-badge,
    .another-pet .user-slide > .card-stars__wrapper > .cotinder-level-badge {
        display: none !important;
    }

    .index__post .card.user-slide .card-stars__wrapper > .entity-star-rating,
    .index__post .user-slide.index__community-card .card-stars__wrapper > .entity-star-rating,
    .profiles-flex__item .card-stars__wrapper > .entity-star-rating,
    .another-pet .user-slide > .card-stars__wrapper > .entity-star-rating,
    .index__post .card.user-slide .card-stars__wrapper > .card-stars,
    .index__post .user-slide.index__community-card .card-stars__wrapper > .card-stars,
    .profiles-flex__item .card-stars__wrapper > .card-stars,
    .another-pet .user-slide > .card-stars__wrapper > .card-stars,
    html.cotinder-in-pwa .index__post .card.user-slide .card-stars__wrapper > .entity-star-rating,
    html.cotinder-in-pwa .profiles-flex__item .card-stars__wrapper > .entity-star-rating,
    html.cotinder-in-pwa .another-pet .user-slide > .card-stars__wrapper > .entity-star-rating,
    html.cotinder-in-pwa .index__post .card.user-slide .card-stars__wrapper > .card-stars,
    html.cotinder-in-pwa .profiles-flex__item .card-stars__wrapper > .card-stars,
    html.cotinder-in-pwa .another-pet .user-slide > .card-stars__wrapper > .card-stars {
        flex: 0 1 auto !important;
        order: 1 !important;
        max-width: calc(100% - 110px) !important;
        min-width: 0 !important;
        overflow: hidden !important;
        margin: 0 !important;
        display: flex !important;
        flex-wrap: nowrap !important;
    }

    .index__post .card.user-slide .card-stars__wrapper > .entity-star-rating .star,
    .index__post .user-slide.index__community-card .card-stars__wrapper > .entity-star-rating .star,
    .profiles-flex__item .card-stars__wrapper > .entity-star-rating .star,
    .another-pet .user-slide > .card-stars__wrapper > .entity-star-rating .star,
    html.cotinder-in-pwa .index__post .card.user-slide .card-stars__wrapper > .entity-star-rating .star,
    html.cotinder-in-pwa .profiles-flex__item .card-stars__wrapper > .entity-star-rating .star,
    html.cotinder-in-pwa .another-pet .user-slide > .card-stars__wrapper > .entity-star-rating .star {
        flex: 0 0 auto !important;
        flex-shrink: 0 !important;
    }

    .index__post .card.user-slide .card-stars__wrapper > .card__buttons,
    .index__post .user-slide.index__community-card .card-stars__wrapper > .card__buttons,
    .profiles-flex__item .card-stars__wrapper > .card__buttons,
    .another-pet .user-slide > .card-stars__wrapper > .card__buttons,
    html.cotinder-in-pwa .index__post .card.user-slide .card-stars__wrapper > .card__buttons,
    html.cotinder-in-pwa .index__post .user-slide.index__community-card .card-stars__wrapper > .card__buttons,
    html.cotinder-in-pwa .profiles-flex__item .card-stars__wrapper > .card__buttons,
    html.cotinder-in-pwa .another-pet .user-slide > .card-stars__wrapper > .card__buttons {
        flex: 0 0 auto !important;
        order: 2 !important;
        flex-shrink: 0 !important;
        margin-left: auto !important;
        position: static !important;
        display: inline-flex !important;
        gap: 6px !important;
        z-index: 2 !important;
    }
}

@media (max-width: 480px) {
    /* Narrow phones: shrink like/comment/share so stars stay visible */
    .index__post .card.user-slide .card-stars__wrapper > .card__buttons .icon,
    .index__post .user-slide.index__community-card .card-stars__wrapper > .card__buttons .icon,
    .profiles-flex__item .card-stars__wrapper > .card__buttons .icon,
    .another-pet .user-slide > .card-stars__wrapper > .card__buttons .icon,
    .index__post .card.user-slide .card-stars__wrapper > .card__buttons svg,
    .index__post .user-slide.index__community-card .card-stars__wrapper > .card__buttons svg,
    .profiles-flex__item .card-stars__wrapper > .card__buttons svg,
    .another-pet .user-slide > .card-stars__wrapper > .card__buttons svg,
    .index__post .card.user-slide .card-stars__wrapper .card__action svg,
    .index__post .user-slide.index__community-card .card-stars__wrapper .card__action svg,
    .profiles-flex__item .card-stars__wrapper .card__action svg,
    .another-pet .user-slide > .card-stars__wrapper .card__action svg,
    html.cotinder-in-pwa .index__post .card.user-slide .card-stars__wrapper > .card__buttons .icon,
    html.cotinder-in-pwa .index__post .user-slide.index__community-card .card-stars__wrapper > .card__buttons .icon,
    html.cotinder-in-pwa .profiles-flex__item .card-stars__wrapper > .card__buttons .icon,
    html.cotinder-in-pwa .another-pet .user-slide > .card-stars__wrapper > .card__buttons .icon,
    html.cotinder-in-pwa .index__post .card.user-slide .card-stars__wrapper > .card__buttons svg,
    html.cotinder-in-pwa .index__post .user-slide.index__community-card .card-stars__wrapper > .card__buttons svg,
    html.cotinder-in-pwa .profiles-flex__item .card-stars__wrapper > .card__buttons svg,
    html.cotinder-in-pwa .another-pet .user-slide > .card-stars__wrapper > .card__buttons svg,
    html.cotinder-in-pwa .index__post .card.user-slide .card-stars__wrapper .card__action svg,
    html.cotinder-in-pwa .profiles-flex__item .card-stars__wrapper .card__action svg,
    html.cotinder-in-pwa .another-pet .user-slide > .card-stars__wrapper .card__action svg {
        width: 16px !important;
        height: 16px !important;
    }

    .index__post .card.user-slide .card-stars__wrapper > .card__buttons,
    .index__post .user-slide.index__community-card .card-stars__wrapper > .card__buttons,
    .profiles-flex__item .card-stars__wrapper > .card__buttons,
    .another-pet .user-slide > .card-stars__wrapper > .card__buttons,
    html.cotinder-in-pwa .index__post .card.user-slide .card-stars__wrapper > .card__buttons,
    html.cotinder-in-pwa .index__post .user-slide.index__community-card .card-stars__wrapper > .card__buttons,
    html.cotinder-in-pwa .profiles-flex__item .card-stars__wrapper > .card__buttons,
    html.cotinder-in-pwa .another-pet .user-slide > .card-stars__wrapper > .card__buttons {
        gap: 4px !important;
        transform: scale(0.85);
        transform-origin: right center;
    }

    .index__post .card.user-slide .card-stars__wrapper > .entity-star-rating .star svg,
    .index__post .user-slide.index__community-card .card-stars__wrapper > .entity-star-rating .star svg,
    .profiles-flex__item .card-stars__wrapper > .entity-star-rating .star svg,
    .another-pet .user-slide > .card-stars__wrapper > .entity-star-rating .star svg,
    .index__post .card.user-slide .card-stars__wrapper > .card-stars .star svg,
    .index__post .user-slide.index__community-card .card-stars__wrapper > .card-stars .star svg,
    .profiles-flex__item .card-stars__wrapper > .card-stars .star svg,
    .another-pet .user-slide > .card-stars__wrapper > .card-stars .star svg,
    html.cotinder-in-pwa .index__post .card.user-slide .card-stars__wrapper > .entity-star-rating .star svg,
    html.cotinder-in-pwa .profiles-flex__item .card-stars__wrapper > .entity-star-rating .star svg,
    html.cotinder-in-pwa .another-pet .user-slide > .card-stars__wrapper > .entity-star-rating .star svg,
    html.cotinder-in-pwa .index__post .card.user-slide .card-stars__wrapper > .card-stars .star svg,
    html.cotinder-in-pwa .profiles-flex__item .card-stars__wrapper > .card-stars .star svg,
    html.cotinder-in-pwa .another-pet .user-slide > .card-stars__wrapper > .card-stars .star svg {
        width: 16px !important;
        height: 15px !important;
    }

    .index__post .card.user-slide .card-stars__wrapper > .entity-star-rating,
    .index__post .user-slide.index__community-card .card-stars__wrapper > .entity-star-rating,
    .profiles-flex__item .card-stars__wrapper > .entity-star-rating,
    .another-pet .user-slide > .card-stars__wrapper > .entity-star-rating,
    .index__post .card.user-slide .card-stars__wrapper > .card-stars,
    .index__post .user-slide.index__community-card .card-stars__wrapper > .card-stars,
    .profiles-flex__item .card-stars__wrapper > .card-stars,
    .another-pet .user-slide > .card-stars__wrapper > .card-stars,
    html.cotinder-in-pwa .index__post .card.user-slide .card-stars__wrapper > .entity-star-rating,
    html.cotinder-in-pwa .profiles-flex__item .card-stars__wrapper > .entity-star-rating,
    html.cotinder-in-pwa .another-pet .user-slide > .card-stars__wrapper > .entity-star-rating,
    html.cotinder-in-pwa .index__post .card.user-slide .card-stars__wrapper > .card-stars,
    html.cotinder-in-pwa .profiles-flex__item .card-stars__wrapper > .card-stars,
    html.cotinder-in-pwa .another-pet .user-slide > .card-stars__wrapper > .card-stars {
        max-width: calc(100% - 78px) !important;
    }

    /* ≤480px: two-row stack — stars full width, buttons on row 2 (no overlap) */
    .index__post .card.user-slide:not(.index__events_event):not(.index__events_article):not(.index__collaborations_card) > .card-stars__wrapper,
    .index__post .user-slide.index__community-card > .card-stars__wrapper,
    .profiles-flex__item .card-stars__wrapper,
    .another-pet .user-slide > .card-stars__wrapper,
    html.cotinder-in-pwa .index__post .card.user-slide:not(.index__events_event):not(.index__events_article):not(.index__collaborations_card) > .card-stars__wrapper,
    html.cotinder-in-pwa .index__post .user-slide.index__community-card > .card-stars__wrapper,
    html.cotinder-in-pwa .profiles-flex__item .card-stars__wrapper,
    html.cotinder-in-pwa .another-pet .user-slide > .card-stars__wrapper {
        flex-wrap: wrap !important;
        row-gap: 6px !important;
    }

    .index__post .card.user-slide .card-stars__wrapper > .entity-star-rating,
    .index__post .user-slide.index__community-card .card-stars__wrapper > .entity-star-rating,
    .profiles-flex__item .card-stars__wrapper > .entity-star-rating,
    .another-pet .user-slide > .card-stars__wrapper > .entity-star-rating,
    .index__post .card.user-slide .card-stars__wrapper > .card-stars,
    .index__post .user-slide.index__community-card .card-stars__wrapper > .card-stars,
    .profiles-flex__item .card-stars__wrapper > .card-stars,
    .another-pet .user-slide > .card-stars__wrapper > .card-stars,
    html.cotinder-in-pwa .index__post .card.user-slide .card-stars__wrapper > .entity-star-rating,
    html.cotinder-in-pwa .profiles-flex__item .card-stars__wrapper > .entity-star-rating,
    html.cotinder-in-pwa .another-pet .user-slide > .card-stars__wrapper > .entity-star-rating,
    html.cotinder-in-pwa .index__post .card.user-slide .card-stars__wrapper > .card-stars,
    html.cotinder-in-pwa .profiles-flex__item .card-stars__wrapper > .card-stars,
    html.cotinder-in-pwa .another-pet .user-slide > .card-stars__wrapper > .card-stars {
        flex: 1 1 100% !important;
        max-width: 100% !important;
        order: 1 !important;
        overflow: visible !important;
    }

    .index__post .card.user-slide .card-stars__wrapper > .card__buttons,
    .index__post .user-slide.index__community-card .card-stars__wrapper > .card__buttons,
    .profiles-flex__item .card-stars__wrapper > .card__buttons,
    .another-pet .user-slide > .card-stars__wrapper > .card__buttons,
    html.cotinder-in-pwa .index__post .card.user-slide .card-stars__wrapper > .card__buttons,
    html.cotinder-in-pwa .index__post .user-slide.index__community-card .card-stars__wrapper > .card__buttons,
    html.cotinder-in-pwa .profiles-flex__item .card-stars__wrapper > .card__buttons,
    html.cotinder-in-pwa .another-pet .user-slide > .card-stars__wrapper > .card__buttons {
        flex: 1 1 100% !important;
        justify-content: flex-end !important;
        margin-left: 0 !important;
        order: 2 !important;
        transform: none !important;
    }
}

/*
 * Pet + owner detail hero — FULL-BLEED square photo is PHONE ONLY (≤767.98).
 * Culprit was the same rules at max-width:1199.98: width/max-width:100% +
 * max-height:none + aspect-ratio:1/1 → photo ≈ viewport-wide square on
 * 768×1024 / 820×1180. Tablet keeps the ≤1440 / 1024 ladder (284px) below.
 */
@media (max-width: 767.98px) {
    .pet .pet__top .pet__top_media {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        gap: 0 !important;
    }

    .pet .pet__top .pet__top_image,
    .pet .pet__top .pet__top_media > .pet__top_image {
        position: relative !important;
        display: block !important;
        width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
    }

    /* Match owners: square cover crop (override global img{height:100%}) */
    .pet .pet__top .pet__top_image > img:not(.pet-photo-badge_search-home),
    .pet .pet__top .pet__top_media > .pet__top_image > img:not(.pet-photo-badge_search-home) {
        display: block !important;
        width: 100% !important;
        height: auto !important;
        max-height: none !important;
        aspect-ratio: 1 / 1 !important;
        object-fit: cover !important;
        object-position: center !important;
        margin: 0 !important;
        padding: 0 !important;
        vertical-align: top !important;
    }

    .pet .pet__top .pet__top_image > .card-stars__wrapper {
        position: absolute !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        top: auto !important;
        margin: 0 !important;
        padding: 8px 10px !important;
        z-index: 4 !important;
        box-sizing: border-box !important;
        background: linear-gradient(transparent, rgba(0, 0, 0, 0.45)) !important;
        font-size: 14px !important;
        line-height: normal !important;
    }

    .pet .pet__top .pet__top_image > .card-stars__wrapper .text-gray,
    .pet .pet__top .pet__top_image > .card-stars__wrapper .entity-star-rating__avg {
        color: rgba(255, 255, 255, 0.95) !important;
    }

    .pet .pet__top .pet__top_image > .card-stars__wrapper .card__buttons {
        margin-left: auto !important;
        background: rgba(255, 255, 255, 0.94) !important;
        border-radius: 999px !important;
        padding: 6px 12px !important;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15) !important;
    }

    .pet .pet__top .pet__top_media > .pet-engage-strip {
        margin-top: 8px !important;
        margin-bottom: 0 !important;
    }
}

/*
 * Tablet 768–1199.98 (768×1024, 820×1180, 1024×1366): lock pet + profile
 * DETAIL hero to the ≤1440 / 1024 photo size (284×284). Phone/PC untouched.
 */
@media (min-width: 768px) and (max-width: 1199.98px) {
    .pet .pet-detail-page .pet__top .pet__top_media,
    .pet .profile-detail-page .pet__top > .pet__top_image {
        flex: 0 0 284px !important;
        flex-basis: 284px !important;
        width: 284px !important;
        max-width: 284px !important;
        min-width: 0 !important;
        height: auto !important;
        min-height: 0 !important;
        align-self: flex-start !important;
    }

    .pet .pet-detail-page .pet__top .pet__top_media > .pet__top_image {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
    }

    .pet .pet-detail-page .pet__top .pet__top_image > img:not(.pet-photo-badge_search-home),
    .pet .profile-detail-page .pet__top > .pet__top_image > img:not(.pet-photo-badge_search-home) {
        display: block !important;
        width: 100% !important;
        height: auto !important;
        max-height: 284px !important;
        aspect-ratio: 1 / 1 !important;
        object-fit: cover !important;
        object-position: center !important;
    }
}

/* Narrow phones — softer lift so icon doesn’t sit mid-photo */
@media (max-width: 767.98px) {
    .card-img-wrap .pet-photo-badge_search-home,
    .pet__top_image .pet-photo-badge_search-home,
    .pet-item__top .pet-photo-badge_search-home--list {
        bottom: 56px !important;
    }

    /*
     * Pet + owner detail hero void (mobile column only).
     * Root cause: .pet__top_media / .pet__top > .pet__top_image use flex: 0 1 527px
     * for desktop ROW width. When .pet__top becomes flex-direction:column (≤767.98),
     * that 527px flex-basis becomes HEIGHT → empty space under photo (owners) or
     * under .pet-engage-strip before .pet__top_description (pets).
     * Templates: pets = .pet-detail-page + .pet__top_media; owners = .profile-detail-page
     * + direct .pet__top_image (no .pet__top_media).
     */
    .pet .pet-detail-page .pet__top,
    .pet .profile-detail-page .pet__top {
        gap: 10px !important;
    }

    .pet .pet-detail-page .pet__top .pet__top_media,
    .pet .profile-detail-page .pet__top > .pet__top_image,
    .pet .pet-detail-page .pet__top .pet__top_media > .pet__top_image {
        flex: 0 0 auto !important;
        flex-basis: auto !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        align-self: stretch !important;
    }

    .pet .pet-detail-page .pet__top .pet__top_image,
    .pet .profile-detail-page .pet__top > .pet__top_image {
        padding-bottom: 0 !important;
        margin-bottom: 0 !important;
    }

    .pet .pet-detail-page .pet__top .pet__top_image > img:not(.pet-photo-badge_search-home),
    .pet .profile-detail-page .pet__top > .pet__top_image > img:not(.pet-photo-badge_search-home) {
        margin-bottom: 0 !important;
    }

    .pet .pet-detail-page .pet__top .pet__top_media > .pet-engage-strip {
        margin-top: 8px !important;
        margin-bottom: 0 !important;
    }

    .pet .pet-detail-page .pet__top .pet__top_description,
    .pet .profile-detail-page .pet__top .pet__top_description,
    .pet .pet-detail-page .pet__top .pet__top_description > .info,
    .pet .profile-detail-page .pet__top .pet__top_description > .info {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }

    /*
     * Event detail hero void (mobile column only).
     * Same flex: 0 1 527px → height bug as pets/owners.
     * Template: local/include/event_detail_page.php → .event-detail-page
     * (direct .pet__top > .pet__top_image, no .pet__top_media).
     * :not(.article-detail-page):not(.collaboration-detail-page) keeps
     * articles/collaborations that reuse event-detail-page classes untouched.
     */
    .pet .event-detail-page:not(.article-detail-page):not(.collaboration-detail-page) .pet__top {
        gap: 10px !important;
    }

    .pet .event-detail-page:not(.article-detail-page):not(.collaboration-detail-page) .pet__top > .pet__top_image {
        flex: 0 0 auto !important;
        flex-basis: auto !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        align-self: stretch !important;
        padding-bottom: 0 !important;
        margin-bottom: 0 !important;
    }

    .pet .event-detail-page:not(.article-detail-page):not(.collaboration-detail-page) .pet__top > .pet__top_image > img:not(.pet-photo-badge_search-home) {
        margin-bottom: 0 !important;
    }

    .pet .event-detail-page:not(.article-detail-page):not(.collaboration-detail-page) .pet__top .pet__top_description,
    .pet .event-detail-page:not(.article-detail-page):not(.collaboration-detail-page) .pet__top .pet__top_description > .info {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }

    /*
     * Collaboration detail hero void (mobile column only).
     * Same flex: 0 1 527px → height bug as events/pets/owners.
     * Own rules — event block excludes .collaboration-detail-page.
     */
    .pet .collaboration-detail-page .pet__top {
        gap: 10px !important;
    }

    .pet .collaboration-detail-page .pet__top > .pet__top_image {
        flex: 0 0 auto !important;
        flex-basis: auto !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        align-self: stretch !important;
        padding-bottom: 0 !important;
        margin-bottom: 0 !important;
    }

    .pet .collaboration-detail-page .pet__top > .pet__top_image > img:not(.pet-photo-badge_search-home) {
        margin-bottom: 0 !important;
    }

    .pet .collaboration-detail-page .pet__top .pet__top_description,
    .pet .collaboration-detail-page .pet__top .pet__top_description > .info {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }
}

/**
 * Event detail title wrap (phone only).
 * Long names overflow past viewport because sidebar sets
 * .mobile-filter .tabs__content_title { white-space: nowrap }.
 * Scoped to real events only — articles/collaborations untouched.
 */
@media (max-width: 767.98px) {
    .pet .event-detail-page:not(.article-detail-page):not(.collaboration-detail-page) .mobile-filter .pat__name,
    .pet .event-detail-page:not(.article-detail-page):not(.collaboration-detail-page) .pet__top_description .pat__name,
    .pet .event-detail-page:not(.article-detail-page):not(.collaboration-detail-page) .event-detail-page__head {
        min-width: 0 !important;
        max-width: 100% !important;
        flex: 1 1 auto !important;
    }

    .pet .event-detail-page:not(.article-detail-page):not(.collaboration-detail-page) .mobile-filter .pat__name .tabs__content_title,
    .pet .event-detail-page:not(.article-detail-page):not(.collaboration-detail-page) .pet__top_description .tabs__content_title,
    .pet .event-detail-page:not(.article-detail-page):not(.collaboration-detail-page) .event-detail-page__head .tabs__content_title {
        min-width: 0 !important;
        max-width: 100% !important;
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: unset !important;
        overflow-wrap: anywhere !important;
        word-break: break-word !important;
        hyphens: auto !important;
    }
}

/**
 * Collaboration detail title wrap (phone only).
 * Own rules — event block excludes .collaboration-detail-page.
 */
@media (max-width: 767.98px) {
    .pet .collaboration-detail-page .mobile-filter .pat__name,
    .pet .collaboration-detail-page .pet__top_description .pat__name,
    .pet .collaboration-detail-page .event-detail-page__head {
        min-width: 0 !important;
        max-width: 100% !important;
        flex: 1 1 auto !important;
    }

    .pet .collaboration-detail-page .mobile-filter .pat__name .tabs__content_title,
    .pet .collaboration-detail-page .pet__top_description .tabs__content_title,
    .pet .collaboration-detail-page .event-detail-page__head .tabs__content_title {
        min-width: 0 !important;
        max-width: 100% !important;
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: unset !important;
        overflow-wrap: anywhere !important;
        word-break: break-word !important;
        hyphens: auto !important;
    }
}

/*
 * Phone ≤700 (2-col): stretch + min-height:0 (match tablet). Must stay ABOVE
 * the ≤480 block — that floor overrides this for 1-col. Desktop ≥1200 untouched.
 */
@media (max-width: 700px) {
    .index__posts > .index__post.index__post_curator-advice,
    .tabs__content[data-target="canals"] .index__posts > .index__post.index__post_curator-advice,
    .cotinder-index-feed[data-cotinder-feed-tab="canals"] .index__posts > .index__post.index__post_curator-advice,
    .tabs__content[data-target="last"] .index__posts > .index__post.index__post_curator-advice,
    .cotinder-index-feed[data-cotinder-feed-tab="last"] .index__posts > .index__post.index__post_curator-advice,
    .tabs__content[data-target="comunity"] .index__posts > .index__post.index__post_curator-advice,
    .cotinder-index-feed[data-cotinder-feed-tab="comunity"] .index__posts > .index__post.index__post_curator-advice,
    .tabs__content[data-target="nko"] .index__posts > .index__post.index__post_curator-advice,
    .cotinder-index-feed[data-cotinder-feed-tab="nko"] .index__posts > .index__post.index__post_curator-advice,
    .pet .pet-detail-page .index__posts > .index__post.index__post_curator-advice,
    .pet .tabs__content_pet .index__posts > .index__post.index__post_curator-advice {
        align-self: stretch !important;
        display: flex !important;
        flex-direction: column !important;
    }

    .index__posts > .index__post.index__post_curator-advice > .card.card__advice,
    .tabs__content[data-target="canals"] .index__posts > .index__post.index__post_curator-advice > .card.card__advice,
    .cotinder-index-feed[data-cotinder-feed-tab="canals"] .index__posts > .index__post.index__post_curator-advice > .card.card__advice,
    .tabs__content[data-target="last"] .index__posts > .index__post.index__post_curator-advice > .card.card__advice,
    .cotinder-index-feed[data-cotinder-feed-tab="last"] .index__posts > .index__post.index__post_curator-advice > .card.card__advice,
    .tabs__content[data-target="comunity"] .index__posts > .index__post.index__post_curator-advice > .card.card__advice,
    .cotinder-index-feed[data-cotinder-feed-tab="comunity"] .index__posts > .index__post.index__post_curator-advice > .card.card__advice,
    .tabs__content[data-target="nko"] .index__posts > .index__post.index__post_curator-advice > .card.card__advice,
    .cotinder-index-feed[data-cotinder-feed-tab="nko"] .index__posts > .index__post.index__post_curator-advice > .card.card__advice,
    .pet .pet-detail-page .index__posts > .index__post.index__post_curator-advice > .card.card__advice,
    .pet .tabs__content_pet .index__posts > .index__post.index__post_curator-advice > .card.card__advice {
        --advice-card-min-h: 0 !important;
        height: 100% !important;
        min-height: 0 !important;
        flex: 1 1 auto !important;
        align-self: stretch !important;
    }
}

/*
 * Phone ≤480 (1-col): stretch alone collapses — parent height is content.
 * Match sibling .card { height: 524px } ladder so advice is not shorter.
 */
@media (max-width: 480px) {
    .index__posts > .index__post.index__post_curator-advice,
    .tabs__content[data-target="canals"] .index__posts > .index__post.index__post_curator-advice,
    .cotinder-index-feed[data-cotinder-feed-tab="canals"] .index__posts > .index__post.index__post_curator-advice,
    .tabs__content[data-target="last"] .index__posts > .index__post.index__post_curator-advice,
    .cotinder-index-feed[data-cotinder-feed-tab="last"] .index__posts > .index__post.index__post_curator-advice,
    .tabs__content[data-target="comunity"] .index__posts > .index__post.index__post_curator-advice,
    .cotinder-index-feed[data-cotinder-feed-tab="comunity"] .index__posts > .index__post.index__post_curator-advice,
    .tabs__content[data-target="nko"] .index__posts > .index__post.index__post_curator-advice,
    .cotinder-index-feed[data-cotinder-feed-tab="nko"] .index__posts > .index__post.index__post_curator-advice,
    .pet .pet-detail-page .index__posts > .index__post.index__post_curator-advice,
    .pet .tabs__content_pet .index__posts > .index__post.index__post_curator-advice {
        align-self: stretch !important;
        display: flex !important;
        flex-direction: column !important;
    }

    .index__posts > .index__post.index__post_curator-advice > .card.card__advice,
    .tabs__content[data-target="canals"] .index__posts > .index__post.index__post_curator-advice > .card.card__advice,
    .cotinder-index-feed[data-cotinder-feed-tab="canals"] .index__posts > .index__post.index__post_curator-advice > .card.card__advice,
    .tabs__content[data-target="last"] .index__posts > .index__post.index__post_curator-advice > .card.card__advice,
    .cotinder-index-feed[data-cotinder-feed-tab="last"] .index__posts > .index__post.index__post_curator-advice > .card.card__advice,
    .tabs__content[data-target="comunity"] .index__posts > .index__post.index__post_curator-advice > .card.card__advice,
    .cotinder-index-feed[data-cotinder-feed-tab="comunity"] .index__posts > .index__post.index__post_curator-advice > .card.card__advice,
    .tabs__content[data-target="nko"] .index__posts > .index__post.index__post_curator-advice > .card.card__advice,
    .cotinder-index-feed[data-cotinder-feed-tab="nko"] .index__posts > .index__post.index__post_curator-advice > .card.card__advice,
    .pet .pet-detail-page .index__posts > .index__post.index__post_curator-advice > .card.card__advice,
    .pet .tabs__content_pet .index__posts > .index__post.index__post_curator-advice > .card.card__advice {
        --advice-card-min-h: 524px !important;
        height: 100% !important;
        min-height: 524px !important;
        flex: 1 1 auto !important;
        align-self: stretch !important;
    }
}

/**
 * /search-map/ phone cards: fit viewport (mapcard20260806b).
 * Desktop/tablet ≥768 untouched. Scoped to .js-search-map-page / #search-map-cards.
 */
@media (max-width: 767.98px) {
    .js-search-map-page #search-map-cards,
    .js-search-map-page .js-search-map-cards {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }

    .js-search-map-page .js-search-map-cards {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 12px;
    }

    .js-search-map-page #search-map-cards > *,
    .js-search-map-page .js-search-map-cards .search-map-card,
    .js-search-map-page .js-search-map-cards .js-search-map-card {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }
}

/*
 * Tablet band 768–1199.98 (768×1024, 820×1180, 1024×1366):
 * Lock pet + profile cards to the ≤1440 / 1024 ladder.
 * Phone ≤767.98 and PC ≥1200 untouched. Canals packing + advice stretch above stay.
 */
@media (min-width: 768px) and (max-width: 1199.98px) {
    .index__posts {
        gap: 15px;
    }

    .index__post {
        width: calc((100% - 30px) / 3);
    }

    .index__post_full {
        width: 100%;
    }

    /* Feed-only — never paint #post / detail / arena via bare .card */
    .index__post .card-img {
        height: 243px !important;
    }

    .index__post .card__video > .card__media-wrap {
        min-height: 0 !important;
        height: auto !important;
        aspect-ratio: 3 / 4 !important;
        flex: 0 0 auto !important;
        background: #F2F2F2 !important;
    }

    .card-likes {
        font-weight: 400;
        font-size: 14px !important;
        line-height: 17px !important;
    }

    .card-desc {
        font-weight: 400;
        font-size: 14px !important;
        line-height: 17px !important;
    }

    /*
     * Scoped to feed .index__post only.
     * Broad .card:not(.card__advice) { height:446 !important; padding:5px }
     * leaked onto #post modal + forced padding strip above media.
     * Exclude event/article/collab/community — left-rail cards must stay
     * content-height (446 lock left a large void above stars/bottom).
     */
    .index__post > .card:not(.card__advice):not(.card__video):not(#post):not(.index__events_event):not(.index__events_article):not(.index__collaborations_card):not(.index__community-card) {
        height: 446px !important;
        padding: 5px;
        padding-top: 0 !important;
    }

    .index__post .card.user-slide:not(.index__events_event):not(.index__events_article):not(.index__collaborations_card):not(.index__community-card):not(.card__video) {
        height: auto !important;
        min-height: 446px !important;
        padding-top: 0 !important;
    }

    /*
     * collabcardgap20260807a — tablet only.
     * Culprit: previous .index__post > .card { height:446 !important } hit
     * .index__collaborations_card (flex column) → empty gap between meta and
     * .card-stars__wrapper / .index__collaborations_bottom.
     * PC ≥1200 and phone ≤767.98 untouched. Borders/padding preserved.
     */
    .index__post > .card.index__collaborations_card,
    .index__post > .index__collaborations.index__collaborations_card,
    .collaborations-page-cards .index__collaborations_card {
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        flex: 0 0 auto !important;
        align-self: flex-start !important;
    }

    .index__post > .card.index__collaborations_card > .card-stars__wrapper,
    .index__post > .card.index__collaborations_card > .index__collaborations_bottom,
    .collaborations-page-cards .index__collaborations_card > .card-stars__wrapper,
    .collaborations-page-cards .index__collaborations_card > .index__collaborations_bottom {
        margin-top: 0 !important;
        flex-shrink: 0 !important;
    }

    .index__post .card.user-slide.card__video:not(.index__events_event):not(.index__events_article):not(.index__collaborations_card):not(.index__community-card) {
        padding: 0 !important;
        height: auto !important;
        min-height: 0 !important;
        background: #fff !important;
    }

    .index__post .card.user-slide:not(.index__events_event):not(.index__events_article):not(.index__collaborations_card):not(.index__community-card) > .card-desc,
    .index__post .card.user-slide:not(.index__events_event):not(.index__events_article):not(.index__collaborations_card):not(.index__community-card) > .card-likes {
        min-height: 17px;
    }

    .index__post .card.user-slide:not(.index__events_event):not(.index__events_article):not(.index__collaborations_card):not(.index__community-card) > .card-desc {
        min-height: 34px !important;
        max-height: 34px;
        -webkit-line-clamp: 2;
        line-height: 17px !important;
    }

    .index__post .card.user-slide:has(> .card-stars__wrapper .entity-star-rating[data-entity-type="pet"]):not(.index__events_event):not(.index__events_article):not(.index__collaborations_card):not(.index__community-card) > .card-desc,
    .another-pet .user-slide:has(> .card-stars__wrapper .entity-star-rating[data-entity-type="pet"]) > .card-desc {
        min-height: 51px !important;
        max-height: 51px !important;
        -webkit-line-clamp: 3;
    }

    .index__post .card.user-slide:not(.index__events_event):not(.index__events_article):not(.index__collaborations_card):not(.index__community-card) > .card-likes {
        -webkit-line-clamp: 2;
    }

    .index__post .user-slide.index__community-card > .card-likes,
    .index__post .user-slide.index__community-card > .card-desc {
        min-height: 17px !important;
        -webkit-line-clamp: 1;
    }

    .card.user-slide.card__video > .card-desc,
    .index__post .card.user-slide.card__video > .card-desc,
    .card__video > .card-desc {
        max-height: 36px !important;
        min-height: 34px !important;
        line-height: 17px !important;
    }

    .profiles-flex__item {
        width: calc((100% - 40px) / 3);
    }

    /* Canals pets stay content-sized (do not re-impose 446). */
    .tabs__content[data-target="canals"] .index__post > .card.user-slide:not(.index__events_event):not(.index__events_article):not(.index__collaborations_card):not(.index__community-card),
    .cotinder-index-feed[data-cotinder-feed-tab="canals"] .index__post > .card.user-slide:not(.index__events_event):not(.index__events_article):not(.index__collaborations_card):not(.index__community-card) {
        height: auto !important;
        min-height: 0 !important;
        flex: 0 0 auto !important;
        align-self: flex-start !important;
    }

    /* «Питомцы данного автора»: do not re-impose tablet .card { height: 446 }. */
    .another-pet .user-slide,
    .another-pet .card.user-slide,
    .another-pet .card:not(.card__advice) {
        height: auto !important;
        min-height: 0 !important;
        flex: 0 0 auto !important;
        align-self: flex-start !important;
    }

    .another-pet .user-slide > .card-desc {
        margin-top: 0 !important;
    }

    /*
     * /charge/ arena cards: tablet .card:not(.card__advice) { height: 446px !important }
     * + .card { overflow: hidden } stretches the card (empty bottom) and clips
     * .arena-card__delete below margin-top:auto CTA. Phone/PC and other pages untouched.
     */
    .index__posts.arena-page-cards {
        align-items: flex-start;
    }

    .index__posts.arena-page-cards .index__post {
        align-self: flex-start;
    }

    .index__posts.arena-page-cards .card.arena-card,
    .index__posts.arena-page-cards .card:not(.card__advice).arena-card {
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        flex: 0 0 auto !important;
        align-self: flex-start !important;
        overflow: visible;
    }

    /*
     * .delete-alert is “hidden” via transform:translateY(500px). That only works when
     * the card clips (overflow:hidden). Tablet sets overflow:visible so “Удалить батл”
     * is not clipped — without an explicit hide, the confirm markup leaks below the card.
     * Scope: arena cards only; open state still uses .delete-alert__active.
     */
    .index__posts.arena-page-cards .card.arena-card > .delete-alert:not(.delete-alert__active),
    .index__posts.arena-page-cards .card.arena-card > .cotinder-delete-alert:not(.delete-alert__active) {
        visibility: hidden;
        pointer-events: none;
    }

    .index__posts.arena-page-cards .card.arena-card > .delete-alert.delete-alert__active,
    .index__posts.arena-page-cards .card.arena-card > .cotinder-delete-alert.delete-alert__active {
        visibility: visible;
        pointer-events: auto;
        z-index: 5;
    }

    /* Restore full “Удалить батл” label (sidebar tablet compact hid text as ×). */
    .index__posts.arena-page-cards .arena-card__btn {
        grid-column: 1 / -1;
        width: 100%;
    }

    .index__posts.arena-page-cards .arena-card__delete {
        grid-column: 1 / -1;
        width: 100%;
        min-width: 0;
        min-height: 36px;
        margin-top: 4px;
        padding: 8px 6px;
        font-size: 14px;
        line-height: 1.2;
        box-sizing: border-box;
        justify-content: center;
    }

    .index__posts.arena-page-cards .arena-card__delete::after {
        content: none;
    }
}

/*
 * feedmediafix20260807a — FEED FIRST restore (loads last, wins tablet locks).
 * Culprits fixed above + here:
 *   - bare .card:not(.card__advice){padding:5px;height:446!important} → gap above media
 *   - flex-stretch / fixed min-height media → near-square video
 *   - dark letterbox under video → force #F2F2F2 / #fff
 * Detail photo 1/1 stays scoped to .pet-detail-page / .profile-detail-page only.
 */
/*
 * cardborder20260807a — restore feed card chrome.
 * Culprit was feedmediafix20260807a:
 *   .index__posts .card.user-slide… { border: none !important }
 * + media-wrap { border: none !important } which killed card outline.
 * Keep padding-top:0 (gap fix). Border matches events/collab: var(--border-color).
 */
.index__posts .card.user-slide:not(.card__advice):not(.index__events_event):not(.index__events_article):not(.index__collaborations_card):not(.index__community-card),
.index__posts .card.card__cotinder:not(.card__advice) {
    padding-top: 0 !important;
    border: 1px solid var(--border-color, #B9B9B9) !important;
}

.index__posts .card.user-slide.card__video:not(.card__advice) {
    padding: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    background: #fff !important;
    border: 1px solid var(--border-color, #B9B9B9) !important;
}

.index__posts .card .card-img-wrap,
.index__posts .card .card__media-wrap {
    margin-top: 0 !important;
    padding: 0 !important;
    padding-top: 0 !important;
}

.index__posts .card.card__video > .card__media-wrap,
.index__posts .card.card__video > .card-img-wrap,
.index__posts .card.card__video .card__media-wrap.card-img-wrap {
    aspect-ratio: 3 / 4 !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    flex: 0 0 auto !important;
    background: #F2F2F2 !important;
    border-radius: 0 !important;
    overflow: hidden !important;
}

.index__posts .card.card__video video,
.index__posts .card.card__video .bg-video,
.index__posts .card .card-img-wrap video,
.index__posts .card .card__media-wrap video {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: cover !important;
    object-position: center !important;
    background: #fff !important;
    aspect-ratio: auto !important; /* box is 3:4 on wrap; video fills it */
}

/**
 * arenatabletgap20260807a — tablet ONLY (768–1199.98), /charge/ arena cards ONLY.
 * Culprit: .index__post > .card:not(...):not(#post)... { height:446px !important }
 * beats earlier arena height:auto (ID specificity from :not(#post)).
 * Phone ≤767.98 / PC ≥1200 / feed/events/collab untouched. Global tablet locks untouched.
 */
@media (min-width: 768px) and (max-width: 1199.98px) {
    .index__posts.arena-page-cards .index__post > .card.arena-card:not(.card__advice):not(.card__video):not(#post):not(.index__events_event):not(.index__events_article):not(.index__collaborations_card):not(.index__community-card),
    .index__posts.arena-page-cards .card.arena-card:not(#post) {
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        flex: 0 0 auto !important;
        align-self: flex-start !important;
        overflow: visible;
    }

    .index__posts.arena-page-cards .card.arena-card > .arena-card__btn,
    .index__posts.arena-page-cards .card.arena-card .arena-card__btn {
        margin-top: 4px !important; /* kill margin-top:auto void inside fixed/tall flex */
    }

    .index__posts.arena-page-cards .card.arena-card > .delete-alert:not(.delete-alert__active),
    .index__posts.arena-page-cards .card.arena-card > .cotinder-delete-alert:not(.delete-alert__active) {
        visibility: hidden;
        pointer-events: none;
    }

    .index__posts.arena-page-cards .card.arena-card > .delete-alert.delete-alert__active,
    .index__posts.arena-page-cards .card.arena-card > .cotinder-delete-alert.delete-alert__active {
        visibility: visible;
        pointer-events: auto;
        z-index: 5;
    }

    .index__posts.arena-page-cards .arena-card__delete {
        grid-column: 1 / -1;
        width: 100%;
        min-width: 0;
        min-height: 36px;
        margin-top: 4px;
        padding: 8px 6px;
        font-size: 14px;
        line-height: 1.2;
        box-sizing: border-box;
        justify-content: center;
    }

    .index__posts.arena-page-cards .arena-card__delete::after {
        content: none;
    }
}

/*
 * Homepage «Хозяева питомцев» (.another-pet): equal card heights on tablet only
 * (homeanothertablet20260807a).
 * anotherpetgap sized ALL .another-pet to content ≤1199 — restore stretch only
 * on body.page-index. Pet-detail / profile-detail / phone (≤767.98) / PC (≥1200)
 * untouched.
 */
@media (min-width: 768px) and (max-width: 1199.98px) {
    body.page-index .another-pet__swiper .swiper-wrapper {
        align-items: stretch !important;
    }

    body.page-index .another-pet__swiper .swiper-slide {
        height: auto !important;
        align-self: stretch !important;
        display: flex !important;
    }

    body.page-index .another-pet .user-slide,
    body.page-index .another-pet .card.user-slide,
    body.page-index .another-pet .card:not(.card__advice) {
        height: 100% !important;
        min-height: 525px !important;
        flex: 1 1 auto !important;
        align-self: stretch !important;
    }

    body.page-index .another-pet .user-slide > .card-desc {
        margin-top: auto !important;
    }
}

/*
 * anotherpetwidth20260807a — narrow tablet ONLY (768×1024, 820×1180).
 * Cause: Swiper slidesPerView:3 from 576 → inline width ~193px in a tight container.
 * Force ~2-up slide width. Phone (≤767.98), ≥901 (incl. 1024×1366), PC (≥1200) untouched.
 */
@media (min-width: 768px) and (max-width: 900px) {
    .another-pet .another-pet__swiper .swiper-slide {
        width: calc((100% - 20px) / 2) !important;
    }
}

/*
 * petdeletetablet20260807a — /personal/pets/ tablet ONLY (768–1199.98).
 * Culprit (custom.css): .pet-delete { transform:translateY(-100px) } +
 * .pet-item__top { overflow:hidden } + hover-only reveal.
 * Phone ≤768 already restores via custom.css; PC ≥1200 keeps hover. Other pages untouched.
 */
@media (min-width: 768px) and (max-width: 1199.98px) {
    .pet-lists .pet-item__top .pet-delete {
        transform: none !important;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 40px;
        padding: 8px 14px;
        font-size: 14px !important;
        line-height: 1.2;
        width: auto;
        min-width: 0;
        background: rgba(255, 255, 255, 0.95);
        border-radius: 10px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
        z-index: 2;
    }
}

/*
 * vipoverlay20260807a — ROOT cause of gap ABOVE photo/video (feed + pet detail).
 * .cotinder-vip-badge--media must be position:absolute over media. Bitrix template
 * CSS cache was serving a bundle WITHOUT that rule → badge stayed in normal flow
 * (static/relative), pushing img/video down (~22px photo, full media-wrap on video).
 * Lives in this file (BODY_END, cache-busted) so it wins without waiting on composite.
 * Scope: media wrappers only. Events/collab/arena/personal-pets chrome untouched.
 */
.card-img-wrap,
.card__media-wrap,
.pet__top_image {
    position: relative;
}

.card-img-wrap > .cotinder-vip-badge--media,
.card__media-wrap > .cotinder-vip-badge--media,
.pet__top_image > .cotinder-vip-badge--media,
a.cotinder-vip-badge--media.cotinder-vip-badge--link {
    position: absolute !important;
    top: 8px !important;
    left: 8px !important;
    right: auto !important;
    bottom: auto !important;
    z-index: 3 !important;
    display: inline-flex !important;
    width: auto !important;
    height: auto !important;
    max-width: calc(100% - 16px) !important;
    margin: 0 !important;
    transform: none !important;
    pointer-events: auto;
}

.card-img-wrap:has(> .cotinder-boost-card__badge) > .cotinder-vip-badge--media,
.card__media-wrap:has(> .cotinder-boost-card__badge) > .cotinder-vip-badge--media,
.pet__top_image:has(> .cotinder-boost-card__badge) > .cotinder-vip-badge--media {
    top: 34px !important;
}

/* Media flush — kill residual card padding strip above first media child */
.index__posts .card.user-slide:not(.card__advice):not(.index__events_event):not(.index__events_article):not(.index__collaborations_card):not(.index__community-card),
.index__posts .card.user-slide.card__video:not(.card__advice) {
    padding-top: 0 !important;
}

.index__posts .card.user-slide:not(.card__advice):not(.index__events_event):not(.index__events_article):not(.index__collaborations_card):not(.index__community-card) > .card-img-wrap,
.index__posts .card.user-slide:not(.card__advice):not(.index__events_event):not(.index__events_article):not(.index__collaborations_card):not(.index__community-card) > .card__media-wrap,
.index__posts .card.user-slide.card__video > .card__media-wrap,
.index__posts .card.user-slide.card__video > .card-img-wrap {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

.pet .pet-detail-page .pet__top_image > img:not(.pet-photo-badge_search-home) {
    margin-top: 0 !important;
}

/*
 * petdescriptright20260807a — RIGHT BLOCK beside photo on /pets/{code}/.
 *
 * Culprit: `.pet__top_media` is the flex column (not direct `.pet__top_image`),
 * but Bitrix template CSS cache often serves a bundle WITHOUT the
 * `.pet__top_media { flex:0 1 527px; max-width; min-width:0 }` rules from
 * custom.css. Media then sizes as a block with width:100% / min-width:auto
 * from image content → squeezes or visually overlaps `.pet__top_description`.
 * Tablet 284px lock in this file helped 768–1199 only; PC/≤1440 still broke.
 *
 * Fix: restore hero ROW here (BODY_END, cache-busted). Scoped to
 * `.pet-detail-page` only — feed cards / events / collab / arena / personal
 * pets / owners untouched.
 */
.pet .pet-detail-page .pet__top {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: flex-start !important;
    gap: 20px;
}

.pet .pet-detail-page .pet__top > .pet__top_media {
    flex: 0 1 527px !important;
    flex-basis: 527px !important;
    width: auto !important;
    max-width: 527px !important;
    min-width: 0 !important;
    align-self: flex-start !important;
    box-sizing: border-box !important;
}

.pet .pet-detail-page .pet__top > .pet__top_description {
    flex: 1 1 0% !important;
    flex-basis: 0% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    position: relative !important;
    z-index: 1;
    box-sizing: border-box !important;
}

@media (max-width: 1660px) {
    .pet .pet-detail-page .pet__top > .pet__top_media {
        max-width: 430px !important;
        flex-basis: 430px !important;
    }
}

@media (max-width: 1440px) {
    .pet .pet-detail-page .pet__top > .pet__top_media {
        max-width: 284px !important;
        flex-basis: 284px !important;
    }
}

@media (min-width: 768px) and (max-width: 1199.98px) {
    .pet .pet-detail-page .pet__top > .pet__top_media {
        flex: 0 0 284px !important;
        flex-basis: 284px !important;
        width: 284px !important;
        max-width: 284px !important;
        min-width: 0 !important;
    }
}

@media (max-width: 767.98px) {
    .pet .pet-detail-page .pet__top {
        flex-direction: column !important;
        gap: 10px !important;
    }

    .pet .pet-detail-page .pet__top > .pet__top_media {
        flex: 0 0 auto !important;
        flex-basis: auto !important;
        width: 100% !important;
        max-width: 100% !important;
    }
}


/*
 * Feed mini-banner height = neighboring .index__post > .card (feedbanner20260807a).
 * Culprit: a.card.card__cotinder:not(.card__cotinder_full){height:auto} + img{height:auto}
 * sized the banner to the image aspect ratio (~462) while feed cards lock to 446/524.
 * Scoped ONLY to .index__post_feed-banner — never touch global .card / pet / arena.
 */
.index__posts > .index__post.index__post_feed-banner:not(.index__post_full) {
    display: flex !important;
    flex-direction: column !important;
    align-self: stretch !important;
}

.index__posts > .index__post.index__post_feed-banner:not(.index__post_full) > .card.card__cotinder,
.index__posts > .index__post.index__post_feed-banner:not(.index__post_full) > a.card.card__cotinder {
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    padding: 0 !important;
    flex: 1 1 auto !important;
    align-self: stretch !important;
    box-sizing: border-box !important;
}

.index__posts > .index__post.index__post_feed-banner:not(.index__post_full) > .card.card__cotinder > img,
.index__posts > .index__post.index__post_feed-banner:not(.index__post_full) > a.card.card__cotinder > img,
.index__posts > .index__post.index__post_feed-banner:not(.index__post_full) img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-height: none !important;
    object-fit: contain !important;
    border-radius: 20px;
}

/* Tablet band: match .index__post > .card { height: 446px } */
@media (min-width: 768px) and (max-width: 1199.98px) {
    .index__posts > .index__post.index__post_feed-banner:not(.index__post_full) > .card.card__cotinder,
    .index__posts > .index__post.index__post_feed-banner:not(.index__post_full) > a.card.card__cotinder {
        height: 446px !important;
        min-height: 446px !important;
    }
}

/* Desktop ≥1200 / ≤1440 ladder often locks .card at 446px (live neighbor) */
@media (min-width: 1200px) {
    .index__posts > .index__post.index__post_feed-banner:not(.index__post_full) > .card.card__cotinder,
    .index__posts > .index__post.index__post_feed-banner:not(.index__post_full) > a.card.card__cotinder {
        height: 446px !important;
        min-height: 446px !important;
    }
}

/* Phone ≤480 1-col: stretch collapses — match .card { height: 524px } */
@media (max-width: 480px) {
    .index__posts > .index__post.index__post_feed-banner:not(.index__post_full) > .card.card__cotinder,
    .index__posts > .index__post.index__post_feed-banner:not(.index__post_full) > a.card.card__cotinder {
        height: 524px !important;
        min-height: 524px !important;
    }
}

/*
 * Left sidebar «Найден / Потерялся» colored plaques (annsidebarbadge20260807a).
 * Culprit: left-column .card / .card-img-wrap link+span resets left the
 * .announcement-card__badges wrapper with transparent bg + body text color;
 * lost/found plaque colors from composite custom.css did not win there.
 * Scope ONLY sidebar announcement cards — no borders/banner/rating/pet-right.
 */
.tabs__content_left .index__post_sidebar-announcement .announcement-card > .card-img-wrap {
    position: relative !important;
}

.tabs__content_left .index__post_sidebar-announcement .announcement-card__badges {
    position: absolute !important;
    left: 10px !important;
    bottom: 10px !important;
    z-index: 5 !important;
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: flex-end !important;
    gap: 4px !important;
    max-width: calc(100% - 20px) !important;
    background: transparent !important;
    color: #fff !important;
    pointer-events: none !important;
}

.tabs__content_left .index__post_sidebar-announcement .announcement-card__badge {
    position: static !important;
    display: inline-block !important;
    padding: 4px 10px !important;
    border-radius: 10px !important;
    background: rgba(45, 45, 45, 0.82) !important;
    color: #fff !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
}

.tabs__content_left .index__post_sidebar-announcement .announcement-card--lost .announcement-card__badge:not(.announcement-card__badge--placed) {
    background: rgba(253, 119, 40, 0.92) !important;
    color: #fff !important;
}

.tabs__content_left .index__post_sidebar-announcement .announcement-card--found .announcement-card__badge:not(.announcement-card__badge--placed) {
    background: rgba(46, 160, 67, 0.92) !important;
    color: #fff !important;
}

.tabs__content_left .index__post_sidebar-announcement .announcement-card__badge--placed {
    background: rgba(128, 145, 169, 0.92) !important;
    color: #fff !important;
}

/*
 * anncardborder20260807a — gray outline on lost/found announcement cards.
 * Culprit: cardborder20260807a/b only restored
 *   .index__posts .card.user-slide… / .card.card__cotinder
 * Left sidebar cards live under .tabs__content_left .index__post_sidebar-announcement
 * (not .index__posts), so they stayed borderless. Base .card has no border.
 * Scope ONLY .announcement-card — badges / feed / banner / rating untouched.
 */
.card.user-slide.announcement-card,
.tabs__content_left .index__post_sidebar-announcement .card.user-slide.announcement-card {
    border: 1px solid var(--border-color, #B9B9B9) !important;
}

/*
 * cardborder20260807c — force gray frame on PLAIN feed pet/user cards (last wins).
 * Culprit: feedmediafix20260807a set border:none !important on
 *   .index__posts .card.user-slide…; cardborder20260807a restored without
 *   !important so non-boost cards stayed borderless (base .card has no border).
 * VIP/boost keep outline/box-shadow chrome — excluded via :not(.cotinder-boost-card).
 * Events / collab / community / advice / announcement untouched.
 */
.index__posts .card.user-slide:not(.card__advice):not(.index__events_event):not(.index__events_article):not(.index__collaborations_card):not(.index__community-card):not(.cotinder-boost-card),
.index__posts .card.card__cotinder:not(.card__advice):not(.cotinder-boost-card),
.index__posts .card.user-slide.card__video:not(.card__advice):not(.cotinder-boost-card) {
    border: 1px solid var(--border-color, #B9B9B9) !important;
}

/*
 * cardborder20260807d — last-tab pet swiper gray frame (live proof target).
 * Culprit: cardborder20260807c only hit .index__posts .card.user-slide…
 * Live CDP: plain .card.user-slide lived under .another-pet__swiper
 * (.tabs__content_right → .another-pet), NOT .index__posts → border stayed
 * 0px none (base .card). Boost/VIP keep pink outline/box-shadow — excluded.
 */
.another-pet .card.user-slide:not(.cotinder-boost-card):not(.card__advice):not(.announcement-card):not(.index__events_event):not(.index__events_article):not(.index__collaborations_card):not(.index__community-card),
.another-pet__swiper .swiper-slide > .card.user-slide:not(.cotinder-boost-card):not(.card__advice):not(.announcement-card),
.tabs__content_right .another-pet .card.user-slide:not(.cotinder-boost-card):not(.card__advice) {
    border: 1px solid var(--border-color, #B9B9B9) !important;
}

/*
 * cardborder20260807e — MAX specificity gray frame on pet/user cards.
 * User still saw no frame after cardborder20260807d (another-pet-only).
 * Raise specificity with body + cover main feed, another-pet, profiles,
 * and community user cards. Also restore .card-img-wrap outline if a
 * prior feedmediafix left media wrap borderless (visual "frame" miss).
 */
body .index__posts .index__post > .card.user-slide:not(.card__advice):not(.index__events_event):not(.index__events_article):not(.index__collaborations_card):not(.index__community-card):not(.cotinder-boost-card),
body .another-pet .card.user-slide:not(.cotinder-boost-card),
body .profiles-flex__item .card.user-slide:not(.cotinder-boost-card),
body .index__posts .card.user-slide.index__community-card:not(.cotinder-boost-card) {
    border: 1px solid #B9B9B9 !important;
    box-sizing: border-box;
}
