/* Brand tokens copied verbatim from the live floresai.io site (FloresAISec/index.html
   :root) so the widget reads as the same product the marketing site already shows. */
:root {
  --bg: #F7F6F2;
  --panel: #FFFFFF;
  --panel2: #EFEDE6;
  --line: rgba(20, 18, 12, .13);
  --ink: #17181B;
  --body: #33322C;
  --muted: #6E6D66;
  --accent: #0E7A63;
  --accent-text: #0B6552;
  --accent-tint: rgba(14, 122, 99, .09);
  --accent-hover: #0A5C4A;
}

* { box-sizing: border-box; }

/* Author rules below set `display: flex` on several of these same elements, which
   would otherwise beat the UA stylesheet's [hidden]{display:none} (author origin
   wins over user-agent origin regardless of specificity) -- state switching in
   chat.js relies on the `hidden` attribute actually hiding things. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--body);
  font-family: "Public Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15px;
}

.chat-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-height: 100vh;
  background: var(--panel);
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-top: 3px solid var(--accent);
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  flex: 0 0 auto;
}

.chat-mark {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  background: var(--accent);
  flex: 0 0 auto;
}

.chat-header-text { display: flex; flex-direction: column; line-height: 1.2; }

.chat-title {
  font-family: Archivo, sans-serif;
  font-weight: 800;
  color: var(--ink);
  font-size: 15px;
}

.chat-subtitle { color: var(--muted); font-size: 12px; }

.chat-state-screen {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px;
  text-align: center;
}

.chat-state-text { color: var(--muted); font-size: 14px; max-width: 320px; margin: 0; }

.chat-cta {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 4px;
  font-size: 14px;
}
.chat-cta:hover { background: var(--accent-hover); }

.chat-cta-small { padding: 8px 14px; font-size: 13px; border: none; cursor: pointer; }

.chat-cta-ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 8px 14px;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
}

.chat-transcript {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg);
}

.chat-bubble {
  max-width: 82%;
  padding: 9px 12px;
  border-radius: 4px;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.chat-bubble.in {
  align-self: flex-start;
  background: var(--panel2);
  color: var(--body);
}

.chat-bubble.out {
  align-self: flex-end;
  background: var(--accent-tint);
  border: 1px solid rgba(14, 122, 99, .28);
  color: #0B5A49;
}

.chat-bubble-tag {
  display: block;
  font-size: 10px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 3px;
}

.chat-typing {
  align-self: flex-start;
  color: var(--muted);
  font-size: 13px;
  padding: 4px 12px;
}

.chat-lead-form, .chat-composer {
  flex: 0 0 auto;
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.chat-lead-form { flex-direction: column; }
.chat-lead-intro { margin: 0 0 4px; font-size: 13px; color: var(--muted); }
.chat-lead-form input {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 9px 10px;
  font-size: 14px;
  font-family: inherit;
}
.chat-lead-actions { display: flex; gap: 8px; margin-top: 2px; }

.chat-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.chat-input {
  flex: 1 1 auto;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
}
.chat-input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

.chat-send {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 0 16px;
  font-weight: 600;
  cursor: pointer;
}
.chat-send:hover { background: var(--accent-hover); }
.chat-send:disabled { opacity: .5; cursor: not-allowed; }

.chat-footer {
  flex: 0 0 auto;
  padding: 8px 12px 12px;
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.chat-footer-book {
  display: block;
  text-align: center;
  color: var(--accent-text);
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
  margin-bottom: 6px;
}
.chat-footer-book:hover { text-decoration: underline; }

.chat-footer-note {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
  line-height: 1.4;
}

/* Mobile-first baseline above is already narrow-safe (tested at 380px); this just
   caps width when the widget is embedded somewhere wider than a phone-sized iframe. */
@media (min-width: 480px) {
  html, body { height: 100%; }
}
