/* ==========================================================
   SevSvet Favorites UI v2
   Единый стиль с карточкой дома
   ========================================================== */

.favorites-panel {
  --fav-text: #142825;
  --fav-muted: #74827f;
  --fav-border: rgba(20, 59, 54, 0.08);
  --fav-divider: rgba(20, 59, 54, 0.065);
  --fav-online: #16b96f;
  --fav-offline: #f34f61;
  --fav-planned: #f2a321;
  --fav-unknown: #8b9895;

  display: flex !important;
  flex-direction: column !important;

  box-sizing: border-box !important;

  max-height:
    var(
      --responsive-popup-max-height,
      calc(100dvh - 10px)
    ) !important;

  overflow: hidden !important;

  border-radius: 22px 22px 0 0 !important;
  background: rgba(255, 255, 255, 0.975) !important;

  box-shadow:
    0 -14px 38px rgba(22, 63, 58, 0.13),
    0 -3px 10px rgba(22, 63, 58, 0.055) !important;

  -webkit-backdrop-filter: blur(22px) saturate(1.12) !important;
  backdrop-filter: blur(22px) saturate(1.12) !important;
}

/* Шапка раздела */

.favorites-panel-header {
  display: flex !important;
  flex: 0 0 auto !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;

  padding: 12px 14px 10px !important;

  border-bottom: 1px solid var(--fav-divider) !important;
}

.favorites-panel-header > div {
  min-width: 0 !important;
}

.favorites-kicker {
  margin: 0 0 2px !important;

  color: #81908d !important;
  font-size: 8.5px !important;
  font-weight: 720 !important;
  line-height: 1.1 !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
}

.favorites-panel-header h2 {
  margin: 0 !important;

  color: var(--fav-text) !important;
  font-size: 17px !important;
  font-weight: 790 !important;
  line-height: 1.1 !important;
  letter-spacing: -0.018em !important;
}

.favorites-close {
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;

  border-radius: 50% !important;

  color: #1e7770 !important;
  background: rgba(226, 244, 242, 0.88) !important;
}

/* Прокручиваемый список */

.favorites-list {
  display: flex !important;
  flex: 1 1 auto !important;
  flex-direction: column !important;
  gap: 10px !important;

  min-height: 0 !important;
  margin: 0 !important;
  padding: 11px 12px !important;

  overflow-x: hidden !important;
  overflow-y: auto !important;

  overscroll-behavior-y: contain !important;
  scrollbar-width: none !important;

  -webkit-overflow-scrolling: touch !important;
}

.favorites-list::-webkit-scrollbar {
  display: none !important;
}

/* Общая карточка адреса */

.favorite-row-wrap {
  position: relative !important;

  display: flex !important;
  flex: 0 0 auto !important;
  flex-direction: column !important;
  gap: 0 !important;

  box-sizing: border-box !important;

  width: 100% !important;
  margin: 0 !important;

  overflow: hidden !important;

  border: 1px solid var(--fav-border) !important;
  border-radius: 17px !important;

  background:
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.99),
      rgba(247, 250, 249, 0.94)
    ) !important;

  box-shadow:
    0 6px 18px rgba(22, 63, 58, 0.055),
    0 1px 4px rgba(22, 63, 58, 0.025) !important;
}

/* Основная кликабельная область */

.favorite-row {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 8px !important;

  box-sizing: border-box !important;

  width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 11px 12px 9px !important;

  border: 0 !important;
  border-radius: 0 !important;

  background: transparent !important;
  box-shadow: none !important;

  color: inherit !important;
  text-align: left !important;
}

.favorite-row:active {
  background: rgba(224, 243, 240, 0.36) !important;
}

/* Адрес и статус */

.favorite-row-top {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: start !important;
  gap: 10px !important;

  width: 100% !important;
}

.favorite-identity {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  gap: 2px !important;

  min-width: 0 !important;
}

.favorite-title {
  display: block !important;

  width: 100% !important;
  margin: 0 !important;

  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;

  color: var(--fav-text) !important;
  font-size: 15px !important;
  font-weight: 790 !important;
  line-height: 1.12 !important;
  letter-spacing: -0.014em !important;
}

.favorite-address-line {
  display: -webkit-box !important;

  width: 100% !important;

  overflow: hidden !important;

  color: #40524f !important;
  font-size: 11px !important;
  font-weight: 630 !important;
  line-height: 1.2 !important;

  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 2 !important;
}

.favorite-settlement {
  display: block !important;

  width: 100% !important;

  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;

  color: var(--fav-muted) !important;
  font-size: 9.5px !important;
  font-weight: 520 !important;
  line-height: 1.15 !important;
}

/* Статусный бейдж */

