/* TaxBooksCFO Assistant widget. Self-contained; works on every page. */
.tba, .tba * { box-sizing: border-box; }
.tba {
  --a-ink: #0A1A2F; --a-ink2: #13315C; --a-accent: #D9622B; --a-accent2: #B44E1E;
  --a-bg: #F6F7F9; --a-line: #E1E6EE; --a-text: #121A26; --a-muted: #5A6577;
  font-family: "Instrument Sans", "Helvetica Neue", Arial, sans-serif; color: var(--a-text);
  position: fixed; right: 20px; bottom: 20px; z-index: 2147483000; font-size: 15px; line-height: 1.5;
}
.tba button { font-family: inherit; }
.tba-launch {
  display: flex; align-items: center; gap: 12px; height: 60px; padding: 0 22px 0 8px; border: 0; border-radius: 999px;
  background: var(--a-ink); color: #fff; cursor: pointer; box-shadow: 0 18px 40px -12px rgba(10,26,47,.55);
  font-size: 15px; font-weight: 600; transition: transform .25s cubic-bezier(.2,.7,.2,1), background .2s;
}
.tba-launch:hover { transform: translateY(-2px); background: var(--a-ink2); }
.tba-launch__ico { width: 44px; height: 44px; border-radius: 50%; background: var(--a-accent); display: grid; place-items: center; position: relative; }
.tba-launch__ico svg { width: 20px; height: 20px; }
.tba-launch__ico::after { content: ""; position: absolute; right: 1px; top: 1px; width: 11px; height: 11px; border-radius: 50%; background: #3BD08A; border: 2px solid var(--a-ink); }
.tba.is-open .tba-launch { display: none; }

.tba-teaser {
  position: absolute; right: 0; bottom: 76px; width: 330px; background: #fff; border-radius: 4px;
  box-shadow: 0 24px 60px -20px rgba(10,26,47,.45); border: 1px solid var(--a-line); padding: 20px 20px 18px;
  opacity: 0; transform: translateY(10px); pointer-events: none; transition: opacity .35s, transform .35s;
}
.tba-teaser.show { opacity: 1; transform: none; pointer-events: auto; }
.tba-teaser__x { position: absolute; right: 8px; top: 8px; width: 30px; height: 30px; border: 0; background: transparent; cursor: pointer; color: var(--a-muted); font-size: 20px; line-height: 1; }
.tba-teaser h4 { font: 400 20px/1.25 "Source Serif 4", Georgia, serif; margin: 0 24px 8px 0; color: var(--a-ink); }
.tba-teaser p { margin: 0 0 14px; color: var(--a-muted); font-size: 14px; }
.tba-teaser form { display: flex; gap: 8px; }
.tba-teaser input { flex: 1; min-width: 0; height: 44px; border: 1px solid #C9D0DA; border-radius: 3px; padding: 0 12px; font: inherit; font-size: 15px; }
.tba-teaser input:focus { outline: 0; border-color: var(--a-ink); }
.tba-teaser form button { height: 44px; padding: 0 14px; border: 0; border-radius: 3px; background: var(--a-accent); color: #fff; font-weight: 600; cursor: pointer; }
.tba-teaser__alt { margin-top: 12px; font-size: 13.5px; }
.tba-teaser__alt button { border: 0; background: none; padding: 0; color: var(--a-ink2); font-weight: 600; text-decoration: underline; cursor: pointer; font-size: 13.5px; }
.tba-teaser__ok { color: #1F7A54; font-weight: 600; font-size: 14px; }

.tba-panel {
  position: absolute; right: 0; bottom: 0; width: 400px; height: min(680px, calc(100vh - 40px));
  background: #fff; border-radius: 6px; overflow: hidden; display: none; flex-direction: column;
  box-shadow: 0 40px 90px -24px rgba(10,26,47,.55); border: 1px solid rgba(10,26,47,.08);
}
.tba.is-open .tba-panel { display: flex; animation: tbaIn .32s cubic-bezier(.2,.7,.2,1); }
@keyframes tbaIn { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.tba-head { background: var(--a-ink); color: #fff; padding: 18px 18px 14px; }
.tba-head__row { display: flex; align-items: center; gap: 12px; }
.tba-av { width: 40px; height: 40px; border-radius: 50%; background: var(--a-accent); display: grid; place-items: center; font-weight: 700; font-size: 12px; letter-spacing: .04em; flex-shrink: 0; }
.tba-head__t { flex: 1; min-width: 0; }
.tba-head__t b { display: block; font-size: 15.5px; }
.tba-head__t span { font-size: 12.5px; color: rgba(255,255,255,.65); display: flex; align-items: center; gap: 6px; }
.tba-head__t span::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #3BD08A; }
.tba-x { width: 36px; height: 36px; border: 0; background: rgba(255,255,255,.08); color: #fff; border-radius: 50%; cursor: pointer; font-size: 18px; }
.tba-x:hover { background: rgba(255,255,255,.16); }
.tba-head__meta { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 12px; font-size: 12.5px; color: rgba(255,255,255,.72); align-items: center; }
.tba-head__meta a { color: #fff; text-decoration: none; }
.tba-human { margin-left: auto; height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid rgba(255,255,255,.4); background: transparent; color: #fff; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.tba-human:hover { background: #fff; color: var(--a-ink); }

.tba-log { flex: 1; overflow-y: auto; padding: 18px 16px 8px; background: var(--a-bg); scroll-behavior: smooth; }
.tba-msg { display: flex; margin-bottom: 12px; }
.tba-msg__b { max-width: 86%; padding: 11px 14px; border-radius: 14px; font-size: 14.5px; line-height: 1.55; word-wrap: break-word; }
.tba-msg--bot .tba-msg__b { background: #fff; border: 1px solid var(--a-line); border-top-left-radius: 4px; }
.tba-msg--me { justify-content: flex-end; }
.tba-msg--me .tba-msg__b { background: var(--a-ink); color: #fff; border-top-right-radius: 4px; }
.tba-msg__b p { margin: 0 0 8px; } .tba-msg__b p:last-child { margin: 0; }
.tba-msg__b ul { margin: 4px 0 8px; padding-left: 18px; } .tba-msg__b li { margin: 2px 0; }
.tba-msg__b a { color: var(--a-ink2); font-weight: 600; }
.tba-msg--me .tba-msg__b a { color: #fff; }
.tba-typing { display: inline-flex; gap: 4px; padding: 14px 16px !important; }
.tba-typing i { width: 7px; height: 7px; border-radius: 50%; background: #9AA5B5; animation: tbaDot 1.2s infinite; }
.tba-typing i:nth-child(2) { animation-delay: .15s; } .tba-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes tbaDot { 0%, 60%, 100% { opacity: .3; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }

.tba-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 14px; }
.tba-chip { border: 1px solid #C9D0DA; background: #fff; color: var(--a-ink); border-radius: 999px; padding: 8px 13px; font-size: 13.5px; font-weight: 500; cursor: pointer; transition: all .15s; }
.tba-chip:hover { border-color: var(--a-ink); background: var(--a-ink); color: #fff; }

.tba-card { background: #fff; border: 1px solid var(--a-line); border-left: 3px solid var(--a-accent); border-radius: 6px; padding: 14px; margin: 0 0 14px; }
.tba-card h5 { margin: 0 0 4px; font-size: 14.5px; }
.tba-card p { margin: 0 0 10px; font-size: 13px; color: var(--a-muted); }
.tba-card input { width: 100%; height: 40px; border: 1px solid #C9D0DA; border-radius: 3px; padding: 0 10px; font: inherit; font-size: 14.5px; margin-bottom: 8px; }
.tba-card input:focus { outline: 0; border-color: var(--a-ink); }
.tba-card__row { display: flex; gap: 8px; } .tba-card__row input { flex: 1; min-width: 0; }
.tba-card button { width: 100%; height: 42px; border: 0; border-radius: 3px; background: var(--a-accent); color: #fff; font-weight: 600; cursor: pointer; font-size: 14.5px; }
.tba-card button:hover { background: var(--a-accent2); }
.tba-card__err { color: #C2412A; font-size: 12.5px; margin: -2px 0 8px; display: none; }
.tba-card.done { border-left-color: #1F7A54; }

.tba-foot { border-top: 1px solid var(--a-line); padding: 10px 12px 10px; background: #fff; }
.tba-form { display: flex; align-items: flex-end; gap: 8px; }
.tba-form textarea { flex: 1; resize: none; border: 1px solid #C9D0DA; border-radius: 20px; padding: 10px 14px; font: inherit; font-size: 15px; max-height: 120px; min-height: 42px; line-height: 1.4; }
.tba-form textarea:focus { outline: 0; border-color: var(--a-ink); }
.tba-send { width: 42px; height: 42px; flex-shrink: 0; border: 0; border-radius: 50%; background: var(--a-accent); color: #fff; cursor: pointer; display: grid; place-items: center; }
.tba-send:disabled { background: #C9D0DA; cursor: default; }
.tba-send svg { width: 18px; height: 18px; }
.tba-legal { font-size: 11px; color: var(--a-muted); text-align: center; margin-top: 6px; }
.tba-legal a { color: inherit; }

@media (max-width: 560px) {
  .tba { right: 12px; bottom: 12px; }
  .tba-launch { height: 56px; padding: 0 8px; } .tba-launch__txt { display: none; }
  .tba-teaser { width: calc(100vw - 24px); bottom: 70px; }
  .tba.is-open { inset: 0; right: 0; bottom: 0; }
  .tba-panel { position: fixed; inset: 0; width: 100%; height: 100%; height: 100dvh; border-radius: 0; }
}
@media print { .tba { display: none; } }
