/* Floating dock + premium DM dropdown */

.ss-floating-dock {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: calc(20px + env(safe-area-inset-bottom));
  z-index: 1200;
  display: flex;
  flex-direction: row-reverse;
  align-items: flex-end;
  gap: var(--ss-fab-gap, 12px);
  pointer-events: none;
  top: auto;
  left: auto;
}

.ss-floating-dock > * {
  pointer-events: auto;
}

.ss-floating-dock__dm {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.ss-floating-dock .shadow-feedback-fab,
.ss-floating-dock .ss-quick-dm-fab {
  position: static;
  right: auto;
  bottom: auto;
  flex-shrink: 0;
}

.ss-quick-dm-fab {
  width: var(--ss-fab-dm-size, 54px);
  height: var(--ss-fab-dm-size, 54px);
  min-width: var(--ss-fab-dm-size, 54px);
  min-height: var(--ss-fab-dm-size, 54px);
  border: 1px solid rgba(85, 165, 255, 0.45);
  border-radius: 16px;
  color: #e9f4ff;
  background: linear-gradient(140deg, rgba(6, 16, 34, 0.96), rgba(15, 28, 54, 0.96));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    0 0 26px rgba(85, 165, 255, 0.2);
  font-size: 1.05rem;
  font-weight: 900;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition:
    transform 0.22s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.22s ease,
    border-color 0.22s ease,
    background 0.22s ease;
}

.ss-quick-dm-fab:hover,
.ss-quick-dm-fab:focus-visible,
.ss-quick-dm-fab.is-open {
  transform: translateY(-2px);
  border-color: rgba(0, 255, 159, 0.52);
  background: linear-gradient(140deg, rgba(10, 28, 52, 0.98), rgba(18, 36, 68, 0.98));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 0 22px rgba(0, 255, 159, 0.22),
    0 10px 28px rgba(0, 0, 0, 0.34);
  outline: none;
}

.ss-quick-dm-dropdown {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  z-index: 1212;
  width: min(400px, calc(100vw - 24px));
  max-height: min(70vh, 520px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  border: 1px solid color-mix(in srgb, var(--ss-theme-accent-2, #00f5ff) 28%, rgba(255, 255, 255, 0.12));
  border-radius: 18px;
  color: #eef6ff;
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02) 38%, transparent 100%),
    linear-gradient(145deg, rgba(6, 13, 26, 0.97), rgba(3, 8, 18, 0.98));
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.58),
    0 0 28px color-mix(in srgb, var(--ss-theme-accent-2, #00f5ff) 12%, transparent),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  overflow: hidden;
  transform-origin: bottom right;
  animation: ssQuickDmDropIn 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.ss-quick-dm-dropdown[hidden] {
  display: none;
}

@keyframes ssQuickDmDropIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.ss-quick-dm-dropdown__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 14px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.ss-quick-dm-dropdown__title-wrap {
  display: grid;
  gap: 2px;
}

.ss-quick-dm-dropdown__title-wrap strong {
  font-size: 0.96rem;
  letter-spacing: 0.01em;
}

.ss-quick-dm-dropdown__all {
  color: rgba(154, 216, 255, 0.88);
  font-size: 0.72rem;
  font-weight: 700;
  text-decoration: none;
}

.ss-quick-dm-dropdown__all:hover,
.ss-quick-dm-dropdown__all:focus-visible {
  color: #00ff9f;
  text-decoration: underline;
}

.ss-quick-dm-dropdown__close {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  color: #a8d2ff;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.ss-quick-dm-dropdown__close:hover,
.ss-quick-dm-dropdown__close:focus-visible {
  transform: scale(1.05);
  border-color: rgba(0, 255, 159, 0.42);
  color: #00ff9f;
  outline: none;
}

.ss-quick-dm-dropdown__body {
  min-height: 0;
  overflow: hidden;
  display: grid;
}

.ss-quick-dm-dropdown__contacts {
  margin: 0;
  padding: 8px;
  list-style: none;
  overflow: auto;
  max-height: min(52vh, 360px);
}

.ss-quick-dm-dropdown__contact-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.ss-quick-dm-dropdown__contact {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: #dceeff;
  background: rgba(255, 255, 255, 0.03);
  text-align: left;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease,
    box-shadow 0.18s ease;
}

.ss-quick-dm-dropdown__contact:hover,
.ss-quick-dm-dropdown__contact:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(85, 165, 255, 0.42);
  background: rgba(85, 165, 255, 0.1);
  box-shadow: 0 0 16px rgba(85, 165, 255, 0.12);
  outline: none;
}

.ss-quick-dm-dropdown__contact.is-active {
  border-color: rgba(0, 255, 159, 0.52);
  background: rgba(0, 255, 159, 0.1);
  box-shadow: 0 0 18px rgba(0, 255, 159, 0.14);
}

.ss-quick-dm-dropdown__avatar {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 900;
  color: #eef8ff;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.55), rgba(0, 245, 255, 0.35));
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.ss-quick-dm-dropdown__contact-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.ss-quick-dm-dropdown__contact-copy strong {
  display: block;
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ss-quick-dm-dropdown__contact-copy small {
  display: block;
  color: rgba(213, 229, 255, 0.72);
  font-size: 0.72rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ss-quick-dm-dropdown__contact-remove {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255, 120, 150, 0.34);
  border-radius: 999px;
  color: #ff8ca7;
  background: rgba(255, 120, 150, 0.08);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.16s ease, background 0.16s ease;
}

.ss-quick-dm-dropdown__contact-remove:hover,
.ss-quick-dm-dropdown__contact-remove:focus-visible {
  transform: scale(1.05);
  background: rgba(255, 120, 150, 0.16);
  outline: none;
}

.ss-quick-dm-dropdown__thread {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  padding: 8px;
}

.ss-quick-dm-dropdown__back {
  justify-self: start;
  margin-bottom: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(214, 229, 255, 0.9);
  padding: 6px 10px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}

.ss-quick-dm-dropdown__back:hover,
.ss-quick-dm-dropdown__back:focus-visible {
  border-color: rgba(0, 255, 159, 0.38);
  color: #00ff9f;
  outline: none;
}

.ss-quick-dm-dropdown__messages {
  margin: 0;
  padding: 4px 2px;
  list-style: none;
  overflow: auto;
  max-height: min(36vh, 260px);
}

.ss-quick-dm-dropdown__msg {
  margin-bottom: 7px;
  max-width: 92%;
  border-radius: 12px;
  padding: 8px 10px;
  font-size: 0.8rem;
  line-height: 1.4;
  color: #e5f0ff;
  background: rgba(255, 255, 255, 0.08);
}

.ss-quick-dm-dropdown__msg.is-me {
  margin-left: auto;
  color: #071018;
  background: linear-gradient(130deg, #59ffbf, #39e9ff);
}

.ss-quick-dm-dropdown__composer-wrap {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 8px;
  display: grid;
  gap: 8px;
}

.ss-quick-dm-dropdown__emoji-panel {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.24);
}

.ss-quick-dm-dropdown__emoji-panel button {
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 1.05rem;
  cursor: pointer;
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.ss-quick-dm-dropdown__emoji-panel button:hover,
.ss-quick-dm-dropdown__emoji-panel button:focus-visible {
  transform: scale(1.06);
  border-color: rgba(0, 255, 159, 0.38);
  background: rgba(0, 255, 159, 0.1);
  outline: none;
}

.ss-quick-dm-dropdown__composer {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.ss-quick-dm-dropdown__emoji-toggle {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 1.05rem;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease;
}

.ss-quick-dm-dropdown__emoji-toggle:hover,
.ss-quick-dm-dropdown__emoji-toggle:focus-visible,
.ss-quick-dm-dropdown__emoji-toggle[aria-expanded="true"] {
  transform: scale(1.04);
  border-color: rgba(0, 255, 159, 0.42);
  outline: none;
}

.ss-quick-dm-dropdown__composer input {
  min-height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  color: #e8f3ff;
  background: rgba(255, 255, 255, 0.04);
  padding: 0 12px;
}

.ss-quick-dm-dropdown__composer input:focus-visible {
  border-color: rgba(0, 255, 159, 0.42);
  box-shadow: 0 0 0 3px rgba(0, 255, 159, 0.12);
  outline: none;
}

.ss-quick-dm-dropdown__send {
  min-height: 40px;
  border: 0;
  border-radius: 12px;
  padding: 0 14px;
  color: #050508;
  background: linear-gradient(130deg, #00ff9f, #00f5ff 55%, #ff00ff);
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.16s ease, filter 0.16s ease;
}

.ss-quick-dm-dropdown__send:hover,
.ss-quick-dm-dropdown__send:focus-visible {
  transform: translateY(-1px);
  filter: brightness(1.05);
  outline: none;
}

.ss-quick-dm-dropdown__empty {
  padding: 14px 12px;
  color: rgba(214, 229, 255, 0.78);
  font-size: 0.78rem;
  line-height: 1.45;
}

.ss-quick-dm-dropdown__empty a {
  display: inline-block;
  margin-top: 6px;
  color: #00ff9f;
  font-weight: 700;
  text-decoration: none;
}

.ss-quick-dm-dropdown__empty a:hover {
  text-decoration: underline;
}

@media (max-width: 860px) {
  .ss-floating-dock {
    right: max(14px, env(safe-area-inset-right));
    bottom: calc(64px + env(safe-area-inset-bottom));
    gap: 10px;
  }

  .ss-quick-dm-fab {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    border-radius: 14px;
    font-size: 0.92rem;
  }

  .ss-quick-dm-dropdown {
    width: min(calc(100vw - 20px), 380px);
    max-height: min(68vh, 480px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ss-quick-dm-dropdown {
    animation: none;
  }
}
