.lawyer-float {
  position: fixed;
  inset-block-end: 1rem;
  inset-inline-end: 1rem;
  /* RTL/LTR تلقائيًا */
  z-index: 1050;
  width: min(92vw, 340px);
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .16);
  padding: .75rem;
  display: flex;
  flex-direction: column;
  gap: .6rem;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .3s ease, transform .3s ease;
}

.lawyer-float.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.lawyer-float__close {
  position: absolute;
  inset-block-start: .35rem;
  inset-inline-end: .35rem;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  background: #f1f3f5;
  color: #495057;
  font-size: 1rem;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.lawyer-float__close:hover {
  background: #e9ecef;
}

.lawyer-float__card {
  display: flex;
  align-items: center;
  gap: .65rem;
  text-decoration: none;
  color: inherit;
  padding-inline-end: 1.4rem;
  /* مساحة لزر الإغلاق */
}

.lawyer-float__card:hover .lawyer-float__name {
  text-decoration: underline;
}

.lawyer-float__avatar {
  width: 56px;
  height: 56px;
  flex: none;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #e9ecef;
}

.lawyer-float__info {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.lawyer-float__eyebrow {
  font-size: .72rem;
  color: #6c757d;
}

.lawyer-float__name {
  font-weight: 700;
  font-size: .95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lawyer-float__meta {
  font-size: .78rem;
  color: #495057;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lawyer-float__wa {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  background: #25d366;
  color: #fff;
  border-radius: 12px;
  padding: .6rem .75rem;
  font-weight: 600;
  font-size: .9rem;
  text-decoration: none;
}

.lawyer-float__wa:hover,
.lawyer-float__wa:focus {
  background: #1eb757;
  color: #fff;
}

.lawyer-float__wa i {
  font-size: 1.1rem;
}

/* منع تغطية قسم التصويت وزر العودة أسفل الصفحة */
body.has-lawyer-float {
  padding-bottom: 140px;
}

/* 📱 الهاتف: فوق البوتوم بار مباشرة */
@media (max-width: 575.98px) {
  .lawyer-float {
    inset-inline: .5rem;
    /* ✅ يرتفع فوق البوتوم بار + هامش صغير + safe-area للآيفون */
    inset-block-end: calc(var(--bottom-bar-h, 64px) + .5rem + env(safe-area-inset-bottom, 0px));
    width: auto;
    padding: .6rem;
    gap: .5rem;
  }

  body.has-lawyer-float {
    /* نفس المسافة + ارتفاع تقريبي للويدجت حتى لا يغطي زر العودة */
    padding-bottom: calc(var(--bottom-bar-h, 64px) + 150px);
  }
}

/* ===== بطاقة الإعلان الترويجي ===== */
.lawyer-float__promo-icon {
  width: 56px;
  height: 56px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  font-size: 1.5rem;
  box-shadow: 0 4px 12px rgba(217, 119, 6, .35);
}

.lawyer-float__wa--promo {
  background: #f59e0b;
}

.lawyer-float__wa--promo:hover,
.lawyer-float__wa--promo:focus {
  background: #d97706;
  color: #fff;
}

/* 📱 تصغير أيقونة الإعلان على الهاتف */
@media (max-width: 575.98px) {
  .lawyer-float__promo-icon {
    width: 46px;
    height: 46px;
    font-size: 1.25rem;
  }
}