/* Peer-sheet — модальная карточка «о собеседнике» с trust-фактами.
   Общий блок двух страниц: чат (аватар в шапке) и детальная поездки
   (аватар пассажира в списке броней). Вынесен из chat/conversation.css
   2026-07-23. ВАЖНО: .peer-sheet — position:fixed; в разметке держать
   ВНЕ контейнеров с backdrop-filter/transform (например
   .ride-detail__card), иначе они станут containing block и шторка
   привяжется к карточке вместо вьюпорта. */

.peer-sheet {
  position: fixed;
  inset: 0;
  /* Выше notif-баннера (9999) и iOS-модалки (10000) из
     _notifications_client.html — открытая карточка модальна. */
  z-index: 10050;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.peer-sheet[hidden] { display: none; }

.peer-sheet__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
}

.peer-sheet__card {
  position: relative;
  width: 100%;
  max-width: 430px;
  box-sizing: border-box;
  background: #121212;
  border: 1px solid rgba(245, 194, 5, 0.28);
  border-radius: 22px 22px 0 0;
  padding: 22px 20px calc(22px + env(safe-area-inset-bottom));
  box-shadow: 0 -18px 48px rgba(0, 0, 0, 0.5);
  animation: peer-sheet-in 0.22s ease;
}

@keyframes peer-sheet-in {
  from { transform: translateY(24px); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

/* Десктоп: не шторка снизу, а центрированная карточка. */
@media (min-width: 541px) {
  .peer-sheet { align-items: center; padding: 20px; }
  .peer-sheet__card { border-radius: 22px; padding-bottom: 22px; }
}

.peer-sheet__close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.75);
  cursor: pointer;
}

.peer-sheet__close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.peer-sheet__close > svg {
  width: 18px;
  height: 18px;
  max-width: none;
  flex-shrink: 0;
}

.peer-sheet__head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-right: 40px;
}

.peer-sheet__avatar {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--grad-secondary);
  color: var(--color-bg);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  overflow: hidden;
}

.peer-sheet__name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  color: var(--color-text);
}

.peer-sheet__role {
  margin: 3px 0 0;
  font-family: var(--font-meta);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(245, 194, 5, 0.85);
}

.peer-sheet__route {
  margin: 12px 0 0;
  font-family: var(--font-body);
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
}

.peer-sheet__facts {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 16px 0 0;
  padding: 0;
}

.peer-sheet__fact {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
}

.peer-sheet__fact-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  color: var(--color-text);
}

.peer-sheet__fact-label {
  font-family: var(--font-body);
  font-size: 10.5px;
  line-height: 1.25;
  color: rgba(255, 255, 255, 0.55);
}

.peer-sheet__rows { margin: 16px 0 0; }

.peer-sheet__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.peer-sheet__row dt {
  font-family: var(--font-body);
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
}

.peer-sheet__row dd {
  margin: 0;
  font-family: var(--font-body);
  font-size: 13.5px;
  color: var(--color-text);
  text-align: right;
  /* Адреса «забрать/привезти» — свободный текст до 200 симв.:
     неразрывный токен не должен вылезать за карточку. */
  overflow-wrap: anywhere;
}

.peer-sheet__phone {
  color: var(--color-accent-from);
  text-decoration: none;
  font-weight: 600;
}

.peer-sheet__ride-link {
  display: inline-flex;
  margin-top: 16px;
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--color-accent-from);
  text-decoration: none;
}

.peer-sheet__ride-link:hover { text-decoration: underline; }
