:root {
  --dm-ink: #1f2328;
  --dm-muted: #6f7782;
  --dm-soft: #f4f6f8;
  --dm-line: #e2e7ee;
  --dm-line-strong: #cfd7e2;
  --dm-panel: #ffffff;
  --dm-panel-alt: #f8fafc;
  --dm-accent: #111827;
  --dm-own: #dfeeff;
  --dm-own-line: #bed7f4;
  --dm-danger: #dc3545;
  --dm-radius: 8px;
}

.dm-page,
.dm-dock,
.dm-preferences {
  color: var(--dm-ink);
}

.dm-page *,
.dm-dock *,
.dm-preferences * {
  box-sizing: border-box;
}

.dm-page button,
.dm-page input,
.dm-page textarea,
.dm-page select,
.dm-dock button,
.dm-dock input,
.dm-dock textarea,
.dm-preferences button,
.dm-preferences input,
.dm-preferences select {
  font: inherit;
}

.dm-page {
  width: min(1180px, calc(100% - 32px));
  min-height: 680px;
  margin: 24px auto 40px;
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr) 260px;
  gap: 10px;
}

.dm-page--profile {
  width: 100%;
  height: clamp(560px, 64vh, 660px);
  min-height: 0;
  margin: 0;
  grid-template-columns: 276px minmax(0, 1fr);
  font-size: 14px;
}

.dm-page--profile .dm-sidebar {
  display: flex;
  flex-direction: column;
  padding: 9px;
}

.dm-sidebar,
.dm-conversation,
.dm-info {
  min-width: 0;
  background: var(--dm-panel);
  border: 1px solid var(--dm-line);
  border-radius: var(--dm-radius);
  overflow: hidden;
}

.dm-sidebar {
  padding: 10px;
}

.dm-sidebar__head,
.dm-chat__head,
.dm-mini-list__head,
.dm-mini__head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dm-sidebar__head {
  justify-content: space-between;
  min-height: 36px;
}

.dm-sidebar__head h1 {
  margin: 0;
  font-size: 17px;
  line-height: 1.2;
  letter-spacing: 0;
}

.dm-icon-button,
.dm-send-button,
.dm-chat-list-button {
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease, transform .15s ease;
}

.dm-icon-button {
  width: 34px;
  height: 34px;
  border-radius: var(--dm-radius);
  color: #7d8792;
  background: transparent;
}

.dm-icon-button:hover,
.dm-icon-button.is-active {
  color: var(--dm-ink);
  background: var(--dm-soft);
}

.dm-search {
  height: 38px;
  margin: 10px 0 8px;
  padding: 0 11px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--dm-soft);
  border: 1px solid transparent;
  border-radius: var(--dm-radius);
  color: #9099a5;
}

.dm-search:focus-within {
  background: #fff;
  border-color: var(--dm-line-strong);
}

.dm-search input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--dm-ink);
}

.dm-page--profile .dm-search {
  height: 34px;
  margin: 8px 0 7px;
  padding: 0 10px;
  font-size: 13px;
}

.dm-filters {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}

.dm-filters button {
  min-width: 0;
  height: 31px;
  padding: 0 10px;
  border: 1px solid var(--dm-line);
  border-radius: var(--dm-radius);
  background: #fff;
  color: #596372;
  white-space: nowrap;
  cursor: pointer;
}

.dm-filters button.is-active {
  background: var(--dm-accent);
  border-color: var(--dm-accent);
  color: #fff;
}

.dm-page--profile .dm-filters {
  gap: 5px;
  margin-bottom: 7px;
}

.dm-page--profile .dm-filters button {
  height: 28px;
  padding: 0 9px;
  font-size: 13px;
}

.dm-thread-list {
  display: grid;
  grid-auto-rows: max-content;
  align-content: start;
  gap: 3px;
  max-height: 568px;
  overflow-y: auto;
  padding-right: 2px;
}

.dm-page--profile .dm-thread-list {
  flex: 0 1 auto;
  min-height: 0;
  max-height: 300px;
}

