.live-chat {
  --chat-accent: #f2b84b;
  --chat-ink: #f7f9fc;
  --chat-muted: #9ba8bb;
  --chat-line: rgba(255, 255, 255, 0.1);
}

.chat {
  height: min(640px, 80dvh);
  min-height: 480px;
  background: rgba(12, 24, 40, 0.96);
  border: 1px solid var(--chat-line);
  border-radius: 16px;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto;
  color: var(--chat-ink);
  box-shadow: 0 20px 50px rgba(7, 17, 31, 0.18);
}

.chat header {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--chat-line);
  background: rgba(255, 255, 255, 0.03);
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: var(--chat-accent);
  color: #17202b;
  display: grid;
  place-items: center;
  font-weight: 900;
}

.chat header div:nth-child(2) {
  display: grid;
  gap: 4px;
}

.chat header strong {
  font-size: 15px;
  color: var(--chat-ink);
}

.chat header span {
  font-size: 12px;
  color: var(--chat-muted);
}

.chat header i {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4bd28f;
  margin-right: 5px;
  box-shadow: 0 0 0 4px rgba(75, 210, 143, 0.1);
}

.reset {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: #9eacbd;
  font-size: 22px;
  cursor: pointer;
}

.messages {
  padding: 20px;
  overflow: auto;
  scroll-behavior: smooth;
}

.day {
  text-align: center;
  color: #748397;
  font-size: 11px;
  margin-bottom: 20px;
}

.bubble {
  max-width: 82%;
  margin: 0 0 14px;
}

.bubble p {
  padding: 13px 16px;
  margin: 0;
  border-radius: 7px 17px 17px 17px;
  background: #18283a;
  color: #e5eaf1;
  line-height: 1.5;
  font-size: 14px;
  white-space: pre-wrap;
}

.bubble time {
  display: block;
  font-size: 10px;
  color: #728196;
  margin: 6px 8px;
}

.bubble.user {
  margin-left: auto;
}

.bubble.user p {
  background: var(--chat-accent);
  color: #17202b;
  border-radius: 17px 7px 17px 17px;
}

.bubble.user time {
  text-align: right;
}

.bubble.pending {
  opacity: 0.65;
}

.chat form {
  border-top: 1px solid var(--chat-line);
  padding: 14px 18px 16px;
}

.identity {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

.identity label {
  font-size: 10px;
  color: #9eacbd;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.identity input {
  display: block;
  width: 100%;
  margin-top: 6px;
  background: #101f30;
  border: 1px solid var(--chat-line);
  border-radius: 10px;
  padding: 11px;
  color: #fff;
  outline: none;
}

.identity input:focus,
.composer:focus-within {
  border-color: var(--chat-accent);
}

.composer {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  background: #101f30;
  border: 1px solid var(--chat-line);
  border-radius: 14px;
  padding: 9px;
}

.composer textarea {
  flex: 1;
  resize: none;
  max-height: 120px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
  padding: 7px;
  font: inherit;
  line-height: 1.45;
}

.composer button {
  border: 0;
  border-radius: 10px;
  background: var(--chat-accent);
  color: #17202b;
  height: 40px;
  padding: 0 14px;
  font-weight: 800;
  cursor: pointer;
}

.composer button b {
  display: none;
}

.composer button:active {
  transform: translateY(1px);
}

.status {
  text-align: center;
  margin: 9px 0 0;
  color: #77869a;
  font-size: 10px;
}

.status.error {
  color: #ff8f8f;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

@media (max-width: 800px) {
  .chat {
    height: min(560px, 72dvh);
    min-height: 420px;
  }

  .messages {
    padding: 16px;
  }

  .identity {
    grid-template-columns: 1fr;
  }

  .composer button span {
    display: none;
  }

  .composer button b {
    display: block;
    font-size: 18px;
  }

  .chat form {
    padding-bottom: max(14px, env(safe-area-inset-bottom));
  }
}

@media (prefers-reduced-motion: reduce) {
  .messages {
    scroll-behavior: auto;
  }
}

/* Affiliate recommendation message: disclosed, accessible and visually distinct from support replies. */
.offer-message{opacity:0;transform:translateY(8px);transition:opacity .28s ease,transform .28s ease}
.offer-message.is-visible{opacity:1;transform:none}
.offer-message>p{border-radius:7px 17px 8px 8px}
.offer-card{display:grid;gap:7px;margin-top:-9px;padding:14px 15px 15px;background:linear-gradient(145deg,#132d3c,#102536);border:1px solid rgba(242,184,75,.34);border-radius:8px 8px 17px 17px;box-shadow:0 14px 34px rgba(0,0,0,.18)}
.offer-card .offer-meta{width:max-content;color:var(--accent);font-size:9px;font-weight:800;letter-spacing:.11em;text-transform:uppercase}
.offer-card strong{color:#fff;font-size:15px;line-height:1.3}
.offer-card small{color:#b7c3d1;font-size:11px;line-height:1.45}
.offer-card a{display:flex;align-items:center;justify-content:center;min-height:42px;margin-top:4px;padding:10px 16px;border-radius:10px;background:var(--accent);color:#17202b;font-size:13px;font-weight:900;text-decoration:none;white-space:nowrap;box-shadow:0 8px 20px rgba(242,184,75,.16);transition:transform .16s ease,filter .16s ease}
.offer-card a:hover{filter:brightness(1.06)}
.offer-card a:focus-visible{outline:3px solid #fff;outline-offset:2px}
.offer-card a:active{transform:translateY(1px)}
.offer-card .offer-disclosure{color:#8796a9;font-size:9px}
@media(max-width:800px){.offer-message{max-width:94%}.offer-card a{min-height:44px}}
@media(prefers-reduced-motion:reduce){.offer-message{opacity:1;transform:none;transition:none}.offer-card a{transition:none}}
