button.hero-goal { font-family: inherit; cursor: pointer; }

.abby-chat {
  --abby-accent: #8edce6;
  --abby-border: #303741;
  position: fixed;
  inset: auto 20px 20px auto;
  width: min(400px, calc(100vw - 40px));
  height: min(600px, calc(var(--abby-viewport-height, 100dvh) - 40px));
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  color: #f4f5f7;
  background: var(--bg, #080809);
  border: 1px solid var(--abby-border);
  border-radius: 18px;
  box-shadow: 0 14px 45px #000b;
  font-family: inherit;
  font-size: 16px;
  line-height: 1.45;
}

.abby-chat[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  animation: abby-enter 160ms ease-out both;
}

.abby-chat::backdrop { background: transparent; }
html.abby-chat-open { overflow: hidden; }
@keyframes abby-enter { from { transform: translateY(14px); opacity: .55; } to { transform: translateY(0); opacity: 1; } }

.abby-chat-header {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 36px;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--abby-border);
  background: var(--panel, #111114);
}

.abby-chat-header img { width: 40px; height: 40px; object-fit: cover; object-position: center 28%; border-radius: 50%; border: 1px solid var(--abby-accent); }
.abby-chat-header h2 { margin: 0; color: inherit; font-size: 16px; font-weight: 700; line-height: 1.2; letter-spacing: 0; }
.abby-chat-header p { margin: 4px 0 0; color: #b9c0cb; font-size: 12px; line-height: 1.2; }

.abby-chat-close, .abby-chat-form button {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--abby-border);
  border-radius: 10px;
  color: inherit;
  background: var(--panel, #111114);
  cursor: pointer;
  font: inherit;
}

.abby-chat-close { width: 36px; height: 36px; }
.abby-chat :is(button, a, textarea):focus-visible { outline: 2px solid var(--abby-accent); outline-offset: 2px; }

.abby-chat-scroll { overflow-y: auto; overscroll-behavior: contain; padding: 14px 12px; }
.abby-chat-messages { display: grid; gap: 8px; }
.abby-chat-bubble, .abby-chat-status {
  width: fit-content;
  max-width: 92%;
  margin: 0;
  padding: 9px 12px;
  border-radius: 13px 13px 13px 4px;
  color: #f4f5f7;
  background: #23262c;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 16px;
}
.abby-chat-bubble.is-person { justify-self: end; color: #081214; background: var(--abby-accent); border-radius: 13px 13px 4px; }
.abby-chat-bubble.is-pablo { border-left: 3px solid #a9d8b2; }
.abby-chat-sender { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; font-size: 12px; font-weight: 600; }
.abby-chat-sender img { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; object-position: center 28%; }
.abby-chat-bubble a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.abby-chat-status { display: flex; align-items: center; gap: 9px; margin-top: 8px; color: #d8dce2; }
.abby-chat-status[hidden] { display: none; }
.abby-chat-dots { display: inline-flex; gap: 3px; }
.abby-chat-dots i { display: block; width: 4px; height: 4px; border-radius: 50%; background: currentColor; animation: abby-tick 1s infinite alternate; }
.abby-chat-dots i:nth-child(2) { animation-delay: .18s; }
.abby-chat-dots i:nth-child(3) { animation-delay: .36s; }
@keyframes abby-tick { from { opacity: .3; } to { opacity: 1; } }

.abby-chat-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
  min-height: 61px;
  padding: 8px;
  border-top: 1px solid var(--abby-border);
  background: var(--panel, #111114);
}
.abby-chat-action {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  min-height: 32px;
  padding: 5px 9px;
  border: 0;
  border-radius: 999px;
  color: #081214;
  background: var(--abby-accent);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
}
.abby-chat-actions .abby-chat-action {
  justify-content: center;
  min-width: 0;
  min-height: 44px;
  padding: 6px 14px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  white-space: normal;
  text-wrap: balance;
  overflow-wrap: anywhere;
}
.abby-chat-actions .abby-chat-action:is([data-action="whatsapp"], :only-child) { grid-column: 1 / -1; }
.abby-chat-action[data-action="llamame"] { background: #a9d8b2; }
.abby-chat-action[data-action="whatsapp"] { background: #dfa6c8; }
.abby-chat-action:is(:disabled, [aria-disabled="true"]) { opacity: .55; cursor: default; }
.abby-chat-retry { justify-self: start; }

.abby-chat-form {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px max(10px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--abby-border);
  background: var(--panel, #111114);
}

.abby-chat-form textarea {
  flex: 1;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 8px 10px;
  resize: none;
  color: #f4f5f7;
  background: #191d24;
  border: 1px solid #465261;
  border-radius: 10px;
  font: inherit;
  font-size: 16px;
  line-height: 22px;
}
.abby-chat-form textarea::placeholder { color: #acb7c4; }
.abby-chat-form button { color: #081214; background: var(--abby-accent); }
.abby-chat-form button:disabled { opacity: .42; cursor: default; }

@media (max-width: 800px) {
  .abby-chat {
    inset: auto auto var(--abby-viewport-bottom, 0px) var(--abby-viewport-left, 0px);
    width: var(--abby-viewport-width, 100vw);
    height: min(88dvh, var(--abby-viewport-height, 100dvh));
    border-radius: 17px 17px 0 0;
  }
  .abby-chat::backdrop { background: #0009; }
  .abby-chat-actions .abby-chat-action { font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  .abby-chat[open], .abby-chat-dots i { animation: none; }
}