.dm-thread {
  width: 100%;
  min-height: 58px;
  padding: 7px;
  border: 0;
  border-radius: var(--dm-radius);
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.dm-page--profile .dm-thread {
  min-height: 54px;
  grid-template-columns: 39px minmax(0, 1fr) auto;
  gap: 8px;
  padding: 6px;
}

.dm-thread:hover,
.dm-thread.is-active {
  background: #eef2f6;
}

.dm-user-avatar {
  position: relative;
  overflow: visible;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  --avatar-flag-clip-radius: 25px;
  --avatar-flag-clip-y: -16px;
  --avatar-online-right: -1px;
  --avatar-online-bottom: 5px;
  --avatar-role-top: -2px;
  --avatar-role-right: -2px;
}

.dm-user-avatar > img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: #e8edf3;
}

.dm-user-avatar .online-indicator {
  position: absolute !important;
  display: block !important;
  width: 10px !important;
  height: 10px !important;
  right: var(--avatar-online-right, -1px) !important;
  bottom: var(--avatar-online-bottom, 5px) !important;
  border: 2px solid #fff !important;
  border-radius: 50%;
  background: #22c55e !important;
  box-shadow: 0 1px 4px rgba(17, 24, 39, .16);
}

.dm-user-avatar .avatar-role-badge {
  position: absolute !important;
  top: var(--avatar-role-top, -2px) !important;
  right: var(--avatar-role-right, -2px) !important;
  z-index: 4;
  width: 17px !important;
  height: 17px !important;
  padding: 2px;
  border: 1px solid rgba(17, 24, 39, .14);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 3px 8px rgba(17, 24, 39, .14);
  object-fit: contain;
}

.dm-user-avatar .avatar-flag {
  position: absolute;
  left: 50%;
  bottom: -2px;
  z-index: 3;
  width: 17px !important;
  height: 11px !important;
  border: 1px solid rgba(255, 255, 255, .96);
  border-radius: 3px;
  background-size: cover;
  background-position: center;
  box-shadow: 0 1px 4px rgba(17, 24, 39, .14);
  transform: translateX(-50%);
  clip-path: circle(var(--avatar-flag-clip-radius) at 50% var(--avatar-flag-clip-y));
}

.dm-user-avatar--thread > img,
.dm-user-avatar--header > img,
.dm-user-avatar--info > img {
  width: 40px;
  height: 40px;
}

.dm-user-avatar--message > img {
  width: 34px;
  height: 34px;
}

.dm-user-avatar--mini > img {
  width: 31px;
  height: 31px;
}

.dm-user-avatar--message {
  --avatar-online-bottom: 3px;
  --avatar-role-top: -3px;
  --avatar-role-right: -3px;
  --avatar-flag-clip-radius: 22px;
  --avatar-flag-clip-y: -13px;
}

.dm-user-avatar--mini {
  --avatar-online-bottom: 3px;
  --avatar-role-top: -3px;
  --avatar-role-right: -3px;
  --avatar-flag-clip-radius: 20px;
  --avatar-flag-clip-y: -11px;
}

.dm-thread__body {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.dm-thread__name,
.dm-thread__text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dm-thread__name {
  font-weight: 700;
  font-size: 14px;
}

.dm-thread__text {
  color: var(--dm-muted);
  font-size: 12px;
}

.dm-page--profile .dm-thread__name {
  font-size: 13px;
}

.dm-page--profile .dm-thread__text,
.dm-page--profile .dm-thread__meta {
  font-size: 11px;
}

.dm-thread__meta {
  display: grid;
  justify-items: end;
  gap: 4px;
  color: #8c95a1;
  font-size: 11px;
}

.dm-thread__unread {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--dm-accent);
  color: #fff;
  font-size: 11px;
}

.dm-conversation,
.dm-chat,
.dm-conversation__empty {
  min-height: 680px;
}

.dm-page--profile .dm-conversation,
.dm-page--profile .dm-chat,
.dm-page--profile .dm-conversation__empty {
  height: 100%;
  min-height: 0;
}

.dm-conversation {
  background: var(--dm-panel-alt);
}

.dm-conversation__empty {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 8px;
  color: #8b95a1;
}

.dm-conversation__empty i {
  font-size: 36px;
}

.dm-chat {
  display: grid;
  grid-template-rows: 64px minmax(0, 1fr) auto;
}

.dm-chat__head {
  min-width: 0;
  padding: 8px 10px;
  background: #fff;
  border-bottom: 1px solid var(--dm-line);
}

