.lds-agent-toggle {
  position: fixed;
  right: 18px;
  bottom: 90px;
  z-index: 70;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid rgba(244, 124, 32, 0.58);
  background: linear-gradient(135deg, rgba(38, 32, 27, 0.98), rgba(16, 14, 12, 0.98));
  color: #ff8a24;
  box-shadow: 0 14px 30px rgba(244, 124, 32, 0.24), 0 8px 22px rgba(0, 0, 0, 0.24);
  cursor: pointer;
}

.lds-agent-toggle svg,
.lds-agent-wa svg {
  width: 30px;
  height: 30px;
  display: block;
}

.wa-mark svg {
  width: 18px;
  height: 18px;
  display: block;
}

.whatsapp-float {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 58px;
  padding: 0 20px;
  border-radius: 999px;
  border: 0;
  background: linear-gradient(135deg, #25d366, #20bd5a);
  color: #07140c;
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 18px 40px rgba(37, 211, 102, 0.28);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.whatsapp-float .wa-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(7, 20, 12, 0.12);
  color: #07140c;
}

.whatsapp-float:hover,
.whatsapp-float:focus-visible {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 22px 48px rgba(37, 211, 102, 0.34);
  outline: none;
}

.lds-agent-toggle:hover,
.lds-agent-toggle:focus-visible {
  transform: translateY(-3px) scale(1.04);
  outline: none;
}

.lds-agent-panel {
  position: fixed;
  right: 18px;
  bottom: 154px;
  z-index: 71;
  width: min(390px, calc(100vw - 24px));
  max-height: min(720px, calc(100dvh - 190px));
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(180deg, #211b16, #12100e);
  color: #f8f4ee;
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.46);
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(18px) scale(0.98);
  transition: opacity 220ms ease, transform 220ms ease, width 220ms ease;
  font-family: "Rajdhani", system-ui, sans-serif;
}

.lds-agent-panel.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.lds-agent-panel.minimized {
  width: min(286px, calc(100vw - 24px));
  max-height: 86px;
  cursor: pointer;
}

.lds-agent-panel.minimized .lds-agent-body,
.lds-agent-panel.minimized .lds-agent-back,
.lds-agent-panel.minimized .lds-agent-minimize,
.lds-agent-panel.minimized .lds-agent-close,
.lds-agent-panel.minimized .lds-agent-nav {
  display: none;
}

.lds-agent-panel.minimized .lds-agent-head {
  border-bottom: 0;
  padding: 15px 16px;
}

.lds-agent-panel.minimized .lds-agent-title::after {
  content: "Click to reopen";
  display: block;
  margin-top: 4px;
  color: rgba(248, 244, 238, 0.62);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

body[data-lang="fr"] .lds-agent-panel.minimized .lds-agent-title::after {
  content: "Cliquez pour rouvrir";
}

.lds-agent-head {
  padding: 16px 18px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
}

.lds-agent-head-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.lds-agent-title {
  margin: 0;
  text-align: center;
  font-size: 1.35rem;
  font-weight: 900;
  line-height: 1;
}

.lds-agent-actions {
  display: flex;
  gap: 6px;
}

.lds-agent-back,
.lds-agent-minimize,
.lds-agent-close {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: inherit;
  font: inherit;
  font-size: 1.2rem;
  font-weight: 900;
  cursor: pointer;
}

.lds-agent-back {
  visibility: hidden;
}

.lds-agent-body {
  display: block;
  max-height: calc(min(720px, calc(100dvh - 190px)) - 68px);
  overflow-y: auto;
  padding: 16px 18px 18px;
}

.lds-agent-view {
  display: none;
}

.lds-agent-panel[data-tab="home"] .lds-agent-home,
.lds-agent-panel[data-tab="messages"] .lds-agent-chat,
.lds-agent-panel[data-tab="help"] .lds-agent-help {
  display: grid;
  gap: 14px;
}

.lds-agent-panel[data-tab="messages"] .lds-agent-back,
.lds-agent-panel[data-tab="help"] .lds-agent-back {
  visibility: visible;
}

.lds-agent-card,
.lds-agent-link,
.lds-agent-search {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  color: inherit;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.12);
}

.lds-agent-card,
.lds-agent-link {
  display: grid;
  gap: 5px;
  width: 100%;
  padding: 16px;
  text-align: left;
}

.lds-agent-link {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  cursor: pointer;
}

.lds-agent-card strong,
.lds-agent-link strong {
  font-size: 1rem;
  font-weight: 900;
}

.lds-agent-card span,
.lds-agent-link span span {
  color: rgba(248, 244, 238, 0.68);
  line-height: 1.4;
}

.lds-agent-arrow {
  color: #ff8a24;
  font-size: 1.4rem;
  font-weight: 900;
}

.lds-agent-search {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  min-height: 54px;
  padding: 0 15px;
  color: rgba(248, 244, 238, 0.76);
  font-weight: 800;
}

.lds-agent-search input {
  min-width: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  outline: 0;
}

.lds-agent-search input::placeholder {
  color: inherit;
  opacity: 1;
}

.lds-agent-search-button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
  color: #ff8a24;
  cursor: pointer;
  font: inherit;
  font-size: 1.35rem;
  font-weight: 900;
}

