/*!
 * AM.CO.ZA KB Chat — structure only.
 * Host pages style appearance via CSS variables and/or their own rules.
 * Do not rely on colors here for brand; override --am-kb-* on .am-kb-chat.
 */
.am-kb-chat {
  /* Theme hooks (host overrides these) */
  --am-kb-bg: #f4f1ea;
  --am-kb-ink: #2a241c;
  --am-kb-muted: #6b6258;
  --am-kb-card: #fffdf8;
  --am-kb-line: #e4dcd0;
  --am-kb-accent: #c45c26;
  --am-kb-user-bg: #2a241c;
  --am-kb-user-ink: #fff;
  --am-kb-bot-bg: #fffdf8;
  --am-kb-error-bg: #fde8e4;
  --am-kb-error-ink: #8a2a12;
  --am-kb-error-line: #f3c4b6;
  --am-kb-waiting-bg: #efe8dc;
  --am-kb-radius: 12px;
  --am-kb-font: Segoe UI, system-ui, sans-serif;

  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  min-height: 420px;
  height: 100%;
  font-family: var(--am-kb-font);
  color: var(--am-kb-ink);
  background: var(--am-kb-bg);
}

.am-kb-chat *,
.am-kb-chat *::before,
.am-kb-chat *::after { box-sizing: border-box; }

.am-kb-chat__header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  padding: 2px 8px;
  background: var(--am-kb-accent);
  color: #fff;
  font-weight: 700;
  min-height: 0;
  height: auto;
  line-height: 1;
}

.am-kb-chat__logo {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  line-height: 0;
  text-decoration: none;
}
.am-kb-chat__logo img {
  height: 13px;
  width: auto;
  display: block;
}
.am-kb-chat__title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: 0.02em;
  font-size: 14px;
  line-height: 1.2;
}

.am-kb-chat__new {
  border: 1px solid rgba(255,255,255,0.55);
  background: transparent;
  color: inherit;
}
.am-kb-chat__new:disabled,
.am-kb-chat__new.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.am-kb-chat__log {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.am-kb-chat__bubble {
  max-width: 820px;
  padding: 10px 14px;
  border-radius: var(--am-kb-radius);
  line-height: 1.45;
  word-wrap: break-word;
}

.am-kb-chat__bubble--user {
  align-self: flex-end;
  background: var(--am-kb-user-bg);
  color: var(--am-kb-user-ink);
  white-space: pre-wrap;
}

.am-kb-chat__bubble--bot {
  align-self: flex-start;
  background: var(--am-kb-bot-bg);
  border: 1px solid var(--am-kb-line);
}

.am-kb-chat__bubble--error {
  align-self: flex-start;
  background: var(--am-kb-error-bg);
  color: var(--am-kb-error-ink);
  border: 1px solid var(--am-kb-error-line);
  white-space: pre-wrap;
}

.am-kb-chat__bubble--flash {
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.am-kb-chat__bubble--flash.is-fading {
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
}


.am-kb-chat__time {
  margin-top: 6px;
  font-size: 0.72rem;
  font-weight: 500;
  opacity: 0.65;
  letter-spacing: 0.02em;
  user-select: none;
}
.am-kb-chat__bubble--user .am-kb-chat__time {
  text-align: right;
  opacity: 0.75;
}
.am-kb-chat__bubble--waiting {
  align-self: flex-start;
  max-width: 100%;
  box-sizing: border-box;
  background: var(--am-kb-waiting-bg);
  border: 1px solid var(--am-kb-line);
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px;
  padding: 12px 14px; /* explicit — avoid half-line clip */
  min-height: 44px;
  overflow: visible;
}
.am-kb-chat__waiting-label {
  font-variant-numeric: tabular-nums;
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
  line-height: 1.4;
  overflow: visible;
}

.am-kb-chat__bubble--bot h1,
.am-kb-chat__bubble--bot h2,
.am-kb-chat__bubble--bot h3,
.am-kb-chat__bubble--bot h4 {
  margin: 0.6em 0 0.35em;
  color: var(--am-kb-accent);
  line-height: 1.25;
}
.am-kb-chat__bubble--bot h1 { font-size: 1.25rem; }
.am-kb-chat__bubble--bot h2 { font-size: 1.12rem; }
.am-kb-chat__bubble--bot h3 { font-size: 1.02rem; }
.am-kb-chat__bubble--bot p { margin: 0.45em 0; }
.am-kb-chat__bubble--bot ul,
.am-kb-chat__bubble--bot ol { margin: 0.4em 0 0.4em 1.2em; padding: 0; }
.am-kb-chat__bubble--bot li { margin: 0.2em 0; }
.am-kb-chat__bubble--bot a { color: var(--am-kb-accent); }
.am-kb-chat__bubble--bot pre {
  background: var(--am-kb-user-bg);
  color: var(--am-kb-bg);
  padding: 10px 12px;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 0.88rem;
}
.am-kb-chat__bubble--bot code {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--am-kb-waiting-bg);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}
.am-kb-chat__bubble--bot pre code { background: none; padding: 0; color: inherit; }

.am-kb-chat__thumbs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.am-kb-chat__thumbs img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 6px;
}