.dm-mobile-back {
  display: none;
}

.dm-chat__user {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 9px;
  color: inherit;
  text-decoration: none;
}

.dm-user-summary {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.dm-user-summary__line {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
}

.dm-user-summary strong,
.dm-user-summary small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dm-user-summary strong {
  font-size: 14px;
}

.dm-user-summary small {
  color: var(--dm-muted);
  font-size: 12px;
}

.dm-user-stats {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 3px;
  transform: translateY(1px);
}

.dm-user-stats .avatar-stat {
  height: 15px;
  min-width: 21px;
  padding: 0 4px;
  color: #6f7884;
  font-size: 10px;
  font-weight: 700;
  background: #fff;
  border: 1px solid #dfe5ec;
  box-shadow: 0 2px 6px rgba(17, 24, 39, .045);
}

.dm-user-stats .avatar-stat i {
  color: #8a93a0;
  font-size: 9px;
}

.dm-chat__actions {
  display: flex;
  gap: 2px;
}

.dm-messages {
  min-height: 0;
  padding: 14px 14px 12px;
  overflow-y: auto;
  background:
    linear-gradient(180deg, rgba(255,255,255,.68), rgba(244,246,248,.88)),
    #f1f4f7;
}

.dm-day {
  width: max-content;
  max-width: 100%;
  margin: 10px auto;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.92);
  color: #7e8793;
  font-size: 12px;
  border: 1px solid rgba(226,231,238,.82);
}

.dm-message {
  display: flex;
  gap: 8px;
  margin: 9px 0;
  align-items: flex-end;
}

.dm-message.is-own {
  justify-content: flex-end;
}

.dm-message__content {
  min-width: 0;
  max-width: min(520px, 78%);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}

.dm-message.is-own .dm-message__content {
  align-items: flex-end;
}

.dm-bubble {
  max-width: 100%;
  min-width: 82px;
  padding: 9px 11px 19px;
  position: relative;
  border-radius: var(--dm-radius);
  background: #fff;
  border: 1px solid var(--dm-line);
}

.dm-message__tools {
  position: absolute;
  top: 5px;
  right: 6px;
  z-index: 3;
}

.dm-message__tools-button {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.72);
  color: #7b8794;
  opacity: .72;
  cursor: pointer;
}

.dm-bubble:hover .dm-message__tools-button,
.dm-message__tools.is-open .dm-message__tools-button,
.dm-message__tools:focus-within .dm-message__tools-button {
  opacity: 1;
}

.dm-message__menu {
  position: absolute;
  right: 0;
  top: 28px;
  min-width: 148px;
  padding: 5px;
  border: 1px solid var(--dm-line);
  border-radius: var(--dm-radius);
  display: none;
  background: #fff;
  box-shadow: 0 14px 34px rgba(17, 24, 39, .18);
}

.dm-message__tools.is-open .dm-message__menu,
.dm-message__tools:focus-within .dm-message__menu {
  display: grid;
  gap: 2px;
}

.dm-message__menu button {
  min-height: 32px;
  padding: 7px 8px;
  border: 0;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: #374151;
  cursor: pointer;
  text-align: left;
}

.dm-message__menu button:hover {
  background: #eef2f6;
}

.dm-message.is-own .dm-bubble {
  background: var(--dm-own);
  border-color: var(--dm-own-line);
}

.dm-message__text {
  display: block;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.38;
}

.dm-message__text::after {
  content: "";
  display: block;
  clear: both;
}

.dm-message__text a {
  color: #1d63ad;
}

.dm-message__meta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  position: absolute;
  right: 10px;
  bottom: 6px;
  margin: 0;
  color: #6f7c8e;
  font-size: 11px;
  line-height: 1;
  white-space: nowrap;
  transform: none;
}

.dm-message__text > .dm-message__meta {
  float: none;
}

.dm-status {
  color: #1f6fc4;
}

.dm-message__edited {
  display: block;
  margin-top: 4px;
  padding-right: 48px;
  color: #8b95a1;
  font-size: 11px;
  line-height: 1;
}

.dm-composer {
  position: relative;
  min-height: 58px;
  padding: 9px 10px;
  border-top: 1px solid var(--dm-line);
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 34px 42px;
  grid-template-areas: "attach text emoji send";
  gap: 8px;
  align-items: center;
  background: #fff;
}

