/* Scoped Local Reset for TKH Chat FAQ */
:where(.tkh-chat-root, .tkh-chat-root *) {
	box-sizing: border-box;
}
:where(.tkh-chat-root) h1,
:where(.tkh-chat-root) h2,
:where(.tkh-chat-root) h3,
:where(.tkh-chat-root) h4,
:where(.tkh-chat-root) p,
:where(.tkh-chat-root) ul,
:where(.tkh-chat-root) ol,
:where(.tkh-chat-root) li {
	margin: 0;
	padding: 0;
}
:where(.tkh-chat-root) a {
	color: inherit;
	text-decoration: none;
}
:where(.tkh-chat-root) button {
	background: none;
	border: none;
	padding: 0;
	font: inherit;
	color: inherit;
	cursor: pointer;
}

/**
 * TKH Chat FAQ - Elementor Custom Widget Stylesheet
 *
 * @package Khalaf_Elementor_Widgets
 */

/* ==========================================================================
   1. CSS Variables & Reset
   ========================================================================== */
.tkh-chat-root {
	--tkh-navy: #292f6e;
	--tkh-navy-d: #171b45;
	--tkh-teal: #5bc4c4;
	--tkh-teal-d: #2a9d9d;
	--tkh-gold: #d4b06a;
	--tkh-ink: #1b2050;
	--tkh-paper: #f3f5fb;
	--tkh-line: #dfe3ef;

	--tkh-font-display: 'Bricolage Grotesque', 'Bricolage Fallback', system-ui, -apple-system, sans-serif;
	--tkh-font-body: 'Manrope', 'Manrope Fallback', system-ui, -apple-system, sans-serif;
	--tkh-font-mono: 'DM Mono', 'DM Mono Fallback', monospace;

	--tkh-window-bg: #f3f5fb;
	--tkh-window-border: 1px solid #dfe3ef;
	--tkh-window-radius: 36px;
	--tkh-window-padding: clamp(20px, 3vw, 38px);
	--tkh-window-gap: 14px;
	--tkh-window-max-width: 920px;

	--tkh-bubble-max-width: 88%;
	--tkh-bubble-radius: 24px;
	--tkh-bubble-padding: 16px 22px;

	--tkh-q-bg: #292f6e;
	--tkh-q-color: #ffffff;
	--tkh-q-font-size: 18px;
	--tkh-q-font-weight: 700;
	--tkh-q-line-height: 1.25;
	--tkh-q-letter-spacing: -0.02em;

	--tkh-a-bg: #ffffff;
	--tkh-a-color: #1b2050;
	--tkh-a-border: 1px solid #dfe3ef;
	--tkh-a-font-size: 16px;
	--tkh-a-font-weight: 400;
	--tkh-a-line-height: 1.5;
	--tkh-a-shadow: 0 10px 24px rgba(41, 47, 110, 0.07);

	--tkh-avatar-size: 34px;
	--tkh-avatar-bg: #d4b06a;
	--tkh-avatar-color: #171b45;
	--tkh-avatar-font-size: 15px;

	box-sizing: border-box;
	position: relative;
	width: 100%;
	margin-left: auto;
	margin-right: auto;
	max-width: var(--tkh-window-max-width);
}

.tkh-chat-root *,
.tkh-chat-root *::before,
.tkh-chat-root *::after {
	box-sizing: border-box;
}

/* ==========================================================================
   2. Optional Section Header & Footer
   ========================================================================== */
.tkh-chat-section-header {
	margin-bottom: 24px;
	text-align: center;
}

.tkh-chat-eyebrow {
	display: inline-block;
	font-family: var(--tkh-font-mono);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--tkh-gold);
	margin-bottom: 8px;
}

.tkh-chat-title {
	font-family: var(--tkh-font-display);
	font-size: clamp(26px, 4vw, 38px);
	font-weight: 800;
	line-height: 1.2;
	color: var(--tkh-navy-d);
	margin: 0 0 12px;
}

.tkh-chat-desc {
	font-family: var(--tkh-font-body);
	font-size: 16px;
	line-height: 1.6;
	color: #555d7e;
	max-width: 680px;
	margin: 0 auto;
}

.tkh-chat-section-footer {
	margin-top: 28px;
	text-align: center;
}

.tkh-chat-section-footer p {
	font-family: var(--tkh-font-body);
	font-size: 15px;
	color: #636b8a;
	margin: 0 0 14px;
}

