:root {
  --amanda-blue: #0e9ee0;
  --amanda-blue-dark: #0a78ad;
  --amanda-navy: #060d19;
  --amanda-ink: #0d131e;
  --amanda-muted: #697386;
  --amanda-soft: #eaf6fd;
  --amanda-white: #fff;
}

.amanda-launcher {
  position: fixed;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 1200;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 9px 18px 9px 9px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  color: var(--amanda-white);
  background: var(--amanda-navy);
  box-shadow: 0 18px 46px rgba(6,13,25,.3);
  font: 600 15px/1 Inter, system-ui, sans-serif;
  cursor: pointer;
}

.amanda-launcher:hover { background: #0b1829; transform: translateY(-2px); }
.amanda-launcher:focus-visible, .amanda-chat button:focus-visible, .amanda-chat textarea:focus-visible,
.amanda-chat input:focus-visible { outline: 3px solid rgba(14,158,224,.35); outline-offset: 2px; }
.amanda-launcher-mark { display:grid; place-items:center; width:40px; height:40px; border-radius:50%; background:var(--amanda-blue); font:700 19px/1 "Space Grotesk",sans-serif; }
.amanda-launcher-dot { width:8px; height:8px; border-radius:50%; background:var(--amanda-blue); box-shadow:0 0 0 4px rgba(14,158,224,.15); }

.amanda-chat {
  position: fixed;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(92px, calc(env(safe-area-inset-bottom) + 82px));
  z-index: 1201;
  display: grid;
  grid-template-rows: auto 1fr auto;
  width: min(390px, calc(100vw - 32px));
  height: min(650px, calc(100dvh - 120px));
  overflow: hidden;
  border: 1px solid rgba(13,19,30,.1);
  border-radius: 24px;
  background: var(--amanda-white);
  box-shadow: 0 28px 80px rgba(6,13,25,.28);
  color: var(--amanda-ink);
  font: 400 15px/1.5 Inter, system-ui, sans-serif;
  transform: translateY(14px) scale(.98);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .25s ease;
}
.amanda-chat.is-open { opacity:1; transform:none; pointer-events:auto; }
.amanda-chat-head { display:flex; align-items:center; gap:12px; padding:16px; color:#fff; background:var(--amanda-navy); }
.amanda-chat-avatar { display:grid; place-items:center; width:42px; height:42px; flex:0 0 auto; border-radius:50%; background:var(--amanda-blue); font:700 20px/1 "Space Grotesk",sans-serif; }
.amanda-chat-title { min-width:0; flex:1; }
.amanda-chat-title strong { display:block; font:600 18px/1.2 "Space Grotesk",sans-serif; }
.amanda-chat-status { display:flex; align-items:center; gap:7px; margin-top:3px; color:#c9d4e2; font-size:12px; }
.amanda-chat-close { display:grid; place-items:center; width:38px; height:38px; border:0; border-radius:12px; color:#fff; background:rgba(255,255,255,.08); font-size:23px; cursor:pointer; }
.amanda-chat-close:hover { background:rgba(255,255,255,.15); }

.amanda-chat-body { overflow-y:auto; padding:18px; background:linear-gradient(180deg,#f8fcff 0%,#fff 36%); }
.amanda-message { width:fit-content; max-width:88%; margin:0 0 12px; padding:11px 14px; border-radius:17px; white-space:pre-wrap; overflow-wrap:anywhere; }
.amanda-message.bot { border:1px solid #dbeaf3; border-bottom-left-radius:5px; background:#fff; }
.amanda-message.user { margin-left:auto; border-bottom-right-radius:5px; color:#fff; background:var(--amanda-blue-dark); }
.amanda-message.error { border-color:#d8e0e8; color:#465160; background:#f5f7f9; }
.amanda-typing { display:flex; gap:5px; width:56px; padding:14px; border:1px solid #dbeaf3; border-radius:17px 17px 17px 5px; background:#fff; }
.amanda-typing span { width:6px; height:6px; border-radius:50%; background:var(--amanda-blue); animation:amanda-bounce 1s infinite ease-in-out; }
.amanda-typing span:nth-child(2){animation-delay:.14s}.amanda-typing span:nth-child(3){animation-delay:.28s}
@keyframes amanda-bounce { 0%,60%,100%{transform:none;opacity:.4} 30%{transform:translateY(-4px);opacity:1} }

.amanda-contact { margin:6px 0 14px; padding:14px; border:1px solid #d9e9f2; border-radius:16px; background:var(--amanda-soft); }
.amanda-contact p { margin:0 0 10px; font-size:13px; color:#415264; }
.amanda-contact-grid { display:grid; gap:8px; }
.amanda-contact input { width:100%; min-height:42px; padding:9px 11px; border:1px solid #cbdbe5; border-radius:10px; color:var(--amanda-ink); background:#fff; font:inherit; }
.amanda-contact-actions { display:flex; gap:8px; margin-top:9px; }
.amanda-contact button { min-height:38px; padding:8px 12px; border:0; border-radius:10px; font:600 13px/1 Inter,sans-serif; cursor:pointer; }
.amanda-contact-save { color:#fff; background:var(--amanda-blue-dark); }
.amanda-contact-skip { color:#334155; background:rgba(255,255,255,.7); }

.amanda-chat-form { padding:12px; border-top:1px solid #e4ebf0; background:#fff; }
.amanda-chat-compose { display:flex; align-items:flex-end; gap:8px; }
.amanda-chat textarea { width:100%; min-height:46px; max-height:120px; resize:none; padding:11px 13px; border:1px solid #cfdbe4; border-radius:14px; color:var(--amanda-ink); background:#fff; font:inherit; }
.amanda-send { display:grid; place-items:center; width:46px; height:46px; flex:0 0 auto; border:0; border-radius:14px; color:#fff; background:var(--amanda-blue); font-size:20px; cursor:pointer; }
.amanda-send:hover { background:var(--amanda-blue-dark); }
.amanda-send:disabled, .amanda-chat textarea:disabled { cursor:not-allowed; opacity:.55; }
.amanda-chat-note { margin:7px 4px 0; color:var(--amanda-muted); font-size:10px; text-align:center; }

@media (max-width: 560px) {
  .amanda-launcher { right:14px; bottom:14px; padding-right:14px; }
  .amanda-chat { inset:0; width:100%; height:100dvh; border:0; border-radius:0; }
}
@media (prefers-reduced-motion: reduce) {
  .amanda-chat, .amanda-launcher, .amanda-typing span { transition:none; animation:none; }
}
