.intern-chat-launcher {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 60;
  width: 64px;
  height: 64px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #111827, #4f46e5);
  color: #fff;
  box-shadow: 0 16px 40px rgba(17, 24, 39, 0.28);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.intern-chat-launcher:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 20px 48px rgba(17, 24, 39, 0.34);
}

.intern-chat-panel {
  position: fixed;
  right: 24px;
  bottom: 100px;
  z-index: 60;
  width: min(380px, calc(100vw - 24px));
  height: min(620px, calc(100vh - 140px));
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(99, 102, 241, 0.18);
  border-radius: 24px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(16px);
}

.intern-chat-hidden {
  display: none;
}

.intern-chat-header {
  padding: 18px 20px 16px;
  background: linear-gradient(135deg, #111827, #312e81);
  color: #fff;
}

.intern-chat-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.intern-chat-close {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}

.intern-chat-connection {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 12px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.92);
}

.intern-chat-connection-dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #22c55e;
}

.intern-chat-connection-dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.22);
  animation: intern-chat-pulse 1.6s ease-out infinite;
}

.intern-chat-connection--offline .intern-chat-connection-dot {
  background: #ef4444;
}

.intern-chat-connection--offline .intern-chat-connection-dot::after {
  background: rgba(239, 68, 68, 0.22);
}

@keyframes intern-chat-pulse {
  0% {
    transform: scale(0.7);
    opacity: 0.9;
  }
  70% {
    transform: scale(1.8);
    opacity: 0;
  }
  100% {
    transform: scale(1.8);
    opacity: 0;
  }
}

.intern-chat-body {
  flex: 1;
  padding: 16px;
  background:
    radial-gradient(circle at top right, rgba(99, 102, 241, 0.08), transparent 38%),
    linear-gradient(180deg, #ffffff, #f8fafc);
  overflow-y: auto;
}

.intern-chat-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.intern-chat-preset {
  border: 1px solid #c7d2fe;
  border-radius: 999px;
  padding: 8px 12px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.intern-chat-message {
  max-width: 84%;
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.intern-chat-message--visitor {
  margin-left: auto;
  border-bottom-right-radius: 6px;
  background: #111827;
  color: #fff;
}

.intern-chat-message--operator {
  margin-right: auto;
  border-bottom-left-radius: 6px;
  background: #eef2ff;
  color: #1f2937;
}

.intern-chat-message--system {
  max-width: 100%;
  padding: 10px 12px;
  border-radius: 14px;
  background: #fef3c7;
  color: #78350f;
}

.intern-chat-form {
  border-top: 1px solid #e5e7eb;
  padding: 14px;
  background: #fff;
}

.intern-chat-input {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
}

.intern-chat-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.intern-chat-send {
  border: 0;
  border-radius: 16px;
  width: 48px;
  min-width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #111827;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.intern-chat-send:hover {
  transform: translateY(-1px);
  background: #312e81;
}

.intern-chat-send svg {
  width: 22px;
  height: 22px;
}

.intern-chat-status {
  margin-top: 10px;
  font-size: 12px;
  color: #6b7280;
  display: none;
}

@media (max-width: 640px) {
  .intern-chat-launcher {
    right: 16px;
    bottom: 16px;
  }

  .intern-chat-panel {
    right: 12px;
    bottom: 92px;
    width: calc(100vw - 24px);
    height: min(70vh, 560px);
  }
}
