.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.chat-widget {
  position: fixed;
  z-index: 110;
  right: auto;
  left: 22px;
  bottom: 22px;
  font-size: 15px;
  line-height: 1.45;
}

.chat-launcher {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 215px;
  min-height: 58px;
  padding: 9px 43px 9px 9px;
  border: 1px solid rgba(240, 210, 75, .38);
  border-radius: 17px;
  background: #151923;
  color: var(--text);
  box-shadow: 0 18px 46px rgba(0, 0, 0, .42);
  cursor: pointer;
  text-align: left;
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}

.chat-launcher:hover {
  transform: translateY(-3px);
  border-color: var(--gold);
  background: #1a1f2b;
}

.chat-launcher:focus-visible,
.chat-icon-button:focus-visible,
.chat-choice:focus-visible,
.chat-whatsapp:focus-visible,
.chat-form input:focus-visible,
.chat-form button:focus-visible {
  outline: 3px solid rgba(240, 210, 75, .45);
  outline-offset: 2px;
}

.chat-launcher-icon {
  display: grid;
  flex: 0 0 41px;
  width: 41px;
  height: 41px;
  place-items: center;
  border-radius: 13px;
  background: var(--gold);
  color: #121212;
}

.chat-launcher-icon svg { width: 23px; fill: currentColor; }
.chat-launcher-copy { display: flex; flex-direction: column; }
.chat-launcher-copy strong { font-size: .88rem; line-height: 1.25; }
.chat-launcher-copy small { margin-top: 2px; color: #989da7; font-size: .68rem; }
.chat-notification {
  position: absolute;
  top: -7px;
  right: -7px;
  display: grid;
  width: 23px;
  height: 23px;
  place-items: center;
  border: 3px solid var(--bg);
  border-radius: 50%;
  background: #ef4b4b;
  color: white;
  font-size: .65rem;
  font-weight: 800;
}

.chat-panel {
  position: absolute;
  right: auto;
  left: 0;
  bottom: 75px;
  display: grid;
  width: min(390px, calc(100vw - 30px));
  height: min(650px, calc(100vh - 115px));
  grid-template-rows: auto 1fr auto auto;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 22px;
  background: #0e121a;
  box-shadow: 0 28px 90px rgba(0, 0, 0, .58);
  transform-origin: bottom left;
  animation: chat-in .22s ease both;
}

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

@keyframes chat-in {
  from { opacity: 0; transform: translateY(14px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.chat-header {
  display: grid;
  grid-template-columns: 43px 1fr 35px 35px;
  gap: 9px;
  align-items: center;
  min-height: 72px;
  padding: 12px 13px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, #181d28, #121620);
}

.chat-avatar {
  display: grid;
  width: 43px;
  height: 43px;
  place-items: center;
  border: 1px solid rgba(240, 210, 75, .42);
  border-radius: 14px;
  background: rgba(240, 210, 75, .10);
  color: var(--gold);
  font-size: .73rem;
  font-weight: 900;
  letter-spacing: -.03em;
}

.chat-heading { display: flex; min-width: 0; flex-direction: column; }
.chat-heading strong { overflow: hidden; color: #fff; font-size: .84rem; text-overflow: ellipsis; white-space: nowrap; }
.chat-heading span { display: flex; align-items: center; gap: 6px; margin-top: 3px; color: #969ca6; font-size: .65rem; }
.chat-heading i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(36, 211, 102, .12); }

.chat-icon-button {
  display: grid;
  width: 35px;
  height: 35px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #9ea3ac;
  cursor: pointer;
}

.chat-icon-button:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.chat-icon-button svg { width: 18px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }

.chat-messages {
  min-height: 0;
  padding: 18px 14px 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: #343b49 transparent;
  scrollbar-width: thin;
}

.chat-message { display: flex; margin-bottom: 12px; }
.chat-message.user { justify-content: flex-end; }
.chat-bubble {
  max-width: 91%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 5px 16px 16px 16px;
  background: #171c27;
  color: #e9e9e7;
  font-size: .79rem;
}

.chat-message.user .chat-bubble {
  max-width: 83%;
  border-color: rgba(240, 210, 75, .28);
  border-radius: 16px 16px 5px 16px;
  background: rgba(240, 210, 75, .12);
  color: #fff;
}

.chat-bubble p { margin: 0; color: inherit; }
.chat-bubble p + p { margin-top: 8px; }
.chat-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 11px; }
.chat-choice {
  padding: 7px 10px;
  border: 1px solid rgba(240, 210, 75, .28);
  border-radius: 999px;
  background: rgba(240, 210, 75, .06);
  color: #ede9d3;
  cursor: pointer;
  font-size: .69rem;
  font-weight: 700;
  line-height: 1.3;
}

.chat-choice:hover { border-color: var(--gold); background: rgba(240, 210, 75, .13); color: #fff; }
.chat-whatsapp {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 11px;
  padding: 9px 10px;
  border-radius: 10px;
  background: #1fb857;
  color: white;
  font-size: .7rem;
  font-weight: 800;
  line-height: 1.3;
  text-align: center;
  transition: background .2s ease, transform .2s ease;
}

.chat-whatsapp:hover { transform: translateY(-1px); background: #24c863; }
.chat-whatsapp span { font-size: .9rem; }

.chat-form {
  display: grid;
  grid-template-columns: 1fr 42px;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  background: #121620;
}

.chat-form input {
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0b0e14;
  color: #fff;
  font-size: .78rem;
}

.chat-form input::placeholder { color: #747a85; }
.chat-form input:focus { border-color: var(--line-gold); outline: 0; }
.chat-form button {
  display: grid;
  width: 42px;
  height: 42px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 12px;
  background: var(--gold);
  color: #151515;
  cursor: pointer;
}
.chat-form button:hover { background: #f6dc65; }
.chat-form button svg { width: 20px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.chat-privacy { margin: 0; padding: 0 12px 9px; background: #121620; color: #6f7580; font-size: .59rem; text-align: center; }

body.chat-open .whatsapp-float { opacity: 0; pointer-events: none; transform: translateY(8px); }
.whatsapp-float { transition: opacity .2s ease, transform .2s ease; }

@media (max-width: 620px) {
  body.chat-open { overflow: hidden; }
  .chat-widget { right: auto; left: 14px; bottom: 14px; }
  .chat-launcher { min-width: 204px; min-height: 55px; }
  .chat-panel {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100dvh;
    max-height: none;
    border: 0;
    border-radius: 0;
  }
  .chat-header { padding-top: max(12px, env(safe-area-inset-top)); }
  .chat-messages { padding-bottom: 18px; }
  .chat-form { padding-bottom: 10px; }
  .chat-privacy { padding-bottom: max(8px, env(safe-area-inset-bottom)); }
  .whatsapp-float { right: 14px; bottom: 16px; width: 48px; height: 48px; }
}

@media (max-width: 390px) {
  .chat-launcher { min-width: 190px; padding-right: 34px; }
  .chat-launcher-copy strong { font-size: .8rem; }
}

@media (prefers-reduced-motion: reduce) {
  .chat-panel { animation: none; }
}
