/* OLONE DM audio call MVP — scoped selectors only (.dm-call- / #dmCall...) */

.dm-call-layer {
  position: fixed;
  inset: 0;
  z-index: 4200;
  display: grid;
  place-items: center;
  overflow-x: hidden;
  overflow-y: auto;
  padding: max(16px, env(safe-area-inset-top, 0px))
    max(16px, env(safe-area-inset-right, 0px))
    max(16px, env(safe-area-inset-bottom, 0px))
    max(16px, env(safe-area-inset-left, 0px));
  background: rgba(2, 7, 18, 0.58);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.dm-call-layer.hidden {
  display: none !important;
}

.dm-call-modal,
#dmCallModal {
  position: relative;
  width: min(980px, calc(100vw - 48px));
  min-height: min(560px, calc(100dvh - 48px));
  border-radius: 28px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 0;
  padding: 36px 28px 32px;
  color: #e8f1ff;
  background:
    linear-gradient(180deg, rgba(36, 64, 110, 0.42), rgba(12, 24, 48, 0.18)),
    linear-gradient(160deg, #0b1730 0%, #102445 48%, #0a1428 100%);
  border: 1px solid rgba(120, 180, 255, 0.28);
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.dm-call-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}

.dm-call-modal.has-media-panel .dm-call-shell {
  grid-template-columns: minmax(0, 1.15fr) minmax(240px, 0.85fr);
}

.dm-call-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-width: 0;
}

.dm-call-modal__glow {
  position: absolute;
  inset: -20% auto auto 50%;
  width: 280px;
  height: 180px;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(90, 170, 255, 0.22), transparent 70%);
  pointer-events: none;
}

.dm-call-avatar-wrap {
  position: relative;
  z-index: 1;
  margin-bottom: 4px;
}

