.profile-dm-btn {
  flex-shrink: 0;
  border-radius: 9999px;
  border: 1px solid rgba(74, 222, 128, 0.35);
  background: rgba(34, 197, 94, 0.12);
  color: #86efac;
  padding: 0.3125rem 0.875rem;
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.profile-dm-btn:hover:not(:disabled) {
  background: rgba(34, 197, 94, 0.2);
  border-color: rgba(74, 222, 128, 0.55);
  color: #bbf7d0;
}

.profile-dm-btn:disabled {
  opacity: 0.55;
  cursor: default;
}

#toast.ep-dm-upsell-toast,
.toast-notification.ep-dm-upsell-toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
  max-width: min(92vw, 420px);
  padding: 0.75rem 1rem;
}

#toast.ep-dm-upsell-toast--anchored {
  bottom: auto !important;
  left: auto !important;
  right: auto !important;
  transform: none !important;
  text-align: center;
  box-shadow:
    0 0 0 1px rgba(74, 222, 128, 0.2),
    0 12px 32px rgba(0, 0, 0, 0.45),
    0 0 24px rgba(250, 204, 21, 0.12);
  animation: ep-dm-upsell-pop 0.22s ease-out;
}

@keyframes ep-dm-upsell-pop {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

#toast.ep-dm-upsell-toast--anchored::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 7px solid rgba(10, 10, 15, 0.95);
  filter: drop-shadow(0 -1px 0 rgba(74, 222, 128, 0.25));
}

.ep-dm-upsell-text {
  color: #f4f4f5;
}

.ep-dm-premium-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  padding: 0.35rem 0.85rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: none;
  color: #0a0a0f;
  background: linear-gradient(135deg, #facc15, #eab308);
  border: 1px solid rgba(250, 204, 21, 0.45);
  white-space: nowrap;
}

.ep-dm-premium-cta:hover {
  filter: brightness(1.05);
}

#ep-dms-root {
  position: fixed;
  inset: 0;
  z-index: 13000;
  pointer-events: none;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

#ep-dms-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

#ep-dms-root.ep-open {
  pointer-events: auto;
}

#ep-dms-root.ep-open #ep-dms-backdrop {
  opacity: 1;
  pointer-events: auto;
}

#ep-dms-panel {
  position: absolute;
  right: max(12px, env(safe-area-inset-right));
  bottom: calc(76px + env(safe-area-inset-bottom));
  width: min(380px, calc(100vw - 24px));
  height: min(520px, calc(100dvh - 120px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #09090b;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
  transform: translateY(12px) scale(0.98);
  opacity: 0;
  transition: transform 0.22s ease, opacity 0.22s ease;
  pointer-events: none;
}

#ep-dms-root.ep-open #ep-dms-panel {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

@media (min-width: 768px) {
  #ep-dms-panel {
    bottom: calc(20px + env(safe-area-inset-bottom));
    right: calc(20px + env(safe-area-inset-right));
  }
}

#ep-dms-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: #0d0d10;
}

#ep-dms-head #ep-dms-title {
  margin: 0;
  font-size: 14px;
  font-weight: 650;
  color: #f4f4f5;
  min-width: 0;
}

.ep-dms-head-user {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.ep-dms-head-user__avatar {
  width: 28px;
  height: 28px;
  border-radius: 9999px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.ep-dms-head-user__name {
  font-size: 14px;
  font-weight: 650;
  color: #f4f4f5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#ep-dms-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 650;
  color: #f4f4f5;
}

.ep-dms-head-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ep-dms-mini-btn {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: transparent;
  color: #9ca3af;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0;
}

.ep-dms-mini-btn:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #f4f4f5;
}

#ep-dms-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

#ep-dms-thread-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.ep-dms-thread {
  width: 100%;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  background: #0d0d10;
  padding: 10px 12px;
  margin-bottom: 8px;
  cursor: pointer;
  color: #f4f4f5;
  transition: border-color 0.15s ease, background 0.15s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}

