.reception-widget-root {
  position: relative;
  z-index: 9998;
}

.reception-widget-toggle {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 9998;
  width: 60px;
  height: 60px;
  padding: 0;
  border: none;
  border-radius: 9999px;
  background: #fff;
  cursor: pointer;
  box-shadow: 0 12px 32px rgb(195 3 25 / 0.28);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.reception-widget-root.is-panel-open .reception-widget-toggle {
  transform: scale(0);
  opacity: 0;
  pointer-events: none;
}

.reception-widget-toggle-avatar {
  width: 100%;
  height: 100%;
  border-radius: 9999px;
  object-fit: cover;
  display: block;
}

.reception-online-dot {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 9999px;
  background: #22c55e;
  border: 2px solid #fff;
  box-sizing: border-box;
}

.reception-online-dot--toggle {
  right: 2px;
  bottom: 2px;
}

.reception-online-dot--header {
  right: 0;
  bottom: 0;
}

.reception-online-dot::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 9999px;
  border: 2px solid rgba(34, 197, 94, 0.55);
  animation: reception-online-pulse 1.6s ease-out infinite;
}

.reception-widget-root:not(.is-online) .reception-online-dot {
  background: #94a3b8;
}

.reception-widget-root:not(.is-online) .reception-online-dot::after {
  border-color: rgba(148, 163, 184, 0.45);
  animation: none;
}

@keyframes reception-online-pulse {
  0% {
    transform: scale(0.75);
    opacity: 0.9;
  }
  100% {
    transform: scale(1.7);
    opacity: 0;
  }
}

.reception-widget-toggle.is-alerting {
  animation: reception-toggle-alert 0.85s ease;
}

@keyframes reception-toggle-alert {
  0%,
  100% {
    transform: scale(1);
  }
  18% {
    transform: scale(1.2);
  }
  36% {
    transform: scale(0.92);
  }
  54% {
    transform: scale(1.14);
  }
  72% {
    transform: scale(0.96);
  }
}

@media (prefers-reduced-motion: reduce) {
  .reception-widget-toggle.is-alerting {
    animation: none;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.35);
  }
}

.reception-widget-panel {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 9999;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 520px;
  max-height: calc(100vh - 48px);
  display: none;
  flex-direction: column;
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.2);
  transform-origin: right bottom;
}

.reception-widget-panel.is-open {
  display: flex;
  animation: reception-panel-in 0.32s ease;
}

@keyframes reception-panel-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.reception-widget-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 14px;
  background: linear-gradient(135deg, var(--brand-black, #111928), var(--brand-red, #c30319));
  color: #fff;
}

.reception-widget-header-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.reception-widget-header-avatar-wrap {
  position: relative;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
}

.reception-widget-header-avatar {
  width: 48px;
  height: 48px;
  border-radius: 9999px;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.85);
  background: #fff;
}

.reception-widget-header-text {
  min-width: 0;
}

.reception-widget-header-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.reception-widget-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
}

.reception-online-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.16);
  font-size: 11px;
  line-height: 1.4;
}

.reception-widget-root.is-online .reception-online-label {
  background: rgba(34, 197, 94, 0.22);
}

.reception-widget-header p {
  margin: 6px 0 0;
  font-size: 12px;
  opacity: 0.92;
  line-height: 1.45;
}

.reception-widget-close {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.reception-widget-close:hover {
  background: rgba(255, 255, 255, 0.28);
}

.reception-widget-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}

.reception-widget-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-bottom: 14px;
}

.reception-widget-row.is-visitor {
  flex-direction: row-reverse;
}

.reception-widget-row.is-system {
  justify-content: center;
}

.reception-widget-avatar {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 9999px;
  object-fit: cover;
  background: #fff;
  border: 1px solid #e2e8f0;
}

.reception-widget-row.is-system .reception-widget-avatar {
  display: none;
}

.reception-widget-bubble {
  max-width: calc(100% - 46px);
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.55;
  word-break: break-word;
}

.reception-widget-row.is-visitor .reception-widget-bubble {
  background: #2563eb;
  color: #fff;
  border-bottom-right-radius: 4px;
}

.reception-widget-row.is-staff .reception-widget-bubble {
  background: #fff;
  color: #0f172a;
  border: 1px solid #e2e8f0;
  border-bottom-left-radius: 4px;
}

.reception-widget-row.is-system .reception-widget-bubble {
  max-width: 92%;
  background: #fdf2f3;
  color: var(--brand-red, #c30319);
  border: 1px solid rgb(195 3 25 / 15%);
  text-align: center;
  font-size: 13px;
}

.reception-widget-message-meta {
  margin-top: 4px;
  font-size: 11px;
  opacity: 0.72;
}

.reception-widget-footer {
  padding: 12px 14px 14px;
  border-top: 1px solid #e2e8f0;
  background: #fff;
}

.reception-widget-input-row {
  display: flex;
  gap: 8px;
}

.reception-widget-input-row input {
  flex: 1;
  height: 42px;
  padding: 0 12px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  font-size: 14px;
  outline: none;
}

.reception-widget-input-row input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.reception-widget-input-row button {
  min-width: 72px;
  height: 42px;
  border: none;
  border-radius: 12px;
  background: #2563eb;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
}

.reception-widget-input-row button:hover {
  background: #1d4ed8;
}

.reception-widget-status {
  margin-top: 8px;
  font-size: 12px;
  color: #64748b;
}

@media (max-width: 480px) {
  .reception-widget-panel {
    right: 12px;
    left: 12px;
    bottom: 12px;
    width: auto;
    height: calc(100vh - 24px);
    max-height: calc(100vh - 24px);
  }

  .reception-widget-toggle {
    right: 16px;
    bottom: 16px;
  }
}
