.dm-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

.dm-header {
  margin-bottom: 20px;
}

.dm-header h1 {
  margin: 0 0 6px;
  font-size: 28px;
}

.dm-header p {
  margin: 0;
  color: #888;
}

.dm-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 20px;
}

.dm-panel {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  overflow: hidden;
}

.dm-panel-header {
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.dm-panel-header h2 {
  margin: 0;
  font-size: 17px;
}

.dm-thread-list,
.dm-request-list {
  display: flex;
  flex-direction: column;
}

.dm-thread-item {
  display: flex;
  gap: 14px;
  padding: 16px 18px;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.dm-thread-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.dm-thread-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  flex: 0 0 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
}

.dm-thread-body {
  min-width: 0;
  flex: 1;
}

.dm-thread-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 5px;
}

.dm-thread-top span {
  font-size: 12px;
  color: #999;
  white-space: nowrap;
}

.dm-thread-body p {
  margin: 0;
  color: #aaa;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.dm-side {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.dm-request-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.dm-request-item p {
  margin: 4px 0 0;
  font-size: 12px;
  color: #999;
}

.dm-btn {
  border: 0;
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  font-weight: 700;
}

.dm-btn-primary {
  background: #7c3aed;
  color: #fff;
}

.dm-empty {
  padding: 30px 18px;
  color: #aaa;
  text-align: center;
}

.dm-empty.small {
  padding: 20px 16px;
  font-size: 14px;
}

@media (max-width: 900px) {
  .dm-layout {
    grid-template-columns: 1fr;
  }

  .dm-page {
    padding: 16px;
  }
}

.dm-chat-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px;
}

.dm-chat-header {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
}

.dm-back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: inherit;
  padding: 9px 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.dm-chat-header h1 {
  margin: 0 0 5px;
  font-size: 25px;
}

.dm-chat-header p {
  margin: 0;
  color: #999;
  font-size: 14px;
}

.dm-chat-box {
  min-height: 420px;
  max-height: 620px;
  overflow-y: auto;
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.dm-msg {
  margin-bottom: 16px;
  max-width: 78%;
}

.dm-msg.is-me {
  margin-left: auto;
}

.dm-msg.is-other {
  margin-right: auto;
}

.dm-msg-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 5px;
  font-size: 12px;
  color: #999;
}

.dm-msg.is-me .dm-msg-meta {
  justify-content: flex-end;
}

.dm-msg-bubble {
  padding: 11px 13px;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.08);
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.dm-msg.is-me .dm-msg-bubble {
  background: rgba(124, 58, 237, 0.7);
  color: #fff;
}

