/* ==========================================================
   SevSvet — House Card v2
   Изолированный дизайн загруженной карточки дома.
   Корневой селектор: .house-popup-card.house-card-v2
   ========================================================== */

:root {
  --hc2-text: #122220;
  --hc2-muted: #74827f;
  --hc2-subtle: #929d9a;

  --hc2-surface: #ffffff;
  --hc2-surface-soft: #f5f8f7;
  --hc2-surface-raised: rgba(255, 255, 255, 0.92);

  --hc2-border: rgba(20, 59, 54, 0.09);
  --hc2-border-strong: rgba(20, 59, 54, 0.13);

  --hc2-green: #18b66d;
  --hc2-green-dark: #087948;
  --hc2-green-soft: #e8f8f0;

  --hc2-red: #f44f5e;
  --hc2-red-soft: #fff0f2;

  --hc2-amber: #eda31d;
  --hc2-amber-dark: #795112;
  --hc2-amber-soft: #fff7e7;

  --hc2-radius-card: 26px;
  --hc2-radius-section: 18px;
  --hc2-radius-control: 14px;

  --hc2-shadow:
    0 24px 64px rgba(6, 42, 38, 0.16),
    0 5px 16px rgba(6, 42, 38, 0.08);
}

/* Внешняя оболочка Leaflet */

.leaflet-popup:has(.house-card-v2) .leaflet-popup-content-wrapper {
  padding: 0 !important;
  overflow: hidden !important;
  border: 1px solid var(--hc2-border) !important;
  border-radius: var(--hc2-radius-card) !important;
  background: var(--hc2-surface) !important;
  box-shadow: var(--hc2-shadow) !important;
}

.leaflet-popup:has(.house-card-v2) .leaflet-popup-content {
  width: min(402px, calc(100vw - 18px)) !important;
  min-width: 0 !important;
  margin: 0 !important;
}

.leaflet-popup:has(.house-card-v2) .leaflet-popup-tip-container {
  display: none !important;
}

/* Корень карточки */

.house-popup-card.house-card-v2 {
  width: 100% !important;
  max-width: none !important;
  padding: 0 !important;
  overflow: hidden !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: var(--hc2-surface) !important;
  color: var(--hc2-text) !important;
  box-shadow: none !important;
}

/* Верх карточки */

.house-card-v2 .house-popup-chrome {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;

  min-height: 56px !important;
  padding: 16px 16px 9px 20px !important;

  border: 0 !important;
  background: transparent !important;
}

.house-card-v2 .house-popup-chrome > span {
  color: var(--hc2-muted) !important;
  font-size: 12px !important;
  font-weight: 750 !important;
  line-height: 1.2 !important;
  letter-spacing: 0.025em !important;
}

.house-card-v2 .house-popup-close {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;

  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  min-height: 38px !important;
  padding: 0 0 2px !important;

  border: 0 !important;
  border-radius: 50% !important;
  background: #f2f5f4 !important;
  color: #172725 !important;

  font-size: 25px !important;
  font-weight: 500 !important;
  line-height: 1 !important;

  box-shadow: none !important;
  transition:
    transform 140ms ease,
    background-color 140ms ease !important;
}

.house-card-v2 .house-popup-close:active {
  transform: scale(0.92) !important;
  background: #e8eeec !important;
}

/* Прокручиваемое содержимое */

.house-card-v2 .house-popup-scroll {
  max-height: min(67vh, 600px) !important;
  padding: 0 12px 12px !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain !important;
  scrollbar-width: none !important;
  background: transparent !important;
}

.house-card-v2 .house-popup-scroll::-webkit-scrollbar {
  display: none !important;
}

/* Общие секции */

.house-card-v2 .house-popup-section {
  margin: 0 0 9px !important;
  padding: 13px !important;

  border: 1px solid var(--hc2-border) !important;
  border-radius: var(--hc2-radius-section) !important;
  background: var(--hc2-surface-soft) !important;

  box-shadow: none !important;
}

.house-card-v2 .house-popup-section:last-child {
  margin-bottom: 0 !important;
}

.house-card-v2 .house-popup-title {
  margin: 0 0 9px !important;

  color: var(--hc2-muted) !important;
  font-size: 11px !important;
  font-weight: 760 !important;
  line-height: 1.25 !important;
  letter-spacing: 0.015em !important;
}

/* Адрес и основной статус */

.house-card-v2 .house-popup-header {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  gap: 7px !important;

  padding: 14px !important;
  background: #f7faf9 !important;
}

.house-card-v2 .house-popup-kicker {
  display: none !important;
}

.house-card-v2 .house-popup-address {
  display: grid !important;
  gap: 2px !important;
  margin: 0 !important;
  padding: 0 !important;

  border: 0 !important;
  background: transparent !important;
}

.house-card-v2 .house-popup-address strong {
  color: var(--hc2-text) !important;
  font-size: 18px !important;
  font-weight: 790 !important;
  line-height: 1.14 !important;
  letter-spacing: -0.02em !important;
}

.house-card-v2 .house-popup-address span {
  color: var(--hc2-muted) !important;
  font-size: 12.5px !important;
  font-weight: 500 !important;
  line-height: 1.35 !important;
}

.house-card-v2 .house-popup-status {
  display: inline-flex !important;
  align-items: center !important;
  gap: 7px !important;
  width: fit-content !important;
  min-height: 28px !important;

  margin: 1px 0 0 !important;
  padding: 5px 10px !important;

  border: 1px solid rgba(24, 182, 109, 0.22) !important;
  border-radius: 999px !important;
  background: var(--hc2-green-soft) !important;
  color: var(--hc2-green-dark) !important;

  font-size: 12px !important;
  font-weight: 780 !important;
  line-height: 1 !important;

  box-shadow: none !important;
}

.house-card-v2 .house-popup-status .house-popup-dot {
  width: 8px !important;
  height: 8px !important;
  flex: 0 0 auto !important;

  border-radius: 50% !important;
  background: var(--hc2-green) !important;
  box-shadow: 0 0 0 3px rgba(24, 182, 109, 0.11) !important;
}

/* Сводка пользовательских подтверждений */

.house-card-v2 .house-popup-community-signal {
  display: grid !important;
  gap: 3px !important;

  margin: 0 0 8px !important;
  padding: 11px 12px !important;

  border: 0 !important;
  border-radius: 14px !important;
  background: var(--hc2-surface) !important;
}

.house-card-v2 .house-popup-community-signal strong {
  color: var(--hc2-text) !important;
  font-size: 13px !important;
  font-weight: 760 !important;
  line-height: 1.3 !important;
}

.house-card-v2 .house-popup-community-signal span {
  color: var(--hc2-muted) !important;
  font-size: 12px !important;
  line-height: 1.35 !important;
}

.house-card-v2 .house-popup-votes {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 7px !important;

  margin: 0 0 7px !important;
}

.house-card-v2 .house-popup-votes > div {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;

  min-width: 0 !important;
  min-height: 38px !important;
  padding: 8px 10px !important;

  border: 0 !important;
  border-radius: 13px !important;
  background: var(--hc2-surface) !important;
}

