/* Tisreo Support: "Ask Tisreo" chat. Uses the theme's --tsr-c-* colours when present. */
.tsr-sup {
	--s-bg: var(--tsr-c-bg, #0b0f14);
	--s-surface: var(--tsr-c-surface, #121820);
	--s-raised: var(--tsr-c-raised, #1a222d);
	--s-line: var(--tsr-c-line, #263140);
	--s-text: var(--tsr-c-text, #e8edf3);
	--s-muted: var(--tsr-c-muted, #9aa7b6);
	--s-accent: var(--tsr-c-accent, #e0b43c);
	--s-on-accent: var(--tsr-c-on-accent, #0b0f14);
	--s-ok: var(--tsr-c-buy, #22c55e);
	position: fixed;
	left: 16px;
	bottom: 16px;
	z-index: 100001;
	font: 15px/1.45 var(--wp--preset--font-family--body, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
	color: var(--s-text);
}
.tsr-sup *, .tsr-sup *::before, .tsr-sup *::after { box-sizing: border-box; }
body:has(.tsr-listen-chip:not([hidden]):not(.is-away)) .tsr-sup { bottom: 92px; }
body:has(.tsr-cookie:not([hidden])) .tsr-sup:not(.is-open) { bottom: 92px; }

.tsr-sup-launch {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: .5rem;
	min-height: 48px;
	padding: .55rem 1.05rem .55rem .85rem;
	border: 1px solid color-mix(in srgb, var(--s-accent) 60%, transparent);
	border-radius: 999px;
	background: var(--s-surface);
	color: var(--s-text);
	font: inherit;
	font-weight: 700;
	box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
	cursor: pointer;
}
.tsr-sup-launch svg { color: var(--s-accent); }
.tsr-sup-launch:hover { border-color: var(--s-accent); }
.tsr-sup-launch:focus-visible, .tsr-sup button:focus-visible, .tsr-sup textarea:focus-visible, .tsr-sup a:focus-visible { outline: 2px solid var(--s-accent); outline-offset: 2px; }
.tsr-sup.is-open .tsr-sup-launch { display: none; }
.tsr-sup-dot { position: absolute; top: 4px; right: 6px; width: 11px; height: 11px; border-radius: 50%; background: var(--s-accent); box-shadow: 0 0 0 2px var(--s-surface); }
.tsr-sup-dot[hidden] { display: none; }

.tsr-sup-panel {
	display: flex;
	flex-direction: column;
	width: min(380px, calc(100vw - 32px));
	height: min(560px, calc(100vh - 32px));
	border: 1px solid var(--s-line);
	border-radius: 18px;
	background: var(--s-bg);
	box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
	overflow: hidden;
	animation: tsr-sup-in .18s ease-out;
}
.tsr-sup-panel[hidden] { display: none; }
@keyframes tsr-sup-in { from { opacity: 0; transform: translateY(8px); } }

.tsr-sup-head { display: flex; align-items: flex-start; gap: .6rem; padding: .85rem .9rem .7rem 1rem; background: var(--s-surface); border-bottom: 1px solid var(--s-line); }
.tsr-sup-titles { flex: 1; min-width: 0; }
.tsr-sup-title { margin: 0; font-size: 1.05rem; line-height: 1.25; color: var(--s-text); }
.tsr-sup-status { margin: .15rem 0 0; font-size: .82rem; color: var(--s-muted); }
.tsr-sup-status::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: .4rem; border-radius: 50%; background: var(--s-muted); vertical-align: 1px; }
.tsr-sup-status.is-online::before { background: var(--s-ok); }
.tsr-sup-x { flex: none; width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--s-raised); color: var(--s-text); font-size: 1.35rem; line-height: 1; cursor: pointer; }

.tsr-sup-list { flex: 1; overflow-y: auto; padding: .9rem; display: flex; flex-direction: column; gap: .6rem; }
.tsr-sup-msg { max-width: 88%; padding: .55rem .75rem; border-radius: 14px; background: var(--s-surface); border: 1px solid var(--s-line); }
.tsr-sup-msg p { margin: 0 0 .35rem; }
.tsr-sup-msg p:last-child { margin-bottom: 0; }
.tsr-sup-member { align-self: flex-end; background: color-mix(in srgb, var(--s-accent) 16%, var(--s-surface)); border-color: color-mix(in srgb, var(--s-accent) 40%, var(--s-line)); border-bottom-right-radius: 4px; }
.tsr-sup-bot, .tsr-sup-team { align-self: flex-start; border-bottom-left-radius: 4px; }
.tsr-sup-team { border-color: color-mix(in srgb, var(--s-ok) 55%, var(--s-line)); }
.tsr-sup-who { display: block; margin-bottom: .15rem; font-size: .74rem; font-weight: 700; letter-spacing: .02em; color: var(--s-muted); }
.tsr-sup-t { display: block; margin-bottom: .2rem; }
.tsr-sup-note { display: block; margin-top: .35rem; font-size: .76rem; color: var(--s-muted); }
.tsr-sup-login { display: inline-block; margin-top: .45rem; padding: .3rem .85rem; border-radius: 999px; background: var(--s-accent); color: var(--s-on-accent); font-weight: 700; text-decoration: none; }
.tsr-sup-rel, .tsr-sup-helped { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; margin-top: .5rem; font-size: .8rem; color: var(--s-muted); }

.tsr-sup-chip { padding: .35rem .7rem; border: 1px solid var(--s-line); border-radius: 999px; background: var(--s-raised); color: var(--s-text); font: inherit; font-size: .82rem; text-align: left; cursor: pointer; }
.tsr-sup-chip:hover { border-color: var(--s-accent); }
.tsr-sup-quick { display: flex; flex-wrap: wrap; gap: .4rem; padding: 0 .9rem .6rem; }
.tsr-sup-quick[hidden] { display: none; }
.tsr-sup-actions { padding: 0 .9rem; }
.tsr-sup-human { margin: 0 0 .5rem; padding: .3rem 0; border: 0; background: none; color: var(--s-accent); font: inherit; font-size: .86rem; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.tsr-sup-human[hidden] { display: none; }

.tsr-sup-form { display: flex; align-items: flex-end; gap: .5rem; padding: .6rem .7rem .7rem; border-top: 1px solid var(--s-line); background: var(--s-surface); }
.tsr-sup-input { flex: 1; min-height: 42px; max-height: 120px; padding: .55rem .75rem; border: 1px solid var(--s-line); border-radius: 12px; background: var(--s-bg); color: var(--s-text); font: inherit; resize: none; }
.tsr-sup-input::placeholder { color: var(--s-muted); opacity: 1; }
.tsr-sup-send { flex: none; min-height: 42px; padding: 0 1rem; border: 0; border-radius: 12px; background: var(--s-accent); color: var(--s-on-accent); font: inherit; font-weight: 700; cursor: pointer; }
.tsr-sup-send:disabled { opacity: .6; cursor: wait; }

.tsr-sup-typing { display: flex; gap: 4px; padding: .7rem .8rem; }
.tsr-sup-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--s-muted); animation: tsr-sup-dot 1s infinite ease-in-out; }
.tsr-sup-typing i:nth-child(2) { animation-delay: .15s; }
.tsr-sup-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes tsr-sup-dot { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }

@media (max-width: 480px) {
	.tsr-sup { left: 8px; bottom: 8px; }
	.tsr-sup.is-open { left: 0; right: 0; bottom: 0; }
	.tsr-sup-panel { width: 100vw; height: min(88vh, 100dvh); border-radius: 18px 18px 0 0; }
	.tsr-sup-launch-label { display: none; }
	.tsr-sup-launch { padding: .6rem; width: 52px; height: 52px; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
	.tsr-sup-panel, .tsr-sup-typing i { animation: none; }
}
@media print { .tsr-sup { display: none; } }
