/**
 * OTIN AI Assistant: embedded section (spec §6, Appendix A).
 *
 * DESIGN TOKENS ARE DRAFT (DECISIONS_REGISTER DR-11 / DEC-13).
 * Colours, radii, type scale, breakpoints and motion durations are derived
 * from the Appendix A mockups and are NOT approved brand values. Adjust only
 * the custom properties below when OTIN supplies approved tokens.
 *
 * Every selector is scoped to .otin-ai to avoid theme/plugin collisions.
 *
 * THEME ISOLATION: selectors start with `:is(.otin-ai, #otin-ai-scope)`.
 * The `#otin-ai-scope` id never exists in the markup; listing it inside :is()
 * only lifts each rule to id-level specificity, so theme rules such as
 * `.body-container h2` or `.body-container button:not(...)` cannot outrank the
 * assistant's own styles. Keep this prefix on every new selector.
 */

:is(.otin-ai, #otin-ai-scope) {
	/* Layout adapts to the space the shortcode actually gets (theme column,
	   Elementor column), not only to the viewport. */
	container: otin-ai / inline-size;

	/* --- DRAFT tokens ---------------------------------------------------- */
	--otin-ai-bg: #07060b;
	--otin-ai-surface: rgba(18, 14, 28, 0.78);
	--otin-ai-surface-2: #15111f;
	--otin-ai-field: rgba(0, 0, 0, 0.35);
	--otin-ai-border: rgba(255, 255, 255, 0.16);
	--otin-ai-border-strong: rgba(255, 255, 255, 0.34);
	--otin-ai-violet: #7c4dff;
	--otin-ai-violet-strong: #6a35ff;
	--otin-ai-violet-soft: rgba(124, 77, 255, 0.16);
	--otin-ai-violet-line: rgba(150, 115, 255, 0.45);
	--otin-ai-violet-text: #c3b1ff;
	--otin-ai-text: #f5f3fb;
	--otin-ai-text-muted: #bcb6cc;
	--otin-ai-danger: #ffb3b3;
	--otin-ai-danger-line: rgba(255, 120, 120, 0.55);
	--otin-ai-focus: #c3b1ff;
	--otin-ai-on-light: #0c0914;
	--otin-ai-font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--otin-ai-radius-pill: 999px;
	--otin-ai-radius-card: 18px;
	--otin-ai-radius-panel: 26px;
	--otin-ai-touch: 44px;
	--otin-ai-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
	--otin-ai-dur: 420ms;
	--otin-ai-dur-fast: 180ms;
	--otin-ai-panel-height: clamp(420px, calc(100vh - 250px), 720px);
	/* --------------------------------------------------------------------- */

	position: relative;
	isolation: isolate;
	overflow: hidden;
	box-sizing: border-box;
	width: 100%;
	max-width: none;
	margin: 0;
	padding: clamp(40px, 7vw, 104px) clamp(16px, 4vw, 40px) clamp(32px, 5vw, 64px);
	background-color: var(--otin-ai-bg);
	color: var(--otin-ai-text);
	font-family: var(--otin-ai-font);
	font-size: 16px;
	line-height: 1.5;
	font-weight: 400;
	font-style: normal;
	letter-spacing: normal;
	word-spacing: normal;
	text-transform: none;
	text-indent: 0;
	text-shadow: none;
	text-align: left;
	-webkit-font-smoothing: antialiased;
}

/* Theme isolation reset: discard every theme/global rule that reaches the
   assistant's elements (headings, buttons, inputs, lists, paragraphs and their
   pseudo-elements) and start from browser defaults. The component rules below
   come later at equal or higher specificity, so they still apply. SVG icons are
   excluded because `revert` would also drop their presentation attributes. */
