.elega-chat {
  position: fixed;
  right: 14px;
  bottom: 138px;
  z-index: 180;
  max-width: calc(100vw - 16px);
  font-family: system-ui, sans-serif;
}

.elega-chat__launcher {
  width: 74px;
  height: 74px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  box-shadow: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  animation: elega-chat-pulse 1.2s ease-out 3;
  transition: transform 0.22s ease, opacity 0.22s ease;
  overflow: visible;
  padding: 0;
}

.elega-chat__launcher-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 10px 22px rgba(15, 32, 19, 0.28));
}

.elega-chat__launcher:hover {
  transform: translateY(-2px);
}

.elega-chat__panel {
  position: absolute;
  right: 0;
  bottom: 0;
  width: min(408px, calc(100vw - 18px));
  max-width: calc(100vw - 18px);
  height: 632px;
  display: none;
  grid-template-rows: auto 1fr auto auto;
  background: linear-gradient(180deg, #fdfefd 0%, #f3f8f4 100%);
  border-radius: 26px;
  overflow: hidden;
  box-shadow: 0 28px 70px rgba(11, 31, 18, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(12px);
}

/* Shared floating UI */
.elega-floating-ui .float-btn {
  position: fixed;
  right: 14px;
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  color: #fff;
  text-decoration: none;
  box-shadow: 0 14px 28px rgba(7, 23, 39, 0.24);
  z-index: 170;
  transition: transform .2s ease, box-shadow .2s ease, opacity .2s ease;
}

.elega-floating-ui .float-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 32px rgba(7, 23, 39, 0.28);
}

.elega-floating-ui .float-btn.phone {
  bottom: 82px;
  background: linear-gradient(135deg, #1f7ae0, #125ec4);
  cursor: pointer;
}

.elega-floating-ui .float-btn.wa {
  bottom: 14px;
  background: linear-gradient(135deg, #25d366, #14914a);
}

.elega-floating-ui .wa-float-wrap {
  position: fixed;
  right: 14px;
  bottom: 14px;
  width: 172px;
  display: grid;
  justify-items: end;
  gap: .45rem;
  z-index: 170;
}

.elega-floating-ui .wa-float-wrap .float-btn.wa {
  position: static;
}

.elega-floating-ui .wa-privacy-note {
  margin: 0;
  font-size: .72rem;
  line-height: 1.3;
  text-align: right;
  color: #39536b;
  background: rgba(255, 255, 255, .95);
  border: 1px solid rgba(191, 209, 224, .9);
  border-radius: 14px;
  padding: .45rem .55rem;
  box-shadow: 0 8px 20px rgba(13, 30, 46, 0.12);
}

.elega-floating-ui .wa-privacy-note a {
  color: #1a6fb0;
}

.elega-floating-ui .cookie-banner {
  position: fixed;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  width: min(980px, calc(100% - 1rem));
  background: rgba(12, 34, 54, .97);
  color: #f3f8ff;
  border: 1px solid rgba(155, 194, 230, .3);
  border-radius: 14px;
  padding: .8rem .9rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  z-index: 220;
  box-shadow: 0 10px 28px rgba(7, 22, 38, .42);
}

.elega-floating-ui .cookie-banner p {
  margin: 0;
  font-size: .92rem;
  line-height: 1.45;
  color: rgba(245, 251, 255, .95);
}

.elega-floating-ui .cookie-banner a {
  color: #a4dbff;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.elega-floating-ui .cookie-actions {
  display: flex;
  gap: .65rem;
  flex-shrink: 0;
}

.elega-floating-ui .cookie-banner.is-hidden {
  display: none;
}

.elega-floating-ui .modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(7, 16, 29, .62);
  backdrop-filter: blur(3px);
  z-index: 240;
}

.elega-floating-ui .modal.open {
  display: flex;
}

.elega-floating-ui .modal-box {
  width: min(440px, 100%);
  background: #fff;
  border-radius: 16px;
  padding: 1.15rem;
  box-shadow: 0 28px 60px rgba(9, 23, 38, .28);
}

.elega-floating-ui .modal-box h3 {
  margin: .1rem 0 .45rem;
  color: #17324e;
}

.elega-floating-ui .modal-box p {
  margin: 0 0 1rem;
  color: #5c6f85;
  line-height: 1.55;
}

.elega-floating-ui .close-modal {
  border: 0;
  background: transparent;
  color: #59708b;
  font-size: 1.75rem;
  line-height: 1;
  float: right;
  cursor: pointer;
}

.elega-floating-ui .call-form {
  display: grid;
  gap: .7rem;
}

.elega-floating-ui .call-form input[type="tel"] {
  width: 100%;
  border: 1px solid #d6dfeb;
  border-radius: 12px;
  padding: .85rem .95rem;
  font: inherit;
}

.elega-floating-ui .call-form .privacy {
  display: flex;
  gap: .55rem;
  align-items: flex-start;
  font-size: .92rem;
  line-height: 1.4;
  color: #4b6178;
}

.elega-floating-ui .call-form .privacy a {
  color: #1a6fb0;
}

body.cookie-visible .elega-floating-ui .float-btn.wa {
  bottom: 112px;
}

body.cookie-visible .elega-floating-ui .float-btn.phone {
  bottom: 180px;
}

body.cookie-visible .elega-floating-ui .wa-float-wrap {
  bottom: 112px;
}

body.chat-widget-open .elega-floating-ui .float-btn,
body.chat-widget-open .elega-floating-ui .wa-float-wrap {
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
}

@media (max-width: 768px) {
  .elega-floating-ui .float-btn {
    width: 46px;
    height: 46px;
    right: 10px;
  }

  .elega-floating-ui .float-btn.phone {
    bottom: 68px;
  }

  .elega-floating-ui .float-btn.wa {
    right: 10px;
    bottom: 12px;
  }

  .elega-floating-ui .wa-float-wrap {
    right: 10px;
    bottom: 12px;
    width: 164px;
  }

  .elega-floating-ui .wa-privacy-note {
    font-size: .68rem;
  }

  body.cookie-visible .elega-floating-ui .float-btn.wa {
    bottom: 152px;
  }

  body.cookie-visible .elega-floating-ui .float-btn.phone {
    bottom: 208px;
  }

  body.cookie-visible .elega-floating-ui .wa-float-wrap {
    bottom: 152px;
  }

  .elega-floating-ui .cookie-banner {
    left: .5rem;
    right: .5rem;
    transform: none;
    width: auto;
    bottom: 10px;
    border-radius: 12px;
    padding: .7rem;
    flex-direction: column;
    align-items: stretch;
    gap: .6rem;
  }

  .elega-floating-ui .cookie-banner p {
    font-size: .84rem;
    line-height: 1.35;
  }

  .elega-floating-ui .cookie-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

.elega-chat.is-open .elega-chat__panel {
  display: grid;
}

.elega-chat.is-open .elega-chat__launcher {
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px) scale(0.96);
}

.elega-chat__header {
  background:
    radial-gradient(circle at top left, rgba(115, 213, 148, 0.28), transparent 34%),
    linear-gradient(135deg, #19492d 0%, #215e38 58%, #1d5333 100%);
  color: #fff;
  padding: 12px 14px 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.elega-chat__header-copy {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.elega-chat__header-copy strong {
  font-size: 1.02rem;
  line-height: 1.15;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  font-weight: 800;
}

.elega-chat__header-copy span {
  font-size: 0.75rem;
  opacity: 0.9;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.elega-chat__brand-image {
  width: 30px;
  height: 30px;
  display: block;
  border-radius: 0;
  object-fit: contain;
  flex: 0 0 30px;
  filter: drop-shadow(0 3px 8px rgba(7, 27, 14, 0.18));
}

.elega-chat__status-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #9df0b0;
  box-shadow: 0 0 0 4px rgba(157, 240, 176, 0.14);
  animation: elega-chat-status 1.8s ease-in-out infinite;
}

.elega-chat__header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.elega-chat__reset,
.elega-chat__close {
  border: 0;
  cursor: pointer;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.elega-chat__reset {
  padding: 9px 12px;
  border-radius: 999px;
  font-size: 0.71rem;
  font-weight: 700;
  white-space: nowrap;
}

.elega-chat__close {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  font-size: 1.15rem;
  line-height: 1;
}

.elega-chat__reset:hover,
.elega-chat__close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.elega-chat__legal {
  color: #6a7f71;
  font-size: 0.62rem;
  line-height: 1.2;
  text-align: center;
}

.elega-chat__legal--footer {
  padding: 2px 14px 8px;
}

.elega-chat__legal a {
  color: #1b5f97;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.elega-chat__messages {
  padding: 16px 16px 14px;
  overflow-y: auto;
  background:
    radial-gradient(circle at top right, rgba(120, 212, 150, 0.08), transparent 32%),
    linear-gradient(180deg, #ffffff 0%, #f6faf6 100%);
}

.elega-chat__message {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.elega-chat__message--user {
  align-items: flex-end;
}

.elega-chat__message--bot {
  align-items: flex-start;
}

.elega-chat__bubble {
  max-width: 88%;
  padding: 13px 15px;
  border-radius: 20px;
  line-height: 1.44;
  font-size: 0.94rem;
  white-space: pre-line;
  word-break: break-word;
  background: rgba(255, 255, 255, 0.94);
  color: #183323;
  border: 1px solid rgba(26, 77, 46, 0.06);
  box-shadow: 0 10px 26px rgba(19, 41, 24, 0.06);
}

.elega-chat__message--user .elega-chat__bubble {
  background: linear-gradient(135deg, #1b542f 0%, #215f38 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 14px 28px rgba(26, 77, 46, 0.2);
  border-bottom-right-radius: 10px;
}

.elega-chat__message--bot .elega-chat__bubble {
  border-bottom-left-radius: 10px;
}

.elega-chat__meta {
  font-size: 0.72rem;
  color: rgba(24, 51, 35, 0.56);
  padding-inline: 8px;
}

.elega-chat__message--user .elega-chat__meta {
  text-align: right;
}

.elega-chat__bubble--typing {
  min-width: 68px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.elega-chat__bubble--typing span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #1a4d2e;
  opacity: 0.35;
  animation: elega-chat-dots 1.2s infinite ease-in-out;
}

.elega-chat__bubble--typing span:nth-child(2) {
  animation-delay: 0.15s;
}

.elega-chat__bubble--typing span:nth-child(3) {
  animation-delay: 0.3s;
}

.elega-chat__actions,
.elega-chat__chips,
.elega-chat__quick-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.elega-chat__actions,
.elega-chat__chips {
  max-width: 90%;
}

.elega-chat__quick-buttons {
  padding: 0 16px 12px;
  background: linear-gradient(180deg, rgba(246, 250, 246, 0) 0%, #f7faf7 60%);
}

.elega-chat__action-btn,
.elega-chat__chip,
.elega-chat__quick-btn {
  border: 1px solid rgba(26, 77, 46, 0.75);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #1a4d2e;
  text-decoration: none;
  font: inherit;
  font-size: 0.82rem;
  line-height: 1.25;
  padding: 9px 13px;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 6px 16px rgba(19, 41, 24, 0.04);
}

.elega-chat__chip,
.elega-chat__quick-btn {
  cursor: pointer;
}

.elega-chat__action-btn:hover,
.elega-chat__chip:hover,
.elega-chat__quick-btn:hover {
  background: #1a4d2e;
  color: #fff;
  transform: translateY(-1px);
}

.elega-chat__composer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 12px 16px 16px;
  border-top: 1px solid rgba(26, 77, 46, 0.06);
  background: rgba(252, 254, 252, 0.86);
  backdrop-filter: blur(10px);
}

.elega-chat__input {
  width: 100%;
  min-height: 46px;
  border: 1px solid #d4e2d7;
  border-radius: 16px;
  padding: 0 14px;
  font: inherit;
  font-size: 0.92rem;
  color: #1a1a1a;
  background: rgba(255, 255, 255, 0.96);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.elega-chat__input:focus {
  border-color: #1a4d2e;
  box-shadow: 0 0 0 3px rgba(26, 77, 46, 0.12);
}

.elega-chat__send {
  min-width: 46px;
  min-height: 46px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, #1a4d2e 0%, #215f38 100%);
  color: #fff;
  cursor: pointer;
  font-size: 1rem;
  box-shadow: 0 12px 26px rgba(26, 77, 46, 0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.elega-chat__send:disabled,
.elega-chat__input:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.elega-chat__send:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(26, 77, 46, 0.26);
}

.elega-chat__table-wrap {
  max-width: 100%;
  overflow: visible;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.elega-chat__table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 10px;
  font-size: 0.84rem;
}

.elega-chat__table thead {
  display: none;
}

.elega-chat__table tbody {
  display: grid;
  gap: 10px;
}

.elega-chat__table tr {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  background: #ffffff;
  border: 1px solid rgba(26, 77, 46, 0.08);
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 8px 18px rgba(19, 41, 24, 0.05);
}

.elega-chat__table td {
  padding: 0;
  text-align: left;
  vertical-align: top;
  word-break: normal;
  overflow-wrap: normal;
  hyphens: none;
}

.elega-chat__table td::before {
  content: attr(data-label);
  display: block;
  margin-bottom: 6px;
  color: #1a4d2e;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.elega-chat__table td a {
  color: #1a4d2e;
  font-weight: 700;
  text-decoration: none;
  word-break: normal;
}

.elega-chat__table-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  min-width: 96px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(26, 77, 46, 0.72);
  background: #f8fbf8;
  font-size: 0.76rem;
  white-space: nowrap;
  gap: 6px;
}

.elega-chat__contact-cell {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
  min-width: 112px;
}

.elega-chat__table-link--phone {
  min-width: 0;
  justify-content: flex-start;
  padding-inline: 10px 12px;
}

.elega-chat__table-link--phone span:last-child {
  white-space: nowrap;
}

.elega-chat__table-link--web {
  min-width: 82px;
}

@media (max-width: 720px) {
  .elega-chat {
    right: 14px;
    bottom: 134px;
  }

  .elega-chat.is-open {
    position: fixed;
    inset: 0;
    right: auto;
    bottom: auto;
    display: grid;
    place-items: center;
    padding: 12px;
    background: rgba(9, 18, 12, 0.18);
  }

  .elega-chat.is-open .elega-chat__panel {
    position: relative;
    right: auto;
    bottom: auto;
    width: 95vw;
    height: min(86vh, 700px);
    max-width: 420px;
  }

  .elega-chat.is-open .elega-chat__launcher {
    display: none;
  }

  .elega-chat__bubble,
  .elega-chat__actions,
  .elega-chat__chips {
    max-width: 100%;
  }

  .elega-chat__header {
    padding: 12px 13px;
  }

  .elega-chat__legal {
    font-size: 0.61rem;
  }

  .elega-chat__legal--footer {
    padding: 2px 12px 8px;
  }

  .elega-chat__header-copy strong {
    font-size: 0.98rem;
    white-space: normal;
  }

  .elega-chat__reset {
    font-size: 0.66rem;
    padding: 7px 10px;
  }

  .elega-chat__table tr {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 12px;
  }

  .elega-chat__table td {
    margin-bottom: 10px;
    line-height: 1.42;
  }

  .elega-chat__table td:last-child {
    margin-bottom: 0;
  }

  .elega-chat__table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 5px;
    color: #1a4d2e;
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
  }

  .elega-chat__table-link {
    width: auto;
    min-width: 0;
    padding-inline: 12px;
  }

  .elega-chat__contact-cell {
    gap: 10px;
    min-width: 0;
  }

  .elega-chat__table-link--phone,
  .elega-chat__table-link--web {
    width: 100%;
    justify-content: center;
  }
}

@keyframes elega-chat-pulse {
  0% {
    transform: scale(1);
    filter: drop-shadow(0 10px 22px rgba(15, 32, 19, 0.28));
  }

  70% {
    transform: scale(1.06);
    filter: drop-shadow(0 18px 34px rgba(15, 32, 19, 0.22));
  }

  100% {
    transform: scale(1);
    filter: drop-shadow(0 10px 22px rgba(15, 32, 19, 0.28));
  }
}

@keyframes elega-chat-dots {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.3;
  }

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

@keyframes elega-chat-status {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.18);
    opacity: 0.82;
  }
}
