.dmusic-chat-messages {
  height: 330px;
  overflow: auto;
  padding: 10px;
}

.mdi-30px.mdi-set, .mdi-30px.mdi:before {
  font-size: 30px;
}

.dmusic-chat-line { margin: 6px 0; }
.dmusic-chat-line.sys { opacity: .7; }
.dmusic-chat-line.err { color: #b00020; }

.dmusic-chat-input {
  display: flex;
  gap: 8px;
}

.dmusic-chat-input input {
  flex: 1;
  padding: 8px;
}

span.dmusic-chat-status {
  font-size: 15px;
}

.dmusic-chat-staff {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.dmusic-chat-inbox,
.dmusic-chat-thread {
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 14px;
  background: #202126;
  box-shadow: 0 10px 22px rgba(0, 0, 0, .2);
  height: 100%;
}

.dmusic-chat-inbox h2,
.dmusic-chat-thread h2 {
  margin: 0;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  font-size: 18px;
}

.dmusic-chat-thread .dmusic-chat-status {
  display: inline-block;
  margin: 8px 14px 4px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
}

.dmusic-chat-inbox-list {
  border: 0;
  background: transparent;
  padding: 8px 10px 10px;
  /*height: 420px;*/
  overflow: auto;
  border-radius: 0 0 14px 14px;
}

.dmusic-inbox-item {
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 10px;
  background: rgba(255, 255, 255, .03);
  padding: 10px;
  cursor: pointer;
  margin-bottom: 8px;
}

.dmusic-inbox-item:hover,
.dmusic-inbox-item.is-active {
  border-color: var(--accent-color2);
  background: rgba(255, 255, 255, .07);
}

.dmusic-inbox-item .row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.dmusic-inbox-item .badge {
  color: #fff;
  background-color: var(--gin-color-primary);
  padding: 0 8px;
  border-radius: 50%;
}

.dmusic-inbox-item .preview {
  opacity: .75;
  font-size: 13px;
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dmusic-chat-widget {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 9999;
  font-family: system-ui, sans-serif;
}

.dmusic-chat-launcher {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  background: var(--accent-color2);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .18);
  font-size: 20px;
}

.dmusic-chat-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #e11d48;
  color: #fff;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.dmusic-chat-panel {
  position: relative;
  width: 340px;
  height: 450px;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 14px 40px rgba(0, 0, 0, .24);
  background-color: var(--sidebar);
  margin-bottom: 12px;
  display: none;
}

.dmusic-chat-name-modal {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(8, 10, 20, .68);
  z-index: 60;
  padding: 14px;
}

.dmusic-chat-name-modal.is-open {
  display: flex;
}

.dmusic-chat-name-card {
  width: 100%;
  max-width: 300px;
  border-radius: 12px;
  background: #1f1f22;
  border: 1px solid rgba(255, 255, 255, .16);
  padding: 12px;
  color: #fff;
}

.dmusic-chat-name-card h4 {
  margin: 0 0 6px;
  font-size: 18px;
}

.dmusic-chat-name-card p {
  margin: 0 0 8px;
  font-size: 13px;
  opacity: .85;
}

.dmusic-chat-name-card input {
  width: 100%;
  height: 36px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, .2);
  background: rgba(255, 255, 255, .06);
  color: #fff;
  padding: 0 10px;
}

.dmusic-chat-name-error {
  min-height: 16px;
  font-size: 12px;
  color: #ff6b81;
  margin-top: 6px;
}

.dmusic-chat-name-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 6px;
}

.dmusic-chat-name-btn {
  height: 32px;
  border-radius: 8px;
  border: none;
  background: var(--accent-color2);
  color: #fff;
  padding: 0 12px;
  cursor: pointer;
}

.dmusic-chat-name-btn.ghost {
  background: rgba(255, 255, 255, .14);
}

.dmusic-chat-widget.is-open .dmusic-chat-panel {
  display: block;
}

.dmusic-chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px;
    background: var(--accent-color2);
    color: #fff;
    margin: 0;
}

.dmusic-chat-close {
  border: none;
  background: transparent;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}

.dmusic-chat-input a.btn {
  padding: 0;
}

.dmusic-chat-input {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
  padding: 0 10px;
}

.dmusic-chat-input input {
  flex: 1;
  min-width: 0;
  padding: 8px;
  border-radius: var(--radius);
  border: none;
  height: 40px;
}

