/* Pool chat widget — Omni Data Pool tema */
.pool-chat-fab-wrap,
.pool-chat-fab,
.pool-chat-panel {
  --chat-anchor-right: 4.5rem;
  --chat-anchor-bottom: 5.5rem;
  --chat-radius: 18px;
  --chat-shadow: 0 20px 60px rgba(26, 43, 76, 0.22), 0 0 0 1px rgba(26, 43, 76, 0.06);
  --chat-navy: var(--navy, #1a2b4c);
  --chat-accent: var(--accent, #c9a227);
  --chat-accent-soft: var(--accent-soft, rgba(201, 162, 39, 0.14));
  --chat-muted: var(--muted, #64748b);
  --chat-line: var(--line, rgba(26, 43, 76, 0.12));
  --chat-surface: var(--surface, rgba(255, 255, 255, 0.96));
}

@keyframes pool-chat-panel-in {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes pool-chat-badge-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.08);
  }
}

@keyframes pool-chat-fab-glow {
  0%,
  100% {
    opacity: 0.6;
    transform: rotate(0deg) scale(1);
  }
  50% {
    opacity: 0.95;
    transform: rotate(180deg) scale(1.04);
  }
}

@keyframes pool-chat-fab-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

@keyframes magic-core-breathe {
  0%,
  100% {
    opacity: 0.45;
    transform: scale(0.92);
  }
  50% {
    opacity: 0.78;
    transform: scale(1.08);
  }
}

@keyframes magic-halo-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes magic-ring-pulse {
  0% {
    opacity: 0.65;
    transform: scale(1);
  }
  70% {
    opacity: 0;
    transform: scale(1.38);
  }
  100% {
    opacity: 0;
    transform: scale(1.38);
  }
}

@keyframes magic-orbit-travel {
  0% {
    transform: rotate(0deg) translateX(2.15rem) scale(0.85);
    opacity: 0.35;
  }
  25% {
    opacity: 1;
    transform: rotate(90deg) translateX(2.15rem) scale(1.15);
  }
  50% {
    opacity: 0.5;
    transform: rotate(180deg) translateX(2.15rem) scale(0.9);
  }
  75% {
    opacity: 1;
    transform: rotate(270deg) translateX(2.15rem) scale(1.1);
  }
  100% {
    transform: rotate(360deg) translateX(2.15rem) scale(0.85);
    opacity: 0.35;
  }
}

@keyframes magic-spark-twinkle {
  0%,
  100% {
    opacity: 0;
    transform: scale(0.4);
    filter: blur(0);
  }
  20% {
    opacity: 0.35;
    transform: scale(0.7);
  }
  45% {
    opacity: 1;
    transform: scale(1.2);
    filter: blur(0);
  }
  70% {
    opacity: 0.55;
    transform: scale(0.85);
    filter: blur(0.5px);
  }
}

@keyframes magic-ember-rise {
  0% {
    opacity: 0;
    transform: translateY(0) scale(0.5);
  }
  25% {
    opacity: 1;
    transform: translateY(-6px) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-22px) scale(0.3);
  }
}

@keyframes magic-shimmer-sweep {
  0% {
    background-position: 0 0, -120% 0;
  }
  50% {
    background-position: 0 0, 50% 0;
  }
  100% {
    background-position: 0 0, 220% 0;
  }
}

/* FAB wrap + magic aura */
.pool-chat-fab-wrap {
  --magic-gold: #c9a227;
  --magic-gold-bright: #f0d060;
  --magic-gold-soft: #ffe9a3;
  --magic-gold-glow: rgba(255, 200, 60, 0.55);
  --magic-gold-deep: rgba(168, 120, 20, 0.35);
  position: fixed;
  right: var(--chat-anchor-right);
  bottom: var(--chat-anchor-bottom);
  z-index: 9000;
  width: 4.5rem;
  height: 4.5rem;
  pointer-events: none;
  overflow: visible;
  animation: pool-chat-fab-float 5s ease-in-out infinite;
  transition: transform 0.55s cubic-bezier(0.34, 1.4, 0.64, 1);
}

