/* AS Code UK — live chat widget */
.chat { position: fixed; right: 22px; bottom: 22px; z-index: 90; font-family: var(--font, Inter, sans-serif); }
body.has-chat .to-top { bottom: 100px; right: 30px; }
.chat-fab { position: relative; width: 62px; height: 62px; border: 0; border-radius: 50%; cursor: pointer; display: grid; place-items: center; color: #03121A;
  background: linear-gradient(135deg, #7DE8FF, #3DD6F5 45%, #3B82F6); box-shadow: 0 16px 40px -10px rgba(61, 214, 245, .8), inset 0 1px 0 rgba(255, 255, 255, .6); transition: transform .25s; }
.chat-fab:hover { transform: scale(1.07) rotate(-4deg); }
.chat-fab::before { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid rgba(61, 214, 245, .55); animation: fabRing 2.4s ease-out infinite; }
@keyframes fabRing { 0% { transform: scale(.85); opacity: .9; } 100% { transform: scale(1.35); opacity: 0; } }
.chat.open .chat-fab::before { display: none; }
.chat-fab svg { position: absolute; width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .3s, opacity .3s; }
.chat-fab .i-chat { animation: chatWiggle 4s ease-in-out infinite; }
@keyframes chatWiggle { 0%, 80%, 100% { transform: rotate(0); } 85% { transform: rotate(-12deg); } 90% { transform: rotate(10deg); } 95% { transform: rotate(-6deg); } }
.chat-fab .i-close { opacity: 0; transform: rotate(-90deg); }
.chat.open .chat-fab .i-chat { opacity: 0; transform: rotate(90deg); animation: none; }
.chat.open .chat-fab .i-close { opacity: 1; transform: none; }
.chat-dot { position: absolute; right: 4px; top: 4px; width: 14px; height: 14px; border-radius: 50%; background: #94A3B8; border: 2px solid #0A1424; }
.chat-fab.online .chat-dot { background: #4ADE9B; }
.chat-hint { position: absolute; right: 74px; bottom: 14px; white-space: nowrap; padding: 9px 14px; border-radius: 14px 14px 4px 14px; background: #fff; color: #0F1E46; font-size: 14px; font-weight: 600; box-shadow: 0 12px 30px -10px rgba(0, 0, 0, .6); opacity: 0; transform: translateX(10px); pointer-events: none; transition: opacity .35s, transform .35s; }
.chat.hint .chat-hint { opacity: 1; transform: none; }
.chat.open .chat-hint { opacity: 0; }
.chat-panel { position: absolute; right: 0; bottom: 78px; width: min(380px, calc(100vw - 32px)); height: min(560px, calc(100vh - 120px)); display: flex; flex-direction: column; overflow: hidden;
  border-radius: 22px; background: #0B1424; border: 1px solid #26405F; box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .95), 0 0 0 1px rgba(61, 214, 245, .08); transform-origin: bottom right; animation: panelIn .3s cubic-bezier(.2, .8, .2, 1); }
.chat-panel[hidden] { display: none; }
@keyframes panelIn { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 14px 14px 14px 16px; background: linear-gradient(135deg, #10324A, #0F1A2C); border-bottom: 1px solid #1A2A42; }
.chat-ava { width: 42px; height: 42px; border-radius: 12px; background: #fff; padding: 4px; }
.chat-head div { flex: 1; display: flex; flex-direction: column; }
.chat-head b { color: #fff; font-size: 15.5px; }
.chat-head span { font-size: 12.5px; color: #A3AFC2; display: flex; align-items: center; gap: 6px; }
.chat-head i { width: 8px; height: 8px; border-radius: 50%; background: #94A3B8; }
.chat-head i.on { background: #4ADE9B; box-shadow: 0 0 0 0 rgba(74, 222, 155, .6); animation: pulseG 1.6s infinite; }
.chat-x { width: 40px; height: 40px; border: 0; border-radius: 10px; background: transparent; color: #A3AFC2; cursor: pointer; display: grid; place-items: center; }
.chat-x:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.chat-x svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.chat-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 86%; padding: 10px 14px; border-radius: 16px; font-size: 14.5px; line-height: 1.5; animation: msgIn .25s ease; }
@keyframes msgIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.msg.bot { align-self: flex-start; background: #142238; color: #E8EEF7; border-bottom-left-radius: 4px; }
.msg.bot small { color: #A3AFC2; }
.msg.me { align-self: flex-end; background: linear-gradient(135deg, #3DD6F5, #3B82F6); color: #03121A; font-weight: 500; border-bottom-right-radius: 4px; }
.msg.typing { display: flex; gap: 4px; padding: 14px; }
.msg.typing i { width: 7px; height: 7px; border-radius: 50%; background: #7F8CA3; animation: dotUp 1s infinite; }
.msg.typing i:nth-child(2) { animation-delay: .15s; } .msg.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes dotUp { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }
.msg-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chat-btn { display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid #26405F; background: transparent; color: #7DD3FC; font: 600 13px inherit; font-family: inherit; cursor: pointer; text-decoration: none; }
.chat-btn:hover { border-color: #3DD6F5; }
.chat-btn.wa { background: #25D366; border-color: #25D366; color: #06210F; }
.chat-chips { display: flex; gap: 6px; padding: 0 14px 10px; overflow-x: auto; flex: none; }
.chat-chips button { flex: none; min-height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid #26405F; background: #0F1A2C; color: #C9D7F2; font: 500 13px inherit; font-family: inherit; cursor: pointer; white-space: nowrap; }
.chat-chips button:hover { border-color: #3DD6F5; color: #fff; }
.chat-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid #1A2A42; background: #0A1220; }
.chat-form input { flex: 1; min-width: 0; min-height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid #26405F; background: #060A13; color: #E8EEF7; font: inherit; font-size: 15px; }
.chat-form input:focus { outline: none; border-color: #3DD6F5; box-shadow: 0 0 0 3px rgba(61, 214, 245, .15); }
.chat-form button { flex: none; width: 44px; height: 44px; border: 0; border-radius: 12px; background: #3DD6F5; color: #03121A; cursor: pointer; display: grid; place-items: center; }
.chat-form button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 520px) {
  .chat { right: 14px; bottom: 14px; }
  .chat-panel { position: fixed; right: 8px; left: 8px; bottom: 86px; width: auto; height: calc(100vh - 110px); }
  .chat-hint { display: none; }
  body.has-chat .to-top { right: 22px; bottom: 88px; }
}
@media (prefers-reduced-motion: reduce) { .chat-fab::before, .chat-fab .i-chat { animation: none; } }
@media print { .chat { display: none; } }

/* ---------- live chat mode ---------- */
.chat .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.chat.has-unread .chat-dot { background: #FB7185; box-shadow: 0 0 0 0 rgba(251, 113, 133, .7); animation: unreadPulse 1.4s infinite; }
@keyframes unreadPulse { 100% { box-shadow: 0 0 0 10px rgba(251, 113, 133, 0); } }
.chat.live .chat-head { background: linear-gradient(135deg, #0E3B35, #0F1A2C); }
.msg.agent { background: #10283A; border: 1px solid rgba(61, 214, 245, .25); }
.agent-tag { display: block; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #5BE1FA; margin-bottom: 3px; }
.msg-time { display: block; margin-top: 4px; font-size: 11px; opacity: .6; text-align: right; }
.msg.me .msg-time { color: #03121A; }
.msg.me a { color: #03121A; text-decoration: underline; }
.msg.bot a { color: #7DD3FC; text-decoration: underline; }
.msg.pending { opacity: .55; }
.msg.failed { background: #7F1D1D; color: #fff; }
.msg.failed::after { content: "Not sent. Check your connection."; display: block; font-size: 11px; margin-top: 4px; }
.live-form { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.live-form input { min-height: 42px; padding: 0 12px; border-radius: 10px; border: 1px solid #26405F; background: #060A13; color: #E8EEF7; font: inherit; font-size: 14.5px; }
.live-form input:focus { outline: none; border-color: #3DD6F5; }
.chat-btn.primary { justify-content: center; background: linear-gradient(135deg, #5BE1FA, #3DD6F5); border-color: transparent; color: #03121A; min-height: 42px; }
.chat-btn.primary:disabled { opacity: .6; cursor: wait; }
.chat-chips .chat-chip-wa { flex: none; display: inline-flex; align-items: center; min-height: 34px; padding: 0 12px; border-radius: 999px; background: rgba(37, 211, 102, .12); border: 1px solid rgba(37, 211, 102, .4); color: #86EFAC; font-size: 13px; font-weight: 500; text-decoration: none; }
.chat-chips [data-endlive] { border-color: rgba(251, 113, 133, .4) !important; color: #FDA4AF !important; }