.dm-composer.has-files {
  grid-template-areas:
    "files files files files"
    "attach text emoji send";
}

.dm-composer.is-editing {
  grid-template-areas:
    "editing editing editing editing"
    "attach text emoji send";
}

.dm-composer.is-editing.has-files {
  grid-template-areas:
    "editing editing editing editing"
    "files files files files"
    "attach text emoji send";
}

.dm-composer > [data-dm-attach-toggle] {
  grid-area: attach;
}

.dm-composer > [data-dm-text] {
  grid-area: text;
  min-width: 0;
}

.dm-composer > [data-dm-emoji] {
  grid-area: emoji;
}

.dm-composer > .dm-send-button {
  grid-area: send;
}

.dm-editing-banner {
  grid-area: editing;
  min-width: 0;
  min-height: 32px;
  padding: 6px 8px;
  border-radius: var(--dm-radius);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #eef5ff;
  color: #315f97;
  font-size: 13px;
}

.dm-editing-banner[hidden] {
  display: none !important;
}

.dm-editing-banner > span {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  overflow: hidden;
}

.dm-editing-banner > span span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dm-editing-banner .dm-icon-button {
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
}

.dm-composer textarea,
.dm-mini__composer textarea {
  width: 100%;
  resize: none;
  overflow-y: hidden;
  border: 1px solid var(--dm-line);
  border-radius: var(--dm-radius);
  outline: 0;
  line-height: 1.35;
  color: var(--dm-ink);
  background: #fff;
}

.dm-composer textarea {
  min-height: 38px;
  max-height: 118px;
  padding: 9px 11px;
}

.dm-composer textarea:focus,
.dm-mini__composer textarea:focus {
  border-color: #9da8b5;
}

.dm-send-button {
  width: 42px;
  height: 42px;
  border-radius: var(--dm-radius);
  background: var(--dm-accent);
  color: #fff;
}

.dm-send-button:hover {
  background: #2b3440;
}

.dm-send-button:disabled {
  opacity: .5;
  cursor: wait;
}

.dm-attach-menu {
  position: absolute;
  left: 10px;
  bottom: 54px;
  z-index: 6;
  width: 188px;
  padding: 7px;
  display: grid;
  gap: 3px;
  background: #fff;
  border: 1px solid var(--dm-line);
  border-radius: var(--dm-radius);
  box-shadow: 0 16px 40px rgba(17, 24, 39, .16);
}

.dm-attach-menu label {
  min-height: 35px;
  padding: 8px 9px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.dm-attach-menu label:hover {
  background: var(--dm-soft);
}

.dm-emoji-panel {
  position: absolute;
  right: 58px;
  bottom: 54px;
  z-index: 7;
  width: min(376px, calc(100vw - 32px));
  max-height: 258px;
  padding: 11px 12px 12px;
  border: 1px solid var(--dm-line);
  border-radius: var(--dm-radius);
  display: grid;
  gap: 9px;
  background: #fff;
  box-shadow: 0 18px 46px rgba(17, 24, 39, .18);
  overflow-y: auto;
}

.dm-emoji-panel::-webkit-scrollbar {
  width: 6px;
}

.dm-emoji-panel::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #c5ccd5;
}

.dm-emoji-panel__title {
  color: #6f7884;
  font-size: 13px;
  line-height: 1.2;
}

.dm-emoji-panel__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(24px, 1fr));
  gap: 3px;
}

