.messages-attachment-preview {
  align-items: center;
  gap: 12px;
}

.messages-attachment-preview[hidden] {
  display: none !important;
}

.messages-attachment-preview-content {
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  overflow: hidden;
  border-radius: 12px;
  background:
    rgba(255, 255, 255, 0.06);
}

.messages-attachment-preview-content img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.messages-attachment-preview.is-uploading {
  pointer-events: none;
  opacity: 0.7;
}

.messages-attachment-preview.is-uploading::after {
  content: "Uploaden...";
  margin-left: auto;
  font-size: 12px;
  font-weight: 700;
  opacity: 0.8;
}

.private-message-bubble.has-image {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 5px;
  overflow: hidden;
}

.private-message-bubble.has-image > p {
  margin: 0;
  padding: 0 8px 6px;
}

.private-message-image-button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 13px;
  overflow: hidden;
  background: transparent;
  cursor: pointer;
}

.private-message-upload-image {
  display: block;
  width: min(320px, 100%);
  max-height: 420px;
  margin: 0 auto;
  border: 0;
  border-radius: 13px;
  object-fit: cover;
  cursor: pointer;
  background:
    rgba(255, 255, 255, 0.04);
}

.private-message-image-button:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

.messages-image-viewer-content {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  overflow: hidden;
  background:
    rgba(0, 0, 0, 0.35);
}

.messages-image-viewer-real-image {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 72vh;
  margin: auto;
  object-fit: contain;
  border-radius: 12px;
}

.messages-image-load-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 300px;
  padding: 30px;
  text-align: center;
}

.messages-image-load-error strong {
  font-size: 16px;
}

.messages-image-load-error span {
  max-width: 100%;
  font-size: 12px;
  word-break: break-all;
  opacity: 0.7;
}

#messagesImageViewer [data-close-messages-image] {
  cursor: pointer;
}

.messages-document-preview-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.04em;
  background: rgba(255, 255, 255, 0.08);
}

.private-message-document {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(360px, 100%);
  padding: 12px;
  border-radius: 13px;
  color: inherit;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.08);
}

.private-message-document:hover {
  background: rgba(255, 255, 255, 0.13);
}

.private-message-document-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border-radius: 11px;
  font-size: 12px;
  font-weight: 900;
  background: rgba(255, 255, 255, 0.1);
}

.private-message-document-info {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}

.private-message-document-info strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.private-message-document-info small {
  opacity: 0.7;
}

.private-message-document-download {
  font-size: 24px;
  font-weight: 800;
}

.messages-voice-recorder{
display:flex;
align-items:center;
justify-content:space-between;
gap:16px;
margin-top:12px;
padding:12px 14px;
border-radius:14px;
background:rgba(255,255,255,.05);
}

.messages-voice-status{
display:flex;
align-items:center;
gap:10px;
font-weight:700;
}

.messages-voice-dot{
width:12px;
height:12px;
border-radius:50%;
background:#ff3b30;
animation:voicePulse 1s infinite;
}

@keyframes voicePulse{

0%{
transform:scale(1);
opacity:1;
}

50%{
transform:scale(1.4);
opacity:.45;
}

100%{
transform:scale(1);
opacity:1;
}

}

.messages-voice-actions{
display:flex;
align-items:center;
gap:10px;
}

.messages-voice-actions button{
padding:8px 14px;
border:0;
border-radius:10px;
cursor:pointer;
}

#messagesVoicePreview{
width:260px;
}


.messages-voice-recorder {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 10px 0;
  padding: 12px 14px;
  color: #f4f0eb;
  background: rgba(25, 22, 24, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
}

.messages-voice-recorder[hidden] {
  display: none !important;
}

.messages-voice-status {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 72px;
  font-weight: 800;
}

.messages-voice-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff4655;
}

.messages-voice-recorder.is-recording .messages-voice-dot {
  animation: voicePulse 1s infinite;
}

.messages-voice-recorder.has-preview .messages-voice-dot {
  background: #6fdc8c;
  animation: none;
}

.messages-voice-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  justify-content: flex-end;
}

.messages-voice-actions button {
  min-height: 38px;
  padding: 8px 14px;
  color: #f8f5f2 !important;
  background: rgba(255, 255, 255, 0.09) !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  border-radius: 10px;
  font-weight: 800;
  cursor: pointer;
}

.messages-voice-actions button:hover {
  background: rgba(255, 255, 255, 0.16) !important;
}

.messages-voice-recorder.has-preview #messagesVoiceStopButton {
  display: none;
}

#messagesVoicePreview {
  width: min(320px, 100%);
  height: 40px;
}

.private-message-voice {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(360px, 100%);
  padding: 10px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.08);
}

.private-message-voice-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
}

.private-message-voice-player {
  width: 100%;
  min-width: 220px;
  height: 38px;
}

@keyframes voicePulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.4);
    opacity: 0.45;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}


.private-message-delete-button {
  display: inline-grid;
  place-items: center;
  width: 27px;
  height: 27px;
  margin-left: 3px;
  padding: 0;
  color: inherit;
  background: transparent;
  border: 0;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1;
  opacity: 0.55;
  cursor: pointer;
}

.private-message-delete-button:hover {
  color: #ffffff;
  background: rgba(255, 70, 85, 0.2);
  opacity: 1;
}

.private-message-delete-button:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}


.private-message-body {
  position: relative;
}

.private-message-meta {
  position: relative;
  z-index: 5;
}

.private-message-document {
  position: relative;
  z-index: 1;
}

.private-message-delete-button {
  position: relative;
  z-index: 10;
  pointer-events: auto !important;
}


.private-message-body {
  position: relative;
}

.private-message-delete-overlay {
  position: absolute !important;
  top: 6px;
  right: 6px;
  z-index: 50 !important;

  display: grid;
  place-items: center;

  width: 30px;
  height: 30px;
  margin: 0;
  padding: 0;

  color: #201600 !important;
  background: rgba(255, 255, 255, 0.72) !important;
  border: 1px solid rgba(0, 0, 0, 0.15) !important;
  border-radius: 9px;

  font-size: 12px;
  opacity: 0;
  pointer-events: auto !important;
  cursor: pointer;

  transition:
    opacity 150ms ease,
    background-color 150ms ease,
    transform 150ms ease;
}

.private-message.sent:hover .private-message-delete-overlay,
.private-message-delete-overlay:focus-visible {
  opacity: 1;
}

.private-message-delete-overlay:hover {
  color: #ffffff !important;
  background: #d93645 !important;
  transform: scale(1.06);
}

.private-message.sent .private-message-bubble {
  padding-right: 42px;
}

.private-message.sent .private-message-bubble.has-image {
  padding-right: 5px;
}

.private-message.sent .private-message-document {
  padding-right: 48px;
}

@media (hover: none) {
  .private-message-delete-overlay {
    opacity: 0.75;
  }
}
