/**
 * Phone air — ≤479.98px only.
 * Layers 1–4: chrome, contest/text pages, cabinet, lists/home.
 * PC ≥1200 and tablet ≥768 unchanged. Does not edit custom.css / mobile-card-fixes / footer.php.
 */
.index__tabs_icon,
.index__tabs_title-short {
  display: none;
}

@media (max-width: 479.98px) {
  /* ---- 1. Chrome: title clear of rail, gutters, compact FABs ---- */
  html body.cotinder-mnav-personal .pet > .pet__title,
  html body.cotinder-mnav-personal .pet > .breadcrumbs {
    padding-left: calc(var(--cotinder-mnav-rail, 56px) + 10px);
    padding-right: 12px;
    box-sizing: border-box;
  }

  html body.cotinder-mnav-personal .pet > .pet__title {
    font-size: 22px;
    line-height: 1.25;
    margin: 0 0 10px;
    overflow-wrap: anywhere;
  }

  .pet:has(.seo-articles__hero--detail) > .pet__title {
    display: none;
  }

  .seo-articles {
    padding-left: 14px;
    padding-right: 14px;
    box-sizing: border-box;
  }

  .cotinder-bug-report__fab-label {
    display: none;
  }

  .cotinder-bug-report__fab {
    left: 8px;
    bottom: calc(62px + env(safe-area-inset-bottom, 0px));
    padding: 6px;
    max-width: 48px;
  }

  body:not(.cotinder-app-promo-dismissed):not(.cotinder-pwa-standalone) .cotinder-app-promo:not([hidden]) {
    padding: 6px 10px;
    gap: 8px;
    border-radius: 12px;
  }

  .cotinder-app-promo__icon {
    width: 28px;
    height: 28px;
  }

  .cotinder-app-promo__text {
    font-size: 0.75rem;
  }

  .cotinder-app-promo__text strong {
    font-size: 0.82rem;
    margin-bottom: 0;
  }

  html body:has(.cotinder-app-promo:not([hidden])) .cotinder-engage-chip {
    bottom: calc(168px + env(safe-area-inset-bottom, 0px)) !important;
  }

  html body:has(.cotinder-app-promo:not([hidden])) .cotinder-engage__toast {
    bottom: calc(216px + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* ---- 2. Contests + text pages ---- */
  .cotinder-energy-page .seo-articles__cover-banner,
  .cotinder-sprint-page .seo-articles__cover-banner {
    margin-bottom: 18px;
  }

  .cotinder-energy-page .seo-articles__cover-banner img,
  .cotinder-sprint-page .seo-articles__cover-banner img {
    aspect-ratio: 16 / 9;
    max-height: 180px;
    object-fit: cover;
    object-position: center 28%;
  }

  .cotinder-energy-page .seo-articles__hero--detail,
  .cotinder-sprint-page .seo-articles__hero--detail,
  .seo-articles__hero--detail {
    padding: 8px 2px 4px;
  }

  .cotinder-energy-page .seo-articles__title,
  .cotinder-sprint-page .seo-articles__title {
    font-size: 1.55rem;
    line-height: 1.2;
    margin-bottom: 8px;
  }

  .cotinder-energy-page .seo-articles__lead,
  .cotinder-sprint-page .seo-articles__lead,
  .seo-articles__lead {
    font-size: 15px;
    line-height: 1.5;
    margin: 10px 0 16px;
  }

  .cotinder-energy-page .seo-articles__section,
  .cotinder-sprint-page .seo-articles__section,
  .seo-articles__section {
    margin-bottom: 28px;
  }

  .cotinder-energy-page__actions {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-top: 16px;
  }

  .cotinder-energy-page__actions .seo-articles__btn--primary {
    width: 100%;
  }

  .cotinder-energy-page__actions .seo-articles__btn:not(.seo-articles__btn--primary) {
    width: auto;
    align-self: center;
    background: transparent;
    border: 0;
    box-shadow: none;
    min-height: 36px;
    padding: 4px 8px;
    text-decoration: underline;
  }

  .cotinder-sprint-page__chip {
    position: static;
    border-radius: 12px;
    font-size: 12px;
    line-height: 1.35;
    margin-bottom: 16px;
  }

  .cotinder-energy-page__box {
    margin-bottom: 28px;
    padding: 14px;
  }

  .cotinder-energy-page__table-wrap {
    overflow: visible;
    -webkit-overflow-scrolling: auto;
  }

  .cotinder-energy-page__table,
  .cotinder-sprint-page__table {
    min-width: 0 !important;
    width: 100%;
    display: block;
  }

  .cotinder-energy-page__table thead {
    display: none;
  }

  .cotinder-energy-page__table tbody,
  .cotinder-energy-page__table tr {
    display: block;
  }

  .cotinder-energy-page__table tr {
    margin: 0 0 12px;
    padding: 10px 12px;
    border: 1px solid #ead9c6;
    border-radius: 12px;
    background: #fff;
  }

  .cotinder-energy-page__table td {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
    border-bottom: 1px solid #f0e6dc;
    text-align: right;
  }

  .cotinder-energy-page__table td:last-child {
    border-bottom: 0;
  }

  .cotinder-energy-page__table td[colspan] {
    display: block;
    text-align: left;
  }

  .cotinder-energy-page__table td[colspan]::before {
    content: none !important;
  }

  .cotinder-energy-page__table td::before {
    content: attr(data-label);
    font-weight: 700;
    color: #9a3412;
    font-size: 0.78rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    text-align: left;
    flex: 0 0 42%;
  }

  .cotinder-energy-page__table:not(.cotinder-sprint-page__table) td:nth-child(1)::before {
    content: "Кто пришёл";
  }

  .cotinder-energy-page__table:not(.cotinder-sprint-page__table) td:nth-child(2)::before {
    content: "Профиль";
  }

  .cotinder-energy-page__table:not(.cotinder-sprint-page__table) td:nth-child(3)::before {
    content: "Питомец";
  }

  .cotinder-energy-page__table:not(.cotinder-sprint-page__table) td:nth-child(4)::before {
    content: "Действие";
  }

  .cotinder-energy-page__table:not(.cotinder-sprint-page__table) td:nth-child(5)::before {
    content: "Зачёт";
  }

  .cotinder-sprint-page__table td:nth-child(1)::before {
    content: "Место";
  }

  .cotinder-sprint-page__table td:nth-child(2)::before {
    content: "Кто";
  }

  .cotinder-sprint-page__table td:nth-child(3)::before {
    content: "Пар за неделю";
  }

  .cotinder-sprint-page__table td:nth-child(4)::before {
    content: "Почему";
  }

  .seo-articles__faq {
    margin-top: 32px;
    padding: 16px;
  }

  .seo-articles__faq-item {
    margin-bottom: 18px;
    padding-bottom: 16px;
  }

  /* ---- 3. Cabinet first screen ---- */
  html body.cotinder-mnav-personal .person__form-tabs {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 8px;
    border-bottom: 0;
    margin-bottom: 12px;
    -webkit-overflow-scrolling: touch;
  }

  html body.cotinder-mnav-personal .person__form-tab,
  html body.cotinder-mnav-personal .person__form-tab.dog-tab {
    width: auto;
    flex: 1 1 0;
    min-width: 0;
    min-height: 40px;
    padding: 8px 10px;
    font-size: 14px;
    line-height: 1.25;
    border-radius: 12px;
  }

  html body.cotinder-mnav-personal .post-form__flex.person__form_avatar {
    margin-bottom: 8px;
    gap: 8px;
  }

  html body.cotinder-mnav-personal .person__form_avatar .filter__button {
    display: none !important;
  }

  html body.cotinder-mnav-personal .person__form-content > .cotinder-vip-promo,
  html body.cotinder-mnav-personal .cotinder-vip-promo {
    margin: 0 0 12px;
    padding: 8px 12px;
  }

  html body.cotinder-mnav-personal .cotinder-vip-promo__inner {
    flex-direction: row;
    align-items: center;
    gap: 10px;
  }

  html body.cotinder-mnav-personal .cotinder-vip-promo__text {
    display: none;
  }

  html body.cotinder-mnav-personal .cotinder-vip-promo__title {
    font-size: 13px;
    margin: 0;
    line-height: 1.3;
  }

  html body.cotinder-mnav-personal .cotinder-vip-promo__btn {
    width: auto;
    min-height: 36px;
    padding: 6px 12px;
    font-size: 13px;
    flex: 0 0 auto;
    white-space: nowrap;
  }

  html body.cotinder-mnav-personal .cabinet-home-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
  }

  html body.cotinder-mnav-personal .form-container {
    padding: 14px 12px;
    margin-bottom: 20px;
    row-gap: 8px;
  }

  html body.cotinder-mnav-personal .form-container .form-row,
  html body.cotinder-mnav-personal .person__form_form .form-row {
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
    width: 100%;
  }

  html body.cotinder-mnav-personal .form-container .form-group {
    margin-bottom: 0;
  }

  /* ---- 4. Lists + home banner + feed tabs ---- */
  .pet:not(:has(.authorization)) .person__form-tabs:not(.authorization__tabs),
  .tabs__content_right .person__form-tabs:not(.authorization__tabs),
  .announcements-page-tabs.person__form-tabs {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 8px;
    -webkit-overflow-scrolling: touch;
  }

  .pet:not(:has(.authorization)) .person__form-tab,
  .tabs__content_right .person__form-tab,
  .announcements-page-tabs .person__form-tab {
    width: auto;
    flex: 0 0 auto;
    min-width: max-content;
    min-height: 40px;
    padding: 8px 14px;
    font-size: 14px;
    border-radius: 999px;
  }

  .events-page .card,
  .collaborations-page .card,
  .announcements-page .card,
  .pet .tabs__content_right .card {
    margin-bottom: 14px;
  }

  html body.page-index .main__banner .main__slide--energy .main__slide_left,
  html body.page-index .main__banner .main__slide--sprint .main__slide_left {
    max-width: min(16.5rem, calc(100% - 72px));
    padding: 8px 10px;
    margin-top: 10px;
  }

  html body.page-index .main__banner .main__slide--energy .main__slide_title,
  html body.page-index .main__banner .main__slide--sprint .main__slide_title {
    font-size: 1.05rem;
    line-height: 1.2;
    margin-bottom: 4px;
  }

  html body.page-index .index__tabs,
  html body.page-index .main__index .index__tabs,
  html body .pet .index__tabs--site-feed {
    padding-left: 0;
    padding-right: 0;
  }

  html body.page-index .index__tabs_wrapper,
  html body .pet .index__tabs--site-feed .index__tabs_wrapper {
    overflow: visible;
    max-width: 100%;
  }

  html body.page-index .index__tabs_tabs,
  html body.page-index .main__index .index__tabs_tabs,
  html body .pet .index__tabs--site-feed .index__tabs_tabs {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    width: 100% !important;
    max-width: 100%;
    gap: 4px;
  }

  html body.page-index .index__tabs_tabs > div,
  html body.page-index .main__index .index__tabs_tabs > div,
  html body .pet .index__tabs--site-feed .index__tabs_tabs > div {
    min-width: 0;
    width: 100%;
    flex: none;
  }

  html body.page-index .index__tabs .index__tabs_btn,
  html body.page-index .main__index .index__tabs_btn,
  html body .pet .index__tabs--site-feed .index__tabs_btn {
    display: flex !important;
    flex-direction: column !important;
    flex: none !important;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none;
    height: auto;
    min-height: 58px;
    padding: 8px 2px 6px;
    border-radius: 12px;
    text-align: center;
  }

  html body.page-index .index__tabs_icon,
  html body .pet .index__tabs--site-feed .index__tabs_icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    color: #fd7728;
    pointer-events: none;
  }

  html body.page-index .index__tabs_btn-active .index__tabs_icon,
  html body .pet .index__tabs--site-feed .index__tabs_btn-active .index__tabs_icon {
    color: inherit;
  }

  html body.page-index .index__tabs .index__tabs_title,
  html body.page-index .main__index .index__tabs_title,
  html body .pet .index__tabs--site-feed .index__tabs_title {
    display: block;
    width: 100% !important;
    margin: 0;
    -webkit-line-clamp: unset;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: keep-all;
    hyphens: none;
    font-size: 10px;
    line-height: 1.15;
    text-align: center;
  }

  html body.page-index .index__tabs_title-full,
  html body .pet .index__tabs--site-feed .index__tabs_title-full {
    display: none;
  }

  html body.page-index .index__tabs_title-short,
  html body .pet .index__tabs--site-feed .index__tabs_title-short {
    display: block;
  }

  /* Pair / walk cards: full-width like feed, no side-arrow squeeze */
  html body.page-index .cotinder-paw-home,
  html body.page-index #cotinder-paw-home,
  html body.page-index .cotinder-paw-home--embed {
    padding-left: 0;
    padding-right: 0;
  }

  html body.page-index .cotinder-paw-home__deck,
  html body.page-index #cotinder-paw-home .cotinder-paw-home__deck {
    padding-right: 0;
  }

  html body.page-index .cotinder-paw-home__more,
  html body.page-index #cotinder-paw-home .cotinder-paw-home__more {
    position: absolute;
    right: 6px;
    top: 42%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    margin: 0;
    display: flex;
    z-index: 4;
  }

  html body.page-index .cotinder-paw-home__more svg {
    width: 48px;
    height: 48px;
  }

  html body.page-index .cotinder-paw-home__col {
    padding: 0;
    border: 0;
    background: transparent;
  }

  html body.page-index .cotinder-paw-home__match-photo {
    aspect-ratio: 1 / 1;
  }

  html body.page-index .cotinder-paw-home__card {
    border-radius: 16px;
  }

  /* Dating: only the main photo on the phone card */
  body.cotinder-page-happytails .cotinder-happytails__card-photos {
    display: block !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: 1fr !important;
    gap: 0 !important;
    padding: 0 !important;
    background: #111;
  }

  body.cotinder-page-happytails .cotinder-happytails__card-photo-wrap.is-extra,
  body.cotinder-page-happytails .cotinder-happytails__photo-label {
    display: none !important;
  }

  body.cotinder-page-happytails .cotinder-happytails__card-photo-wrap.is-main,
  body.cotinder-page-happytails .cotinder-happytails__card-photo-wrap[data-slot="0"] {
    display: block !important;
    grid-column: auto !important;
    grid-row: auto !important;
    width: 100% !important;
    height: 100% !important;
    border-radius: 18px !important;
    transform: none !important;
  }

  body.cotinder-page-happytails .cotinder-happytails__deck-wrap {
    max-width: none;
    width: 100%;
  }

  /* Owner + pet: one full feed-sized card */
  body.cotinder-page-happytails .cotinder-ht-together--main {
    padding: 10px;
    margin: 12px 0;
  }

  body.cotinder-page-happytails .cotinder-ht-together--main .cotinder-ht-together__grid {
    min-height: 0;
  }

  body.cotinder-page-happytails .cotinder-ht-together--main .cotinder-ht-together__card img {
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    aspect-ratio: 1 / 1 !important;
    object-fit: cover !important;
    border-radius: 16px;
  }

  /* Canals / community: pumpkin sprint is 2nd, after the first live card */
  html body.page-index .cotinder-index-feed[data-cotinder-feed-tab="canals"] .index__posts,
  html body.page-index .cotinder-index-feed[data-cotinder-feed-tab="comunity"] .index__posts {
    display: flex;
    flex-direction: column;
  }

  html body.page-index .cotinder-index-feed[data-cotinder-feed-tab="canals"] .index__posts > .index__post_feed-banner:first-child,
  html body.page-index .cotinder-index-feed[data-cotinder-feed-tab="comunity"] .index__posts > .index__post_feed-banner:first-child {
    order: 2;
  }

  html body.page-index .cotinder-index-feed[data-cotinder-feed-tab="canals"] .index__posts > .index__post:nth-child(2),
  html body.page-index .cotinder-index-feed[data-cotinder-feed-tab="comunity"] .index__posts > .index__post:nth-child(2) {
    order: 1;
  }

  html body.page-index .cotinder-index-feed[data-cotinder-feed-tab="canals"] .index__posts > .index__post:nth-child(n+3),
  html body.page-index .cotinder-index-feed[data-cotinder-feed-tab="comunity"] .index__posts > .index__post:nth-child(n+3) {
    order: 3;
  }
}
