/* Site AI Chat - colours come from the site profile (--sac-*) */
#tfc-root { position: fixed; right: 20px; bottom: 20px; z-index: 99990; font-size: 15px; line-height: 1.45; font-family: inherit; color: var(--sac-primary); }
#tfc-root *, #tfc-root *::before, #tfc-root *::after { box-sizing: border-box; }
#tfc-root button { font-family: inherit; cursor: pointer; }

.tfc-launcher { width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--sac-primary); color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 14px rgba(17, 21, 27, .25); }
.tfc-launcher:hover { background: var(--sac-primary-hover); }
.tfc-launcher:focus-visible, .tfc-panel button:focus-visible, .tfc-input:focus-visible { outline: 2px solid var(--sac-accent); outline-offset: 2px; }

.tfc-panel { width: 360px; height: 520px; max-height: calc(100vh - 40px); background: #fff; border: 1px solid #e3e5e8; border-radius: 12px; box-shadow: 0 8px 30px rgba(17, 21, 27, .18); display: flex; flex-direction: column; overflow: hidden; }
.tfc-panel[hidden] { display: none; }

.tfc-head { background: var(--sac-primary); color: #fff; padding: 12px 12px 12px 16px; display: flex; align-items: center; gap: 8px; }
.tfc-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tfc-title strong { font-size: 15px; font-weight: 600; }
.tfc-sub { font-size: 12px; color: #c9ccd1; }
.tfc-human { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.7); border-radius: 6px; padding: 5px 8px; font-size: 12px; white-space: nowrap; }
.tfc-human:hover { background: #fff; color: var(--sac-primary); }
.tfc-close { background: transparent; border: 0; color: #fff; font-size: 24px; line-height: 1; padding: 0 4px; }

.tfc-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; background: #f7f8f9; }
.tfc-msg { max-width: 85%; padding: 9px 12px; border-radius: 10px; word-wrap: break-word; overflow-wrap: anywhere; font-size: 14px; }
.tfc-assistant { align-self: flex-start; background: #fff; border: 1px solid #e3e5e8; }
.tfc-user { align-self: flex-end; background: var(--sac-primary); color: #fff; }
.tfc-msg a { color: inherit; text-decoration: underline; }
.tfc-typing { color: #6b7079; letter-spacing: 2px; }

.tfc-quick { display: flex; flex-wrap: wrap; gap: 6px; }
.tfc-chip, .tfc-handoff { background: #fff; border: 1px solid var(--sac-primary); color: var(--sac-primary); border-radius: 6px; padding: 6px 10px; font-size: 13px; }
.tfc-chip:hover, .tfc-handoff:hover { background: var(--sac-primary); color: #fff; }
.tfc-handoff { align-self: flex-start; }

.tfc-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid #e3e5e8; background: #fff; }
.tfc-input { flex: 1; resize: none; border: 1px solid #cfd3d8; border-radius: 8px; padding: 9px 10px; font: inherit; font-size: 14px; color: var(--sac-primary); max-height: 96px; }
.tfc-send { background: var(--sac-accent); color: var(--sac-accent-text); border: 0; border-radius: 8px; padding: 0 14px; font-weight: 600; font-size: 14px; }
.tfc-send:disabled { opacity: .5; cursor: default; }

@media (max-width: 480px) {
  #tfc-root { right: 12px; bottom: 12px; }
  .tfc-panel { position: fixed; inset: auto 0 0 0; width: 100%; height: 85vh; max-height: 85vh; border-radius: 12px 12px 0 0; }
}

/* typing dots (all sites) */
.tfc-dots { display: inline-flex; gap: 4px; padding: 4px 0; }
.tfc-dots i { width: 6px; height: 6px; border-radius: 50%; background: #9aa0a8; animation: tfc-bounce 1.2s infinite; }
.tfc-dots i:nth-child(2) { animation-delay: .15s; }
.tfc-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes tfc-bounce { 0%, 60%, 100% { opacity: .35; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .tfc-dots i { animation: none; opacity: .6; } }

/* named assistant (profile 'agent') */
.tfc-has-agent .tfc-launcher { position: relative; width: 60px; height: 60px; padding: 0; background: #fff; border: 2px solid #fff; box-shadow: 0 6px 20px rgba(17, 21, 27, .25); transition: transform .15s; }
.tfc-has-agent .tfc-launcher:hover { background: #fff; transform: translateY(-2px); }
.tfc-launcher .tfc-av { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.tfc-online { position: absolute; right: 1px; bottom: 1px; width: 13px; height: 13px; border-radius: 50%; background: #22C55E; border: 2px solid #fff; }
.tfc-has-agent .tfc-head { padding: 14px 12px 14px 14px; gap: 10px; }
.tfc-av-wrap { position: relative; flex: none; width: 42px; height: 42px; }
.tfc-av-wrap .tfc-av { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; display: block; }
.tfc-av-wrap .tfc-online { width: 12px; height: 12px; right: -1px; bottom: -1px; border-color: var(--sac-primary); }
.tfc-has-agent .tfc-title strong { font-size: 16px; }
.tfc-role { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: #c9ccd1; }
.tfc-ai { font-size: 10px; font-weight: 700; letter-spacing: .5px; color: #fff; background: rgba(255, 255, 255, .16); border-radius: 4px; padding: 1px 5px; }
.tfc-note { font-size: 12px; color: #6b7079; text-align: center; padding: 0 10px 4px; }
.tfc-row { display: flex; gap: 8px; align-items: flex-end; align-self: flex-start; max-width: 90%; }
.tfc-row .tfc-msg { max-width: 100%; }
.tfc-row .tfc-av { flex: none; width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.tfc-has-agent .tfc-assistant { border-radius: 14px 14px 14px 4px; }
.tfc-has-agent .tfc-user { border-radius: 14px 14px 4px 14px; }
.tfc-has-agent .tfc-quick { padding-left: 36px; }
.tfc-has-agent .tfc-handoff { margin-left: 36px; }
.tfc-teaser { position: absolute; right: 72px; bottom: 6px; width: max-content; max-width: 230px; background: #fff; color: var(--sac-primary); border: 1px solid #e3e5e8; border-radius: 14px 14px 4px 14px; box-shadow: 0 6px 20px rgba(17, 21, 27, .14); padding: 10px 30px 10px 13px; font-size: 14px; line-height: 1.4; cursor: pointer; }
.tfc-teaser-x { position: absolute; top: 3px; right: 5px; border: 0; background: none; color: #6b7079; font-size: 17px; line-height: 1; padding: 2px; }
@media (max-width: 480px) { .tfc-teaser { max-width: 190px; right: 70px; } }
.tfc-has-agent .tfc-title { min-width: 0; }
.tfc-role { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tfc-has-agent .tfc-human { padding: 5px 9px; }