.house-card-v2 .house-popup-votes span {
  overflow: hidden !important;
  color: var(--hc2-muted) !important;
  font-size: 11px !important;
  line-height: 1.2 !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.house-card-v2 .house-popup-votes strong {
  flex: 0 0 auto !important;
  margin: 0 !important;
  color: var(--hc2-text) !important;
  font-size: 15px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
}

.house-card-v2 .house-popup-note {
  margin: 0 0 5px !important;
  padding: 8px 10px !important;

  border: 0 !important;
  border-radius: 12px !important;
  background: rgba(255, 255, 255, 0.7) !important;

  color: var(--hc2-muted) !important;
  font-size: 11.5px !important;
  line-height: 1.35 !important;
}

.house-card-v2 .house-popup-note:last-child {
  margin-bottom: 0 !important;
}

/* Отключения */

.house-card-v2 [data-popup-outages-section] {
  background: #f6f9f8 !important;
}

.house-card-v2 .outage-card {
  margin: 0 0 7px !important;
  padding: 12px !important;

  border: 1px solid rgba(237, 163, 29, 0.24) !important;
  border-radius: 15px !important;
  background: var(--hc2-amber-soft) !important;

  box-shadow: none !important;
}

.house-card-v2 .outage-card:last-child {
  margin-bottom: 0 !important;
}

.house-card-v2 .outage-card strong,
.house-card-v2 .outage-title {
  color: #2b281f !important;
  font-size: 13px !important;
  font-weight: 780 !important;
  line-height: 1.3 !important;
}

.house-card-v2 .outage-card time,
.house-card-v2 .outage-time {
  display: block !important;
  margin-top: 5px !important;

  color: var(--hc2-amber-dark) !important;
  font-size: 13px !important;
  font-weight: 760 !important;
  line-height: 1.3 !important;
}

.house-card-v2 .outage-description {
  margin-top: 7px !important;
  color: #7c725e !important;
  font-size: 12px !important;
  line-height: 1.4 !important;
}

/* Нижние действия */

.house-card-v2 .house-popup-sticky-actions {
  position: sticky !important;
  bottom: 0 !important;
  z-index: 5 !important;

  margin: 0 !important;
  padding:
    11px 12px
    calc(11px + env(safe-area-inset-bottom)) !important;

  border-top: 1px solid var(--hc2-border) !important;
  background: rgba(255, 255, 255, 0.965) !important;

  box-shadow: 0 -12px 28px rgba(8, 43, 39, 0.055) !important;
  backdrop-filter: blur(18px) saturate(135%) !important;
}

.house-card-v2 .house-popup-actions,
.house-card-v2 .house-popup-secondary-actions {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 7px !important;
}

.house-card-v2 .house-popup-secondary-actions {
  margin-top: 8px !important;
}

.house-card-v2 .house-popup-action,
.house-card-v2 .house-popup-favorite-action,
.house-card-v2 .house-popup-history-action {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;

  min-width: 0 !important;
  min-height: 42px !important;
  padding: 10px 11px !important;

  border: 0 !important;
  border-radius: var(--hc2-radius-control) !important;

  font-size: 12.5px !important;
  font-weight: 780 !important;
  line-height: 1.15 !important;

  box-shadow: none !important;
  transition:
    transform 130ms ease,
    opacity 130ms ease,
    filter 130ms ease !important;
}

.house-card-v2 .house-popup-action:active,
.house-card-v2 .house-popup-favorite-action:active,
.house-card-v2 .house-popup-history-action:active {
  transform: scale(0.975) !important;
}

.house-card-v2 .house-popup-action.is-online {
  background: var(--hc2-green) !important;
  color: #ffffff !important;
}

.house-card-v2 .house-popup-action.is-offline {
  background: var(--hc2-red) !important;
  color: #ffffff !important;
}

.house-card-v2 .house-popup-favorite-action,
.house-card-v2 .house-popup-history-action {
  background: #eaf2f0 !important;
  color: #0a6660 !important;
}

.house-card-v2 .house-popup-favorite-action.is-active {
  background: #057b76 !important;
  color: #ffffff !important;
}

.house-card-v2 .house-popup-action.is-disabled,
.house-card-v2 .house-popup-history-action.is-disabled {
  opacity: 0.47 !important;
  filter: saturate(0.55) !important;
}

.house-card-v2 .house-popup-limit-note {
  margin: 7px 4px 0 !important;
  color: var(--hc2-muted) !important;
  font-size: 10.5px !important;
  line-height: 1.35 !important;
  text-align: center !important;
}

/* Toast/cooldown внутри карточки */

.house-card-v2 .house-popup-toast,
.house-card-v2 .house-popup-vote-toast {
  margin: 0 12px 8px !important;
  padding: 11px 14px !important;

  border-radius: 16px !important;
  background: rgba(10, 48, 43, 0.94) !important;
  color: #ffffff !important;

  font-size: 12px !important;
  font-weight: 700 !important;
  line-height: 1.35 !important;

  box-shadow: 0 10px 24px rgba(7, 40, 36, 0.22) !important;
}

/* Мобильные размеры */

@media (max-width: 480px) {
  .leaflet-popup:has(.house-card-v2) .leaflet-popup-content {
    width: calc(100vw - 16px) !important;
  }

  .house-card-v2 .house-popup-scroll {
    max-height: min(65vh, 555px) !important;
  }
}

@media (max-height: 720px) {
  .house-card-v2 .house-popup-scroll {
    max-height: 54vh !important;
  }

  .house-card-v2 .house-popup-chrome {
    min-height: 50px !important;
    padding-top: 12px !important;
  }
}

/* House Card v2.1 — compact layout */

.house-card-v2 .house-popup-chrome {
  min-height: 46px !important;
  padding: 11px 13px 5px 16px !important;
}

.house-card-v2 .house-popup-chrome > span {
  font-size: 11px !important;
}

.house-card-v2 .house-popup-close {
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  min-height: 34px !important;
}

.house-card-v2 .house-popup-scroll {
  padding: 0 10px 9px !important;
}

.house-card-v2 .house-popup-section {
  margin-bottom: 7px !important;
  padding: 11px !important;
  border-radius: 16px !important;
}

.house-card-v2 .house-popup-header {
  gap: 5px !important;
  padding: 12px !important;
}

.house-card-v2 .house-popup-address strong {
  font-size: 17px !important;
}

.house-card-v2 .house-popup-status {
  min-height: 25px !important;
  padding: 4px 9px !important;
}

.house-card-v2 .house-popup-community-signal {
  margin-bottom: 6px !important;
  padding: 9px 10px !important;
}

.house-card-v2 .house-popup-votes {
  margin-bottom: 5px !important;
}

.house-card-v2 .house-popup-votes > div {
  min-height: 34px !important;
  padding: 7px 9px !important;
}

.house-card-v2 .house-popup-note {
  margin-bottom: 4px !important;
  padding: 7px 9px !important;
}

.house-card-v2 .outage-card {
  padding: 10px !important;
}

.house-card-v2 .house-popup-sticky-actions {
  padding:
    9px 10px
    calc(9px + env(safe-area-inset-bottom)) !important;
}

.house-card-v2 .house-popup-action,
.house-card-v2 .house-popup-favorite-action,
.house-card-v2 .house-popup-history-action {
  min-height: 40px !important;
}

.house-card-v2 .house-popup-secondary-actions {
  margin-top: 6px !important;
}

.house-card-v2 .house-popup-limit-note {
  margin-top: 5px !important;
}

/* House Card v3 — базовый каркас */

.house-card-v2 .house-popup-scroll {
  padding: 0 16px 10px !important;
}

.house-card-v2 .house-popup-section {
  margin: 0 !important;
  padding: 16px 0 !important;
  border: 0 !important;
  border-bottom: 1px solid rgba(20, 59, 54, 0.09) !important;
  border-radius: 0 !important;
  background: transparent !important;
}

.house-card-v2 .house-popup-section:last-child {
  border-bottom: 0 !important;
}

.house-card-v2 .house-popup-header {
  padding-top: 8px !important;
}

.house-card-v2 .house-popup-community-signal,
.house-card-v2 .house-popup-votes > div,
.house-card-v2 .house-popup-note {
  border: 0 !important;
  box-shadow: none !important;
}

.house-card-v2 [data-popup-outages-section] {
  background: transparent !important;
}


/* House Card v3.1 — confirmations */

.house-card-v2 .house-popup-title {
  margin-bottom: 12px !important;
  color: #6f7e7b !important;
  font-size: 11px !important;
  font-weight: 800 !important;
}

.house-card-v2 .house-popup-community-signal {
  margin: 0 0 10px !important;
  padding: 0 10px !important;
  background: transparent !important;
}

.house-card-v2 .house-popup-votes {
  margin: 0 0 10px !important;
  padding: 0 10px !important;
}

.house-card-v2 .house-popup-votes > div {
  min-height: 30px !important;
  padding: 4px 0 !important;
  background: transparent !important;
}

.house-card-v2 .house-popup-note {
  margin: 0 !important;
  padding: 7px 10px !important;
  background: transparent !important;
}

.house-card-v2 .house-popup-note + .house-popup-note {
  border-top: 1px solid rgba(20, 59, 54, 0.055) !important;
}

/* House History v1 — timeline */

.history-event {
  position: relative !important;
  display: grid !important;
  grid-template-columns: 22px minmax(0, 1fr) !important;
  gap: 10px !important;
  margin: 0 !important;
  padding: 0 0 18px !important;
  background: transparent !important;
}

.history-event:last-child {
  padding-bottom: 0 !important;
}

.history-event::before {
  content: "" !important;
  position: absolute !important;
  top: 16px !important;
  bottom: -2px !important;
  left: 7px !important;
  width: 2px !important;
  border-radius: 999px !important;
  background: rgba(20, 59, 54, 0.10) !important;
}

.history-event:last-child::before {
  display: none !important;
}

.history-event-marker {
  position: relative !important;
  z-index: 2 !important;
  width: 14px !important;
  height: 14px !important;
  margin-top: 3px !important;
  border: 3px solid #ffffff !important;
  border-radius: 50% !important;
  background: #98a5a2 !important;
  box-shadow: 0 0 0 1px rgba(20, 59, 54, 0.12) !important;
}

.history-event.is-online .history-event-marker {
  background: #18b66d !important;
  box-shadow:
    0 0 0 1px rgba(24, 182, 109, 0.24),
    0 0 0 5px rgba(24, 182, 109, 0.08) !important;
}

.history-event.is-offline .history-event-marker {
  background: #f44f5e !important;
  box-shadow:
    0 0 0 1px rgba(244, 79, 94, 0.24),
    0 0 0 5px rgba(244, 79, 94, 0.08) !important;
}

.history-event.is-planned .history-event-marker {
  background: #eda31d !important;
  box-shadow:
    0 0 0 1px rgba(237, 163, 29, 0.28),
    0 0 0 5px rgba(237, 163, 29, 0.09) !important;
}

.history-event-body {
  min-width: 0 !important;
  padding: 0 0 2px !important;
}

.history-event-meta {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
  margin-bottom: 4px !important;
}

.history-event-meta span {
  color: #74827f !important;
  font-size: 11px !important;
  font-weight: 650 !important;
  line-height: 1.25 !important;
}

.history-event-meta em {
  color: #93a09d !important;
  font-size: 10px !important;
  font-style: normal !important;
  font-weight: 650 !important;
  line-height: 1.25 !important;
}

.history-event h3 {
  margin: 0 !important;
  color: #122220 !important;
  font-size: 14px !important;
  font-weight: 780 !important;
  line-height: 1.3 !important;
}

.history-event p {
  margin: 5px 0 0 !important;
  color: #74827f !important;
  font-size: 12px !important;
  line-height: 1.4 !important;
}


/* House Card v2.1 — compact unified layout */

.house-popup-card {
  --house-card-border: rgba(20, 59, 54, 0.08);
  --house-card-divider: rgba(20, 59, 54, 0.07);
  --house-card-muted: #74827f;
  --house-card-surface: rgba(255, 255, 255, 0.96);
}

/* Верх карточки */

.house-popup-header {
  padding-top: 8px !important;
  padding-bottom: 12px !important;
}

.house-popup-address {
  gap: 2px !important;
}

.house-popup-address strong {
  font-size: 17px !important;
  line-height: 1.15 !important;
}

.house-popup-address span {
  font-size: 12px !important;
  line-height: 1.25 !important;
}

.house-popup-status {
  margin-top: 7px !important;
}

/* Общие секции */

.house-popup-section {
  padding-top: 14px !important;
  padding-bottom: 14px !important;
}

.house-popup-section + .house-popup-section {
  border-top: 1px solid var(--house-card-divider) !important;
}

.house-popup-section-label {
  margin-bottom: 9px !important;

  font-size: 11px !important;
  line-height: 1.2 !important;
}

/* Подтверждения */

.house-popup-community {
  gap: 8px !important;
}

.house-popup-community .house-popup-title {
  margin: 0 !important;

  font-size: 13px !important;
  line-height: 1.25 !important;
}

.house-popup-community .house-popup-note {
  margin-top: 3px !important;

  font-size: 11px !important;
  line-height: 1.3 !important;
}

.house-popup-community-stats {
  margin-top: 8px !important;
  padding: 0 !important;
}

.house-popup-community-stat {
  min-height: 34px !important;
  padding: 5px 8px !important;
}

.house-popup-community-stat span {
  font-size: 10px !important;
}

.house-popup-community-stat strong {
  font-size: 15px !important;
}

.house-popup-community-meta {
  margin-top: 8px !important;

  font-size: 10.5px !important;
  line-height: 1.3 !important;
}

.house-popup-community-message,
.house-popup-community-lock {
  min-height: 34px !important;
  margin-top: 6px !important;
  padding: 8px 10px !important;

  border-radius: 12px !important;

  font-size: 10.5px !important;
  line-height: 1.25 !important;
}

/* Убираем повторную подсказку внутри блока.
   Нижняя подсказка под кнопками остаётся. */

.house-popup-community .house-popup-community-lock:last-child {
  display: none !important;
}

/* Отключения */

.house-popup-outages {
  gap: 8px !important;
}

.house-popup-outage-card {
  padding: 11px !important;
  border-radius: 14px !important;
}

.house-popup-outage-card strong {
  font-size: 12px !important;
}

.house-popup-outage-card .outage-description {
  margin-top: 6px !important;

  font-size: 10.5px !important;
  line-height: 1.35 !important;
}

/* Нижняя панель действий */

.house-popup-actions {
  padding: 9px 12px max(10px, env(safe-area-inset-bottom)) !important;
  gap: 7px !important;

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

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

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

.house-popup-actions-grid {
  gap: 7px !important;
}

.house-popup-actions button {
  min-height: 40px !important;
  padding: 8px 10px !important;

  border-radius: 13px !important;

  font-size: 11px !important;
  font-weight: 720 !important;
}

.house-popup-actions-note {
  margin-top: 2px !important;

  font-size: 9.5px !important;
  line-height: 1.25 !important;
}

/* Disabled-кнопки остаются понятными, но не выглядят «выключенными наглухо» */

.house-popup-actions button:disabled {
  opacity: 0.58 !important;
}

/* Крестик */

.house-popup-close {
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
}

/* Ручка */

.house-popup-card::before {
  width: 36px !important;
  height: 4px !important;
}

@media (max-width: 390px) {
  .house-popup-section {
    padding-top: 12px !important;
    padding-bottom: 12px !important;
  }

  .house-popup-address strong {
    font-size: 16px !important;
  }

  .house-popup-actions button {
    min-height: 38px !important;
  }
}


/* House Card v2.2 — equal action buttons */

.house-popup-actions-grid,
.house-popup-actions-row,
.house-popup-actions-primary,
.house-popup-actions-secondary {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  width: 100% !important;
  gap: 7px !important;
}

.house-popup-actions-grid > *,
.house-popup-actions-row > *,
.house-popup-actions-primary > *,
.house-popup-actions-secondary > * {
  min-width: 0 !important;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
}

.house-popup-actions button,
.house-popup-actions a {
  box-sizing: border-box !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  flex: none !important;
}

/* Оба ряда одинаковой ширины относительно контейнера */

.house-popup-actions {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
}

.house-popup-actions > * {
  width: 100% !important;
}


/* House Card v2.3 — all action buttons same size */

.house-popup-actions-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  grid-auto-rows: 42px !important;

  width: 100% !important;
  gap: 8px !important;
}

.house-popup-actions-grid > * {
  width: 100% !important;
  min-width: 0 !important;
  height: 42px !important;
  min-height: 42px !important;
  max-height: 42px !important;
  margin: 0 !important;
}

.house-popup-actions-grid button,
.house-popup-actions-grid a {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 5px !important;

  box-sizing: border-box !important;

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

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

  padding: 0 10px !important;
  margin: 0 !important;

  border-radius: 13px !important;

  font-size: 11px !important;
  font-weight: 720 !important;
  line-height: 1 !important;
  white-space: nowrap !important;

  flex: none !important;
}

/* Иконки не должны менять высоту кнопок */

.house-popup-actions-grid button svg,
.house-popup-actions-grid a svg {
  width: 15px !important;
  height: 15px !important;
  min-width: 15px !important;
  flex: 0 0 auto !important;
}

/* Disabled-состояние сохраняет тот же размер */

.house-popup-actions-grid button:disabled,
.house-popup-actions-grid a[aria-disabled="true"] {
  height: 42px !important;
  min-height: 42px !important;
  max-height: 42px !important;
}


/* House Card v2.4 — equal real action rows */

.house-popup-sticky-actions {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 8px !important;
}

.house-popup-sticky-actions > .house-popup-actions,
.house-popup-sticky-actions > .house-popup-secondary-actions {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  grid-auto-columns: minmax(0, 1fr) !important;

  width: 100% !important;
  margin: 0 !important;
  gap: 8px !important;
}

.house-popup-sticky-actions > .house-popup-actions > *,
.house-popup-sticky-actions > .house-popup-secondary-actions > * {
  box-sizing: border-box !important;

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

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

  margin: 0 !important;
  padding: 0 10px !important;

  border-radius: 13px !important;

  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 5px !important;

  flex: none !important;

  font-size: 11px !important;
  font-weight: 720 !important;
  line-height: 1 !important;
  text-align: center !important;
  white-space: nowrap !important;
}

.house-popup-sticky-actions .house-popup-action,
.house-popup-sticky-actions .house-popup-history-action,
.house-popup-sticky-actions .favorite-button,
.house-popup-sticky-actions [data-favorite-house],
.house-popup-sticky-actions [data-popup-favorite] {
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;

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

  margin: 0 !important;
  flex: none !important;
}

/* Текстовая подсказка не превращается в элемент сетки */

.house-popup-sticky-actions > .house-popup-limit-note {
  width: 100% !important;
  margin: 0 !important;
}


/* House Card v2.5 — identical action row width */

.house-popup-sticky-actions {
  box-sizing: border-box !important;
  width: 100% !important;
  padding:
    10px
    12px
    max(10px, env(safe-area-inset-bottom)) !important;
}

/* У верхнего ряда раньше были собственные боковые отступы */
.house-popup-sticky-actions > .house-popup-actions,
.house-popup-sticky-actions > .house-popup-secondary-actions {
  box-sizing: border-box !important;

  width: 100% !important;
  max-width: none !important;

  margin: 0 !important;
  padding: 0 !important;

  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  gap: 8px !important;
}

/* Сбрасываем возможные старые отступы конкретно у верхней строки */
.house-popup-sticky-actions > .house-popup-actions {
  inset: auto !important;
  left: auto !important;
  right: auto !important;
}

/* Все четыре кнопки имеют совершенно одинаковую геометрию */
.house-popup-sticky-actions > .house-popup-actions > *,
.house-popup-sticky-actions > .house-popup-secondary-actions > * {
  box-sizing: border-box !important;

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

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

  margin: 0 !important;
  padding: 0 10px !important;

  border-radius: 13px !important;

  flex: none !important;
}

/* Подсказка под кнопками располагается по общей ширине */
.house-popup-sticky-actions > .house-popup-limit-note {
  box-sizing: border-box !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 4px !important;
}


/* House Card v2.6 — status-first hero header */

.house-popup-hero {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;

  gap: 7px !important;
  padding-top: 8px !important;
  padding-bottom: 14px !important;
}

.house-popup-hero .house-popup-status {
  order: 1 !important;

  width: fit-content !important;
  margin: 0 !important;
}

.house-popup-hero .house-popup-address {
  order: 2 !important;

  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  gap: 3px !important;

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

.house-popup-hero .house-popup-address strong {
  display: block !important;

  color: #142825 !important;
  font-size: 18px !important;
  font-weight: 780 !important;
  line-height: 1.15 !important;
  letter-spacing: -0.015em !important;
}

.house-popup-hero .house-popup-address span {
  display: block !important;

  color: #74827f !important;
  font-size: 11.5px !important;
  font-weight: 520 !important;
  line-height: 1.25 !important;
}

.house-popup-hero + .house-popup-section {
  border-top: 1px solid rgba(20, 59, 54, 0.07) !important;
}

@media (max-width: 390px) {
  .house-popup-hero .house-popup-address strong {
    font-size: 17px !important;
  }
}


/* House Card v2.7 — community status card */

.house-popup-community-section {
  --community-neutral: #8b9895;
  --community-online: #16b96f;
  --community-offline: #f34f61;
}

.house-popup-community-card {
  position: relative;

  display: flex;
  flex-direction: column;
  gap: 10px;

  margin-top: 10px;
  padding: 12px;

  border: 1px solid rgba(20, 59, 54, 0.10);
  border-radius: 15px;

  background: rgba(247, 250, 249, 0.78);

  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    box-shadow 160ms ease;
}

/* Есть свет преобладает */

.house-popup-community-card.is-online {
  border-color: rgba(22, 185, 111, 0.60);

  background:
    linear-gradient(
      135deg,
      rgba(22, 185, 111, 0.075),
      rgba(255, 255, 255, 0.88) 62%
    );

  box-shadow:
    inset 3px 0 0 rgba(22, 185, 111, 0.82),
    0 4px 14px rgba(22, 185, 111, 0.055);
}

/* Нет света преобладает */

.house-popup-community-card.is-offline {
  border-color: rgba(243, 79, 97, 0.58);

  background:
    linear-gradient(
      135deg,
      rgba(243, 79, 97, 0.075),
      rgba(255, 255, 255, 0.88) 62%
    );

  box-shadow:
    inset 3px 0 0 rgba(243, 79, 97, 0.82),
    0 4px 14px rgba(243, 79, 97, 0.055);
}

/* Нет голосов или равенство */

.house-popup-community-card.is-neutral {
  border-color: rgba(20, 59, 54, 0.09);
  background: rgba(247, 250, 249, 0.72);
}

/* Верхний вывод сообщества */

.house-popup-community-card .house-popup-community-signal {
  display: flex;
  flex-direction: column;
  gap: 3px;

  margin: 0;
  padding: 0;

  border: 0;
  background: transparent;
}

.house-popup-community-card .house-popup-community-signal strong {
  color: #142825;
  font-size: 12.5px;
  font-weight: 760;
  line-height: 1.25;
}

.house-popup-community-card .house-popup-community-signal span {
  color: #74827f;
  font-size: 10.5px;
  line-height: 1.3;
}

/* Счётчики */

.house-popup-community-card .house-popup-votes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));

  width: 100%;
  margin: 0;
  padding: 0;

  border-top: 1px solid rgba(20, 59, 54, 0.065);
  border-bottom: 1px solid rgba(20, 59, 54, 0.065);
}