.favorite-status-badge {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 5px !important;

  min-height: 27px !important;
  padding: 5px 8px !important;

  border: 1px solid rgba(139, 152, 149, 0.20) !important;
  border-radius: 999px !important;

  background: rgba(139, 152, 149, 0.08) !important;

  color: var(--fav-unknown) !important;
  font-size: 9px !important;
  font-style: normal !important;
  font-weight: 730 !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

.favorite-status-badge i {
  display: block !important;

  width: 7px !important;
  height: 7px !important;
  min-width: 7px !important;

  border-radius: 50% !important;
  background: currentColor !important;
}

/* Поддерживаем разные возможные названия статусов */

.favorite-status-badge.is-online,
.favorite-status-badge.is-light,
.favorite-status-badge.is-on {
  border-color: rgba(22, 185, 111, 0.27) !important;
  background: rgba(22, 185, 111, 0.09) !important;
  color: var(--fav-online) !important;
}

.favorite-status-badge.is-offline,
.favorite-status-badge.is-no-light,
.favorite-status-badge.is-off {
  border-color: rgba(243, 79, 97, 0.27) !important;
  background: rgba(243, 79, 97, 0.09) !important;
  color: var(--fav-offline) !important;
}

.favorite-status-badge.is-planned,
.favorite-status-badge.is-scheduled {
  border-color: rgba(242, 163, 33, 0.28) !important;
  background: rgba(242, 163, 33, 0.10) !important;
  color: var(--fav-planned) !important;
}

/* Последнее подтверждение */

.favorite-row-meta {
  display: flex !important;
  align-items: center !important;

  min-height: 25px !important;
  margin: 0 !important;
  padding: 5px 8px !important;

  border-radius: 9px !important;

  background: rgba(235, 242, 240, 0.70) !important;

  color: var(--fav-muted) !important;
  font-size: 9px !important;
  font-weight: 540 !important;
  line-height: 1.2 !important;
}

/* Четыре одинаковых действия */

.favorite-row-actions {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 6px !important;

  width: 100% !important;
  margin: 0 !important;
  padding: 7px 9px 9px !important;

  border-top: 1px solid var(--fav-divider) !important;
}

.favorite-row-actions > button {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 3px !important;

  box-sizing: border-box !important;

  width: 100% !important;
  min-width: 0 !important;
  height: 45px !important;
  min-height: 45px !important;
  max-height: 45px !important;

  margin: 0 !important;
  padding: 4px 2px !important;

  border: 1px solid rgba(20, 59, 54, 0.065) !important;
  border-radius: 11px !important;

  background: rgba(247, 250, 249, 0.90) !important;
  box-shadow: none !important;

  color: #5f706d !important;
  font-size: 8px !important;
  font-weight: 680 !important;
  line-height: 1 !important;
  text-align: center !important;
}

.favorite-row-actions > button .app-icon {
  width: 16px !important;
  height: 16px !important;
  min-width: 16px !important;
}

/* Подписи для кнопок с одной иконкой */

.favorite-edit::after {
  content: "Название";
}

.favorite-notifications::after {
  content: "Уведомления";
}

.favorite-delete::after {
  content: "Удалить";
}

.favorite-history {
  font-size: 0 !important;
}

.favorite-history::before {
  content: "";

  display: block;

  width: 16px;
  height: 16px;

  background:
    no-repeat center / contain
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235f706d' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 12a9 9 0 1 0 3-6.7L3 8'/%3E%3Cpath d='M3 3v5h5'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E");
}

.favorite-history::after {
  content: "История";

  font-size: 8px;
  font-weight: 680;
  line-height: 1;
}

.favorite-notifications.is-active {
  border-color: rgba(8, 125, 119, 0.16) !important;
  background: rgba(225, 243, 241, 0.82) !important;
  color: #087d77 !important;
}

.favorite-delete {
  color: #d84b5b !important;
  background: rgba(243, 79, 97, 0.055) !important;
}

.favorite-row-actions > button:active:not(:disabled) {
  transform: scale(0.975) !important;
}

.favorite-row-actions > button:disabled {
  opacity: 0.42 !important;
}

/* Пустое состояние */

.favorites-empty {
  margin: auto 0 !important;
  padding: 24px 18px !important;

  border: 1px dashed rgba(20, 59, 54, 0.13) !important;
  border-radius: 16px !important;

  background: rgba(247, 250, 249, 0.82) !important;

  color: var(--fav-muted) !important;
  font-size: 11px !important;
  line-height: 1.45 !important;
  text-align: center !important;
}

/* ==========================================================
   Будущий блок расширения
   ========================================================== */

.favorites-upgrade {
  display: grid !important;
  flex: 0 0 auto !important;
  grid-template-columns: 34px minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 9px !important;

  margin: 0 !important;
  padding:
    9px
    12px
    max(10px, env(safe-area-inset-bottom))
    !important;

  border-top: 1px solid var(--fav-divider) !important;

  background:
    linear-gradient(
      135deg,
      rgba(8, 125, 119, 0.055),
      rgba(255, 255, 255, 0.97) 55%
    ) !important;
}

.favorites-upgrade-icon {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;

  width: 34px !important;
  height: 34px !important;

  border-radius: 11px !important;

  background: rgba(8, 125, 119, 0.10) !important;
  color: #087d77 !important;
}

.favorites-upgrade-icon .app-icon {
  width: 18px !important;
  height: 18px !important;
}

.favorites-upgrade-copy {
  display: flex !important;
  flex-direction: column !important;
  gap: 2px !important;

  min-width: 0 !important;
}

.favorites-upgrade-copy strong {
  color: var(--fav-text) !important;
  font-size: 10.5px !important;
  font-weight: 760 !important;
  line-height: 1.15 !important;
}

.favorites-upgrade-copy span {
  display: -webkit-box !important;

  overflow: hidden !important;

  color: var(--fav-muted) !important;
  font-size: 8px !important;
  line-height: 1.2 !important;

  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 2 !important;
}

.favorites-upgrade-button {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 1px !important;

  min-height: 38px !important;
  padding: 6px 9px !important;

  border: 1px solid rgba(8, 125, 119, 0.14) !important;
  border-radius: 11px !important;

  background: rgba(225, 243, 241, 0.90) !important;

  color: #087d77 !important;
  font-size: 8.5px !important;
  font-weight: 730 !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

.favorites-upgrade-button small {
  color: #77918e !important;
  font-size: 6.5px !important;
  font-weight: 620 !important;
}

/* Короткие телефоны */

@media (max-height: 760px) {
  .favorites-panel-header {
    padding-top: 9px !important;
    padding-bottom: 8px !important;
  }

  .favorites-list {
    gap: 8px !important;
    padding: 8px 10px !important;
  }

  .favorite-row {
    gap: 6px !important;
    padding: 9px 10px 7px !important;
  }

  .favorite-row-actions {
    padding: 6px 8px 8px !important;
  }

  .favorite-row-actions > button {
    height: 41px !important;
    min-height: 41px !important;
    max-height: 41px !important;
  }

  .favorites-upgrade {
    padding-top: 7px !important;
    padding-bottom:
      max(8px, env(safe-area-inset-bottom))
      !important;
  }
}

/* Очень узкие Android */

@media (max-width: 360px) {
  .favorite-title {
    font-size: 14px !important;
  }

  .favorite-status-badge {
    min-height: 25px !important;
    padding: 4px 6px !important;
    font-size: 8px !important;
  }

  .favorite-row-actions {
    gap: 4px !important;
  }

  .favorite-row-actions > button {
    font-size: 7px !important;
  }

  .favorite-history::after {
    font-size: 7px !important;
  }

  .favorites-upgrade {
    grid-template-columns: 31px minmax(0, 1fr) !important;
  }

  .favorites-upgrade-button {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    min-height: 34px !important;
  }
}


/* ==========================================================
   Favorites UI v2.1
   Hidden-state fix + compact cards
   ========================================================== */

/*
 * Критически важно:
 * display:flex !important у панели не должен перебивать
 * стандартное поведение атрибута hidden.
 */

.favorites-panel[hidden] {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.favorites-panel:not([hidden]) {
  display: flex !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

/* Панель не должна перехватывать карту в скрытом состоянии */

#favoritesPanel[hidden],
section#favoritesPanel[hidden] {
  display: none !important;
  opacity: 0 !important;
  transform: translateY(100%) !important;
  pointer-events: none !important;
}

/* ==========================================================
   Более компактный список — меньше прокрутки
   ========================================================== */

.favorites-list {
  gap: 7px !important;
  padding: 8px 10px !important;
}

.favorite-row-wrap {
  border-radius: 15px !important;
}

.favorite-row {
  gap: 5px !important;
  padding: 8px 10px 7px !important;
}

.favorite-row-top {
  gap: 8px !important;
}

.favorite-identity {
  gap: 1px !important;
}

.favorite-title {
  font-size: 13.5px !important;
  line-height: 1.08 !important;
}

.favorite-address-line {
  font-size: 9.5px !important;
  line-height: 1.15 !important;
}

.favorite-settlement {
  font-size: 8px !important;
}

.favorite-status-badge {
  min-height: 23px !important;
  padding: 4px 7px !important;

  font-size: 7.8px !important;
}

.favorite-status-badge i {
  width: 6px !important;
  height: 6px !important;
  min-width: 6px !important;
}

.favorite-row-meta {
  min-height: 22px !important;
  padding: 4px 7px !important;

  font-size: 7.8px !important;
}

/* Кнопки компактнее, но остаются удобными */

.favorite-row-actions {
  gap: 5px !important;
  padding: 6px 8px 7px !important;
}

.favorite-row-actions > button {
  height: 39px !important;
  min-height: 39px !important;
  max-height: 39px !important;

  padding: 3px 2px !important;
  border-radius: 10px !important;

  font-size: 7px !important;
}

.favorite-row-actions > button .app-icon,
.favorite-history::before {
  width: 14px !important;
  height: 14px !important;
  min-width: 14px !important;
}

.favorite-history::after {
  font-size: 7px !important;
}

/* Нижний блок остаётся отдельным и стационарным */

.favorites-upgrade {
  position: relative !important;
  z-index: 20 !important;

  flex: 0 0 auto !important;

  padding:
    7px
    10px
    max(8px, env(safe-area-inset-bottom))
    !important;

  box-shadow:
    0 -8px 18px rgba(22, 63, 58, 0.055) !important;
}

.favorites-upgrade-copy strong {
  font-size: 9px !important;
}

.favorites-upgrade-copy span {
  font-size: 7px !important;
}

.favorites-upgrade-button {
  min-height: 34px !important;
  padding: 5px 8px !important;

  font-size: 7.5px !important;
}

/* Galaxy S8+, старые iPhone и короткие браузерные окна */

@media (max-height: 760px) {
  .favorites-panel-header {
    padding: 8px 11px 7px !important;
  }

  .favorites-panel-header h2 {
    font-size: 15px !important;
  }

  .favorites-list {
    gap: 6px !important;
    padding: 6px 8px !important;
  }

  .favorite-row {
    padding: 7px 8px 6px !important;
  }

  .favorite-row-actions {
    padding: 5px 7px 6px !important;
  }

  .favorite-row-actions > button {
    height: 36px !important;
    min-height: 36px !important;
    max-height: 36px !important;
  }

  .favorites-upgrade {
    padding:
      6px
      8px
      max(7px, env(safe-area-inset-bottom))
      !important;
  }
}


/* ==========================================================
   Favorites UI v2.2
   Compact final cards
   ========================================================== */

/* Чуть больше полезной высоты для списка */

.favorites-panel {
  max-height:
    var(
      --responsive-popup-max-height,
      calc(100dvh - 8px)
    ) !important;
}

/* Компактная шапка */

.favorites-panel-header {
  min-height: 57px !important;
  padding: 9px 12px 8px !important;
}

.favorites-kicker {
  margin-bottom: 2px !important;

  font-size: 7.5px !important;
}

.favorites-panel-header h2 {
  font-size: 15.5px !important;
}

.favorites-close {
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
}

/* Список */

.favorites-list {
  gap: 7px !important;

  padding:
    8px
    10px
    9px
    !important;
}

/* Карточка */

.favorite-row-wrap {
  border-radius: 14px !important;

  box-shadow:
    0 4px 13px rgba(22, 63, 58, 0.045),
    0 1px 3px rgba(22, 63, 58, 0.022) !important;
}

.favorite-row {
  gap: 5px !important;

  padding:
    9px
    10px
    7px
    !important;
}

/* Название, адрес, город */

.favorite-row-top {
  align-items: center !important;
  gap: 8px !important;
}

.favorite-identity {
  gap: 1px !important;
}

.favorite-title {
  font-size: 13px !important;
  line-height: 1.08 !important;
}

.favorite-address-line {
  font-size: 9.5px !important;
  line-height: 1.15 !important;
}

.favorite-settlement {
  font-size: 7.7px !important;
  line-height: 1.1 !important;
}

/* Статус */

.favorite-status-badge {
  min-height: 22px !important;

  padding:
    4px
    7px
    !important;

  font-size: 7.5px !important;
}

.favorite-status-badge i {
  width: 6px !important;
  height: 6px !important;
  min-width: 6px !important;
}

/* Последнее подтверждение */

.favorite-row-meta {
  min-height: 21px !important;

  padding:
    4px
    7px
    !important;

  border-radius: 8px !important;

  font-size: 7.4px !important;
}

/* ==========================================================
   Действия
   ========================================================== */

.favorite-row-actions {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;

  gap: 5px !important;

  padding:
    5px
    8px
    7px
    !important;
}

.favorite-row-actions > button {
  position: relative !important;

  height: 36px !important;
  min-height: 36px !important;
  max-height: 36px !important;

  gap: 2px !important;

  padding:
    3px
    2px
    !important;

  border-radius: 9px !important;

  font-size: 6.8px !important;
  font-weight: 700 !important;

  transition:
    transform 130ms ease,
    background-color 130ms ease,
    border-color 130ms ease !important;
}

.favorite-row-actions > button .app-icon,
.favorite-history::before {
  width: 13px !important;
  height: 13px !important;
  min-width: 13px !important;
}

.favorite-edit {
  background: rgba(239, 246, 244, 0.94) !important;
}

.favorite-notifications {
  background: rgba(232, 246, 244, 0.94) !important;
  color: #137f78 !important;
}

.favorite-notifications.is-active {
  border-color: rgba(8, 125, 119, 0.25) !important;

  background:
    linear-gradient(
      145deg,
      rgba(215, 242, 238, 0.96),
      rgba(238, 249, 247, 0.98)
    ) !important;

  box-shadow:
    inset 0 0 0 1px rgba(8, 125, 119, 0.04) !important;
}

.favorite-history {
  background: rgba(243, 247, 246, 0.96) !important;
}

.favorite-delete {
  border-color: rgba(243, 79, 97, 0.10) !important;

  background: rgba(253, 241, 243, 0.92) !important;
}

.favorite-row-actions > button:active:not(:disabled) {
  transform: scale(0.965) !important;
}

/* ==========================================================
   Нижний блок расширения
   ========================================================== */

.favorites-upgrade {
  grid-template-columns:
    31px
    minmax(0, 1fr)
    auto
    !important;

  gap: 8px !important;

  padding:
    7px
    10px
    max(8px, env(safe-area-inset-bottom))
    !important;

  background:
    linear-gradient(
      135deg,
      rgba(8, 125, 119, 0.065),
      rgba(255, 255, 255, 0.985) 58%
    ) !important;
}

.favorites-upgrade-icon {
  width: 31px !important;
  height: 31px !important;

  border-radius: 10px !important;
}

.favorites-upgrade-icon .app-icon {
  width: 16px !important;
  height: 16px !important;
}

.favorites-upgrade-copy {
  gap: 1px !important;
}

.favorites-upgrade-copy strong {
  font-size: 8.5px !important;
  line-height: 1.1 !important;
}

.favorites-upgrade-copy span {
  font-size: 6.7px !important;
  line-height: 1.15 !important;
}

.favorites-upgrade-button {
  min-height: 32px !important;

  padding:
    5px
    8px
    !important;

  border-radius: 9px !important;

  font-size: 7px !important;
}

.favorites-upgrade-button small {
  font-size: 5.8px !important;
}

/*
 * Когда решим временно убрать блок до запуска подписок,
 * достаточно заменить 0 на 1.
 */

.favorites-panel {
  --hide-favorites-upgrade: 0;
}

.favorites-panel[style*="--hide-favorites-upgrade: 1"]
.favorites-upgrade {
  display: none !important;
}

/* ==========================================================
   Короткие экраны
   ========================================================== */

@media (max-height: 760px) {

  .favorites-panel-header {
    min-height: 52px !important;

    padding:
      7px
      10px
      6px
      !important;
  }

  .favorites-panel-header h2 {
    font-size: 14.5px !important;
  }

  .favorites-close {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
  }

  .favorites-list {
    gap: 5px !important;

    padding:
      6px
      8px
      7px
      !important;
  }

  .favorite-row {
    padding:
      7px
      8px
      6px
      !important;
  }

  .favorite-row-actions {
    gap: 4px !important;

    padding:
      4px
      7px
      6px
      !important;
  }

  .favorite-row-actions > button {
    height: 33px !important;
    min-height: 33px !important;
    max-height: 33px !important;

    font-size: 6.3px !important;
  }

  .favorite-row-actions > button .app-icon,
  .favorite-history::before {
    width: 12px !important;
    height: 12px !important;
    min-width: 12px !important;
  }

  .favorite-history::after {
    font-size: 6.3px !important;
  }

  .favorites-upgrade {
    padding:
      6px
      8px
      max(7px, env(safe-area-inset-bottom))
      !important;
  }
}

/* Узкие Android */

@media (max-width: 360px) {

  .favorite-row-top {
    gap: 6px !important;
  }

  .favorite-title {
    font-size: 12.5px !important;
  }

  .favorite-address-line {
    font-size: 9px !important;
  }

  .favorite-row-actions > button {
    font-size: 6px !important;
  }

  .favorite-history::after {
    font-size: 6px !important;
  }

  .favorites-upgrade {
    grid-template-columns:
      29px
      minmax(0, 1fr)
      !important;
  }

  .favorites-upgrade-button {
    grid-column: 1 / -1 !important;

    width: 100% !important;
    min-height: 29px !important;
  }
}


/* ==========================================================
   Favorites UI v2.2.1
   History duplicate fix + delete accent
   ========================================================== */

/*
 * В исходной кнопке подпись «История» уже присутствует.
 * Убираем добавленную нами вторую подпись через ::after.
 */

.favorite-row-actions > .favorite-history {
  color: #5f706d !important;
  font-size: 6.8px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
}

.favorite-row-actions > .favorite-history::after {
  content: none !important;
  display: none !important;
}

/* Сохраняем одну аккуратную иконку истории */

.favorite-row-actions > .favorite-history::before {
  display: block !important;

  width: 13px !important;
  height: 13px !important;
  min-width: 13px !important;

  margin: 0 !important;
}

/* Удаление — лёгкий красный акцент без агрессивного фона */

.favorite-row-actions > .favorite-delete {
  border-color: rgba(232, 76, 91, 0.18) !important;

  background:
    linear-gradient(
      145deg,
      rgba(253, 239, 241, 0.96),
      rgba(255, 248, 249, 0.98)
    ) !important;

  color: #cf4554 !important;
}

.favorite-row-actions > .favorite-delete .app-icon {
  color: #cf4554 !important;
  stroke: currentColor !important;
}

.favorite-row-actions > .favorite-delete:active:not(:disabled) {
  border-color: rgba(232, 76, 91, 0.30) !important;
  background: rgba(249, 222, 226, 0.96) !important;
}

/* Короткие экраны */

@media (max-height: 760px) {
  .favorite-row-actions > .favorite-history {
    font-size: 6.3px !important;
  }

  .favorite-row-actions > .favorite-history::before {
    width: 12px !important;
    height: 12px !important;
    min-width: 12px !important;
  }
}

@media (max-width: 360px) {
  .favorite-row-actions > .favorite-history {
    font-size: 6px !important;
  }
}


/* ==========================================================
   Favorites UI v2.3
   Custom delete confirmation dialog
   ========================================================== */

.favorite-delete-dialog[hidden] {
  display: none !important;
}

.favorite-delete-dialog {
  position: fixed !important;
  inset: 0 !important;
  z-index: 7000 !important;

  display: flex !important;
  align-items: flex-end !important;
  justify-content: center !important;

  padding: 0 !important;

  pointer-events: none !important;
}

.favorite-delete-dialog.is-visible {
  pointer-events: auto !important;
}

.favorite-delete-backdrop {
  position: absolute !important;
  inset: 0 !important;

  opacity: 0 !important;

  background: rgba(13, 31, 29, 0.28) !important;

  -webkit-backdrop-filter: blur(4px) !important;
  backdrop-filter: blur(4px) !important;

  transition: opacity 180ms ease !important;
}

.favorite-delete-dialog.is-visible
.favorite-delete-backdrop {
  opacity: 1 !important;
}

.favorite-delete-sheet {
  position: relative !important;
  z-index: 1 !important;

  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;

  box-sizing: border-box !important;

  width: min(100%, 520px) !important;

  padding:
    8px
    16px
    max(14px, env(safe-area-inset-bottom))
    !important;

  overflow: hidden !important;

  border: 1px solid rgba(20, 59, 54, 0.08) !important;
  border-radius: 24px 24px 0 0 !important;

  background: rgba(255, 255, 255, 0.985) !important;

  box-shadow:
    0 -18px 50px rgba(14, 44, 40, 0.20),
    0 -3px 12px rgba(14, 44, 40, 0.08)
    !important;

  transform: translateY(105%) !important;

  transition:
    transform 220ms cubic-bezier(0.22, 0.8, 0.28, 1)
    !important;
}

.favorite-delete-dialog.is-visible
.favorite-delete-sheet {
  transform: translateY(0) !important;
}

.favorite-delete-handle {
  width: 38px !important;
  height: 4px !important;
  margin: 0 0 12px !important;

  border-radius: 999px !important;

  background: rgba(42, 75, 71, 0.17) !important;
}

.favorite-delete-icon {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;

  width: 46px !important;
  height: 46px !important;
  margin-bottom: 10px !important;

  border-radius: 15px !important;

  background: rgba(243, 79, 97, 0.10) !important;
  color: #d84b5b !important;
}

.favorite-delete-icon svg {
  width: 23px !important;
  height: 23px !important;

  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 1.8 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
}

.favorite-delete-copy {
  width: 100% !important;

  text-align: center !important;
}

.favorite-delete-copy h2 {
  margin: 0 0 7px !important;

  color: #142825 !important;
  font-size: 18px !important;
  font-weight: 790 !important;
  line-height: 1.12 !important;
  letter-spacing: -0.018em !important;
}

.favorite-delete-copy p {
  margin: 0 auto 6px !important;

  color: #2e4440 !important;
  font-size: 12px !important;
  font-weight: 680 !important;
  line-height: 1.28 !important;
  overflow-wrap: anywhere !important;
}

.favorite-delete-copy span {
  display: block !important;

  margin: 0 auto !important;

  color: #7a8986 !important;
  font-size: 9.5px !important;
  font-weight: 520 !important;
  line-height: 1.3 !important;
}

.favorite-delete-actions {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 8px !important;

  width: 100% !important;
  margin-top: 16px !important;
}

.favorite-delete-actions > button {
  min-height: 44px !important;
  padding: 10px 12px !important;

  border-radius: 13px !important;

  font-size: 12px !important;
  font-weight: 750 !important;

  transition:
    transform 120ms ease,
    opacity 120ms ease,
    background-color 120ms ease
    !important;
}

.favorite-delete-actions > button:active:not(:disabled) {
  transform: scale(0.975) !important;
}

.favorite-delete-cancel {
  border: 1px solid rgba(20, 59, 54, 0.08) !important;

  background: rgba(239, 245, 243, 0.95) !important;
  color: #36504b !important;
}

.favorite-delete-confirm {
  border: 1px solid rgba(220, 63, 80, 0.18) !important;

  background:
    linear-gradient(
      145deg,
      rgba(229, 74, 91, 0.98),
      rgba(211, 57, 75, 0.98)
    ) !important;

  color: #ffffff !important;

  box-shadow:
    0 5px 14px rgba(216, 75, 91, 0.18) !important;
}

.favorite-delete-confirm:disabled {
  opacity: 0.58 !important;
}

/* Плавное исчезновение карточки */

.favorite-row-wrap {
  transition:
    opacity 180ms ease,
    transform 180ms ease,
    height 220ms ease,
    max-height 220ms ease,
    margin 220ms ease,
    border-width 220ms ease
    !important;
}

.favorite-row-wrap.is-removing {
  height: 0 !important;
  max-height: 0 !important;

  margin-top: 0 !important;
  margin-bottom: 0 !important;

  border-width: 0 !important;

  opacity: 0 !important;
  transform: scale(0.97) translateY(-4px) !important;
}

@media (max-height: 700px) {
  .favorite-delete-sheet {
    padding-top: 6px !important;
  }

  .favorite-delete-handle {
    margin-bottom: 8px !important;
  }

  .favorite-delete-icon {
    width: 40px !important;
    height: 40px !important;
    margin-bottom: 7px !important;
  }

  .favorite-delete-copy h2 {
    font-size: 16px !important;
  }

  .favorite-delete-actions {
    margin-top: 12px !important;
  }
}


/* ==========================================================
   Favorites UI v2.3.1
   Delete dialog final polish
   ========================================================== */

.favorite-delete-sheet {
  padding:
    7px
    16px
    max(13px, env(safe-area-inset-bottom))
    !important;
}

.favorite-delete-handle {
  margin-bottom: 9px !important;
}

.favorite-delete-icon {
  width: 38px !important;
  height: 38px !important;
  margin-bottom: 7px !important;

  border-radius: 12px !important;

  background: rgba(217, 63, 82, 0.09) !important;
  color: #d93f52 !important;
}

.favorite-delete-icon svg {
  width: 19px !important;
  height: 19px !important;
}

.favorite-delete-copy h2 {
  margin-bottom: 5px !important;
  font-size: 17px !important;
}

.favorite-delete-copy p {
  margin-bottom: 4px !important;
}

.favorite-delete-copy span {
  max-width: 360px !important;
}

.favorite-delete-actions {
  margin-top: 13px !important;
}

.favorite-delete-confirm {
  border-color: rgba(205, 50, 69, 0.18) !important;

  background:
    linear-gradient(
      145deg,
      #e44759,
      #d93f52
    ) !important;

  box-shadow:
    0 5px 14px rgba(217, 63, 82, 0.18)
    !important;
}

.favorite-delete-confirm.is-loading {
  cursor: wait !important;
  opacity: 0.74 !important;
}

/*
 * Во время подтверждённого удаления фон и окно
 * уходят немного быстрее, чем карточка начинает схлопываться.
 */

.favorite-delete-dialog.is-confirming
.favorite-delete-backdrop {
  opacity: 0 !important;

  transition-duration: 140ms !important;
}

.favorite-delete-dialog.is-confirming
.favorite-delete-sheet {
  transform: translateY(105%) !important;

  transition-duration: 170ms !important;
}

@media (max-height: 700px) {
  .favorite-delete-icon {
    width: 35px !important;
    height: 35px !important;
    margin-bottom: 5px !important;
  }

  .favorite-delete-icon svg {
    width: 17px !important;
    height: 17px !important;
  }

  .favorite-delete-copy h2 {
    font-size: 15.5px !important;
  }

  .favorite-delete-actions {
    margin-top: 10px !important;
  }
}


/* ==========================================================
   Favorites UI v2.4
   Three cards visible layout
   ========================================================== */

.favorites-panel {
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

/* Шапка остаётся компактной и стационарной */

.favorites-panel-header {
  flex: 0 0 auto !important;
  min-height: 54px !important;
  padding: 8px 12px 7px !important;
}

.favorites-panel-header h2 {
  font-size: 15px !important;
}

.favorites-close {
  width: 35px !important;
  height: 35px !important;
  min-width: 35px !important;
}

/*
 * В обычном режиме три карточки должны занимать
 * доступную высоту без визуального обрезания.
 */

.favorites-list {
  display: flex !important;
  flex: 1 1 auto !important;
  flex-direction: column !important;
  gap: 6px !important;

  min-height: 0 !important;
  padding: 7px 9px 9px !important;

  overflow-x: hidden !important;
  overflow-y: auto !important;

  scrollbar-width: none !important;
  overscroll-behavior-y: contain !important;
  -webkit-overflow-scrolling: touch !important;
}

.favorites-list::-webkit-scrollbar {
  display: none !important;
}

.favorite-row-wrap {
  flex: 0 0 auto !important;
  border-radius: 14px !important;
}

/* Информационная часть карточки */

.favorite-row {
  gap: 4px !important;
  padding: 8px 9px 6px !important;
}

.favorite-row-top {
  gap: 7px !important;
}

.favorite-title {
  font-size: 12.8px !important;
  line-height: 1.06 !important;
}

.favorite-address-line {
  font-size: 9.2px !important;
  line-height: 1.12 !important;
}

.favorite-settlement {
  font-size: 7.5px !important;
  line-height: 1.08 !important;
}

.favorite-status-badge {
  min-height: 21px !important;
  padding: 3px 7px !important;
  font-size: 7.3px !important;
}

.favorite-row-meta {
  min-height: 20px !important;
  padding: 3px 7px !important;
  font-size: 7.2px !important;
  line-height: 1.15 !important;
}

/* Четыре действия остаются удобными для пальца */

.favorite-row-actions {
  gap: 5px !important;
  padding: 5px 7px 6px !important;
}

.favorite-row-actions > button {
  height: 35px !important;
  min-height: 35px !important;
  max-height: 35px !important;

  gap: 2px !important;
  border-radius: 9px !important;

  font-size: 6.6px !important;
}

.favorite-row-actions > button .app-icon,
.favorite-history::before {
  width: 13px !important;
  height: 13px !important;
  min-width: 13px !important;
}

/* Galaxy S8+ и другие короткие экраны */

@media (max-height: 760px) {
  .favorites-panel-header {
    min-height: 48px !important;
    padding: 6px 9px 5px !important;
  }

  .favorites-panel-header h2 {
    font-size: 14px !important;
  }

  .favorites-close {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
  }

  .favorites-list {
    gap: 4px !important;
    padding: 5px 7px 6px !important;
  }

  .favorite-row {
    gap: 3px !important;
    padding: 6px 7px 5px !important;
  }

  .favorite-title {
    font-size: 12px !important;
  }

  .favorite-address-line {
    font-size: 8.6px !important;
  }

  .favorite-row-meta {
    min-height: 18px !important;
    padding: 3px 6px !important;
  }

  .favorite-row-actions {
    gap: 4px !important;
    padding: 4px 6px 5px !important;
  }

  .favorite-row-actions > button {
    height: 32px !important;
    min-height: 32px !important;
    max-height: 32px !important;

    font-size: 6.1px !important;
  }

  .favorite-row-actions > button .app-icon,
  .favorite-history::before {
    width: 12px !important;
    height: 12px !important;
    min-width: 12px !important;
  }
}


/* ==========================================================
   Favorites UI v2.4 — three visible cards
   ========================================================== */

.favorites-panel {
  display: flex !important;
  flex-direction: column !important;

  /*
   * Панель выше прежней, но не заходит под шапку карты
   * и остаётся над нижней навигацией.
   */
  max-height:
    calc(
      100dvh
      - var(--responsive-bottom-nav-height, 78px)
      - env(safe-area-inset-bottom)
      - 104px
    ) !important;

  overflow: hidden !important;
}

/* Компактная стационарная шапка */

.favorites-panel-header {
  flex: 0 0 auto !important;

  min-height: 51px !important;
  padding: 7px 11px 6px !important;
}

.favorites-panel-header h2 {
  font-size: 14.5px !important;
  line-height: 1.08 !important;
}

.favorites-kicker {
  margin-bottom: 1px !important;
  font-size: 7px !important;
}

.favorites-close {
  width: 33px !important;
  height: 33px !important;
  min-width: 33px !important;
}

/* Список занимает всё освободившееся пространство */

.favorites-list {
  display: flex !important;
  flex: 1 1 auto !important;
  flex-direction: column !important;

  min-height: 0 !important;

  gap: 5px !important;
  padding: 6px 8px 7px !important;

  overflow-x: hidden !important;
  overflow-y: auto !important;

  scrollbar-width: none !important;
  overscroll-behavior-y: contain !important;
  -webkit-overflow-scrolling: touch !important;
}

.favorites-list::-webkit-scrollbar {
  display: none !important;
}

/* Карточки чуть компактнее, без потери читаемости */

.favorite-row-wrap {
  flex: 0 0 auto !important;
  border-radius: 13px !important;
}

.favorite-row {
  gap: 3px !important;
  padding: 7px 8px 5px !important;
}

.favorite-row-top {
  gap: 6px !important;
}

.favorite-identity {
  gap: 1px !important;
}

.favorite-title {
  font-size: 12.5px !important;
  line-height: 1.05 !important;
}

.favorite-address-line {
  font-size: 8.8px !important;
  line-height: 1.1 !important;
}

.favorite-settlement {
  font-size: 7.2px !important;
  line-height: 1.05 !important;
}

.favorite-status-badge {
  min-height: 20px !important;
  padding: 3px 6px !important;

  font-size: 7px !important;
}

.favorite-status-badge i {
  width: 5px !important;
  height: 5px !important;
  min-width: 5px !important;
}

.favorite-row-meta {
  min-height: 18px !important;
  padding: 3px 6px !important;

  border-radius: 7px !important;

  font-size: 7px !important;
  line-height: 1.1 !important;
}

/* Кнопки остаются удобными для нажатия */

.favorite-row-actions {
  gap: 4px !important;
  padding: 4px 6px 5px !important;
}

.favorite-row-actions > button {
  height: 33px !important;
  min-height: 33px !important;
  max-height: 33px !important;

  gap: 1px !important;
  padding: 2px !important;

  border-radius: 8px !important;

  font-size: 6.2px !important;
  line-height: 1 !important;
}

.favorite-row-actions > button .app-icon,
.favorite-history::before {
  width: 12px !important;
  height: 12px !important;
  min-width: 12px !important;
}

/* Galaxy S8+ и другие короткие экраны */

@media (max-height: 760px) {
  .favorites-panel {
    max-height:
      calc(
        100dvh
        - var(--responsive-bottom-nav-height, 78px)
        - env(safe-area-inset-bottom)
        - 66px
      ) !important;
  }

  .favorites-panel-header {
    min-height: 45px !important;
    padding: 5px 8px 4px !important;
  }

  .favorites-panel-header h2 {
    font-size: 13.5px !important;
  }

  .favorites-close {
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
  }

  .favorites-list {
    gap: 4px !important;
    padding: 4px 6px 5px !important;
  }

  .favorite-row {
    padding: 5px 6px 4px !important;
  }

  .favorite-title {
    font-size: 11.7px !important;
  }

  .favorite-address-line {
    font-size: 8.2px !important;
  }

  .favorite-row-meta {
    min-height: 17px !important;
    padding: 2px 5px !important;
  }

  .favorite-row-actions {
    padding: 3px 5px 4px !important;
  }

  .favorite-row-actions > button {
    height: 30px !important;
    min-height: 30px !important;
    max-height: 30px !important;

    font-size: 5.8px !important;
  }

  .favorite-row-actions > button .app-icon,
  .favorite-history::before {
    width: 11px !important;
    height: 11px !important;
    min-width: 11px !important;
  }
}


/* ==========================================================
   Favorites UI v2.4.1
   Explicit full-height geometry
   ========================================================== */

.favorites-panel {
  top: 228px !important;

  right: 0 !important;
  bottom:
    calc(
      var(--responsive-bottom-nav-height, 78px)
      + env(safe-area-inset-bottom)
    )
    !important;
  left: 0 !important;

  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;

  border-radius: 22px 22px 0 0 !important;
}

/*
 * Три карточки делят доступное пространство.
 * Прокрутка остаётся только как страховка для длинного текста.
 */

.favorites-panel .favorites-list {
  display: grid !important;
  grid-template-rows: repeat(3, minmax(0, 1fr)) !important;

  align-content: stretch !important;

  overflow-y: hidden !important;
}

.favorites-panel .favorite-row-wrap {
  min-height: 0 !important;
  height: 100% !important;

  overflow: hidden !important;
}

.favorites-panel .favorite-row {
  box-sizing: border-box !important;
  height: calc(100% - 42px) !important;
  min-height: 0 !important;
}

.favorites-panel .favorite-row-actions {
  height: 42px !important;
  min-height: 42px !important;
}

/* iPhone 14 Pro Max и близкие экраны */

@media (min-height: 800px) {
  .favorites-panel {
    top: 250px !important;
  }
}

/* Galaxy S8+ и другие короткие экраны */

@media (max-height: 760px) {
  .favorites-panel {
    top: 178px !important;
  }

  .favorites-panel .favorites-list {
    gap: 3px !important;
    padding-top: 4px !important;
    padding-bottom: 4px !important;
  }

  .favorites-panel .favorite-row {
    height: calc(100% - 36px) !important;
  }

  .favorites-panel .favorite-row-actions {
    height: 36px !important;
    min-height: 36px !important;
  }
}

/* Если адресов меньше трёх — не растягиваем их искусственно */

.favorites-panel .favorites-list:has(
  .favorite-row-wrap:first-child:last-child
) {
  grid-template-rows: auto !important;
}

.favorites-panel .favorites-list:has(
  .favorite-row-wrap:nth-child(2):last-child
) {
  grid-template-rows: repeat(2, auto) !important;
  align-content: start !important;
}


/* ==========================================================
   Favorites UI v2.4.2
   Natural three-card sheet
   ========================================================== */

/*
 * Отменяем принудительную полноэкранную геометрию.
 * Панель снова растёт от содержимого, но может занять
 * большую часть экрана при необходимости.
 */

.favorites-panel {
  top: auto !important;

  right: 0 !important;
  bottom:
    calc(
      var(--responsive-bottom-nav-height, 78px)
      + env(safe-area-inset-bottom)
    )
    !important;
  left: 0 !important;

  height: auto !important;
  min-height: 0 !important;
  max-height:
    calc(
      100dvh
      - var(--responsive-bottom-nav-height, 78px)
      - env(safe-area-inset-bottom)
      - 188px
    )
    !important;

  overflow: hidden !important;
}

/*
 * Карточки имеют естественную высоту.
 * Никакого деления панели на три одинаковые строки.
 */

.favorites-panel .favorites-list {
  display: flex !important;
  flex: 0 1 auto !important;
  flex-direction: column !important;

  grid-template-rows: none !important;
  align-content: initial !important;

  gap: 7px !important;
  min-height: 0 !important;
  padding: 7px 9px 9px !important;

  overflow-x: hidden !important;
  overflow-y: auto !important;
}

.favorites-panel .favorite-row-wrap {
  flex: 0 0 auto !important;

  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;

  overflow: visible !important;
}

.favorites-panel .favorite-row {
  box-sizing: border-box !important;

  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;

  padding: 8px 10px 6px !important;
}

.favorites-panel .favorite-row-actions {
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;

  padding: 5px 8px 7px !important;
}

.favorites-panel .favorite-row-actions > button {
  height: 36px !important;
  min-height: 36px !important;
  max-height: 36px !important;
}

/* Возвращаем нормальную читаемость */

.favorites-panel .favorite-title {
  font-size: 12.5px !important;
  line-height: 1.08 !important;
}

.favorites-panel .favorite-address-line {
  font-size: 8.8px !important;
  line-height: 1.15 !important;
}

.favorites-panel .favorite-settlement {
  font-size: 7.4px !important;
  line-height: 1.12 !important;
}

/* Короткие устройства */

@media (max-height: 760px) {
  .favorites-panel {
    max-height:
      calc(
        100dvh
        - var(--responsive-bottom-nav-height, 78px)
        - env(safe-area-inset-bottom)
        - 142px
      )
      !important;
  }

  .favorites-panel .favorites-list {
    gap: 5px !important;
    padding: 5px 7px 6px !important;
  }

  .favorites-panel .favorite-row {
    padding: 6px 8px 5px !important;
  }

  .favorites-panel .favorite-row-actions {
    padding: 4px 6px 5px !important;
  }

  .favorites-panel .favorite-row-actions > button {
    height: 32px !important;
    min-height: 32px !important;
    max-height: 32px !important;
  }
}