:is(.otin-ai, #otin-ai-scope) :where(:not(svg, svg *)),
:is(.otin-ai, #otin-ai-scope) :where(:not(svg, svg *))::before,
:is(.otin-ai, #otin-ai-scope) :where(:not(svg, svg *))::after {
	all: revert;
}

/* Themes commonly inject list bullets with `content: ... !important`
   (e.g. `ul > li::before`); only !important can cancel those. */
:is(.otin-ai, #otin-ai-scope) :where(li)::before,
:is(.otin-ai, #otin-ai-scope) :where(li)::after {
	content: none !important;
}

:is(.otin-ai, #otin-ai-scope) *,
:is(.otin-ai, #otin-ai-scope) *::before,
:is(.otin-ai, #otin-ai-scope) *::after {
	box-sizing: border-box;
}

:is(.otin-ai, #otin-ai-scope) :where(h2, h3, p, ul, ol, dl, dd, figure) {
	margin: 0;
	padding: 0;
}

:is(.otin-ai, #otin-ai-scope) :where(button, input, textarea, select) {
	font: inherit;
	letter-spacing: normal;
	text-transform: none;
	margin: 0;
	color: inherit;
}

:is(.otin-ai, #otin-ai-scope) :where(svg) {
	display: block;
	flex: none;
}

:is(.otin-ai, #otin-ai-scope) [hidden] {
	display: none !important;
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__sr-only {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0 0 0 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

/* Shared focus treatment (WCAG 2.2 focus visible / not obscured). */
:is(.otin-ai, #otin-ai-scope) :focus-visible {
	outline: 2px solid var(--otin-ai-focus);
	outline-offset: 3px;
}

/* --- Decorative backdrop (CSS only; no unapproved imagery) ------------- */

:is(.otin-ai, #otin-ai-scope) .otin-ai__backdrop {
	position: absolute;
	inset: 0;
	z-index: -1;
	pointer-events: none;
	background:
		linear-gradient(118deg, transparent 58%, rgba(124, 77, 255, 0.0) 60%, rgba(124, 77, 255, 0.38) 66%, rgba(80, 40, 220, 0.12) 70%, transparent 76%),
		radial-gradient(60% 70% at 92% 6%, rgba(110, 60, 255, 0.34), transparent 70%),
		radial-gradient(45% 60% at 4% 40%, rgba(90, 50, 220, 0.30), transparent 72%),
		radial-gradient(30% 35% at 12% 88%, rgba(124, 77, 255, 0.16), transparent 70%);
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__backdrop::after {
	/* Subtle vignette keeps text contrast high over the glow. */
	content: "";
	position: absolute;
	inset: 0;
	background: radial-gradient(70% 60% at 50% 45%, rgba(7, 6, 11, 0.55), transparent 80%);
}

@supports (height: 1dvh) {
	:is(.otin-ai, #otin-ai-scope) {
		--otin-ai-panel-height: clamp(420px, calc(100dvh - 250px), 720px);
	}
}

/* --- Layout -------------------------------------------------------------- */

:is(.otin-ai, #otin-ai-scope) .otin-ai__inner {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: clamp(20px, 3vw, 32px);
	max-width: 1180px;
	margin: 0 auto;
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__header {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: var(--otin-ai-touch);
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__brand {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	color: var(--otin-ai-text);
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__mark {
	width: 34px;
	height: 34px;
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__brand-text {
	font-size: 0.95rem;
	font-weight: 500;
	letter-spacing: 0.32em;
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__new-chat {
	position: absolute;
	right: 0;
	top: 50%;
	transform: translateY(-50%);
	min-height: var(--otin-ai-touch);
	padding: 8px 18px;
	border: 1px solid var(--otin-ai-violet-line);
	border-radius: var(--otin-ai-radius-pill);
	background: var(--otin-ai-violet-soft);
	color: var(--otin-ai-text);
	font-size: 0.9rem;
	font-weight: 600;
	cursor: pointer;
	transition: background-color var(--otin-ai-dur-fast) ease, border-color var(--otin-ai-dur-fast) ease;
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__new-chat:hover {
	background: rgba(124, 77, 255, 0.28);
	border-color: var(--otin-ai-violet-text);
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__intro {
	text-align: center;
	max-width: 46rem;
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__headline {
	font-family: inherit;
	font-size: clamp(2.1rem, 5vw, 3.75rem);
	font-weight: 700;
	line-height: 1.08;
	letter-spacing: -0.02em;
	color: var(--otin-ai-text);
	transition: font-size var(--otin-ai-dur) var(--otin-ai-ease);
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__subline {
	margin-top: 12px;
	font-size: clamp(1rem, 1.7vw, 1.2rem);
	color: var(--otin-ai-text-muted);
}

/* --- Panel: composer in INITIAL, full chat once expanded ----------------- */

:is(.otin-ai, #otin-ai-scope) .otin-ai__panel {
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: 820px;
	max-height: 140px;
	border: 1px solid transparent;
	border-radius: var(--otin-ai-radius-panel);
	transition:
		max-height var(--otin-ai-dur) var(--otin-ai-ease),
		max-width var(--otin-ai-dur) var(--otin-ai-ease),
		padding var(--otin-ai-dur) var(--otin-ai-ease),
		background-color var(--otin-ai-dur) ease,
		border-color var(--otin-ai-dur) ease;
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__log {
	position: relative;
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
	/* No smooth scroll-behavior: programmatic jumps to the newest message must be instant. */
	padding: 8px 6px 16px;
	display: flex;
	flex-direction: column;
	gap: 18px;
	scrollbar-width: thin;
	scrollbar-color: rgba(195, 177, 255, 0.35) transparent;
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__log:focus-visible {
	outline-offset: -2px;
}

/* --- Composer -------------------------------------------------------------- */

:is(.otin-ai, #otin-ai-scope) .otin-ai__composer {
	display: flex;
	align-items: flex-end;
	gap: 12px;
	width: 100%;
	min-height: 66px;
	padding: 9px 9px 9px 20px;
	border: 1px solid var(--otin-ai-border-strong);
	border-radius: 34px;
	background: rgba(8, 6, 14, 0.72);
	backdrop-filter: blur(6px);
	transition: border-color var(--otin-ai-dur-fast) ease, box-shadow var(--otin-ai-dur-fast) ease;
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__composer:focus-within {
	border-color: var(--otin-ai-violet-text);
	box-shadow: 0 0 0 3px rgba(124, 77, 255, 0.25);
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__sparkle {
	width: 22px;
	height: 22px;
	margin-bottom: 13px;
	color: var(--otin-ai-text);
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__input {
	flex: 1 1 auto;
	min-width: 0;
	min-height: 46px;
	max-height: 160px;
	padding: 11px 0;
	border: 0;
	background: transparent;
	color: var(--otin-ai-text);
	font-size: 1rem;
	line-height: 1.5;
	resize: none;
	overflow-y: hidden;
	box-shadow: none;
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__input::placeholder {
	color: var(--otin-ai-text-muted);
	opacity: 1;
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__input:focus,
:is(.otin-ai, #otin-ai-scope) .otin-ai__input:focus-visible {
	outline: none;
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__send {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #fff;
	color: var(--otin-ai-on-light);
	cursor: pointer;
	transition: transform var(--otin-ai-dur-fast) ease, opacity var(--otin-ai-dur-fast) ease;
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__send svg {
	width: 22px;
	height: 22px;
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__send:hover {
	transform: translateX(2px);
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__send[aria-disabled="true"] {
	opacity: 0.45;
	cursor: not-allowed;
	transform: none;
}

/* --- Shortcuts ------------------------------------------------------------- */

:is(.otin-ai, #otin-ai-scope) .otin-ai__shortcuts {
	display: grid;
	grid-template-rows: 1fr;
	width: 100%;
	transition:
		grid-template-rows var(--otin-ai-dur) var(--otin-ai-ease),
		opacity var(--otin-ai-dur-fast) ease,
		visibility 0s linear 0s;
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__shortcuts > ul {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 14px;
	min-height: 0;
	overflow: hidden;
	list-style: none;
	padding: 4px;
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__shortcut {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	min-height: 56px;
	padding: 12px 18px;
	border: 1px solid var(--otin-ai-border-strong);
	border-radius: var(--otin-ai-radius-pill);
	background: rgba(8, 6, 14, 0.55);
	color: var(--otin-ai-text);
	font-size: 0.95rem;
	font-weight: 500;
	text-align: left;
	cursor: pointer;
	transition: background-color var(--otin-ai-dur-fast) ease, border-color var(--otin-ai-dur-fast) ease;
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__shortcut:hover {
	background: var(--otin-ai-violet-soft);
	border-color: var(--otin-ai-violet-text);
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__shortcut-icon {
	width: 22px;
	height: 22px;
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__shortcut-arrow {
	width: 18px;
	height: 18px;
	margin-left: 6px;
	opacity: 0.85;
}

/* --- Disclosure -------------------------------------------------------------- */

:is(.otin-ai, #otin-ai-scope) .otin-ai__disclosure {
	max-width: 46rem;
	font-size: 0.85rem;
	color: var(--otin-ai-text-muted);
	text-align: center;
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__link,
:is(.otin-ai, #otin-ai-scope) a {
	color: var(--otin-ai-violet-text);
	text-decoration: underline;
	text-underline-offset: 2px;
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__draft-flag,
:is(.otin-ai, #otin-ai-scope) .otin-ai__badge {
	display: inline-block;
	margin: 4px 6px 0;
	padding: 2px 10px;
	border: 1px dashed rgba(255, 210, 120, 0.7);
	border-radius: var(--otin-ai-radius-pill);
	color: #ffe0a3;
	font-size: 0.75rem;
	font-weight: 600;
}

/* ===== EXPANDED (QUALIFYING and later) =================================== */

:is(.otin-ai, #otin-ai-scope):not([data-state="initial"]) .otin-ai__new-chat {
	display: inline-flex;
	align-items: center;
}

:is(.otin-ai, #otin-ai-scope):not([data-state="initial"]) .otin-ai__headline {
	font-size: clamp(1.5rem, 2.8vw, 2.25rem);
}

:is(.otin-ai, #otin-ai-scope):not([data-state="initial"]) .otin-ai__subline {
	margin-top: 6px;
	font-size: 1rem;
}

:is(.otin-ai, #otin-ai-scope):not([data-state="initial"]) {
	padding-top: clamp(20px, 3vw, 32px);
	padding-bottom: clamp(20px, 3vw, 32px);
}

:is(.otin-ai, #otin-ai-scope):not([data-state="initial"]) .otin-ai__inner {
	gap: 14px;
}

:is(.otin-ai, #otin-ai-scope):not([data-state="initial"]) .otin-ai__panel {
	max-width: 1000px;
	height: var(--otin-ai-panel-height);
	max-height: var(--otin-ai-panel-height);
	padding: 14px;
	background: var(--otin-ai-surface);
	border-color: var(--otin-ai-violet-line);
	box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.05);
	backdrop-filter: blur(10px);
}

:is(.otin-ai, #otin-ai-scope):not([data-state="initial"]) .otin-ai__log {
	animation: otin-ai-fade-in var(--otin-ai-dur) var(--otin-ai-ease) both;
}

:is(.otin-ai, #otin-ai-scope):not([data-state="initial"]) .otin-ai__composer {
	flex: none;
	margin-top: 10px;
}

:is(.otin-ai, #otin-ai-scope):not([data-state="initial"]) .otin-ai__shortcuts {
	grid-template-rows: 0fr;
	opacity: 0;
	visibility: hidden;
	transition:
		grid-template-rows var(--otin-ai-dur) var(--otin-ai-ease),
		opacity var(--otin-ai-dur-fast) ease,
		visibility 0s linear var(--otin-ai-dur);
}

/* --- Messages ---------------------------------------------------------------- */

:is(.otin-ai, #otin-ai-scope) .otin-ai__badge-row {
	display: flex;
	justify-content: center;
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__msg {
	display: grid;
	grid-template-columns: 40px minmax(0, 1fr);
	gap: 12px;
	align-items: start;
	max-width: 900px;
	animation: otin-ai-rise var(--otin-ai-dur) var(--otin-ai-ease) both;
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__avatar {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__avatar svg {
	width: 22px;
	height: 22px;
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__msg--visitor .otin-ai__avatar {
	background: rgba(124, 77, 255, 0.22);
	color: var(--otin-ai-text);
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__msg--assistant .otin-ai__avatar {
	background: radial-gradient(circle, rgba(124, 77, 255, 0.35), rgba(124, 77, 255, 0.08) 70%);
	box-shadow: 0 0 0 2px rgba(150, 115, 255, 0.65), 0 0 18px rgba(124, 77, 255, 0.45);
	color: var(--otin-ai-text);
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__meta {
	display: flex;
	align-items: baseline;
	gap: 10px;
	margin-bottom: 6px;
	font-size: 0.82rem;
	color: var(--otin-ai-text-muted);
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__who {
	font-weight: 600;
	color: var(--otin-ai-text);
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__time {
	color: var(--otin-ai-violet-text);
	font-variant-numeric: tabular-nums;
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__bubble {
	padding: 13px 18px;
	border: 1px solid var(--otin-ai-border);
	border-radius: 16px;
	background: rgba(255, 255, 255, 0.035);
	white-space: pre-line;
	overflow-wrap: anywhere;
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__msg--visitor .otin-ai__bubble {
	background: var(--otin-ai-violet-soft);
	border-color: rgba(150, 115, 255, 0.32);
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__msg--failed .otin-ai__bubble {
	border-style: dashed;
	border-color: var(--otin-ai-danger-line);
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__failed {
	margin-top: 6px;
	font-size: 0.8rem;
	color: var(--otin-ai-danger);
}

/* Typing indicator */
:is(.otin-ai, #otin-ai-scope) .otin-ai__typing .otin-ai__bubble {
	display: inline-flex;
	gap: 6px;
	padding: 16px 18px;
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--otin-ai-violet-text);
	animation: otin-ai-blink 1.2s infinite ease-in-out both;
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__dot:nth-child(2) { animation-delay: 0.15s; }
:is(.otin-ai, #otin-ai-scope) .otin-ai__dot:nth-child(3) { animation-delay: 0.3s; }

/* Quick replies */
:is(.otin-ai, #otin-ai-scope) .otin-ai__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-left: 52px;
	list-style: none;
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__chip {
	min-height: var(--otin-ai-touch);
	padding: 9px 16px;
	border: 1px solid var(--otin-ai-violet-line);
	border-radius: var(--otin-ai-radius-pill);
	background: var(--otin-ai-violet-soft);
	color: var(--otin-ai-text);
	font-size: 0.92rem;
	cursor: pointer;
	transition: background-color var(--otin-ai-dur-fast) ease;
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__chip:hover {
	background: rgba(124, 77, 255, 0.3);
}

/* --- Cards: notices, estimate, recap, forms ------------------------------- */

:is(.otin-ai, #otin-ai-scope) .otin-ai__card {
	margin-left: 52px;
	max-width: 640px;
	padding: 18px 20px;
	border: 1px solid var(--otin-ai-violet-line);
	border-radius: var(--otin-ai-radius-card);
	background: var(--otin-ai-surface-2);
	animation: otin-ai-rise var(--otin-ai-dur) var(--otin-ai-ease) both;
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__card--notice {
	border-color: var(--otin-ai-danger-line);
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__card--success {
	border-color: rgba(140, 230, 170, 0.55);
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__card-title {
	margin-bottom: 10px;
	font-size: 1.05rem;
	font-weight: 700;
	line-height: 1.3;
	color: var(--otin-ai-text);
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__card p + p,
:is(.otin-ai, #otin-ai-scope) .otin-ai__card p + dl,
:is(.otin-ai, #otin-ai-scope) .otin-ai__card p + form,
:is(.otin-ai, #otin-ai-scope) .otin-ai__card p + .otin-ai__actions,
:is(.otin-ai, #otin-ai-scope) .otin-ai__card dl + p,
:is(.otin-ai, #otin-ai-scope) .otin-ai__card dl + .otin-ai__actions {
	margin-top: 12px;
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__figure {
	font-size: 1.2rem;
	font-weight: 700;
	color: var(--otin-ai-text);
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__dl {
	display: grid;
	grid-template-columns: minmax(120px, 34%) 1fr;
	gap: 8px 16px;
	font-size: 0.92rem;
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__dl dt {
	color: var(--otin-ai-text-muted);
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__dl dd ul {
	padding-left: 1.1em;
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__budget-fit {
	margin-top: 12px;
	padding: 10px 14px;
	border-left: 3px solid var(--otin-ai-violet);
	background: var(--otin-ai-violet-soft);
	border-radius: 8px;
	font-size: 0.92rem;
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__budget-fit ul {
	margin-top: 6px;
	padding-left: 1.1em;
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__fine {
	font-size: 0.82rem;
	color: var(--otin-ai-text-muted);
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: var(--otin-ai-touch);
	padding: 10px 18px;
	border: 1px solid var(--otin-ai-border-strong);
	border-radius: var(--otin-ai-radius-pill);
	background: transparent;
	color: var(--otin-ai-text);
	font-size: 0.92rem;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	transition: background-color var(--otin-ai-dur-fast) ease, border-color var(--otin-ai-dur-fast) ease;
}

:is(.otin-ai, #otin-ai-scope) a.otin-ai__btn {
	text-decoration: none;
	color: var(--otin-ai-text);
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__btn:hover {
	border-color: var(--otin-ai-violet-text);
	background: var(--otin-ai-violet-soft);
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__btn--primary,
:is(.otin-ai, #otin-ai-scope) a.otin-ai__btn--primary {
	border-color: var(--otin-ai-violet);
	background: var(--otin-ai-violet-strong);
	color: #fff;
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__btn--primary:hover {
	background: var(--otin-ai-violet);
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__btn[aria-disabled="true"],
:is(.otin-ai, #otin-ai-scope) .otin-ai__btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

/* Forms inside cards */
:is(.otin-ai, #otin-ai-scope) .otin-ai__form {
	display: grid;
	gap: 14px;
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__field {
	display: grid;
	gap: 6px;
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__field label,
:is(.otin-ai, #otin-ai-scope) .otin-ai__check {
	font-size: 0.9rem;
	color: var(--otin-ai-text);
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__field input,
:is(.otin-ai, #otin-ai-scope) .otin-ai__field textarea {
	width: 100%;
	min-height: var(--otin-ai-touch);
	padding: 10px 12px;
	border: 1px solid var(--otin-ai-border-strong);
	border-radius: 12px;
	background: var(--otin-ai-field);
	color: var(--otin-ai-text);
	font-size: 1rem;
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__field textarea {
	min-height: 84px;
	resize: vertical;
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__field input:focus-visible,
:is(.otin-ai, #otin-ai-scope) .otin-ai__field textarea:focus-visible {
	outline: 2px solid var(--otin-ai-focus);
	outline-offset: 1px;
	border-color: transparent;
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__field [aria-invalid="true"] {
	border-color: var(--otin-ai-danger-line);
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__field-error {
	font-size: 0.82rem;
	color: var(--otin-ai-danger);
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__check {
	display: grid;
	grid-template-columns: 24px 1fr;
	gap: 10px;
	align-items: start;
	/* The whole label is the checkbox's target: keep it touch-sized. */
	min-height: var(--otin-ai-touch);
	padding-block: 10px;
	cursor: pointer;
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__check input {
	width: 20px;
	height: 20px;
	margin-top: 2px;
	accent-color: var(--otin-ai-violet);
}

/* --- Dialog (New Chat warning) ------------------------------------------- */

:is(.otin-ai, #otin-ai-scope) .otin-ai__dialog {
	max-width: min(420px, calc(100vw - 32px));
	padding: 24px;
	border: 1px solid var(--otin-ai-violet-line);
	border-radius: var(--otin-ai-radius-card);
	background: var(--otin-ai-surface-2);
	color: var(--otin-ai-text);
	font-family: var(--otin-ai-font);
	box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__dialog::backdrop {
	background: rgba(4, 3, 8, 0.7);
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__dialog-title {
	margin: 0 0 8px;
	font-size: 1.15rem;
	font-weight: 700;
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__dialog-body {
	margin: 0 0 20px;
	color: var(--otin-ai-text-muted);
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__dialog-actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 10px;
}

/* --- QA fixture toolbar (settings managers only) ------------------------- */

:is(.otin-ai, #otin-ai-scope) .otin-ai__fixtures {
	width: 100%;
	padding: 12px;
	border: 1px dashed rgba(255, 210, 120, 0.6);
	border-radius: 12px;
	font-size: 0.8rem;
	color: #ffe0a3;
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__fixtures-list {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 8px;
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__fixtures button {
	min-height: 32px;
	padding: 4px 10px;
	border: 1px solid rgba(255, 210, 120, 0.5);
	border-radius: 8px;
	background: transparent;
	color: #ffe0a3;
	font-size: 0.78rem;
	cursor: pointer;
}

/* --- Motion ---------------------------------------------------------------- */

@keyframes otin-ai-rise {
	from { opacity: 0; transform: translateY(8px); }
	to { opacity: 1; transform: none; }
}

@keyframes otin-ai-fade-in {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes otin-ai-blink {
	0%, 80%, 100% { opacity: 0.25; transform: scale(0.85); }
	40% { opacity: 1; transform: none; }
}


/* --- V1.2 interactive answers (Prompt 7) ------------------------------------
   One principal control under the latest question, inside the transcript.
   Near-black surfaces, subtle violet selection, 44px touch targets. */

:is(.otin-ai, #otin-ai-scope) .otin-ai__ui {
	margin-left: 52px;
	max-width: 640px;
	animation: otin-ai-rise var(--otin-ai-dur) var(--otin-ai-ease) both;
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__ui.is-pending {
	opacity: 0.6;
	pointer-events: none;
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__ui-form {
	display: grid;
	gap: 12px;
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__fieldset {
	display: grid;
	gap: 8px;
	margin: 0;
	padding: 0;
	border: 0;
	min-width: 0;
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__fieldset--grid {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__option {
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: var(--otin-ai-touch);
	padding: 10px 14px;
	border: 1px solid var(--otin-ai-border);
	border-radius: 14px;
	background: var(--otin-ai-surface-2);
	color: var(--otin-ai-text);
	font-size: 0.95rem;
	cursor: pointer;
	transition: border-color var(--otin-ai-dur-fast) ease, background-color var(--otin-ai-dur-fast) ease;
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__option:hover {
	border-color: var(--otin-ai-violet-line);
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__option:has(input:checked) {
	border-color: var(--otin-ai-violet);
	background: var(--otin-ai-violet-soft);
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__option:has(input:focus-visible) {
	outline: 2px solid var(--otin-ai-focus);
	outline-offset: 2px;
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__option input {
	flex: none;
	width: 18px;
	height: 18px;
	margin: 0;
	accent-color: var(--otin-ai-violet);
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__options {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__chip.is-selected {
	border-color: var(--otin-ai-violet);
	background: rgba(124, 77, 255, 0.34);
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__ui-footer {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 8px;
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__btn--ghost {
	border-color: var(--otin-ai-border);
	background: transparent;
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__slider {
	display: grid;
	gap: 10px;
	padding: 14px 16px;
	border: 1px solid var(--otin-ai-border);
	border-radius: 14px;
	background: var(--otin-ai-surface-2);
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__slider-value {
	justify-self: center;
	padding: 6px 18px;
	border: 1px solid var(--otin-ai-violet-line);
	border-radius: var(--otin-ai-radius-pill);
	color: var(--otin-ai-text);
	font-size: 1.05rem;
	font-weight: 600;
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__slider input[type="range"] {
	width: 100%;
	min-height: var(--otin-ai-touch);
	margin: 0;
	accent-color: var(--otin-ai-violet);
	cursor: pointer;
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__slider input[type="range"] {
	border-radius: var(--otin-ai-radius-pill);
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__slider input[type="range"]:focus-visible {
	outline: 2px solid var(--otin-ai-focus);
	outline-offset: 2px;
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__card--retry {
	padding: 12px 16px;
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__budget-custom {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__notice-line {
	margin-left: 52px;
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__link-btn {
	margin-left: 8px;
	padding: 0;
	border: 0;
	background: none;
	color: var(--otin-ai-violet-text);
	font: inherit;
	text-decoration: underline;
	cursor: pointer;
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__lines {
	display: grid;
	gap: 6px;
	margin: 10px 0;
	padding: 0;
	list-style: none;
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__lines li {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	border-bottom: 1px solid var(--otin-ai-border);
	padding-bottom: 6px;
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__line-amount {
	flex: none;
	color: var(--otin-ai-text-muted);
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__quote-items ul {
	margin: 4px 0 10px 18px;
}

@media (prefers-reduced-motion: reduce) {
	:is(.otin-ai, #otin-ai-scope) *,
	:is(.otin-ai, #otin-ai-scope) *::before,
	:is(.otin-ai, #otin-ai-scope) *::after {
		animation-duration: 0.001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.001ms !important;
		transition-delay: 0s !important;
		scroll-behavior: auto !important;
	}

	:is(.otin-ai, #otin-ai-scope) .otin-ai__dot {
		opacity: 0.8;
	}
}

/* --- Tablet ---------------------------------------------------------------- */

@media (min-width: 1101px) {
	:is(.otin-ai, #otin-ai-scope) .otin-ai__shortcuts > ul {
		flex-wrap: nowrap;
	}
}

@media (max-width: 1100px) {
	:is(.otin-ai, #otin-ai-scope) .otin-ai__shortcuts > ul {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		width: 100%;
		max-width: 640px;
		margin: 0 auto;
	}

	:is(.otin-ai, #otin-ai-scope) .otin-ai__shortcut {
		width: 100%;
	}

	:is(.otin-ai, #otin-ai-scope) .otin-ai__shortcut-arrow {
		margin-left: auto;
	}
}

/* --- Mobile (DRAFT breakpoints) -------------------------------------------- */

@media (max-width: 640px) {
	:is(.otin-ai, #otin-ai-scope) {
		--otin-ai-panel-height: clamp(360px, calc(100vh - 190px), 640px);
		padding: 28px 16px 24px;
	}

	@supports (height: 1dvh) {
		:is(.otin-ai, #otin-ai-scope) {
			--otin-ai-panel-height: clamp(340px, calc(100dvh - 190px), 640px);
		}
	}

	:is(.otin-ai, #otin-ai-scope) .otin-ai__backdrop {
		opacity: 0.7;
	}

	:is(.otin-ai, #otin-ai-scope) .otin-ai__inner {
		gap: 20px;
	}

	:is(.otin-ai, #otin-ai-scope) .otin-ai__headline {
		font-size: clamp(2rem, 9vw, 2.6rem);
	}

	:is(.otin-ai, #otin-ai-scope) .otin-ai__composer {
		padding-left: 14px;
	}

	:is(.otin-ai, #otin-ai-scope) .otin-ai__sparkle {
		width: 20px;
		height: 20px;
	}

	:is(.otin-ai, #otin-ai-scope) .otin-ai__shortcuts > ul {
		grid-template-columns: 1fr;
		gap: 10px;
	}

	:is(.otin-ai, #otin-ai-scope) .otin-ai__shortcut {
		min-height: 52px;
		padding: 10px 18px;
	}

	/* Expanded: compact header, left-aligned intro, full-width chat. */
	:is(.otin-ai, #otin-ai-scope):not([data-state="initial"]) {
		padding: 16px 12px 16px;
	}

	:is(.otin-ai, #otin-ai-scope):not([data-state="initial"]) .otin-ai__header {
		justify-content: space-between;
	}

	:is(.otin-ai, #otin-ai-scope):not([data-state="initial"]) .otin-ai__new-chat {
		position: static;
		transform: none;
	}

	:is(.otin-ai, #otin-ai-scope):not([data-state="initial"]) .otin-ai__mark {
		width: 28px;
		height: 28px;
	}

	:is(.otin-ai, #otin-ai-scope):not([data-state="initial"]) .otin-ai__intro {
		width: 100%;
		text-align: left;
	}

	:is(.otin-ai, #otin-ai-scope):not([data-state="initial"]) .otin-ai__headline {
		font-size: 1.35rem;
	}

	:is(.otin-ai, #otin-ai-scope):not([data-state="initial"]) .otin-ai__subline {
		font-size: 0.92rem;
	}

	:is(.otin-ai, #otin-ai-scope):not([data-state="initial"]) .otin-ai__inner {
		gap: 12px;
	}

	:is(.otin-ai, #otin-ai-scope):not([data-state="initial"]) .otin-ai__panel {
		padding: 8px;
		border-radius: 20px;
	}

	:is(.otin-ai, #otin-ai-scope) .otin-ai__log {
		gap: 14px;
		padding: 6px 2px 12px;
	}

	:is(.otin-ai, #otin-ai-scope) .otin-ai__msg {
		grid-template-columns: 32px minmax(0, 1fr);
		gap: 10px;
	}

	:is(.otin-ai, #otin-ai-scope) .otin-ai__avatar {
		width: 32px;
		height: 32px;
	}

	:is(.otin-ai, #otin-ai-scope) .otin-ai__avatar svg {
		width: 18px;
		height: 18px;
	}

	:is(.otin-ai, #otin-ai-scope) .otin-ai__bubble {
		padding: 11px 14px;
	}

	:is(.otin-ai, #otin-ai-scope) .otin-ai__chips,
	:is(.otin-ai, #otin-ai-scope) .otin-ai__card {
		margin-left: 0;
	}

	:is(.otin-ai, #otin-ai-scope) .otin-ai__card {
		padding: 16px;
	}

	:is(.otin-ai, #otin-ai-scope) .otin-ai__dl {
		grid-template-columns: 1fr;
		gap: 2px;
	}

	:is(.otin-ai, #otin-ai-scope) .otin-ai__dl dd {
		margin-bottom: 8px;
	}

	:is(.otin-ai, #otin-ai-scope) .otin-ai__actions .otin-ai__btn {
		flex: 1 1 100%;
	}
}

/* Very small screens: 2×2 shortcut grid (Appendix A3 alternative). */
@media (max-width: 400px) {
	:is(.otin-ai, #otin-ai-scope) .otin-ai__shortcuts > ul {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	:is(.otin-ai, #otin-ai-scope) .otin-ai__shortcut {
		flex-direction: column;
		align-items: flex-start;
		gap: 8px;
		min-height: 88px;
		padding: 14px;
		border-radius: 18px;
		font-size: 0.9rem;
		line-height: 1.25;
	}

	:is(.otin-ai, #otin-ai-scope) .otin-ai__shortcut-arrow {
		display: none;
	}
}

/* --- Narrow placements (container queries) ---------------------------------
   Same layouts as the viewport breakpoints above, keyed to the assistant's own
   content width so a narrow theme/Elementor column never clips the shortcuts.
   Thresholds = viewport breakpoints minus the section's side padding (DRAFT). */

@container otin-ai (max-width: 1020px) {
	:is(.otin-ai, #otin-ai-scope) .otin-ai__shortcuts > ul {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		flex-wrap: wrap;
		width: 100%;
		max-width: 640px;
		margin: 0 auto;
	}

	:is(.otin-ai, #otin-ai-scope) .otin-ai__shortcut {
		width: 100%;
	}

	:is(.otin-ai, #otin-ai-scope) .otin-ai__shortcut-arrow {
		margin-left: auto;
	}
}

@container otin-ai (max-width: 600px) {
	:is(.otin-ai, #otin-ai-scope) .otin-ai__shortcuts > ul {
		grid-template-columns: 1fr;
		gap: 10px;
	}

	:is(.otin-ai, #otin-ai-scope) .otin-ai__shortcut {
		min-height: 52px;
		padding: 10px 18px;
	}
}

@container otin-ai (max-width: 368px) {
	:is(.otin-ai, #otin-ai-scope) .otin-ai__shortcuts > ul {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	:is(.otin-ai, #otin-ai-scope) .otin-ai__shortcut {
		flex-direction: column;
		align-items: flex-start;
		gap: 8px;
		min-height: 88px;
		padding: 14px;
		border-radius: 18px;
		font-size: 0.9rem;
		line-height: 1.25;
	}

	:is(.otin-ai, #otin-ai-scope) .otin-ai__shortcut-arrow {
		display: none;
	}
}

/* Windows High Contrast / forced colours. */
@media (forced-colors: active) {
	:is(.otin-ai, #otin-ai-scope) .otin-ai__composer,
	:is(.otin-ai, #otin-ai-scope) .otin-ai__shortcut,
	:is(.otin-ai, #otin-ai-scope) .otin-ai__bubble,
	:is(.otin-ai, #otin-ai-scope) .otin-ai__card,
	:is(.otin-ai, #otin-ai-scope) .otin-ai__chip,
	:is(.otin-ai, #otin-ai-scope) .otin-ai__btn {
		border: 1px solid CanvasText;
	}
}

/* Bot challenge host: only visible when Cloudflare needs an interaction. */
:is(.otin-ai, #otin-ai-scope) .otin-ai__challenge {
	display: flex;
	justify-content: center;
	margin-block: var(--otin-ai-space-2, 0.5rem);
}

:is(.otin-ai, #otin-ai-scope) .otin-ai__challenge[hidden] {
	display: none;
}

/* V1.2 components on narrow columns / phones: full width; footer buttons share
   rows instead of one full-width row each; two-column checkboxes as in the
   Playbook mockup down to very narrow containers. */
@container otin-ai (max-width: 600px) {
	:is(.otin-ai, #otin-ai-scope) .otin-ai__ui,
	:is(.otin-ai, #otin-ai-scope) .otin-ai__notice-line {
		margin-left: 0;
	}

	:is(.otin-ai, #otin-ai-scope) .otin-ai__budget-custom {
		grid-template-columns: 1fr;
	}

	:is(.otin-ai, #otin-ai-scope) .otin-ai__option {
		padding: 10px 12px;
		font-size: 0.92rem;
	}

	:is(.otin-ai, #otin-ai-scope) .otin-ai__ui-footer .otin-ai__actions .otin-ai__btn {
		flex: 1 1 auto;
	}
}

@container otin-ai (max-width: 360px) {
	:is(.otin-ai, #otin-ai-scope) .otin-ai__fieldset--grid {
		grid-template-columns: 1fr;
	}
}