.dm-emoji-panel__grid button {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.dm-emoji-panel__grid button:hover {
  background: #eef2f6;
}

.dm-selected-files {
  grid-area: files;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.dm-selected-files[hidden] {
  display: none !important;
}

.dm-file-chip {
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef2f6;
  color: #596372;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dm-attachments {
  display: grid;
  gap: 7px;
  margin-top: 7px;
}

.dm-attachment-image {
  display: block;
  max-width: 280px;
  padding: 0;
  border-radius: var(--dm-radius);
  overflow: hidden;
  border: 1px solid rgba(0,0,0,.06);
  background: transparent;
  cursor: zoom-in;
  text-align: left;
}

.dm-attachment-image img {
  display: block;
  width: 100%;
  height: auto;
}

.dm-lightbox-open {
  overflow: hidden;
}

.dm-lightbox {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(13, 18, 26, .82);
}

.dm-lightbox__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: transparent;
  cursor: zoom-out;
}

.dm-lightbox__stage {
  position: relative;
  z-index: 1;
  max-width: min(92vw, 1120px);
  max-height: 90vh;
  margin: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  border-radius: 8px;
  overflow: hidden;
  background: #111827;
  box-shadow: 0 28px 80px rgba(0,0,0,.38);
}

.dm-lightbox__stage img {
  max-width: 100%;
  max-height: calc(90vh - 48px);
  display: block;
  object-fit: contain;
  background: #0b0f16;
}

.dm-lightbox__stage figcaption {
  min-height: 48px;
  padding: 9px 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 32px;
  align-items: center;
  gap: 10px;
  color: #e5e7eb;
  background: rgba(17, 24, 39, .96);
  font-size: 13px;
}

.dm-lightbox__stage figcaption span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dm-lightbox__stage figcaption a {
  color: #b9d8ff;
  text-decoration: none;
}

.dm-lightbox__stage figcaption button {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #e5e7eb;
  background: rgba(255,255,255,.08);
  cursor: pointer;
}

.dm-attachment-file {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 8px;
  border-radius: var(--dm-radius);
  background: rgba(255,255,255,.64);
  color: inherit;
  text-decoration: none;
}

.dm-attachment-file--missing {
  border: 1px dashed #cbd5e1;
  background: rgba(248, 250, 252, .86);
  color: #667085;
  cursor: default;
}

.dm-attachment-file--missing i {
  color: #94a3b8;
}

.dm-attachment-file--missing > span {
  min-width: 0;
  white-space: normal;
}

.dm-attachment-file strong,
.dm-attachment-file span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dm-attachment-file--missing span span {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  line-height: 1.25;
  white-space: normal;
  overflow-wrap: anywhere;
}

.dm-shared-missing {
  display: block;
  color: #8a94a3;
  font-size: 12px;
}

.dm-card {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 9px;
  margin-top: 7px;
  padding: 8px;
  border-radius: var(--dm-radius);
  background: rgba(255,255,255,.72);
  color: inherit;
  text-decoration: none;
}

.dm-card img {
  width: 78px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 6px;
  background: #e6ebf0;
}

.dm-card strong,
.dm-card span,
.dm-card small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dm-card strong {
  white-space: nowrap;
}

.dm-card span {
  margin-top: 2px;
  color: var(--dm-muted);
  font-size: 12px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.dm-card small {
  margin-top: 5px;
  color: #1d63ad;
}

.dm-info {
  padding: 12px;
  display: grid;
  align-content: start;
  gap: 12px;
}

.dm-page--profile .dm-info {
  display: none;
}

.dm-info__profile {
  display: grid;
  justify-items: center;
  gap: 7px;
  padding: 10px 4px;
  text-align: center;
}

.dm-info__profile .dm-user-avatar {
  margin-bottom: 2px;
  --avatar-online-bottom: 9px;
  --avatar-role-top: 1px;
  --avatar-role-right: 1px;
  --avatar-flag-clip-radius: 34px;
  --avatar-flag-clip-y: -24px;
}

.dm-info__profile .dm-user-avatar > img {
  width: 76px;
  height: 76px;
}

.dm-info__profile .dm-user-stats {
  justify-content: center;
  flex-wrap: wrap;
}

.dm-info__profile > span {
  max-width: 100%;
  color: var(--dm-muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.dm-info__profile a,
.dm-primary-button {
  min-height: 35px;
  padding: 8px 12px;
  border: 0;
  border-radius: var(--dm-radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--dm-accent);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
}

.dm-info__section {
  display: grid;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--dm-line);
}

.dm-info__section h2 {
  margin: 0;
  font-size: 14px;
  letter-spacing: 0;
}

.dm-shared-list {
  display: grid;
  gap: 6px;
  color: var(--dm-muted);
  font-size: 13px;
}

.dm-shared-list a {
  color: #1d63ad;
  overflow-wrap: anywhere;
}

.dm-info__actions button {
  min-height: 35px;
  border: 0;
  border-radius: var(--dm-radius);
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--dm-soft);
  color: #374151;
  cursor: pointer;
}

.dm-info__actions button:hover {
  background: #e8edf3;
}

.dm-preferences {
  width: min(420px, calc(100vw - 24px));
  border: 0;
  border-radius: var(--dm-radius);
  margin: 0;
  padding: 0;
  box-shadow: 0 24px 60px rgba(17, 24, 39, .24);
}

.dm-preferences[open] {
  position: fixed;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  max-height: calc(100vh - 24px);
  overflow: auto;
  z-index: 10030;
}

.dm-preferences::backdrop {
  background: rgba(17, 24, 39, .36);
}

.dm-preferences__box {
  padding: 16px;
  display: grid;
  gap: 13px;
}

.dm-preferences__box header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.dm-preferences__box label {
  display: grid;
  gap: 6px;
  color: #596372;
}

.dm-preferences__box select {
  min-height: 38px;
  border: 1px solid var(--dm-line);
  border-radius: var(--dm-radius);
  padding: 0 10px;
  background: #fff;
  color: var(--dm-ink);
}

.dm-toggle {
  grid-template-columns: 18px 1fr;
  align-items: center;
}

.dm-toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 10020;
  transform: translateX(-50%);
  max-width: min(420px, calc(100vw - 24px));
  padding: 10px 14px;
  border-radius: var(--dm-radius);
  background: var(--dm-accent);
  color: #fff;
  box-shadow: 0 16px 38px rgba(17, 24, 39, .22);
}

.dm-context-button {
  width: max-content;
  min-height: 32px;
  margin-top: 7px;
  padding: 7px 10px;
  border-radius: var(--dm-radius);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--dm-accent);
  color: #fff !important;
  text-decoration: none !important;
  line-height: 1.1;
}