.tkh-chat-section-cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 12px 28px;
	background: var(--tkh-navy);
	color: #ffffff;
	border-radius: 999px;
	font-family: var(--tkh-font-display);
	font-weight: 700;
	font-size: 15px;
	text-decoration: none;
	transition: background 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
	box-shadow: 0 4px 14px rgba(41, 47, 110, 0.15);
}

.tkh-chat-section-cta:hover {
	background: var(--tkh-navy-d);
	transform: translateY(-2px);
	box-shadow: 0 6px 20px rgba(41, 47, 110, 0.22);
	color: #ffffff;
}

/* ==========================================================================
   3. Toolbar: Filter Chips & Search Box
   ========================================================================== */
.tkh-chat-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	margin-bottom: 20px;
}

.tkh-chat-filter-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
}

.tkh-chat-filter-chip {
	appearance: none;
	background: #ffffff;
	border: 1px solid var(--tkh-line);
	border-radius: 999px;
	padding: 7px 16px;
	font-family: var(--tkh-font-body);
	font-size: 14px;
	font-weight: 600;
	color: #4b5472;
	cursor: pointer;
	transition: all 0.2s ease;
	outline: none;
}

.tkh-chat-filter-chip:hover {
	border-color: var(--tkh-navy);
	color: var(--tkh-navy);
	background: #f8f9fe;
}

.tkh-chat-filter-chip.is-active {
	background: var(--tkh-navy);
	border-color: var(--tkh-navy);
	color: #ffffff;
	box-shadow: 0 4px 12px rgba(41, 47, 110, 0.2);
}

.tkh-chat-search {
	position: relative;
	min-width: 220px;
	flex: 1 1 auto;
	max-width: 320px;
}

.tkh-chat-search input {
	width: 100%;
	padding: 9px 36px 9px 14px;
	background: #ffffff;
	border: 1px solid var(--tkh-line);
	border-radius: 999px;
	font-family: var(--tkh-font-body);
	font-size: 14px;
	color: var(--tkh-ink);
	outline: none;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.tkh-chat-search input:focus {
	border-color: var(--tkh-navy);
	box-shadow: 0 0 0 3px rgba(41, 47, 110, 0.12);
}

.tkh-chat-search-icon {
	position: absolute;
	right: 14px;
	top: 50%;
	transform: translateY(-50%);
	pointer-events: none;
	color: #8b94af;
	display: flex;
	align-items: center;
	justify-content: center;
}

.tkh-chat-no-results {
	display: none;
	text-align: center;
	padding: 32px 16px;
	color: #7b84a1;
	font-family: var(--tkh-font-body);
	font-size: 15px;
}

.tkh-chat-root.has-no-results .tkh-chat-no-results {
	display: block;
}

/* ==========================================================================
   4. Chat Window (.chat / .tkh-chat-window)
   ========================================================================== */
.tkh-chat-window,
.tkh-chat-root .chat {
	display: flex;
	flex-direction: column;
	gap: var(--tkh-window-gap);
	background: var(--tkh-window-bg);
	border-radius: var(--tkh-window-radius);
	padding: var(--tkh-window-padding);
	border: var(--tkh-window-border);
	position: relative;
	overflow: visible;
	box-shadow: 0 12px 36px rgba(41, 47, 110, 0.04);
}

/* Optional Wallpaper / Pattern Overlay */
.tkh-chat-pattern {
	position: absolute;
	inset: 0;
	border-radius: inherit;
	pointer-events: none;
	opacity: 0.04;
	background-image: radial-gradient(var(--tkh-navy) 1px, transparent 1px);
	background-size: 16px 16px;
	z-index: 0;
}

.tkh-chat-items-wrap {
	display: flex;
	flex-direction: column;
	gap: var(--tkh-window-gap);
	position: relative;
	z-index: 1;
	width: 100%;
}

/* ==========================================================================
   5. Mode C: Scrollable Chat Window
   ========================================================================== */
.tkh-chat-root.mode-c .tkh-chat-window {
	height: var(--tkh-chat-height, 540px);
	max-height: 85vh;
	overflow-y: auto;
	scroll-behavior: smooth;
	overscroll-behavior: contain;
	position: relative;
}

/* Slim Custom Scrollbars */
.tkh-chat-root.mode-c .tkh-chat-window::-webkit-scrollbar {
	width: 6px;
}
.tkh-chat-root.mode-c .tkh-chat-window::-webkit-scrollbar-track {
	background: rgba(223, 227, 239, 0.3);
	border-radius: 999px;
}
.tkh-chat-root.mode-c .tkh-chat-window::-webkit-scrollbar-thumb {
	background: #c7cde0;
	border-radius: 999px;
	transition: background 0.2s ease;
}
.tkh-chat-root.mode-c .tkh-chat-window::-webkit-scrollbar-thumb:hover {
	background: var(--tkh-gold);
}

/* Scroll Fade Masks */
.tkh-chat-root.mode-c.has-fade-masks .tkh-chat-window {
	mask-image: linear-gradient(
		to bottom,
		transparent 0%,
		black 24px,
		black calc(100% - 24px),
		transparent 100%
	);
	-webkit-mask-image: linear-gradient(
		to bottom,
		transparent 0%,
		black 24px,
		black calc(100% - 24px),
		transparent 100%
	);
}

/* ==========================================================================
   6. Optional Chat Header Bar & Footer Bar
   ========================================================================== */
.tkh-chat-header-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	padding: 16px 20px;
	background: #ffffff;
	border: 1px solid var(--tkh-line);
	border-radius: 24px 24px 16px 16px;
	margin-bottom: 4px;
	position: relative;
	z-index: 2;
	box-shadow: 0 4px 16px rgba(41, 47, 110, 0.04);
}