.dm-call-avatar-ring {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(145deg, #7ec8ff, #3a7bd5 45%, #1b4f9c);
  box-shadow: 0 10px 28px rgba(20, 60, 120, 0.45);
}

.dm-call-avatar,
.dm-call-avatar-ph {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: block;
  object-fit: cover;
  background:
    radial-gradient(circle at 50% 35%, rgba(70, 120, 190, 0.45), transparent 55%),
    #13233f;
}

.dm-call-avatar-ph {
  display: grid;
  place-items: center;
  color: rgba(210, 228, 255, 0.92);
}

.dm-call-avatar-fallback-icon {
  width: 54%;
  height: 54%;
  display: block;
}

.dm-call-avatar.hidden,
.dm-call-avatar-ph.hidden {
  display: none;
}

.dm-call-name {
  position: relative;
  z-index: 1;
  max-width: min(520px, 86vw);
  margin: 8px 0 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dm-call-status {
  position: relative;
  z-index: 1;
  min-height: 1.4em;
  color: rgba(200, 220, 245, 0.82);
  font-size: 16px;
  text-align: center;
}

.dm-call-timer {
  position: relative;
  z-index: 1;
  font-variant-numeric: tabular-nums;
  font-size: 34px;
  font-weight: 650;
  letter-spacing: 0.04em;
  color: #f2f7ff;
}

.dm-call-timer.hidden {
  display: none;
}

.dm-call-actions {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 28px;
  margin-top: 28px;
  padding-bottom: 18px;
}

.dm-call-actions.hidden {
  display: none;
}

.dm-call-control {
  width: 62px;
  min-width: 62px;
  height: 62px;
  border: 0;
  border-radius: 50%;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  color: #fff;
  background: transparent;
  box-shadow: none;
  position: relative;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.dm-call-control:hover:not(:disabled) {
  transform: translateY(-1px);
}

.dm-call-control:focus-visible {
  outline: 2px solid #8ec5ff;
  outline-offset: 3px;
}

.dm-call-control__icon {
  display: grid;
  place-items: center;
  box-sizing: border-box;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background:
    linear-gradient(180deg, rgba(54, 86, 140, 0.88), rgba(18, 34, 68, 0.94));
  border: 1px solid rgba(150, 198, 255, 0.34);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 10px 22px rgba(0, 0, 0, 0.34);
}

.dm-call-control__label {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 12px;
  color: rgba(210, 225, 245, 0.88);
  pointer-events: none;
}

.dm-call-control--accept .dm-call-control__icon {
  background: linear-gradient(180deg, #45d67d, #1f9e4d);
  border-color: rgba(170, 255, 200, 0.45);
}

.dm-call-control--decline .dm-call-control__icon,
.dm-call-control--end .dm-call-control__icon {
  background: linear-gradient(180deg, #ff7373, #d62828);
  border-color: rgba(255, 180, 180, 0.4);
}

.dm-call-control--mute .dm-call-control__icon {
  background:
    linear-gradient(180deg, rgba(58, 90, 145, 0.9), rgba(22, 40, 78, 0.95));
  border: 1px solid rgba(160, 200, 255, 0.28);
}

.dm-call-control--mute.is-muted .dm-call-control__icon {
  background: linear-gradient(180deg, rgba(190, 90, 90, 0.55), rgba(120, 40, 40, 0.8));
  border-color: rgba(255, 140, 140, 0.45);
}

.dm-call-control--secondary .dm-call-control__icon {
  background:
    linear-gradient(180deg, rgba(52, 84, 138, 0.9), rgba(20, 38, 74, 0.95));
  border: 1px solid rgba(160, 200, 255, 0.28);
}

.dm-call-control--secondary.is-active .dm-call-control__icon,
.dm-call-control--secondary[aria-pressed="true"] .dm-call-control__icon {
  color: #eaf5ff;
  background: linear-gradient(180deg, rgba(70, 155, 245, 0.95), rgba(36, 91, 176, 0.96));
  border-color: rgba(160, 210, 255, 0.75);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 0 0 3px rgba(70, 150, 255, 0.18),
    0 10px 22px rgba(20, 70, 140, 0.4);
}

.dm-call-control:disabled {
  opacity: 0.48;
  cursor: default;
  transform: none;
}

.dm-call-minimize-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 5;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 12px;
  color: #d7e8ff;
  background:
    linear-gradient(180deg, rgba(28, 48, 84, 0.9), rgba(12, 24, 48, 0.92));
  border: 1px solid rgba(133, 177, 235, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

.dm-call-minimize-btn.hidden {
  display: none;
}

.dm-call-minimize-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.dm-call-media-stage {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  min-height: 150px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 22px;
}

.dm-call-media-stage.has-remote-video {
  aspect-ratio: 16 / 9;
  min-height: 0;
  background: #050b16;
  border: 1px solid rgba(126, 180, 245, 0.22);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.3);
}

.dm-call-remote-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  background: #050b16;
}

.dm-call-media-stage.is-screen-share .dm-call-remote-video {
  object-fit: contain;
}

.dm-call-remote-video.hidden,
.dm-call-local-preview.hidden {
  display: none;
}

.dm-call-remote-video-placeholder {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
}

.dm-call-media-stage.has-remote-video .dm-call-remote-video-placeholder {
  display: none;
}

.dm-call-local-preview {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 3;
  width: 132px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 12px;
  background: #07101f;
  border: 1px solid rgba(180, 214, 255, 0.38);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.42);
}

.dm-call-media-block__loading {
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 13px;
  color: #dcecff;
  background: rgba(20, 40, 72, 0.72);
  border: 1px solid rgba(130, 180, 240, 0.28);
}

.dm-call-media-block__loading.hidden {
  display: none !important;
}

.dm-call-media-block.is-viewer-suppressed .dm-call-media-block__video {
  opacity: 0.35;
}

#dmCallLocalVideoPreview.is-mirror,
.dm-call-media-block__video--mirror,
.dm-call-media-viewer__video.is-mirror {
  transform: scaleX(-1);
}

.dm-call-media-panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(18, 34, 64, 0.78), rgba(10, 20, 40, 0.72));
  border: 1px solid rgba(130, 180, 240, 0.24);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.dm-call-media-panel.hidden {
  display: none;
}

.dm-call-media-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.dm-call-media-block.hidden {
  display: none;
}

.dm-call-media-block__header {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dm-call-media-block__title {
  font-size: 14px;
  font-weight: 650;
  color: #eaf3ff;
}

.dm-call-media-block__subtitle {
  font-size: 12px;
  color: rgba(190, 214, 245, 0.78);
}

.dm-call-media-block__video {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  border-radius: 14px;
  background: #050b16;
  border: 1px solid rgba(140, 185, 240, 0.24);
}

.dm-call-media-block__video--mirror,
.dm-call-media-viewer__video.is-mirror {
  transform: scaleX(-1);
}

.dm-call-media-block__video.hidden {
  display: none;
}

.dm-call-media-block__action {
  appearance: none;
  border: 1px solid rgba(140, 190, 255, 0.36);
  border-radius: 12px;
  padding: 10px 12px;
  color: #e8f3ff;
  background:
    linear-gradient(180deg, rgba(48, 92, 160, 0.55), rgba(28, 56, 110, 0.7));
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.dm-call-media-block__action:hover {
  border-color: rgba(170, 210, 255, 0.55);
}

.dm-call-media-viewer {
  position: fixed;
  inset: 0;
  z-index: 4300;
  display: flex;
  flex-direction: column;
  background: transparent;
  padding: max(16px, env(safe-area-inset-top, 0px))
    max(16px, env(safe-area-inset-right, 0px))
    max(16px, env(safe-area-inset-bottom, 0px))
    max(16px, env(safe-area-inset-left, 0px));
}

.dm-call-media-viewer::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: rgba(2, 7, 18, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  pointer-events: none;
}

.dm-call-media-viewer.hidden {
  display: none !important;
}

.dm-call-media-viewer__chrome {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.dm-call-media-viewer__title {
  font-size: 18px;
  font-weight: 650;
  color: #eef5ff;
}

.dm-call-media-viewer__close {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid rgba(140, 185, 240, 0.3);
  background: rgba(12, 24, 48, 0.85);
  color: #dcecff;
  cursor: pointer;
}

.dm-call-media-viewer__close svg {
  width: 20px;
  height: 20px;
}

.dm-call-media-viewer__stage {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
  border-radius: 18px;
  overflow: hidden;
  background: #050b16;
  border: 1px solid rgba(130, 180, 240, 0.22);
}

.dm-call-control--secondary.is-requesting .dm-call-control__icon {
  opacity: 0.92;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 0 0 3px rgba(120, 180, 255, 0.28),
    0 10px 22px rgba(0, 0, 0, 0.34);
  animation: dm-call-camera-pulse 1.1s ease-in-out infinite;
}

.dm-call-control--secondary.is-error .dm-call-control__icon {
  border-color: rgba(255, 150, 150, 0.55);
  background: linear-gradient(180deg, rgba(150, 60, 70, 0.9), rgba(90, 28, 36, 0.95));
}

@keyframes dm-call-camera-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(0.96);
  }
}

#dmCallCameraButton {
  pointer-events: auto;
  z-index: 6;
}

.dm-call-media-block__current {
  font-size: 12px;
  color: rgba(200, 220, 245, 0.86);
  margin-bottom: 6px;
}

.dm-call-media-block__select-label {
  display: block;
  font-size: 12px;
  margin-bottom: 4px;
  color: rgba(190, 212, 240, 0.9);
}

.dm-call-media-block__select {
  width: 100%;
  margin-bottom: 10px;
  border-radius: 10px;
  border: 1px solid rgba(130, 180, 240, 0.3);
  background: rgba(8, 18, 36, 0.92);
  color: #e8f3ff;
  padding: 8px 10px;
  font-size: 13px;
}

.dm-call-media-block__select.is-highlight {
  outline: 2px solid #8ec5ff;
  outline-offset: 2px;
}

.dm-call-camera-error {
  margin: 10px 0 12px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 150, 150, 0.42);
  background: rgba(70, 18, 28, 0.72);
  color: #ffe8ea;
}

.dm-call-camera-error.hidden {
  display: none !important;
}

.dm-call-camera-error__title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 6px;
}