.dm-compose {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.dm-compose textarea {
  flex: 1;
  resize: vertical;
  border: 0;
  outline: none;
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
}

.dm-compose button {
  border: 0;
  border-radius: 14px;
  padding: 0 18px;
  cursor: pointer;
  font-weight: 800;
  background: #7c3aed;
  color: #fff;
}

@media (max-width: 700px) {
  .dm-chat-page {
    padding: 14px;
  }

  .dm-chat-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .dm-msg {
    max-width: 92%;
  }

  .dm-compose {
    flex-direction: column;
  }

  .dm-compose button {
    padding: 12px 16px;
  }
}

.spk-profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.spk-profile-actions form {
  margin: 0;
}

.spk-profile-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 15px;
  border: 0;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.spk-profile-action-btn.primary {
  background: #7c3aed;
  color: #fff;
}

.spk-profile-action-btn.secondary {
  background: rgba(255, 255, 255, 0.09);
  color: inherit;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.spk-profile-action-btn.danger {
  background: rgba(239, 68, 68, 0.16);
  color: #ff8a8a;
  border: 1px solid rgba(239, 68, 68, 0.28);
}

.spk-profile-action-btn.muted {
  background: rgba(255, 255, 255, 0.06);
  color: #999;
  cursor: not-allowed;
}

.spk-profile-action-btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

@media (max-width: 640px) {
  .spk-profile-actions {
    width: 100%;
  }

  .spk-profile-actions form,
  .spk-profile-action-btn {
    width: 100%;
  }
}

.dm-compose {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.dm-compose-main {
  flex: 1;
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.dm-compose-main textarea {
  flex: 1;
}

.dm-file-label {
  position: relative;
  min-width: 82px;
  border-radius: 14px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  cursor: pointer;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.dm-file-label:hover {
  background: rgba(255, 255, 255, 0.12);
}

.dm-file-label input {
  display: none;
}

.dm-attachment {
  margin-top: 8px;
}

.dm-attachment-image {
  display: block;
  max-width: 280px;
  max-height: 320px;
  border-radius: 14px;
  object-fit: cover;
}

.dm-attachment-video {
  display: block;
  width: 320px;
  max-width: 100%;
  border-radius: 14px;
  background: #000;
}

.dm-attachment-file {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 320px;
  padding: 11px 13px;
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  background: rgba(255, 255, 255, 0.08);
  word-break: break-all;
}

.dm-attachment-file:hover {
  background: rgba(255, 255, 255, 0.12);
}

.dm-attachment-file i {
  font-size: 20px;
}

@media (max-width: 700px) {
  .dm-compose {
    flex-direction: column;
  }

  .dm-compose-main {
    flex-direction: column;
  }

  .dm-file-label {
    min-height: 42px;
    width: 100%;
  }

  .dm-attachment-image {
    max-width: 100%;
  }
}

.dm-link-preview {
  display: block;
  margin-top: 9px;
  max-width: 360px;
  overflow: hidden;
  border-radius: 15px;
  text-decoration: none;
  color: inherit;
  background: rgba(255, 255, 255, 0.075);
  border: 1px solid rgba(255, 255, 255, 0.09);
}

.dm-link-preview:hover {
  background: rgba(255, 255, 255, 0.11);
}

.dm-link-preview-image {
  width: 100%;
  max-height: 180px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.3);
}

.dm-link-preview-image img {
  width: 100%;
  height: 100%;
  max-height: 180px;
  object-fit: cover;
  display: block;
}

.dm-link-preview-body {
  padding: 12px 13px;
}

.dm-link-preview-site {
  margin-bottom: 5px;
  font-size: 12px;
  color: #aaa;
}

.dm-link-preview-body strong {
  display: block;
  font-size: 14px;
  line-height: 1.35;
  margin-bottom: 6px;
}

.dm-link-preview-body p {
  margin: 0 0 7px;
  font-size: 13px;
  color: #bbb;
  line-height: 1.4;
}

.dm-link-preview-body span {
  display: block;
  font-size: 12px;
  color: #999;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dm-msg.is-me .dm-link-preview {
  background: rgba(124, 58, 237, 0.28);
  border-color: rgba(255, 255, 255, 0.14);
}

.dm-msg.is-me .dm-link-preview-body p,
.dm-msg.is-me .dm-link-preview-body span,
.dm-msg.is-me .dm-link-preview-site {
  color: rgba(255, 255, 255, 0.78);
}

@media (max-width: 700px) {
  .dm-link-preview {
    max-width: 100%;
  }
}

.dm-group-form {
  padding: 16px;
}

.dm-group-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 12px;
}

.dm-group-field label {
  font-size: 13px;
  font-weight: 800;
  color: #aaa;
}

.dm-group-field input {
  width: 100%;
  border: 0;
  outline: none;
  border-radius: 12px;
  padding: 11px 12px;
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
}

.dm-group-help {
  margin-bottom: 10px;
  font-size: 12px;
  color: #999;
}

.dm-friend-check-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: 230px;
  overflow-y: auto;
  margin-bottom: 14px;
  padding-right: 4px;
}

.dm-friend-check {
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  padding: 9px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
}

.dm-friend-check:hover {
  background: rgba(255, 255, 255, 0.08);
}

.dm-friend-check input {
  accent-color: #7c3aed;
}

.dm-friend-check span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 14px;
}

.dm-group-create-btn {
  width: 100%;
}

.dm-group-invite-panel {
  margin-bottom: 14px;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.dm-group-invite-head {
  padding: 13px 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.dm-group-invite-head > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dm-group-invite-head strong {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.dm-group-invite-head span {
  color: #999;
  font-size: 13px;
}

.dm-group-invite-form {
  padding: 14px;
}

.dm-invite-check-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.dm-invite-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 9px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.dm-invite-check:hover {
  background: rgba(255, 255, 255, 0.1);
}

.dm-invite-check input {
  accent-color: #7c3aed;
}

.dm-invite-check span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
}

@media (max-width: 700px) {
  .dm-group-invite-head > div {
    align-items: flex-start;
    flex-direction: column;
  }

  .dm-invite-check-list {
    flex-direction: column;
  }

  .dm-invite-check {
    width: 100%;
  }

  .dm-group-invite-form .dm-btn {
    width: 100%;
  }
}

.dm-online-list {
  display: flex;
  flex-direction: column;
}

.dm-online-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.dm-online-item a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.dm-online-item strong {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.dm-online-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: 0 0 9px;
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.14);
}

.dm-online-item form {
  margin: 0;
}

.dm-online-message-btn {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  color: #fff;
  background: #7c3aed;
}

.dm-online-message-btn:hover {
  transform: translateY(-1px);
}

.spk-mini-chat {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 9999;
  width: 340px;
  max-width: calc(100vw - 28px);
  border-radius: 18px;
  overflow: hidden;
  background: rgba(20, 20, 28, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(12px);
}

.spk-mini-chat-head {
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 10px 0 14px;
  background: rgba(255, 255, 255, 0.06);
}

.spk-mini-title {
  min-width: 0;
  flex: 1;
  border: 0;
  background: transparent;
  color: #fff;
  font-weight: 900;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.spk-mini-actions {
  display: inline-flex;
  gap: 6px;
}

.spk-mini-actions button {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.spk-mini-actions button:hover {
  background: rgba(255, 255, 255, 0.18);
}

.spk-mini-chat-body {
  height: 330px;
  overflow-y: auto;
  padding: 12px;
}

.spk-mini-empty {
  padding: 30px 10px;
  text-align: center;
  color: #aaa;
  font-size: 14px;
}

.spk-mini-msg {
  margin-bottom: 12px;
  max-width: 88%;
}

.spk-mini-msg.is-me {
  margin-left: auto;
}

.spk-mini-msg.is-other {
  margin-right: auto;
}

.spk-mini-msg-meta {
  margin-bottom: 4px;
  font-size: 11px;
  color: #aaa;
}

.spk-mini-msg.is-me .spk-mini-msg-meta {
  text-align: right;
}

.spk-mini-msg-bubble {
  padding: 9px 11px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.spk-mini-msg.is-me .spk-mini-msg-bubble {
  background: rgba(124, 58, 237, 0.78);
}

.spk-mini-file,
.spk-mini-link {
  display: block;
  margin-top: 6px;
  padding: 9px 10px;
  border-radius: 12px;
  text-decoration: none;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  font-size: 12px;
  word-break: break-word;
}

.spk-mini-link strong {
  display: block;
  margin-bottom: 3px;
  font-size: 13px;
}

.spk-mini-link span {
  display: block;
  color: #bbb;
  font-size: 11px;
}

.spk-mini-compose {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.spk-mini-compose input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  border-radius: 999px;
  padding: 10px 12px;
  color: #fff;
  background: rgba(255, 255, 255, 0.09);
}

.spk-mini-compose button {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  color: #fff;
  background: #7c3aed;
}

.spk-mini-chat.is-collapsed .spk-mini-chat-body,
.spk-mini-chat.is-collapsed .spk-mini-compose {
  display: none;
}

@media (max-width: 640px) {
  .spk-mini-chat {
    right: 12px;
    bottom: 12px;
    width: calc(100vw - 24px);
  }

  .spk-mini-chat-body {
    height: 300px;
  }
}

.dm-mini-open-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  padding: 9px 13px;
  cursor: pointer;
  font-weight: 800;
  color: #fff;
  background: rgba(124, 58, 237, 0.75);
}

.dm-unread-badge {
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  font-size: 12px;
  font-weight: 900;
  color: #fff;
  background: #ef4444;
}

[hidden] {
  display: none !important;
}

.vnav__badge {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  margin-left: auto;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 900;
  color: #fff;
  background: #ef4444;
}

.dm-msg-delete-form {
  display: inline-flex;
  margin: 0;
}

.dm-msg-delete-btn {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #aaa;
  background: rgba(255, 255, 255, 0.08);
  font-size: 11px;
}

.dm-msg-delete-btn:hover {
  color: #fff;
  background: rgba(239, 68, 68, 0.75);
}

.dm-msg.is-me .dm-msg-meta {
  justify-content: flex-end;
}

.dm-chat-header form {
  margin: 0;
}

.dm-leave-group-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  padding: 9px 13px;
  cursor: pointer;
  font-weight: 800;
  color: #ffb4b4;
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.28);
}

.dm-leave-group-btn:hover {
  color: #fff;
  background: rgba(239, 68, 68, 0.75);
}

.dm-group-rename-panel {
  margin-bottom: 14px;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.dm-group-rename-form {
  display: flex;
  gap: 10px;
  padding: 14px;
}

.dm-group-rename-form input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  border-radius: 12px;
  padding: 11px 12px;
  color: inherit;
  background: rgba(255, 255, 255, 0.08);
}

.dm-group-rename-form button {
  white-space: nowrap;
}

@media (max-width: 700px) {
  .dm-group-rename-form {
    flex-direction: column;
  }

  .dm-group-rename-form button {
    width: 100%;
  }
}

.dm-group-members-panel {
  margin-bottom: 14px;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.dm-group-member-list {
  display: flex;
  flex-direction: column;
}

.dm-group-member-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.dm-group-member-item:last-child {
  border-bottom: 0;
}

.dm-group-member-item > div {
  min-width: 0;
}

.dm-group-member-item strong {
  display: inline-block;
  max-width: 180px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.dm-member-role {
  display: inline-flex;
  align-items: center;
  margin-left: 7px;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  color: #aaa;
  background: rgba(255, 255, 255, 0.07);
}

.dm-member-role.owner {
  color: #fff;
  background: rgba(124, 58, 237, 0.55);
}

.dm-group-member-item form {
  margin: 0;
}

.dm-kick-member-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  border-radius: 999px;
  padding: 8px 11px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  color: #ffb4b4;
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.26);
}

.dm-kick-member-btn:hover {
  color: #fff;
  background: rgba(239, 68, 68, 0.75);
}

@media (max-width: 700px) {
  .dm-group-member-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .dm-kick-member-btn {
    width: 100%;
    justify-content: center;
  }

  .dm-group-member-item form {
    width: 100%;
  }
}

.dm-request-actions {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.dm-request-actions form {
  margin: 0;
}

.dm-btn-danger {
  background: rgba(239, 68, 68, 0.16);
  color: #ffb4b4;
  border: 1px solid rgba(239, 68, 68, 0.28);
}

.dm-btn-danger:hover {
  background: rgba(239, 68, 68, 0.75);
  color: #fff;
}

.dm-btn-muted {
  background: rgba(255, 255, 255, 0.08);
  color: #aaa;
}

.dm-btn-muted:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.dm-friends-list {
  display: flex;
  flex-direction: column;
}

.dm-friend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.dm-friend-item:last-child {
  border-bottom: 0;
}

.dm-friend-main {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.dm-friend-main strong {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.dm-friend-actions {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.dm-friend-actions form {
  margin: 0;
}

.dm-friend-icon-btn {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  color: #fff;
  background: #7c3aed;
}

.dm-friend-icon-btn:hover {
  transform: translateY(-1px);
}

.dm-friend-icon-btn.danger {
  color: #ffb4b4;
  background: rgba(239, 68, 68, 0.16);
  border: 1px solid rgba(239, 68, 68, 0.28);
}

.dm-friend-icon-btn.danger:hover {
  color: #fff;
  background: rgba(239, 68, 68, 0.75);
}

@media (max-width: 700px) {
  .dm-friend-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .dm-friend-actions {
    width: 100%;
  }

  .dm-friend-actions form,
  .dm-friend-icon-btn {
    flex: 1;
  }
}

.dm-new-message-notice,
.spk-mini-new {
  width: 100%;
  border: 0;
  cursor: pointer;
  font-weight: 900;
  color: #fff;
  background: rgba(124, 58, 237, 0.9);
}

.dm-new-message-notice {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 999px;
}

.spk-mini-new {
  padding: 8px 10px;
  font-size: 13px;
}

[hidden] {
  display: none !important;
}

/* ================================
   DM Theme Polish
================================ */

:root {
  --dm-bg: #111113;
  --dm-panel: #18181b;
  --dm-panel-2: #222226;
  --dm-line: rgba(255, 255, 255, 0.08);
  --dm-line-strong: rgba(255, 255, 255, 0.12);
  --dm-text: #f4f4f5;
  --dm-muted: #a1a1aa;
  --dm-muted-2: #71717a;

  --dm-primary: #ff6f9f;
  --dm-primary-2: #9b5cff;
  --dm-primary-soft: rgba(255, 111, 159, 0.16);
  --dm-purple-soft: rgba(155, 92, 255, 0.22);

  --dm-danger: #ef4444;
  --dm-danger-soft: rgba(239, 68, 68, 0.16);
  --dm-online: #22c55e;
}

/* 전체 패널 톤 정리 */
.dm-panel,
.dm-chat-box,
.dm-group-invite-panel,
.dm-group-rename-panel,
.dm-group-members-panel {
  background: var(--dm-panel);
  border: 1px solid var(--dm-line);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.18);
}

.dm-panel {
  border-radius: 18px;
}

.dm-panel-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--dm-line);
}

.dm-panel-header h2 {
  font-size: 18px;
  letter-spacing: -0.02em;
}

/* 카드 내부 여백 완화 */
.dm-empty {
  padding: 22px 18px;
  color: var(--dm-muted);
}

.dm-empty.small {
  padding: 18px 16px;
}

/* 버튼 색감 통일 */
.dm-btn-primary,
.dm-compose button,
.dm-online-message-btn,
.dm-friend-icon-btn,
.dm-group-create-btn,
.dm-mini-open-btn {
  background: linear-gradient(135deg, var(--dm-primary), var(--dm-primary-2));
  color: #fff;
  box-shadow: 0 8px 18px rgba(155, 92, 255, 0.24);
}

.dm-btn-primary:hover,
.dm-compose button:hover,
.dm-online-message-btn:hover,
.dm-friend-icon-btn:hover,
.dm-group-create-btn:hover,
.dm-mini-open-btn:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.dm-btn-danger,
.dm-friend-icon-btn.danger,
.dm-kick-member-btn,
.dm-leave-group-btn {
  background: var(--dm-danger-soft);
  color: #ffb4b4;
  border: 1px solid rgba(239, 68, 68, 0.28);
  box-shadow: none;
}

.dm-btn-danger:hover,
.dm-friend-icon-btn.danger:hover,
.dm-kick-member-btn:hover,
.dm-leave-group-btn:hover {
  background: rgba(239, 68, 68, 0.72);
  color: #fff;
}

/* 스크롤바 커스텀 */
.dm-chat-box,
.dm-friend-check-list,
.dm-invite-check-list,
.dm-online-list,
.dm-thread-list,
.dm-request-list,
.dm-friends-list {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 111, 159, 0.45) transparent;
}

.dm-chat-box::-webkit-scrollbar,
.dm-friend-check-list::-webkit-scrollbar,
.dm-invite-check-list::-webkit-scrollbar,
.dm-online-list::-webkit-scrollbar,
.dm-thread-list::-webkit-scrollbar,
.dm-request-list::-webkit-scrollbar,
.dm-friends-list::-webkit-scrollbar {
  width: 8px;
}

.dm-chat-box::-webkit-scrollbar-track,
.dm-friend-check-list::-webkit-scrollbar-track,
.dm-invite-check-list::-webkit-scrollbar-track,
.dm-online-list::-webkit-scrollbar-track,
.dm-thread-list::-webkit-scrollbar-track,
.dm-request-list::-webkit-scrollbar-track,
.dm-friends-list::-webkit-scrollbar-track {
  background: transparent;
}

.dm-chat-box::-webkit-scrollbar-thumb,
.dm-friend-check-list::-webkit-scrollbar-thumb,
.dm-invite-check-list::-webkit-scrollbar-thumb,
.dm-online-list::-webkit-scrollbar-thumb,
.dm-thread-list::-webkit-scrollbar-thumb,
.dm-request-list::-webkit-scrollbar-thumb,
.dm-friends-list::-webkit-scrollbar-thumb {
  background: rgba(255, 111, 159, 0.38);
  border-radius: 999px;
}

/* 메시지 목록 레이아웃 정리 */
.dm-thread-item {
  padding: 15px 18px;
  gap: 15px;
}

.dm-thread-avatar {
  width: 48px;
  height: 48px;
  flex-basis: 48px;
  background: rgba(255, 255, 255, 0.07);
}

.dm-thread-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.dm-thread-name {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.dm-thread-right {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 0 auto;
  margin-left: auto;
}

.dm-thread-time {
  font-size: 12px;
  color: var(--dm-muted);
  white-space: nowrap;
}

.dm-unread-badge {
  min-width: 21px;
  height: 21px;
  padding: 0 7px;
  margin-left: 0;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  color: #fff;
  background: linear-gradient(135deg, #ff5f8f, #ff3d6e);
  box-shadow: 0 8px 16px rgba(255, 61, 110, 0.22);
}

/* 일반 채팅창 정리 */
.dm-chat-page {
  max-width: 1120px;
}

.dm-chat-header {
  gap: 12px;
}

.dm-back-link,
.dm-mini-open-btn {
  min-height: 42px;
  padding: 0 15px;
  border-radius: 999px;
  font-size: 14px;
}

.dm-back-link {
  background: rgba(255, 255, 255, 0.07);
  color: var(--dm-text);
}

.dm-chat-header h1 {
  font-size: 28px;
  letter-spacing: -0.04em;
}

.dm-chat-header p {
  color: var(--dm-muted);
}

.dm-chat-box {
  padding: 18px 20px;
  border-radius: 20px;
  max-height: 620px;
}

/* 말풍선 폭/간격 정리 */
.dm-msg {
  max-width: 74%;
  margin-bottom: 18px;
}

.dm-msg-meta {
  gap: 8px;
  margin-bottom: 6px;
  color: var(--dm-muted);
}

.dm-msg-bubble {
  display: inline-block;
  max-width: 100%;
  padding: 11px 15px;
  border-radius: 18px;
  background: var(--dm-panel-2);
  line-height: 1.55;
  color: var(--dm-text);
}

.dm-msg.is-me {
  text-align: right;
}

.dm-msg.is-me .dm-msg-bubble {
  text-align: left;
  background: linear-gradient(135deg, #ff6f9f, #8b5cf6);
  color: #fff;
}

.dm-msg.is-other .dm-msg-bubble {
  background: #2a2a2f;
}

/* 첨부 이미지 크기 제한 */
.dm-attachment {
  margin-top: 9px;
}

.dm-attachment-image {
  max-width: 260px;
  max-height: 260px;
  border-radius: 16px;
  object-fit: contain;
  background: rgba(0, 0, 0, 0.28);
}

.dm-attachment-video {
  width: 320px;
  max-width: 100%;
  max-height: 260px;
  border-radius: 16px;
}

/* 링크 미리보기 카드 정리 */
.dm-link-preview {
  max-width: 360px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.065);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.dm-msg.is-me .dm-link-preview {
  margin-left: auto;
  text-align: left;
  background: rgba(255, 255, 255, 0.09);
}

.dm-link-preview-image {
  max-height: 150px;
}

.dm-link-preview-image img {
  max-height: 150px;
}

/* 입력창 정리 */
.dm-compose {
  align-items: stretch;
  gap: 12px;
}

.dm-compose textarea {
  min-height: 56px;
  border-radius: 18px;
  background: #242428;
  color: var(--dm-text);
}

.dm-compose textarea::placeholder {
  color: var(--dm-muted-2);
}

.dm-file-label {
  min-width: 96px;
  border-radius: 18px;
  background: #242428;
}

.dm-compose button {
  min-width: 104px;
  border-radius: 18px;
}

/* 친구/온라인/그룹 UI 정리 */
.dm-request-item,
.dm-friend-item,
.dm-online-item,
.dm-group-member-item {
  padding: 12px 16px;
}

.dm-online-dot {
  width: 8px;
  height: 8px;
  flex-basis: 8px;
  background: var(--dm-online);
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.12);
}

.dm-online-message-btn,
.dm-friend-icon-btn {
  width: 38px;
  height: 38px;
}

/* 그룹 체크박스 커스텀 */
.dm-friend-check,
.dm-invite-check {
  position: relative;
  background: #242428;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.dm-friend-check:hover,
.dm-invite-check:hover {
  background: #2b2b30;
  border-color: rgba(255, 111, 159, 0.26);
}

.dm-friend-check input,
.dm-invite-check input {
  width: 17px;
  height: 17px;
  accent-color: var(--dm-primary);
}

.dm-friend-check:has(input:checked),
.dm-invite-check:has(input:checked) {
  background: var(--dm-primary-soft);
  border-color: rgba(255, 111, 159, 0.55);
}

/* 새 메시지 알림 */
.dm-new-message-notice {
  margin: 10px auto 0;
  max-width: 360px;
  display: block;
  padding: 10px 14px;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  font-weight: 900;
  color: #fff;
  background: linear-gradient(135deg, #ff6f9f, #8b5cf6);
  box-shadow: 0 10px 22px rgba(155, 92, 255, 0.22);
}

.dm-new-message-notice[hidden] {
  display: none !important;
}

/* 모바일 정리 */
@media (max-width: 700px) {
  .dm-layout {
    gap: 14px;
  }

  .dm-panel {
    border-radius: 16px;
  }

  .dm-panel-header {
    padding: 13px 15px;
  }

  .dm-thread-item {
    padding: 14px 15px;
  }

  .dm-thread-top {
    align-items: flex-start;
  }

  .dm-thread-right {
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
  }

  .dm-msg {
    max-width: 88%;
  }

  .dm-attachment-image {
    max-width: 210px;
    max-height: 220px;
  }

  .dm-compose button {
    width: 100%;
  }
}

/* ================================
   Mini Chat Polish
================================ */

.spk-mini-chat {
  width: 350px;
  background: rgba(18, 18, 22, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.48);
}

.spk-mini-chat-head {
  background: rgba(255, 255, 255, 0.055);
}

.spk-mini-title {
  font-size: 15px;
  letter-spacing: -0.02em;
}

.spk-mini-actions button {
  background: rgba(255, 255, 255, 0.1);
}

.spk-mini-actions button:hover {
  background: rgba(255, 111, 159, 0.22);
}

.spk-mini-chat-body {
  height: 325px;
  padding: 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 111, 159, 0.42) transparent;
}

.spk-mini-chat-body::-webkit-scrollbar {
  width: 7px;
}

.spk-mini-chat-body::-webkit-scrollbar-track {
  background: transparent;
}

.spk-mini-chat-body::-webkit-scrollbar-thumb {
  background: rgba(255, 111, 159, 0.38);
  border-radius: 999px;
}

.spk-mini-msg {
  max-width: 86%;
  margin-bottom: 12px;
}

.spk-mini-msg-meta {
  margin-bottom: 5px;
  color: #a1a1aa;
}

.spk-mini-msg-bubble {
  display: inline-block;
  max-width: 100%;
  padding: 9px 12px;
  border-radius: 15px;
  background: #2a2a2f;
  line-height: 1.45;
}

.spk-mini-msg.is-me {
  text-align: right;
}

.spk-mini-msg.is-me .spk-mini-msg-bubble {
  text-align: left;
  background: linear-gradient(135deg, #ff6f9f, #8b5cf6);
}

.spk-mini-file,
.spk-mini-link {
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.08);
}

.spk-mini-new {
  width: calc(100% - 20px);
  margin: 0 10px 8px;
  padding: 8px 10px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
  color: #fff;
  background: linear-gradient(135deg, #ff6f9f, #8b5cf6);
}

.spk-mini-new[hidden] {
  display: none !important;
}

.spk-mini-compose {
  padding: 10px;
  gap: 8px;
}

.spk-mini-compose input {
  height: 42px;
  background: #242428;
}

.spk-mini-compose button {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, #ff6f9f, #8b5cf6);
}

@media (max-width: 640px) {
  .spk-mini-chat {
    width: calc(100vw - 24px);
  }

  .spk-mini-chat-body {
    height: 300px;
  }
}

.vnav__badge {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  margin-left: auto;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 900;
  color: #fff;
  background: linear-gradient(135deg, #ff6f9f, #ff3d6e);
  box-shadow: 0 6px 14px rgba(255, 61, 110, 0.28);
}

[hidden] {
  display: none !important;
}

.vnav.is-collapsed .vnav__badge,
body.nav-collapsed .vnav__badge {
  position: absolute;
  top: 8px;
  right: 8px;
  min-width: 18px;
  height: 18px;
  font-size: 10px;
}

.dm-friend-icon-btn,
.dm-online-message-btn {
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  cursor: pointer;
}

.dm-friend-icon-btn i,
.dm-online-message-btn i {
  display: block;
  line-height: 1;
  margin: 0;
}

/* ================================
   Mini Chat Button/Input Alignment Fix
================================ */

/* 상단 - / X 버튼 아이콘 중앙 정렬 */
.spk-mini-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.spk-mini-actions button {
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.spk-mini-actions button i {
  display: block;
  line-height: 1;
  margin: 0;
}

/* 하단 입력창/전송 버튼 높이 통일 */
.spk-mini-compose {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
}

.spk-mini-compose input {
  height: 46px !important;
  min-height: 46px !important;
  max-height: 46px !important;
  padding: 0 16px !important;
  box-sizing: border-box;
  border-radius: 999px;
  line-height: 46px;
}

.spk-mini-compose button {
  width: 46px !important;
  height: 46px !important;
  min-width: 46px !important;
  min-height: 46px !important;
  padding: 0 !important;
  border: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  flex: 0 0 46px;
}

.spk-mini-compose button i {
  display: block;
  line-height: 1;
  margin: 0;
}

/* 미니 채팅 상단 버튼: 배경 제거, 아이콘만 표시 */
.spk-mini-actions button {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0 !important;
  border-radius: 50%;
  background: transparent !important;
  box-shadow: none !important;
  color: rgba(255, 255, 255, 0.85);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.spk-mini-actions button:hover {
  background: transparent !important;
  color: #fff;
}

.spk-mini-actions button i {
  display: block;
  line-height: 1;
  margin: 0;
}

.dm-thread-list .dm-unread-badge,
.dm-thread-item .dm-unread-badge,
span.dm-unread-badge {
  color: #fff !important;
}

/* ================================
   DM Attachment Alignment Fix
================================ */

/* 첨부파일 영역 기본 정렬 */
.dm-msg .dm-attachment {
  display: flex;
  width: 100%;
  margin-top: 9px;
}

/* 내가 보낸 첨부파일은 오른쪽 */
.dm-msg.is-me .dm-attachment {
  justify-content: flex-end;
  text-align: right;
}

/* 상대방 첨부파일은 왼쪽 */
.dm-msg.is-other .dm-attachment {
  justify-content: flex-start;
  text-align: left;
}

/* 이미지 링크 wrapper 정렬 */
.dm-msg .dm-attachment > a {
  display: inline-flex;
  max-width: 100%;
}

/* 내가 보낸 이미지 자체도 오른쪽으로 고정 */
.dm-msg.is-me .dm-attachment-image {
  margin-left: auto;
  margin-right: 0;
}

/* 상대방 이미지는 왼쪽 */
.dm-msg.is-other .dm-attachment-image {
  margin-left: 0;
  margin-right: auto;
}

/* 첨부 이미지 크기 안정화 */
.dm-attachment-image {
  display: block;
  max-width: 260px;
  max-height: 260px;
  width: auto;
  height: auto;
  border-radius: 16px;
  object-fit: contain;
  background: rgba(0, 0, 0, 0.28);
}

/* ================================
   DM Delete Button Shape Fix
================================ */

.dm-msg-delete-form {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  flex: 0 0 auto;
}

.dm-msg-delete-btn {
  width: 30px !important;
  height: 30px !important;
  min-width: 30px !important;
  min-height: 30px !important;
  max-width: 30px !important;
  max-height: 30px !important;
  padding: 0 !important;
  border: 0;
  border-radius: 50% !important;
  flex: 0 0 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  cursor: pointer;
  color: #aaa;
  background: rgba(255, 255, 255, 0.08);
}

.dm-msg-delete-btn i {
  display: block;
  line-height: 1;
  margin: 0;
  font-size: 13px;
}

.dm-msg-delete-btn:hover {
  color: #fff;
  background: rgba(239, 68, 68, 0.75);
}

/* 내 메시지 meta 정렬 안정화 */
.dm-msg.is-me .dm-msg-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

/* 상대 메시지 meta 정렬 */
.dm-msg.is-other .dm-msg-meta {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
}

/* 미니 채팅 첨부 이미지/비디오 표시 */
.spk-mini-image-link {
  display: inline-flex;
  margin-top: 6px;
  max-width: 100%;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.25);
}

.spk-mini-image {
  display: block;
  max-width: 190px;
  max-height: 190px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 14px;
}

.spk-mini-video {
  display: block;
  margin-top: 6px;
  width: 210px;
  max-width: 100%;
  max-height: 170px;
  border-radius: 14px;
  background: #000;
}

.spk-mini-msg.is-me .spk-mini-image-link,
.spk-mini-msg.is-me .spk-mini-video {
  margin-left: auto;
}

.spk-mini-msg.is-other .spk-mini-image-link,
.spk-mini-msg.is-other .spk-mini-video {
  margin-right: auto;
}


/* ================================
   Create Group Input Fix
================================ */

.dm-group-form {
  padding: 18px 20px 20px;
}

.dm-group-field {
  width: 100%;
  margin-bottom: 14px;
}

.dm-group-field label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 900;
  color: #b7b7c2;
}

.dm-group-field input {
  display: block;
  width: 100%;
  max-width: 100%;
  height: 46px;
  box-sizing: border-box;
  border: 1px solid rgba(255, 255, 255, 0.08);
  outline: none;
  border-radius: 14px;
  padding: 0 16px;
  background: #242428;
  color: #f4f4f5;
  font-size: 15px;
  line-height: 46px;
}

.dm-group-field input::placeholder {
  color: #85858f;
}

.dm-group-field input:focus {
  border-color: rgba(255, 111, 159, 0.55);
  background: #28282d;
  box-shadow: 0 0 0 4px rgba(255, 111, 159, 0.12);
}

.dm-group-help {
  margin: 0 0 12px;
  font-size: 13px;
  color: #a1a1aa;
}

/* ================================
   DM Thread Header Layout Fix
================================ */

.dm-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.dm-chat-header-info {
  min-width: 0;
  flex: 1 1 auto;
  text-align: left;
}

.dm-chat-header-info h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: #f4f4f5;
}

.dm-chat-header-info p {
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 1.45;
  color: #a1a1aa;
  text-align: left;
  word-break: break-word;
}

.dm-chat-header-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  flex: 0 0 auto;
}

.dm-chat-header-actions form {
  margin: 0;
  display: inline-flex;
}

/* 모든 상단 버튼 세로 높이 통일 */
.dm-head-btn {
  height: 46px;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  box-sizing: border-box;
  white-space: nowrap;
  cursor: pointer;
}

/* 돌아가기 버튼 */
.dm-back-link.dm-head-btn {
  background: rgba(255, 255, 255, 0.07);
  color: #f4f4f5;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.dm-back-link.dm-head-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

/* 간략화 버튼 */
.dm-mini-open-btn.dm-head-btn {
  background: linear-gradient(135deg, #ff6f9f, #8b5cf6);
  color: #fff;
  border: 0;
  box-shadow: 0 10px 24px rgba(139, 92, 246, 0.24);
}

.dm-mini-open-btn.dm-head-btn:hover {
  filter: brightness(1.06);
}

/* 나가기 버튼 */
.dm-leave-group-btn.dm-head-btn {
  background: rgba(239, 68, 68, 0.14);
  color: #ffb4b4;
  border: 1px solid rgba(239, 68, 68, 0.28);
}

.dm-leave-group-btn.dm-head-btn:hover {
  background: rgba(239, 68, 68, 0.75);
  color: #fff;
}

.dm-head-btn i {
  display: block;
  line-height: 1;
  margin: 0;
}

/* 모바일 대응 */
@media (max-width: 900px) {
  .dm-chat-header {
    flex-direction: column;
    align-items: stretch;
  }

  .dm-chat-header-info {
    order: 1;
  }

  .dm-chat-header-actions {
    order: 2;
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .dm-chat-header-actions {
    display: flex;
    width: 100%;
  }

  .dm-chat-header-actions form {
    flex: 1 1 auto;
  }

  .dm-head-btn,
  .dm-chat-header-actions .dm-head-btn {
    flex: 1 1 auto;
    width: 100%;
  }
}

/* 친구/온라인 아이콘 버튼: 둥근 정사각형 */
.dm-friend-icon-btn,
.dm-online-message-btn {
  width: 46px !important;
  height: 46px !important;
  min-width: 46px !important;
  min-height: 46px !important;
  padding: 0 !important;
  border-radius: 14px !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.dm-friend-icon-btn i,
.dm-online-message-btn i {
  display: block;
  line-height: 1;
  margin: 0;
  font-size: 17px;
}

/* 삭제/친구 제거 버튼도 동일한 형태 유지 */
.dm-friend-icon-btn.danger {
  border-radius: 14px !important;
}

/* 버튼 사이 간격 정리 */
.dm-friend-actions {
  gap: 8px;
}

.dm-online-item form,
.dm-friend-actions form {
  margin: 0;
  display: inline-flex;
}

/* ================================
   DM Compose Bar Redesign
================================ */

.dm-compose {
  margin-top: 14px;
}

.dm-compose-input-wrap {
  flex: 1 1 auto;
  min-width: 0;
}

.dm-compose-input-wrap textarea {
  display: block;
  width: 100%;
  min-height: 54px;
  max-height: 140px;
  resize: vertical;
  border: 0;
  outline: none;
  box-sizing: border-box;
  padding: 15px 18px;
  border-radius: 18px;
  background: #24242a;
  color: #f4f4f5;
  font-size: 15px;
  line-height: 1.45;
}

.dm-compose-input-wrap textarea::placeholder {
  color: #8d8d99;
}

.dm-compose-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.dm-compose-icon-btn {
  width: 54px;
  height: 54px;
  min-width: 54px;
  min-height: 54px;
  padding: 0;
  border: 0;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  cursor: pointer;
  line-height: 1;
  transition: transform 0.15s ease, filter 0.15s ease, background 0.15s ease;
}

.dm-compose-icon-btn i {
  display: block;
  margin: 0;
  line-height: 1;
  font-size: 20px;
}

/* 파일 버튼 */
.dm-file-label.dm-compose-icon-btn {
  position: relative;
  background: #24242a;
  color: #f4f4f5;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.dm-file-label.dm-compose-icon-btn:hover {
  background: #2b2b31;
  transform: translateY(-1px);
}

.dm-file-label.dm-compose-icon-btn input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

/* 전송 버튼 */
.dm-send-btn {
  background: linear-gradient(135deg, #ff6f9f, #8b5cf6);
  color: #fff;
  box-shadow: 0 10px 22px rgba(139, 92, 246, 0.26);
}

.dm-send-btn:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

/* 예전 텍스트 스타일 제거 대응 */
.dm-file-label span {
  display: none !important;
}

/* 모바일 */
@media (max-width: 700px) {
  .dm-compose-shell {
    gap: 10px;
    padding: 10px;
  }

  .dm-compose-input-wrap textarea {
    min-height: 50px;
    padding: 13px 15px;
    border-radius: 16px;
  }

  .dm-compose-icon-btn {
    width: 50px;
    height: 50px;
    min-width: 50px;
    min-height: 50px;
    border-radius: 16px;
  }

  .dm-compose-icon-btn i {
    font-size: 18px;
  }
}

/* ================================
   DM Compose Full Width Bar
================================ */

.dm-compose {
  width: 100%;
  margin-top: 14px;
}

.dm-compose-shell {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  box-sizing: border-box;
  border-radius: 22px;
  background: #1b1b20;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

.dm-compose-input-wrap {
  flex: 1 1 auto;
  min-width: 0;
}

.dm-compose-input-wrap textarea {
  display: block;
  width: 100%;
  height: 50px;
  min-height: 50px;
  max-height: 120px;
  resize: none;
  box-sizing: border-box;
  border: 0;
  outline: none;
  padding: 13px 15px;
  border-radius: 16px;
  background: #24242a;
  color: #f4f4f5;
  font-size: 15px;
  line-height: 1.45;
}

.dm-compose-input-wrap textarea::placeholder {
  color: #8d8d99;
}

.dm-compose-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.dm-compose-icon-btn {
  width: 50px;
  height: 50px;
  min-width: 50px;
  min-height: 50px;
  padding: 0;
  border: 0;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  cursor: pointer;
  line-height: 1;
}

.dm-compose-icon-btn i {
  display: block;
  line-height: 1;
  margin: 0;
  font-size: 19px;
}

/* 파일 버튼 */
.dm-file-label.dm-compose-icon-btn {
  position: relative;
  background: #24242a;
  color: #f4f4f5;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.dm-file-label.dm-compose-icon-btn:hover {
  background: #2b2b31;
}

/* 파일 input은 버튼 전체를 클릭 가능하게 */
.dm-file-label.dm-compose-icon-btn input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

/* 전송 버튼 */
.dm-send-btn {
  background: linear-gradient(135deg, #ff6f9f, #8b5cf6);
  color: #fff;
  box-shadow: 0 8px 18px rgba(139, 92, 246, 0.24);
}

.dm-send-btn:hover {
  filter: brightness(1.06);
}

/* 예전 텍스트 제거 */
.dm-file-label span,
.dm-send-btn span {
  display: none !important;
}

/* 모바일에서도 하나의 바로 유지 */
@media (max-width: 700px) {
  .dm-compose-shell {
    gap: 7px;
    padding: 7px;
    border-radius: 20px;
  }

  .dm-compose-input-wrap textarea {
    height: 48px;
    min-height: 48px;
    padding: 12px 14px;
    border-radius: 15px;
  }

  .dm-compose-icon-btn {
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    border-radius: 15px;
  }
}

/* 미니 채팅 전송 버튼: 둥근 정사각형 */
.spk-mini-compose button {
  width: 46px !important;
  height: 46px !important;
  min-width: 46px !important;
  min-height: 46px !important;
  flex: 0 0 46px;
  padding: 0 !important;
  border: 0;
  border-radius: 14px !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  background: linear-gradient(135deg, #ff6f9f, #8b5cf6);
  color: #fff;
  box-shadow: 0 8px 18px rgba(139, 92, 246, 0.24);
}

.spk-mini-compose button i {
  display: block;
  line-height: 1;
  margin: 0;
  font-size: 18px;
}

.spk-mini-compose button:hover {
  filter: brightness(1.06);
}

.spk-mini-compose input {
  height: 46px !important;
  min-height: 46px !important;
  max-height: 46px !important;
  padding: 0 15px !important;
  box-sizing: border-box;
  border-radius: 14px !important;
  line-height: 46px;
}

/* ================================
   DM Profile Avatars
================================ */

.dm-thread-avatar {
  overflow: hidden;
}

.dm-thread-avatar-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: inherit;
}

.dm-msg-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dm-msg.is-me .dm-msg-meta {
  justify-content: flex-end;
}

.dm-msg.is-other .dm-msg-meta {
  justify-content: flex-start;
}

.dm-msg-avatar {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.dm-msg.is-me .dm-msg-avatar {
  order: 3;
}

.dm-msg.is-me .dm-msg-delete-form {
  order: 4;
}

.spk-mini-msg-meta {
  display: flex;
  align-items: center;
  gap: 6px;
}

.spk-mini-msg.is-me .spk-mini-msg-meta {
  justify-content: flex-end;
}

.spk-mini-msg-avatar {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.08);
}

.spk-mini-msg.is-me .spk-mini-msg-avatar {
  order: 2;
}

/* ================================
   DM Message Meta Size Balance
================================ */

/* 메시지 상단 유저 정보 크기 조정 */
.dm-msg-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 8px;
  font-size: 14px;
  line-height: 1.2;
}

/* 프로필 이미지 확대 */
.dm-msg-avatar {
  width: 34px !important;
  height: 34px !important;
  flex: 0 0 34px !important;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

/* 닉네임 강조 */
.dm-msg-meta strong {
  font-size: 15px;
  font-weight: 900;
  color: #f4f4f5;
  letter-spacing: -0.02em;
}

/* 시간은 살짝 작고 흐리게 */
.dm-msg-meta span {
  font-size: 13px;
  color: #a1a1aa;
}

/* 내 메시지 쪽 정렬 유지 */
.dm-msg.is-me .dm-msg-meta {
  justify-content: flex-end;
}

/* 상대 메시지 쪽 정렬 유지 */
.dm-msg.is-other .dm-msg-meta {
  justify-content: flex-start;
}

/* 삭제 버튼도 메타 크기에 맞춰 균형 조정 */
.dm-msg-delete-btn {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  min-height: 32px !important;
  flex: 0 0 32px !important;
}

.dm-msg-delete-btn i {
  font-size: 13px;
}

/* ================================
   Mini Chat Meta Size Balance
================================ */

.spk-mini-msg-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 6px;
  font-size: 12px;
  line-height: 1.2;
  color: #a1a1aa;
}

.spk-mini-msg-avatar {
  width: 24px !important;
  height: 24px !important;
  flex: 0 0 24px !important;
  border-radius: 50%;
  object-fit: cover;
}

.spk-mini-msg-meta span {
  font-size: 12px;
  color: #a1a1aa;
}

/* ================================
   New Message Notice Inside Chat Box
================================ */

.dm-chat-box-wrap {
  position: relative;
  width: 100%;
}

.dm-new-message-notice {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  width: min(760px, calc(100% - 56px));
  max-width: 760px;
  height: 46px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  font-weight: 900;
  color: #fff;
  background: linear-gradient(135deg, #ff6f9f, #8b5cf6);
  box-shadow:
    0 14px 30px rgba(139, 92, 246, 0.28),
    0 0 0 1px rgba(255, 255, 255, 0.08) inset;
  z-index: 5;
}

.dm-new-message-notice[hidden] {
  display: none !important;
}