.tkh-chat-header-info {
	display: flex;
	align-items: center;
	gap: 12px;
}

.tkh-chat-header-avatar {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: var(--tkh-gold);
	color: var(--tkh-navy-d);
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: var(--tkh-font-display);
	font-weight: 800;
	font-size: 17px;
	position: relative;
	flex-shrink: 0;
	box-shadow: 0 0 0 2px #ffffff, 0 0 0 3px var(--tkh-line);
}

.tkh-chat-header-avatar img {
	width: 100%;
	height: 100%;
	border-radius: 50%;
	object-fit: cover;
}

.tkh-chat-status-dot {
	position: absolute;
	bottom: 0;
	right: 0;
	width: 11px;
	height: 11px;
	background: #22c55e;
	border: 2px solid #ffffff;
	border-radius: 50%;
}

.tkh-chat-status-dot.pulse::after {
	content: '';
	position: absolute;
	inset: -2px;
	border-radius: 50%;
	border: 2px solid #22c55e;
	animation: tkhDotPulse 2s cubic-bezier(0.24, 0, 0.38, 1) infinite;
}

@keyframes tkhDotPulse {
	0% { transform: scale(0.9); opacity: 0.9; }
	60% { transform: scale(2.2); opacity: 0; }
	100% { transform: scale(2.2); opacity: 0; }
}

.tkh-chat-header-text {
	display: flex;
	flex-direction: column;
}

.tkh-chat-header-name {
	font-family: var(--tkh-font-display);
	font-weight: 700;
	font-size: 16px;
	color: var(--tkh-navy-d);
	line-height: 1.25;
}

.tkh-chat-header-sub {
	font-family: var(--tkh-font-body);
	font-size: 13px;
	color: #6d7694;
	line-height: 1.35;
}

.tkh-chat-header-action {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: #f0f3fa;
	color: var(--tkh-navy);
	text-decoration: none;
	transition: all 0.2s ease;
}

.tkh-chat-header-action:hover {
	background: var(--tkh-navy);
	color: #ffffff;
}

/* Chat Footer Bar */
.tkh-chat-footer-bar {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 14px 18px;
	background: #ffffff;
	border: 1px solid var(--tkh-line);
	border-radius: 16px 16px 24px 24px;
	margin-top: 4px;
	position: relative;
	z-index: 2;
}

.tkh-chat-fake-input {
	flex: 1;
	background: #f7f9fd;
	border: 1px solid var(--tkh-line);
	border-radius: 999px;
	padding: 10px 18px;
	font-family: var(--tkh-font-body);
	font-size: 14px;
	color: #8c95af;
	user-select: none;
	cursor: default;
}

.tkh-chat-send-btn {
	appearance: none;
	border: none;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: var(--tkh-navy);
	color: #ffffff;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: background 0.2s ease, transform 0.2s ease;
	flex-shrink: 0;
}

.tkh-chat-send-btn:hover {
	background: var(--tkh-navy-d);
	transform: scale(1.05);
}