.dm-call-camera-error__description {
  font-size: 13px;
  line-height: 1.45;
  color: rgba(255, 230, 232, 0.92);
  margin-bottom: 10px;
}

.dm-call-camera-error__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dm-call-media-block__action--secondary {
  background: rgba(20, 40, 72, 0.85);
}

.dm-call-media-block__action--ghost {
  background: transparent;
  border-color: rgba(160, 190, 230, 0.28);
}

.dm-call-camera-warning {
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.4;
  color: #ffe7c2;
  background: rgba(90, 60, 10, 0.55);
  border: 1px solid rgba(255, 190, 110, 0.35);
}

.dm-call-camera-warning.hidden {
  display: none !important;
}

.dm-call-media-viewer__video {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
  object-position: center;
  background: #050b16;
  filter: none;
  image-rendering: auto;
}

.dm-call-media-viewer__video:not(.is-mirror) {
  transform: none;
}

.dm-call-mic-panel {
  position: relative;
  z-index: 4;
  width: min(420px, 100%);
  margin-top: 18px;
  padding: 14px;
  box-sizing: border-box;
  border-radius: 16px;
  color: #dcecff;
  background: rgba(8, 20, 39, 0.92);
  border: 1px solid rgba(126, 180, 245, 0.25);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.3);
}

.dm-call-mic-panel.hidden {
  display: none;
}

.dm-call-mic-panel label {
  display: block;
  margin-bottom: 7px;
  font-size: 12px;
  color: #9db8da;
}

.dm-call-mic-panel select {
  width: 100%;
  height: 38px;
  padding: 0 10px;
  border-radius: 10px;
  color: #eaf3ff;
  background: #10213a;
  border: 1px solid rgba(126, 180, 245, 0.28);
}

