/* TimiLab Chat widget — scoped under #tlc-root */
#tlc-root {
	--tlc-accent: #0f766e;
	--tlc-bg: #ffffff;
	--tlc-surface: #f4f5f7;
	--tlc-text: #1f2328;
	--tlc-muted: #6b7280;
	--tlc-border: #e5e7eb;
	position: fixed;
	bottom: 20px;
	z-index: 2147483000;
	font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
	color: var(--tlc-text);
}
#tlc-root.tlc-right { right: 20px; }
#tlc-root.tlc-left { left: 20px; }
#tlc-root *, #tlc-root *::before, #tlc-root *::after { box-sizing: border-box; }
#tlc-root button { font: inherit; cursor: pointer; margin: 0; }
#tlc-root svg { width: 22px; height: 22px; display: block; }

/* launcher */
#tlc-root .tlc-launcher {
	width: 60px; height: 60px; border-radius: 50%; border: 0; padding: 0;
	background: var(--tlc-accent); color: #fff;
	display: flex; align-items: center; justify-content: center;
	box-shadow: 0 8px 24px rgba(0,0,0,.18), 0 2px 6px rgba(0,0,0,.12);
	transition: transform .25s ease, box-shadow .18s ease, opacity .25s ease;
	overflow: hidden;
}
#tlc-root .tlc-launcher.tlc-has-img { background: #fff; }
#tlc-root .tlc-launcher img,
#tlc-root .tlc-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%; }
#tlc-root.tlc-scrolling .tlc-launcher { opacity: 0 !important; transform: translateY(16px) scale(.85) !important; pointer-events: none; }
#tlc-root .tlc-launcher svg { width: 28px; height: 28px; }
#tlc-root .tlc-launcher:hover { transform: translateY(-2px) scale(1.04); }
#tlc-root .tlc-launcher:focus-visible { outline: 3px solid rgba(0,0,0,.35); outline-offset: 3px; }

/* panel */
#tlc-root .tlc-panel {
	position: absolute; bottom: 76px; width: 380px; height: min(620px, calc(100vh - 120px));
	background: var(--tlc-bg); border-radius: 18px; overflow: hidden;
	box-shadow: 0 18px 50px rgba(0,0,0,.22), 0 2px 8px rgba(0,0,0,.08);
	display: flex; flex-direction: column;
	opacity: 0; visibility: hidden; transform: translateY(12px) scale(.98);
	transform-origin: bottom right;
	transition: opacity .2s ease, transform .2s ease, visibility 0s linear .2s;
}
#tlc-root.tlc-right .tlc-panel { right: 0; }
#tlc-root.tlc-left .tlc-panel { left: 0; transform-origin: bottom left; }
#tlc-root.tlc-open .tlc-panel { opacity: 1; visibility: visible; transform: none; transition: opacity .2s ease, transform .2s ease; }

#tlc-root .tlc-header {
	display: flex; align-items: center; gap: 10px; padding: 14px 12px 14px 16px;
	background: var(--tlc-accent); color: #fff;
}
#tlc-root .tlc-avatar {
	width: 38px; height: 38px; border-radius: 50%; flex: none;
	background: rgba(255,255,255,.2); display: flex; align-items: center; justify-content: center;
	font-weight: 700; font-size: 17px; overflow: hidden;
}
#tlc-root .tlc-avatar svg { width: 21px; height: 21px; }
#tlc-root .tlc-avatar.tlc-has-img { background: #fff; }
#tlc-root .tlc-titles { flex: 1; min-width: 0; }
#tlc-root .tlc-name { font-weight: 650; font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#tlc-root .tlc-status { font-size: 12.5px; opacity: .88; display: flex; align-items: center; gap: 6px; }
#tlc-root .tlc-dot { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 2px rgba(255,255,255,.25); }
#tlc-root .tlc-icon-btn {
	background: transparent; border: 0; color: #fff; padding: 7px; border-radius: 8px; opacity: .9;
}
#tlc-root .tlc-icon-btn svg { width: 20px; height: 20px; }
#tlc-root .tlc-icon-btn:hover { background: rgba(255,255,255,.16); opacity: 1; }