.tkh-chat-footer-cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	padding: 12px 20px;
	border-radius: 999px;
	background: var(--tkh-navy);
	color: #ffffff;
	font-family: var(--tkh-font-display);
	font-weight: 700;
	font-size: 15px;
	text-decoration: none;
	transition: all 0.2s ease;
}

.tkh-chat-footer-cta:hover {
	background: var(--tkh-navy-d);
	color: #ffffff;
}

/* ==========================================================================
   7. Bubble Structure (.bb, .bq, .ba)
   ========================================================================== */
.tkh-chat-item {
	display: flex;
	flex-direction: column;
	gap: 12px;
	width: 100%;
	position: relative;
}

.tkh-chat-item.is-hidden {
	display: none !important;
}

/* Base Bubble Style */
.tkh-chat-root .bb, .tkh-chat-root .tkh-chat-bubble {
	max-width: var(--tkh-bubble-max-width);
	padding: var(--tkh-bubble-padding);
	border-radius: var(--tkh-bubble-radius);
	box-sizing: border-box;
	position: relative;
	overflow-wrap: anywhere;
	word-break: break-word;
	font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
}

/* Entrance Transition */
.tkh-chat-root .bb.in, .tkh-chat-root .tkh-chat-bubble.tkh-chat-in, .tkh-chat-root .tkh-chat-in {
	opacity: 1;
	transform: none;
	transition: opacity 0.5s cubic-bezier(0.3, 1.5, 0.5, 1),
	            transform 0.5s cubic-bezier(0.3, 1.5, 0.5, 1);
}

.tkh-chat-root.reveal-on-scroll .bb:not(.in), .tkh-chat-root.reveal-on-scroll .tkh-chat-bubble:not(.tkh-chat-in) {
	opacity: 0;
	transform: translateY(20px) scale(0.96);
}

/* ==========================================================================
   8. Question Bubble (.bq)
   ========================================================================== */
.tkh-chat-root .bq, .tkh-chat-root .bb.bq, .tkh-chat-root .tkh-chat-q {
	align-self: flex-end;
	background: var(--tkh-q-bg);
	color: var(--tkh-q-color);
	font-family: var(--tkh-font-display);
	font-size: var(--tkh-q-font-size);
	font-weight: var(--tkh-q-font-weight);
	line-height: var(--tkh-q-line-height);
	letter-spacing: var(--tkh-q-letter-spacing);
	border-bottom-right-radius: 6px;
	text-align: left;
	box-shadow: 0 4px 16px rgba(41, 47, 110, 0.12);
	cursor: default;
	border: none;
	display: inline-flex;
	flex-direction: column;
	gap: 4px;
}

/* Question as Interactive Button in Mode A / C */
.tkh-chat-root.mode-a .bq,
.tkh-chat-root.mode-c[data-submode="tap"] .bq {
	cursor: pointer;
	user-select: none;
	appearance: none;
	transition: transform 0.2s cubic-bezier(0.3, 1.5, 0.5, 1),
	            box-shadow 0.2s ease,
	            background-color 0.2s ease;
	outline: none;
}

.tkh-chat-root.mode-a .bq:hover,
.tkh-chat-root.mode-c[data-submode="tap"] .bq:hover {
	transform: translateY(-2px) scale(1.01);
	box-shadow: 0 6px 22px rgba(41, 47, 110, 0.2);
}

.tkh-chat-root.mode-a .bq:focus-visible,
.tkh-chat-root.mode-c[data-submode="tap"] .bq:focus-visible {
	box-shadow: 0 0 0 3px #ffffff, 0 0 0 6px var(--tkh-navy);
}

.tkh-chat-q-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	width: 100%;
}

.tkh-chat-q-text {
	flex: 1;
}

.tkh-chat-q-toggle-icon {
	display: none;
	flex-shrink: 0;
	width: 18px;
	height: 18px;
	transition: transform 0.3s cubic-bezier(0.3, 1.5, 0.5, 1);
	opacity: 0.8;
}

.tkh-chat-root.mode-a .tkh-chat-q-toggle-icon,
.tkh-chat-root.mode-c[data-submode="tap"] .tkh-chat-q-toggle-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.tkh-chat-item.is-open .tkh-chat-q-toggle-icon {
	transform: rotate(180deg);
	opacity: 1;
}