.pool-chat-fab-wrap > .pool-chat-fab__badge {
  position: absolute;
  top: -3px;
  right: -3px;
  z-index: 10;
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: var(--danger, #c53030);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  text-align: center;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(197, 48, 48, 0.45);
  animation: pool-chat-badge-pulse 2s ease-in-out infinite;
  box-sizing: border-box;
}

.pool-chat-fab-wrap:hover {
  animation: none;
  transform: translateY(-6px);
}

.pool-chat-fab-wrap:active {
  transform: translateY(-2px);
  transition-duration: 0.12s;
}

.pool-chat-fab-wrap.hidden {
  display: none;
}

/* Aura layers (behind button) */
.pool-chat-fab-aura {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.pool-chat-fab-aura__core {
  position: absolute;
  inset: -28px;
  border-radius: 50%;
  background: radial-gradient(
    circle at 50% 50%,
    rgba(240, 208, 96, 0.72) 0%,
    rgba(201, 162, 39, 0.42) 38%,
    rgba(255, 233, 163, 0.18) 58%,
    transparent 72%
  );
  filter: blur(14px);
  animation: magic-core-breathe 3.2s ease-in-out infinite;
  will-change: transform, opacity;
}

.pool-chat-fab-aura__halo {
  position: absolute;
  inset: -18px;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    rgba(255, 233, 163, 0.15) 30deg,
    rgba(240, 208, 96, 0.75) 72deg,
    rgba(255, 255, 255, 0.55) 110deg,
    rgba(201, 162, 39, 0.65) 160deg,
    transparent 200deg,
    rgba(255, 220, 100, 0.35) 260deg,
    rgba(240, 208, 96, 0.8) 310deg,
    transparent 360deg
  );
  filter: blur(8px);
  opacity: 0.62;
  animation: magic-halo-spin 14s linear infinite;
  will-change: transform;
}

.pool-chat-fab-aura__ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1.5px solid rgba(240, 208, 96, 0.55);
  box-shadow:
    0 0 12px var(--magic-gold-glow),
    0 0 24px rgba(255, 200, 60, 0.25),
    inset 0 0 8px rgba(255, 233, 163, 0.2);
  animation: magic-ring-pulse 2.8s ease-out infinite;
  will-change: transform, opacity;
}

.pool-chat-fab-aura__ring--delay {
  inset: -6px;
  border-color: rgba(255, 233, 163, 0.4);
  animation-delay: 1.4s;
}