.dm-context-button:hover {
  background: #2b3440;
  color: #fff !important;
}

.comment-message-button,
.home-feed-comment-message {
  min-height: 30px;
  padding: 6px 8px;
  border-radius: var(--dm-radius);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--dm-soft);
  color: #374151 !important;
  text-decoration: none !important;
  line-height: 1;
}

.comment-message-button:hover,
.home-feed-comment-message:hover {
  background: #e8edf3;
  color: var(--dm-ink) !important;
}

.home-feed-comment-message {
  width: 30px;
  justify-content: center;
}

.dm-dock {
  position: fixed;
  right: 18px;
  bottom: var(--dm-dock-bottom, 0px);
  z-index: 10000;
  display: flex;
  align-items: flex-end;
  gap: 9px;
  pointer-events: none;
  transition: bottom .16s ease;
}

.is-home-page .dm-dock {
  right: 76px;
}

.dm-dock > * {
  pointer-events: auto;
}

.dm-chat-list-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin-bottom: 8px;
  padding: 0;
  border: 1px solid var(--dm-line);
  border-radius: 7px;
  background: #fff;
  color: #7b8794;
  line-height: 1;
  opacity: .58;
  box-shadow: 0 10px 28px rgba(17, 24, 39, .14);
  transition: opacity .16s ease, background-color .16s ease, border-color .16s ease, color .16s ease;
}

.dm-chat-list-button:hover,
.dm-chat-list-button.is-active {
  opacity: 1;
  color: #4f5965;
  background: #f8fafc;
  border-color: var(--dm-line-strong);
}

.dm-chat-list-button > i {
  position: absolute !important;
  top: 50%;
  left: 50%;
  font-size: 19px;
  margin: 0;
  line-height: 1;
  transform: translate(-50%, -50%) !important;
}

.dm-dock-count {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  display: none;
  align-items: center;
  justify-content: center;
  background: var(--dm-danger);
  color: #fff;
  border: 2px solid #fff;
  font-size: 11px;
  line-height: 18px;
}

.dm-suggestions[hidden] {
  display: none !important;
}

.dm-suggestions {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #edf0f4;
}

.dm-suggestions__title {
  margin: 0 0 7px;
  color: #8a94a1;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0;
}

.dm-suggestions__list {
  display: grid;
  gap: 4px;
}

.dm-suggestion {
  width: 100%;
  min-height: 48px;
  padding: 6px;
  border: 1px solid transparent;
  border-radius: 8px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}