.tkh-chat-q-meta {
	font-family: var(--tkh-font-mono);
	font-size: 11px;
	font-weight: 500;
	color: rgba(255, 255, 255, 0.65);
	align-self: flex-end;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	margin-top: 2px;
}

.tkh-chat-ticks {
	color: var(--tkh-gold);
	font-size: 12px;
	letter-spacing: -2px;
}

/* ==========================================================================
   9. Answer Bubble (.ba)
   ========================================================================== */
.tkh-chat-root .ba, .tkh-chat-root .bb.ba, .tkh-chat-root .tkh-chat-a {
	align-self: flex-start;
	background: var(--tkh-a-bg);
	border: var(--tkh-a-border);
	border-bottom-left-radius: 6px;
	display: flex;
	gap: 14px;
	align-items: flex-start;
	color: var(--tkh-a-color);
	font-family: var(--tkh-font-body);
	font-size: var(--tkh-a-font-size);
	font-weight: var(--tkh-a-font-weight);
	line-height: var(--tkh-a-line-height);
	box-shadow: var(--tkh-a-shadow);
	transition: transform 0.4s cubic-bezier(0.3, 1.5, 0.5, 1),
	            opacity 0.4s ease;
}

/* Answer Avatar (i) */
.ba i,
.tkh-chat-avatar {
	width: var(--tkh-avatar-size);
	height: var(--tkh-avatar-size);
	min-width: var(--tkh-avatar-size);
	border-radius: 50%;
	background: var(--tkh-avatar-bg);
	color: var(--tkh-avatar-color);
	font-family: var(--tkh-font-display);
	font-weight: 800;
	font-size: var(--tkh-avatar-font-size);
	font-style: normal;
	display: flex;
	align-items: center;
	justify-content: center;
	flex: none;
	user-select: none;
	line-height: 1;
	box-shadow: 0 2px 8px rgba(212, 176, 106, 0.35);
}

.ba i img,
.tkh-chat-avatar img {
	width: 100%;
	height: 100%;
	border-radius: 50%;
	object-fit: cover;
}

.tkh-chat-answer-body {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 10px;
	min-width: 0;
}

.tkh-chat-answer-content {
	color: inherit;
	font-size: inherit;
	line-height: inherit;
}

.tkh-chat-answer-content p {
	margin: 0 0 10px;
}
.tkh-chat-answer-content p:last-child {
	margin-bottom: 0;
}

.tkh-chat-answer-content a {
	color: var(--tkh-navy);
	text-decoration: underline;
	text-underline-offset: 3px;
	font-weight: 600;
	transition: color 0.2s ease;
}

.tkh-chat-answer-content a:hover {
	color: var(--tkh-gold);
}

.tkh-chat-answer-content ul,
.tkh-chat-answer-content ol {
	margin: 8px 0;
	padding-left: 20px;
}

.tkh-chat-answer-content li {
	margin-bottom: 4px;
}

.tkh-chat-a-meta {
	font-family: var(--tkh-font-mono);
	font-size: 11px;
	color: #8e96b0;
	margin-top: 4px;
	display: flex;
	align-items: center;
	gap: 6px;
}

/* Follow-up bubble inside answer */
.tkh-chat-followup {
	margin-top: 6px;
	padding: 10px 14px;
	background: #f7f9fe;
	border: 1px solid var(--tkh-line);
	border-radius: 14px;
	font-size: 14.5px;
	line-height: 1.45;
	color: #2e355c;
}

/* Quick reply chips */
.tkh-chat-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 8px;
}

.tkh-chat-chip-item {
	display: inline-flex;
	align-items: center;
	padding: 5px 12px;
	border-radius: 999px;
	background: #f0f3fa;
	border: 1px solid var(--tkh-line);
	color: var(--tkh-navy);
	font-family: var(--tkh-font-body);
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
	transition: all 0.2s ease;
}

.tkh-chat-chip-item:hover {
	background: var(--tkh-navy);
	color: #ffffff;
	border-color: var(--tkh-navy);
}

/* Attachments */
.tkh-chat-attachment {
	margin-top: 8px;
	max-width: 100%;
}

.tkh-chat-attachment-img {
	max-width: 100%;
	border-radius: 14px;
	display: block;
	object-fit: cover;
	border: 1px solid var(--tkh-line);
}

.tkh-chat-attachment-card {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 14px;
	border: 1px solid var(--tkh-line);
	border-radius: 14px;
	background: #fcfdff;
	text-decoration: none;
	color: inherit;
	transition: background 0.2s ease, border-color 0.2s ease;
}