.house-popup-community-card .house-popup-vote {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;

  min-width: 0;
  min-height: 40px;
  padding: 7px 9px;
}

.house-popup-community-card .house-popup-vote + .house-popup-vote {
  border-left: 1px solid rgba(20, 59, 54, 0.065);
}

.house-popup-community-card .house-popup-vote span {
  color: #74827f;
  font-size: 10px;
  font-weight: 620;
  line-height: 1.15;
}

.house-popup-community-card .house-popup-vote strong {
  color: #142825;
  font-size: 16px;
  font-weight: 790;
  line-height: 1;
}

/* Цвет победившего статуса */

.house-popup-community-card.is-online
  .house-popup-vote.is-online span,
.house-popup-community-card.is-online
  .house-popup-vote.is-online strong {
  color: var(--community-online);
}

.house-popup-community-card.is-offline
  .house-popup-vote.is-offline span,
.house-popup-community-card.is-offline
  .house-popup-vote.is-offline strong {
  color: var(--community-offline);
}

/* Последнее подтверждение внутри цветной карточки */

.house-popup-community-card .house-popup-last-confirmation {
  margin: 0;
  padding: 0;

  border: 0;
  border-radius: 0;
  background: transparent;

  color: #74827f;
  font-size: 10px;
  line-height: 1.3;
}