.am-kb-chat__bubble--waiting .am-kb-chat__spinner {
  flex: 0 0 18px;
  margin-top: 1px;
}
.am-kb-chat__spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--am-kb-line);
  border-top-color: var(--am-kb-accent);
  border-radius: 50%;
  animation: am-kb-spin 0.8s linear infinite;
  flex: 0 0 auto;
}
.am-kb-chat__waiting-label { color: var(--am-kb-muted); font-size: 0.95em; } /* size/color; wrap rules above */

@keyframes am-kb-spin {
  to { transform: rotate(360deg); }
}

.am-kb-chat__composer {
  border-top: 1px solid var(--am-kb-line);
  background: var(--am-kb-card);
  padding: 8px 10px 10px;
}

.am-kb-chat__preview {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.am-kb-chat__preview:empty { display: none; }

.am-kb-chat__prev {
  position: relative;
  width: 72px;
  height: 72px;
}
.am-kb-chat__prev img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}
.am-kb-chat__prev-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 50%;
  background: var(--am-kb-accent);
  color: #fff;
  cursor: pointer;
  line-height: 20px;
  padding: 0;
}

.am-kb-chat__row {
  display: flex;
  gap: 4px;
  align-items: stretch; /* Photo / field / Send same height */
}

.am-kb-chat__file { display: none; }

.am-kb-chat__message {
  flex: 1;
  min-width: 0;
  min-height: 40px;
  height: 40px;
  max-height: 160px;
  resize: vertical;
  border: 1px solid var(--am-kb-line);
  border-radius: 6px;
  padding: 8px 10px;
  font: inherit;
  font-size: 14px;
  line-height: 1.35;
  background: #fff;
  color: inherit;
  box-sizing: border-box;
}

.am-kb-chat__btn {
  background: var(--am-kb-accent);
  color: #02020b;
  border: 0;
  border-radius: 6px;
  padding: 0 12px;
  height: auto;
  min-height: 40px;
  max-height: none;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  flex: 0 0 auto;
  box-sizing: border-box;
  white-space: nowrap;
  line-height: 1;
}
.am-kb-chat__btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.am-kb-chat__hint {
  color: var(--am-kb-muted);
  font-size: 11px;
  line-height: 1.35;
  margin-top: 6px;
}

/* While waiting: keep composer usable so a 2nd message can go after cooldown */
.am-kb-chat.is-busy .am-kb-chat__hint {
  opacity: 0.85;
}

.am-kb-chat.is-cooling .am-kb-chat__send {
  opacity: 0.75;
}

