/* CodingforkAI chat assistant ------------------------------------------------ */
.cfc { position: fixed; right: 20px; bottom: 20px; z-index: 250; font-family: var(--font); }
.cfc-launcher {
	position: relative; display: grid; place-items: center; width: 60px; height: 60px; border: 0; border-radius: 50%;
	background: var(--brand); color: #fff; cursor: pointer; box-shadow: 0 12px 28px -10px rgba(219, 101, 22, .75);
	transition: transform .2s, background-color .2s;
}
.cfc-launcher:hover { transform: scale(1.05); background: var(--brand-600); }
.cfc-launcher-close, .cfc.is-open .cfc-launcher-open { display: none; }
.cfc.is-open .cfc-launcher-close { display: grid; }
.cfc.is-open .cfc-launcher { background: var(--ink); box-shadow: var(--shadow); }
.cfc-badge {
	position: absolute; top: -2px; right: -2px; display: grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px;
	border-radius: 10px; background: var(--ink); color: #fff; font-size: 12px; font-weight: 700; border: 2px solid #fff;
}
.cfc-badge[hidden] { display: none; }

.cfc-teaser {
	/* Width from its own text (the parent .cfc is only as wide as the button). */
	position: absolute; right: 74px; bottom: 6px; display: flex; align-items: center; gap: 8px;
	width: max-content; max-width: min(270px, calc(100vw - 110px));
	padding: 10px 8px 10px 14px; background: #fff; color: var(--ink); border-radius: 14px 14px 4px 14px;
	box-shadow: 0 10px 30px -10px rgba(52, 54, 53, .45); animation: cfc-pop .25s ease-out;
}
.cfc-teaser[hidden] { display: none; }
.cfc-teaser::after {
	content: ""; position: absolute; right: -6px; bottom: 16px; width: 12px; height: 12px; background: #fff;
	transform: rotate(45deg); border-radius: 2px; box-shadow: 3px -3px 6px -4px rgba(52, 54, 53, .25);
}
.cfc-teaser-text { flex: 1 1 auto; min-width: 0; border: 0; background: none; padding: 0; color: var(--ink); font: 600 14px/1.4 var(--font); text-align: left; white-space: normal; overflow-wrap: break-word; cursor: pointer; }
.cfc-teaser-x { flex: none; width: 24px; height: 24px; border: 0; border-radius: 50%; background: var(--bg-soft); color: var(--muted); font-size: 16px; line-height: 1; cursor: pointer; }
@keyframes cfc-pop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.cfc-panel {
	position: absolute; right: 0; bottom: 76px; display: flex; flex-direction: column; width: 380px; height: min(600px, calc(100vh - 120px));
	background: #fff; border-radius: 18px; overflow: hidden; box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .45);
	animation: cfc-pop .2s ease-out;
}
.cfc-panel[hidden] { display: none; }
.cfc-head { display: flex; align-items: center; gap: 10px; padding: 14px 14px 14px 16px; background: var(--ink); color: #fff; }
.cfc-avatar { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 12px; background: var(--amber); color: var(--ink); }
.cfc-avatar-img { overflow: hidden; background: #fff; }
.cfc-avatar-img img { width: 100%; height: 100%; object-fit: cover; }
.cfc-head-text { flex: 1; min-width: 0; line-height: 1.25; }
.cfc-head-text strong { display: block; font-size: 15px; }
.cfc-head-text small { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--on-dark-muted); }
.cfc-head-text small i { width: 7px; height: 7px; border-radius: 50%; background: #3ccf6e; }
.cfc-icon-btn { display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 8px; background: transparent; color: var(--on-dark-muted); cursor: pointer; }
.cfc-icon-btn:hover { background: rgba(255, 255, 255, .1); color: #fff; }

.cfc-body { flex: 1; overflow-y: auto; padding: 16px 14px; display: flex; flex-direction: column; gap: 8px; background: var(--bg-soft); scroll-behavior: smooth; }
.cfc-row { display: flex; }
.cfc-user { justify-content: flex-end; }
.cfc-bubble { max-width: 85%; padding: 10px 13px; border-radius: 14px; font-size: 14.5px; line-height: 1.5; background: #fff; color: var(--ink); border: 1px solid var(--line); border-bottom-left-radius: 4px; overflow-wrap: anywhere; }
.cfc-user .cfc-bubble { background: var(--brand); color: #fff; border-color: var(--brand); border-radius: 14px 14px 4px 14px; }
.cfc-typing .cfc-bubble { display: inline-flex; gap: 4px; padding: 12px 14px; }
.cfc-typing span { width: 7px; height: 7px; border-radius: 50%; background: #b9b2a5; animation: cfc-dot 1s infinite; }
.cfc-typing span:nth-child(2) { animation-delay: .15s; }
.cfc-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes cfc-dot { 0%, 60%, 100% { opacity: .35; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }

.cfc-card { width: 88%; padding: 14px; border-radius: 14px; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--brand); font-size: 14px; color: var(--ink); }
.cfc-card strong { display: block; font-size: 16px; text-transform: uppercase; margin-bottom: 4px; }
.cfc-card p { margin: 0 0 6px; color: var(--muted); }
.cfc-card .cfc-card-meta { color: var(--ink); font-weight: 600; font-size: 13px; }
.cfc-card ul { margin: 6px 0 8px; padding-left: 18px; }
.cfc-card li { margin-bottom: 3px; }
.cfc-card .cfc-card-fee { color: var(--brand); font-weight: 700; }
.cfc-card-link { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; font-size: 13px; }

.cfc-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 12px; border-top: 1px solid var(--line); background: #fff; max-height: 132px; overflow-y: auto; }
.cfc-chips[hidden] { display: none; }
.cfc-chip {
	display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; border: 1.5px solid var(--brand);
	background: #fff; color: var(--brand); font: 600 13px/1.2 var(--font); cursor: pointer; transition: background-color .15s, color .15s;
}
.cfc-chip:hover, .cfc-chip:focus-visible { background: var(--brand); color: #fff; }
.cfc-chip-primary { background: var(--brand); color: #fff; }
.cfc-chip-primary:hover { background: var(--brand-600); border-color: var(--brand-600); }
.cfc-chip-wa { border-color: #1fa855; color: #1a8f48; }
.cfc-chip-wa:hover { background: #1fa855; color: #fff; }

.cfc-input { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); background: #fff; }
.cfc-input input {
	flex: 1; min-width: 0; height: 44px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: 22px;
	font: 500 15px var(--font); color: var(--ink); background: var(--bg-soft);
}
.cfc-input input:focus { outline: none; border-color: var(--brand); background: #fff; }
.cfc-input button { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--brand); color: #fff; cursor: pointer; }
.cfc-input button:hover { background: var(--brand-600); }
.cfc-foot { margin: 0; padding: 0 14px 10px; background: #fff; font-size: 11px; color: var(--muted); text-align: center; }
.cfc-foot a { color: var(--muted); text-decoration: underline; }

/* Make room for the chat button */
.to-top { right: 28px; bottom: 96px; }

@media (max-width: 1023px) {
	/* Sits inside the mobile bottom bar, next to the WhatsApp button (same size and shape). */
	.cfc { right: 14px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 96; }
	.cfc-launcher { width: 50px; height: 50px; border-radius: 14px; box-shadow: none; }
	.cfc-launcher:hover { transform: none; }
	.cfc-panel { bottom: 64px; }
	/* Teaser above the bar instead of over its buttons. */
	.cfc .cfc-teaser { right: 0; bottom: 62px; }
	.cfc .cfc-teaser::after { right: 18px; bottom: -6px; }
	.cfc .cfc-teaser { max-width: min(280px, calc(100vw - 28px)); }
	.nav-open .cfc { display: none; }
}
@media (max-width: 600px) {
	/* Floating card with space on every side instead of full screen. */
	.cfc-panel {
		position: fixed; top: 14px; right: 12px; bottom: 14px; left: 12px; width: auto;
		height: auto; max-height: none; border-radius: 16px;
		top: max(14px, env(safe-area-inset-top)); bottom: max(14px, env(safe-area-inset-bottom));
	}
	.admin-bar .cfc-panel { top: 60px; }
	.cfc-body, .cfc-chips { overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
	.cfc.is-open::before { content: ""; position: fixed; inset: 0; background: rgba(0, 0, 0, .45); }
	.cfc.is-open .cfc-launcher { display: none; }
	.cfc-input input { font-size: 16px; } /* avoids iOS zoom */
}
@media (prefers-reduced-motion: reduce) {
	.cfc-panel, .cfc-teaser { animation: none; }
	.cfc-typing span { animation: none; }
}
