.smartychat-root {
  --smartychat-color: #0b7a75;
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9998;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.smartychat-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 999px;
  background: var(--smartychat-color);
  color: #fff;
  padding: 12px 18px;
  cursor: pointer;
  box-shadow: 0 16px 40px rgba(11, 122, 117, 0.24);
}

.smartychat-toggle-icon {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  font-weight: 700;
}

.smartychat-panel {
  width: min(380px, calc(100vw - 24px));
  height: min(560px, calc(100vh - 120px));
  display: none;
  flex-direction: column;
  overflow: hidden;
  background: #ffffff;
  border-radius: 22px;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.2);
  border: 1px solid rgba(15, 23, 42, 0.08);
  margin-top: 12px;
}

.smartychat-root.is-open .smartychat-panel {
  display: flex;
}

.smartychat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  background: linear-gradient(135deg, var(--smartychat-color), #123f52);
  color: #fff;
}

.smartychat-subtitle {
  font-size: 12px;
  opacity: 0.8;
}

.smartychat-close {
  border: 0;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
}

.smartychat-consent {
  padding: 14px 16px;
  background: #f5faf9;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  font-size: 13px;
  color: #334155;
}

.smartychat-consent-accept {
  margin-top: 8px;
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  background: var(--smartychat-color);
  color: #fff;
  cursor: pointer;
}

.smartychat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  background:
    radial-gradient(circle at top right, rgba(11, 122, 117, 0.08), transparent 32%),
    linear-gradient(180deg, #fcfffe, #f8fafc);
}

.smartychat-bubble {
  max-width: 86%;
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.smartychat-bubble.is-user {
  margin-left: auto;
  background: #e2e8f0;
  color: #0f172a;
  border-bottom-right-radius: 6px;
}

.smartychat-bubble.is-assistant {
  margin-right: auto;
  background: #ffffff;
  color: #0f172a;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-bottom-left-radius: 6px;
}

.smartychat-bubble.is-handoff {
  max-width: 92%;
  text-align: center;
  background: #f0fdf4;
  border-color: rgba(37, 211, 102, 0.24);
}

.smartychat-bubble.is-typing {
  color: #475569;
}

.smartychat-handoff-helper {
  margin: 0 0 8px;
  color: #166534;
  font-size: 13px;
}

.smartychat-handoff-cta {
  display: inline-block;
  background: #25D366;
  color: #fff !important;
  padding: 12px 20px;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  margin-top: 8px;
  font-size: 14px;
}

.smartychat-handoff-cta:hover {
  background: #1fb855;
}

.smartychat-handoff-cta::before {
  content: "\1F4AC  ";
}

.smartychat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  background: #fff;
}

.smartychat-input {
  resize: none;
  min-height: 44px;
  max-height: 96px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  padding: 10px 12px;
  font-size: 14px;
}

.smartychat-send {
  border: 0;
  border-radius: 14px;
  background: var(--smartychat-color);
  color: #fff;
  padding: 0 18px;
  cursor: pointer;
}

.smartychat-send:disabled {
  opacity: 0.6;
  cursor: wait;
}

@media (max-width: 640px) {
  .smartychat-root {
    left: 12px;
    right: 12px;
    bottom: 12px;
  }

  .smartychat-toggle {
    width: 100%;
    justify-content: center;
  }

  .smartychat-panel {
    width: 100%;
    height: min(72vh, 560px);
  }
}

.smartychat-disclaimer {
  font-size: 11px;
  color: #6a7782;
  padding: 6px 12px 10px;
  margin: 0;
  text-align: center;
  line-height: 1.4;
}