.dm-suggestion:hover {
  border-color: #e0e6ee;
  background: #f4f7fa;
}

.dm-suggestion .dm-user-avatar > img {
  width: 36px;
  height: 36px;
}

.dm-suggestion__body {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.dm-suggestion__body strong,
.dm-suggestion__body span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dm-suggestion__body strong {
  color: #303640;
  font-size: 13px;
  font-weight: 700;
}

.dm-suggestion__body span {
  color: #8a94a1;
  font-size: 12px;
}

.dm-mini-list {
  position: absolute;
  right: 0;
  bottom: 70px;
  width: 326px;
  max-height: none;
  padding: 9px;
  border: 1px solid var(--dm-line);
  border-radius: var(--dm-radius);
  display: grid;
  gap: 6px;
  background: #fff;
  box-shadow: 0 20px 52px rgba(17, 24, 39, .2);
}

.dm-mini-list__head {
  justify-content: space-between;
  min-height: 30px;
  padding: 0 2px 3px;
}

.dm-mini-list__head strong {
  font-size: 14px;
}

.dm-mini-list__head a {
  color: #1d63ad;
  font-size: 12px;
  text-decoration: none;
}

.dm-mini-list__body {
  max-height: none;
  overflow: visible;
  display: grid;
  gap: 4px;
}

.dm-mini-list__empty {
  min-height: 118px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: #8b95a1;
  font-size: 13px;
}

.dm-mini-list .dm-thread {
  min-height: 58px;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 9px;
  padding: 7px;
  border: 1px solid transparent;
  background: #fff;
}

.dm-mini-list .dm-thread .dm-user-avatar > img {
  width: 38px;
  height: 38px;
}

.dm-mini-list .dm-thread:hover,
.dm-mini-list .dm-thread.is-active {
  border-color: #e0e6ee;
  background: #edf2f7;
}

.dm-mini-list .dm-thread__name {
  font-size: 13px;
}

.dm-mini-list .dm-thread__text {
  font-size: 12px;
}

.dm-mini-list .dm-thread__meta {
  font-size: 11px;
}

.dm-mini-list .dm-thread__unread {
  min-width: 18px;
  height: 18px;
  font-size: 10px;
}

.dm-mini {
  width: 340px;
  height: 424px;
  margin-bottom: 8px;
  border: 1px solid #d8dfe8;
  border-radius: 7px;
  display: grid;
  grid-template-rows: 47px minmax(0, 1fr) auto;
  background: #fff;
  box-shadow: 0 18px 46px rgba(17, 24, 39, .18);
  overflow: hidden;
}

.dm-mini__head {
  min-width: 0;
  padding: 7px 8px;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 30px 30px 30px;
  gap: 6px;
  border-bottom: 1px solid #dde3eb;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfd 100%);
}

.dm-mini__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
  font-size: 13px;
}

.dm-mini__open {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #8b95a1;
  text-decoration: none;
}

.dm-mini__open:hover {
  color: #4f5965;
  background: #eef2f6;
}

.dm-mini .dm-icon-button {
  width: 30px;
  height: 30px;
  border-radius: 7px;
}

.dm-mini__body {
  min-height: 0;
  padding: 14px 12px 12px;
  overflow-y: auto;
  background: #edf1f5;
}

.dm-mini__body::-webkit-scrollbar,
.dm-mini-list__body::-webkit-scrollbar,
.dm-thread-list::-webkit-scrollbar,
.dm-messages::-webkit-scrollbar {
  width: 6px;
}

.dm-mini__body::-webkit-scrollbar-thumb,
.dm-mini-list__body::-webkit-scrollbar-thumb,
.dm-thread-list::-webkit-scrollbar-thumb,
.dm-messages::-webkit-scrollbar-thumb {
  background: #cbd3dc;
  border-radius: 999px;
}

.dm-mini .dm-message {
  margin: 7px 0;
}

.dm-mini .dm-message__content {
  max-width: min(292px, 94%);
}

.dm-mini .dm-bubble {
  max-width: 100%;
  min-width: 78px;
  padding: 8px 10px 19px;
  border-radius: 12px;
  box-shadow: none;
}

.dm-mini .dm-message.is-own .dm-bubble {
  background: #d8eaff;
  border-color: #bfd7f1;
  border-bottom-right-radius: 5px;
}