.pool-chat-fab-aura__orbit {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: radial-gradient(circle, #fffef5 0%, #f0d060 45%, transparent 70%);
  box-shadow:
    0 0 8px 3px rgba(255, 220, 100, 0.9),
    0 0 16px 6px rgba(201, 162, 39, 0.45);
  animation: magic-orbit-travel 6s linear infinite;
  will-change: transform, opacity;
}

/* Spark particles */
.pool-chat-fab-sparks {
  position: absolute;
  inset: -14px;
  pointer-events: none;
  z-index: 1;
}

.pool-chat-fab-spark {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff8d0 0%, #f0d060 55%, rgba(201, 162, 39, 0.6) 100%);
  box-shadow:
    0 0 6px 2px rgba(255, 210, 80, 0.9),
    0 0 12px 4px rgba(201, 162, 39, 0.35);
  animation: magic-spark-twinkle 2.6s ease-in-out infinite;
  will-change: transform, opacity;
}

.pool-chat-fab-spark--ember {
  width: 3px;
  height: 3px;
  animation:
    magic-spark-twinkle 2.2s ease-in-out infinite,
    magic-ember-rise 3.4s ease-out infinite;
}

.pool-chat-fab-spark:nth-child(1) {
  top: 2%;
  left: 48%;
  animation-duration: 2.1s;
  animation-delay: 0s;
}
.pool-chat-fab-spark:nth-child(2) {
  top: 14%;
  left: 82%;
  animation-duration: 2.8s;
  animation-delay: 0.6s;
}
.pool-chat-fab-spark:nth-child(3) {
  top: 48%;
  left: 96%;
  width: 5px;
  height: 5px;
  animation-duration: 3.1s;
  animation-delay: 1.2s;
}
.pool-chat-fab-spark:nth-child(4) {
  top: 82%;
  left: 78%;
  animation-duration: 2.4s;
  animation-delay: 0.3s;
}
.pool-chat-fab-spark:nth-child(5) {
  top: 94%;
  left: 46%;
  animation-duration: 3.4s;
  animation-delay: 1.8s;
}
.pool-chat-fab-spark:nth-child(6) {
  top: 78%;
  left: 12%;
  animation-duration: 2.6s;
  animation-delay: 0.9s;
}
.pool-chat-fab-spark:nth-child(7) {
  top: 44%;
  left: 0%;
  width: 5px;
  height: 5px;
  animation-duration: 2.9s;
  animation-delay: 2.1s;
}
.pool-chat-fab-spark:nth-child(8) {
  top: 10%;
  left: 14%;
  animation-delay: 0.4s;
}
.pool-chat-fab-spark:nth-child(9) {
  top: 28%;
  left: 6%;
  animation-delay: 1.5s;
}
.pool-chat-fab-spark:nth-child(10) {
  top: 62%;
  left: 90%;
  animation-delay: 2.7s;
}
.pool-chat-fab-spark--ember:nth-child(8) {
  animation-delay: 0.4s, 0s;
  animation-duration: 2.2s, 3.8s;
}
.pool-chat-fab-spark--ember:nth-child(9) {
  animation-delay: 1.5s, 1.2s;
  animation-duration: 2.2s, 4.2s;
}
.pool-chat-fab-spark--ember:nth-child(10) {
  animation-delay: 2.7s, 2.4s;
  animation-duration: 2.2s, 3.6s;
}

/* FAB button */
.pool-chat-fab {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  padding: 0;
  border: none;
  border-radius: 999px;
  isolation: isolate;
  pointer-events: auto;
  background:
    radial-gradient(circle at 32% 22%, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0) 42%),
    linear-gradient(155deg, #ffffff 0%, #f3f6fb 48%, #e6ebf4 100%);
  color: #fff;
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.95),
    inset 0 -10px 18px rgba(26, 43, 76, 0.07),
    0 1px 2px rgba(26, 43, 76, 0.05),
    0 6px 14px rgba(26, 43, 76, 0.1),
    0 16px 34px rgba(26, 43, 76, 0.14),
    0 0 0 1px rgba(255, 255, 255, 0.75),
    0 0 0 2px rgba(201, 162, 39, 0.32);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition:
    transform 0.55s cubic-bezier(0.34, 1.4, 0.64, 1),
    box-shadow 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform, box-shadow;
}

.pool-chat-fab::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  background: conic-gradient(
    from 180deg,
    rgba(201, 162, 39, 0) 0deg,
    rgba(240, 208, 96, 0.7) 55deg,
    rgba(255, 255, 255, 0.5) 100deg,
    rgba(255, 233, 163, 0.35) 150deg,
    rgba(201, 162, 39, 0.55) 220deg,
    rgba(255, 220, 100, 0.65) 290deg,
    rgba(201, 162, 39, 0) 360deg
  );
  filter: blur(7px);
  opacity: 0.7;
  z-index: -1;
  pointer-events: none;
  animation: pool-chat-fab-glow 7s ease-in-out infinite;
}

.pool-chat-fab::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    linear-gradient(
      165deg,
      rgba(255, 255, 255, 0.72) 0%,
      rgba(255, 255, 255, 0.08) 38%,
      rgba(26, 43, 76, 0.04) 100%
    ),
    linear-gradient(
      105deg,
      transparent 0%,
      rgba(255, 248, 208, 0) 35%,
      rgba(255, 248, 208, 0.75) 50%,
      rgba(255, 248, 208, 0) 65%,
      transparent 100%
    );
  background-size: 100% 100%, 60% 200%;
  background-position: 0 0, -120% 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
  pointer-events: none;
  z-index: 2;
  mix-blend-mode: soft-light;
  overflow: hidden;
  animation: magic-shimmer-sweep 4s ease-in-out infinite;
}

.pool-chat-fab-wrap:hover .pool-chat-fab {
  transform: scale(1.05);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 1),
    inset 0 -12px 20px rgba(26, 43, 76, 0.08),
    0 2px 4px rgba(26, 43, 76, 0.06),
    0 10px 22px rgba(26, 43, 76, 0.14),
    0 24px 48px rgba(26, 43, 76, 0.18),
    0 0 0 1px rgba(255, 255, 255, 0.85),
    0 0 0 2px rgba(201, 162, 39, 0.52),
    0 0 32px rgba(255, 200, 60, 0.35),
    0 0 56px rgba(201, 162, 39, 0.18);
}

