.kangoo-chat,
.kangoo-chat * { box-sizing: border-box; }

.kangoo-chat {
  --kc-blue: #075cd6;
  --kc-navy: #071d45;
  --kc-orange: #ff7900;
  --kc-line: #dfe6f0;
  --kc-muted: #64748b;
  position: fixed;
  z-index: 5900;
  left: max(18px, env(safe-area-inset-left));
  bottom: max(18px, calc(env(safe-area-inset-bottom) + 12px));
  color: #111827;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.45;
}

.kangoo-chat#kangoo-live-chat { z-index: 5900 !important; }

.kangoo-chat.is-open#kangoo-live-chat { z-index: 9990 !important; }

body:has(.kangoo-mega-menu.is-open) .kangoo-chat#kangoo-live-chat {
  z-index: 5900 !important;
}

html.kangoo-age-gate-open .kangoo-chat#kangoo-live-chat {
  display: none !important;
}

.kangoo-chat button,
.kangoo-chat input,
.kangoo-chat select,
.kangoo-chat textarea { font: inherit; }

.kangoo-chat__launcher {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 8px 18px 8px 9px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, var(--kc-blue), #0047a9);
  box-shadow: 0 16px 38px rgba(3, 47, 112, 0.28);
  cursor: pointer;
}

.kangoo-chat__launcher::before {
  content: "";
  position: absolute;
  z-index: 0;
  top: 0;
  bottom: 0;
  left: 0;
  width: 58px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--kc-blue), #1593ff, var(--kc-orange), var(--kc-navy), var(--kc-blue));
  pointer-events: none;
}

.kangoo-chat__launcher-icon {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: var(--kc-navy);
  background: #fff;
}

.kangoo-chat svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.kangoo-chat__launcher-label { position: relative; z-index: 1; font-size: 0.9rem; font-weight: 850; }
.kangoo-chat__badge {
  position: absolute;
  z-index: 2;
  top: -5px;
  right: -3px;
  display: grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border: 3px solid #fff;
  border-radius: 999px;
  color: #fff;
  background: #e4283d;
  font-size: 0.68rem;
  font-weight: 900;
}

.kangoo-chat__panel {
  position: absolute;
  left: 0;
  bottom: 72px;
  display: flex;
  flex-direction: column;
  width: min(390px, calc(100vw - 28px));
  max-height: min(650px, calc(100dvh - 110px));
  overflow: hidden;
  border: 1px solid rgba(7, 29, 69, 0.12);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(4, 24, 59, 0.26);
}

