/* ==========================================================================
   KALI FOUNDATION — site guide (chatbot) widget
   Self-contained: it defines its own tokens rather than borrowing the page's,
   so it looks the same on the main site and on the product pages.
   ========================================================================== */

.kali-bot {
  --kb-ink:        #212E32;
  --kb-ink-soft:   #52616B;
  --kb-cream:      #F8F4EA;
  --kb-cream-warm: #FBF8F1;
  --kb-white:      #FFFFFF;
  --kb-sage:       #4C6B41;
  --kb-sage-soft:  #EFF3EA;
  --kb-clay:       #B98E5E;
  --kb-gold:       #D9BD8A;
  --kb-border:     rgba(33, 46, 50, 0.14);
  --kb-shadow:     0 8px 24px rgba(33, 46, 50, 0.10), 0 24px 60px rgba(33, 46, 50, 0.16);
  --kb-font:       'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 9990;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  font-family: var(--kb-font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--kb-ink);
}

.kali-bot *,
.kali-bot *::before,
.kali-bot *::after { box-sizing: border-box; }

.kali-bot__sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* -------------------- launcher -------------------- */

.kali-bot__launcher {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 18px 11px 14px;
  border: 1px solid rgba(248, 244, 234, 0.18);
  border-radius: 999px;
  background: var(--kb-ink);
  color: var(--kb-cream);
  font: inherit;
  font-weight: 600;
  font-size: 14.5px;
  letter-spacing: 0.005em;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(33, 46, 50, 0.16), 0 12px 32px rgba(33, 46, 50, 0.18);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s ease;
}

.kali-bot__launcher:hover { transform: translateY(-2px); background: #1A2427; }
.kali-bot__launcher:focus-visible { outline: 2.5px solid var(--kb-gold); outline-offset: 3px; }

.kali-bot__launcher-icon { display: inline-flex; }
.kali-bot__launcher-icon svg { width: 21px; height: 21px; color: var(--kb-gold); }

.kali-bot.is-open .kali-bot__launcher-label { display: none; }
.kali-bot.is-open .kali-bot__launcher { padding: 11px 13px; }

/* -------------------- first-visit nudge -------------------- */

.kali-bot__nudge {
  display: none;
  align-items: flex-start;
  gap: 10px;
  max-width: 268px;
  padding: 12px 12px 12px 15px;
  border: 1px solid var(--kb-border);
  border-radius: 14px 14px 4px 14px;
  background: var(--kb-white);
  color: var(--kb-ink);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  box-shadow: var(--kb-shadow);
}

.kali-bot__nudge.is-visible { display: flex; animation: kali-bot-rise 0.4s cubic-bezier(0.16, 1, 0.3, 1) both; }

.kali-bot__nudge-close {
  flex: none;
  width: 22px; height: 22px;
  margin: -2px -2px 0 0;
  border: 0; border-radius: 50%;
  background: transparent;
  color: var(--kb-ink-soft);
  font-size: 17px; line-height: 1;
  cursor: pointer;
}
.kali-bot__nudge-close:hover { background: var(--kb-sage-soft); }

/* -------------------- panel -------------------- */

.kali-bot__panel {
  display: flex;
  flex-direction: column;
  width: 384px;
  max-width: calc(100vw - 32px);
  height: 596px;
  max-height: calc(100vh - 132px);
  overflow: hidden;
  border: 1px solid var(--kb-border);
  border-radius: 18px;
  background: var(--kb-cream-warm);
  box-shadow: var(--kb-shadow);
  animation: kali-bot-rise 0.28s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.kali-bot__panel[hidden] { display: none; }

.kali-bot__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 14px 14px 18px;
  background: var(--kb-ink);
  color: var(--kb-cream);
  border-bottom: 3px solid transparent;
  border-image: linear-gradient(90deg, var(--kb-sage), var(--kb-clay) 50%, var(--kb-gold)) 1;
}

.kali-bot__title {
  margin: 0;
  font-size: 15.5px;
  font-weight: 650;
  letter-spacing: 0.005em;
}

.kali-bot__subtitle {
  margin: 3px 0 0;
  font-size: 12.5px;
  color: rgba(248, 244, 234, 0.72);
}

.kali-bot__close {
  flex: none;
  width: 30px; height: 30px;
  border: 1px solid rgba(248, 244, 234, 0.22);
  border-radius: 50%;
  background: transparent;
  color: var(--kb-cream);
  font-size: 19px; line-height: 1;
  cursor: pointer;
}
.kali-bot__close:hover { background: rgba(248, 244, 234, 0.12); }
.kali-bot__close:focus-visible { outline: 2.5px solid var(--kb-gold); outline-offset: 2px; }

/* -------------------- transcript -------------------- */

.kali-bot__log {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px 16px 6px;
  scrollbar-width: thin;
}

.kali-bot__log:focus-visible { outline: 2px solid var(--kb-sage); outline-offset: -3px; }

.kali-bot__msg { display: flex; margin-bottom: 12px; }
.kali-bot__msg--user { justify-content: flex-end; }

.kali-bot__bubble {
  max-width: 88%;
  padding: 11px 14px;
  border: 1px solid var(--kb-border);
  border-radius: 14px 14px 14px 4px;
  background: var(--kb-white);
  box-shadow: 0 1px 2px rgba(33, 46, 50, 0.04);
}

.kali-bot__msg--user .kali-bot__bubble {
  border-radius: 14px 14px 4px 14px;
  border-color: transparent;
  background: var(--kb-ink);
  color: var(--kb-cream);
}

.kali-bot__bubble p { margin: 0 0 9px; font-size: 14.5px; }
.kali-bot__bubble p:last-child { margin-bottom: 0; }

.kali-bot__list {
  margin: 0 0 9px;
  padding-left: 18px;
  font-size: 14.5px;
}
.kali-bot__list li { margin-bottom: 5px; }
.kali-bot__list li::marker { color: var(--kb-clay); }
.kali-bot__list:last-child { margin-bottom: 0; }

/* -------------------- links and chips -------------------- */

.kali-bot__links {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 11px;
}

.kali-bot__link {
  display: inline-flex;
  align-items: center;
  padding: 7px 13px;
  border-radius: 999px;
  background: var(--kb-sage);
  color: var(--kb-cream) !important;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none !important;
}
.kali-bot__link::after { content: " →"; white-space: pre; }
.kali-bot__link:hover { background: #3E5836; }
.kali-bot__link:focus-visible { outline: 2.5px solid var(--kb-ink); outline-offset: 2px; }

.kali-bot__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 11px;
}

.kali-bot__chip {
  padding: 7px 13px;
  border: 1px solid var(--kb-clay);
  border-radius: 999px;
  background: transparent;
  color: var(--kb-ink);
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.18s ease;
}
.kali-bot__chip:hover { background: #F3E7D5; }
.kali-bot__chip:focus-visible { outline: 2.5px solid var(--kb-sage); outline-offset: 2px; }

/* -------------------- typing -------------------- */

.kali-bot__bubble--typing { display: flex; gap: 4px; padding: 14px; }
.kali-bot__bubble--typing span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--kb-ink-soft);
  opacity: 0.45;
  animation: kali-bot-blink 1.1s infinite ease-in-out;
}
.kali-bot__bubble--typing span:nth-child(2) { animation-delay: 0.16s; }
.kali-bot__bubble--typing span:nth-child(3) { animation-delay: 0.32s; }