.pool-chat-fab-wrap:hover .pool-chat-fab::before {
  opacity: 1;
  filter: blur(10px);
}

.pool-chat-fab-wrap:hover .pool-chat-fab-aura__core {
  opacity: 0.9;
  filter: blur(16px);
  animation-duration: 2.4s;
}

.pool-chat-fab-wrap:hover .pool-chat-fab-aura__halo {
  opacity: 0.88;
  filter: blur(10px);
  animation-duration: 10s;
}

.pool-chat-fab-wrap:hover .pool-chat-fab-aura__ring {
  border-color: rgba(255, 233, 163, 0.75);
  box-shadow:
    0 0 18px var(--magic-gold-glow),
    0 0 36px rgba(255, 200, 60, 0.35);
}

.pool-chat-fab-wrap:hover .pool-chat-fab-spark {
  animation-duration: 1.6s;
}

.pool-chat-fab-wrap:active .pool-chat-fab {
  transform: scale(0.97);
  transition-duration: 0.12s;
  box-shadow:
    inset 0 2px 8px rgba(26, 43, 76, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    0 4px 12px rgba(26, 43, 76, 0.16),
    0 0 0 2px rgba(201, 162, 39, 0.38);
}

.pool-chat-fab-wrap:active .pool-chat-fab-aura__core {
  transform: scale(0.88);
  opacity: 0.55;
}

.pool-chat-fab:focus-visible {
  outline: none;
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.95),
    0 16px 34px rgba(26, 43, 76, 0.14),
    0 0 0 3px rgba(201, 162, 39, 0.55),
    0 0 0 5px rgba(201, 162, 39, 0.18);
}

.pool-chat-fab__icon {
  position: relative;
  z-index: 3;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.12);
  filter: drop-shadow(0 3px 6px rgba(26, 43, 76, 0.14));
  transition: filter 0.45s ease, transform 0.45s cubic-bezier(0.34, 1.4, 0.64, 1);
}

.pool-chat-fab-wrap:hover .pool-chat-fab__icon {
  transform: scale(1.14);
  filter: drop-shadow(0 6px 12px rgba(26, 43, 76, 0.18)) drop-shadow(0 0 8px rgba(255, 200, 60, 0.25));
}

.pool-chat-fab svg:not(.pool-chat-fab__icon) {
  width: 1.5rem;
  height: 1.5rem;
}

@media (prefers-reduced-motion: reduce) {
  .pool-chat-fab-wrap,
  .pool-chat-fab,
  .pool-chat-fab::before,
  .pool-chat-fab::after,
  .pool-chat-fab-aura__core,
  .pool-chat-fab-aura__halo,
  .pool-chat-fab-aura__ring,
  .pool-chat-fab-aura__orbit,
  .pool-chat-fab-spark {
    animation: none !important;
  }

  .pool-chat-fab-wrap {
    transform: none;
  }

  .pool-chat-fab-aura__core {
    opacity: 0.5;
    transform: scale(1);
  }

  .pool-chat-fab-aura__halo {
    opacity: 0.4;
  }

  .pool-chat-fab-aura__ring {
    opacity: 0.35;
    transform: scale(1.12);
  }

  .pool-chat-fab-aura__orbit,
  .pool-chat-fab-spark {
    opacity: 0;
  }

  .pool-chat-fab-wrap,
  .pool-chat-fab,
  .pool-chat-fab__icon {
    transition-duration: 0.01ms;
  }
}

/* Panel */
.pool-chat-panel {
  position: fixed;
  right: var(--chat-anchor-right);
  bottom: var(--chat-anchor-bottom);
  z-index: 9001;
  width: min(30rem, calc(100vw - 2.5rem));
  height: min(38rem, calc(100vh - 7rem));
  display: flex;
  flex-direction: column;
  border-radius: var(--chat-radius);
  background: var(--chat-surface);
  border: 1px solid var(--surface-border, rgba(26, 43, 76, 0.1));
  box-shadow: var(--chat-shadow);
  backdrop-filter: var(--glass-blur, blur(20px));
  -webkit-backdrop-filter: var(--glass-blur, blur(20px));
  overflow: hidden;
  animation: pool-chat-panel-in 0.22s ease-out;
}

