.f5-sc-widget {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: var(--f5-sc-width, 420px);
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 6px 16px rgba(0,0,0,0.06);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

.f5-sc-header {
  padding: 12px 14px;
  background: var(--f5-sc-primary, #0ea5e9);
  color: #fff;
  font-weight: 600;
}

.f5-sc-messages {
  height: var(--f5-sc-height, 380px);
  overflow-y: auto;
  padding: 12px;
  background: linear-gradient(180deg, #f8fafc, #ffffff);
}

.f5-sc-message {
  padding: 10px 12px;
  margin-bottom: 10px;
  border-radius: 10px;
  line-height: 1.4;
  white-space: pre-wrap;
}

.f5-sc-message.user {
  background: #e0f2fe;
  align-self: flex-end;
  border: 1px solid #bae6fd;
}

.f5-sc-message.assistant {
  background: #ffffff;
  border: 1px solid #e5e7eb;
}

.f5-sc-message.assistant.typing {
  font-style: italic;
  color: #64748b;
}

.f5-sc-input {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid #e5e7eb;
  background: #fff;
}

.f5-sc-input input[type="text"] {
  flex: 1;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 10px 12px;
  outline: none;
}

.f5-sc-input button {
  background: var(--f5-sc-primary, #0ea5e9);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  cursor: pointer;
  transition: transform .05s ease, box-shadow .2s ease;
}

.f5-sc-input button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.f5-sc-input button:hover { box-shadow: 0 6px 12px rgba(14,165,233,.28); }
.f5-sc-input button:active { transform: translateY(1px); }

/* Floating button */
.f5-sc-fab {
  position: fixed;
  bottom: 20px;
  z-index: 9999;
  background: var(--f5-sc-primary, #0ea5e9);
  color: #fff;
  border-radius: 999px;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 20px rgba(0,0,0,0.15);
  cursor: pointer;
  user-select: none;
}
.f5-sc-fab--right { right: 20px; }
.f5-sc-fab--left { left: 20px; }
.f5-sc-fab-icon svg { display: block; }

.f5-sc-floating-panel {
  position: fixed;
  bottom: 80px;
  z-index: 9998;
  display: none;
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  transform-origin: bottom right;
  transition: opacity .22s ease, transform .22s ease;
  will-change: opacity, transform;
}
.f5-sc-floating-panel--right { right: 20px; }
.f5-sc-floating-panel--left { left: 20px; }

.f5-sc-floating-panel.open {
  display: block;
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Корректный центр трансформации в зависимости от стороны */
.f5-sc-floating-panel--left { transform-origin: bottom left; }

.f5-sc-floating-panel .f5-sc-widget {
  width: var(--f5-sc-width, 420px) !important;
  max-width: none !important;
  min-width: auto !important;
  flex-basis: var(--f5-sc-width, 420px) !important;
  flex-shrink: 0 !important;
  flex-grow: 0 !important;
}