/* messages */
#tlc-root .tlc-log {
	flex: 1; overflow-y: auto; padding: 16px 14px 8px; background: var(--tlc-bg);
	display: flex; flex-direction: column; gap: 8px; overscroll-behavior: contain;
}
#tlc-root .tlc-msg {
	max-width: 85%; padding: 9px 13px; border-radius: 16px; word-wrap: break-word; overflow-wrap: anywhere;
	animation: tlc-in .18s ease;
}
#tlc-root .tlc-bot { align-self: flex-start; background: var(--tlc-surface); border-bottom-left-radius: 5px; }
#tlc-root .tlc-user { align-self: flex-end; background: var(--tlc-accent); color: #fff; border-bottom-right-radius: 5px; white-space: pre-wrap; }
#tlc-root .tlc-err { background: #fef2f2; color: #991b1b; }
#tlc-root .tlc-msg p { margin: 0; }
#tlc-root .tlc-msg p + p { margin-top: 4px; }
#tlc-root .tlc-msg .tlc-gap { height: 6px; }
#tlc-root .tlc-msg ul { margin: 4px 0; padding-left: 18px; }
#tlc-root .tlc-msg li { margin: 2px 0; }
#tlc-root .tlc-msg a { color: var(--tlc-accent); text-decoration: underline; font-weight: 550; }
#tlc-root .tlc-msg strong { font-weight: 650; }

#tlc-root .tlc-typing { display: flex; gap: 4px; padding: 13px 15px; }
#tlc-root .tlc-typing span {
	width: 7px; height: 7px; border-radius: 50%; background: var(--tlc-muted); opacity: .5;
	animation: tlc-dot 1.2s infinite ease-in-out;
}
#tlc-root .tlc-typing span:nth-child(2) { animation-delay: .15s; }
#tlc-root .tlc-typing span:nth-child(3) { animation-delay: .3s; }

/* suggestion chips */
#tlc-root .tlc-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 14px 10px; }
#tlc-root .tlc-chips:empty { display: none; }
#tlc-root .tlc-chip {
	background: var(--tlc-bg); color: var(--tlc-accent); border: 1.5px solid var(--tlc-accent);
	border-radius: 999px; padding: 5px 12px; font-size: 13.5px; line-height: 1.3;
}
#tlc-root .tlc-chip:hover { background: var(--tlc-accent); color: #fff; }

/* composer */
#tlc-root .tlc-form {
	display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--tlc-border); background: var(--tlc-bg);
}
#tlc-root .tlc-input {
	flex: 1; resize: none; border: 1px solid var(--tlc-border); border-radius: 12px; padding: 9px 12px;
	font: inherit; color: var(--tlc-text); background: var(--tlc-bg); max-height: 120px; min-height: 40px;
	outline: none; box-shadow: none; margin: 0;
}
#tlc-root .tlc-input:focus { border-color: var(--tlc-accent); }
#tlc-root .tlc-send {
	width: 40px; height: 40px; flex: none; border: 0; border-radius: 12px; padding: 0;
	background: var(--tlc-accent); color: #fff; display: flex; align-items: center; justify-content: center;
}
#tlc-root .tlc-send:disabled { opacity: .5; cursor: default; }
#tlc-root .tlc-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }
#tlc-root .tlc-foot { font-size: 11.5px; color: var(--tlc-muted); text-align: center; padding: 0 12px 9px; background: var(--tlc-bg); }

@keyframes tlc-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes tlc-dot { 0%, 80%, 100% { transform: translateY(0); opacity: .4; } 40% { transform: translateY(-4px); opacity: 1; } }

