.avail-pm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 9999px;
  background: transparent;
  color: #a1a1aa;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.avail-pm-btn i {
  font-size: 1.5rem;
  line-height: 1;
}
.avail-pm-btn:hover {
  color: #6ee7b7;
  border-color: #3f3f46;
  background: rgba(16, 185, 129, 0.08);
}
.pm-modal[hidden] { display: none !important; }
.pm-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.pm-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
}
.pm-modal__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 28rem;
  max-height: min(32rem, 90vh);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #3f3f46;
  background: #18181b;
  box-shadow: 0 24px 48px -20px rgba(0, 0, 0, 0.85);
}
@media (min-width: 640px) {
  .pm-modal__panel {
    max-width: 40rem;
    max-height: min(38rem, 90vh);
  }
}
.pm-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #27272a;
}
.pm-modal__title {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: #f4f4f5;
  min-width: 0;
  flex: 1;
}
.pm-modal__title-name {
  font-weight: 600;
}
.pm-modal__head-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}
.pm-modal__block {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 1.75rem;
  padding: 0.3rem 0.65rem;
  border: 1px solid rgba(239, 68, 68, 0.32);
  border-radius: 0;
  background: rgba(127, 29, 29, 0.14);
  color: #fca5a5;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
  transition:
    color 0.15s ease,
    border-color 0.15s ease,
    background 0.15s ease,
    box-shadow 0.15s ease;
}
.pm-modal__block i {
  font-size: 0.7rem;
  opacity: 0.92;
}
.pm-modal__block:hover {
  border-color: rgba(248, 113, 113, 0.55);
  background: rgba(127, 29, 29, 0.28);
  color: #fecaca;
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.14);
}
.pm-modal__block:focus-visible {
  outline: 2px solid rgba(248, 113, 113, 0.45);
  outline-offset: 2px;
}
.pm-modal__block--muted {
  border-color: #3f3f46;
  background: rgba(9, 9, 11, 0.9);
  color: #a1a1aa;
}
.pm-modal__block--muted:hover {
  border-color: rgba(52, 211, 153, 0.45);
  background: rgba(16, 185, 129, 0.08);
  color: #6ee7b7;
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.18);
}
.pm-modal__block--muted:focus-visible {
  outline-color: rgba(52, 211, 153, 0.45);
}
.pm-modal__close {
  border: none;
  background: none;
  color: #71717a;
  cursor: pointer;
  padding: 0.25rem;
  font-size: 1.125rem;
  line-height: 1;
}
.pm-modal__close:hover { color: #e4e4e7; }
.pm-modal__thread {
  flex: 1;
  min-height: 10rem;
  overflow-y: auto;
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  color-scheme: dark;
  scrollbar-width: thin;
  scrollbar-color: #27272a #09090b;
}
.pm-modal__thread::-webkit-scrollbar {
  width: 10px;
}
.pm-modal__thread::-webkit-scrollbar-track {
  background: #09090b !important;
  border-radius: 0 !important;
}
.pm-modal__thread::-webkit-scrollbar-thumb {
  background-color: #18181b !important;
  background-image: none !important;
  border-radius: 0 !important;
  border: 1px solid #3f3f46;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}
.pm-modal__thread::-webkit-scrollbar-thumb:hover {
  background-color: #0a0a0a !important;
  border-color: rgba(52, 211, 153, 0.85) !important;
  box-shadow:
    0 0 0 1px rgba(16, 185, 129, 0.3),
    0 0 14px rgba(16, 185, 129, 0.35) !important;
}
.pm-modal__thread::-webkit-scrollbar-corner {
  background: #09090b;
}
.pm-modal__empty {
  margin: auto 0;
  text-align: center;
  font-size: 0.8125rem;
  color: #71717a;
}
.pm-bubble {
  position: relative;
  width: fit-content;
  max-width: min(72%, 18rem);
  padding: 0.4rem 0.55rem;
  font-size: 0.8125rem;
  line-height: 1.4;
  word-break: break-word;
}
@media (min-width: 640px) {
  .pm-bubble {
    max-width: min(62%, 20rem);
  }
}
.pm-bubble--mine {
  align-self: flex-end;
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #d1fae5;
}
.pm-bubble--theirs {
  align-self: flex-start;
  background: #09090b;
  border: 1px solid #3f3f46;
  color: #e4e4e7;
}
.pm-bubble--unread {
  border-color: rgba(96, 165, 250, 0.45);
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.12);
}
.pm-bubble--theirs.pm-bubble--unread {
  background: rgba(30, 58, 138, 0.12);
}
.pm-bubble__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  margin-top: 0.3rem;
  padding-top: 0.25rem;
  border-top: 1px solid rgba(63, 63, 70, 0.45);
}
.pm-bubble--mine .pm-bubble__foot {
  border-top-color: rgba(16, 185, 129, 0.22);
}
.pm-bubble__meta {
  display: block;
  font-size: 0.75rem;
  line-height: 1.35;
  color: #a1a1aa;
  font-variant-numeric: tabular-nums;
  min-width: 0;
}
.pm-bubble--mine .pm-bubble__meta {
  color: rgba(167, 243, 208, 0.82);
}
.pm-bubble__unread-tag {
  color: #93c5fd;
  font-weight: 600;
  font-size: 0.75rem;
}
.pm-bubble__mark-unread {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 0.25rem;
  background: transparent;
  color: #71717a;
  cursor: pointer;
  font-size: 0.7rem;
  opacity: 0;
  transition: opacity 0.15s ease, color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.pm-bubble:hover .pm-bubble__mark-unread,
.pm-bubble__mark-unread:focus-visible {
  opacity: 1;
}
.pm-bubble__mark-unread:hover {
  color: #93c5fd;
  border-color: #3f3f46;
  background: rgba(39, 39, 42, 0.65);
}
.pm-modal__compose {
  flex-shrink: 0;
  border-top: 1px solid #27272a;
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 0;
}
.pm-modal__toolbar {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  flex-wrap: wrap;
}
.pm-modal__tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 0.25rem;
  background: transparent;
  color: #a1a1aa;
  cursor: pointer;
  font-size: 0.75rem;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.pm-modal__tool:hover:not(:disabled) {
  color: #e4e4e7;
  border-color: #3f3f46;
  background: rgba(39, 39, 42, 0.65);
}
.pm-modal__tool:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.pm-bubble__body {
  display: block;
  white-space: pre-wrap;
}
.pm-bubble__body strong { font-weight: 700; }
.pm-bubble__body em { font-style: italic; }
.pm-bubble__body s { text-decoration: line-through; opacity: 0.88; }
.pm-bubble__code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.78em;
  padding: 0.05rem 0.25rem;
  border-radius: 0.2rem;
  background: rgba(0, 0, 0, 0.28);
}
.pm-bubble--mine .pm-bubble__code {
  background: rgba(0, 0, 0, 0.22);
}
.pm-modal__input {
  width: 100%;
  box-sizing: border-box;
  height: 4.5rem;
  max-height: 4.5rem;
  resize: none !important;
  overflow-y: auto;
  background: #09090b;
  border: 1px solid #3f3f46;
  padding: 0.55rem 0.65rem;
  font-size: 0.8125rem;
  color: #e4e4e7;
  color-scheme: dark;
  scrollbar-width: thin;
  scrollbar-color: #27272a #09090b;
}
.pm-modal__input::-webkit-scrollbar {
  width: 10px;
}
.pm-modal__input::-webkit-scrollbar-track {
  background: #09090b !important;
  border-radius: 0 !important;
}
.pm-modal__input::-webkit-scrollbar-thumb {
  background-color: #18181b !important;
  background-image: none !important;
  border-radius: 0 !important;
  border: 1px solid #3f3f46;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}
.pm-modal__input::-webkit-scrollbar-thumb:hover {
  background-color: #0a0a0a !important;
  border-color: rgba(52, 211, 153, 0.85) !important;
  box-shadow:
    0 0 0 1px rgba(16, 185, 129, 0.3),
    0 0 14px rgba(16, 185, 129, 0.35) !important;
}
.pm-modal__input::-webkit-scrollbar-corner {
  background: #09090b;
}
.pm-modal__input:focus {
  outline: none;
  border-color: #10b981;
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.25);
}
.pm-modal__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.pm-modal__counter {
  font-size: 0.6875rem;
  color: #52525b;
  font-variant-numeric: tabular-nums;
}
.pm-modal__send {
  padding: 0.4rem 0.85rem;
  font-size: 0.75rem;
  font-weight: 500;
  background: #059669;
  border: none;
  color: #fff;
  cursor: pointer;
}
.pm-modal__send:hover { background: #10b981; }
.pm-modal__send:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.blocked-users-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.blocked-users-list__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid #27272a;
  background: #09090b;
}
.blocked-users-list__meta { font-size: 0.875rem; min-width: 0; }
.blocked-users-list__char { font-weight: 600; color: #f4f4f5; }
.blocked-users-list__unblock {
  border: 1px solid #3f3f46;
  background: transparent;
  color: #a1a1aa;
  cursor: pointer;
  padding: 0.25rem 0.55rem;
  font-size: 0.75rem;
  border-radius: 0.25rem;
  flex-shrink: 0;
}
.blocked-users-list__unblock:hover { border-color: #52525b; color: #e4e4e7; }

.pm-modal__error {
  margin: 0;
  font-size: 0.75rem;
  color: #f87171;
}