.fb-social-badge {
  position: absolute;
  top: -4px;
  right: -3px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: #ff3014;
  color: #fff;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 950;
  border: 2px solid #000;
  box-sizing: border-box;
  line-height: 1;
}

.fb-social-badge.visible { display: flex; }

.fb-icon-btn,
.icon-button,
.exercise-icon-btn {
  position: relative;
}

.fb-social-popover {
  position: fixed;
  top: 84px;
  right: 24px;
  width: min(390px, calc(100vw - 28px));
  max-height: min(620px, calc(100vh - 120px));
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0,0,0,.18);
  z-index: 1000;
  display: none;
  overflow: hidden;
}

.fb-social-popover.open {
  display: grid;
  grid-template-rows: auto 1fr;
}

.fb-social-popover header {
  padding: 14px 16px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #111;
  font-weight: 950;
}

.fb-social-close {
  border: 0;
  background: transparent;
  color: #111;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
}

.fb-social-close .material-icons {
  color: #000;
}

.fb-social-body {
  padding: 12px;
  overflow: auto;
  display: grid;
  gap: 10px;
}

.fb-social-item {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px;
  display: grid;
  gap: 7px;
  color: #111;
  background: #fff;
}

.fb-social-item strong { font-size: 14px; }
.fb-social-item p { margin: 0; color: #686d76; font-size: 13px; line-height: 1.35; }
.fb-social-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.fb-social-actions button {
  min-height: 32px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #111;
  font-weight: 850;
  cursor: pointer;
  padding: 0 10px;
}
.fb-social-actions button.primary {
  border-color: #ff4b12;
  background: #ff4b12;
  color: #fff;
}

.fb-conversation-item {
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  cursor: pointer;
}

.fb-conversation-item img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  background: #e5e7eb;
}

.fb-conversation-item strong,
.fb-conversation-item p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fb-conversation-item .material-icons {
  color: #9ca3af;
}

.fb-conversation-unread {
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  padding: 0 6px;
  background: #ff4b12;
  color: #fff;
  font-size: 12px;
  font-weight: 950;
}

.fb-chat-bubble {
  position: fixed;
  right: 24px;
  bottom: 110px;
  width: min(390px, calc(100vw - 28px));
  height: min(540px, calc(100vh - 150px));
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(0,0,0,.24);
  z-index: 1001;
  display: none;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
}

.fb-chat-bubble.open { display: grid; }

.fb-chat-header {
  min-height: 58px;
  background: #070707;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px;
}

.fb-chat-user {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-weight: 900;
}

.fb-chat-user img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
}

.fb-chat-user span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fb-chat-close {
  border: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #fff;
  color: #000;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
}

.fb-chat-close .material-icons {
  color: #000;
}

.fb-chat-messages {
  padding: 14px;
  overflow: auto;
  display: grid;
  align-content: end;
  gap: 8px;
  background: #f5f6f8;
}

.fb-chat-msg {
  max-width: 82%;
  border-radius: 14px;
  padding: 9px 11px;
  background: #fff;
  color: #111;
  box-shadow: 0 5px 14px rgba(15,23,42,.06);
  justify-self: start;
  font-size: 14px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.fb-chat-msg.mine {
  background: #ff4b12;
  color: #fff;
  justify-self: end;
}

.fb-chat-msg small {
  display: block;
  opacity: .65;
  margin-top: 4px;
  font-size: 11px;
}

.fb-chat-typing {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #686d76;
  font-weight: 850;
}

.fb-chat-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #9ca3af;
  animation: fbTypingPulse 1s infinite ease-in-out;
}

.fb-chat-typing span:nth-child(2) { animation-delay: .14s; }
.fb-chat-typing span:nth-child(3) { animation-delay: .28s; }

@keyframes fbTypingPulse {
  0%, 80%, 100% { transform: translateY(0); opacity: .45; }
  40% { transform: translateY(-4px); opacity: 1; }
}

.passkey-prompt-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(8, 9, 12, .46);
}

.passkey-prompt-card {
  width: min(420px, 100%);
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.5);
  background: #fff;
  box-shadow: 0 26px 80px rgba(0,0,0,.28);
  padding: 24px;
  color: #000;
  text-align: center;
}

.passkey-prompt-icon {
  width: 58px;
  height: 58px;
  margin: 0 auto 14px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff1ec;
  color: #000;
  font-size: 34px;
}

.passkey-prompt-card h2 {
  margin: 0 0 8px;
  font-size: 1.35rem;
  font-weight: 950;
}

.passkey-prompt-card p {
  margin: 0;
  color: #676b75;
  line-height: 1.45;
  font-weight: 650;
}

.passkey-prompt-note {
  min-height: 20px;
  margin-top: 10px !important;
  color: #ff2f16 !important;
  font-weight: 850 !important;
}

.passkey-prompt-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}

.fb-chat-form {
  display: grid;
  grid-template-columns: 1fr 46px;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid #e5e7eb;
  background: #fff;
}

.fb-chat-form input {
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  min-height: 42px;
  padding: 0 14px;
  color: #111;
}

.fb-chat-form button {
  border: 0;
  border-radius: 50%;
  background: #ff4b12;
  color: #fff;
  cursor: pointer;
}

@media (max-width: 820px) {
  .fb-social-badge {
    top: -5px;
    right: -5px;
    min-width: 17px;
    height: 17px;
    font-size: 10px;
    border-width: 2px;
  }

  .fb-social-popover {
    top: 96px;
    right: 10px;
  }

  .fb-chat-bubble {
    right: 10px;
    bottom: 92px;
    width: calc(100vw - 20px);
    height: min(540px, calc(100vh - 120px));
  }

  .passkey-prompt-actions {
    grid-template-columns: 1fr;
  }
}