/* phones: full screen */
@media (max-width: 600px) {
	#tlc-root { bottom: 16px; }
	#tlc-root.tlc-right { right: 16px; }
	#tlc-root.tlc-left { left: 16px; }
	#tlc-root .tlc-panel {
		position: fixed; inset: 0; width: 100%; height: 100%; height: 100dvh; border-radius: 0; bottom: 0;
	}
	#tlc-root.tlc-open .tlc-launcher { display: none; }
	#tlc-root .tlc-input { font-size: 16px; } /* stops iOS zoom */
}

@media (prefers-reduced-motion: reduce) {
	#tlc-root *, #tlc-root *::before, #tlc-root *::after { animation: none !important; transition: none !important; }
}

/* greeting pop-up */
#tlc-root .tlc-greet {
	position: absolute; bottom: 74px; width: max-content; max-width: 250px;
	background: #fff; color: var(--tlc-text); border-radius: 16px; padding: 12px 16px 12px 14px;
	font-size: 14.5px; line-height: 1.4; cursor: pointer;
	box-shadow: 0 10px 30px rgba(0,0,0,.16), 0 2px 6px rgba(0,0,0,.08);
	opacity: 0; visibility: hidden; transform: translateY(10px) scale(.9);
	transition: opacity .3s ease, transform .35s cubic-bezier(.34,1.56,.64,1), visibility 0s linear .3s;
}
#tlc-root.tlc-right .tlc-greet { right: 4px; transform-origin: bottom right; border-bottom-right-radius: 4px; }
#tlc-root.tlc-left .tlc-greet { left: 4px; transform-origin: bottom left; border-bottom-left-radius: 4px; }
#tlc-root.tlc-greeting:not(.tlc-open) .tlc-greet {
	opacity: 1; visibility: visible; transform: none;
	transition: opacity .3s ease, transform .35s cubic-bezier(.34,1.56,.64,1);
}
#tlc-root.tlc-scrolling .tlc-greet { opacity: 0 !important; transform: translateY(10px) scale(.9) !important; pointer-events: none; }
#tlc-root .tlc-greet:hover { box-shadow: 0 12px 34px rgba(0,0,0,.2), 0 2px 6px rgba(0,0,0,.1); }
#tlc-root .tlc-greet-close {
	position: absolute; top: -9px; width: 22px; height: 22px; border-radius: 50%; border: 0; padding: 0;
	background: #fff; color: var(--tlc-muted); display: flex; align-items: center; justify-content: center;
	box-shadow: 0 1px 4px rgba(0,0,0,.2); opacity: 0; transition: opacity .15s ease;
}
#tlc-root.tlc-right .tlc-greet-close { left: -9px; }
#tlc-root.tlc-left .tlc-greet-close { right: -9px; }
#tlc-root .tlc-greet:hover .tlc-greet-close, #tlc-root .tlc-greet-close:focus-visible { opacity: 1; }
#tlc-root .tlc-greet-close svg { width: 12px; height: 12px; }
@media (hover: none) { #tlc-root .tlc-greet-close { opacity: 1; } }

#tlc-root .tlc-launcher { position: relative; overflow: visible; }
#tlc-root .tlc-launcher img { overflow: hidden; }
#tlc-root .tlc-badge {
	position: absolute; top: -2px; right: -2px; min-width: 20px; height: 20px; padding: 0 5px;
	border-radius: 999px; background: #ef4444; color: #fff; font-size: 12px; font-weight: 700; line-height: 20px;
	box-shadow: 0 0 0 2px #fff; animation: tlc-pop .3s ease;
}
#tlc-root .tlc-launcher.tlc-wave svg, #tlc-root .tlc-launcher.tlc-wave img { animation: tlc-wave 1.6s ease-in-out 2; transform-origin: 70% 80%; }
@keyframes tlc-wave {
	0%, 60%, 100% { transform: rotate(0); }
	10%, 30% { transform: rotate(14deg); }
	20%, 40% { transform: rotate(-10deg); }
	50% { transform: rotate(8deg); }
}
@keyframes tlc-pop { from { transform: scale(0); } to { transform: scale(1); } }
@media (max-width: 600px) {
	#tlc-root .tlc-greet { max-width: calc(100vw - 100px); font-size: 14px; }
}