.pool-chat-panel.hidden {
  display: none;
}

/* Header */
.pool-chat-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: linear-gradient(135deg, #0f1a30 0%, #1a2b4c 50%, #243a5e 100%);
  border-bottom: 2px solid rgba(201, 162, 39, 0.35);
  flex-shrink: 0;
}

.pool-chat-panel__head-text {
  min-width: 0;
  flex: 1;
}

.pool-chat-panel__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pool-chat-panel__subtitle {
  margin: 0.15rem 0 0;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.65);
  font-weight: 500;
}

.pool-chat-panel__actions {
  display: flex;
  gap: 0.25rem;
  flex-shrink: 0;
}

.pool-chat-icon-btn {
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.85);
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}

.pool-chat-icon-btn svg {
  width: 1.1rem;
  height: 1.1rem;
}

.pool-chat-icon-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.pool-chat-icon-btn--danger:hover {
  background: rgba(197, 48, 48, 0.35);
  color: #fecaca;
}

.pool-chat-icon-btn.hidden {
  display: none;
}

/* Body layout */
.pool-chat-body {
  flex: 1;
  display: flex;
  min-height: 0;
}

/* Sidebar */
.pool-chat-threads {
  width: 42%;
  min-width: 9.5rem;
  max-width: 12.5rem;
  border-right: 1px solid var(--chat-line);
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: rgba(26, 43, 76, 0.03);
}

.pool-chat-threads__label {
  margin: 0;
  padding: 0.55rem 0.75rem 0.25rem;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--chat-muted);
}

.pool-chat-threads__new {
  padding: 0.35rem 0.65rem 0.55rem;
}

.pool-chat-threads__new button,
.pool-chat-btn-outline {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.45rem 0.6rem;
  border-radius: 10px;
  border: 1.5px solid rgba(201, 162, 39, 0.45);
  background: var(--chat-accent-soft);
  cursor: pointer;
  color: var(--chat-navy);
  font-family: inherit;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.pool-chat-threads__new button:hover,
.pool-chat-btn-outline:hover {
  background: rgba(201, 162, 39, 0.22);
  border-color: var(--chat-accent);
}

.pool-chat-threads__new button svg {
  width: 0.9rem;
  height: 0.9rem;
  flex-shrink: 0;
}

.pool-chat-threads__list {
  flex: 1;
  overflow-y: auto;
  list-style: none;
  margin: 0;
  padding: 0.2rem 0.4rem 0.5rem;
}

.pool-chat-threads__list > li {
  margin-bottom: 0.2rem;
}

.pool-chat-thread-item {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  border-radius: 12px;
  border-left: 3px solid transparent;
  transition: background 0.15s ease;
}

.pool-chat-thread-item:hover {
  background: rgba(26, 43, 76, 0.06);
}

.pool-chat-thread-item--active {
  background: var(--chat-accent-soft);
  border-left-color: var(--chat-accent);
}

.pool-chat-thread-item__row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.45rem;
  min-width: 0;
}