.dm-call-mic-panel__label {
  margin-top: 8px;
  overflow: hidden;
  color: #b8cce6;
  font-size: 12px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.dm-call-mic-panel__meter {
  height: 5px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(151, 183, 224, 0.16);
}

.dm-call-mic-panel__meter span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #48d58b, #70c8ff);
  transition: width 80ms linear;
}

.dm-call-mic-panel__error {
  min-height: 16px;
  margin-top: 7px;
  color: #ff9ca5;
  font-size: 12px;
}

.dm-call-mini-widget {
  position: fixed;
  right: 22px;
  bottom: 92px;
  z-index: 1450;
  width: min(360px, calc(100vw - 24px));
  height: 76px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
  box-sizing: border-box;
  border-radius: 16px;
  color: rgba(238, 244, 255, 0.97);
  background: linear-gradient(145deg, rgba(17, 27, 45, 0.96), rgba(9, 16, 29, 0.97));
  border: 1px solid rgba(92, 126, 188, 0.34);
  box-shadow:
    0 18px 46px rgba(0, 0, 0, 0.36),
    0 0 0 1px rgba(75, 112, 174, 0.08),
    0 0 26px rgba(69, 81, 255, 0.12);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.dm-call-mini-widget.hidden,
.dm-call-mini-widget[aria-hidden="true"] {
  display: none !important;
}

.dm-call-mini-widget__avatar {
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: rgba(230, 240, 255, 0.95);
  font-size: 0;
  background:
    radial-gradient(circle at 50% 35%, rgba(90, 140, 220, 0.45), transparent 55%),
    linear-gradient(145deg, #2a4f8f, #1a2f5c);
  box-shadow: 0 0 20px rgba(80, 114, 230, 0.3);
  overflow: hidden;
}

.dm-call-mini-widget__avatar-icon {
  width: 58%;
  height: 58%;
  display: block;
}

.dm-call-mini-widget__meta {
  flex: 1 1 auto;
  min-width: 0;
}

.dm-call-mini-widget__name {
  overflow: hidden;
  color: #f5f8ff;
  font-size: 14px;
  line-height: 18px;
  font-weight: 750;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.dm-call-mini-widget__subline {
  display: flex;
  gap: 6px;
  color: rgba(153, 170, 199, 0.84);
  font-size: 11px;
  line-height: 15px;
  white-space: nowrap;
}

.dm-call-mini-widget__controls {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
}

.dm-call-mini-widget__button {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 12px;
  color: #e0e9f8;
  background: rgba(17, 29, 49, 0.9);
  border: 1px solid rgba(91, 123, 175, 0.28);
  cursor: pointer;
}

.dm-call-mini-widget__button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dm-call-mini-widget__button[aria-pressed="true"] {
  color: #ff7f89;
  background: rgba(91, 27, 38, 0.54);
  border-color: rgba(239, 74, 91, 0.36);
}

.dm-call-mini-widget__button--end {
  color: #ff727c;
  background: rgba(112, 24, 36, 0.64);
  border-color: rgba(255, 77, 91, 0.48);
}

.dm-call-mini-widget button:focus-visible,
.dm-call-minimize-btn:focus-visible {
  outline: 2px solid #8ec5ff;
  outline-offset: 2px;
}

/* Stable DM header call slot — scoped only */
#chatHeader.olone-chat-header > .dm-header-right-actions,
.dm-header-right-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-left: auto;
  margin-right: 0;
  padding-right: 4px; /* header already has 12px padding → visual ~16px from edge */
  min-width: 44px;
  flex: 0 0 auto;
  position: relative;
  z-index: 4;
  order: 40;
  box-sizing: border-box;
}

/* Collapse empty DM right slot so GC/channel headers keep normal spacing */
.dm-header-right-actions:not(:has(.msg-tools:not(.hidden))):not(:has(#dmAudioCallButton:not(.hidden))) {
  margin-left: 0;
  padding-right: 0;
  min-width: 0;
  gap: 0;
}

.olone-chat-header[data-olone-header-mode="dm"] > .dm-header-right-actions {
  margin-left: auto;
  padding-right: 4px;
}

.olone-chat-header[data-olone-header-mode="dm"] > .dm-header-right-actions:not(:has(.msg-tools:not(.hidden))):not(:has(#dmAudioCallButton:not(.hidden))) {
  /* Keep reserved right slot in DM even when idle so coordinates stay stable */
  margin-left: auto;
  padding-right: 4px;
  min-width: 44px;
}

.dm-header-selection-actions {
  order: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
  min-height: 0;
  max-width: min(520px, calc(100vw - 280px));
  max-height: none;
  flex: 0 1 auto;
  overflow: visible;
  overflow-x: visible;
  overflow-y: visible;
  scrollbar-gutter: auto;
}

.dm-header-selection-actions:empty {
  display: none;
}

.dm-header-right-actions .msg-tools {
  flex: 0 1 auto !important;
  width: auto !important;
  max-width: 100%;
  min-width: 0;
  height: auto;
  max-height: none;
  overflow: visible !important;
  overflow-x: visible !important;
  overflow-y: visible !important;
  scrollbar-gutter: auto;
  overscroll-behavior: auto;
  -webkit-overflow-scrolling: auto;
  box-sizing: border-box;
}

#dmAudioCallButton.dm-call-start-button {
  order: 2;
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(78, 148, 255, 0.34);
  background:
    linear-gradient(
      180deg,
      rgba(29, 48, 76, 0.94) 0%,
      rgba(17, 31, 52, 0.96) 100%
    );
  color: #6eafff;
  box-shadow:
    0 8px 22px rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.055);
  cursor: pointer;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    color 160ms ease,
    opacity 160ms ease;
}

#dmAudioCallButton.dm-call-start-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

#dmAudioCallButton.dm-call-start-button:hover:not(:disabled) {
  color: #8fc1ff;
  border-color: rgba(93, 166, 255, 0.62);
  background:
    linear-gradient(
      180deg,
      rgba(36, 63, 101, 0.97) 0%,
      rgba(22, 42, 70, 0.98) 100%
    );
  box-shadow:
    0 10px 26px rgba(0, 0, 0, 0.28),
    0 0 0 3px rgba(65, 138, 255, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.075);
}

#dmAudioCallButton.dm-call-start-button:active:not(:disabled) {
  background:
    linear-gradient(
      180deg,
      rgba(22, 43, 72, 0.98) 0%,
      rgba(15, 29, 49, 0.98) 100%
    );
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.22),
    inset 0 1px 4px rgba(0, 0, 0, 0.22);
}