.tkh-chat-attachment-card:hover {
	background: #f3f6fc;
	border-color: var(--tkh-navy);
}

.tkh-chat-card-img {
	width: 48px;
	height: 48px;
	border-radius: 10px;
	object-fit: cover;
	flex-shrink: 0;
}

.tkh-chat-card-text {
	display: flex;
	flex-direction: column;
}

.tkh-chat-card-title {
	font-family: var(--tkh-font-display);
	font-weight: 700;
	font-size: 14px;
	color: var(--tkh-navy-d);
}

.tkh-chat-card-desc {
	font-family: var(--tkh-font-body);
	font-size: 12px;
	color: #6d7593;
}

/* ==========================================================================
   10. Mode A Grid Expand/Collapse & Progressive Enhancement
   ========================================================================== */
.tkh-chat-answer-wrap {
	display: grid;
	grid-template-rows: 1fr;
	transition: grid-template-rows 0.38s cubic-bezier(0.4, 0, 0.2, 1);
	width: 100%;
}

.tkh-chat-answer-inner {
	overflow: hidden;
	min-height: 0;
}

/* PROGRESSIVE ENHANCEMENT:
   Answers are only collapsed IF .js-ready is present!
   If JS fails or is disabled, all Q&As remain 100% visible and accessible. */
.tkh-chat-root.js-ready.mode-a .tkh-chat-item:not(.is-open) .tkh-chat-answer-wrap,
.tkh-chat-root.js-ready.mode-c[data-submode="tap"] .tkh-chat-item:not(.is-open) .tkh-chat-answer-wrap {
	grid-template-rows: 0fr;
}

.tkh-chat-root.js-ready.mode-a .tkh-chat-item:not(.is-open) .tkh-chat-answer,
.tkh-chat-root.js-ready.mode-c[data-submode="tap"] .tkh-chat-item:not(.is-open) .tkh-chat-answer {
	opacity: 0;
	transform: translateY(10px) scale(0.98);
	pointer-events: none;
}

.tkh-chat-root.js-ready.mode-a .tkh-chat-item.is-open .tkh-chat-answer,
.tkh-chat-root.js-ready.mode-c[data-submode="tap"] .tkh-chat-item.is-open .tkh-chat-answer {
	opacity: 1;
	transform: translateY(0) scale(1);
	pointer-events: auto;
}

/* Tap Hint text */
.tkh-chat-tap-hint {
	display: flex;
	align-items: center;
	gap: 6px;
	font-family: var(--tkh-font-mono);
	font-size: 12px;
	color: #7b84a1;
	margin-bottom: 8px;
	user-select: none;
}

/* ==========================================================================
   11. Typing Indicator Bubble
   ========================================================================== */
.tkh-chat-typing-wrap {
	width: 100%;
	display: none;
}

.tkh-chat-item.is-typing .tkh-chat-typing-wrap {
	display: block;
}

.tkh-chat-typing {
	align-self: flex-start;
	background: var(--tkh-a-bg);
	border: var(--tkh-a-border);
	border-bottom-left-radius: 6px;
	display: inline-flex;
	align-items: center;
	gap: 12px;
	padding: 10px 18px;
	box-shadow: 0 4px 14px rgba(41, 47, 110, 0.05);
	animation: tkhTypingEntrance 0.25s cubic-bezier(0.3, 1.5, 0.5, 1);
}

@keyframes tkhTypingEntrance {
	from { opacity: 0; transform: translateY(8px) scale(0.95); }
	to { opacity: 1; transform: translateY(0) scale(1); }
}

.tkh-typing-dots {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 4px 0;
}

.tkh-typing-dots span {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--tkh-navy);
	display: inline-block;
	animation: tkhChatBounce 1.2s infinite ease-in-out;
}

.tkh-typing-dots span:nth-child(1) { animation-delay: 0s; }
.tkh-typing-dots span:nth-child(2) { animation-delay: 0.18s; }
.tkh-typing-dots span:nth-child(3) { animation-delay: 0.36s; }

@keyframes tkhChatBounce {
	0%, 60%, 100% {
		transform: translateY(0);
		opacity: 0.35;
	}
	30% {
		transform: translateY(-5px);
		opacity: 1;
	}
}

/* ==========================================================================
   12. RTL Mirroring Support
   ========================================================================== */
