/* --- Langa: the site chat assistant (launcher, teaser and chat panel) --- */
.lws-chat-root {
  --lc-teal-900: #0B3B3F;
  --lc-teal: #0B7A70;
  --lc-gold: #E0A83E;
  --lc-ink: #1C1B18;
  --lc-body: #4F5552;
  --lc-muted: #6B716E;
  --lc-line: rgba(28, 27, 24, 0.1);
  --lc-bg: #F4F5F4;
  --lc-white: #FFFFFF;
  --lc-font: 'Inter', system-ui, sans-serif;
  --lc-head: 'Plus Jakarta Sans', system-ui, sans-serif;
  --lc-ease: cubic-bezier(0.22, 1, 0.36, 1);
  font-family: var(--lc-font);
}
.lws-chat-root *, .lws-chat-root *::before, .lws-chat-root *::after { box-sizing: border-box; border-radius: 0; }
.lws-chat-root button { font: inherit; }
.lws-chat-root a:focus-visible, .lws-chat-root button:focus-visible, .lws-chat-root input:focus-visible { outline: 2px solid var(--lc-gold); outline-offset: 2px; }

/* Langa's robot face (used on the launcher and in the chat header) */
.lws-bot { display: block; width: 46px; height: 46px; overflow: visible; }
.lws-bot__head, .lws-bot__ear, .lws-bot__stem { fill: var(--bot-head, #FFFFFF); }
.lws-bot__visor { fill: var(--bot-visor, #0B3B3F); }
.lws-bot__eye, .lws-bot__mouth { fill: var(--bot-eye, #4FD1C1); }
.lws-bot__antenna { fill: var(--lc-gold); animation: lws-antenna 2.4s ease-in-out infinite; }
.lws-bot__eye { transform-box: fill-box; transform-origin: center; animation: lws-blink 4.6s infinite; }
.lws-bot__eyes { animation: lws-look 10s var(--lc-ease) infinite; }
@keyframes lws-blink { 0%, 91%, 100% { transform: scaleY(1); } 94% { transform: scaleY(0.12); } }
@keyframes lws-look { 0%, 38%, 100% { transform: translateX(0); } 45%, 58% { transform: translateX(2px); } 65%, 78% { transform: translateX(-2px); } }
@keyframes lws-antenna { 50% { fill: #FFD683; } }

/* Launcher: square brand-teal button showing the robot */
.lws-chat-launcher {
  position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 2500;
  display: grid; place-items: center; width: 64px; height: 64px; padding: 0;
  border: 0; cursor: pointer; background: var(--lc-teal-900); color: var(--lc-white);
  box-shadow: 0 12px 28px -14px rgba(11, 59, 63, 0.7);
  transition: translate 0.3s var(--lc-ease), background 0.25s ease;
}
.lws-chat-launcher:hover { translate: 0 -3px; background: var(--lc-teal); }
.lws-chat-launcher > span > svg:not(.lws-bot) { width: 24px; height: 24px; }
/* A little hop when Langa says something */
.lws-chat-launcher.is-waving { animation: lws-hop 0.8s var(--lc-ease); }
@keyframes lws-hop { 25% { transform: translateY(-9px); } 50% { transform: translateY(0); } 70% { transform: translateY(-4px); } 100% { transform: translateY(0); } }
.lws-chat-launcher .lws-icon-close { display: none; }
.lws-chat-launcher[aria-expanded="true"] .lws-icon-open { display: none; }
.lws-chat-launcher[aria-expanded="true"] .lws-icon-close { display: block; }
.lws-chat-launcher__badge {
  position: absolute; top: -8px; left: -8px; display: none; place-items: center; min-width: 22px; height: 22px; padding: 0 5px;
  background: var(--lc-gold); color: var(--lc-ink); font-family: var(--lc-head); font-size: 0.75rem; font-weight: 800;
}
.lws-chat-launcher__badge.is-visible { display: grid; }

/* Speech bubble: "Hi! How can I help you?" while the visitor scrolls */
.lws-chat-nudge {
  position: fixed; right: 1.25rem; bottom: calc(1.25rem + 82px); z-index: 2500;
  display: flex; align-items: flex-start; gap: 0.4rem; width: max-content; max-width: 280px;
  padding: 0.85rem 0.7rem 0.9rem 1rem;
  background: var(--lc-white); border: 1px solid var(--lc-line); border-top: 3px solid var(--lc-gold);
  box-shadow: 0 18px 40px -22px rgba(11, 59, 63, 0.6);
  opacity: 0; translate: 0 10px; visibility: hidden; transform-origin: bottom right;
  transition: opacity 0.35s ease, translate 0.45s var(--lc-ease), visibility 0s linear 0.45s;
}
.lws-chat-nudge.is-visible { opacity: 1; translate: 0 0; visibility: visible; transition: opacity 0.35s ease, translate 0.45s var(--lc-ease), visibility 0s; }
/* Tail pointing down at the robot */
.lws-chat-nudge::after {
  content: ""; position: absolute; right: 24px; bottom: -8px; width: 14px; height: 14px;
  background: var(--lc-white); border-right: 1px solid var(--lc-line); border-bottom: 1px solid var(--lc-line);
  transform: rotate(45deg);
}
.lws-chat-nudge__open { flex: 1; min-width: 0; padding: 0; border: 0; background: none; text-align: left; cursor: pointer; color: var(--lc-ink); }
.lws-chat-nudge__name { display: block; margin-bottom: 0.25rem; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--lc-teal); }
.lws-chat-nudge__text { display: block; min-height: 1.45em; font-family: var(--lc-head); font-size: 0.98rem; font-weight: 700; line-height: 1.45; }
.lws-nudge-typing { display: inline-flex; gap: 4px; padding-top: 0.45em; }
.lws-nudge-typing i { width: 6px; height: 6px; background: var(--lc-teal); animation: lws-dot 1.1s infinite ease-in-out; }
.lws-nudge-typing i:nth-child(2) { animation-delay: 0.15s; }
.lws-nudge-typing i:nth-child(3) { animation-delay: 0.3s; }
.lws-chat-nudge__close { flex-shrink: 0; display: grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 0; background: var(--lc-bg); color: var(--lc-muted); cursor: pointer; }
.lws-chat-nudge__close svg { width: 11px; height: 11px; }

/* Chat panel */
.lws-chat {
  position: fixed; right: 1.25rem; bottom: calc(1.25rem + 76px); z-index: 2500;
  display: flex; flex-direction: column; width: min(400px, calc(100vw - 2.5rem)); height: min(640px, calc(100vh - 120px));
  background: var(--lc-white); border: 1px solid var(--lc-line);
  box-shadow: 0 30px 70px -32px rgba(11, 59, 63, 0.6);
  opacity: 0; translate: 0 16px; visibility: hidden;
  transition: opacity 0.3s ease, translate 0.45s var(--lc-ease), visibility 0s linear 0.45s;
}
.lws-chat.is-open { opacity: 1; translate: 0 0; visibility: visible; transition: opacity 0.3s ease, translate 0.45s var(--lc-ease), visibility 0s; }

.lws-chat__header {
  display: flex; align-items: center; gap: 0.75rem; padding: 0.9rem 0.9rem 0.9rem 1rem;
  background: var(--lc-teal-900); color: var(--lc-white); border-bottom: 3px solid var(--lc-gold);
}
.lws-chat__avatar {
  --bot-head: var(--lc-teal); --bot-visor: var(--lc-teal-900); --bot-eye: #4FD1C1;
  display: grid; place-items: center; flex-shrink: 0; width: 44px; height: 44px; background: var(--lc-white);
}
.lws-chat__avatar .lws-bot { width: 34px; height: 34px; }
.lws-chat__who { flex: 1; min-width: 0; }
.lws-chat__name { margin: 0; font-family: var(--lc-head); font-size: 1rem; font-weight: 700; line-height: 1.2; }
.lws-chat__status { display: flex; align-items: center; gap: 0.4rem; margin: 0.15rem 0 0; font-size: 0.75rem; color: rgba(255, 255, 255, 0.75); }
.lws-chat__status::before { content: ""; width: 7px; height: 7px; background: #25D366; }
.lws-chat__action {
  display: grid; place-items: center; flex-shrink: 0; width: 36px; height: 36px; padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.2); background: transparent; color: var(--lc-white); cursor: pointer; text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.lws-chat__action:hover { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.45); }
.lws-chat__action svg { width: 17px; height: 17px; }

.lws-chat__log {
  flex: 1; display: flex; flex-direction: column; gap: 0.9rem; overflow-y: auto; overscroll-behavior: contain;
  padding: 1.1rem 1rem 1.3rem; background: var(--lc-bg);
}

/* Message rows: Langa's on the left with a small robot avatar, the visitor's on the right */
.lws-msg { display: flex; align-items: flex-start; gap: 0.55rem; animation: lws-in 0.35s var(--lc-ease) both; }
.lws-msg--bot { align-self: stretch; padding-right: 0.75rem; }
.lws-msg--user { align-self: flex-end; max-width: 82%; }
.lws-msg--cont { margin-top: -0.55rem; } /* follow-on messages sit closer to the one before */
@keyframes lws-in { from { opacity: 0; translate: 0 6px; } }
.lws-msg__avatar {
  --bot-head: #FFFFFF; --bot-visor: var(--lc-teal-900); --bot-eye: #4FD1C1;
  display: grid; place-items: center; flex-shrink: 0; width: 28px; height: 28px; background: var(--lc-teal-900);
}
.lws-msg--cont .lws-msg__avatar { background: transparent; }
.lws-msg__avatar .lws-bot { width: 22px; height: 22px; }
.lws-msg__avatar .lws-bot * { animation: none; } /* only the launcher and header robots move */
.lws-msg__body { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 0.5rem; }
.lws-msg--user .lws-msg__body { align-items: flex-end; }

.lws-bubble { max-width: 100%; padding: 0.8rem 0.95rem; font-size: 0.875rem; line-height: 1.6; overflow-wrap: break-word; }
.lws-msg--bot .lws-bubble { background: var(--lc-white); border: 1px solid var(--lc-line); color: #2B302D; }
.lws-msg--user .lws-bubble { padding: 0.6rem 0.9rem; background: var(--lc-teal); color: var(--lc-white); }
.lws-bubble p { margin: 0; }
.lws-bubble p + p { margin-top: 0.6rem; }
.lws-bubble ul { margin: 0.6rem 0 0.1rem; padding: 0; list-style: none; display: grid; gap: 0.45rem; }
.lws-bubble ul + p { margin-top: 0.7rem; }
/* Block (not flex) so bold words stay inline with the rest of the sentence */
.lws-bubble li { position: relative; display: block; padding-left: 1.05rem; line-height: 1.55; }
.lws-bubble li::before { content: ""; position: absolute; left: 0; top: 0.58em; width: 6px; height: 6px; background: var(--lc-gold); }
.lws-bubble strong { font-weight: 700; color: var(--lc-teal-900); }
.lws-msg--user .lws-bubble strong { color: inherit; }

/* Package recommendation and quote summary cards */
.lws-card { width: 100%; background: var(--lc-white); border: 1px solid var(--lc-line); border-top: 3px solid var(--lc-gold); }
.lws-card__body { padding: 0.9rem 1rem; }
.lws-card__label { margin: 0 0 0.2rem; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--lc-teal); }
.lws-card__title { margin: 0; font-family: var(--lc-head); font-size: 1.05rem; font-weight: 800; color: var(--lc-ink); }
.lws-card__price { margin: 0.35rem 0 0.6rem; font-family: var(--lc-head); font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em; color: var(--lc-ink); }
.lws-card__text { margin: 0 0 0.6rem; font-size: 0.86rem; color: var(--lc-body); line-height: 1.5; white-space: pre-line; }
.lws-card ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.35rem; font-size: 0.85rem; color: var(--lc-body); }
.lws-card li { display: flex; gap: 0.5rem; }
.lws-card li::before { content: ""; flex-shrink: 0; width: 14px; height: 14px; margin-top: 0.15em; background: var(--lc-teal) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FFFFFF' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center / 9px no-repeat; }
.lws-card__actions { display: grid; gap: 1px; background: var(--lc-line); border-top: 1px solid var(--lc-line); }
.lws-card__btn {
  display: flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.75rem 1rem;
  font-family: var(--lc-head); font-size: 0.88rem; font-weight: 700; text-decoration: none; text-align: center;
  background: var(--lc-white); color: var(--lc-teal); transition: background 0.2s ease, color 0.2s ease;
}
.lws-card__btn:hover { background: var(--lc-bg); }
.lws-card__btn--primary { background: var(--lc-gold); color: var(--lc-ink); }
.lws-card__btn--primary:hover { background: #EBB955; }
.lws-card__btn svg { width: 16px; height: 16px; }
.lws-card__note { margin: 0; padding: 0.55rem 1rem; font-size: 0.72rem; color: var(--lc-muted); background: var(--lc-bg); }

/* Typing indicator: three squares */
.lws-typing { display: inline-flex; gap: 5px; padding: 1rem 1.05rem; background: var(--lc-white); border: 1px solid var(--lc-line); }
.lws-typing i { width: 7px; height: 7px; background: var(--lc-teal); animation: lws-dot 1.1s infinite ease-in-out; }
.lws-typing i:nth-child(2) { animation-delay: 0.15s; }
.lws-typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes lws-dot { 0%, 60%, 100% { opacity: 0.25; translate: 0 0; } 30% { opacity: 1; translate: 0 -4px; } }

/* Quick-reply buttons */
/* One scrollable row, so suggestions never crowd out the conversation */
.lws-chat__chips {
  display: flex; flex-wrap: nowrap; gap: 0.5rem; overflow-x: auto; scrollbar-width: none;
  padding: 0.75rem 1.1rem; background: var(--lc-white); border-top: 1px solid var(--lc-line);
  -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent);
  mask-image: linear-gradient(90deg, #000 88%, transparent);
}
.lws-chat__chips::-webkit-scrollbar { display: none; }
.lws-chat__chips:empty { display: none; }
.lws-chip {
  flex-shrink: 0; white-space: nowrap; padding: 0.4rem 0.75rem; border: 1px solid var(--lc-teal); background: var(--lc-white); color: var(--lc-teal);
  font-size: 0.8rem; font-weight: 600; cursor: pointer; transition: background 0.2s ease, color 0.2s ease;
}
.lws-chip:last-child { margin-right: 2rem; } /* room to scroll the last one clear of the fade */
.lws-chip:hover { background: var(--lc-teal); color: var(--lc-white); }

/* Message box */
.lws-chat__form { display: flex; border-top: 1px solid var(--lc-line); background: var(--lc-white); }
.lws-chat__input { flex: 1; min-width: 0; padding: 0.85rem 1rem; border: 0; background: transparent; color: var(--lc-ink); font: inherit; font-size: 0.9rem; }
.lws-chat__input::placeholder { color: var(--lc-muted); }
.lws-chat__input:focus { outline: none; }
.lws-chat__send {
  display: grid; place-items: center; width: 54px; padding: 0; border: 0; cursor: pointer;
  background: var(--lc-teal); color: var(--lc-white); transition: background 0.2s ease;
}
.lws-chat__send:hover { background: var(--lc-teal-900); }
.lws-chat__send:disabled { background: #B9C2BF; cursor: default; }
.lws-chat__send svg { width: 18px; height: 18px; }
.lws-chat__foot { margin: 0; padding: 0.5rem 1rem 0.6rem; font-size: 0.7rem; color: var(--lc-muted); text-align: center; background: var(--lc-white); }
.lws-chat__foot a { color: var(--lc-teal); font-weight: 600; }

.lws-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Phones: the panel takes the whole screen */
@media (max-width: 520px) {
  .lws-chat { inset: 0; width: 100%; height: 100%; height: 100dvh; border: 0; }
  .lws-chat-root.is-open .lws-chat-launcher { display: none; }
  .lws-chat-nudge { right: 1rem; max-width: 240px; }
  .lws-chat-nudge__text { font-size: 0.92rem; }
  body.lws-chat-locked { overflow: hidden; }
}

@media (prefers-reduced-motion: reduce) {
  .lws-chat-root *, .lws-chat-root *::before { animation: none !important; transition: none !important; }
}