.kangoo-chat__panel[hidden] { display: none; }
.kangoo-chat__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  padding: 14px 14px 14px 20px;
  color: #fff;
  background: linear-gradient(135deg, var(--kc-navy), #0b397d);
}
.kangoo-chat__header div { display: grid; gap: 2px; }
.kangoo-chat__header span { color: #9cc7ff; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; }
.kangoo-chat__header strong { font-size: 1.06rem; }
.kangoo-chat__close {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  font-size: 1.6rem;
  cursor: pointer;
}

.kangoo-chat__status {
  padding: 10px 18px;
  border-bottom: 1px solid var(--kc-line);
  color: #27405f;
  background: #f1f7ff;
  font-size: 0.78rem;
  font-weight: 750;
}

.kangoo-chat.has-connected .kangoo-chat__status { color: #05603a; background: #e9fbf2; }
.kangoo-chat__start { display: grid; gap: 13px; padding: 18px; overflow-y: auto; }
.kangoo-chat__start[hidden] { display: none; }
.kangoo-chat__start > label:not(.kangoo-chat__consent) { display: grid; gap: 5px; }
.kangoo-chat__start label > span { color: #27364c; font-size: 0.75rem; font-weight: 800; }
.kangoo-chat__start small { color: var(--kc-muted); font-size: 0.7rem; font-weight: 600; }
.kangoo-chat__start input:not([type="checkbox"]),
.kangoo-chat__start select,
.kangoo-chat__composer textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid #cad5e3;
  border-radius: 12px;
  color: #111827;
  background: #fff;
  outline: 0;
}
.kangoo-chat__start input:focus,
.kangoo-chat__start select:focus,
.kangoo-chat__composer textarea:focus { border-color: var(--kc-blue); box-shadow: 0 0 0 3px rgba(7, 92, 214, 0.12); }
.kangoo-chat__website { position: absolute !important; left: -9999px !important; width: 1px !important; height: 1px !important; opacity: 0 !important; }
.kangoo-chat__consent { display: grid; grid-template-columns: 20px 1fr; align-items: start; gap: 9px; }
.kangoo-chat__consent input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--kc-blue); }
.kangoo-chat__consent span { color: var(--kc-muted) !important; font-size: 0.7rem !important; font-weight: 600 !important; }
.kangoo-chat__consent a { color: var(--kc-blue); }
.kangoo-chat__start > button,
.kangoo-chat__new {
  min-height: 48px;
  border: 0;
  border-radius: 13px;
  color: #fff;
  background: var(--kc-blue);
  font-weight: 850;
  cursor: pointer;
}
.kangoo-chat__start > button:disabled { opacity: 0.55; }
.kangoo-chat__error { min-height: 1em; margin: -4px 0 0; color: #c51c32; font-size: 0.72rem; }
.kangoo-chat.has-conversation .kangoo-chat__panel { height: min(422px, calc(100dvh - 110px)); }
.kangoo-chat__conversation { display: flex; min-height: 0; flex: 1; flex-direction: column; overflow: hidden; }
.kangoo-chat__conversation[hidden] { display: none; }
.kangoo-chat__messages { display: flex; min-height: 0; flex: 1; flex-direction: column; gap: 10px; padding: 16px; overflow-y: auto; overscroll-behavior: contain; background: #f7f9fc; }
.kangoo-chat__message { align-self: flex-start; max-width: 82%; padding: 9px 11px; border: 1px solid var(--kc-line); border-radius: 15px 15px 15px 4px; color: #172033; background: #fff; }
.kangoo-chat__message.is-customer { align-self: flex-end; border-color: transparent; border-radius: 15px 15px 4px 15px; color: #fff; background: var(--kc-blue); }
.kangoo-chat__message.is-agent,
.kangoo-chat__message.is-agent strong,
.kangoo-chat__message.is-agent time,
.kangoo-chat__message.is-agent p { color: #000 !important; }
.kangoo-chat__message.is-customer,
.kangoo-chat__message.is-customer strong,
.kangoo-chat__message.is-customer time,
.kangoo-chat__message.is-customer p { color: #fff !important; }
.kangoo-chat__message.is-system { align-self: center; max-width: 94%; border: 0; color: var(--kc-muted); background: transparent; text-align: center; }
.kangoo-chat__message > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.kangoo-chat__message strong { font-size: 0.68rem; }
.kangoo-chat__message time { color: inherit; opacity: 0.68; font-size: 0.62rem; }
.kangoo-chat__message p { margin: 4px 0 0; overflow-wrap: anywhere; white-space: pre-wrap; font-size: 0.82rem; }
.kangoo-chat__message.is-system p { margin: 0; font-size: 0.7rem; }
.kangoo-chat__message.is-system > div { display: none; }
.kangoo-chat__composer { display: grid; grid-template-columns: minmax(0, 1fr) 48px; align-items: end; gap: 9px; padding: 12px; border-top: 1px solid var(--kc-line); background: #fff; }
.kangoo-chat__composer textarea { min-height: 48px; max-height: 110px; resize: vertical; }
.kangoo-chat__composer button { display: grid; place-items: center; width: 48px; height: 48px; padding: 0; border: 0; border-radius: 14px; color: #fff; background: var(--kc-blue); cursor: pointer; }
.kangoo-chat__composer button:disabled { color: #8b98a9; background: #e2e8f0; }
.kangoo-chat__new { margin: 14px; }

body.kangoo-live-chat-open .kangoo-helper-mascot,
body.kangoo-live-chat-open .kangoo-mascot-helper {
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

@media (min-width: 521px) {
  .kangoo-chat__launcher-label { margin-left: 15px; }
}

@media (max-width: 520px) {
  body.kangoo-live-chat-open { overflow: hidden; }
  body.kangoo-live-chat-open .site-header { z-index: 5800 !important; }
  .kangoo-chat { left: max(12px, env(safe-area-inset-left)); bottom: max(14px, calc(env(safe-area-inset-bottom) + 10px)); }
  .kangoo-chat__launcher { width: 58px; padding: 8px; }
  .kangoo-chat.is-open .kangoo-chat__launcher { visibility: hidden; opacity: 0; pointer-events: none; }
  .kangoo-chat__launcher-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .kangoo-chat__panel {
    position: fixed;
    inset: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    width: auto;
    max-height: none;
    border-radius: 20px;
  }
  .kangoo-chat.has-conversation .kangoo-chat__panel { height: auto; }
  .kangoo-chat__start { min-height: 0; flex: 1; }
}

@media (prefers-reduced-motion: no-preference) {
  .kangoo-chat__launcher::before { animation: kangoo-chat-ring-spin 10s linear infinite; }
  .kangoo-chat__panel { transform-origin: left bottom; animation: kangoo-chat-open 160ms ease-out; }
  @keyframes kangoo-chat-ring-spin { to { transform: rotate(1turn); } }
  @keyframes kangoo-chat-open { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: none; } }
}
