.peggtech-assistant {
  --assistant-accent: var(--accent-color, #d35a16);
  --assistant-ink: #18242d;
  --assistant-muted: #64727c;
  --assistant-line: #e3e9ed;
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 2147483000;
  font-family: var(--default-font, Arial, sans-serif);
}

.assistant-launcher {
  display: inline-flex;
  min-height: 56px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--assistant-accent), #e97928);
  box-shadow: 0 12px 30px rgba(39, 31, 25, .28), 0 0 0 1px rgba(255, 255, 255, .22) inset;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  transition: transform .22s ease, box-shadow .22s ease, filter .22s ease;
}

.assistant-launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 17px 38px rgba(39, 31, 25, .34), 0 0 0 1px rgba(255, 255, 255, .28) inset;
  filter: saturate(1.08);
}

.assistant-launcher i {
  font-size: 19px;
}

.assistant-panel[hidden] {
  display: none;
}

.assistant-panel {
  position: absolute;
  right: 0;
  bottom: 70px;
  display: flex;
  width: min(410px, calc(100vw - 32px));
  height: min(650px, calc(100dvh - 112px));
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  border: 1px solid rgba(31, 40, 45, .09);
  border-radius: 22px;
  background: #fffdfa;
  box-shadow: 0 28px 90px rgba(18, 26, 30, .3), 0 3px 12px rgba(18, 26, 30, .08);
  color: var(--assistant-ink);
  animation: assistant-enter .24s cubic-bezier(.2, .8, .2, 1);
}

.peggtech-assistant .assistant-header {
  position: relative;
  inset: auto;
  width: auto;
  display: flex;
  min-height: 82px;
  flex: 0 0 auto;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  background: linear-gradient(115deg, #18242d 0%, #233844 74%, #2d414b 100%);
  color: #fff;
}

.assistant-avatar {
  display: grid;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 15px;
  background: linear-gradient(145deg, rgba(255, 255, 255, .18), rgba(255, 255, 255, .07));
  color: #ff9a55;
  font-size: 20px;
}

.assistant-avatar img {
  display: block;
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.assistant-heading {
  min-width: 0;
  flex: 1;
}

.assistant-heading h2 {
  margin: 0 0 4px;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
}

.assistant-heading p {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  color: rgba(255, 255, 255, .72);
  font-size: 12px;
}

.assistant-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #61d49c;
  box-shadow: 0 0 0 3px rgba(97, 212, 156, .13), 0 0 10px rgba(97, 212, 156, .35);
}

.assistant-icon-button {
  display: inline-grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--assistant-line);
  border-radius: 12px;
  background: #fff;
  color: var(--assistant-ink);
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}

.assistant-header .assistant-icon-button {
  width: 34px;
  height: 34px;
  border-color: rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .08);
  color: #fff;
}

.assistant-icon-button:hover {
  border-color: var(--assistant-accent);
  color: var(--assistant-accent);
}

.assistant-header .assistant-icon-button:hover {
  background: rgba(255, 255, 255, .18);
  color: #fff;
}

.assistant-messages {
  display: flex;
  min-height: 160px;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 13px;
  overflow-y: auto;
  padding: 20px 17px 15px;
  background: radial-gradient(ellipse at 100% 0%, rgba(200, 87, 22, .035), transparent 44%), #fffdfa;
  overscroll-behavior: contain;
  scrollbar-color: #c7ced0 transparent;
  scrollbar-width: thin;
}

.assistant-messages::-webkit-scrollbar {
  width: 6px;
}

.assistant-messages::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #c7ced0;
}

.assistant-message {
  max-width: 90%;
  padding: 12px 15px;
  border-radius: 17px;
  font-size: 14px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  text-align: left;
  white-space: pre-wrap;
  animation: assistant-message-in .18s ease-out;
}

.assistant-rich-line {
  display: block;
}

.assistant-rich-line + .assistant-rich-line {
  margin-top: 4px;
}

.assistant-rich-spacer {
  height: 5px;
  margin: 0 !important;
}

.assistant-rich-number {
  margin-right: 7px;
  color: var(--assistant-accent);
  font-weight: 700;
}

.assistant-message-user .assistant-rich-number {
  color: rgba(255, 255, 255, .88);
}

.assistant-message strong {
  font-weight: 700;
}