/* -------------------- composer -------------------- */

.kali-bot__form {
  display: flex;
  gap: 8px;
  padding: 12px 14px 8px;
  border-top: 1px solid var(--kb-border);
  background: var(--kb-cream);
}

.kali-bot__input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 11px 14px;
  border: 1px solid var(--kb-border);
  border-radius: 999px;
  background: var(--kb-white);
  color: var(--kb-ink);
  font: inherit;
  font-size: 14.5px;
}
.kali-bot__input::placeholder { color: var(--kb-ink-soft); opacity: 0.75; }
.kali-bot__input:focus-visible { outline: 2.5px solid var(--kb-sage); outline-offset: 1px; }

.kali-bot__send {
  flex: none;
  width: 42px; height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: var(--kb-ink);
  color: var(--kb-cream);
  cursor: pointer;
}
.kali-bot__send svg { width: 19px; height: 19px; }
.kali-bot__send:hover { background: #1A2427; }
.kali-bot__send:focus-visible { outline: 2.5px solid var(--kb-sage); outline-offset: 2px; }

.kali-bot__note {
  margin: 0;
  padding: 0 16px 12px;
  background: var(--kb-cream);
  color: var(--kb-ink-soft);
  font-size: 11.5px;
  line-height: 1.45;
}
.kali-bot__note a { color: var(--kb-sage); }

/* -------------------- motion and small screens -------------------- */

@keyframes kali-bot-rise {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to   { opacity: 1; transform: none; }
}

@keyframes kali-bot-blink {
  0%, 60%, 100% { opacity: 0.28; transform: translateY(0); }
  30%           { opacity: 0.8;  transform: translateY(-2px); }
}

@media (max-width: 520px) {
  .kali-bot { right: 12px; left: 12px; bottom: 12px; align-items: flex-end; }
  .kali-bot__panel { width: 100%; height: 74vh; max-height: calc(100vh - 96px); }
  .kali-bot__launcher-label { display: none; }
  .kali-bot__launcher { padding: 12px 13px; }
  .kali-bot__nudge { max-width: 100%; }
}

@supports (height: 100dvh) {
  @media (max-width: 520px) {
    .kali-bot__panel { height: 74dvh; max-height: calc(100dvh - 96px); }
  }
}

@media (prefers-reduced-motion: reduce) {
  .kali-bot *,
  .kali-bot *::before,
  .kali-bot *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .kali-bot__launcher:hover { transform: none; }
}

/* --------------------------------------------------------------------------
   Room for the launcher. It floats over the bottom-right corner of the page,
   which is exactly where footers like to put a copyright line or a set of
   social links — so every footer on a page carrying the guide gets a little
   extra breathing room underneath its content.
   -------------------------------------------------------------------------- */

.site-footer,
body > footer[class] { padding-bottom: 5.5rem; }

@media (max-width: 520px) {
  .site-footer,
  body > footer[class] { padding-bottom: 5rem; }
}

@media print { .kali-bot { display: none !important; } }

@media print {
  .site-footer,
  body > footer[class] { padding-bottom: 0; }
}