/* Сообщение пользователя и таймер остаются отдельными строками */

.house-popup-community-card
  + .house-popup-note {
  margin-top: 8px !important;
}

@media (max-width: 390px) {
  .house-popup-community-card {
    padding: 10px;
  }

  .house-popup-community-card .house-popup-vote {
    padding: 6px 7px;
  }
}


/* ===========================================================
   House Card v2.8
   Compact address header
   =========================================================== */

.house-popup-hero {
    display:flex !important;
    flex-direction:column !important;
    gap:8px !important;

    padding-top:2px !important;
    padding-bottom:10px !important;
}

.house-popup-hero .house-popup-address{
    display:grid !important;
    grid-template-columns:minmax(0,1fr) auto !important;
    grid-template-areas:
        "title status"
        "city status";
    align-items:center;
    column-gap:12px;
    row-gap:3px;
    width:100%;
}

.house-popup-hero .house-popup-address strong{
    grid-area:title;

    margin:0 !important;

    font-size:18px !important;
    font-weight:780 !important;
    line-height:1.12 !important;
}

.house-popup-hero .house-popup-address span{
    grid-area:city;

    margin:0 !important;

    font-size:11px !important;
    color:#788582;
}

.house-popup-hero .house-popup-status{
    grid-area:status;

    justify-self:end;
    align-self:center;

    margin:0 !important;

    white-space:nowrap;

    transform:translateY(-1px);
}

.house-popup-hero .house-popup-status span{
    font-size:13px;
    font-weight:700;
}

.house-popup-hero .house-popup-dot{
    width:8px;
    height:8px;
}

@media (max-width:390px){

    .house-popup-hero .house-popup-address{
        column-gap:10px;
    }

    .house-popup-hero .house-popup-address strong{
        font-size:17px !important;
    }

}


/* House Card v2.9 — status left, address right */

.house-popup-hero {
  display: block !important;
  padding-top: 4px !important;
  padding-bottom: 12px !important;
}

.house-popup-hero-row {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) !important;
  align-items: center !important;
  gap: 11px !important;

  width: 100% !important;
}

.house-popup-hero-row .house-popup-status {
  align-self: center !important;
  justify-self: start !important;

  width: max-content !important;
  max-width: 100% !important;
  margin: 0 !important;

  white-space: nowrap !important;
  transform: none !important;
}

.house-popup-hero-row .house-popup-address {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  gap: 3px !important;

  min-width: 0 !important;
  width: 100% !important;
  margin: 0 !important;
}

.house-popup-hero-row .house-popup-address strong {
  display: block !important;
  width: 100% !important;
  margin: 0 !important;

  overflow-wrap: anywhere !important;

  color: #142825 !important;
  font-size: 17px !important;
  font-weight: 780 !important;
  line-height: 1.15 !important;
  letter-spacing: -0.015em !important;
}

.house-popup-hero-row .house-popup-address span {
  display: block !important;
  margin: 0 !important;

  color: #74827f !important;
  font-size: 11px !important;
  font-weight: 520 !important;
  line-height: 1.2 !important;
}

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

@media (max-width: 390px) {
  .house-popup-hero-row {
    gap: 8px !important;
  }

  .house-popup-hero-row .house-popup-status {
    padding-left: 8px !important;
    padding-right: 8px !important;
  }

  .house-popup-hero-row .house-popup-status span {
    font-size: 10px !important;
  }

  .house-popup-hero-row .house-popup-address strong {
    font-size: 16px !important;
  }
}


/* House Card v2.9.1 — fix old v2.8 grid conflict */

.house-popup-hero-row {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) !important;
  grid-template-rows: auto !important;
  grid-template-areas: none !important;

  align-items: center !important;
  column-gap: 11px !important;
  row-gap: 0 !important;
}

/* Статус — строго первая колонка */

.house-popup-hero-row > .house-popup-status {
  grid-area: auto !important;
  grid-column: 1 !important;
  grid-row: 1 !important;

  order: 0 !important;
  align-self: center !important;
  justify-self: start !important;

  margin: 0 !important;
  transform: none !important;
}

/* Адрес — строго вторая колонка */

.house-popup-hero-row > .house-popup-address {
  grid-area: auto !important;
  grid-column: 2 !important;
  grid-row: 1 !important;

  order: 0 !important;

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

  min-width: 0 !important;
  width: 100% !important;
  margin: 0 !important;
}

/* Сбрасываем grid-area у внутренних строк адреса */

.house-popup-hero-row > .house-popup-address > strong,
.house-popup-hero-row > .house-popup-address > span {
  grid-area: auto !important;
}

@media (max-width: 390px) {
  .house-popup-hero-row {
    grid-template-columns: auto minmax(0, 1fr) !important;
    column-gap: 8px !important;
  }
}


/* House Card v3.0 — two-line status card and right-aligned address */

.house-popup-hero {
  padding-top: 4px !important;
  padding-bottom: 12px !important;
}

.house-popup-hero-row {
  display: grid !important;
  grid-template-columns:
    minmax(126px, 0.85fr)
    minmax(0, 1.45fr) !important;

  grid-template-rows: auto !important;
  grid-template-areas: none !important;

  align-items: stretch !important;
  gap: 12px !important;

  width: 100% !important;
}

/* Статусная карточка слева */

.house-popup-hero-row > .house-popup-status {
  grid-area: auto !important;
  grid-column: 1 !important;
  grid-row: 1 !important;

  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 9px !important;

  box-sizing: border-box !important;

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

  margin: 0 !important;
  padding: 9px 10px !important;

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

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

  white-space: normal !important;
  transform: none !important;
}

/* Крупная статусная точка */