.lds-agent-messages {
  display: grid;
  gap: 10px;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 4px;
}

.lds-agent-bubble {
  max-width: 92%;
  padding: 12px 14px;
  border-radius: 18px;
  line-height: 1.55;
  font-size: 0.98rem;
}

.lds-agent-bubble.bot {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.lds-agent-bubble.user {
  margin-left: auto;
  background: rgba(244, 124, 32, 0.15);
  border: 1px solid rgba(244, 124, 32, 0.26);
}

.lds-agent-typing {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 58px;
}

.lds-agent-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.36;
  animation: ldsTypingDots 0.9s infinite ease-in-out;
}

.lds-agent-typing span:nth-child(2) {
  animation-delay: 0.14s;
}

.lds-agent-typing span:nth-child(3) {
  animation-delay: 0.28s;
}

@keyframes ldsTypingDots {
  0%, 80%, 100% {
    transform: translateY(0);
    opacity: 0.3;
  }

  40% {
    transform: translateY(-4px);
    opacity: 0.9;
  }
}

.lds-agent-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lds-agent-chip {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: inherit;
  cursor: pointer;
  font-weight: 800;
}

.lds-agent-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.lds-agent-input,
.lds-agent-feedback textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(12, 10, 9, 0.82);
  color: inherit;
  outline: none;
  font: inherit;
}

.lds-agent-input {
  min-height: 46px;
  border-radius: 16px;
  padding: 0 14px;
}