/* button animations ("dance") */
#tlc-root .tlc-launcher.tlc-anim-dance { animation: tlc-dance 1.7s ease-in-out; }
#tlc-root .tlc-launcher.tlc-anim-bounce { animation: tlc-bounce 1.2s ease; }
#tlc-root .tlc-launcher.tlc-anim-wiggle { animation: tlc-wiggle .9s ease-in-out; }
#tlc-root .tlc-launcher.tlc-anim-jelly { animation: tlc-jelly .9s ease; }
#tlc-root .tlc-launcher.tlc-anim-heartbeat { animation: tlc-heartbeat 1.3s ease-in-out; }
#tlc-root .tlc-launcher.tlc-anim-spin > svg, #tlc-root .tlc-launcher.tlc-anim-spin > img { animation: tlc-spin 1s cubic-bezier(.5,0,.3,1); }
#tlc-root .tlc-launcher.tlc-anim-pulse::before {
	content: ""; position: absolute; inset: 0; border-radius: 50%;
	border: 3px solid var(--tlc-accent); animation: tlc-pulse 1.6s ease-out; pointer-events: none;
}
@keyframes tlc-dance {
	0%   { transform: translateY(0) rotate(0) scale(1); }
	10%  { transform: translateY(-10px) rotate(-14deg) scale(1.05); }
	20%  { transform: translateY(0) rotate(0) scale(1.08, .92); }
	30%  { transform: translateY(-10px) rotate(14deg) scale(1.05); }
	40%  { transform: translateY(0) rotate(0) scale(1.08, .92); }
	52%  { transform: translateY(-4px) rotate(-8deg); }
	64%  { transform: translateY(0) rotate(8deg); }
	76%  { transform: translateY(-2px) rotate(-4deg); }
	88%  { transform: rotate(2deg); }
	100% { transform: none; }
}
@keyframes tlc-bounce {
	0%, 100% { transform: translateY(0); }
	15% { transform: translateY(-18px); }
	30% { transform: translateY(0) scale(1.08, .92); }
	45% { transform: translateY(-9px); }
	60% { transform: translateY(0) scale(1.04, .96); }
	75% { transform: translateY(-3px); }
}
@keyframes tlc-wiggle {
	0%, 100% { transform: rotate(0); }
	15% { transform: rotate(-15deg); } 30% { transform: rotate(13deg); }
	45% { transform: rotate(-9deg); } 60% { transform: rotate(6deg); } 75% { transform: rotate(-3deg); }
}
@keyframes tlc-jelly {
	0%, 100% { transform: scale(1, 1); }
	30% { transform: scale(1.22, .8); } 40% { transform: scale(.8, 1.2); }
	55% { transform: scale(1.12, .88); } 70% { transform: scale(.95, 1.05); } 85% { transform: scale(1.03, .97); }
}
@keyframes tlc-heartbeat {
	0%, 40%, 100% { transform: scale(1); }
	10% { transform: scale(1.16); } 20% { transform: scale(1); } 30% { transform: scale(1.16); }
}
@keyframes tlc-spin { from { transform: rotate(0); } to { transform: rotate(360deg); } }
@keyframes tlc-pulse { from { transform: scale(1); opacity: .8; } to { transform: scale(1.7); opacity: 0; } }
#tlc-root .tlc-greet-text { display: inline-block; transition: opacity .25s ease, transform .25s ease; }
#tlc-root .tlc-greet.tlc-greet-swap .tlc-greet-text { opacity: 0; transform: translateY(6px); }