.house-popup-status-icon {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;

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

  border-radius: 50% !important;

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

.house-popup-status-icon .house-popup-dot {
  width: 12px !important;
  height: 12px !important;
  min-width: 12px !important;
  margin: 0 !important;

  box-shadow: 0 0 0 5px rgba(139, 152, 149, 0.10) !important;
}

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

.house-popup-status-copy {
  display: flex !important;
  flex: 1 1 auto !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  justify-content: center !important;
  gap: 2px !important;

  min-width: 0 !important;

  text-align: left !important;
}

.house-popup-status-copy strong {
  display: block !important;

  color: #15332f !important;
  font-size: 12px !important;
  font-weight: 760 !important;
  line-height: 1.12 !important;
}

.house-popup-status-copy small {
  display: block !important;

  color: #74827f !important;
  font-size: 8.5px !important;
  font-weight: 520 !important;
  line-height: 1.18 !important;
}

/* Зелёное состояние */

.house-popup-status.is-online,
.house-popup-status.online,
.house-popup-status.has-light {
  border-color: rgba(22, 185, 111, 0.35) !important;

  background:
    linear-gradient(
      135deg,
      rgba(22, 185, 111, 0.09),
      rgba(255, 255, 255, 0.86)
    ) !important;
}

.house-popup-status.is-online .house-popup-status-icon,
.house-popup-status.online .house-popup-status-icon,
.house-popup-status.has-light .house-popup-status-icon {
  background: rgba(22, 185, 111, 0.13) !important;
}

.house-popup-status.is-online .house-popup-dot,
.house-popup-status.online .house-popup-dot,
.house-popup-status.has-light .house-popup-dot {
  background: #16b96f !important;
  box-shadow: 0 0 0 5px rgba(22, 185, 111, 0.12) !important;
}

.house-popup-status.is-online .house-popup-status-copy strong,
.house-popup-status.online .house-popup-status-copy strong,
.house-popup-status.has-light .house-popup-status-copy strong {
  color: #118854 !important;
}

/* Красное состояние */

.house-popup-status.is-offline,
.house-popup-status.offline,
.house-popup-status.no-light {
  border-color: rgba(243, 79, 97, 0.35) !important;

  background:
    linear-gradient(
      135deg,
      rgba(243, 79, 97, 0.09),
      rgba(255, 255, 255, 0.86)
    ) !important;
}

.house-popup-status.is-offline .house-popup-status-icon,
.house-popup-status.offline .house-popup-status-icon,
.house-popup-status.no-light .house-popup-status-icon {
  background: rgba(243, 79, 97, 0.13) !important;
}

.house-popup-status.is-offline .house-popup-dot,
.house-popup-status.offline .house-popup-dot,
.house-popup-status.no-light .house-popup-dot {
  background: #f34f61 !important;
  box-shadow: 0 0 0 5px rgba(243, 79, 97, 0.12) !important;
}

.house-popup-status.is-offline .house-popup-status-copy strong,
.house-popup-status.offline .house-popup-status-copy strong,
.house-popup-status.no-light .house-popup-status-copy strong {
  color: #d83d50 !important;
}

/* Адрес справа */

.house-popup-hero-row > .house-popup-address {
  grid-area: auto !important;
  grid-column: 2 !important;
  grid-row: 1 !important;

  display: flex !important;
  flex-direction: column !important;
  align-items: flex-end !important;
  justify-content: center !important;
  gap: 4px !important;

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

  text-align: right !important;
}

.house-popup-hero-row > .house-popup-address > strong {
  grid-area: auto !important;

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

  overflow-wrap: anywhere !important;

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

.house-popup-hero-row > .house-popup-address > span {
  grid-area: auto !important;

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

  color: #74827f !important;
  font-size: 11px !important;
  font-weight: 520 !important;
  line-height: 1.2 !important;
  text-align: right !important;
}

/* Компактная адаптация */

@media (max-width: 390px) {
  .house-popup-hero-row {
    grid-template-columns:
      minmax(116px, 0.82fr)
      minmax(0, 1.38fr) !important;

    gap: 9px !important;
  }

  .house-popup-hero-row > .house-popup-status {
    min-height: 54px !important;
    padding: 8px !important;
    gap: 7px !important;
  }

  .house-popup-status-icon {
    width: 27px !important;
    height: 27px !important;
    min-width: 27px !important;
  }

  .house-popup-status-icon .house-popup-dot {
    width: 10px !important;
    height: 10px !important;
    min-width: 10px !important;
  }

  .house-popup-status-copy strong {
    font-size: 11px !important;
  }

  .house-popup-status-copy small {
    font-size: 7.8px !important;
  }

  .house-popup-hero-row > .house-popup-address > strong {
    font-size: 16px !important;
  }
}


/* ==========================================================
   House Card v3.2 — Galaxy compact WOW layout
   ========================================================== */

/* Карточка ограничена реальной высотой окна браузера */

.house-popup-card {
  display: flex !important;
  flex-direction: column !important;

  box-sizing: border-box !important;

  width: 100% !important;
  max-height: calc(100dvh - 4px) !important;

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

  overscroll-behavior: contain !important;
  -webkit-overflow-scrolling: touch !important;
}

/* Шапка: статусу чуть больше пространства */

.house-popup-hero-row {
  display: grid !important;
  grid-template-columns:
    minmax(0, 1.26fr)
    minmax(0, 1fr) !important;

  align-items: stretch !important;
  gap: 8px !important;

  width: 100% !important;
}

/* Статусная карточка */

.house-popup-hero-row > .house-popup-status {
  display: grid !important;
  grid-template-columns: 27px minmax(0, 1fr) !important;
  align-items: center !important;
  column-gap: 8px !important;

  box-sizing: border-box !important;

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

  margin: 0 !important;
  padding: 7px 9px !important;

  border-radius: 14px !important;

  overflow: hidden !important;
}

/* Более выразительная статусная иконка */

.house-popup-status-icon {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;

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

  border-radius: 50% !important;
}

.house-popup-status-icon .house-popup-dot {
  width: 9px !important;
  height: 9px !important;
  min-width: 9px !important;

  margin: 0 !important;
}

/* Текст статуса аккуратно занимает две строки */

.house-popup-status-copy {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  justify-content: center !important;
  gap: 2px !important;

  min-width: 0 !important;

  overflow: hidden !important;
  text-align: left !important;
}

.house-popup-status-copy strong {
  display: block !important;

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

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

  font-size: 11.5px !important;
  font-weight: 780 !important;
  line-height: 1.05 !important;
}

.house-popup-status-copy small {
  display: -webkit-box !important;

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

  overflow: hidden !important;

  font-size: 7.5px !important;
  font-weight: 540 !important;
  line-height: 1.15 !important;

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

/* Адрес справа */

.house-popup-hero-row > .house-popup-address {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-end !important;
  justify-content: center !important;
  gap: 3px !important;

  box-sizing: border-box !important;

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

  padding: 1px 0 !important;
  margin: 0 !important;

  text-align: right !important;
}

.house-popup-hero-row > .house-popup-address > strong {
  display: -webkit-box !important;

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

  overflow: hidden !important;

  font-size: 14.5px !important;
  font-weight: 790 !important;
  line-height: 1.06 !important;
  letter-spacing: -0.018em !important;
  text-align: right !important;

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

.house-popup-hero-row > .house-popup-address > span {
  display: block !important;

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

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

  font-size: 9px !important;
  line-height: 1.05 !important;
  text-align: right !important;
}

/* Верхняя секция становится компактнее */

.house-popup-hero {
  padding-top: 0 !important;
  padding-bottom: 8px !important;
}

/* ==========================================================
   Закреплённая панель из всех четырёх кнопок
   ========================================================== */

.house-popup-sticky-actions {
  position: sticky !important;
  right: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  z-index: 30 !important;

  display: flex !important;
  flex: 0 0 auto !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 6px !important;

  box-sizing: border-box !important;

  width: 100% !important;
  margin-top: auto !important;
  padding:
    7px
    10px
    max(7px, env(safe-area-inset-bottom))
    !important;

  border-top: 1px solid rgba(20, 59, 54, 0.075) !important;

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

  box-shadow:
    0 -10px 24px rgba(22, 63, 58, 0.075),
    0 -2px 7px rgba(22, 63, 58, 0.035) !important;

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

.house-popup-sticky-actions > .house-popup-actions,
.house-popup-sticky-actions > .house-popup-secondary-actions {
  display: grid !important;
  grid-template-columns:
    minmax(0, 1fr)
    minmax(0, 1fr) !important;

  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  gap: 6px !important;
}

.house-popup-sticky-actions
> .house-popup-actions
> *,
.house-popup-sticky-actions
> .house-popup-secondary-actions
> * {
  box-sizing: border-box !important;

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

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

  margin: 0 !important;
  padding: 0 8px !important;

  border-radius: 12px !important;

  font-size: 10px !important;
  font-weight: 740 !important;
  line-height: 1 !important;
}

/* ==========================================================
   Galaxy S8+, старые Android и короткие окна Chrome
   ========================================================== */

@media (max-height: 760px) {

  .house-popup-card {
    max-height: calc(100dvh - 2px) !important;
  }

  .house-popup-hero-row {
    grid-template-columns:
      minmax(0, 1.3fr)
      minmax(0, 1fr) !important;

    gap: 7px !important;
  }

  .house-popup-hero-row > .house-popup-status,
  .house-popup-hero-row > .house-popup-address {
    height: 48px !important;
    min-height: 48px !important;
  }

  .house-popup-hero-row > .house-popup-status {
    grid-template-columns: 25px minmax(0, 1fr) !important;
    padding: 6px 8px !important;
    column-gap: 7px !important;
  }

  .house-popup-status-icon {
    width: 25px !important;
    height: 25px !important;
    min-width: 25px !important;
  }

  .house-popup-status-copy strong {
    font-size: 10.5px !important;
  }

  .house-popup-status-copy small {
    font-size: 7px !important;
  }

  .house-popup-hero-row
  > .house-popup-address
  > strong {
    font-size: 13.5px !important;
  }

  .house-popup-hero-row
  > .house-popup-address
  > span {
    font-size: 8.5px !important;
  }

  /* Уплотняем только вертикальные расстояния */

  .house-popup-section {
    padding-top: 8px !important;
    padding-bottom: 8px !important;
  }

  .house-popup-community-card {
    gap: 6px !important;
    margin-top: 6px !important;
    padding: 8px !important;
  }

  .house-popup-community-card
  .house-popup-community-signal strong {
    font-size: 11px !important;
  }

  .house-popup-community-card
  .house-popup-community-signal span {
    font-size: 9px !important;
  }

  .house-popup-community-card
  .house-popup-vote {
    min-height: 32px !important;
    padding: 4px 6px !important;
  }

  .house-popup-community-card
  .house-popup-last-confirmation {
    font-size: 8.8px !important;
  }

  .house-popup-community-section
  > .house-popup-note {
    min-height: 28px !important;
    margin-top: 4px !important;
    padding: 5px 7px !important;

    font-size: 9px !important;
  }

  .house-popup-sticky-actions {
    gap: 5px !important;
    padding:
      6px
      9px
      max(6px, env(safe-area-inset-bottom))
      !important;
  }

  .house-popup-sticky-actions
  > .house-popup-actions,
  .house-popup-sticky-actions
  > .house-popup-secondary-actions {
    gap: 5px !important;
  }

  .house-popup-sticky-actions
  > .house-popup-actions
  > *,
  .house-popup-sticky-actions
  > .house-popup-secondary-actions
  > * {
    height: 36px !important;
    min-height: 36px !important;
    max-height: 36px !important;

    border-radius: 11px !important;

    font-size: 9.5px !important;
  }
}

/* Узкие Android */

@media (max-width: 360px) {

  .house-popup-hero-row {
    grid-template-columns:
      minmax(0, 1.34fr)
      minmax(0, 1fr) !important;

    gap: 6px !important;
  }

  .house-popup-status-copy small {
    font-size: 6.8px !important;
  }

  .house-popup-hero-row
  > .house-popup-address
  > strong {
    font-size: 13px !important;
  }
}


/* ==========================================================
   House Card v3.3 FINAL
   Final responsive composition
   ========================================================== */

/*
 * Геометрия карточки:
 * 1. Сама карточка не выходит за viewport.
 * 2. Контент занимает доступную высоту.
 * 3. Панель действий всегда остаётся снизу.
 */

.house-popup-card {
  display: flex !important;
  flex-direction: column !important;

  box-sizing: border-box !important;

  max-height: calc(
    100dvh
    - max(4px, env(safe-area-inset-top))
  ) !important;

  overflow: hidden !important;
}

/*
 * В проекте контент может находиться либо в отдельном
 * scroll-wrapper, либо непосредственно внутри карточки.
 */

.house-popup-scroll,
.house-popup-content,
.house-popup-body {
  flex: 1 1 auto !important;
  min-height: 0 !important;

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

  overscroll-behavior: contain !important;
  -webkit-overflow-scrolling: touch !important;
}

/* ==========================================================
   HERO: статус 58%, адрес 42%
   ========================================================== */

.house-popup-hero {
  flex: 0 0 auto !important;

  padding-top: 0 !important;
  padding-bottom: 8px !important;
}

.house-popup-hero-row {
  display: grid !important;
  grid-template-columns:
    minmax(0, 1.38fr)
    minmax(0, 1fr) !important;

  grid-template-rows: 48px !important;
  grid-template-areas: none !important;

  align-items: stretch !important;
  gap: 8px !important;

  width: 100% !important;
}

/* Левая карточка статуса */

.house-popup-hero-row > .house-popup-status {
  grid-area: auto !important;
  grid-column: 1 !important;
  grid-row: 1 !important;

  display: grid !important;
  grid-template-columns: 25px minmax(0, 1fr) !important;
  align-items: center !important;
  column-gap: 8px !important;

  box-sizing: border-box !important;

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

  margin: 0 !important;
  padding: 6px 9px !important;

  border-radius: 13px !important;

  overflow: hidden !important;
  white-space: normal !important;
  transform: none !important;
}

.house-popup-status-icon {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;

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

  border-radius: 50% !important;
}

.house-popup-status-icon .house-popup-dot {
  width: 9px !important;
  height: 9px !important;
  min-width: 9px !important;

  margin: 0 !important;
}

.house-popup-status-copy {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  justify-content: center !important;
  gap: 2px !important;

  min-width: 0 !important;

  overflow: hidden !important;
  text-align: left !important;
}

.house-popup-status-copy strong {
  display: block !important;

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

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

  font-size: 11.5px !important;
  font-weight: 790 !important;
  line-height: 1.05 !important;
}

.house-popup-status-copy small {
  display: block !important;

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

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

  font-size: 7.2px !important;
  font-weight: 540 !important;
  line-height: 1.1 !important;
}

/* Адрес справа */

.house-popup-hero-row > .house-popup-address {
  grid-area: auto !important;
  grid-column: 2 !important;
  grid-row: 1 !important;

  display: flex !important;
  flex-direction: column !important;
  align-items: flex-end !important;
  justify-content: center !important;
  gap: 2px !important;

  box-sizing: border-box !important;

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

  margin: 0 !important;
  padding: 1px 0 !important;

  overflow: hidden !important;
  text-align: right !important;
}

.house-popup-hero-row > .house-popup-address > strong {
  grid-area: auto !important;

  display: -webkit-box !important;

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

  overflow: hidden !important;

  color: #142825 !important;
  font-size: 14px !important;
  font-weight: 800 !important;
  line-height: 1.04 !important;
  letter-spacing: -0.018em !important;
  text-align: right !important;

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

.house-popup-hero-row > .house-popup-address > span {
  grid-area: auto !important;

  display: block !important;

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

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

  color: #74827f !important;
  font-size: 8.5px !important;
  font-weight: 540 !important;
  line-height: 1.05 !important;
  text-align: right !important;
}

/* ==========================================================
   Компактные секции
   ========================================================== */

.house-popup-section {
  padding-top: 10px !important;
  padding-bottom: 10px !important;
}

.house-popup-section-label,
.house-popup-title {
  margin-bottom: 7px !important;
}

.house-popup-community-section {
  padding-top: 10px !important;
  padding-bottom: 9px !important;
}

.house-popup-community-card {
  gap: 7px !important;

  margin-top: 7px !important;
  padding: 10px !important;

  border-radius: 14px !important;
}

.house-popup-community-card
.house-popup-community-signal {
  gap: 2px !important;
}

.house-popup-community-card
.house-popup-community-signal strong {
  font-size: 11.5px !important;
  line-height: 1.22 !important;
}

.house-popup-community-card
.house-popup-community-signal span {
  font-size: 9.5px !important;
  line-height: 1.2 !important;
}

.house-popup-community-card
.house-popup-votes {
  margin-top: 1px !important;
}

.house-popup-community-card
.house-popup-vote {
  min-height: 34px !important;
  padding: 5px 7px !important;
}

.house-popup-community-card
.house-popup-vote span {
  font-size: 9px !important;
}

.house-popup-community-card
.house-popup-vote strong {
  font-size: 14px !important;
}

.house-popup-community-card
.house-popup-last-confirmation {
  padding-top: 1px !important;

  font-size: 8.8px !important;
  line-height: 1.2 !important;
}

/* Строки статуса пользователя */

.house-popup-community-section > .house-popup-note {
  min-height: 29px !important;

  margin-top: 5px !important;
  padding: 6px 8px !important;

  border-radius: 11px !important;

  font-size: 9px !important;
  line-height: 1.2 !important;
}

/* Блок отключений */

.house-popup-outages-section,
.house-popup-outages {
  padding-top: 9px !important;
  padding-bottom: 9px !important;
}

.house-popup-outage-card {
  padding: 9px 10px !important;
  border-radius: 13px !important;
}

/* Пустое состояние отключений становится компактным */

.house-popup-outages .house-popup-note,
.house-popup-outages-section .house-popup-note {
  min-height: 30px !important;
  margin: 0 !important;
  padding: 7px 9px !important;

  border-radius: 11px !important;
}

/* ==========================================================
   Финальная панель действий
   ========================================================== */

.house-popup-sticky-actions {
  position: relative !important;
  right: auto !important;
  bottom: auto !important;
  left: auto !important;
  z-index: 40 !important;

  display: flex !important;
  flex: 0 0 auto !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 5px !important;

  box-sizing: border-box !important;

  width: 100% !important;
  margin: 0 !important;
  padding:
    7px
    10px
    max(7px, env(safe-area-inset-bottom))
    !important;

  border-top: 1px solid rgba(20, 59, 54, 0.075) !important;

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

  box-shadow:
    0 -9px 20px rgba(22, 63, 58, 0.06),
    0 -2px 5px rgba(22, 63, 58, 0.025) !important;

  -webkit-backdrop-filter: blur(18px) saturate(1.1) !important;
  backdrop-filter: blur(18px) saturate(1.1) !important;
}

.house-popup-sticky-actions > .house-popup-actions,
.house-popup-sticky-actions > .house-popup-secondary-actions {
  display: grid !important;
  grid-template-columns:
    minmax(0, 1fr)
    minmax(0, 1fr) !important;

  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  gap: 6px !important;
}

.house-popup-sticky-actions
> .house-popup-actions
> *,
.house-popup-sticky-actions
> .house-popup-secondary-actions
> * {
  box-sizing: border-box !important;

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

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

  margin: 0 !important;
  padding: 0 8px !important;

  border-radius: 11px !important;

  font-size: 9.5px !important;
  font-weight: 750 !important;
  line-height: 1 !important;
}

/* ==========================================================
   Galaxy S8+, Chrome с крупными панелями
   ========================================================== */

@media (max-height: 760px) {

  .house-popup-card {
    max-height: calc(100dvh - 2px) !important;
  }

  .house-popup-hero-row {
    grid-template-columns:
      minmax(0, 1.42fr)
      minmax(0, 1fr) !important;

    grid-template-rows: 45px !important;

    gap: 7px !important;
  }

  .house-popup-hero-row > .house-popup-status,
  .house-popup-hero-row > .house-popup-address {
    height: 45px !important;
    min-height: 45px !important;
    max-height: 45px !important;
  }

  .house-popup-hero-row > .house-popup-status {
    grid-template-columns: 23px minmax(0, 1fr) !important;

    padding: 5px 7px !important;
    column-gap: 7px !important;
  }

  .house-popup-status-icon {
    width: 23px !important;
    height: 23px !important;
    min-width: 23px !important;
  }

  .house-popup-status-copy strong {
    font-size: 10.5px !important;
  }

  .house-popup-status-copy small {
    font-size: 6.8px !important;
  }

  .house-popup-hero-row > .house-popup-address > strong {
    font-size: 13px !important;
  }

  .house-popup-hero-row > .house-popup-address > span {
    font-size: 8px !important;
  }

  .house-popup-section {
    padding-top: 8px !important;
    padding-bottom: 8px !important;
  }

  .house-popup-community-card {
    gap: 6px !important;
    margin-top: 5px !important;
    padding: 8px !important;
  }

  .house-popup-sticky-actions {
    gap: 5px !important;
    padding:
      6px
      9px
      max(6px, env(safe-area-inset-bottom))
      !important;
  }

  .house-popup-sticky-actions
  > .house-popup-actions
  > *,
  .house-popup-sticky-actions
  > .house-popup-secondary-actions
  > * {
    height: 35px !important;
    min-height: 35px !important;
    max-height: 35px !important;

    font-size: 9px !important;
  }
}

/* Очень узкие телефоны */

@media (max-width: 360px) {

  .house-popup-hero-row {
    grid-template-columns:
      minmax(0, 1.48fr)
      minmax(0, 1fr) !important;

    gap: 6px !important;
  }

  .house-popup-status-copy small {
    display: none !important;
  }

  .house-popup-hero-row > .house-popup-address > strong {
    font-size: 12.5px !important;
  }
}


/* ==========================================================
   House Card v3.3.1
   Galaxy bottom actions viewport fix
   ========================================================== */

/*
 * Не используем 100dvh напрямую:
 * карточка начинается ниже верхнего края экрана.
 * JS уже рассчитывает фактически доступную высоту.
 */

.house-popup-card {
  max-height:
    var(
      --responsive-popup-max-height,
      calc(100dvh - 12px)
    ) !important;

  height: auto !important;
}

/*
 * Информационная часть занимает всё оставшееся место,
 * панель действий не участвует в её прокрутке.
 */

.house-popup-scroll,
.house-popup-content,
.house-popup-body {
  flex: 1 1 auto !important;
  min-height: 0 !important;
}

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

.house-popup-sticky-actions {
  position: relative !important;
  flex: 0 0 auto !important;

  box-sizing: border-box !important;

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

  transform: none !important;
}

/* Короткие Android-экраны и Chrome с большими панелями */

@media (max-height: 760px) {

  .house-popup-card {
    max-height:
      var(
        --responsive-popup-max-height,
        calc(100dvh - 10px)
      ) !important;
  }

  .house-popup-sticky-actions {
    gap: 4px !important;

    padding:
      5px
      9px
      max(7px, env(safe-area-inset-bottom))
      !important;
  }

  .house-popup-sticky-actions
  > .house-popup-actions,
  .house-popup-sticky-actions
  > .house-popup-secondary-actions {
    gap: 5px !important;
  }

  .house-popup-sticky-actions
  > .house-popup-actions
  > *,
  .house-popup-sticky-actions
  > .house-popup-secondary-actions
  > * {
    height: 34px !important;
    min-height: 34px !important;
    max-height: 34px !important;

    border-radius: 10px !important;

    font-size: 9px !important;
  }
}

/*
 * Для очень короткого доступного viewport дополнительно
 * убираем лишние 2–3 px, не уменьшая зоны нажатия критично.
 */

@media (max-height: 680px) {

  .house-popup-sticky-actions {
    padding-top: 4px !important;
    padding-bottom:
      max(5px, env(safe-area-inset-bottom))
      !important;
  }

  .house-popup-sticky-actions
  > .house-popup-actions
  > *,
  .house-popup-sticky-actions
  > .house-popup-secondary-actions
  > * {
    height: 33px !important;
    min-height: 33px !important;
    max-height: 33px !important;
  }
}


/* ==========================================================
   House Card v3.3.2
   Real scroll wrapper + fixed action panel
   ========================================================== */

/*
 * Фактическая структура:
 *
 * .house-popup-card
 *   .house-popup-chrome
 *   .house-popup-scroll
 *   .house-popup-sticky-actions
 */

.house-popup-card {
  display: flex !important;
  flex-direction: column !important;

  box-sizing: border-box !important;

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

  overflow: hidden !important;
}

/* Крестик и верхняя chrome-зона не сжимаются */

.house-popup-card > .house-popup-chrome {
  position: relative !important;

  flex: 0 0 auto !important;
  min-height: 0 !important;

  z-index: 20 !important;
}

/*
 * Это реальный контейнер всей информации дома.
 * Только он прокручивается и при необходимости сжимается.
 */

.house-popup-card > .house-popup-scroll {
  display: block !important;

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

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

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

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

.house-popup-card > .house-popup-scroll::-webkit-scrollbar {
  display: none !important;
}

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

.house-popup-card > .house-popup-sticky-actions {
  position: relative !important;
  inset: auto !important;
  z-index: 30 !important;

  flex: 0 0 auto !important;

  box-sizing: border-box !important;

  width: 100% !important;
  min-width: 0 !important;

  margin: 0 !important;
  transform: none !important;

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

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

/* Короткие окна Chrome на Android */

@media (max-height: 760px) {

  .house-popup-card {
    max-height:
      var(
        --responsive-popup-max-height,
        calc(100dvh - 6px)
      ) !important;
  }

  .house-popup-card > .house-popup-sticky-actions {
    gap: 4px !important;

    padding:
      4px
      9px
      max(6px, env(safe-area-inset-bottom))
      !important;
  }

  .house-popup-card
  > .house-popup-sticky-actions
  > .house-popup-actions,
  .house-popup-card
  > .house-popup-sticky-actions
  > .house-popup-secondary-actions {
    gap: 5px !important;
  }

  .house-popup-card
  > .house-popup-sticky-actions
  > .house-popup-actions
  > *,
  .house-popup-card
  > .house-popup-sticky-actions
  > .house-popup-secondary-actions
  > * {
    height: 33px !important;
    min-height: 33px !important;
    max-height: 33px !important;

    border-radius: 10px !important;

    font-size: 9px !important;
  }
}

/*
 * На совсем низком viewport уменьшаем только служебные
 * расстояния, но оба ряда кнопок сохраняются.
 */

@media (max-height: 680px) {

  .house-popup-card > .house-popup-sticky-actions {
    gap: 3px !important;

    padding-top: 3px !important;
    padding-bottom:
      max(5px, env(safe-area-inset-bottom))
      !important;
  }

  .house-popup-card
  > .house-popup-sticky-actions
  > .house-popup-actions
  > *,
  .house-popup-card
  > .house-popup-sticky-actions
  > .house-popup-secondary-actions
  > * {
    height: 32px !important;
    min-height: 32px !important;
    max-height: 32px !important;
  }
}


/* ==========================================================
   House Card v3.4
   Responsive full address
   ========================================================== */

/*
 * Адрес всегда показываем полностью:
 * до трёх строк, без многоточия.
 */

.house-popup-card .house-popup-address {
  min-width: 0 !important;
  max-width: 100% !important;
}

.house-popup-card .house-popup-address > * {
  min-width: 0 !important;
  max-width: 100% !important;
}

/*
 * Основная строка адреса.
 * Поддерживаем несколько вероятных классов текущей разметки.
 */

.house-popup-card .house-popup-address h2,
.house-popup-card .house-popup-address h3,
.house-popup-card .house-popup-address strong,
.house-popup-card .house-popup-address-title,
.house-popup-card .house-popup-address-main {
  display: -webkit-box !important;

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

  overflow: hidden !important;

  color: #122220 !important;

  font-size:
    clamp(
      12px,
      3.6vw,
      15px
    ) !important;

  font-weight: 790 !important;
  line-height: 1.05 !important;
  letter-spacing: -0.018em !important;

  white-space: normal !important;
  overflow-wrap: anywhere !important;
  word-break: normal !important;
  text-overflow: clip !important;

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

/* Населённый пункт */

.house-popup-card .house-popup-address p,
.house-popup-card .house-popup-address small,
.house-popup-card .house-popup-settlement,
.house-popup-card .house-popup-address-settlement {
  display: block !important;

  width: 100% !important;
  max-width: 100% !important;
  margin: 2px 0 0 !important;

  overflow: hidden !important;

  color: #74827f !important;
  font-size: clamp(8px, 2.4vw, 10px) !important;
  font-weight: 570 !important;
  line-height: 1.1 !important;

  white-space: normal !important;
  overflow-wrap: anywhere !important;
  text-overflow: clip !important;
}

/*
 * Правая колонка адреса должна иметь достаточно ширины,
 * но не выталкивать блок статуса.
 */

.house-popup-card .house-popup-header-main,
.house-popup-card .house-popup-identity {
  grid-template-columns:
    minmax(0, 1fr)
    minmax(0, 1fr)
    !important;
}

.house-popup-card .house-popup-address {
  justify-self: stretch !important;
  text-align: right !important;
}

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

@media (max-width: 380px) {
  .house-popup-card .house-popup-address h2,
  .house-popup-card .house-popup-address h3,
  .house-popup-card .house-popup-address strong,
  .house-popup-card .house-popup-address-title,
  .house-popup-card .house-popup-address-main {
    font-size: clamp(11px, 3.45vw, 13px) !important;
    line-height: 1.03 !important;
  }
}

/* Очень узкие и старые Android */

@media (max-width: 340px) {
  .house-popup-card .house-popup-header-main,
  .house-popup-card .house-popup-identity {
    grid-template-columns:
      minmax(0, 1.08fr)
      minmax(0, 0.92fr)
      !important;
  }

  .house-popup-card .house-popup-address h2,
  .house-popup-card .house-popup-address h3,
  .house-popup-card .house-popup-address strong,
  .house-popup-card .house-popup-address-title,
  .house-popup-card .house-popup-address-main {
    font-size: 10.5px !important;
    line-height: 1.02 !important;
  }
}


/* ==========================================================
   House Card v3.4.1
   Auto-fit full address
   ========================================================== */

.house-popup-card .house-popup-address {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-end !important;
  justify-content: center !important;

  min-width: 0 !important;
  min-height: 44px !important;
  max-height: none !important;

  overflow: visible !important;
}

.house-popup-card .house-popup-address h2,
.house-popup-card .house-popup-address h3,
.house-popup-card .house-popup-address strong,
.house-popup-card .house-popup-address-title,
.house-popup-card .house-popup-address-main {
  display: block !important;

  width: 100% !important;
  max-width: 100% !important;
  max-height: none !important;

  margin: 0 !important;
  padding: 0 !important;

  overflow: visible !important;

  white-space: normal !important;
  overflow-wrap: normal !important;
  word-break: normal !important;
  text-overflow: clip !important;

  -webkit-line-clamp: unset !important;
  -webkit-box-orient: initial !important;

  font-size: var(--house-address-fit-size, 15px) !important;
  line-height: 1.02 !important;

  text-align: right !important;
}

/* Город всегда остаётся отдельной строкой */

.house-popup-card .house-popup-address p,
.house-popup-card .house-popup-address small,
.house-popup-card .house-popup-settlement,
.house-popup-card .house-popup-address-settlement {
  flex: 0 0 auto !important;

  margin-top: 3px !important;

  overflow: visible !important;
  white-space: normal !important;
  text-overflow: clip !important;

  text-align: right !important;
}

/* Верхняя строка карточки не должна обрезать адрес */

.house-popup-card .house-popup-header-main,
.house-popup-card .house-popup-identity,
.house-popup-card .house-popup-summary {
  min-height: 52px !important;
  height: auto !important;
  max-height: none !important;

  overflow: visible !important;

  align-items: center !important;
}

/* На узких телефонах немного расширяем колонку адреса */

@media (max-width: 380px) {
  .house-popup-card .house-popup-header-main,
  .house-popup-card .house-popup-identity {
    grid-template-columns:
      minmax(0, 0.96fr)
      minmax(0, 1.04fr)
      !important;
  }
}


/* ==========================================================
   House History v2
   Modern timeline cards
   ========================================================== */

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

  overflow: hidden !important;

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

  background: rgba(255, 255, 255, 0.982) !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;
}

/* Шапка истории */

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

  min-height: 56px !important;
  padding: 9px 12px 8px !important;

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

  background: rgba(255, 255, 255, 0.92) !important;
}

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

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

.history-panel-header p,
.history-header p,
.history-panel-address {
  margin: 2px 0 0 !important;

  color: #74827f !important;
  font-size: 9px !important;
  font-weight: 570 !important;
  line-height: 1.2 !important;
}

/* Прокручиваемое содержимое */

.history-panel-content,
.history-content,
.history-list {
  flex: 1 1 auto !important;

  min-height: 0 !important;
  padding: 10px 11px 13px !important;

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

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

.history-panel-content::-webkit-scrollbar,
.history-content::-webkit-scrollbar,
.history-list::-webkit-scrollbar {
  display: none !important;
}

/* Одно событие */

.history-event {
  position: relative !important;

  display: grid !important;
  grid-template-columns: 19px minmax(0, 1fr) !important;
  gap: 8px !important;

  margin: 0 !important;
  padding: 0 0 9px !important;

  background: transparent !important;
}

.history-event:last-child {
  padding-bottom: 0 !important;
}

/* Линия между событиями */

.history-event::before {
  top: 17px !important;
  bottom: -1px !important;
  left: 6px !important;

  width: 2px !important;

  background:
    linear-gradient(
      to bottom,
      rgba(20, 59, 54, 0.12),
      rgba(20, 59, 54, 0.045)
    ) !important;
}

/* Маркер */

.history-event-marker {
  width: 13px !important;
  height: 13px !important;
  margin-top: 12px !important;

  border: 3px solid #ffffff !important;

  box-shadow:
    0 0 0 1px rgba(20, 59, 54, 0.12),
    0 2px 7px rgba(20, 59, 54, 0.08)
    !important;
}

/* Карточка события */

.history-event-body {
  position: relative !important;

  min-width: 0 !important;
  padding: 9px 10px 9px !important;

  overflow: hidden !important;

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

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

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

/* Мягкая статусная полоса */

.history-event-body::after {
  content: "" !important;

  position: absolute !important;
  top: 0 !important;
  bottom: 0 !important;
  left: 0 !important;

  width: 3px !important;

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

  background: #98a5a2 !important;
}

.history-event.is-online .history-event-body::after {
  background: #18b66d !important;
}

.history-event.is-offline .history-event-body::after {
  background: #f44f5e !important;
}

.history-event.is-planned .history-event-body::after {
  background: #eda31d !important;
}

/* Дата и источник */

.history-event-meta {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;

  margin-bottom: 3px !important;
}

.history-event-meta span {
  color: #74827f !important;
  font-size: 9px !important;
  font-weight: 680 !important;
  line-height: 1.15 !important;
}

.history-event-meta em {
  flex: 0 0 auto !important;

  padding: 3px 6px !important;

  border-radius: 999px !important;

  background: rgba(232, 240, 238, 0.8) !important;

  color: #758582 !important;
  font-size: 7.5px !important;
  font-style: normal !important;
  font-weight: 680 !important;
  line-height: 1 !important;
}

/* Статус */

.history-event h3 {
  margin: 0 !important;

  color: #142825 !important;
  font-size: 13px !important;
  font-weight: 790 !important;
  line-height: 1.18 !important;
}

.history-event.is-online h3 {
  color: #13965b !important;
}

.history-event.is-offline h3 {
  color: #db4353 !important;
}

.history-event.is-planned h3 {
  color: #c7830e !important;
}

.history-event p {
  margin: 3px 0 0 !important;

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

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

.history-empty,
.history-panel-empty {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;

  min-height: 150px !important;
  margin: 10px !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: #74827f !important;
  font-size: 10px !important;
  line-height: 1.4 !important;
  text-align: center !important;
}

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

@media (max-height: 760px) {
  .history-panel-header,
  .history-header {
    min-height: 49px !important;
    padding: 7px 10px 6px !important;
  }

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

  .history-panel-content,
  .history-content,
  .history-list {
    padding: 7px 8px 9px !important;
  }

  .history-event {
    gap: 7px !important;
    padding-bottom: 7px !important;
  }

  .history-event-body {
    padding: 7px 8px !important;
  }

  .history-event-marker {
    margin-top: 10px !important;
  }
}


/* ==========================================================
   House History v2.0.1
   Critical hidden-state guard
   ========================================================== */

/*
 * Любой bottom-sheet с атрибутом hidden обязан быть полностью
 * выключен. Это правило должно находиться после display:flex
 * из визуального оформления панели.
 */

.history-panel[hidden],
.history-panel[aria-hidden="true"],
.favorites-panel[hidden],
.favorites-panel[aria-hidden="true"] {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translateY(110%) !important;
}


/* ==========================================================
   House History v2.1
   Explicit full-height geometry
   ========================================================== */

.history-panel:not([hidden]):not([aria-hidden="true"]) {
  top: 270px !important;

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

  display: flex !important;

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

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

/*
 * Контент истории занимает всю высоту панели,
 * а карточки событий остаются естественной высоты.
 */

.history-panel:not([hidden]):not([aria-hidden="true"])
.history-list,
.history-panel:not([hidden]):not([aria-hidden="true"])
.history-content,
.history-panel:not([hidden]):not([aria-hidden="true"])
.history-panel-content {
  flex: 1 1 auto !important;
  min-height: 0 !important;

  overflow-y: auto !important;
}

@media (min-height: 800px) {
  .history-panel:not([hidden]):not([aria-hidden="true"]) {
    top: 285px !important;
  }
}

@media (max-height: 760px) {
  .history-panel:not([hidden]):not([aria-hidden="true"]) {
    top: 190px !important;
  }
}


/* ==========================================================
   House History v2.1.1
   Natural event height
   ========================================================== */

/*
 * История тоже растёт по содержимому.
 * При большом количестве событий включается внутренний скролл.
 */

.history-panel:not([hidden]):not([aria-hidden="true"]) {
  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)
      - 176px
    )
    !important;
}

/* Список не растягивает единственное событие */

.history-panel .history-list,
.history-panel .history-content,
.history-panel .history-panel-content {
  display: block !important;

  flex: 0 1 auto !important;

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

  overflow-y: auto !important;
}

/* Событие и его карточка всегда естественной высоты */

.history-panel .history-event {
  display: grid !important;

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

  align-items: start !important;
}

.history-panel .history-event-body {
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;

  align-self: start !important;
}

/* Убираем растяжение внутренних элементов */

.history-panel .history-event-body > * {
  flex: initial !important;
}

@media (max-height: 760px) {
  .history-panel:not([hidden]):not([aria-hidden="true"]) {
    max-height:
      calc(
        100dvh
        - var(--responsive-bottom-nav-height, 78px)
        - env(safe-area-inset-bottom)
        - 136px
      )
      !important;
  }
}