#dmAudioCallButton.dm-call-start-button:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 3px rgba(7, 15, 27, 0.96),
    0 0 0 5px rgba(75, 151, 255, 0.68),
    0 8px 22px rgba(0, 0, 0, 0.24);
}

#dmAudioCallButton.dm-call-start-button:disabled,
#dmAudioCallButton.dm-call-start-button[aria-disabled="true"] {
  opacity: 0.42;
  cursor: default;
  box-shadow: none;
}

#dmAudioCallButton.dm-call-start-button.hidden {
  display: none !important;
}

/* Keep call slot pinned during selection; toolbar compresses first */
.olone-chat-header--selection .dm-header-right-actions {
  margin-left: auto;
  flex: 0 0 auto;
}

.olone-chat-header--selection .dm-header-right-actions .msg-tools {
  flex: 0 1 auto !important;
  /* Never become a scroll container: overflow-x:auto forces overflow-y:auto
     and max-height + button padding then paints a vertical scrollbar. */
  overflow: visible !important;
  overflow-x: visible !important;
  overflow-y: visible !important;
  max-height: none;
  height: auto;
  scrollbar-gutter: auto;
  -webkit-overflow-scrolling: auto;
}

/* Prevent selection-mode flex/gap from shifting the pinned DM call slot */
@media (min-width: 921px) {
  .olone-chat-header[data-olone-header-mode="dm"].olone-chat-header--selection {
    gap: 8px;
  }

  .olone-chat-header[data-olone-header-mode="dm"].olone-chat-header--selection .olone-chat-header__actions {
    flex: 0 0 auto;
    margin-left: auto;
    max-width: none;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
  }
}

@media (max-width: 900px) {
  .dm-header-selection-actions .msg-tools-btn__label {
    display: none;
  }

  .dm-header-selection-actions,
  .dm-header-right-actions .msg-tools {
    gap: 4px;
    max-width: min(220px, calc(100vw - 120px));
    overflow: visible !important;
    overflow-x: visible !important;
    overflow-y: visible !important;
  }
}

@media (max-width: 560px) {
  .dm-header-right-actions {
    gap: 6px;
    padding-right: 10px;
  }

  #dmAudioCallButton.dm-call-start-button {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
  }
}