.ep-dms-thread__avatar {
  width: 40px;
  height: 40px;
  border-radius: 9999px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.ep-dms-thread__body {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ep-dms-thread:hover {
  border-color: rgba(74, 222, 128, 0.25);
  background: rgba(34, 197, 94, 0.06);
}

.ep-dms-thread__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.ep-dms-thread__name {
  font-size: 13px;
  font-weight: 650;
}

.ep-dms-thread__time {
  font-size: 10px;
  color: #6b7280;
}

.ep-dms-thread__preview {
  display: block;
  font-size: 12px;
  color: #9ca3af;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ep-dms-thread__preview-empty {
  opacity: 0.65;
}

.ep-dms-empty {
  padding: 24px 16px;
  text-align: center;
  color: #9ca3af;
  font-size: 12px;
  line-height: 1.55;
}

.ep-dms-empty__title {
  font-size: 13px;
  font-weight: 650;
  color: #f4f4f5;
  margin-bottom: 6px;
}

.ep-dms-empty__text {
  color: #9ca3af;
  margin-bottom: 14px;
}

.ep-dms-empty-premium-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
  padding: 10px 14px;
  border-radius: 12px;
  text-decoration: none;
  font-size: 12px;
  font-weight: 650;
  color: #f8fafc;
  background: linear-gradient(135deg, rgba(250, 204, 21, 0.16), rgba(234, 179, 8, 0.08));
  border: 1px solid rgba(250, 204, 21, 0.35);
  box-shadow: 0 0 24px rgba(250, 204, 21, 0.12);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.ep-dms-empty-premium-cta:hover {
  transform: translateY(-1px);
  border-color: rgba(250, 204, 21, 0.55);
  box-shadow: 0 0 28px rgba(250, 204, 21, 0.22);
}

.ep-dms-signin-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 4px;
  padding: 9px 14px;
  border: 1px solid rgba(74, 222, 128, 0.28);
  border-radius: 12px;
  background: rgba(16, 185, 129, 0.1);
  color: #bbf7d0;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.ep-dms-signin-btn:hover {
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(74, 222, 128, 0.42);
  transform: translateY(-1px);
}

.ep-dms-premium-glow {
  color: #fde047;
  text-shadow: 0 0 10px rgba(250, 204, 21, 0.75), 0 0 18px rgba(234, 179, 8, 0.45);
  animation: ep-dms-premium-pulse 2.2s ease-in-out infinite;
}

.ep-dms-premium-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fde047;
  font-size: 14px;
  font-weight: 700;
  text-shadow: 0 0 10px rgba(250, 204, 21, 0.65);
}

@keyframes ep-dms-premium-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.82; }
}

#ep-dms-chat {
  flex: 1;
  min-height: 0;
  display: none;
  flex-direction: column;
}

#ep-dms-chat.ep-visible {
  display: flex;
}

.ep-dms-thread--unread .ep-dms-thread__name {
  color: #bbf7d0;
}

#ep-dms-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ep-dms-msg-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 100%;
}

.ep-dms-msg-row--in {
  align-self: flex-start;
}

.ep-dms-msg-row--out {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.ep-dms-msg-row__avatar {
  width: 28px;
  height: 28px;
  border-radius: 9999px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.ep-dms-msg-stack {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  max-width: min(78%, 260px);
}

.ep-dms-msg-row--out .ep-dms-msg-stack {
  align-items: flex-end;
}

.ep-dms-msg-row__name {
  font-size: 10px;
  font-weight: 600;
  color: #9ca3af;
  padding: 0 4px;
}

.ep-dms-msg-out,
.ep-dms-msg-in {
  width: 100%;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 12.5px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.ep-dms-msg-out {
  align-self: flex-end;
  background: rgba(34, 197, 94, 0.14);
  border: 1px solid rgba(34, 197, 94, 0.22);
  color: #f4f4f5;
  border-bottom-right-radius: 4px;
}

.ep-dms-msg-in {
  align-self: flex-start;
  background: #0d0d10;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #f4f4f5;
  border-bottom-left-radius: 4px;
}

#ep-dms-compose {
  padding: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: #0d0d10;
}

#ep-dms-compose-row {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #09090b;
}

#ep-dms-input {
  flex: 1;
  min-height: 36px;
  max-height: 108px;
  border: none;
  background: transparent;
  color: #f4f4f5;
  font: inherit;
  font-size: 13px;
  line-height: 1.35;
  resize: none;
  outline: none;
  padding: 8px 4px;
}

#ep-dms-send {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: #22c55e;
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

#ep-dms-send:disabled {
  opacity: 0.35;
  cursor: default;
}

#ep-dms-status {
  min-height: 14px;
  margin-top: 6px;
  font-size: 10px;
  color: #6b7280;
}

#ep-dms-compose.ep-dms-compose--locked #ep-dms-compose-row {
  opacity: 0.45;
}

#ep-dms-compose.ep-dms-compose--locked #ep-dms-input {
  cursor: not-allowed;
}

#ep-dms-loading {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(9, 9, 11, 0.88);
  z-index: 4;
}

#ep-dms-loading.ep-on {
  display: flex;
}

.ep-dms-spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(34, 197, 94, 0.2);
  border-top-color: #4ade80;
  animation: ep-dms-spin 0.7s linear infinite;
}

@keyframes ep-dms-spin {
  to { transform: rotate(360deg); }
}