.am-kb-chat__bubble--bot {
  position: relative;
  padding-bottom: 2.4rem;
}
.am-kb-chat__answer {
  min-width: 0;
}
/* Copy always visible (mobile has no hover). Feedback only on hover, to the left of Copy. */
.am-kb-chat__toolbar {
  position: absolute;
  right: 8px;
  bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  pointer-events: auto;
}
.am-kb-chat__copy,
.am-kb-chat__feedback-btn {
  border: 1px solid var(--am-kb-line);
  background: var(--am-kb-card, var(--am-kb-bot-bg));
  color: var(--am-kb-muted);
  border-radius: 6px;
  padding: 3px 8px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.am-kb-chat__copy {
  opacity: 0.9;
}
.am-kb-chat__copy:hover {
  opacity: 1;
  color: var(--am-kb-ink);
  border-color: var(--am-kb-accent);
}
.am-kb-chat__feedback-btn {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s ease, visibility 0.15s ease;
}
.am-kb-chat__bubble--bot:hover .am-kb-chat__feedback-btn,
.am-kb-chat__bubble--bot:focus-within .am-kb-chat__feedback-btn,
.am-kb-chat__bubble--bot.is-feedback-open .am-kb-chat__feedback-btn {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.am-kb-chat__feedback-btn:hover {
  color: var(--am-kb-ink);
  border-color: var(--am-kb-accent);
}
@media (hover: none) {
  /* Phones/tablets: never show Feedback (no reliable hover); Copy stays. */
  .am-kb-chat__feedback-btn {
    display: none !important;
  }
}
.am-kb-chat__feedback {
  margin-top: 10px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--am-kb-line);
  background: color-mix(in srgb, var(--am-kb-bot-bg) 85%, #000);
  font-size: 13px;
}
.am-kb-chat__feedback-title {
  font-weight: 700;
  color: var(--am-kb-accent);
  margin-bottom: 6px;
}
.am-kb-chat__feedback-qa {
  display: grid;
  gap: 6px;
  margin-bottom: 8px;
  color: var(--am-kb-muted);
}
.am-kb-chat__feedback-atext,
.am-kb-chat__feedback-qtext {
  color: var(--am-kb-ink);
  white-space: pre-wrap;
}
.am-kb-chat__feedback-rates {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}
.am-kb-chat__feedback-rates button {
  border: 1px solid var(--am-kb-line);
  background: transparent;
  color: var(--am-kb-ink);
  border-radius: 999px;
  padding: 4px 12px;
  font: inherit;
  cursor: pointer;
}
.am-kb-chat__feedback-rates button.is-active {
  border-color: var(--am-kb-accent);
  color: var(--am-kb-accent);
}
.am-kb-chat__feedback-extra label {
  display: block;
  margin: 6px 0 3px;
  color: var(--am-kb-muted);
}
.am-kb-chat__feedback-extra textarea {
  width: 100%;
  box-sizing: border-box;
  border-radius: 8px;
  border: 1px solid var(--am-kb-line);
  background: var(--am-kb-bg);
  color: var(--am-kb-ink);
  padding: 8px;
  font: inherit;
  resize: vertical;
}

.am-kb-chat__feedback-email-wrap {
  margin-top: 8px;
}
.am-kb-chat__feedback-email-wrap label {
  display: block;
  margin: 6px 0 3px;
  color: var(--am-kb-muted);
}
.am-kb-chat__feedback-reply-email {
  width: 100%;
  box-sizing: border-box;
  border-radius: 8px;
  border: 1px solid var(--am-kb-line);
  background: var(--am-kb-bg);
  color: var(--am-kb-ink);
  padding: 8px;
  font: inherit;
}

.am-kb-chat__feedback-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}
.am-kb-chat__feedback-submit {
  border: 0;
  border-radius: 8px;
  padding: 6px 12px;
  background: var(--am-kb-accent);
  color: #111;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.am-kb-chat__feedback-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.am-kb-chat__feedback-status {
  color: var(--am-kb-muted);
  font-size: 12px;
}

/* —— Ephraim Live (yellow theme) —— */
.am-kb-chat--live {
  --am-kb-accent: #e6b800;
  --am-kb-user-bg: #8a6d00;
  --am-kb-waiting-bg: #fff6cc;
  --am-kb-bot-bg: #fffbeb;
  --am-kb-bg: #fff9e6;
  --am-kb-card: #fffdf3;
  --am-kb-line: #e6d48a;
}
.am-kb-chat--live .am-kb-chat__header {
  background: linear-gradient(90deg, #f0d24a 0%, #e6b800 55%, #c9a000 100%);
  color: #1a1400;
}
.am-kb-chat--live .am-kb-chat__new {
  border-color: rgba(26, 20, 0, 0.45);
  color: #1a1400;
}
.am-kb-chat--live .am-kb-chat__btn {
  background: #1a1400;
  color: #ffe566;
}
.am-kb-chat__live-banner {
  display: none;
  padding: 8px 14px;
  background: #ffe566;
  color: #1a1400;
  font-size: 0.92rem;
  border-bottom: 1px solid #e6d48a;
  line-height: 1.35;
}
.am-kb-chat--live .am-kb-chat__live-banner { display: block; }
.am-kb-chat__live-banner a { color: #5a4500; font-weight: 600; }

.am-kb-chat__live-hl {
  display: inline;
  padding: 0.12em 0.45em;
  margin: 0 0.05em;
  border-radius: 999px;
  background: #1a1400;
  color: #ffe566;
  font-weight: 700;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.am-kb-chat__live-banner a.am-kb-chat__live-hl,
.am-kb-chat__live-hl a {
  color: #ffe566;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}


/* Advice / CRM caution highlights inside bot answers (Ask + Live) */
.am-kb-chat__warn {
  display: inline;
  padding: 0.1em 0.25em;
  border-radius: 3px;
  background: #ffe566;
  background: linear-gradient(180deg, #ffe566 0%, #f0c000 100%);
  color: #1a1400;
  font-weight: 600;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
/* Keep readable if a host theme uses dark navy bot text areas */
.am-kb-chat--live .am-kb-chat__warn,
.am-kb-chat__bubble--bot .am-kb-chat__warn {
  background: #ffe566;
  background: linear-gradient(180deg, #ffe566 0%, #f0c000 100%);
  color: #1a1400;
}

.am-kb-chat__escalate {
  border: 1px solid rgba(255,255,255,0.55);
  background: transparent;
  color: inherit;
  white-space: nowrap;
}
.am-kb-chat--live .am-kb-chat__escalate {
  background: #1a1400;
  color: #ffe566;
  border-color: #1a1400;
}
.am-kb-chat__identify {
  display: none;
  padding: 10px 14px;
  background: #fff3bf;
  border-bottom: 1px solid #e6d48a;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
/* Show identify for SADC / allowed (Ask or Live) until verified */
.am-kb-chat--identify-open .am-kb-chat__identify,
.am-kb-chat--live .am-kb-chat__identify { display: flex; }
.am-kb-chat.is-staff-tier .am-kb-chat__identify,
.am-kb-chat--live.is-staff-tier .am-kb-chat__identify,
.am-kb-chat--identify-open.is-staff-tier .am-kb-chat__identify { display: none; }

.am-kb-chat__access-banner {
  padding: 8px 14px;
  background: #eef6ff;
  border-bottom: 1px solid #c5daf0;
  color: #1a3a55;
  font-size: 0.88rem;
  line-height: 1.35;
}
.am-kb-chat--live .am-kb-chat__access-banner {
  background: #fff8e0;
  border-bottom-color: #e6d48a;
  color: #5a4500;
}
.am-kb-chat__access-notice + .am-kb-chat__access-notice {
  margin-top: 4px;
}
.am-kb-chat__identify input {
  flex: 1 1 160px;
  min-width: 140px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #e6d48a;
  font: inherit;
}
.am-kb-chat__identify button {
  padding: 8px 12px;
  border-radius: 8px;
  border: none;
  background: #1a1400;
  color: #ffe566;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.am-kb-chat__identify-status {
  flex: 1 1 100%;
  font-size: 0.85rem;
  color: #5a4500;
}
.am-kb-chat__header-actions {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  flex-wrap: nowrap;
  justify-content: flex-end;
  flex: 0 0 auto;
  flex-shrink: 0;
  width: auto;
  margin-left: auto; /* whole button group hugs the right */
  margin-right: 0;
  min-height: 28px;
}


/* Drag-drop images onto composer */
.am-kb-chat__composer {
  position: relative;
}
.am-kb-chat__composer.is-drop::after {
  content: 'Drop images here';
  position: absolute;
  inset: 6px;
  border: 2px dashed var(--am-kb-accent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--am-kb-accent) 18%, transparent);
  color: var(--am-kb-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  pointer-events: none;
  z-index: 5;
}

/* Floating host — match Ask AI guide page (dark 8i shell), large centered modal */
.am-kb-float-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2147483600;
  background: rgba(2, 2, 11, 0.62);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.am-kb-float-host {
  position: fixed;
  z-index: 2147483601;
  left: 50%;
  top: 50%;
  right: auto;
  bottom: auto;
  transform: translate(-50%, -50%);
  /* Same ballpark as .ask-shell on the guide page */
  width: min(920px, calc(100vw - 40px));
  height: min(780px, calc(100vh - 48px));
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(2, 2, 11, 0.45);
  border: 1px solid rgba(183, 183, 251, 0.28);
  background: #06062ae6;
}
.am-kb-float-host.is-max {
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  transform: none;
  width: 100vw;
  height: 100vh;
  border-radius: 0;
  border: 0;
}
.am-kb-float-host .am-kb-chat {
  flex: 1;
  min-height: 0;
  height: 100%;
  /* Map to 8i Interface System — same as guide .ask-shell */
  --am-kb-bg: #030312;
  --am-kb-ink: #f7f7ff;
  --am-kb-muted: #aaaadc;
  --am-kb-card: #09094ae8;
  --am-kb-line: rgba(183, 183, 251, 0.28);
  --am-kb-accent: #f6cd49;
  --am-kb-user-bg: #0f0fb9;
  --am-kb-user-ink: #f7f7ff;
  --am-kb-bot-bg: #09094ae8;
  --am-kb-waiting-bg: #06062a;
  --am-kb-error-bg: #3a1828;
  --am-kb-error-ink: #ffd0d8;
  --am-kb-error-line: #7a3048;
  --am-kb-radius: 12px;
  --am-kb-font: 'Baloo Chettan 2', Arial, sans-serif;
  background: transparent;
}
.am-kb-float-host .am-kb-chat__header {
  background: linear-gradient(90deg, #0c0c78, #0f0fb9);
  color: #f7f7ff;
}
.am-kb-float-host .am-kb-chat__new,
.am-kb-float-host .am-kb-chat__max {
  border-color: color-mix(in srgb, #f6cd49 55%, transparent);
  color: #f6cd49;
}
.am-kb-float-host .am-kb-chat__btn {
  background: #f6cd49;
  color: #02020b;
  border-radius: 6px;
  height: auto;
  min-height: 40px;
  max-height: none;
  align-self: stretch;
  font-size: 12px;
  font-weight: 600;
}
.am-kb-float-host .am-kb-chat__message {
  background: #030312;
  color: #f7f7ff;
  border-color: rgba(183, 183, 251, 0.28);
  border-radius: 6px;
  min-height: 40px;
  height: 40px;
}
.am-kb-float-host .am-kb-chat__composer {
  padding: 8px 10px 10px;
  background: transparent;
  border-top-color: rgba(183, 183, 251, 0.28);
}
.am-kb-float-host .am-kb-chat__row {
  gap: 4px;
  align-items: stretch;
}
.am-kb-float-host .am-kb-chat__hint {
  font-size: 11px;
  color: #aaaadc;
}
.am-kb-float-host .am-kb-chat__spinner {
  border-color: rgba(183, 183, 251, 0.28);
  border-top-color: #f6cd49;
}
/* Fixed 36×36 — match Max exactly; no stretch (stretch made × taller than Max) */
.am-kb-float-host .am-kb-chat__max,
.am-kb-float-host .am-kb-float-close {
  box-sizing: border-box;
  flex: 0 0 28px;
  align-self: center;
  aspect-ratio: auto;
  width: 28px !important;
  height: 28px !important;
  min-width: 28px !important;
  min-height: 28px !important;
  max-width: 28px !important;
  max-height: 28px !important;
  padding: 0 !important;
  margin: 0;
  line-height: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  overflow: hidden;
}
.am-kb-float-host .am-kb-float-close {
  position: static;
  z-index: auto;
  top: auto;
  right: auto;
  border: 1px solid color-mix(in srgb, #f6cd49 55%, transparent);
  background: transparent;
  color: #f6cd49;
  cursor: pointer;
  font: inherit;
  font-size: 0;
  font-weight: 700;
}
.am-kb-float-host .am-kb-float-close:hover {
  background: #f6cd49;
  color: #02020b;
}
/* Keep Max+Close tight beside each other after New */
.am-kb-float-host .am-kb-chat__header-actions {
  gap: 4px;
  margin-left: auto;
  align-items: center !important;
}
.am-kb-float-host .am-kb-chat__max,
.am-kb-float-host .am-kb-float-close {
  margin: 0 !important;
}
.am-kb-float-host .am-kb-chat__escalate,
.am-kb-float-host .am-kb-chat__new {
  border-color: color-mix(in srgb, #f6cd49 55%, transparent);
  color: #f6cd49;
}
.am-kb-float-fab {
  position: fixed;
  z-index: 2147483602;
  right: 16px;
  bottom: 16px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 0;
  cursor: pointer;
  background: #f6cd49;
  color: #02020b;
  font-weight: 800;
  font-size: 14px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

/* Shared header action button size — one centered 28px row */
.am-kb-chat__header-actions {
  align-items: center !important;
}
.am-kb-chat__escalate,
.am-kb-chat__new,
.am-kb-chat__max,
.am-kb-float-close {
  box-sizing: border-box;
  flex: 0 0 auto;
  align-self: center !important;
  margin: 0 !important;
  vertical-align: middle;
  border-radius: 6px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.am-kb-chat__escalate,
.am-kb-chat__new {
  min-height: 28px !important;
  height: 28px !important;
  max-height: 28px !important;
  padding: 0 8px !important;
  line-height: 1 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px !important;
}
.am-kb-chat__max,
.am-kb-float-close {
  width: 28px !important;
  height: 28px !important;
  min-width: 28px !important;
  min-height: 28px !important;
  max-width: 28px !important;
  max-height: 28px !important;
  padding: 0 !important;
  line-height: 0 !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  aspect-ratio: auto;
}
.am-kb-chat__max {
  border: 1px solid color-mix(in srgb, var(--am-kb-accent, #f6cd49) 55%, transparent);
  background: transparent;
  color: var(--am-kb-accent, #f6cd49);
  flex: 0 0 28px;
}

.am-kb-chat__max:hover { filter: brightness(1.08); }
.am-kb-chat__max-icon {
  display: inline-flex;
  line-height: 0;
}
.am-kb-chat__max-icon svg {
  display: block;
}

/* Inline / page chat maximized */
.am-kb-chat.am-kb-chat--max {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: none !important;
  max-height: none !important;
  z-index: 2147483000;
  border-radius: 0 !important;
  margin: 0 !important;
}
.ask-shell.is-max {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: none !important;
  margin: 0 !important;
  border-radius: 0 !important;
  z-index: 2147482999;
}
html.am-kb-chat-max-open,
body.am-kb-chat-max-open {
  overflow: hidden;
}

.am-kb-chat--live .am-kb-chat__max {
  border-color: rgba(0,0,0,0.35);
  color: #1a1400;
  background: transparent;
}
.ask-shell .am-kb-chat__max {
  /* inherit page theme with new/escalate */
}


/* Live wait >1 min — offer Ask AI fallback */
.am-kb-chat__live-timeout {
  border-color: #e6d48a;
  background: #fff8e1;
}
.am-kb-chat--live .am-kb-chat__live-timeout {
  background: #fff6cc;
  border-color: #e6d48a;
  color: #1a1400;
}
.am-kb-chat__live-timeout-btn {
  margin-top: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  background: #0C50EE;
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.am-kb-chat__live-timeout-btn:hover { filter: brightness(1.06); }
.am-kb-chat--live .am-kb-chat__live-timeout-btn {
  background: #1a1400;
  color: #ffe566;
}


/* Live wait progress (thin bar on bottom border of waiting bubble) */
.am-kb-chat__bubble--waiting-live {
  position: relative;
  padding-bottom: 14px;
}
.am-kb-chat__wait-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(0, 0, 0, 0.12);
  border-radius: 0 0 var(--am-kb-radius, 12px) var(--am-kb-radius, 12px);
  overflow: hidden;
  pointer-events: none;
}
.am-kb-chat__wait-bar-fill {
  display: block;
  height: 100%;
  width: 0%;
  background: #f6cd49; /* accent yellow — visible on Live cream + dark */
  border-radius: inherit;
  transition: none;
}
.am-kb-chat--live .am-kb-chat__wait-bar {
  background: rgba(26, 20, 0, 0.18);
}
.am-kb-chat--live .am-kb-chat__wait-bar-fill {
  background: #f6cd49;
}
.am-kb-chat__live-timeout-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.am-kb-chat__live-timeout-btn--wait {
  background: transparent !important;
  color: inherit !important;
  border: 1px solid rgba(0,0,0,0.35) !important;
}
.am-kb-chat--live .am-kb-chat__live-timeout-btn--wait {
  border-color: rgba(26, 20, 0, 0.4) !important;
  color: #1a1400 !important;
}

.am-kb-chat__access-banner {
  transition: opacity 0.55s ease;
}
.am-kb-chat__access-banner.is-fading {
  opacity: 0;
  pointer-events: none;
}

/* Live mode badge is not clickable */
.am-kb-chat__escalate:disabled,
.am-kb-chat--live .am-kb-chat__escalate:disabled {
  cursor: default;
  pointer-events: none;
  opacity: 1;
}