[dir="rtl"] .tkh-chat-root,
.rtl .tkh-chat-root {
	direction: rtl;
	text-align: right;
}

/* In RTL:
   - Question bubble (user side) is on the left or mirrored:
     Let's mirror according to standard RTL chat apps (WhatsApp/Telegram RTL):
     The question bubble aligns to the left (flex-start), tail corner bottom-left.
     The answer bubble aligns to the right (flex-end), tail corner bottom-right.
     Avatar stays at the start of the answer (which is on the right in RTL). */
[dir="rtl"] .bq,
.rtl .bq {
	align-self: flex-start;
	border-bottom-right-radius: var(--tkh-bubble-radius);
	border-bottom-left-radius: 6px;
	text-align: right;
}

[dir="rtl"] .ba,
.rtl .ba {
	align-self: flex-end;
	border-bottom-left-radius: var(--tkh-bubble-radius);
	border-bottom-right-radius: 6px;
	text-align: right;
}

[dir="rtl"] .tkh-chat-typing,
.rtl .tkh-chat-typing {
	align-self: flex-end;
	border-bottom-left-radius: var(--tkh-bubble-radius);
	border-bottom-right-radius: 6px;
}

[dir="rtl"] .tkh-chat-q-meta,
.rtl .tkh-chat-q-meta {
	align-self: flex-start;
}

[dir="rtl"] .tkh-chat-search input,
.rtl .tkh-chat-search input {
	padding: 9px 14px 9px 36px;
}

[dir="rtl"] .tkh-chat-search-icon,
.rtl .tkh-chat-search-icon {
	right: auto;
	left: 14px;
}

[dir="rtl"] .tkh-chat-status-dot,
.rtl .tkh-chat-status-dot {
	right: auto;
	left: 0;
}

/* ==========================================================================
   13. Responsive Rules (Mobile <= 700px)
   ========================================================================== */
@media (max-width: 700px) {
	.tkh-chat-root {
		--tkh-window-radius: 26px;
		--tkh-window-padding: 18px;
		--tkh-bubble-max-width: 96%;
		--tkh-q-font-size: 16px;
		--tkh-a-font-size: 15px;
	}

	.bb {
		max-width: 96%;
		padding: 14px 18px;
	}

	.tkh-chat-window,
	.tkh-chat-root .chat {
		gap: 12px;
		border-radius: 26px;
		padding: 16px 14px;
	}

	.tkh-chat-toolbar {
		flex-direction: column;
		align-items: stretch;
	}

	.tkh-chat-search {
		max-width: 100%;
	}

	.tkh-chat-header-bar {
		padding: 12px 14px;
	}
}

/* ==========================================================================
   14. Layout Checker (Editor / Admin Only)
   ========================================================================== */
.tkh-chat-checker {
	margin-top: 16px;
	padding: 12px 16px;
	background: #171b45;
	border: 1px solid #292f6e;
	border-radius: 12px;
	color: #e2e8f0;
	font-family: var(--tkh-font-mono);
	font-size: 12px;
	line-height: 1.5;
	display: none;
}

.tkh-chat-root.show-checker .tkh-chat-checker {
	display: block;
}

.tkh-chat-checker-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	font-weight: 700;
	color: var(--tkh-gold);
	margin-bottom: 6px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
	padding-bottom: 4px;
}

.tkh-chat-checker-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
	gap: 6px 12px;
}

.tkh-chat-checker-warnings {
	margin-top: 8px;
	padding-top: 6px;
	border-top: 1px dashed rgba(255, 255, 255, 0.15);
	color: #f87171;
}

.tkh-chat-checker-warnings:empty {
	display: none;
}

/* ==========================================================================
   15. Accessibility & Reduced Motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
	.bb.in,
	.tkh-chat-answer-wrap,
	.tkh-chat-typing,
	.tkh-typing-dots span,
	.tkh-chat-status-dot.pulse::after,
	.tkh-chat-q-toggle-icon {
		transition: none !important;
		animation: none !important;
	}

	.tkh-chat-root.reveal-on-scroll .bb:not(.in), .tkh-chat-root.reveal-on-scroll .tkh-chat-bubble:not(.tkh-chat-in) {
		opacity: 1 !important;
		transform: none !important;
	}

	.tkh-chat-root.mode-c .tkh-chat-window {
		scroll-behavior: auto !important;
	}
}
