/* Discord channel list inside an X messages column. Colors follow the theme tokens. */
.center:has(.dmsgs) {
  padding-top: env(safe-area-inset-top);
  padding-bottom: 0;
  min-height: 0;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
}
.dmsgs {
  display: flex;
  flex: 1;
  min-height: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
}
.dmsgs-list {
  position: relative;
  width: var(--dmsgs-list, 440px);
  flex: 0 0 var(--dmsgs-list, 440px);
  min-width: 300px;
  max-width: 60%;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--line);
  background: var(--bg);
}
.dmsgs-split {
  position: absolute;
  top: 0;
  bottom: 0;
  right: -4px;
  z-index: 4;
  width: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: col-resize;
  touch-action: none;
}
.dmsgs-split:focus { outline: none; }
.dmsgs-split::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 3px;
  width: 2px;
  background: transparent;
}
.dmsgs-split:hover::before,
.dmsgs-split.is-dragging::before,
.dmsgs-split:focus-visible::before {
  background: var(--blue);
}
.dmsgs-head {
  display: flex;
  align-items: center;
  height: 53px;
  padding: 0 16px;
  flex: none;
}
.dmsgs-head h1 {
  margin: 0;
  font-size: 20px;
  line-height: 24px;
  font-weight: 800;
}
.dmsgs-search {
  margin: 0 12px 8px;
  flex: none;
}
.dmsgs-search svg { width: 16px; height: 16px; fill: var(--muted); }
.dmsgs-server {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 8px 8px;
  padding: 10px;
  border-radius: 16px;
  flex: none;
}
.dmsgs-server-ico,
.dmsgs-server-ico img {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  flex: none;
  object-fit: cover;
}
.dmsgs-server-ico {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #5865f2;
  color: #fff;
  font-weight: 800;
  overflow: hidden;
}
.dmsgs-server-copy { display: flex; flex-direction: column; min-width: 0; line-height: 20px; }
.dmsgs-server-copy b { font-size: 15px; }
.dmsgs-server-copy span { color: var(--muted); font-size: 13px; }
.dmsgs-srv-row {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0 4px;
  border-radius: 16px;
}
.dmsgs-srv-row:hover { background: var(--hover-soft); }
.dmsgs-srv-main {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  padding: 10px 4px 10px 6px;
  cursor: pointer;
}
.dmsgs-chev { width: 16px; flex: none; }
.dmsgs-chev svg { width: 16px; height: 16px; fill: var(--muted); display: block; transition: transform .15s ease; }
.dmsgs-srv.open .dmsgs-chev svg { transform: rotate(90deg); }
.dmsgs-srv-ico,
.dmsgs-srv-ico img {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  flex: none;
  object-fit: cover;
}
.dmsgs-srv-ico {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #5865f2;
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  overflow: hidden;
}
.dmsgs-srv-copy { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 20px; }
.dmsgs-srv-top { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.dmsgs-srv-top b {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 15px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dmsgs-srv-top time { margin-left: auto; color: var(--muted); font-size: 13px; font-weight: 400; flex: none; }
.dmsgs-srv-preview { color: var(--muted); font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dmsgs-badge {
  min-width: 20px;
  height: 20px;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-size: 12px;
  line-height: 20px;
  font-weight: 700;
  text-align: center;
  flex: none;
}
.dmsgs-srv.muted .dmsgs-srv-copy,
.dmsgs-srv.muted .dmsgs-srv-ico,
.dmsgs-ch-row.muted { opacity: 0.45; }
.dmsgs-srv.muted .dmsgs-badge,
.dmsgs-ch-row.muted .dmsgs-dot { display: none; }
.dmsgs-iconbtn {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  padding: 0;
  cursor: pointer;
  flex: none;
}
.dmsgs-iconbtn svg { width: 16px; height: 16px; fill: currentColor; display: block; margin: 0 auto; }
.dmsgs-iconbtn.on { color: var(--blue); }
.dmsgs-iconbtn:hover { background: var(--hover); color: var(--text); }
.dmsgs-sub { padding-bottom: 4px; }
.dmsgs-srv:not(.open) .dmsgs-sub { display: none; }
.dmsgs-channels.is-filtering .dmsgs-sub { display: block; }
.dmsgs-ch-row {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 28px;
  padding-right: 8px;
}
.dmsgs-ch-row .dmsgs-ch { flex: 1; min-width: 0; }
.dmsgs-sub .dmsgs-cat { margin-left: 40px; }
.dmsgs-channels {
  flex: 1;
  overflow: auto;
  overflow-anchor: none;
  padding: 0 8px 16px;
  min-height: 0;
}
.dmsgs-cat {
  margin: 14px 12px 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 16px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dmsgs-ch {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 15px;
  line-height: 20px;
  font-weight: 500;
}
.dmsgs-ch:hover { background: var(--hover-soft); }
.dmsgs-ch.on { background: var(--hover); color: var(--text); font-weight: 700; }
.dmsgs-ch.unread { color: var(--text); font-weight: 700; }
.dmsgs-hash { width: 22px; flex: none; text-align: center; font-weight: 500; }
.dmsgs-hash.lg { width: auto; font-size: 22px; color: var(--muted); }
.dmsgs-ch-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dmsgs-dot {
  width: 8px;
  height: 8px;
  margin-left: auto;
  border-radius: 50%;
  background: var(--blue);
  flex: none;
}
.dmsgs-pinmark,
.dmsgs-bell {
  width: 16px;
  height: 16px;
  margin-left: auto;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.dmsgs-pinmark + .dmsgs-bell,
.dmsgs-pinmark + .dmsgs-dot,
.dmsgs-bell + .dmsgs-dot { margin-left: 6px; }
.dmsgs-pinmark svg,
.dmsgs-bell svg { width: 14px; height: 14px; fill: currentColor; display: block; }
.dmsgs-more {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  padding: 0;
  cursor: pointer;
  flex: none;
}
.dmsgs-more svg { width: 18px; height: 18px; fill: currentColor; display: block; margin: 0 auto; }
.dmsgs-more:hover,
.dmsgs-ch-row:hover .dmsgs-more { background: var(--hover); color: var(--text); }
.dmsgs-scrim {
  position: fixed;
  inset: 0;
  z-index: 35;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: default;
}
.dmsgs-menu {
  position: fixed;
  z-index: 40;
  min-width: 260px;
  max-width: min(320px, calc(100vw - 16px));
  padding: 8px 0;
  background: var(--sheet);
  border-radius: 16px;
  box-shadow: 0 0 15px var(--shadow), 0 0 3px 1px var(--shadow-tight);
  overflow: hidden;
}
.dmsgs-menu button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 0 16px;
  border: 0;
  background: none;
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}
.dmsgs-menu button:hover { background: var(--hover); }
.dmsgs-menu-title {
  padding: 8px 16px 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.dmsgs-mi { width: 20px; height: 20px; flex: none; display: inline-flex; }
.dmsgs-mi svg { width: 18px; height: 18px; fill: currentColor; display: block; }
.dmsgs-grab { display: none; }
.dmsgs-conv-head .dmsgs-pins { margin-left: auto; }
.dmsgs-pinpanel {
  position: absolute;
  top: 61px;
  right: 12px;
  z-index: 6;
  width: min(380px, calc(100% - 24px));
  max-height: min(70%, 520px);
  display: flex;
  flex-direction: column;
  background: var(--sheet);
  border-radius: 16px;
  box-shadow: 0 0 15px var(--shadow), 0 0 3px 1px var(--shadow-tight);
  overflow: hidden;
}
.dmsgs-pinhead {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 8px 0 16px;
  border-bottom: 1px solid var(--line);
}
.dmsgs-pinhead b { font-size: 17px; font-weight: 800; }
.dmsgs-pinhead .dmsgs-iconbtn { margin-left: auto; font-size: 22px; line-height: 1; }
.dmsgs-pinlist { overflow: auto; padding: 4px 0; }
.dmsgs-pinempty { margin: 0; padding: 28px 16px; text-align: center; color: var(--muted); font-size: 15px; }
.dmsgs-pinrow {
  display: block;
  width: 100%;
  padding: 12px 16px;
  border: 0;
  background: none;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.dmsgs-pinrow:hover { background: var(--hover); }
.dmsgs-pinrow-top { display: flex; align-items: baseline; gap: 8px; }
.dmsgs-pinrow-top b { font-size: 15px; }
.dmsgs-pinrow-top time { margin-left: auto; color: var(--muted); font-size: 13px; font-weight: 400; }
.dmsgs-pinrow-text {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 15px;
  line-height: 20px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dmsg-flash { animation: dmsg-flash 1.4s ease; }
@keyframes dmsg-flash {
  0% { background: var(--blue-dim); }
  100% { background: transparent; }
}
a[href="#/messages"] .dmsgs-tab-badge {
  position: absolute;
  top: -6px;
  right: -8px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}
.dmsgs-conv {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  background: var(--bg);
}
.dmsgs-conv-head {
  height: 53px;
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
}
.dmsgs-conv-head b { display: block; font-size: 17px; line-height: 20px; }
.dmsgs-conv-head span { color: var(--muted); font-size: 13px; line-height: 16px; }
.dmsgs-conv-title { min-width: 0; flex: 1; }
.dmsgs-conv-title b,
.dmsgs-conv-title span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dmsgs-back {
  display: none;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  line-height: 1;
  color: var(--text);
}
.dmsgs-log {
  flex: 1;
  overflow: auto;
  overflow-anchor: none;
  min-height: 0;
  padding: 12px 0 8px;
}
.dmsgs-placeholder {
  margin: auto;
  max-width: 360px;
  padding: 32px 24px;
  text-align: center;
}
.dmsgs-conv-empty { align-items: center; justify-content: center; }
.dmsgs-placeholder h2 { margin: 0 0 8px; font-size: 31px; line-height: 36px; font-weight: 800; }
.dmsgs-placeholder p { margin: 0; color: var(--muted); font-size: 15px; line-height: 20px; }
.dmsg-day {
  display: flex;
  justify-content: center;
  margin: 12px 16px 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.dmsg {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 1px 16px;
}
.dmsg.group { margin-top: 14px; align-items: flex-start; }
.dmsg-gutter { width: 40px; flex: none; }
.dmsg.no-face .dmsg-gutter,
.dmsg-gutter:has(> .ava-none) { width: 0; }
.dmsg-bubble {
  display: inline-block;
  max-width: min(520px, 100%);
  background: var(--search);
  border-radius: 22px;
  padding: 8px 12px 10px;
}
.dmsg.group .dmsg-bubble { border-top-left-radius: 6px; }
.dmsg.cont .dmsg-bubble { border-top-left-radius: 6px; border-bottom-left-radius: 6px; }
.dmsgs-head-face,
.dmsgs-head-face img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
}
.dmsgs-head-face {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ava);
  font-weight: 700;
  overflow: hidden;
}
.dmsgs-head-face.silhouette { color: var(--muted); }
.dmsgs-head-face.silhouette svg { width: 68%; height: 68%; display: block; }
.dmsg-ava,
.dmsg-ava img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}
.dmsg-ava {
  margin-top: 2px;
  background: var(--ava);
}
.dmsg-ava.initials {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--initials-fg);
  background: var(--initials-bg);
}
.dmsg.cont .dmsg-hovertime {
  display: block;
  margin-top: 2px;
  text-align: right;
  color: var(--muted);
  font-size: 11px;
  line-height: 16px;
  opacity: 0;
}
.dmsg.cont:hover .dmsg-hovertime { opacity: 1; }
.dmsg-body { min-width: 0; }
.dmsg-head { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.dmsg-name { font-weight: 700; font-size: 15px; line-height: 20px; }
.dmsg-head time,
.dmsg-edited { color: var(--muted); font-size: 12px; font-weight: 400; }
.dmsg-text {
  font-size: 15px;
  line-height: 20px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.dmsg-text a { color: var(--blue); }
.dmsg-text a:hover { text-decoration: underline; }
.dmsg-mention {
  color: var(--blue);
  background: var(--blue-dim);
  border-radius: 4px;
  padding: 0 2px;
}
.dmsg-emoji {
  width: 22px;
  height: 22px;
  vertical-align: text-bottom;
  object-fit: contain;
}
.dmsg code,
.dmsg-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--search);
  border-radius: 4px;
}
.dmsg code { padding: 0 4px; font-size: 13px; }
.dmsg-code {
  display: block;
  margin: 6px 0;
  padding: 8px 10px;
  white-space: pre-wrap;
  font-size: 13px;
  line-height: 18px;
}
.dmsg-spoiler {
  background: var(--text);
  color: transparent;
  border-radius: 4px;
  cursor: pointer;
  user-select: none;
}
.dmsg-spoiler.open {
  background: var(--search);
  color: var(--text);
  user-select: text;
}
.dmsg-reply {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 13px;
  line-height: 16px;
  min-width: 0;
}
.dmsg-reply::before {
  content: "";
  width: 24px;
  height: 10px;
  margin-left: 8px;
  border-left: 2px solid var(--line);
  border-top: 2px solid var(--line);
  border-radius: 8px 0 0 0;
  flex: none;
}
.dmsg-reply-name { color: var(--text); font-weight: 700; flex: none; }
.dmsg-reply-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dmsg-shot { display: block; margin-top: 6px; max-width: min(400px, 100%); }
.dmsg-shot img,
.dmsg-video,
.dmsg-embed img {
  display: block;
  max-width: min(400px, 100%);
  max-height: 360px;
  border-radius: 12px;
  background: var(--card);
}
.dmsg-embed {
  margin-top: 8px;
  max-width: 420px;
  border-left: 4px solid var(--blue);
  border-radius: 4px;
  background: var(--card);
  padding: 8px 12px 12px;
}
.dmsg-embed-site { color: var(--muted); font-size: 12px; line-height: 16px; }
.dmsg-embed-title { font-weight: 700; margin-top: 2px; }
.dmsg-embed-title a { color: var(--blue); }
.dmsg-embed-desc { margin-top: 4px; font-size: 14px; line-height: 18px; }
.dmsg-embed img { margin-top: 8px; }
.dmsg-rxs { display: flex; flex-wrap: wrap; margin-top: 4px; }
.dmsg-rx {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 4px 6px 0 0;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--search);
  color: var(--text);
  font-size: 13px;
  line-height: 18px;
}
.dmsg-rx img { width: 16px; height: 16px; object-fit: contain; }
.dmsgs-jump {
  position: absolute;
  left: 50%;
  bottom: 84px;
  transform: translateX(-50%);
  border: 0;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font: inherit;
  font-weight: 700;
  padding: 8px 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
  z-index: 2;
}
.dmsgs-compose { padding: 8px 16px 16px; flex: none; }
.dmsgs-compose-box {
  min-height: 48px;
  border: 0;
  border-radius: 999px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  color: var(--muted);
  background: var(--search);
}
body:has(.dmsgs) .fab { display: none; }

@media (max-width: 699px) {
  .dmsgs-list { width: 100%; flex-basis: auto; min-width: 0; max-width: none; border-right: 0; }
  .dmsgs-split { display: none; }
  .dmsgs.has-channel .dmsgs-list { display: none; }
  .dmsgs:not(.has-channel) .dmsgs-conv { display: none; }
  .dmsgs-back { display: flex; }
  .dmsgs-placeholder h2 { font-size: 23px; line-height: 28px; }
  .dmsgs-more { display: none; }
  .dmsgs-scrim { background: rgba(91, 112, 131, 0.4); }
  .dmsgs-grab {
    display: block;
    width: 36px;
    height: 4px;
    margin: 8px auto 4px;
    border-radius: 999px;
    background: var(--line);
  }
  .dmsgs-menu {
    top: auto !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100%;
    min-width: 0;
    max-width: none;
    border-radius: 16px 16px 0 0;
    padding: 0 0 calc(8px + env(safe-area-inset-bottom));
    box-shadow: none;
  }
  .dmsgs-pinpanel {
    position: fixed;
    top: auto;
    right: 0;
    left: 0;
    bottom: 0;
    width: 100%;
    max-height: 72vh;
    border-radius: 16px 16px 0 0;
    z-index: 30;
  }
}
@media (max-width: 499px) {
  .center:has(.dmsgs) {
    height: calc(100dvh - 53px - env(safe-area-inset-bottom));
    padding-top: env(safe-area-inset-top);
  }
}
.dmsgs-skel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
}
.dmsgs-skel span {
  display: block;
  height: 46px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--text) 8%, transparent);
  animation: dmsgs-skel 1.1s ease-in-out infinite;
}
.dmsgs-skel span:nth-child(2) { width: 86%; animation-delay: .1s; }
.dmsgs-skel span:nth-child(3) { width: 72%; animation-delay: .2s; }
.dmsgs-skel span:nth-child(4) { width: 58%; animation-delay: .3s; }
@keyframes dmsgs-skel {
  50% { opacity: .45; }
}
@media (prefers-reduced-motion: reduce) {
  .dmsgs-skel span { animation: none; }
}