.pool-chat-thread-item__avatar {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(145deg, #2c5282, #1a2b4c);
  overflow: hidden;
}

.pool-chat-thread-item__avatar--photo {
  background: #e8ecf2;
}

.pool-chat-thread-item__avatar--photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pool-chat-thread-item--team .pool-chat-thread-item__avatar--team {
  background: linear-gradient(145deg, #c9a227, #a8861e);
  color: #1a2b4c;
}

.pool-chat-thread-item__avatar svg {
  width: 1rem;
  height: 1rem;
}

.pool-chat-thread-item__text {
  flex: 1;
  min-width: 0;
}

.pool-chat-thread-item__name {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--chat-navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pool-chat-thread-item__preview {
  display: block;
  font-size: 0.68rem;
  color: var(--chat-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0.1rem;
}

.pool-chat-thread-item__badge {
  flex-shrink: 0;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: var(--chat-accent);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1.15rem;
  text-align: center;
}

/* Main chat area */
.pool-chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  position: relative;
}

.pool-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  background:
    radial-gradient(circle at 20% 10%, rgba(201, 162, 39, 0.04) 0%, transparent 45%),
    radial-gradient(circle at 80% 90%, rgba(26, 43, 76, 0.04) 0%, transparent 40%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.5) 0%, rgba(238, 241, 246, 0.3) 100%);
}

.pool-chat-empty {
  margin: auto;
  text-align: center;
  color: #94a3b8;
  font-size: 0.85rem;
  padding: 1.5rem 1rem;
  line-height: 1.5;
}

/* Typing indicator strip (between messages and compose) */
.pool-chat-typing {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 1.55rem;
  padding: 0.2rem 1rem 0.35rem;
  border-top: 1px solid transparent;
  background: rgba(255, 255, 255, 0.88);
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.2;
}

.pool-chat-typing.hidden {
  display: none;
}

.pool-chat-typing__label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pool-chat-typing__dots {
  display: inline-flex;
  align-items: center;
  gap: 0.18rem;
  flex-shrink: 0;
}

.pool-chat-typing__dots i {
  width: 0.28rem;
  height: 0.28rem;
  border-radius: 999px;
  background: #94a3b8;
  opacity: 0.35;
  animation: pool-chat-typing-dot 1.1s ease-in-out infinite;
}

.pool-chat-typing__dots i:nth-child(2) {
  animation-delay: 0.15s;
}

.pool-chat-typing__dots i:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes pool-chat-typing-dot {
  0%,
  80%,
  100% {
    opacity: 0.3;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-0.12rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .pool-chat-typing__dots i {
    animation: none;
    opacity: 0.7;
  }
}

/* Message bubbles */
/* Message rows + bubbles */
.pool-chat-msg {
  display: flex;
  align-items: flex-end;
  gap: 0.45rem;
  max-width: 92%;
}

.pool-chat-msg--in {
  align-self: flex-start;
}

.pool-chat-msg--out {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.pool-chat-msg__avatar {
  flex-shrink: 0;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.58rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(145deg, #2c5282, #1a2b4c);
  overflow: hidden;
  margin-bottom: 0.15rem;
}

.pool-chat-msg__avatar--photo {
  background: #e8ecf2;
}

.pool-chat-msg__avatar--photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pool-chat-bubble {
  max-width: 100%;
  min-width: 0;
  flex: 1;
  padding: 0.55rem 0.75rem;
  border-radius: 14px;
  font-size: 0.875rem;
  line-height: 1.45;
  word-break: break-word;
}

.pool-chat-bubble--in {
  background: #fff;
  color: var(--chat-navy);
  border: 1px solid rgba(26, 43, 76, 0.1);
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 8px rgba(26, 43, 76, 0.06);
}

.pool-chat-bubble--out {
  background: linear-gradient(145deg, #1a2b4c 0%, #2c5282 100%);
  color: #fff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 14px rgba(26, 43, 76, 0.2);
}

.pool-chat-bubble__sender {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--chat-accent);
  margin-bottom: 0.2rem;
}

.pool-chat-bubble__body {
  white-space: pre-wrap;
}

.pool-chat-bubble__meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  margin-top: 0.3rem;
  font-size: 0.65rem;
  opacity: 0.8;
}

.pool-chat-bubble--in .pool-chat-bubble__meta {
  justify-content: flex-start;
}

.pool-chat-seen {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  margin-left: 0.25rem;
}

.pool-chat-seen--partial .pool-chat-seen__avatar {
  opacity: 0.92;
}

.pool-chat-seen__avatars {
  display: inline-flex;
  align-items: center;
  flex-direction: row-reverse;
  justify-content: flex-end;
}

.pool-chat-seen__avatar {
  flex-shrink: 0;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.48rem;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  background: linear-gradient(145deg, #2c5282, #1a2b4c);
  border: 1.5px solid rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 0 1px rgba(26, 43, 76, 0.15);
  overflow: hidden;
  margin-left: -0.3rem;
  cursor: default;
}

.pool-chat-seen__avatars .pool-chat-seen__avatar:last-child {
  margin-left: 0;
}

.pool-chat-seen__avatar--photo {
  background: #e8ecf2;
}

.pool-chat-seen__avatar--photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pool-chat-seen__avatar--more {
  background: rgba(15, 23, 42, 0.75);
  font-size: 0.45rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.pool-chat-delivery {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1;
}

.pool-chat-delivery__icon {
  width: 0.95rem;
  height: 0.95rem;
  display: block;
}

.pool-chat-delivery__icon--double {
  width: 1.15rem;
}

.pool-chat-delivery--sending {
  color: rgba(255, 255, 255, 0.72);
  animation: pool-chat-delivery-pulse 1.1s ease-in-out infinite;
}

.pool-chat-bubble--out.pool-chat-bubble--has-image .pool-chat-delivery--sending,
.pool-chat-bubble--out:not(.pool-chat-bubble--has-image) .pool-chat-delivery--sending {
  color: rgba(255, 255, 255, 0.72);
}

.pool-chat-delivery--sent {
  color: rgba(255, 255, 255, 0.82);
}

.pool-chat-delivery--read {
  color: #7dd3fc;
}

.pool-chat-delivery--failed {
  color: #fecaca;
  font-weight: 700;
  font-size: 0.75rem;
}

@keyframes pool-chat-delivery-pulse {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
}

/* Compose attachments */
.pool-chat-attach-preview-wrap {
  padding: 0 0.85rem 0.35rem;
}

.pool-chat-attach-preview {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.55rem;
  border-radius: 10px;
  background: rgba(26, 43, 76, 0.05);
  border: 1px solid rgba(26, 43, 76, 0.08);
}

.pool-chat-attach-preview--error {
  border-color: rgba(220, 38, 38, 0.35);
  background: rgba(254, 242, 242, 0.9);
}

.pool-chat-attach-preview__thumb {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}

.pool-chat-attach-preview__name {
  flex: 1;
  min-width: 0;
  font-size: 0.78rem;
  color: var(--chat-navy);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pool-chat-attach-preview__error {
  display: block;
  font-size: 0.72rem;
  color: #b91c1c;
}

.pool-chat-attach-preview__remove {
  flex-shrink: 0;
  width: 1.6rem;
  height: 1.6rem;
  border: none;
  border-radius: 999px;
  background: rgba(26, 43, 76, 0.08);
  color: var(--chat-navy);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.pool-chat-compose--dragover .pool-chat-compose__bar {
  border-color: rgba(59, 130, 246, 0.55);
  background: rgba(239, 246, 255, 0.85);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.pool-chat-compose__clip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--chat-muted);
  cursor: pointer;
  padding: 0;
}

.pool-chat-compose__clip:hover {
  color: var(--chat-navy);
  background: rgba(26, 43, 76, 0.06);
}

.pool-chat-compose__clip svg {
  width: 1.1rem;
  height: 1.1rem;
}

.pool-chat-bubble--has-image .pool-chat-bubble__body {
  margin-top: 0.35rem;
}

.pool-chat-bubble__image {
  display: block;
  width: 100%;
  max-width: 220px;
  padding: 0;
  border: none;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.06);
  line-height: 0;
}

.pool-chat-bubble__image img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 280px;
  object-fit: cover;
}

.pool-chat-bubble__image-loading,
.pool-chat-bubble__image-error {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 4rem;
  font-size: 0.75rem;
  color: var(--chat-muted);
}

.pool-chat-bubble--out .pool-chat-bubble__image {
  background: rgba(255, 255, 255, 0.12);
}

.pool-chat-bubble__image--pending {
  position: relative;
}

.pool-chat-bubble__image--pending img {
  opacity: 0.88;
}

.pool-chat-bubble__image-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  animation: pool-chat-image-upload 1.1s ease-in-out infinite;
}

@keyframes pool-chat-image-upload {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.pool-chat-toast {
  position: absolute;
  bottom: 0.75rem;
  left: 50%;
  transform: translateX(-50%) translateY(calc(100% + 2rem));
  z-index: 20;
  margin: 0;
  padding: 0.55rem 0.9rem;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.92);
  color: #fff;
  font-size: 0.78rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    transform 0.25s ease,
    opacity 0.2s ease,
    visibility 0s linear 0.25s;
}

.pool-chat-toast--visible {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
  transition:
    transform 0.25s ease,
    opacity 0.2s ease,
    visibility 0s;
}

/* Compose */
.pool-chat-compose {
  padding: 0.7rem 0.85rem 0.85rem;
  border-top: 1px solid var(--chat-line);
  background: rgba(255, 255, 255, 0.92);
  flex-shrink: 0;
}

.pool-chat-compose__bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.28rem 0.32rem 0.28rem 0.8rem;
  background: #fff;
  border: 1.5px solid rgba(26, 43, 76, 0.1);
  border-radius: 999px;
  box-shadow: 0 2px 10px rgba(26, 43, 76, 0.05);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.pool-chat-compose__bar:focus-within {
  border-color: rgba(201, 162, 39, 0.5);
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.12);
}

.pool-chat-compose textarea {
  flex: 1;
  min-width: 0;
  width: 100%;
  resize: none;
  min-height: 2.25rem;
  max-height: 5.5rem;
  border: none;
  border-radius: 0;
  padding: 0.45rem 0;
  font-family: inherit;
  font-size: 0.875rem;
  line-height: 1.4;
  background: transparent;
  color: var(--chat-navy);
}

.pool-chat-compose textarea:focus {
  outline: none;
}

.pool-chat-compose textarea::placeholder {
  color: #94a3b8;
}

.pool-chat-compose__send {
  flex-shrink: 0;
  align-self: center;
  width: 2.55rem;
  height: 2.55rem;
  border: none;
  border-radius: 999px;
  padding: 0;
  background: linear-gradient(145deg, #1a2b4c, #2c5282);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(26, 43, 76, 0.22);
  transition: transform 0.15s ease, opacity 0.15s ease, box-shadow 0.15s ease;
}

.pool-chat-compose__send svg {
  width: 1.05rem;
  height: 1.05rem;
  display: block;
  margin: 0 auto;
}

.pool-chat-compose__send:hover:not(:disabled) {
  transform: scale(1.04);
  box-shadow: 0 4px 14px rgba(26, 43, 76, 0.28);
}

.pool-chat-compose__send:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.pool-chat-compose__send-label {
  display: none;
}

/* DM picker overlay */
.pool-chat-picker {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.98);
  z-index: 2;
  display: flex;
  flex-direction: column;
  padding: 0.75rem;
  backdrop-filter: blur(8px);
}

.pool-chat-picker.hidden {
  display: none;
}

.pool-chat-picker__title {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--chat-navy);
}

.pool-chat-picker__search-wrap {
  position: relative;
  margin-bottom: 0.5rem;
}

.pool-chat-picker__search-wrap svg {
  position: absolute;
  left: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  width: 0.95rem;
  height: 0.95rem;
  color: var(--chat-muted);
  pointer-events: none;
}

.pool-chat-picker input {
  width: 100%;
  border: 1.5px solid rgba(26, 43, 76, 0.12);
  border-radius: 12px;
  padding: 0.5rem 0.65rem 0.5rem 2.1rem;
  font-size: 0.85rem;
  font-family: inherit;
  background: #fff;
}

.pool-chat-picker input:focus {
  outline: none;
  border-color: rgba(201, 162, 39, 0.55);
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.12);
}

