/* Future Tools Assistant - chat window. Everything is scoped under .ftwa-root so the theme is not affected. */
.ftwa-root {
  --ftwa-accent: #1e4f9c;
  --ftwa-accent-dark: #163b75;
  --ftwa-highlight: #f26f21;
  --ftwa-bg: #ffffff;
  --ftwa-soft: #f2f4f8;
  --ftwa-text: #1d2330;
  --ftwa-muted: #667085;
  position: fixed; right: 20px; bottom: var(--ftwa-bottom, 20px); z-index: 99999;
  font: 15px/1.45 -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: var(--ftwa-text);
}
.ftwa-root *, .ftwa-root *::before, .ftwa-root *::after { box-sizing: border-box; }
.ftwa-root button { font: inherit; cursor: pointer; }
.ftwa-root [hidden] { display: none !important; }
.ftwa-root.ftwa-left { right: auto; left: 20px; }
.ftwa-root.ftwa-is-open { bottom: 20px; }   /* the open window always uses the full height */
.ftwa-root.ftwa-no-launcher .ftwa-launcher { display: none !important; }

.ftwa-launcher {
  display: flex; align-items: center; gap: 8px; border: 0; border-radius: 28px; padding: 12px 18px;
  background: var(--ftwa-accent); color: #fff; box-shadow: 0 6px 20px rgba(0,0,0,.25); font-weight: 600;
}
.ftwa-launcher:hover { background: var(--ftwa-accent-dark); }
.ftwa-launcher svg { width: 22px; height: 22px; }

