/* QuickTextTools Assistant chat widget (v3.2.4). Uses the theme's
 * --qtt-* tokens (with fallbacks) so light/dark mode just works. */
.ftt-chat { --fc-accent: var(--qtt-accent, #4f46e5); --fc-strong: var(--qtt-accent-strong, #4338ca); --fc-soft: var(--qtt-accent-soft, #edebff); --fc-ink: var(--qtt-ink, #16141f); --fc-muted: var(--qtt-muted, #5d5a6e); --fc-line: var(--qtt-line, #e4e2ee); --fc-surface: var(--qtt-surface, #fff); --fc-bg: var(--qtt-bg, #f5f5f8); }
.ftt-chat-fab { position: fixed; right: 20px; bottom: 20px; z-index: 99990; width: 56px; height: 56px; padding: 0; border: none; border-radius: 50%; background: linear-gradient(135deg, #6366f1, #4338ca); color: #fff; font-size: 26px; line-height: 1; cursor: pointer; box-shadow: 0 8px 24px rgba(79, 70, 229, .45); display: inline-flex; align-items: center; justify-content: center; transition: transform .15s ease, box-shadow .15s ease; }
.ftt-chat-fab:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(79, 70, 229, .5); }
.ftt-chat-fab:focus-visible { outline: 3px solid var(--fc-soft); outline-offset: 2px; }
.ftt-chat-panel { position: fixed; right: 20px; bottom: 88px; z-index: 99990; width: 360px; max-width: calc(100vw - 24px); height: min(520px, 70vh); display: flex; flex-direction: column; background: var(--fc-surface); color: var(--fc-ink); border: 1px solid var(--fc-line); border-radius: 16px; box-shadow: 0 24px 60px rgba(18, 16, 31, .28); overflow: hidden; }
.ftt-chat-panel[hidden] { display: none; }
.ftt-chat-head { display: flex; align-items: center; gap: 8px; padding: 13px 16px; background: linear-gradient(135deg, #6366f1, #4338ca); color: #fff; flex: none; }
.ftt-chat-title { font-weight: 700; font-size: 15.5px; line-height: 1.3; }
.ftt-chat-close { margin-left: auto; width: 30px; height: 30px; padding: 0; border: none; border-radius: 50%; background: rgba(255, 255, 255, .16); color: #fff; font-size: 14px; line-height: 1; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.ftt-chat-close:hover { background: rgba(255, 255, 255, .3); }
.ftt-chat-msgs { flex: 1 1 auto; overflow-y: auto; padding: 14px 12px; display: flex; flex-direction: column; gap: 8px; background: var(--fc-bg); }
.ftt-chat-msg { max-width: 86%; padding: 9px 12px; border-radius: 14px; font-size: 14.5px; line-height: 1.5; overflow-wrap: anywhere; }
.ftt-chat-msg p { margin: 0; white-space: pre-line; }
.ftt-chat-bot { align-self: flex-start; background: var(--fc-surface); border: 1px solid var(--fc-line); border-bottom-left-radius: 4px; }
.ftt-chat-user { align-self: flex-end; background: var(--fc-accent); color: #fff; border-bottom-right-radius: 4px; }
.ftt-chat-typing { color: var(--fc-muted); letter-spacing: 2px; }
.ftt-chat-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ftt-chat-link { display: inline-block; padding: 5px 11px; border-radius: 999px; background: var(--fc-soft); color: var(--fc-strong); font-size: 13.5px; font-weight: 700; text-decoration: none; border: 1px solid transparent; }
.ftt-chat-link:hover { border-color: var(--fc-accent); text-decoration: none; }
.ftt-chat-chips { flex: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px 0; background: var(--fc-surface); }
.ftt-chat-chips:empty { padding-top: 0; }
.ftt-chat-chip { padding: 5px 11px; border-radius: 999px; border: 1.5px solid var(--fc-accent); background: transparent; color: var(--fc-strong); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.ftt-chat-chip:hover { background: var(--fc-soft); }
.ftt-chat-form { flex: none; display: flex; gap: 8px; padding: 10px 12px 12px; background: var(--fc-surface); }
.ftt-chat-input { flex: 1 1 auto; min-width: 0; padding: 9px 12px; border: 1.5px solid var(--fc-line); border-radius: 999px; background: var(--fc-surface); color: var(--fc-ink); font: inherit; font-size: 14.5px; }
.ftt-chat-input:focus { outline: none; border-color: var(--fc-accent); }
.ftt-chat-send { flex: none; padding: 9px 16px; border: none; border-radius: 999px; background: var(--fc-accent); color: #fff; font: inherit; font-size: 14.5px; font-weight: 700; cursor: pointer; }
.ftt-chat-send:hover { background: var(--fc-strong); }
@media (max-width: 480px) {
	.ftt-chat-fab { right: 14px; bottom: 14px; }
	.ftt-chat-panel { right: 0; left: 0; bottom: 0; width: auto; max-width: none; height: min(78vh, 560px); height: min(78dvh, 560px); border-radius: 16px 16px 0 0; border-bottom: none; }
	/* v3.2.5 mobile pass: thumb-size targets inside the sheet — the
	   close button was 30x30 and the chips ~33px tall. The input is
	   pinned to 16px so iOS Safari never auto-zooms on focus. */
	.ftt-chat-close { width: 40px; height: 40px; font-size: 16px; }
	.ftt-chat-chip { padding: 10px 13px; }
	.ftt-chat-link { padding: 9px 13px; }
	.ftt-chat .ftt-chat-input { font-size: 16px; }
	.ftt-chat-send { min-height: 44px; }
}
