/* Jabian USA (JAAA) — FAQ chatbot widget.
   Matches the site theme (assets/style.css variables):
   cream panel #fffdf6, near-black text #14181f, dark green #14532d,
   gold #f2c94c, amber focus #b45309, Georgia serif.
   No images, no backend, no tracking. Pure client-side FAQ matching. */

/* Launcher button — bottom right. */
.jaaa-chat-launcher {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 1100;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 2px solid var(--accent, #14532d);
  background: var(--accent, #14532d);
  color: #fffdf6;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
  font-size: 1.7rem;
  line-height: 1;
  padding: 0;
}
.jaaa-chat-launcher:hover { background: #0b3d20; }
.jaaa-chat-launcher:focus-visible { outline: 3px solid #b45309; outline-offset: 3px; }

/* Panel */
.jaaa-chat-panel {
  position: fixed;
  right: 1.25rem;
  bottom: 5.5rem;
  z-index: 1100;
  width: 380px;
  max-width: calc(100vw - 2rem);
  height: 560px;
  max-height: calc(100vh - 7rem);
  display: flex;
  flex-direction: column;
  background: var(--panel, #fffdf6);
  color: var(--text, #14181f);
  border: 1px solid var(--border, #cfc8b8);
  border-top: 4px solid var(--accent, #14532d);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1rem;
  line-height: 1.6;
}
.jaaa-chat-panel[hidden] { display: none; }

.jaaa-chat-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.8rem 1rem;
  background: var(--accent, #14532d);
  color: #fffdf6;
}
.jaaa-chat-header .jaaa-chat-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #f2c94c;
  color: #14181f;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.05rem;
  flex: none;
}
.jaaa-chat-header .jaaa-chat-title { font-weight: 800; line-height: 1.25; }
.jaaa-chat-header .jaaa-chat-subtitle { font-size: 0.85rem; color: #e7f5e9; line-height: 1.25; }
.jaaa-chat-header .jaaa-chat-spacer { flex: 1; }
.jaaa-chat-lang,
.jaaa-chat-close {
  background: transparent;
  color: #fffdf6;
  border: 1px solid rgba(255, 253, 246, 0.6);
  border-radius: 6px;
  cursor: pointer;
  padding: 0.3rem 0.55rem;
  font-size: 0.9rem;
  line-height: 1.2;
}
.jaaa-chat-lang:hover, .jaaa-chat-close:hover { border-color: #f2c94c; color: #f2c94c; }
.jaaa-chat-lang:focus-visible, .jaaa-chat-close:focus-visible { outline: 3px solid #b45309; outline-offset: 2px; }

.jaaa-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.jaaa-chat-msg { max-width: 88%; padding: 0.6rem 0.85rem; border-radius: 10px; overflow-wrap: break-word; }
.jaaa-chat-msg p { margin: 0 0 0.4rem; }
.jaaa-chat-msg p:last-child { margin-bottom: 0; }
.jaaa-chat-msg a { color: var(--accent, #14532d); text-decoration: underline; }
.jaaa-chat-msg-bot { background: #fdfcf7; border: 1px solid var(--border, #cfc8b8); align-self: flex-start; border-bottom-left-radius: 2px; }
.jaaa-chat-msg-user { background: var(--accent, #14532d); color: #fffdf6; align-self: flex-end; border-bottom-right-radius: 2px; }
.jaaa-chat-msg-user a { color: #fffdf6; }
.jaaa-chat-msg .jaaa-chat-action {
  display: inline-block;
  margin-top: 0.45rem;
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  background: var(--accent, #14532d);
  color: #ffffff;
  text-decoration: none;
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
}
.jaaa-chat-msg .jaaa-chat-action:hover { background: #0b3d20; }

.jaaa-chat-typing { color: #5a5348; font-style: italic; }

.jaaa-chat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0.5rem 1rem;
  border-top: 1px solid var(--border, #cfc8b8);
}
.jaaa-chat-chip {
  background: transparent;
  color: var(--accent, #14532d);
  border: 1px solid var(--accent, #14532d);
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  font-size: 0.9rem;
  cursor: pointer;
  line-height: 1.3;
}
.jaaa-chat-chip:hover { background: var(--accent, #14532d); color: #fffdf6; }
.jaaa-chat-chip:focus-visible { outline: 3px solid #b45309; outline-offset: 2px; }

.jaaa-chat-input-row {
  display: flex;
  gap: 0.5rem;
  padding: 0.7rem 1rem 0.9rem;
  border-top: 1px solid var(--border, #cfc8b8);
}
.jaaa-chat-input {
  flex: 1;
  min-width: 0;
  background: #ffffff;
  color: var(--text, #14181f);
  border: 1px solid var(--border, #cfc8b8);
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  font-size: 1rem;
  font-family: inherit;
}
.jaaa-chat-input:focus-visible { outline: 3px solid #b45309; outline-offset: 2px; }
.jaaa-chat-send {
  background: var(--accent, #14532d);
  color: #ffffff;
  border: 2px solid var(--accent, #14532d);
  border-radius: 8px;
  padding: 0.5rem 1rem;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  font-family: Arial, Helvetica, sans-serif;
}
.jaaa-chat-send:hover { background: #0b3d20; }
.jaaa-chat-send:focus-visible { outline: 3px solid #b45309; outline-offset: 2px; }

@media (max-width: 700px) {
  .jaaa-chat-launcher { right: 0.9rem; }
  .jaaa-chat-panel { right: 0.5rem; }
}