.pool-chat-picker__list {
  flex: 1;
  overflow-y: auto;
  list-style: none;
  margin: 0;
  padding: 0;
}

.pool-chat-picker__list > li {
  margin-bottom: 0.15rem;
}

.pool-chat-picker__user {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  text-align: left;
  border: none;
  background: transparent;
  padding: 0.5rem 0.45rem;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.85rem;
  font-family: inherit;
  color: var(--chat-navy);
}

.pool-chat-picker__user:hover {
  background: rgba(26, 43, 76, 0.06);
}

.pool-chat-picker__user-avatar {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(145deg, #2c5282, #1a2b4c);
  overflow: hidden;
}

.pool-chat-picker__user-avatar--photo {
  background: #e8ecf2;
}

.pool-chat-picker__user-avatar--photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pool-chat-picker__footer {
  margin-top: 0.5rem;
  flex-shrink: 0;
}

@media (max-width: 480px) {
  .pool-chat-fab-wrap,
  .pool-chat-fab,
  .pool-chat-panel {
    --chat-anchor-right: 1.25rem;
    --chat-anchor-bottom: 4rem;
  }

  .pool-chat-panel {
    left: 1.25rem;
    width: auto;
    height: min(88vh, 38rem);
  }

  .pool-chat-threads {
    width: 38%;
    min-width: 7.5rem;
  }
}