@media (max-width: 720px) {
  .dm-call-layer {
    padding: max(12px, env(safe-area-inset-top, 0px))
      max(12px, env(safe-area-inset-right, 0px))
      max(12px, env(safe-area-inset-bottom, 0px))
      max(12px, env(safe-area-inset-left, 0px));
  }

  .dm-call-modal {
    width: min(100vw - 24px, 980px);
    min-height: min(520px, calc(100dvh - 32px));
    border-radius: 22px;
    padding: 28px 16px 24px;
  }

  .dm-call-modal.has-media-panel .dm-call-shell {
    grid-template-columns: 1fr;
  }

  .dm-call-name {
    font-size: 22px;
  }

  .dm-call-control {
    width: 56px;
    min-width: 56px;
    height: 56px;
  }

  .dm-call-control__icon {
    width: 56px;
    height: 56px;
  }

  .dm-call-actions {
    gap: 22px;
  }

  .dm-call-actions--active {
    width: 100%;
    flex-wrap: wrap;
    gap: 26px 18px;
  }

  .dm-call-media-stage {
    width: 100%;
  }

  .dm-call-local-preview {
    width: 106px;
  }
}

@media (max-width: 430px) {
  .dm-call-modal {
    width: calc(100vw - 20px);
    min-height: min(480px, calc(100dvh - 24px));
    padding: 28px 16px 24px;
    gap: 12px;
    border-radius: 20px;
  }

  .dm-call-avatar-ring {
    width: 96px;
    height: 96px;
  }

  .dm-call-avatar-ph {
    font-size: 0;
  }

  .dm-call-avatar-fallback-icon {
    width: 52%;
    height: 52%;
  }

  .dm-call-name {
    font-size: 20px;
  }

  .dm-call-status {
    font-size: 14px;
  }

  .dm-call-timer {
    font-size: 28px;
  }

  .dm-call-actions {
    gap: 24px;
    margin-top: 20px;
  }

  .dm-call-actions--active {
    gap: 24px 14px;
  }

  .dm-call-control,
  .dm-call-control__icon {
    width: 52px;
    min-width: 52px;
    height: 52px;
  }

  .dm-call-media-stage {
    min-height: 116px;
    border-radius: 16px;
  }

  .dm-call-local-preview {
    right: 8px;
    bottom: 8px;
    width: 92px;
    border-radius: 9px;
  }

  .dm-call-mini-widget {
    right: 10px;
    bottom: 82px;
    width: calc(100vw - 20px);
    height: 72px;
    padding: 12px;
    gap: 8px;
  }

  .dm-call-mini-widget__avatar {
    flex-basis: 42px;
    width: 42px;
    height: 42px;
  }

  .dm-call-mini-widget__button {
    width: 36px;
    height: 36px;
  }
}

@media (max-width: 390px) {
  .dm-call-modal {
    padding: 24px 14px 20px;
    gap: 10px;
  }

  .dm-call-avatar-ring {
    width: 88px;
    height: 88px;
  }

  .dm-call-name {
    font-size: 18px;
  }

  .dm-call-timer {
    font-size: 26px;
  }

  .dm-call-actions {
    gap: 20px;
    margin-top: 16px;
  }

  .dm-call-actions--active {
    gap: 22px 10px;
  }
}

@media (max-width: 360px) {
  .dm-call-avatar-ring {
    width: 80px;
    height: 80px;
  }

  .dm-call-avatar-ph {
    font-size: 0;
  }

  .dm-call-avatar-fallback-icon {
    width: 50%;
    height: 50%;
  }

  .dm-call-name {
    font-size: 17px;
  }

  .dm-call-status {
    font-size: 13px;
  }

  .dm-call-timer {
    font-size: 24px;
  }

  .dm-call-control,
  .dm-call-control__icon {
    width: 52px;
    min-width: 52px;
    height: 52px;
  }

  .dm-call-actions {
    gap: 18px;
  }

  .dm-call-actions--active {
    gap: 22px 8px;
  }

  .dm-call-mini-widget__subline #dmCallMiniStatus {
    display: none;
  }
}

@media (max-width: 320px) {
  .dm-call-modal {
    width: calc(100vw - 12px);
    padding: 20px 10px 16px;
    border-radius: 16px;
  }

  .dm-call-avatar-ring {
    width: 80px;
    height: 80px;
  }

  .dm-call-name {
    font-size: 16px;
  }

  .dm-call-actions {
    gap: 14px;
    margin-top: 12px;
  }
}

@media (max-height: 600px) {
  .dm-call-modal {
    min-height: min(420px, calc(100dvh - 24px));
    gap: 8px;
    padding-top: 24px;
    padding-bottom: 20px;
  }

  .dm-call-avatar-wrap {
    margin-bottom: 0;
  }

  .dm-call-avatar-ring {
    width: 80px;
    height: 80px;
  }

  .dm-call-name {
    margin-top: 4px;
    font-size: 18px;
  }

  .dm-call-timer {
    font-size: 24px;
  }

  .dm-call-actions {
    margin-top: 14px;
    gap: 20px;
  }
}

