/* Léa Reno chat widget — Haidly design tokens */
:root {
  --lea-ink: #1E262E;
  --lea-orange: #EC6A2B;
  --lea-cream: #F7F5F2;
  --lea-muted: #5C6570;
  --lea-white: #FFFFFF;
  --lea-radius: 14px;
  --lea-shadow: 0 12px 40px rgba(30, 38, 46, 0.18);
}

#lea-chat-root {
  position: fixed;
  z-index: 99990;
  right: 20px;
  bottom: 20px;
  font-family: Lexend, system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  color: var(--lea-ink);
  box-sizing: border-box;
}

#lea-chat-root *,
#lea-chat-root *::before,
#lea-chat-root *::after {
  box-sizing: border-box;
}

.lea-fab {
  display: flex;
  align-items: center;
  gap: 10px;
  border: none;
  cursor: pointer;
  background: var(--lea-orange);
  color: var(--lea-white);
  padding: 14px 18px;
  border-radius: 999px;
  box-shadow: var(--lea-shadow);
  font-family: inherit;
  font-weight: 600;
  font-size: 15px;
  transition: transform 0.15s ease, background 0.15s ease;
}

.lea-fab:hover,
.lea-fab:focus-visible {
  background: #d45a1f;
  transform: translateY(-1px);
  outline: none;
}

.lea-fab-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.lea-fab-label {
  white-space: nowrap;
}

.lea-panel {
  display: none;
  flex-direction: column;
  width: min(380px, calc(100vw - 32px));
  height: min(520px, calc(100vh - 100px));
  background: var(--lea-white);
  border-radius: var(--lea-radius);
  box-shadow: var(--lea-shadow);
  overflow: hidden;
  border: 1px solid rgba(30, 38, 46, 0.08);
}

#lea-chat-root.is-open .lea-panel {
  display: flex;
}

#lea-chat-root.is-open .lea-fab {
  display: none;
}

.lea-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: var(--lea-ink);
  color: var(--lea-white);
}

.lea-header-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.lea-header-sub {
  margin: 2px 0 0;
  font-size: 12px;
  opacity: 0.75;
  font-weight: 400;
}

.lea-close {
  border: none;
  background: transparent;
  color: var(--lea-white);
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  font-size: 22px;
  line-height: 1;
  opacity: 0.85;
}

.lea-close:hover,
.lea-close:focus-visible {
  opacity: 1;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
}

.lea-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: var(--lea-cream);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.lea-bubble--bot {
  align-self: flex-start;
  background: var(--lea-white);
  color: var(--lea-ink);
  border: 1px solid rgba(30, 38, 46, 0.08);
  border-bottom-left-radius: 4px;
}

.lea-bubble--user {
  align-self: flex-end;
  background: var(--lea-orange);
  color: var(--lea-white);
  border-bottom-right-radius: 4px;
}

.lea-bubble--typing {
  opacity: 0.7;
  font-style: italic;
}

.lea-form {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid rgba(30, 38, 46, 0.08);
  background: var(--lea-white);
}

.lea-input {
  flex: 1;
  border: 1px solid rgba(30, 38, 46, 0.18);
  border-radius: 10px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 15px;
  color: var(--lea-ink);
  resize: none;
  min-height: 44px;
  max-height: 96px;
}

.lea-input:focus {
  outline: 2px solid rgba(236, 106, 43, 0.35);
  border-color: var(--lea-orange);
}

.lea-send {
  border: none;
  background: var(--lea-ink);
  color: var(--lea-white);
  border-radius: 10px;
  padding: 0 16px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
}

.lea-send:hover:not(:disabled),
.lea-send:focus-visible:not(:disabled) {
  background: var(--lea-orange);
  outline: none;
}

.lea-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

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

  .lea-fab-label {
    display: none;
  }

  .lea-fab {
    padding: 14px;
    border-radius: 50%;
  }

  .lea-panel {
    width: calc(100vw - 24px);
    height: min(70vh, 560px);
  }
}