/* product cards */
#tlc-root .tlc-cards {
	display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory;
	margin: 2px -14px 4px; padding: 2px 14px 8px; flex: none; scrollbar-width: thin;
}
#tlc-root .tlc-card {
	flex: 0 0 196px; scroll-snap-align: start; background: #fff; border: 1px solid var(--tlc-border);
	border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; animation: tlc-in .25s ease;
}
#tlc-root .tlc-cards-one .tlc-card { flex-basis: 240px; }
#tlc-root .tlc-card-img { display: block; background: #fff; aspect-ratio: 4 / 3; border-bottom: 1px solid var(--tlc-border); }
#tlc-root .tlc-card-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
#tlc-root .tlc-card-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
#tlc-root .tlc-card-name {
	color: var(--tlc-text); font-weight: 600; font-size: 14px; line-height: 1.3; text-decoration: none;
	display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
#tlc-root .tlc-card-name:hover { color: var(--tlc-accent); }
#tlc-root .tlc-card-price { color: var(--tlc-accent); font-weight: 700; font-size: 14.5px; }
#tlc-root .tlc-card-btns { display: flex; gap: 6px; margin-top: auto; padding-top: 6px; }
#tlc-root .tlc-card-btn {
	flex: 1; text-align: center; border: 0; border-radius: 10px; padding: 8px 6px; font-size: 13px; font-weight: 600;
	background: var(--tlc-accent); color: #fff; text-decoration: none; line-height: 1.2; white-space: nowrap;
}
#tlc-root .tlc-card-btn:hover { filter: brightness(1.08); color: #fff; }
#tlc-root .tlc-card-btn:disabled { opacity: .75; cursor: default; }
#tlc-root .tlc-card-btn.tlc-card-done { background: #16a34a; opacity: 1; }
#tlc-root .tlc-card-cart { background: #fff; color: var(--tlc-accent); box-shadow: inset 0 0 0 1.5px var(--tlc-accent); }
#tlc-root .tlc-card-cart:hover { color: var(--tlc-accent); background: var(--tlc-surface); }
#tlc-root .tlc-card-off { background: var(--tlc-surface); color: var(--tlc-muted); }

/* kit finder + answer chips */
#tlc-root .tlc-chip-finder { background: var(--tlc-accent); color: #fff; font-weight: 600; }
#tlc-root .tlc-chip-finder:hover { filter: brightness(1.08); }
#tlc-root .tlc-chip-reply { animation: tlc-in .2s ease; }

/* photo check */
#tlc-root .tlc-file { display: none !important; }
#tlc-root .tlc-cam {
	width: 40px; height: 40px; flex: none; border: 0; border-radius: 12px; padding: 0;
	background: transparent; color: var(--tlc-muted); display: flex; align-items: center; justify-content: center;
}
#tlc-root .tlc-cam:hover { background: var(--tlc-surface); color: var(--tlc-accent); }
#tlc-root .tlc-cam svg { width: 24px; height: 24px; }
#tlc-root .tlc-preview {
	display: flex; align-items: center; gap: 10px; margin: 0 12px; padding: 8px 8px 8px 8px;
	background: var(--tlc-surface); border-radius: 12px; font-size: 13px; color: var(--tlc-muted);
}
#tlc-root .tlc-preview img { width: 46px; height: 46px; object-fit: cover; border-radius: 8px; }
#tlc-root .tlc-preview-label { flex: 1; }
#tlc-root .tlc-preview-x { border: 0; background: transparent; color: var(--tlc-muted); padding: 6px; border-radius: 8px; }
#tlc-root .tlc-preview-x svg { width: 16px; height: 16px; }
#tlc-root .tlc-preview-x:hover { background: #fff; }
#tlc-root .tlc-msg-img { display: block; max-width: 100%; max-height: 240px; border-radius: 10px; margin-bottom: 6px; object-fit: cover; }
#tlc-root .tlc-has-photo.tlc-user { padding: 5px 5px 8px; }
#tlc-root .tlc-has-photo.tlc-user > div { padding: 0 8px; }
#tlc-root .tlc-chip-landlord { background: var(--tlc-surface); }