/* DM call history card in dialog — compact horizontal redesign */
.bubble.bubble--dm-call {
  box-sizing: border-box;
  width: fit-content;
  max-width: min(520px, 100%);
  min-width: 0;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  white-space: normal;
}

.bubble.bubble--dm-call.bubble--dm-call-incoming {
  align-self: flex-start;
}

.bubble.bubble--dm-call.bubble--dm-call-outgoing {
  align-self: flex-end;
}

.bubble.bubble--dm-call .bubble-body--dm-call {
  padding: 0;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  white-space: normal;
  line-height: 1.25;
}

.dm-call-message {
  --dm-call-accent: #55e1e7;
  --dm-call-accent-soft: #55a8ff;
  --dm-call-border: rgba(71, 211, 231, 0.42);
  --dm-call-glow: rgba(62, 214, 229, 0.14);
  position: relative;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  grid-template-rows: auto;
  align-items: center;
  align-content: center;
  gap: 16px;
  width: min(520px, 100%);
  max-width: 100%;
  min-width: 0;
  min-height: 106px;
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid var(--dm-call-border);
  background: linear-gradient(145deg, rgba(24, 48, 86, 0.96) 0%, rgba(15, 33, 62, 0.98) 100%);
  box-shadow:
    0 14px 34px rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.045);
  overflow: visible;
  color: rgba(247, 250, 255, 0.98);
  white-space: normal;
  line-height: 1.25;
}

.dm-call-message::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(110deg, rgba(255, 255, 255, 0.035), transparent 40%);
}

.dm-call-message--result-completed,
.dm-call-message--result-offline,
.dm-call-message--result-busy,
.dm-call-message--result-voice-session-active,
.dm-call-message--result-no-answer,
.dm-call-message--result-declined,
.dm-call-message--result-cancelled,
.dm-call-message--result-connect-timeout,
.dm-call-message--result-socket-disconnected,
.dm-call-message--result-failed {
  /* result state hooks for visual QA / future accents */
}

.dm-call-message--incoming {
  --dm-call-accent: #55e1e7;
  --dm-call-accent-soft: #55a8ff;
  --dm-call-border: rgba(71, 211, 231, 0.42);
  --dm-call-glow: rgba(62, 214, 229, 0.14);
}

.dm-call-message--outgoing {
  --dm-call-accent: #ff9768;
  --dm-call-accent-soft: #ff724f;
  --dm-call-border: rgba(255, 139, 91, 0.44);
  --dm-call-glow: rgba(255, 118, 75, 0.14);
}

.dm-call-message__visual {
  position: relative;
  width: 76px;
  height: 64px;
  min-width: 76px;
  min-height: 64px;
  flex: 0 0 76px;
  overflow: visible;
  line-height: 0;
}

