.edc-ai-root {
  --edc-ai-brand: #111827;
  --edc-ai-bg: #ffffff;
  --edc-ai-border: rgba(17, 24, 39, 0.14);
  --edc-ai-text: #111827;
  --edc-ai-muted: #6b7280;
  --edc-ai-soft: #f7f8fb;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--edc-ai-text);
  line-height: 1.45;
  box-sizing: border-box;
}

.edc-ai-root *,
.edc-ai-root *::before,
.edc-ai-root *::after {
  box-sizing: border-box;
}

.edc-ai-root-floating {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 99999;
}

.edc-ai-launcher {
  width: 58px;
  height: 58px;
  border-radius: 999px;
  border: 0;
  background: var(--edc-ai-brand);
  color: #fff;
  font-weight: 800;
  letter-spacing: -0.03em;
  box-shadow: 0 16px 35px rgba(0, 0, 0, 0.25);
  cursor: pointer;
}

.edc-ai-launcher.is-hidden {
  display: none;
}

.edc-ai-panel {
  display: none;
  width: min(430px, calc(100vw - 28px));
  height: min(680px, calc(100vh - 40px));
  background: var(--edc-ai-bg);
  border: 1px solid var(--edc-ai-border);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
}

.edc-ai-root-inline .edc-ai-panel {
  width: 100%;
  max-width: 780px;
  height: 620px;
  margin: 24px 0;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.10);
}

.edc-ai-panel.is-open {
  display: flex;
  flex-direction: column;
}

.edc-ai-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 16px;
  background: var(--edc-ai-brand);
  color: #fff;
}

.edc-ai-header strong {
  display: block;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.edc-ai-header span {
  display: block;
  font-size: 12px;
  opacity: 0.82;
}

.edc-ai-close,
.edc-ai-lead-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 23px;
  line-height: 1;
  cursor: pointer;
}

.edc-ai-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px;
  background:
    radial-gradient(circle at top left, rgba(17, 24, 39, 0.04), transparent 24%),
    #f9fafb;
}

.edc-ai-message {
  width: fit-content;
  max-width: 92%;
  padding: 10px 12px;
  margin-bottom: 10px;
  border-radius: 15px;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.edc-ai-message strong {
  font-weight: 800;
}

.edc-ai-message-assistant {
  background: #fff;
  border: 1px solid var(--edc-ai-border);
  border-top-left-radius: 5px;
}

.edc-ai-message-user {
  margin-left: auto;
  background: var(--edc-ai-brand);
  color: #fff;
  border-top-right-radius: 5px;
}

.edc-ai-thinking {
  color: var(--edc-ai-muted);
  font-style: italic;
}

.edc-ai-form {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid var(--edc-ai-border);
  background: #fff;
}

.edc-ai-input {
  width: 100%;
  resize: none;
  border: 1px solid var(--edc-ai-border);
  border-radius: 13px;
  padding: 10px 12px;
  font: inherit;
  min-height: 48px;
  max-height: 120px;
  background: #fff;
  color: var(--edc-ai-text);
}

.edc-ai-input:focus {
  outline: 2px solid color-mix(in srgb, var(--edc-ai-brand), transparent 72%);
  border-color: var(--edc-ai-brand);
}

.edc-ai-send,
.edc-ai-handoff,
.edc-ai-lead-submit {
  border: 0;
  border-radius: 13px;
  background: var(--edc-ai-brand);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.edc-ai-send {
  padding: 0 16px;
  min-width: 70px;
}

.edc-ai-send:disabled,
.edc-ai-lead-submit:disabled {
  opacity: 0.55;
  cursor: wait;
}

.edc-ai-actions {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 0 12px 12px;
  background: #fff;
}

.edc-ai-handoff {
  width: 100%;
  padding: 12px 14px;
}

.edc-ai-cta {
  display: block;
  padding: 10px 12px;
  border: 1px solid var(--edc-ai-border);
  border-radius: 12px;
  color: var(--edc-ai-brand);
  background: #fff;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
}

.edc-ai-cta:hover,
.edc-ai-cta:focus {
  text-decoration: underline;
}

.edc-ai-lead-form {
  flex: 0 0 auto;
  max-height: 55%;
  overflow-y: auto;
  padding: 14px;
  border-top: 1px solid var(--edc-ai-border);
  background: #fff;
}

.edc-ai-lead-form[hidden] {
  display: none !important;
}

.edc-ai-lead-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}

.edc-ai-lead-head strong {
  font-size: 15px;
}

.edc-ai-lead-close {
  width: 30px;
  height: 30px;
  color: var(--edc-ai-brand);
  border-color: var(--edc-ai-border);
  background: #fff;
}

.edc-ai-lead-form p {
  margin: 0 0 10px;
  color: var(--edc-ai-muted);
  font-size: 13px;
}

.edc-ai-lead-form label {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 800;
  color: var(--edc-ai-text);
}

.edc-ai-lead-form label span {
  color: #b91c1c;
}

.edc-ai-lead-form input,
.edc-ai-lead-form textarea {
  display: block;
  width: 100%;
  margin-top: 4px;
  border: 1px solid var(--edc-ai-border);
  border-radius: 10px;
  padding: 9px 10px;
  font: inherit;
  font-weight: 400;
  background: #fff;
  color: var(--edc-ai-text);
}

.edc-ai-lead-submit {
  width: 100%;
  padding: 12px 14px;
  margin-top: 4px;
}

.edc-ai-lead-status {
  min-height: 18px;
  margin-top: 8px;
  font-size: 13px;
  color: var(--edc-ai-muted);
}

.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}

@media (max-width: 520px) {
  .edc-ai-root-floating {
    right: 10px;
    bottom: 10px;
  }

  .edc-ai-panel {
    width: calc(100vw - 20px);
    height: calc(100vh - 20px);
    border-radius: 16px;
  }

  .edc-ai-header {
    padding: 14px;
  }

  .edc-ai-body {
    padding: 14px;
  }

  .edc-ai-form {
    grid-template-columns: minmax(0, 1fr) 74px;
    gap: 8px;
    padding: 10px;
  }

  .edc-ai-send {
    padding: 0 12px;
    min-width: 0;
  }

  .edc-ai-actions {
    padding: 0 10px 10px;
  }
}
