/* Teresa Insider — Guia de IA (widget flutuante)
   Escopo fechado em .ti-guide* para não colidir com style.css */

.ti-guide-launch {
  position: fixed; right: 18px; bottom: 18px; z-index: 9000;
  display: inline-flex; align-items: center; gap: 9px;
  padding: 12px 18px; border: 0; border-radius: 999px;
  background: #092d35; color: #fff;
  font: 600 14px/1 system-ui, -apple-system, "Segoe UI", sans-serif;
  cursor: pointer; box-shadow: 0 10px 30px rgba(9, 45, 53, .28);
  transition: transform .15s ease, box-shadow .15s ease;
}
.ti-guide-launch:hover { transform: translateY(-1px); box-shadow: 0 14px 36px rgba(9, 45, 53, .34); }
.ti-guide-launch:focus-visible { outline: 3px solid #7fd1c1; outline-offset: 3px; }
.ti-guide-launch[hidden] { display: none; }
.ti-guide-launch svg { width: 17px; height: 17px; flex: none; }

.ti-guide {
  position: fixed; right: 18px; bottom: 18px; z-index: 9001;
  width: min(404px, calc(100vw - 24px));
  height: min(620px, calc(100vh - 32px));
  display: none; flex-direction: column;
  background: #fff; border-radius: 18px; overflow: hidden;
  box-shadow: 0 24px 70px rgba(9, 45, 53, .35);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #092d35;
}
.ti-guide.is-open { display: flex; }

.ti-guide-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; background: #092d35; color: #fff; flex: none;
}
.ti-guide-head strong { font-size: 15px; font-weight: 650; letter-spacing: .1px; }
.ti-guide-head small { display: block; font-size: 11.5px; opacity: .72; font-weight: 400; margin-top: 2px; }
.ti-guide-head .ti-guide-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #7fd1c1; flex: none;
  box-shadow: 0 0 0 3px rgba(127, 209, 193, .22);
}
.ti-guide-close {
  margin-left: auto; background: transparent; border: 0; color: #fff;
  font-size: 22px; line-height: 1; cursor: pointer; padding: 4px 6px; border-radius: 8px;
}
.ti-guide-close:hover { background: rgba(255, 255, 255, .14); }

.ti-guide-log {
  flex: 1; overflow-y: auto; padding: 16px 14px 6px;
  display: flex; flex-direction: column; gap: 10px;
  background: #f6f8f7; scroll-behavior: smooth;
}
.ti-msg { max-width: 88%; padding: 10px 13px; border-radius: 14px; font-size: 14px; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; }
.ti-msg--bot { background: #fff; border: 1px solid #e3eae7; align-self: flex-start; border-bottom-left-radius: 5px; }
.ti-msg--me { background: #092d35; color: #fff; align-self: flex-end; border-bottom-right-radius: 5px; }
.ti-msg a { color: #0b6b5c; text-decoration: underline; text-underline-offset: 2px; }
.ti-msg--me a { color: #cdeee7; }
.ti-msg--err { background: #fff4f2; border: 1px solid #f3cdc6; color: #7a2b1c; }

.ti-chips { display: flex; flex-wrap: wrap; gap: 7px; padding: 10px 14px 0; background: #f6f8f7; flex: none; }
.ti-chip {
  border: 1px solid #cfdcd8; background: #fff; color: #0b4b45;
  padding: 7px 11px; border-radius: 999px; font-size: 12.5px; cursor: pointer;
  transition: background .12s ease, border-color .12s ease;
}
.ti-chip:hover { background: #eaf6f2; border-color: #7fd1c1; }

.ti-guide-form { display: flex; gap: 8px; padding: 12px 14px 14px; background: #f6f8f7; flex: none; }
.ti-guide-input {
  flex: 1; resize: none; min-height: 44px; max-height: 120px;
  padding: 11px 13px; border: 1px solid #cfdcd8; border-radius: 12px;
  font: inherit; font-size: 14px; color: #092d35; background: #fff;
}
.ti-guide-input:focus { outline: none; border-color: #0b6b5c; box-shadow: 0 0 0 3px rgba(11, 107, 92, .12); }
.ti-guide-send {
  width: 44px; height: 44px; flex: none; border: 0; border-radius: 12px;
  background: #092d35; color: #fff; cursor: pointer; display: grid; place-items: center;
}
.ti-guide-send:disabled { opacity: .45; cursor: default; }
.ti-guide-send svg { width: 18px; height: 18px; }

.ti-guide-foot {
  padding: 0 14px 10px; background: #f6f8f7; flex: none;
  font-size: 10.5px; color: #5d726d; line-height: 1.4;
}

.ti-typing { display: inline-flex; gap: 4px; align-items: center; }
.ti-typing i { width: 6px; height: 6px; border-radius: 50%; background: #9db5b0; animation: ti-blink 1.1s infinite; }
.ti-typing i:nth-child(2) { animation-delay: .18s; }
.ti-typing i:nth-child(3) { animation-delay: .36s; }
@keyframes ti-blink { 0%, 60%, 100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-2px); } }

@media (max-width: 520px) {
  .ti-guide { right: 0; bottom: 0; width: 100vw; height: 100vh; border-radius: 0; }
  .ti-guide-launch { right: 12px; bottom: 12px; padding: 11px 15px; }
}
@media (prefers-reduced-motion: reduce) {
  .ti-guide-launch, .ti-chip { transition: none; }
  .ti-typing i { animation: none; }
}