.dm-call-message__icon-shell {
  position: absolute;
  left: 0;
  top: 2px;
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  box-sizing: border-box;
  border-radius: 50%;
  overflow: visible;
  border: 1px solid rgba(85, 225, 231, 0.58);
  background:
    radial-gradient(circle at 36% 28%, rgba(255, 255, 255, 0.08), transparent 45%),
    linear-gradient(145deg, rgba(23, 77, 105, 0.95), rgba(15, 45, 76, 0.98));
  color: var(--dm-call-accent);
  box-shadow:
    0 0 24px var(--dm-call-glow),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.dm-call-message--outgoing .dm-call-message__icon-shell {
  border-color: rgba(255, 151, 104, 0.58);
  background:
    radial-gradient(circle at 36% 28%, rgba(255, 255, 255, 0.08), transparent 45%),
    linear-gradient(145deg, rgba(91, 54, 47, 0.94), rgba(51, 35, 53, 0.98));
}

.dm-call-message__main-call-icon {
  display: block;
  width: 30px;
  height: 30px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.dm-call-message__handset-path {
  stroke-width: 1.75;
}

.dm-call-message__arrow-path {
  stroke-width: 2.2;
}

.dm-call-message--incoming .dm-call-message__main-call-icon {
  color: #55e1e7;
}

.dm-call-message--outgoing .dm-call-message__main-call-icon {
  color: #ff9768;
}

/* Legacy alias kept for older QA selectors; not rendered. */
.dm-call-message__phone-icon {
  display: none !important;
}

.dm-call-message__status-badge {
  position: absolute;
  right: 2px;
  bottom: 3px;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  box-sizing: border-box;
  margin: 0;
  transform: none;
  border-radius: 50%;
  z-index: 2;
  color: #ffffff;
  border: 2px solid rgba(14, 29, 54, 0.98);
  background: linear-gradient(145deg, #ff6b82, #e7385b);
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
  line-height: 0;
}

.dm-call-message__status-badge-icon {
  display: block;
  width: 11px;
  height: 11px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.dm-call-message--incoming .dm-call-message__status-badge--completed {
  background: linear-gradient(145deg, #5eeaf0, #2cb7c8);
  color: #092837;
}

.dm-call-message--outgoing .dm-call-message__status-badge--completed {
  background: linear-gradient(145deg, #ffac7c, #f47a4e);
  color: #3c160c;
}

.dm-call-message__status-badge--warning,
.dm-call-message__status-badge--missed,
.dm-call-message__status-badge--failed {
  background: linear-gradient(145deg, #ff6b82, #e7385b);
  color: #ffffff;
}

.dm-call-message__status-badge--declined {
  background: linear-gradient(145deg, #ff667d, #d83252);
  color: #ffffff;
}

.dm-call-message__status-badge--cancelled {
  background: linear-gradient(145deg, #aebbd0, #7f8ea7);
  color: #132033;
}

.dm-call-message__status-badge--busy {
  background: linear-gradient(145deg, #ff806d, #e55245);
  color: #ffffff;
}

.dm-call-message__body {
  min-width: 0;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  white-space: normal;
}

.dm-call-message__title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.dm-call-message__title {
  margin: 0;
  min-width: 0;
  color: rgba(247, 250, 255, 0.98);
  font-size: 16px;
  font-weight: 750;
  line-height: 1.25;
  letter-spacing: 0.01em;
  overflow-wrap: anywhere;
}

.dm-call-message__title--accent {
  color: #ff9bac;
}

.dm-call-message__time {
  flex: 0 0 auto;
  margin: 0;
  color: rgba(143, 183, 235, 0.88);
  font-size: 12px;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  padding-top: 2px;
  white-space: nowrap;
}

.dm-call-message__subtitle {
  margin: 0;
  min-width: 0;
  color: rgba(180, 199, 229, 0.88);
  font-size: 14px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.dm-call-message__duration {
  color: var(--dm-call-accent);
  font-weight: 700;
}

.dm-call-message:hover {
  border-color: var(--dm-call-border);
  box-shadow:
    0 16px 38px rgba(0, 0, 0, 0.28),
    0 0 22px var(--dm-call-glow),
    inset 0 1px 0 rgba(255, 255, 255, 0.055);
}

.bubble.bubble--dm-call.selected .dm-call-message,
.bubble.bubble--dm-call.bubble--msg-selected .dm-call-message,
.bubble.bubble--dm-call.bubble--forward-selected .dm-call-message {
  box-shadow:
    0 0 0 2px rgba(95, 157, 255, 0.72),
    0 14px 34px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.045);
}

.bubble.bubble--dm-call .meta.meta--dm-call {
  width: auto;
  max-width: 100%;
  padding: 4px 6px 0;
  min-height: 0;
  opacity: 0.9;
  background: transparent;
  align-self: flex-end;
}

.bubble.bubble--dm-call .meta.meta--dm-call[hidden] {
  display: none !important;
}

.bubble.bubble--dm-call .reaction-row {
  display: none;
}

@media (max-width: 560px) {
  .bubble.bubble--dm-call {
    max-width: min(390px, 100%);
  }

  .dm-call-message {
    width: min(100%, 390px);
    min-width: 0;
    grid-template-columns: 68px minmax(0, 1fr);
    gap: 12px;
    padding: 14px;
    min-height: 96px;
    border-radius: 18px;
  }

  .dm-call-message__visual {
    width: 68px;
    height: 54px;
    min-width: 68px;
    min-height: 54px;
    flex-basis: 68px;
  }

  .dm-call-message__icon-shell {
    left: 0;
    top: 1px;
    width: 52px;
    height: 52px;
  }

  .dm-call-message__main-call-icon {
    width: 26px;
    height: 26px;
  }

  .dm-call-message__handset-path {
    stroke-width: 1.8;
  }

  .dm-call-message__arrow-path {
    stroke-width: 2.25;
  }

  .dm-call-message__status-badge {
    right: 1px;
    bottom: 2px;
    width: 16px;
    height: 16px;
    transform: none;
  }

  .dm-call-message__status-badge-icon {
    width: 10px;
    height: 10px;
  }

  .dm-call-message__title {
    font-size: 15px;
  }

  .dm-call-message__subtitle {
    font-size: 13px;
    margin-top: 0;
  }

  .dm-call-message__time {
    font-size: 11px;
  }
}

@media (max-width: 360px) {
  .dm-call-message__title-row {
    flex-wrap: wrap;
  }

  .dm-call-message__time {
    width: 100%;
    padding-top: 0;
  }
}