.ftwa-panel {
  display: flex; flex-direction: column; width: 390px; height: min(640px, calc(100vh - 40px));
  background: var(--ftwa-bg); border-radius: 14px; overflow: hidden; box-shadow: 0 12px 40px rgba(0,0,0,.28);
}
.ftwa-head { display: flex; align-items: center; gap: 6px; padding: 12px 14px; background: var(--ftwa-accent); color: #fff; }
.ftwa-head div { flex: 1; min-width: 0; }
.ftwa-head strong { display: block; font-size: 16px; }
.ftwa-head small { display: block; opacity: .85; font-size: 12px; }
.ftwa-head button { background: transparent; border: 0; color: #fff; font-size: 22px; line-height: 1; padding: 4px 8px; border-radius: 6px; }
.ftwa-head button:hover { background: rgba(255,255,255,.15); }

.ftwa-log { flex: 1; overflow-y: auto; padding: 14px; background: var(--ftwa-soft); }
.ftwa-msg { display: flex; flex-direction: column; margin: 0 0 12px; }
.ftwa-user { align-items: flex-end; }
.ftwa-bot, .ftwa-notice { align-items: flex-start; }
.ftwa-bubble { max-width: 88%; padding: 9px 12px; border-radius: 14px; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.08); overflow-wrap: anywhere; }
.ftwa-user .ftwa-bubble { background: var(--ftwa-accent); color: #fff; border-bottom-right-radius: 4px; }
.ftwa-bot .ftwa-bubble { border-bottom-left-radius: 4px; }
.ftwa-notice .ftwa-bubble { background: #fff6e8; border: 1px solid #f6d6a8; }
.ftwa-bubble p { margin: 0 0 6px; } .ftwa-bubble p:last-child { margin: 0; }
.ftwa-bubble ul { margin: 4px 0 6px; padding-left: 20px; }
.ftwa-bubble a { color: var(--ftwa-accent); text-decoration: underline; }

.ftwa-typing .ftwa-bubble { display: flex; gap: 4px; padding: 12px 14px; }
.ftwa-typing span { width: 7px; height: 7px; border-radius: 50%; background: #9aa3b5; animation: ftwa-dot 1.2s infinite ease-in-out; }
.ftwa-typing span:nth-child(2) { animation-delay: .15s; } .ftwa-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes ftwa-dot { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }

.ftwa-options { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; max-width: 100%; }
.ftwa-option { border: 1px solid var(--ftwa-accent); background: #fff; color: var(--ftwa-accent); border-radius: 18px; padding: 6px 12px; margin-top: 6px; }
.ftwa-option:hover { background: var(--ftwa-accent); color: #fff; }

.ftwa-cards { display: grid; gap: 8px; width: 100%; margin-top: 8px; }
.ftwa-card { display: grid; grid-template-columns: 84px 1fr; gap: 10px; background: #fff; border: 1px solid #e3e7ef; border-radius: 10px; padding: 8px; }
.ftwa-card-img { grid-row: span 2; display: flex; align-items: center; justify-content: center; background: #fafbfc; border-radius: 6px; }
.ftwa-card-img img { max-width: 84px; max-height: 84px; object-fit: contain; }
.ftwa-card-name { font-weight: 600; font-size: 14px; }
.ftwa-card-pn { color: var(--ftwa-muted); font-size: 12px; margin: 2px 0 4px; }
.ftwa-card-specs { list-style: none; margin: 0; padding: 0; font-size: 12px; }
.ftwa-card-specs span { color: var(--ftwa-muted); }
.ftwa-card-note { font-size: 11px; color: #9a5b00; margin-top: 4px; }
.ftwa-card-quote { grid-column: 2; justify-self: start; border: 0; border-radius: 6px; padding: 5px 10px; background: var(--ftwa-highlight); color: #fff; font-size: 13px; }

.ftwa-figure { margin: 8px 0 0; background: #fff; border-radius: 10px; padding: 6px; max-width: 100%; border: 1px solid #e3e7ef; }
.ftwa-figure img { display: block; max-width: 100%; height: auto; border-radius: 6px; }
.ftwa-figure figcaption { font-size: 12px; color: var(--ftwa-muted); margin-top: 4px; }

.ftwa-form { width: 100%; margin-top: 8px; background: #fff; border: 1px solid #dfe4ee; border-radius: 10px; padding: 12px; }
.ftwa-form-title { font-weight: 700; margin-bottom: 8px; }
.ftwa-sub { font-weight: 600; margin: 10px 0 4px; }
.ftwa-field { margin-bottom: 8px; }
.ftwa-field label { display: block; font-size: 13px; margin-bottom: 2px; }
.ftwa-field label b { color: #c0392b; } .ftwa-field label em { color: var(--ftwa-muted); font-style: normal; }
.ftwa-field input, .ftwa-field textarea, .ftwa-field select, .ftwa-row input {
  width: 100%; border: 1px solid #cfd6e2; border-radius: 6px; padding: 7px 9px; font: inherit; font-size: 14px; background: #fff; color: inherit;
}
.ftwa-field .ftwa-inline { display: inline-flex; align-items: center; gap: 4px; margin-right: 14px; font-size: 14px; }
.ftwa-field .ftwa-inline input { width: auto; }
.ftwa-bad input, .ftwa-bad textarea, .ftwa-bad select { border-color: #c0392b; }
.ftwa-err { color: #c0392b; font-size: 12px; }
.ftwa-rows { display: grid; gap: 6px; }
.ftwa-row { display: grid; grid-template-columns: 1fr 1.6fr 56px; gap: 6px; }
.ftwa-add { background: none; border: 0; color: var(--ftwa-accent); padding: 4px 0; font-size: 13px; }
.ftwa-submit { width: 100%; border: 0; border-radius: 8px; padding: 10px; background: var(--ftwa-highlight); color: #fff; font-weight: 700; }
.ftwa-submit:disabled { opacity: .6; }
.ftwa-form-error { color: #c0392b; font-size: 13px; margin-bottom: 6px; }
.ftwa-form-note { font-size: 11px; color: var(--ftwa-muted); margin-top: 6px; }
.ftwa-sent { margin-top: 6px; font-size: 13px; color: #1e7b34; font-weight: 600; }

.ftwa-check { padding: 6px 14px; background: #fff; }
.ftwa-input { display: flex; gap: 8px; padding: 10px; border-top: 1px solid #e3e7ef; background: #fff; }
.ftwa-input textarea { flex: 1; resize: none; overflow-y: hidden; border: 1px solid #cfd6e2; border-radius: 10px; padding: 9px 11px; font: inherit; max-height: 120px; color: inherit; }
.ftwa-input button { border: 0; border-radius: 10px; width: 44px; background: var(--ftwa-accent); color: #fff; font-size: 18px; }
.ftwa-root .ftwa-input button { padding: 0; }   /* themes pad every button (Astra: 15px 28px), which left the icon 0px wide */
.ftwa-input .ftwa-mic { display: flex; align-items: center; justify-content: center; flex: none; background: var(--ftwa-soft); color: var(--ftwa-accent); }
.ftwa-input .ftwa-mic:hover { background: #e3e8f2; }
.ftwa-input .ftwa-mic svg { width: 22px; height: 22px; flex: none; }
.ftwa-input .ftwa-mic.ftwa-listening { background: #c0392b; color: #fff; animation: ftwa-pulse 1.4s infinite; }
@keyframes ftwa-pulse { 0% { box-shadow: 0 0 0 0 rgba(192,57,43,.45); } 70%, 100% { box-shadow: 0 0 0 8px rgba(192,57,43,0); } }
@media (prefers-reduced-motion: reduce) { .ftwa-input .ftwa-mic.ftwa-listening { animation: none; } }
.ftwa-privacy { padding: 0 12px 8px; background: #fff; font-size: 11px; color: var(--ftwa-muted); }

@media (max-width: 600px) {
  .ftwa-root { right: 12px; bottom: min(var(--ftwa-bottom, 12px), 40vh); }
  .ftwa-root.ftwa-left { right: auto; left: 12px; }
  .ftwa-root.ftwa-is-open { inset: 0; }
  .ftwa-root.ftwa-is-open .ftwa-panel { width: 100vw; height: 100vh; height: 100dvh; border-radius: 0; }
}