.assistant-message-bot {
  align-self: flex-start;
  border: 1px solid #e9edef;
  border-bottom-left-radius: 5px;
  background: linear-gradient(145deg, #f7f8f8, #f1f4f4);
  color: #25323a;
}

.assistant-message-user {
  align-self: flex-end;
  border: 1px solid rgba(200, 87, 22, .18);
  border-bottom-right-radius: 5px;
  background: linear-gradient(135deg, var(--assistant-accent), #e47324);
  box-shadow: 0 6px 14px rgba(200, 87, 22, .12);
  color: #fff;
}

.assistant-message-error {
  border-color: #f2d4d1;
  background: #fff6f5;
  color: #9d342b;
}

.assistant-quick-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-self: flex-start;
  max-width: 100%;
}

.assistant-quick-prompts button {
  padding: 9px 13px;
  border: 1px solid rgba(200, 87, 22, .24);
  border-radius: 999px;
  background: rgba(255, 255, 255, .9);
  color: var(--assistant-accent);
  font-size: 12px;
  font-weight: 600;
  transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.assistant-quick-prompts button:hover {
  background: var(--assistant-accent);
  border-color: var(--assistant-accent);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(200, 87, 22, .18);
}

.assistant-draft {
  margin: 0 16px 12px;
  padding: 14px;
  border: 1px solid rgba(200, 87, 22, .3);
  border-radius: 14px;
  background: linear-gradient(145deg, #fffaf5, #fff);
  box-shadow: 0 8px 24px rgba(51, 43, 35, .06);
}

.assistant-draft[hidden] {
  display: none;
}

.assistant-draft h3 {
  margin: 0 0 9px;
  color: var(--assistant-ink);
  font-size: 14px;
}

.assistant-draft p {
  margin: 4px 0;
  color: #4e5b63;
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.assistant-draft label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 11px 0;
  color: #4e5b63;
  font-size: 12px;
  line-height: 1.45;
}

.assistant-draft input[type="checkbox"] {
  margin-top: 2px;
  accent-color: var(--assistant-accent);
}

.assistant-draft button {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 10px;
  background: var(--assistant-accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.assistant-draft button:disabled {
  cursor: not-allowed;
  opacity: .5;
}

.assistant-state {
  margin: 0;
  padding: 0 16px 5px;
  color: var(--assistant-muted);
  font-size: 12px;
}

.assistant-state:empty {
  display: none;
}

.assistant-form {
  margin: 0 14px;
  padding: 10px 11px 11px;
  border: 1px solid #e0e5e7;
  border-radius: 17px;
  background: #fff;
  box-shadow: 0 7px 20px rgba(31, 42, 47, .045);
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.assistant-form:focus-within {
  border-color: var(--assistant-accent);
  box-shadow: 0 0 0 3px rgba(200, 87, 22, .1), 0 8px 22px rgba(31, 42, 47, .07);
}

.assistant-form textarea {
  display: block;
  width: 100%;
  max-height: 100px;
  resize: vertical;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--assistant-ink);
  font: inherit;
  font-size: 14px;
  line-height: 1.45;
}

.assistant-form textarea::placeholder {
  color: #8b969d;
}

.assistant-form-actions {
  display: flex;
  min-height: 40px;
  align-items: center;
  gap: 8px;
  padding-top: 7px;
}

.assistant-microphone {
  width: 36px;
  height: 36px;
  border: 0;
  background: #f0f3f5;
  color: #55646d;
}

.assistant-microphone.is-recording {
  background: #fff0ef;
  color: #cf352d;
  animation: assistant-recording 1.2s ease-in-out infinite;
}

.assistant-form-hint {
  min-width: 0;
  flex: 1;
  color: #7c888f;
  font-size: 10px;
}

.assistant-send {
  display: inline-grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  border: 0;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--assistant-accent), #e47324);
  color: #fff;
  font-size: 19px;
  box-shadow: 0 5px 12px rgba(200, 87, 22, .2);
  transition: transform .18s ease, opacity .18s ease;
}

.assistant-send:hover {
  transform: translateY(-1px);
}

.assistant-send:disabled {
  cursor: wait;
  opacity: .55;
}

.assistant-panel button:focus-visible,
.assistant-launcher:focus-visible,
.assistant-form textarea:focus-visible,
.assistant-draft input:focus-visible {
  outline: 3px solid rgba(200, 87, 22, .38);
  outline-offset: 2px;
}

@keyframes assistant-enter {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes assistant-message-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes assistant-recording {
  50% { box-shadow: 0 0 0 6px rgba(207, 53, 45, .12); }
}

@media (max-width: 575px) {
  .peggtech-assistant {
    right: 14px;
    bottom: 14px;
  }

  .assistant-panel {
    position: fixed;
    inset: max(8px, env(safe-area-inset-top)) 8px calc(76px + env(safe-area-inset-bottom));
    width: auto;
    height: auto;
    max-height: none;
    min-height: 0;
    border-radius: 22px;
    z-index: 2147483001;
  }

  .peggtech-assistant .assistant-header {
    min-height: 76px;
    padding: 13px 15px;
  }

  .assistant-messages {
    min-height: 0;
    padding: 17px 14px 13px;
  }

  .assistant-form {
    margin: 0 11px;
  }

  .assistant-launcher {
    min-height: 50px;
    padding: 0 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .assistant-panel,
  .assistant-message,
  .assistant-microphone.is-recording {
    animation: none;
  }
}

/* Raccourcis de contact PeggTech */
.contact-actions[hidden],
.contact-actions-toggle[hidden] { display: none !important; }
.contact-actions {
  display: flex;
  width: 164px;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}
.contact-action {
  position: relative;
  display: flex;
  width: 164px;
  min-height: 52px;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 17px;
  color: #fff;
  text-align: left;
  text-decoration: none;
  box-shadow: 0 10px 22px rgba(23, 24, 22, .2);
  transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
  animation: contact-action-in .32s ease both;
}
.contact-action:nth-child(2) { animation-delay: .04s; }
.contact-action:nth-child(3) { animation-delay: .08s; }
.contact-action:hover { transform: translateX(-3px); color: #fff; box-shadow: 0 13px 28px rgba(23,24,22,.25); filter: brightness(1.06); }
.contact-action:focus-visible,
.contact-actions-close:focus-visible,
.contact-actions-toggle:focus-visible { outline: 3px solid #ffb17a; outline-offset: 3px; }
.contact-action-assistant,
.assistant-launcher.contact-action-assistant { min-height: 52px; padding: 7px 12px; border-radius: 17px; background: #20201e; color: #fff; }
.assistant-launcher.contact-action-assistant:hover { background: #292724; color: #fff; }
.contact-action-whatsapp { background: #0d9f50; }
.contact-action-email { background: #d65a17; }
.contact-action-icon {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border-radius: 11px;
  background: rgba(255,255,255,.16);
  color: #fff;
}
.contact-action-icon i { font-size: 18px; }
.contact-action-assistant .contact-action-icon { color: #ff914f; }
.contact-action-label { display: flex; min-width: 0; flex-direction: column; gap: 2px; line-height: 1.15; }
.contact-action-label strong { overflow: hidden; font-size: 12px; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.contact-action-label small { overflow: hidden; color: rgba(255,255,255,.82); font-size: 9px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.contact-action-status { width: 9px; height: 9px; flex: 0 0 9px; margin-left: auto; border: 1px solid #fff; border-radius: 50%; background: #20d27a; box-shadow: 0 0 0 2px rgba(32,210,122,.16); }
.contact-actions-close {
  display: grid;
  width: 52px;
  height: 52px;
  align-self: flex-end;
  place-items: center;
  margin-top: 1px;
  border: 0;
  border-radius: 17px;
  background: #20201e;
  color: #fff;
  box-shadow: 0 10px 22px rgba(23, 24, 22, .2);
  transition: transform .2s ease, background .2s ease;
}
.contact-actions-close i { font-size: 20px; }
.contact-actions-close:hover { transform: translateY(-2px); background: #d65a17; }
.contact-actions-toggle {
  display: inline-flex;
  min-height: 54px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 19px;
  border: 0;
  border-radius: 999px;
  background: #d65a17;
  color: #fff;
  font-size: 13px;
  font-weight: 750;
  box-shadow: 0 12px 28px rgba(39,31,25,.27);
  animation: contact-action-in .25s ease both;
}
.contact-actions-toggle:hover { transform: translateY(-2px); background: #bd4c10; color: #fff; }
.contact-actions-toggle i { font-size: 17px; }
.assistant-panel { bottom: calc(100% + 14px); }
.peggtech-assistant .assistant-panel .assistant-header { background: linear-gradient(115deg, #20201e, #30251f); }
.contact-actions.chat-open .contact-action-whatsapp,
.contact-actions.chat-open .contact-action-email,
.contact-actions.chat-open .contact-actions-close { display: none; }
@keyframes contact-action-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (max-width: 575px) {
  .peggtech-assistant { right: 13px; bottom: 13px; }
  .contact-actions { width: 156px; gap: 7px; }
  .contact-action { width: 156px; min-height: 50px; padding: 6px 10px; border-radius: 16px; }
  .assistant-launcher.contact-action-assistant { min-height: 50px; padding: 6px 10px; }
  .contact-actions-close { width: 48px; height: 48px; border-radius: 16px; }
  .contact-actions-toggle { min-height: 50px; padding: 0 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .contact-action, .contact-actions-toggle { animation: none; transition: none; }
}
