/* SmileFemto embeddable chat widget — scoped under #sfc-root */
#sfc-root,
#sfc-root * {
  box-sizing: border-box;
}

#sfc-root {
  --sfc-primary: #0d9488;
  --sfc-primary-dark: #0f766e;
  --sfc-bg: #ffffff;
  --sfc-surface: #f0fdfa;
  --sfc-text: #134e4a;
  --sfc-muted: #5f7a78;
  --sfc-shadow: 0 12px 40px rgba(15, 118, 110, 0.22);
  --sfc-radius: 16px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  z-index: 2147483000;
  position: fixed;
  bottom: 20px;
  right: 20px;
}

#sfc-root.sfc-left {
  right: auto;
  left: 20px;
}

#sfc-launcher {
  width: 60px;
  height: 60px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--sfc-primary) 0%, var(--sfc-primary-dark) 100%);
  color: #fff;
  cursor: pointer;
  box-shadow: var(--sfc-shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#sfc-launcher:hover {
  transform: scale(1.05);
}

#sfc-launcher svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
}

#sfc-panel {
  display: none;
  flex-direction: column;
  position: absolute;
  bottom: 76px;
  right: 0;
  width: min(380px, calc(100vw - 32px));
  height: min(520px, calc(100vh - 120px));
  background: var(--sfc-bg);
  border-radius: var(--sfc-radius);
  box-shadow: var(--sfc-shadow);
  overflow: hidden;
  border: 1px solid rgba(13, 148, 136, 0.15);
}

#sfc-root.sfc-left #sfc-panel {
  right: auto;
  left: 0;
}

#sfc-root.sfc-open #sfc-panel {
  display: flex;
}

#sfc-root.sfc-open #sfc-launcher {
  transform: scale(0.95);
}

#sfc-header {
  background: linear-gradient(135deg, var(--sfc-primary) 0%, var(--sfc-primary-dark) 100%);
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

#sfc-header-text {
  flex: 1;
  min-width: 0;
}

#sfc-title {
  font-weight: 600;
  font-size: 16px;
  margin: 0;
}

#sfc-subtitle {
  font-size: 12px;
  opacity: 0.9;
  margin: 2px 0 0;
}

#sfc-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

#sfc-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  background: var(--sfc-surface);
}

.sfc-msg {
  margin-bottom: 10px;
  display: flex;
}

.sfc-msg-user {
  justify-content: flex-end;
}

.sfc-bubble {
  max-width: 88%;
  padding: 10px 14px;
  border-radius: 14px;
  word-wrap: break-word;
  white-space: pre-wrap;
}

#sfc-root .sfc-bubble a {
  color: var(--sfc-primary-dark);
  text-decoration: underline;
  word-break: break-all;
}

#sfc-root .sfc-bubble a:hover {
  color: var(--sfc-primary);
}

.sfc-msg-bot .sfc-bubble {
  background: #fff;
  color: var(--sfc-text);
  border: 1px solid rgba(13, 148, 136, 0.12);
  border-bottom-left-radius: 4px;
}

.sfc-msg-user .sfc-bubble {
  background: var(--sfc-primary);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.sfc-msg-system .sfc-bubble {
  background: #fef3c7;
  color: #92400e;
  font-size: 13px;
  max-width: 100%;
}

.sfc-typing .sfc-bubble {
  color: var(--sfc-muted);
  font-style: italic;
}

#sfc-footer {
  padding: 10px 12px 12px;
  background: #fff;
  border-top: 1px solid rgba(13, 148, 136, 0.1);
}

#sfc-form {
  display: flex;
  gap: 8px;
}

#sfc-input {
  flex: 1;
  border: 1px solid rgba(13, 148, 136, 0.25);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  color: var(--sfc-text);
  resize: none;
  min-height: 42px;
  max-height: 100px;
}

#sfc-input:focus {
  outline: 2px solid rgba(13, 148, 136, 0.35);
  border-color: var(--sfc-primary);
}

#sfc-send {
  border: none;
  border-radius: 10px;
  background: var(--sfc-primary);
  color: #fff;
  padding: 0 16px;
  font-weight: 600;
  cursor: pointer;
  min-width: 72px;
}

#sfc-send:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

#sfc-disclaimer {
  font-size: 11px;
  color: var(--sfc-muted);
  margin-top: 8px;
  text-align: center;
}

@media (max-width: 480px) {
  #sfc-root {
    bottom: 12px;
    right: 12px;
  }

  #sfc-panel {
    width: calc(100vw - 24px);
    height: min(70vh, 480px);
  }
}
