.dsc-root {
  position: fixed;
  inset-block-end: 20px;
  inset-inline-end: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  font-family: inherit;
}
.dsc-fab {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: #1f7da1;
  color: #fff;
  font-size: 24px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
  transition: transform 0.15s ease, background 0.15s ease;
}
.dsc-fab:hover {
  background: #186481;
  transform: scale(1.05);
}
.dsc-panel {
  width: min(360px, calc(100vw - 32px));
  height: min(500px, calc(100vh - 110px));
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(0, 0, 0, 0.08);
}
.dsc-panel[hidden],
.dsc-error[hidden],
.dsc-root [hidden] {
  display: none !important;
}
.dsc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #1f7da1;
  color: #fff;
  font-weight: 600;
  font-size: 15px;
}
.dsc-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.85;
}
.dsc-close:hover {
  opacity: 1;
}
.dsc-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.dsc-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dsc-intro {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  flex: 1;
  overflow-y: auto;
}
.dsc-intro input,
.dsc-intro textarea,
.dsc-input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid #d5dde1;
  border-radius: 8px;
  font: inherit;
  font-size: 14px;
  outline: none;
}
.dsc-intro input:focus,
.dsc-intro textarea:focus,
.dsc-input:focus {
  border-color: #1f7da1;
  box-shadow: 0 0 0 2px rgba(31, 125, 161, 0.15);
}
.dsc-submit {
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  background: #1f7da1;
  color: #fff;
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.dsc-submit:hover:not([disabled]) {
  background: #186481;
}
.dsc-submit[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}
.dsc-msg {
  max-width: 82%;
  padding: 8px 12px;
  border-radius: 12px;
  background: #f1f4f6;
  align-self: flex-start;
  font-size: 14px;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.45;
}
.dsc-msg.dsc-mine {
  align-self: flex-end;
  background: #d9edf5;
  color: #0c3645;
}
.dsc-msg.dsc-system {
  background: #fff5e0;
  color: #5c4300;
  font-style: italic;
}
.dsc-who {
  display: block;
  font-size: 11px;
  color: #666;
  margin-block-end: 2px;
}
.dsc-shot-wrap {
  position: relative;
  display: inline-block;
  max-width: 100%;
  border-radius: 8px;
  overflow: hidden;
  margin-block-start: 6px;
  cursor: pointer;
}
.dsc-shot {
  max-width: 100%;
  border-radius: 8px;
  display: block;
  transition: transform 0.18s ease;
}
.dsc-shot-wrap:hover .dsc-shot {
  transform: scale(1.02);
}
.dsc-shot-btn {
  position: absolute;
  inset-block-end: 6px;
  inset-inline-end: 6px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.18s ease, background 0.18s ease;
}
.dsc-shot-wrap:hover .dsc-shot-btn {
  opacity: 1;
}
.dsc-shot-btn:hover {
  background: rgba(0, 0, 0, 0.85);
}
.dsc-msg-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-block-start: 4px;
}
.dsc-time {
  font-size: 10px;
  color: #64748b;
}
.dsc-seen {
  font-size: 11px;
  font-weight: bold;
  color: #94a3b8;
  letter-spacing: -1px;
}
.dsc-seen.is-seen {
  color: #0284c7;
}

/* Lightbox Modal */
.dsc-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}
.dsc-lightbox[hidden] {
  display: none !important;
}
.dsc-lightbox-dialog {
  max-width: min(92vw, 900px);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  background: #1e293b;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
}
.dsc-lightbox-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: #0f172a;
  color: #f8fafc;
  gap: 16px;
  min-height: 44px;
}
.dsc-lightbox-name {
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dsc-lightbox-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.dsc-lightbox-dl {
  background: #1f7da1;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.dsc-lightbox-dl:hover {
  background: #186481;
}
.dsc-lightbox-close {
  background: none;
  border: none;
  color: #cbd5e1;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}
.dsc-lightbox-close:hover {
  color: #fff;
}
.dsc-lightbox-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  overflow: hidden;
  background: #0f172a;
}
.dsc-lightbox-img {
  max-width: min(85vw, 840px);
  max-height: min(75vh, 650px);
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}
.dsc-composer {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 8px 12px;
  border-block-start: 1px solid #e3e8ea;
  background: #fafbfc;
}
.dsc-attach {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  opacity: 0.7;
}
.dsc-attach:hover {
  opacity: 1;
}
.dsc-error {
  margin: 0;
  padding: 0 16px 8px;
  color: #b3261e;
  font-size: 12px;
}
.dsc-legal {
  padding: 0 16px 10px;
  margin: 0;
  font-size: 11px;
  color: #888;
}

@media (max-width: 480px) {
  .dsc-root {
    inset-block-end: 16px;
    inset-inline-end: 16px;
  }
  .dsc-panel {
    width: calc(100vw - 32px);
    height: min(460px, calc(100vh - 100px));
  }
}
