/* RCup: offerta in trattativa — importo leggibile, non tagliato dalla barra pay/composer */

.msg-offer.pending,
.msg-offer.theirs.pending,
.msg-offer.pending.mine {
  overflow: visible !important;
}

.msg-offer-amt {
  line-height: 1.25 !important;
  overflow: visible !important;
  padding: 8px 14px 12px !important;
  font-size: 26px !important;
  font-weight: 800 !important;
  color: var(--rc-text, #E8EDF5) !important;
}

.msg-offer-sticky {
  overflow: visible !important;
  z-index: 46 !important;
  padding: 12px 12px 14px !important;
  /* sopra composer + chip Indirizzo/PayPal/WhatsApp */
  bottom: calc(var(--rc-mob-nav-h, 86px) + var(--rc-mob-composer-lift, 24px) + env(safe-area-inset-bottom, 0px) + 168px) !important;
}

.msg-offer-sticky-amt {
  display: block !important;
  line-height: 1.3 !important;
  overflow: visible !important;
  font-size: 24px !important;
  font-weight: 800 !important;
  margin: 6px 0 12px !important;
  padding: 0 !important;
  color: var(--rc-text, #E8EDF5) !important;
}

.msg-offer-sticky-actions {
  display: flex !important;
  gap: 8px !important;
  flex-wrap: wrap !important;
}

/* Desktop: lo scroll del thread non deve finire sotto composer/pay */
@media (min-width: 768px) {
  .msg-desktop-thread .msg-thread-scroll {
    padding-bottom: 240px !important;
    scroll-padding-bottom: 240px !important;
  }
  .msg-desktop-thread .msg-offer.theirs.pending,
  .msg-desktop-thread .msg-offer.pending.mine,
  .msg-desktop-thread .msg-offer.accepted {
    scroll-margin-bottom: 220px !important;
  }
  /* sticky in colonna chat, non full-bleed viewport */
  .msg-desktop-thread .msg-offer-sticky {
    position: sticky !important;
    left: auto !important;
    right: auto !important;
    bottom: 0 !important;
    width: 100% !important;
    z-index: 5 !important;
    margin-top: auto;
  }
}

@media (max-width: 767px) {
  .app.app--messages .msg-offer-sticky {
    bottom: calc(var(--rc-mob-nav-h, 86px) + var(--rc-mob-composer-lift, 24px) + env(safe-area-inset-bottom, 0px) + 168px) !important;
  }
  .app.app--messages .msg-thread-scroll {
    padding-bottom: calc(320px + var(--rc-mob-nav-h, 86px) + var(--rc-mob-composer-lift, 24px) + env(safe-area-inset-bottom, 0px)) !important;
    scroll-padding-bottom: calc(320px + var(--rc-mob-nav-h, 86px) + var(--rc-mob-composer-lift, 24px)) !important;
  }
}