.lds-agent-send,
.lds-agent-submit {
  border: 0;
  background: linear-gradient(135deg, #f47c20, #ff9a3d);
  color: #1d1916;
  font-weight: 900;
  cursor: pointer;
}

.lds-agent-send {
  min-width: 58px;
  min-height: 46px;
  border-radius: 16px;
}

.lds-agent-feedback[hidden] {
  display: none;
}

.lds-agent-feedback {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
}

.lds-agent-stars {
  display: flex;
  gap: 8px;
}

.lds-agent-star {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(248, 244, 238, 0.64);
  font-size: 1.35rem;
  font-weight: 900;
  cursor: pointer;
}

.lds-agent-star.active,
.lds-agent-star:hover,
.lds-agent-star:focus-visible {
  border-color: rgba(244, 124, 32, 0.58);
  background: rgba(244, 124, 32, 0.16);
  color: #f47c20;
  outline: none;
}

.lds-agent-feedback textarea {
  min-height: 90px;
  resize: vertical;
  border-radius: 16px;
  padding: 12px 14px;
}

.lds-agent-feedback-status {
  display: none;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(244, 124, 32, 0.22);
  background: rgba(244, 124, 32, 0.12);
  font-weight: 800;
}

.lds-agent-feedback.sent .lds-agent-stars,
.lds-agent-feedback.sent textarea,
.lds-agent-feedback.sent .lds-agent-feedback-actions {
  display: none;
}

.lds-agent-feedback.sent .lds-agent-feedback-status {
  display: block;
}

.lds-agent-feedback-actions {
  display: flex;
  gap: 10px;
}

.lds-agent-submit,
.lds-agent-skip {
  min-height: 42px;
  padding: 0 15px;
  border-radius: 14px;
  font-weight: 900;
  cursor: pointer;
}

.lds-agent-skip {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: inherit;
}

.lds-agent-nav {
  display: none;
}

.lds-agent-panel {
  width: min(430px, calc(100vw - 24px));
  max-height: min(720px, calc(100dvh - 190px));
  background: #f7f4ef;
  color: #171412;
  display: flex;
  flex-direction: column;
  border-color: rgba(20, 18, 16, 0.1);
  box-shadow: 0 26px 80px rgba(24, 20, 16, 0.22);
}

.lds-agent-head {
  flex: 0 0 auto;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(20, 18, 16, 0.1);
  background: #fff;
}

.lds-agent-title {
  color: #171412;
  text-transform: none;
}

.lds-agent-back,
.lds-agent-minimize,
.lds-agent-close {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: rgba(23, 20, 18, 0.72);
}

.lds-agent-body {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  padding: 18px;
  background:
    radial-gradient(circle at 50% 0%, rgba(244, 124, 32, 0.12), transparent 34%),
    linear-gradient(180deg, #fbf7f0, #f4efe7);
  color: #171412;
}

.lds-agent-card,
.lds-agent-link,
.lds-agent-search,
.lds-agent-feedback {
  border-color: rgba(20, 18, 16, 0.08);
  background: #fff;
  color: #171412;
  box-shadow: 0 14px 34px rgba(24, 20, 16, 0.08);
}

.lds-agent-card span,
.lds-agent-link span span {
  color: rgba(23, 20, 18, 0.62);
}

.lds-agent-messages {
  max-height: none;
  overflow: visible;
  padding-right: 0;
}

.lds-agent-bubble.bot {
  border: 0;
  background: #ece8e2;
  color: #171412;
}

.lds-agent-bubble.user {
  border-color: rgba(244, 124, 32, 0.24);
  background: rgba(244, 124, 32, 0.16);
  color: #171412;
}

.lds-agent-chip {
  min-height: 38px;
  border-color: rgba(20, 18, 16, 0.08);
  background: #fff;
  color: #171412;
}

.lds-agent-form {
  position: sticky;
  bottom: 0;
  grid-template-columns: minmax(0, 1fr) auto;
  margin-top: 16px;
  padding: 10px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 16px 44px rgba(24, 20, 16, 0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.lds-agent-input,
.lds-agent-feedback textarea {
  border-color: transparent;
  background: #f5f2ee;
  color: #171412;
}

.lds-agent-send {
  min-width: 54px;
  border-radius: 16px;
}

.lds-agent-star {
  border-color: rgba(20, 18, 16, 0.16);
  background: #f5f2ee;
  color: rgba(23, 20, 18, 0.68);
}

.lds-agent-skip {
  border-color: rgba(20, 18, 16, 0.1);
  background: #fff;
  color: #171412;
}

.lds-agent-feedback-status {
  color: #171412;
}

.lds-agent-panel.minimized .lds-agent-title::after {
  color: rgba(23, 20, 18, 0.62);
}

.lds-agent-nav {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 8px 10px;
  border-top: 1px solid rgba(20, 18, 16, 0.1);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.lds-agent-tab {
  display: grid;
  justify-items: center;
  gap: 4px;
  min-height: 56px;
  border: 0;
  background: transparent;
  color: rgba(23, 20, 18, 0.58);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 900;
  cursor: pointer;
}

.lds-agent-tab.active {
  color: #f47c20;
}

.lds-agent-panel:not(.open) .lds-agent-nav {
  display: none;
}

@media (max-width: 640px) {
  body.lds-agent-open {
    overflow: hidden;
  }

  .lds-agent-toggle {
    right: 14px;
    bottom: 82px;
    width: 50px;
    height: 50px;
  }

  .whatsapp-float {
    right: 14px;
    bottom: 14px;
    width: 58px;
    min-height: 58px;
    padding: 0;
    border-radius: 50%;
  }

  .whatsapp-float span:last-child {
    display: none;
  }

  .lds-agent-panel {
    inset: 0;
    right: auto;
    bottom: auto;
    z-index: 90;
    width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border: 0;
    border-radius: 0;
    background: #f7f4ef;
    color: #171412;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    transform: translateY(18px);
  }

  .lds-agent-panel.minimized {
    width: 100vw;
    max-height: 100dvh;
  }

  .lds-agent-head {
    flex: 0 0 auto;
    padding: calc(14px + env(safe-area-inset-top, 0px)) 18px 14px;
    background: #fff;
    border-bottom: 1px solid rgba(20, 18, 16, 0.1);
  }

  .lds-agent-title {
    color: #171412;
    text-transform: none;
  }

  .lds-agent-back,
  .lds-agent-minimize,
  .lds-agent-close {
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: rgba(23, 20, 18, 0.72);
  }

  .lds-agent-body {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    padding: 18px 18px calc(96px + env(safe-area-inset-bottom, 0px));
    background: radial-gradient(circle at 16% 8%, rgba(244, 124, 32, 0.1), transparent 28%), linear-gradient(180deg, #f9f6f1, #f5f1eb);
    color: #171412;
  }

  .lds-agent-card,
  .lds-agent-link,
  .lds-agent-search {
    border-color: rgba(20, 18, 16, 0.08);
    background: #fff;
    color: #171412;
    box-shadow: 0 14px 34px rgba(24, 20, 16, 0.08);
  }

  .lds-agent-card span,
  .lds-agent-link span span {
    color: rgba(23, 20, 18, 0.62);
  }

  .lds-agent-messages {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .lds-agent-bubble.bot {
    background: #ece8e2;
    border: 0;
  }

  .lds-agent-bubble.user {
    background: rgba(244, 124, 32, 0.16);
  }

  .lds-agent-chip {
    background: #fff;
    color: #171412;
    border-color: rgba(20, 18, 16, 0.08);
  }

  .lds-agent-form {
    position: sticky;
    bottom: calc(78px + env(safe-area-inset-bottom, 0px));
    margin-top: 16px;
    padding: 10px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 16px 44px rgba(24, 20, 16, 0.12);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }

  .lds-agent-input,
  .lds-agent-feedback textarea {
    background: #f5f2ee;
    color: #171412;
    border-color: transparent;
  }

  .lds-agent-feedback {
    background: #fff;
    color: #171412;
    border-color: rgba(20, 18, 16, 0.08);
  }

  .lds-agent-star {
    border-color: rgba(20, 18, 16, 0.16);
    background: #f5f2ee;
    color: rgba(23, 20, 18, 0.68);
  }

  .lds-agent-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 92;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid rgba(20, 18, 16, 0.1);
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
  }

  .lds-agent-tab {
    display: grid;
    justify-items: center;
    gap: 4px;
    min-height: 56px;
    border: 0;
    background: transparent;
    color: rgba(23, 20, 18, 0.58);
    font-weight: 900;
    cursor: pointer;
  }

  .lds-agent-tab.active {
    color: #f47c20;
  }

  .lds-agent-panel:not(.open) .lds-agent-nav {
    display: none;
  }
}