.dmusic-chat-input > .btn,
.dmusic-chat-input > a.btn {
  width: 38px;
  height: 38px;
  min-width: 38px;
  padding: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.dmusic-chat-send-icon {
  font-size: 18px;
  line-height: 1;
}

.dmusic-chat-input input.is-recording {
  background: rgba(225, 29, 72, .16);
  border: 1px solid rgba(225, 29, 72, .65);
  color: #fff;
  font-weight: 600;
}

.dmusic-chat-voice-draft {
  display: none;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}

.dmusic-chat-voice-draft.is-open {
  display: flex;
}

.dmusic-chat-voice-preview {
  display: none;
}

.dmusic-chat-draft-btn {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 7px;
  background: rgba(255, 255, 255, .08);
  color: #fff;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}

.dmusic-chat-draft-btn.primary {
  border-color: var(--accent-color2);
  background: var(--accent-color2);
  color: #fff;
  font-weight: 700;
}

.dmusic-chat-draft-btn.danger {
  border-color: rgba(225, 29, 72, .6);
  background: rgba(225, 29, 72, .2);
}

.dmusic-chat-input.is-voice-mode .dmusic-chat-media-actions {
  display: none;
}

.dmusic-chat-voice-draft .dmusic-chat-draft-btn.play,
.dmusic-chat-voice-draft .dmusic-chat-draft-btn.delete {
  display: inline-flex;
}

.dmusic-chat-voice-draft.is-recording .dmusic-chat-draft-btn.play,
.dmusic-chat-voice-draft.is-recording .dmusic-chat-draft-btn.delete {
  display: none;
}

.dmusic-chat-widget.is-open .dmusic-chat-launcher {
  display: none;
}

.dmusic-chat-line.is-listener .dmusic-chat-bubble {
  background: var(--accent-color);
  border-radius: var(--radius);
  padding: 6px 12px;
  font-size: 16px;
  text-transform: none;
}

.dmusic-chat-line.is-staff .dmusic-chat-bubble {
  background: #ffffff2e;
  border-radius: var(--radius);
  padding: 6px 12px;
  font-size: 16px;
  text-transform: none;
}

.dmusic-chat-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dmusic-chat-line.is-staff {
  justify-content: flex-start;
}

.dmusic-chat-line.is-listener {
  justify-content: flex-end;
}

.dmusic-chat-line.is-listener .dmusic-chat-avatar {
  order: 2;
}

.dmusic-chat-line.is-listener span {
  order: 1;
}

.dmusic-chat-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #4b5563;
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  flex: 0 0 26px;
  overflow: hidden;
}

.dmusic-chat-media-actions {
  display: inline-flex;
  align-items: center;
  position: relative;
  margin-right: 4px;
}

#dmusic-chat-staff .dmusic-chat-messages {
  height: 520px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

#dmusic-chat-staff .dmusic-chat-input {
  padding: 10px 12px 12px;
}

@media (max-width: 980px) {
  .dmusic-chat-staff {
    grid-template-columns: 1fr;
  }
}

.dmusic-chat-plus-btn {
    width: 34px;
    height: 34px;
    border-radius: var(--radius);
    border: none;
    font-size: 30px;
    line-height: 10px;
    font-weight: 700;
    background: var(--accent-color2);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .22);
}

.dmusic-chat-plus-menu {
  position: absolute;
  bottom: 42px;
  left: 0;
  display: none;
  gap: 6px;
  background: #1f1f22;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 12px;
  padding: 8px;
  min-width: 110px;
  z-index: 30;
  box-shadow: 0 14px 24px rgba(0, 0, 0, .3);
}
.dmusic-chat-plus-menu.is-open {
  display: grid;
}

.dmusic-chat-action-btn {
  min-width: 90px;
  height: 32px;
  padding: 0 10px;
  font-size: 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .08);
  color: #fff;
  text-align: left;
  cursor: pointer;
}

.dmusic-chat-emoji-panel {
  position: absolute;
  bottom: 42px;
  left: 0;
  width: 308px;
  display: none;
  background: #1f1f22;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 12px;
  padding: 8px;
  z-index: 31;
  box-shadow: 0 14px 24px rgba(0, 0, 0, .3);
}
.dmusic-chat-emoji-panel.is-open {
  display: block;
}

.dmusic-chat-emoji-tabs {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 6px;
  margin-bottom: 6px;
  padding-bottom: 4px;
}

.dmusic-chat-emoji-tab {
  flex: 0 0 auto;
  min-width: 38px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 8px;
  background: rgba(255, 255, 255, .07);
  color: #fff;
  cursor: pointer;
  font-size: 15px;
}

.dmusic-chat-emoji-tab.is-active {
  background: var(--accent-color2);
  border-color: var(--accent-color2);
}

.dmusic-chat-tone-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.dmusic-chat-tone-btn {
  flex: 0 0 auto;
  width: 34px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 8px;
  background: rgba(255, 255, 255, .08);
  color: #fff;
  cursor: pointer;
  font-size: 16px;
}

.dmusic-chat-tone-btn.is-active {
  background: var(--accent-color2);
  border-color: var(--accent-color2);
}

.dmusic-chat-emoji-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 2px;
}

.dmusic-chat-emoji-btn {
  width: 36px;
  height: 34px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, .08);
  cursor: pointer;
  font-size: 19px;
}

.dmusic-chat-media {
  margin-top: 6px;
}

.dmusic-chat-media-image {
  width: 180px;
  max-width: 100%;
  border-radius: 8px;
  display: block;
  cursor: zoom-in;
}

.dmusic-chat-audio-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, .18);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 10px;
  padding: 6px 8px;
}

.dmusic-chat-audio-toggle {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: none;
  background: var(--accent-color2);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.dmusic-chat-media-audio {
  display: none;
}

.dmusic-chat-media-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.dmusic-chat-media-modal.is-open {
  display: flex;
}

.dmusic-chat-media-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .75);
}

.dmusic-chat-media-modal-img {
  position: relative;
  z-index: 1;
  max-width: min(92vw, 780px);
  max-height: 84vh;
  border-radius: 12px;
  box-shadow: 0 22px 50px rgba(0, 0, 0, .45);
  object-fit: contain;
}
