/* Tarsil TapTalk — widget styles. All themable values come from CSS vars. */
#tttk-root{
	--tttk-deep: var(--tttk-brand);
	position: fixed;
	z-index: 99999;
	bottom: 20px;
	font-family: var(--tttk-font, -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif);
}
#tttk-root.tttk-pos-br{ right: 20px; }
#tttk-root.tttk-pos-bl{ left: 20px; }

/* Launcher */
.tttk-launcher{
	position: relative;
	width: var(--tttk-launcher-size, 60px);
	height: var(--tttk-launcher-size, 60px);
	border-radius: 50%;
	background: var(--tttk-launcher, #25D366);
	border: none;
	cursor: pointer;
	box-shadow: 0 8px 22px rgba(0,0,0,.28);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform .15s ease, box-shadow .15s ease;
	padding: 0;
}
.tttk-launcher:hover{ transform: scale(1.05); }
.tttk-launcher:focus-visible{ outline: 3px solid var(--tttk-accent); outline-offset: 3px; }
.tttk-launcher svg{ width: 50%; height: 50%; fill: #fff; display: block; }
.tttk-launcher .tttk-badge{
	position: absolute; top: -2px; right: -2px;
	background: #ff3b30; color: #fff; min-width: 20px; height: 20px;
	border-radius: 10px; font-size: 11px; font-weight: 700;
	display: flex; align-items: center; justify-content: center; padding: 0 5px;
}

/* Greeting bubble */
.tttk-greet{
	position: absolute; bottom: calc(var(--tttk-launcher-size,60px) + 18px);
	background: #fff; color: #1f2c33; padding: 12px 16px;
	border-radius: 14px; font-size: 13px; line-height: 1.4;
	box-shadow: 0 6px 20px rgba(0,0,0,.18); cursor: pointer;
	width: max-content; max-width: 220px; min-width: 0;
}
#tttk-root.tttk-pos-br .tttk-greet{ right: 2px; border-bottom-right-radius: 3px; }
#tttk-root.tttk-pos-bl .tttk-greet{ left: 2px; border-bottom-left-radius: 3px; }
.tttk-greet .tttk-greet-text{ display: block; padding-right: 6px; white-space: normal; word-break: normal; overflow-wrap: anywhere; }
.tttk-greet .tttk-greet-x{
	position: absolute; top: -10px; right: -10px; background: #54656f; color: #fff;
	width: 22px; height: 22px; border-radius: 50%; border: 2px solid #fff; cursor: pointer;
	font-size: 13px; line-height: 1; display: flex; align-items: center; justify-content: center;
	padding: 0; box-shadow: 0 2px 6px rgba(0,0,0,.2);
}

/* Panel */
.tttk-widget{
	width: var(--tttk-width, 360px);
	max-width: calc(100vw - 40px);
	height: 540px;
	max-height: calc(100vh - 110px);
	background: var(--tttk-chat-bg, #efeae2);
	border-radius: calc(var(--tttk-radius, 16px) + 4px);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	box-shadow: 0 20px 56px rgba(0,0,0,.28);
	font-size: var(--tttk-font-size, 14px);
}
.tttk-widget.tttk-has-pattern .tttk-w-body{
	background-image: radial-gradient(rgba(0,0,0,.025) 1px, transparent 1px);
	background-size: 18px 18px;
}

.tttk-anim-in{ animation: tttk-pop .18s ease; }
@keyframes tttk-pop{ from{ transform: translateY(12px) scale(.98); opacity: 0; } to{ transform: none; opacity: 1; } }

/* Header */
.tttk-w-head{
	background: var(--tttk-brand, #075E54);
	color: #fff; padding: 13px 14px;
	display: flex; align-items: center; gap: 11px;
}
.tttk-w-avatar{
	width: 38px; height: 38px; border-radius: 50%;
	background: var(--tttk-launcher, #25D366);
	display: flex; align-items: center; justify-content: center;
	flex-shrink: 0; overflow: hidden; background-size: cover; background-position: center;
}
.tttk-w-avatar svg{ width: 21px; height: 21px; fill: #fff; }
.tttk-w-title{ font-size: 15px; font-weight: var(--tttk-heading-weight, 600); line-height: 1.2; }
.tttk-w-status{ font-size: 11.5px; opacity: .85; display: flex; align-items: center; gap: 5px; }
.tttk-dot{ width: 7px; height: 7px; border-radius: 50%; background: #7ee787; display: inline-block; }
.tttk-w-head .tttk-close{
	margin-inline-start: auto; background: transparent; border: none; color: #fff;
	cursor: pointer; font-size: 20px; line-height: 1; opacity: .85; padding: 4px;
}
.tttk-w-head .tttk-close:hover{ opacity: 1; }
.tttk-w-head .tttk-back{
	background: transparent; border: none; color: #fff; cursor: pointer;
	font-size: 18px; opacity: .85; padding: 0 2px 0 0; display: none;
}
.tttk-w-head.tttk-can-back .tttk-back{ display: inline-block; }

/* Body */
.tttk-w-body{
	flex: 1; padding: 14px 12px; overflow-y: auto;
	display: flex; flex-direction: column; gap: 9px;
}
.tttk-w-body.tttk-rtl{ direction: rtl; text-align: right; }

.tttk-bubble{
	background: var(--tttk-bot, #fff); color: #1f2c33;
	padding: 9px 12px; border-radius: 0 12px 12px 12px;
	font-size: var(--tttk-font-size, 14px); max-width: 88%;
	box-shadow: 0 1px 1px rgba(0,0,0,.06); word-wrap: break-word;
}
.tttk-bubble-user{
	align-self: flex-end; background: var(--tttk-user, #d9fdd3);
	border-radius: 12px 0 12px 12px;
}
.tttk-rtl .tttk-bubble{ border-radius: 12px 0 12px 12px; align-self: flex-end; }
.tttk-rtl .tttk-bubble-user{ border-radius: 0 12px 12px 12px; align-self: flex-start; }
.tttk-bubble a{ color: var(--tttk-accent, #2271b1); }

/* Crumb */
.tttk-crumb{
	font-size: 11px; color: #5a6b75; background: rgba(255,255,255,.7);
	align-self: flex-start; padding: 3px 9px; border-radius: 7px; cursor: pointer; border: none;
}
.tttk-rtl .tttk-crumb{ align-self: flex-end; }

/* Choice rows */
.tttk-lang-row{ display: flex; gap: 7px; flex-wrap: wrap; }
.tttk-lang{
	background: #fff; border: 1.5px solid #e3e6e8; padding: 7px 15px;
	border-radius: 18px; font-size: 13px; font-weight: 600; color: #1f2c33; cursor: pointer;
	transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.tttk-lang:hover,
.tttk-lang:focus{ border-color: var(--tttk-launcher, #25D366); background: #f1fff7; color: #1f2c33; }
.tttk-lang.is-active{ background: var(--tttk-launcher, #25D366); border-color: var(--tttk-launcher, #25D366); color: #fff; }

.tttk-ind-grid{ display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.tttk-ind{
	background: #fff; border: 1.5px solid #e3e6e8; border-radius: 9px;
	padding: 10px 8px; font-size: 12px; font-weight: 600; color: #1f2c33;
	display: flex; flex-direction: column; align-items: center; gap: 5px;
	text-align: center; cursor: pointer;
	transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.tttk-ind:hover,
.tttk-ind:focus{ border-color: var(--tttk-launcher, #25D366); background: #f6fffb; color: var(--tttk-brand, #075E54); }
.tttk-ind .tttk-ico{ font-size: 18px; }

.tttk-chips{ display: flex; flex-direction: column; gap: 7px; }
.tttk-chip{
	background: #fff; border: 1.5px solid var(--tttk-launcher, #25D366);
	color: var(--tttk-brand, #075E54); padding: 10px 13px; border-radius: 10px;
	font-size: 13px; font-weight: 500; cursor: pointer; text-align: start;
	display: flex; align-items: center; justify-content: space-between; gap: 8px;
	transition: background .12s ease, color .12s ease;
}
.tttk-chip:hover,
.tttk-chip:focus{ background: #f1fff7; color: var(--tttk-brand, #075E54); }
.tttk-chip span{ color: inherit; }
.tttk-chip .tttk-arrow{ color: var(--tttk-launcher, #25D366); font-weight: 700; }
.tttk-rtl .tttk-chip .tttk-arrow{ transform: scaleX(-1); }

/* Answer card */
.tttk-answer{
	background: var(--tttk-bot, #fff); border-radius: 12px; overflow: hidden;
	max-width: 94%; box-shadow: 0 1px 2px rgba(0,0,0,.1);
}
.tttk-answer-text{ padding: 11px 13px; font-size: var(--tttk-font-size, 14px); color: #1f2c33; }
.tttk-answer-text p{ margin: 0 0 8px; }
.tttk-answer-text p:last-child{ margin-bottom: 0; }
.tttk-answer-link{
	display: flex; align-items: center; gap: 7px; padding: 10px 13px;
	border-top: 1px solid #eceff1; color: var(--tttk-accent, #2271b1);
	font-weight: 600; font-size: 13px; text-decoration: none;
}
.tttk-answer-link svg{ width: 15px; height: 15px; fill: currentColor; }

/* Video row (opens fullscreen dialog) */
.tttk-video-row{
	display: flex; align-items: center; gap: 11px; width: 100%;
	padding: 10px 13px; border: none; border-top: 1px solid #eceff1;
	background: transparent; cursor: pointer; text-align: start;
}
.tttk-video-row:hover{ background: #f6fbff; }
.tttk-video-thumb{
	position: relative; width: 64px; height: 40px; border-radius: 6px;
	background: linear-gradient(135deg,#075E54,#128C7E); background-size: cover;
	background-position: center; flex-shrink: 0;
}
.tttk-video-thumb-plain{ background: linear-gradient(135deg,#075E54,#128C7E); }
.tttk-video-play{
	position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
}
.tttk-video-play svg{ width: 20px; height: 20px; fill: #fff; filter: drop-shadow(0 1px 2px rgba(0,0,0,.4)); }
.tttk-video-label{ font-size: 13px; font-weight: 600; color: var(--tttk-accent,#2271b1); }

/* Video dialog */
.tttk-video-overlay{
	position: fixed; inset: 0; z-index: 100000; background: rgba(0,0,0,.78);
	display: flex; align-items: center; justify-content: center; padding: 20px;
	animation: tttk-fade .15s ease;
}
.tttk-video-dialog{ position: relative; width: min(900px, 96vw); }
.tttk-video-frame{
	position: relative; width: 100%; aspect-ratio: 16/9; background: #000;
	border-radius: 10px; overflow: hidden;
}
.tttk-video-frame iframe,
.tttk-video-frame embed,
.tttk-video-frame object{ position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.tttk-video-fallback{ color: #fff; display: flex; align-items: center; justify-content: center; height: 100%; }
.tttk-video-close{
	position: absolute; top: -42px; right: 0; background: rgba(255,255,255,.15); color: #fff;
	border: none; width: 34px; height: 34px; border-radius: 50%; font-size: 22px; cursor: pointer;
	display: flex; align-items: center; justify-content: center;
}
.tttk-video-close:hover{ background: rgba(255,255,255,.28); }
@keyframes tttk-fade{ from{ opacity: 0; } to{ opacity: 1; } }

/* Feedback row — lives inside the answer card footer */
.tttk-ans-foot{
	display: flex; align-items: center; gap: 8px;
	padding: 8px 13px; border-top: 1px solid #eceff1; background: #fafbfb;
}
.tttk-ans-foot-q{ font-size: 12px; color: #5a6b75; margin-inline-end: auto; }
.tttk-thumb{
	width: 34px; height: 32px; border: 1.5px solid #e3e6e8; border-radius: 9px;
	background: #fff; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
	flex-shrink: 0; padding: 0; transition: border-color .12s ease, background .12s ease;
}
.tttk-thumb svg{ width: 17px; height: 17px; fill: #5a6b75; display: block; }
.tttk-thumb-up:hover{ border-color: var(--tttk-launcher,#25D366); background: #f0fff6; }
.tttk-thumb-up:hover svg{ fill: #0b7a3e; }
.tttk-thumb-down:hover{ border-color: #e9a; background: #fff5f8; }
.tttk-thumb-down:hover svg{ fill: #b3306b; }
.tttk-thumb.is-picked{ border-color: var(--tttk-launcher,#25D366); background: #eafff2; }
.tttk-thumb.is-picked svg{ fill: #0b7a3e; }
.tttk-thumb-down.is-picked{ border-color: #e9a; background: #fff5f8; }
.tttk-thumb-down.is-picked svg{ fill: #b3306b; }
.tttk-thumb:disabled{ cursor: default; }
.tttk-fb-done .tttk-ans-foot-q{ color: #0b7a3e; font-weight: 600; }

/* WhatsApp CTA — full width, single line */
.tttk-wa{
	background: var(--tttk-launcher, #25D366); color: #fff;
	border: none; cursor: pointer; border-radius: 11px; padding: 12px 16px;
	font-size: 13.5px; font-weight: 600; display: flex; align-items: center;
	justify-content: center; gap: 9px; width: 100%; max-width: 100%;
	text-decoration: none; white-space: nowrap; box-shadow: 0 3px 10px rgba(37,211,102,.3);
}
.tttk-wa span{ white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tttk-wa svg{ width: 18px; height: 18px; fill: #fff; flex-shrink: 0; }
.tttk-wa:hover{ filter: brightness(1.05); }

.tttk-note{
	text-align: center; font-size: 11px; color: #5a6b75; background: rgba(255,243,211,.9);
	align-self: center; padding: 4px 12px; border-radius: 8px;
}

/* Exit confirm */
.tttk-confirm-overlay{
	position: absolute; inset: 0; z-index: 5; background: rgba(11,20,26,.45);
	display: flex; align-items: center; justify-content: center; padding: 20px;
	animation: tttk-fade .12s ease;
}
.tttk-confirm{
	background: #fff; border-radius: 14px; padding: 20px; width: 100%; max-width: 280px;
	box-shadow: 0 12px 32px rgba(0,0,0,.3); text-align: center;
}
.tttk-confirm-title{ font-size: 16px; font-weight: 700; color: #1f2c33; margin-bottom: 6px; }
.tttk-confirm-body{ font-size: 13px; color: #5a6b75; margin-bottom: 16px; line-height: 1.5; }
.tttk-confirm-actions{ display: flex; gap: 10px; }
.tttk-confirm-actions button{ flex: 1; padding: 10px; border-radius: 9px; font-size: 13px; font-weight: 600; cursor: pointer; border: none; }
.tttk-confirm-no{ background: #eceff1; color: #1f2c33; }
.tttk-confirm-no:hover{ background: #dfe4e7; }
.tttk-confirm-yes{ background: var(--tttk-launcher,#25D366); color: #fff; }
.tttk-confirm-yes:hover{ filter: brightness(1.05); }

/* Header timer chip */
.tttk-w-titlerow{ display: flex; align-items: center; gap: 8px; }
.tttk-timer{
	font-size: 11px; font-weight: 700; color: #fff; background: rgba(255,255,255,.18);
	padding: 1px 8px; border-radius: 10px; font-variant-numeric: tabular-nums; letter-spacing: .02em;
}

/* Footer search */
.tttk-w-foot{ padding: 9px 11px; background: #f0f2f5; display: flex; gap: 8px; align-items: center; }
.tttk-search-wrap{ flex: 1; display: flex; align-items: center; background: #fff; border: 1px solid #e3e6e8; border-radius: 20px; padding: 0 6px 0 12px; }
.tttk-search-wrap svg{ width: 15px; height: 15px; fill: #667781; flex-shrink: 0; }
.tttk-search{ flex: 1; border: none; outline: none; padding: 9px 8px; font-size: 13px; background: transparent; color: #1f2c33; font-family: inherit; }
.tttk-search-go{
	background: var(--tttk-launcher,#25D366); border: none; color: #fff;
	width: 36px; height: 36px; min-width: 36px; border-radius: 50%; cursor: pointer;
	display: flex; align-items: center; justify-content: center; flex-shrink: 0; padding: 0;
}
.tttk-search-go svg{ fill: #fff; width: 17px; height: 17px; display: block; }
.tttk-search-go:hover{ filter: brightness(1.05); }
.tttk-rtl .tttk-search-go svg{ transform: scaleX(-1); }

/* Loading dots */
.tttk-typing{ display: inline-flex; gap: 4px; padding: 4px 2px; }
.tttk-typing span{ width: 7px; height: 7px; border-radius: 50%; background: #b6c0c6; animation: tttk-blink 1.2s infinite both; }
.tttk-typing span:nth-child(2){ animation-delay: .2s; }
.tttk-typing span:nth-child(3){ animation-delay: .4s; }
@keyframes tttk-blink{ 0%,80%,100%{ opacity: .3; } 40%{ opacity: 1; } }

@media (prefers-reduced-motion: reduce){
	.tttk-anim-in, .tttk-typing span{ animation: none; }
	.tttk-launcher{ transition: none; }
}
