/* LTD Assistant — חלון הצ'אט. הצבעים נלקחים מהתבנית, עם ברירת מחדל שעוברת AA על לבן. */

.ltd-ast {
	--ltd-ast-accent: var(--wp--preset--color--cta, #9c4e2e);
	--ltd-ast-text: #2b2520;
	--ltd-ast-muted: #5c5148;
	--ltd-ast-line: #dbcbb4;
	--ltd-ast-soft: #f4ece0;
	color: var(--ltd-ast-text);
	direction: rtl;
	font-size: 16px;
	line-height: 1.5;
	text-align: right;
}

.ltd-ast *,
.ltd-ast *::before,
.ltd-ast *::after {
	box-sizing: border-box;
}

.ltd-ast--float {
	bottom: 16px;
	left: 16px;
	position: fixed;
	z-index: 9990;
}

.ltd-ast--inline {
	margin: 0 0 1.5em;
	max-width: 520px;
}

.ltd-ast [hidden] {
	display: none !important;
}

.ltd-ast__toggle,
.ltd-ast__send {
	background: var(--ltd-ast-accent);
	border: 0;
	border-radius: 999px;
	color: #fff;
	cursor: pointer;
	font: inherit;
	font-weight: 600;
	min-height: 44px;
	padding: 0 20px;
}

.ltd-ast__toggle {
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.ltd-ast__send:disabled {
	cursor: wait;
	opacity: 0.7;
}

.ltd-ast__toggle:focus-visible,
.ltd-ast__send:focus-visible,
.ltd-ast__close:focus-visible,
.ltd-ast__book:focus-visible,
.ltd-ast__log:focus-visible,
.ltd-ast input:focus-visible,
.ltd-ast textarea:focus-visible {
	outline: 3px solid #1d4ed8;
	outline-offset: 2px;
}

.ltd-ast__panel {
	background: #fff;
	border: 1px solid var(--ltd-ast-line);
	border-radius: 14px;
	display: flex;
	flex-direction: column;
	/* Scrolls instead of clipping: at 200% zoom the consent area and the
	   delete button were cut off (a11y review 18.11.2026, WCAG 1.4.10). */
	overflow-y: auto;
}

.ltd-ast--float .ltd-ast__panel {
	box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
	height: min(560px, calc(100vh - 32px));
	height: min(560px, calc(100dvh - 32px));
	width: min(380px, calc(100vw - 32px));
}

.ltd-ast--inline .ltd-ast__panel {
	height: 480px;
}

.ltd-ast__head {
	align-items: center;
	background: var(--ltd-ast-accent);
	color: #fff;
	display: flex;
	justify-content: space-between;
	padding: 8px 14px;
}

.ltd-ast__title {
	font-weight: 700;
	margin: 0;
}

.ltd-ast__close {
	background: transparent;
	border: 0;
	color: #fff;
	cursor: pointer;
	font-size: 26px;
	height: 44px;
	line-height: 1;
	width: 44px;
}

.ltd-ast__log {
	display: flex;
	flex: 1 0 96px; /* never squeezed below ~3 lines when the panel is short */
	flex-direction: column;
	gap: 10px;
	overflow-y: auto;
	padding: 14px;
}

.ltd-ast__msg {
	border-radius: 12px;
	max-width: 88%;
	padding: 8px 12px;
	white-space: pre-line;
}

.ltd-ast__msg--bot {
	align-self: flex-start;
	background: var(--ltd-ast-soft);
}

.ltd-ast__msg--user {
	align-self: flex-end;
	background: var(--ltd-ast-accent);
	color: #fff;
}

.ltd-ast__source {
	color: var(--ltd-ast-muted);
	display: block;
	font-size: 14px;
	margin-top: 6px;
}

.ltd-ast__book {
	color: var(--ltd-ast-accent);
	display: inline-block;
	font-weight: 600;
	margin-top: 6px;
	min-height: 24px;
}

.ltd-ast__status {
	color: var(--ltd-ast-muted);
	font-size: 14px;
	margin: 0;
	min-height: 21px;
	padding: 0 14px;
}

.ltd-ast__form {
	align-items: flex-end;
	border-top: 1px solid var(--ltd-ast-line);
	display: flex;
	gap: 8px;
	padding: 10px;
}

.ltd-ast__input {
	border: 1px solid #8a7a68;
	border-radius: 10px;
	flex: 1;
	font: inherit;
	min-height: 44px;
	padding: 8px 10px;
	resize: none;
}

.ltd-ast__consent {
	color: var(--ltd-ast-muted);
	font-size: 13px;
	padding: 0 12px 8px;
}

.ltd-ast__consent label {
	align-items: flex-start;
	display: flex;
	gap: 6px;
}

.ltd-ast__consent input {
	flex: none;
	height: 24px;
	margin: 0;
	width: 24px;
}

.ltd-ast__consent-more {
	margin: 4px 30px 0 0;
}

.ltd-ast__forget {
	background: none;
	border: 0;
	color: var(--ltd-ast-accent);
	cursor: pointer;
	font: inherit;
	min-height: 24px;
	padding: 4px 0;
	text-decoration: underline;
}

.ltd-ast__note {
	color: var(--ltd-ast-muted);
	font-size: 13px;
	margin: 0;
	padding: 0 12px 10px;
}

.ltd-ast__lead {
	background: var(--ltd-ast-soft);
	border-radius: 12px;
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 12px;
}

.ltd-ast__lead label {
	font-weight: 600;
}

.ltd-ast__lead input {
	border: 1px solid #8a7a68;
	border-radius: 8px;
	font: inherit;
	min-height: 44px;
	padding: 6px 10px;
	width: 100%;
}

.ltd-ast__small {
	color: var(--ltd-ast-muted);
	font-size: 13px;
	margin: 0;
}

.ltd-ast__error {
	color: #a4261f;
	font-size: 14px;
	margin: 0;
}

.ltd-ast__error:empty {
	display: none;
}

.ltd-ast__sr,
.ltd-ast__hp {
	clip: rect(0, 0, 0, 0);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	position: absolute;
	white-space: nowrap;
	width: 1px;
}

@media (max-width: 480px) {
	.ltd-ast--float {
		bottom: 12px;
		left: 12px;
	}

	.ltd-ast--float .ltd-ast__panel {
		border-radius: 12px 12px 0 0;
		bottom: 0;
		height: 85vh;
		height: 85dvh;
		left: 0;
		position: fixed;
		right: 0;
		width: 100%;
	}
}

@media (prefers-reduced-motion: no-preference) {
	.ltd-ast__toggle {
		transition: transform 0.15s ease;
	}

	.ltd-ast__toggle:hover {
		transform: translateY(-2px);
	}
}