.dm-mini .dm-message:not(.is-own) .dm-bubble {
  border-bottom-left-radius: 5px;
}

.dm-mini .dm-message__text {
  font-size: 14px;
}

.dm-mini .dm-message__meta {
  gap: 4px;
  right: 9px;
  bottom: 6px;
  margin: 0;
  font-size: 10px;
  color: #758294;
  transform: none;
}

.dm-mini .dm-message__text > .dm-message__meta {
  float: none;
  margin: 0;
  transform: none;
}

.dm-mini .dm-attachments {
  gap: 6px;
}

.dm-mini .dm-attachment-image {
  max-width: min(252px, 100%);
}

.dm-mini .dm-attachment-file {
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 7px;
  max-width: 100%;
  min-width: 0;
  padding: 8px 9px;
}

.dm-mini .dm-attachment-file > i {
  font-size: 15px;
}

.dm-mini .dm-attachment-file span {
  min-width: 0;
}

.dm-mini .dm-attachment-file strong {
  display: block;
  font-size: 13px;
  line-height: 1.25;
  max-height: 2.5em;
  white-space: normal;
  overflow-wrap: anywhere;
}

.dm-mini .dm-attachment-file span span {
  display: block;
  margin-top: 2px;
  font-size: 11px;
}

.dm-mini__composer {
  padding: 8px;
  border-top: 1px solid #dde3eb;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  gap: 7px;
  align-items: center;
  background: #fff;
}

.dm-mini__composer textarea {
  min-height: 36px;
  max-height: 104px;
  padding: 8px 11px;
  border-radius: 7px;
  border-color: #dce3eb;
  font-size: 13px;
}

.dm-mini__composer .dm-send-button {
  width: 36px;
  height: 36px;
  border-radius: 7px;
  background: #7f8a98;
  color: #fff;
}

.dm-mini__composer .dm-send-button:hover {
  background: #687482;
}

.dm-mini__composer .dm-send-button i {
  transform: translateX(1px);
}

.profile-messenger-section {
  padding: 0;
}

@media (max-width: 1100px) {
  .dm-page {
    grid-template-columns: 286px minmax(0, 1fr);
  }

  .dm-info {
    display: none;
  }
}

@media (max-width: 760px) {
  .dm-page,
  .dm-page--profile {
    width: 100%;
    height: auto;
    min-height: calc(100vh - 80px);
    margin: 0;
    grid-template-columns: 1fr;
    gap: 0;
  }

  .dm-sidebar,
  .dm-conversation {
    border-left: 0;
    border-right: 0;
    border-radius: 0;
    min-height: calc(100vh - 80px);
  }

  .dm-conversation {
    display: none;
  }

  .dm-page.has-open-chat .dm-sidebar {
    display: none;
  }

  .dm-page.has-open-chat .dm-conversation {
    display: block;
  }

  .dm-chat,
  .dm-conversation__empty {
    height: auto;
    min-height: calc(100vh - 80px);
  }

  .dm-page--profile .dm-conversation,
  .dm-page--profile .dm-chat,
  .dm-page--profile .dm-conversation__empty {
    height: auto;
    min-height: calc(100vh - 80px);
  }

  .dm-mobile-back {
    display: inline-flex;
  }

  .dm-thread-list,
  .dm-page--profile .dm-thread-list {
    max-height: none;
  }

  .dm-chat__actions .dm-icon-button:nth-child(n+2) {
    display: none;
  }

  .dm-messages {
    padding: 12px 10px;
  }

  .dm-bubble {
    max-width: 84%;
  }

  .dm-emoji-panel {
    left: 8px;
    right: 8px;
    width: auto;
    max-height: 236px;
  }

  .dm-lightbox {
    padding: 10px;
  }

  .dm-lightbox__stage {
    width: 100%;
    max-height: 94vh;
  }

  .dm-lightbox__stage img {
    max-height: calc(94vh - 86px);
  }

  .dm-lightbox__stage figcaption {
    grid-template-columns: minmax(0, 1fr) 32px;
  }

  .dm-lightbox__stage figcaption a {
    grid-column: 1 / -1;
  }

  .dm-dock {
    display: none;
  }
}
