/* ==========================================================================
   H&M Automotive Security — AI chat widget (dark theme)
   ========================================================================== */
.hmchat, .hmchat * { box-sizing: border-box; }
.hmchat svg { display: block; }

/* Launcher */
.hmchat-launch {
  position: fixed; right: 20px; bottom: 20px; z-index: 95;
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--red,#e2131a); color: #fff; border: 0; cursor: pointer;
  font-family: var(--display,sans-serif); font-weight: 600; letter-spacing: .5px;
  text-transform: uppercase; font-size: .9rem;
  padding: 13px 20px 13px 16px; border-radius: 999px;
  box-shadow: 0 10px 26px rgba(0,0,0,.4);
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.hmchat-launch:hover { transform: translateY(-2px) scale(1.04); background: var(--red-600,#c20f16); box-shadow: 0 14px 32px rgba(0,0,0,.5); }
.hmchat-launch .ic { display: grid; place-items: center; width: 20px; height: 20px; }
.hmchat-launch[hidden] { display: none; }

/* Panel */
.hmchat-panel {
  position: fixed; right: 20px; bottom: 20px; z-index: 96;
  width: 380px; max-width: calc(100vw - 32px); height: 600px; max-height: calc(100vh - 40px);
  background: var(--surface,#141518); border-radius: 20px; overflow: hidden; display: none; flex-direction: column;
  box-shadow: 0 30px 70px rgba(0,0,0,.55); border: 1px solid var(--border-strong,rgba(255,255,255,.16));
  font-family: var(--body,sans-serif);
}
.hmchat-panel.is-open { display: flex; animation: hmchat-in .22s ease; }
@keyframes hmchat-in { from { opacity:0; transform: translateY(14px) scale(.98); } to { opacity:1; transform:none; } }

/* Header */
.hmchat-head { background: linear-gradient(135deg,#1a1c20,#0c0d10); color:#fff; padding:16px 18px; display:flex; align-items:center; gap:12px; border-bottom:1px solid var(--border,rgba(255,255,255,.09)); }
.hmchat-head .av { width:44px; height:44px; border-radius:50%; background:#000; border:1px solid var(--border,rgba(255,255,255,.09)); flex:none; padding:4px; }
.hmchat-head h4 { margin:0; font-family: var(--display,sans-serif); font-size:1.02rem; color:#fff; letter-spacing:.5px; }
.hmchat-head p { margin:2px 0 0; font-size:.78rem; color: var(--muted,#a2a7b0); display:flex; align-items:center; gap:6px; }
.hmchat-head .online { width:8px; height:8px; border-radius:50%; background:#25d366; display:inline-block; box-shadow:0 0 0 3px rgba(37,211,102,.25); }
.hmchat-head .close { margin-left:auto; background:rgba(255,255,255,.12); border:0; color:#fff; width:32px; height:32px; border-radius:9px; cursor:pointer; font-size:1.1rem; line-height:1; display:grid; place-items:center; }
.hmchat-head .close:hover { background:rgba(255,255,255,.24); }

/* Messages */
.hmchat-body { flex:1; overflow-y:auto; padding:18px; background: var(--bg-2,#0e0f12); display:flex; flex-direction:column; gap:12px; }
.hmchat-msg { max-width:82%; padding:11px 14px; border-radius:15px; font-size:.95rem; line-height:1.5; white-space:pre-wrap; word-wrap:break-word; }
.hmchat-msg.bot { background: var(--surface-2,#1a1c20); color:#eef0f3; border:1px solid var(--border,rgba(255,255,255,.09)); border-bottom-left-radius:5px; align-self:flex-start; }
.hmchat-msg.user { background: var(--red,#e2131a); color:#fff; border-bottom-right-radius:5px; align-self:flex-end; }
.hmchat-typing { align-self:flex-start; background: var(--surface-2,#1a1c20); border:1px solid var(--border,rgba(255,255,255,.09)); border-radius:15px; border-bottom-left-radius:5px; padding:13px 16px; display:inline-flex; gap:4px; }
.hmchat-typing span { width:7px; height:7px; border-radius:50%; background: var(--muted,#a2a7b0); animation: hmchat-bounce 1.2s infinite ease-in-out; }
.hmchat-typing span:nth-child(2) { animation-delay:.15s; }
.hmchat-typing span:nth-child(3) { animation-delay:.3s; }
@keyframes hmchat-bounce { 0%,60%,100% { transform: translateY(0); opacity:.5; } 30% { transform: translateY(-5px); opacity:1; } }

/* Chips */
.hmchat-chips { display:flex; flex-wrap:wrap; gap:8px; padding:0 18px 4px; background: var(--bg-2,#0e0f12); }
.hmchat-chip { background: var(--surface-2,#1a1c20); border:1px solid var(--border-strong,rgba(255,255,255,.16)); color:#e9eaec; font-family: var(--display,sans-serif); font-weight:500; letter-spacing:.3px; font-size:.88rem; padding:9px 14px; border-radius:999px; cursor:pointer; transition:.12s; }
.hmchat-chip:hover { background: var(--red,#e2131a); color:#fff; border-color: var(--red,#e2131a); }
.hmchat-chip.go { background:#25d366; border-color:#25d366; color:#07321a; display:inline-flex; align-items:center; gap:8px; }
.hmchat-chip.go:hover { background:#1db957; border-color:#1db957; }
.hmchat-chip.call { background: var(--red,#e2131a); border-color: var(--red,#e2131a); color:#fff; }
.hmchat-chip.call:hover { background: var(--red-600,#c20f16); }

/* Input */
.hmchat-input { background: var(--surface,#141518); padding:12px; display:flex; gap:8px; align-items:center; border-top:1px solid var(--border,rgba(255,255,255,.09)); }
.hmchat-input input { flex:1; background: var(--bg-2,#0e0f12); border:1px solid var(--border-strong,rgba(255,255,255,.16)); border-radius:999px; padding:11px 16px; font:inherit; font-size:.95rem; color:#fff; outline:0; }
.hmchat-input input::placeholder { color: var(--muted-2,#72777f); }
.hmchat-input input:focus { border-color: var(--red,#e2131a); }
.hmchat-input button { flex:none; width:42px; height:42px; border-radius:50%; border:0; padding:0; background: var(--red,#e2131a); color:#fff; cursor:pointer; display:grid; place-items:center; }
.hmchat-input button:hover { background: var(--red-600,#c20f16); }

.hmchat-foot { text-align:center; font-size:.72rem; color: var(--muted-2,#72777f); padding:0 0 10px; background: var(--surface,#141518); }

/* Lift the launcher + teaser above the mobile action bar while that bar shows (<=900px) */
@media (max-width: 900px) {
  .hmchat-launch { bottom: 80px; }
}
@media (max-width: 480px) {
  .hmchat-panel { inset:0 !important; width:100% !important; max-width:none !important; height:100% !important; max-height:none !important; border-radius:0 !important; z-index:2147483000 !important; }
  .hmchat-launch { right:14px; padding:12px 16px 12px 12px; }
  .hmchat-launch .label-sm { display:none; }
}

/* Proactive greeting teaser */
.hmchat-teaser { position:fixed; right:20px; bottom:96px; z-index:94; max-width:270px; background: var(--surface,#141518); color:#eef0f3; border:1px solid var(--border-strong,rgba(255,255,255,.16)); border-radius:16px; border-bottom-right-radius:5px; padding:14px 16px; box-shadow:0 16px 36px rgba(0,0,0,.4); font-size:.92rem; line-height:1.5; cursor:pointer; opacity:0; transform:translateY(12px); transition:opacity .25s ease, transform .25s ease; }
.hmchat-teaser.in { opacity:1; transform:none; }
.hmchat-teaser p { margin:0; padding-right:8px; }
.hmchat-teaser strong { color: var(--red,#e2131a); }
.hmchat-teaser-x { position:absolute; top:6px; right:9px; background:none; border:0; font-size:1.15rem; line-height:1; color: var(--muted,#a2a7b0); cursor:pointer; padding:2px; }
.hmchat-teaser-x:hover { color:#fff; }
@media (max-width: 900px) { .hmchat-teaser { bottom:168px; } }
@media (max-width: 480px) { .hmchat-teaser { right:14px; bottom:156px; max-width:calc(100vw - 28px); } }