/* 👍 / 👎 */
#tlc-root .tlc-fb { display: flex; gap: 2px; margin: -4px 0 2px 6px; opacity: .65; transition: opacity .15s ease; }
#tlc-root .tlc-fb:hover, #tlc-root .tlc-fb.tlc-fb-set { opacity: 1; }
#tlc-root .tlc-fb-btn {
	border: 0; background: transparent; padding: 3px 6px; border-radius: 8px; font-size: 14px; line-height: 1;
	filter: grayscale(1); opacity: .7;
}
#tlc-root .tlc-fb-btn:hover { background: var(--tlc-surface); opacity: 1; }
#tlc-root .tlc-fb-btn.tlc-on { filter: none; opacity: 1; background: var(--tlc-surface); }
#tlc-root .tlc-fb-ask { display: flex; gap: 6px; margin: 0 0 4px 6px; font-size: 13px; color: var(--tlc-muted); align-items: center; }
#tlc-root .tlc-fb-ask input { flex: 1; min-width: 0; border: 1px solid var(--tlc-border); border-radius: 10px; padding: 6px 10px; font: inherit; font-size: 13px; color: var(--tlc-text); background: #fff; margin: 0; }
#tlc-root .tlc-fb-ask button { border: 0; border-radius: 10px; padding: 6px 12px; background: var(--tlc-accent); color: #fff; font-size: 13px; font-weight: 600; }
@media (max-width: 600px) { #tlc-root .tlc-fb-ask input { font-size: 16px; } }

/* promo bubble (upsell / cart helper) uses the greeting bubble look */
#tlc-root.tlc-promoting:not(.tlc-open) .tlc-promo {
	opacity: 1; visibility: visible; transform: none;
	transition: opacity .3s ease, transform .35s cubic-bezier(.34,1.56,.64,1);
}
#tlc-root.tlc-promoting .tlc-greet:not(.tlc-promo) { opacity: 0 !important; visibility: hidden !important; }
#tlc-root.tlc-scrolling .tlc-promo { opacity: 0 !important; pointer-events: none; }

/* comparison table */
#tlc-root .tlc-compare {
	flex: none; overflow-x: auto; margin: 2px 0 4px; background: #fff; border: 1px solid var(--tlc-border);
	border-radius: 14px; animation: tlc-in .25s ease;
}
#tlc-root .tlc-compare table { width: 100%; border-collapse: collapse; font-size: 13px; line-height: 1.35; table-layout: fixed; min-width: 300px; }
#tlc-root .tlc-compare th, #tlc-root .tlc-compare td { padding: 7px 8px; border-bottom: 1px solid var(--tlc-border); text-align: left; vertical-align: top; }
#tlc-root .tlc-compare tr > th:first-child { width: 26%; color: var(--tlc-muted); font-weight: 600; font-size: 12px; background: var(--tlc-surface); }
#tlc-root .tlc-compare .tlc-cmp-corner { background: #fff !important; }
#tlc-root .tlc-cmp-prod a { display: flex; flex-direction: column; gap: 6px; color: var(--tlc-text); text-decoration: none; font-weight: 600; font-size: 12.5px; }
#tlc-root .tlc-cmp-prod a span { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
#tlc-root .tlc-cmp-prod img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: #fff; border-radius: 8px; border: 1px solid var(--tlc-border); }
#tlc-root .tlc-cmp-price td { color: var(--tlc-accent); font-weight: 700; }
#tlc-root .tlc-cmp-btns td, #tlc-root .tlc-cmp-btns th { border-bottom: 0; }
#tlc-root .tlc-cmp-btns .tlc-card-btns { flex-direction: column; padding-top: 0; }
#tlc-root .tlc-cmp-btns .tlc-card-btn { font-size: 12px; padding: 7px 4px; white-space: normal; }
#tlc-root .tlc-cmp-btns tr > th:first-child, #tlc-root .tlc-cmp-btns > th { background: #fff; }
