/* Lumen 0.3.0.25 — Learning Centre palette, motion via transform + opacity only. */
.tai {
	--tai-bg: #0b0814;
	--tai-panel: #150e1f;
	--tai-panel-2: #1c1428;
	--tai-ink: #f4ecff;
	--tai-muted: #b7a7cc;
	--tai-line: rgba(255,255,255,.08);
	--tai-accent: #8e43f0;
	--tai-cyan: #5ec8ff;
	--tai-good: #7ee0b0;
	--tai-ease: cubic-bezier(.2,.7,.2,1);
	--tai-t: 220ms;
	--tai-t-slow: 320ms;
	--tai-font: Montserrat, "Helvetica Neue", Arial, sans-serif;
	color: var(--tai-ink);
	font-family: var(--tai-font);
	line-height: 1.55;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}
.tai[data-theme="light"] {
	--tai-bg: #f6f1fb;
	--tai-panel: #ffffff;
	--tai-panel-2: #efe7f8;
	--tai-ink: #1a1224;
	--tai-muted: #5c5268;
	--tai-line: rgba(21,14,31,.12);
	--tai-accent: #7a2ee0;
	--tai-cyan: #1578a8;
}

.tai *, .tai *::before, .tai *::after { box-sizing: border-box; }
.tai button, .tai textarea, .tai input { font: inherit; }
.tai a { color: var(--tai-cyan); text-underline-offset: 2px; }
.tai .screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0);
}

/* Full-bleed page block (JS may also pin it). */
body:has(.tai-page) .wp-block-post-title,
body:has(.tai-page) .entry-title,
body:has(.tai-page) .entry-header { display: none; }

.tai-page {
	background: var(--tai-bg);
	color: var(--tai-ink);
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
	width: 100vw;
	max-width: 100vw;
	padding: 0 0 32px;
}

.tai-hero {
	text-align: center;
	padding: 28px 20px 8px;
	max-width: 720px;
	margin: 0 auto;
}
.tai-eyebrow {
	letter-spacing: .16em;
	font-size: 12px;
	font-weight: 700;
	color: var(--tai-cyan);
	margin: 14px 0 8px;
}
.tai-title {
	font-size: clamp(24px, 3.6vw, 40px);
	line-height: 1.15;
	margin: 0 0 10px;
	font-weight: 700;
}
.tai-lead { color: var(--tai-muted); margin: 0 auto 8px; max-width: 36em; }

/* Bulb: slow float + 3s 2.5% breathe. Gold while thinking, brief flash when done. */
.tai-orbwrap {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 0;
	animation: tai-float 7s ease-in-out infinite;
	will-change: transform;
	cursor: default;
}
.tai-orbwrap::after {
	content: "";
	position: absolute;
	inset: -16px -14px -8px;
	border-radius: 50%;
	background: radial-gradient(circle at 50% 38%, rgba(142,67,240,.5) 0%, rgba(94,200,255,.22) 42%, transparent 70%);
	opacity: .35;
	transform: scale(.95);
	pointer-events: none;
	z-index: 0;
	animation: tai-breathe-glow 3s ease-in-out infinite;
	will-change: transform, opacity;
	transition: opacity 320ms ease-out, background 320ms ease-out;
}
.tai-orb {
	position: relative;
	z-index: 1;
	display: block;
	height: auto;
	animation: tai-breathe 3s ease-in-out infinite;
	transform-origin: 50% 38%;
	will-change: transform;
}
.tai-orb-lg { width: 80px; }
.tai-orb-md { width: 52px; }
.tai-orb-sm { width: 24px; }
.tai-bulb-warm, .tai-bulb-flash { opacity: 0; transition: opacity 320ms ease-out; pointer-events: none; }
.tai-orbwrap:hover::after { opacity: .62; }
.tai-orbwrap:hover .tai-orb { /* slight brighten; scale stays on the breathe animation */ }

/* Thinking: warm gold / amber, slightly faster pulse. */
.tai-thinking .tai-bulb-warm { opacity: 1; }
.tai-thinking .tai-orbwrap::after {
	background: radial-gradient(circle at 50% 38%, rgba(255,193,74,.7) 0%, rgba(240,160,32,.28) 46%, transparent 72%);
	animation: tai-think-glow 1.1s ease-in-out infinite;
}
.tai-thinking .tai-orb {
	animation: tai-think-orb 1.1s ease-in-out infinite;
}

/* Brief bright flash when an answer finishes. */
.tai-flash .tai-bulb-flash { opacity: .95; transition: opacity 160ms ease-out; }
.tai-flash .tai-orbwrap::after {
	background: radial-gradient(circle at 50% 38%, rgba(255,244,208,.9) 0%, rgba(255,193,74,.45) 48%, transparent 72%);
	opacity: .9;
	animation: none;
	transform: scale(1.12);
}
.tai-flash .tai-orb { animation: tai-flash-bulb 380ms ease-out; }

@keyframes tai-float {
	0%, 100% { transform: translate3d(0, 0, 0); }
	50% { transform: translate3d(0, -6px, 0); }
}
@keyframes tai-breathe {
	0%, 100% { transform: scale(1); }
	50% { transform: scale(1.025); }
}
@keyframes tai-breathe-glow {
	0%, 100% { opacity: .28; transform: scale(.95); }
	50% { opacity: .55; transform: scale(1.08); }
}
@keyframes tai-think-glow {
	0%, 100% { opacity: .4; transform: scale(.96); }
	50% { opacity: .9; transform: scale(1.16); }
}
@keyframes tai-think-orb {
	0%, 100% { transform: scale(1); }
	50% { transform: scale(1.03); }
}
@keyframes tai-flash-bulb {
	0% { transform: scale(1); }
	40% { transform: scale(1.08); }
	100% { transform: scale(1); }
}
@keyframes tai-enter {
	from { opacity: 0; transform: translate3d(0, 10px, 0); }
	to { opacity: 1; transform: translate3d(0, 0, 0); }
}


/* Layered ethereal glow: lavender halo + warmer inner light, slow breath, faint sparks. */
.tai-orbwrap::before {
	content: "";
	position: absolute;
	inset: -28px -24px -14px;
	border-radius: 50%;
	background: radial-gradient(circle at 50% 36%, rgba(142,67,240,.42) 0%, rgba(142,67,240,.12) 38%, transparent 68%);
	opacity: .45;
	transform: scale(.92);
	pointer-events: none;
	z-index: 0;
	animation: tai-halo 5.6s ease-in-out infinite;
}
.tai-orbwrap::after {
	/* tighten the inner wash so the two layers read as one soft lamp */
	inset: -12px -10px -6px;
	background: radial-gradient(circle at 50% 40%, rgba(255,214,140,.42) 0%, rgba(142,67,240,.28) 40%, rgba(94,200,255,.12) 58%, transparent 74%);
	animation: tai-breathe-glow 4.2s ease-in-out infinite;
}
.tai-bulb-filament {
	opacity: .55;
	animation: tai-filament 2.8s ease-in-out infinite;
}
.tai-bulb-shimmer {
	opacity: .25;
	stroke-dasharray: 18 22;
	stroke-dashoffset: 0;
	animation: tai-shimmer 6.5s ease-in-out infinite;
}
.tai-sparks {
	position: absolute;
	inset: 4% 10% 22%;
	pointer-events: none;
	z-index: 2;
	overflow: hidden;
}
.tai-sparks i {
	position: absolute;
	width: 3px;
	height: 3px;
	border-radius: 50%;
	background: #ffe9c4;
	box-shadow: 0 0 6px 1px rgba(255, 214, 140, .7);
	opacity: 0;
	animation: tai-spark 7.5s ease-in-out infinite;
}
.tai-sparks i:nth-child(1) { left: 28%; top: 58%; animation-delay: 0s; }
.tai-sparks i:nth-child(2) { left: 62%; top: 46%; animation-delay: 1.8s; width: 2px; height: 2px; }
.tai-sparks i:nth-child(3) { left: 44%; top: 30%; animation-delay: 3.4s; }
.tai-sparks i:nth-child(4) { left: 70%; top: 62%; animation-delay: 5.1s; width: 2px; height: 2px; }
/* Tiny marks (header, fab) keep the glow, drop the sparks so they do not clutter. */
.tai-orb-sm ~ .tai-sparks, .tai-orbwrap:has(.tai-orb-sm) .tai-sparks { display: none; }
.tai-thinking .tai-orbwrap::before {
	background: radial-gradient(circle at 50% 36%, rgba(255,193,74,.4) 0%, rgba(142,67,240,.14) 42%, transparent 70%);
	animation: tai-halo 3.2s ease-in-out infinite;
}
.tai-thinking .tai-bulb-filament { opacity: .9; animation-duration: 1.4s; }
@keyframes tai-halo {
	0%, 100% { opacity: .32; transform: scale(.9); }
	50% { opacity: .6; transform: scale(1.06); }
}
@keyframes tai-filament {
	0%, 100% { opacity: .4; }
	40% { opacity: .75; }
	55% { opacity: .5; }
	70% { opacity: .85; }
}
@keyframes tai-shimmer {
	0%, 100% { opacity: .15; stroke-dashoffset: 0; }
	50% { opacity: .7; stroke-dashoffset: -16; }
}
@keyframes tai-spark {
	0%, 12%, 100% { opacity: 0; transform: translate3d(0, 8px, 0) scale(.6); }
	25% { opacity: .7; }
	55% { opacity: .35; transform: translate3d(4px, -14px, 0) scale(1); }
	80% { opacity: 0; transform: translate3d(6px, -22px, 0) scale(.4); }
}

/* About Lumen panel */
.tai-about-link { margin: 12px 2px 0; }
.tai-about-open {
	appearance: none;
	background: none;
	border: 0;
	padding: 0;
	font: inherit;
	font-size: 12px !important;
	font-weight: 400 !important;
	letter-spacing: normal !important;
	text-transform: none !important;
	color: var(--tai-muted);
	text-decoration: underline;
	text-underline-offset: 2px;
	cursor: pointer;
	line-height: 1.45;
}
.tai-about-open:hover { color: var(--tai-ink); }
.tai-about {
	position: fixed;
	inset: 0;
	z-index: 80;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px 16px;
}
.tai-about[hidden] { display: none !important; }
.tai-about-back {
	position: absolute;
	inset: 0;
	background: rgba(6, 3, 12, .62);
}
.tai-about-card {
	position: relative;
	z-index: 1;
	width: min(440px, 100%);
	max-height: min(86dvh, 720px);
	overflow: auto;
	padding: 28px 26px 22px;
	border-radius: 18px;
	background: linear-gradient(180deg, #1a1228 0%, #120c1c 100%);
	border: 1px solid rgba(142,67,240,.35);
	box-shadow: 0 24px 60px rgba(0,0,0,.45), 0 0 40px rgba(142,67,240,.12);
	color: var(--tai-ink);
}
.tai-about-card .tai-orbwrap { display: flex; margin: 0 auto 10px; }
.tai-about-card h2 { margin: 0 0 10px; font-size: 22px; text-align: center; font-weight: 700; }
.tai-about-card h3 { margin: 18px 0 8px; font-size: 13px; font-weight: 600; color: var(--tai-cyan); letter-spacing: .02em; }
.tai-about-card p { margin: 0 0 10px; font-size: 14px; line-height: 1.55; color: var(--tai-ink); }
.tai-about-x { position: absolute; top: 8px; right: 8px; }
.tai-about-tiers { list-style: none; margin: 0 0 14px; padding: 0; border: 1px solid var(--tai-line); border-radius: 12px; overflow: hidden; }
.tai-about-tiers li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 12px; font-size: 13px; border-top: 1px solid var(--tai-line); }
.tai-about-tiers li:first-child { border-top: 0; }
.tai-about-tiers li span:last-child { color: var(--tai-muted); }
.tai-about-nudge { color: var(--tai-muted); font-size: 13px !important; }
.tai-about-close { margin-top: 8px; font-size: 13px !important; color: var(--tai-muted); }
html body .tai .tai-about-card, html body .tai .tai-about-card * {
	text-transform: none !important;
	letter-spacing: normal !important;
}

/* App shell */
.tai-app {
	max-width: 980px;
	margin: 12px auto 0;
	padding: 0 16px;
	position: relative;
}
.tai-shell {
	position: relative;
	background: var(--tai-panel);
	border: 1px solid var(--tai-line);
	border-radius: 20px;
	overflow: hidden;
	min-height: min(72vh, 820px);
	display: flex;
	flex-direction: column;
}
.tai-main { display: flex; flex-direction: column; flex: 1; min-width: 0; min-height: 0; position: relative; }

/* Sidebar slides with transform; overlay so the thread width never jumps. */
.tai-side {
	position: absolute;
	top: 0; left: 0; bottom: 0;
	width: min(300px, 86vw);
	background: var(--tai-panel-2);
	border-right: 1px solid var(--tai-line);
	z-index: 8;
	display: flex;
	flex-direction: column;
	padding: 14px 12px 16px;
	transform: translate3d(-105%, 0, 0);
	opacity: 0;
	pointer-events: none;
	transition: transform var(--tai-t-slow) var(--tai-ease), opacity var(--tai-t) var(--tai-ease);
	will-change: transform, opacity;
}
.tai-app.tai-side-open .tai-side {
	transform: translate3d(0, 0, 0);
	opacity: 1;
	pointer-events: auto;
}
.tai-side-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.tai-side-h h2 { font-size: 14px; letter-spacing: .01em; text-transform: none; margin: 0; }
.tai-chats { list-style: none; margin: 0; padding: 0; overflow: auto; flex: 1; }
.tai-chats li { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.tai-chats button.tai-chat-open {
	flex: 1; text-align: left; background: transparent; color: var(--tai-ink);
	border: 0; border-radius: 10px; padding: 8px 10px; cursor: pointer;
	overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
	transition: transform 180ms var(--tai-ease), opacity 180ms var(--tai-ease);
}
.tai-chats button.tai-chat-open:hover { transform: translate3d(3px, 0, 0); }
.tai-chats li.is-on button.tai-chat-open { background: rgba(142,67,240,.18); }
.tai-chats .tai-chat-del { opacity: .55; }
.tai-chats .tai-chat-del, .tai-chats .tai-chat-ren {
	position: relative;
	z-index: 2;
	flex: 0 0 auto;
	pointer-events: auto;
}

.tai-bar {
	display: flex; align-items: center; justify-content: space-between;
	gap: 10px; padding: 10px 14px;
	border-bottom: 1px solid var(--tai-line);
	background: rgba(0,0,0,.12);
}
.tai[data-theme="light"] .tai-bar { background: rgba(255,255,255,.4); }
.tai-bar-name { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.tai-bar-tools { display: flex; gap: 6px; }

.tai-thread {
	flex: 1;
	overflow: auto;
	padding: 18px 16px 8px;
	scroll-behavior: smooth;
	overscroll-behavior: auto;
}
.tai-welcome { text-align: center; padding: 12px 8px 20px; }
.tai-hello { max-width: 38em; margin: 12px auto 18px; color: var(--tai-muted); }

/* Lumen wordmark: thin Montserrat, lavender-to-amber wash, a slow light sweep. */
html body .tai .tai-wordmark {
	display: inline-flex !important;
	flex-direction: column;
	align-items: flex-start;
	gap: 0;
}
.tai-wordmark-row {
	display: inline-flex;
	align-items: flex-start;
	gap: 0.45em;
}
html body .tai .tai-wordmark-text {
	display: inline-block;
	font-family: Montserrat, "Helvetica Neue", Arial, sans-serif !important;
	font-weight: 300 !important;
	letter-spacing: 0.16em !important;
	text-transform: none !important;
	font-variant-caps: normal !important;
	line-height: 1.1;
}
html body .tai .tai-wordmark-text {
	background: linear-gradient(105deg, #f4ecff 0%, #c9a6ff 32%, #ffd56a 78%, #f7e7c2 100%);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
	-webkit-text-fill-color: transparent;
	filter: drop-shadow(0 0 10px rgba(142,67,240,.35)) drop-shadow(0 0 18px rgba(255,213,106,.18));
}
.tai-wordmark { position: relative; display: inline-flex !important; flex-direction: column; align-items: flex-start; gap: 0; vertical-align: middle; overflow: visible; }
.tai-wordmark-clip { position: relative; display: inline-block; overflow: hidden; }
.tai-wordmark-hero { margin: 14px 0 2px; position: relative; padding-top: 1.35em; }
html body .tai .tai-wordmark-hero .tai-wordmark-row { gap: 0.12em; }
html body .tai .tai-wordmark-hero .tai-wordmark-text {
	font-size: clamp(42px, 8vw, 72px) !important;
	letter-spacing: 0.2em !important;
	font-weight: 200 !important;
	padding: 0 0.05em;
}
html body .tai .tai-wordmark-side .tai-wordmark-text,
html body .tai .tai-wordmark-bar .tai-wordmark-text {
	font-size: 15px !important;
	letter-spacing: 0.14em !important;
	font-weight: 300 !important;
	filter: drop-shadow(0 0 6px rgba(142,67,240,.3));
}
.tai-wordmark-clip::after {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	left: -40%;
	width: 40%;
	background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent);
	transform: skewX(-20deg);
	animation: tai-word-sweep 8.5s ease-in-out infinite;
	pointer-events: none;
	mix-blend-mode: soft-light;
}
@keyframes tai-word-sweep {
	0%, 18% { transform: skewX(-20deg) translate3d(0, 0, 0); opacity: 0; }
	28% { opacity: .7; }
	48%, 100% { transform: skewX(-20deg) translate3d(320%, 0, 0); opacity: 0; }
}


html body .tai .tai-kicker {
	display: block;
	font-family: Montserrat, "Helvetica Neue", Arial, sans-serif !important;
	font-weight: 300 !important;
	letter-spacing: 0.32em !important;
	text-transform: none !important;
	font-variant-caps: normal !important;
	font-size: 8px !important;
	line-height: 1.2 !important;
	color: rgba(228, 216, 255, 0.72);
	-webkit-text-fill-color: rgba(228, 216, 255, 0.72);
	background: none;
	filter: none;
	margin: 0 0 0.12em 0.06em;
}
html body .tai .tai-wordmark-hero .tai-kicker {
	position: absolute;
	left: 0.1em;
	top: 0;
	font-size: 13px !important;
	letter-spacing: 0.4em !important;
	font-weight: 300 !important;
	margin: 0;
	color: rgba(232, 222, 255, 0.74);
	-webkit-text-fill-color: rgba(232, 222, 255, 0.74);
	pointer-events: none;
	animation: tai-kicker-play 4.9s cubic-bezier(.2,.7,.2,1) 1 forwards;
}
@keyframes tai-kicker-play {
	0%   { opacity: 0; transform: translate3d(0, 10px, 0); }
	18.4% { opacity: 1; transform: translate3d(0, 0, 0); }
	79.6% { opacity: 1; transform: translate3d(0, 0, 0); }
	100% { opacity: 0; transform: translate3d(0, -4px, 0); visibility: hidden; }
}
html body .tai .tai-wordmark-side .tai-kicker,
html body .tai .tai-wordmark-bar .tai-kicker {
	font-size: 8px !important;
	letter-spacing: 0.28em !important;
	margin: 0 0 0.08em 0.04em;
}
html body .tai .tai-beta {
	display: inline-block;
	flex: 0 0 auto;
	align-self: flex-start;
	margin-top: 0;
	transform: translate(0.06em, -0.35em);
	padding: 2px 7px 3px;
	border-radius: 999px;
	border: 1px solid rgba(201,166,255,.55);
	box-shadow: 0 0 8px rgba(255,213,106,.2), inset 0 0 6px rgba(142,67,240,.12);
	background: rgba(20, 12, 32, .35);
	color: #e6d7ff;
	font-family: Montserrat, "Helvetica Neue", Arial, sans-serif !important;
	font-size: 9px !important;
	font-weight: 400 !important;
	letter-spacing: 0.08em !important;
	text-transform: none !important;
	font-variant-caps: normal !important;
	line-height: 1.2 !important;
	white-space: nowrap;
}
html body .tai .tai-wordmark-hero .tai-beta {
	margin-top: 0;
	font-size: 10px !important;
	padding: 2px 8px 3px;
	border-color: rgba(201,166,255,.6);
	transform: translate(0.1em, -0.45em);
}
html body .tai .tai-wordmark-side .tai-beta,
html body .tai .tai-wordmark-bar .tai-beta {
	margin-top: 0;
	font-size: 8px !important;
	padding: 1px 5px 2px;
	transform: translate(0.04em, -0.28em);
}
@media (prefers-reduced-motion: reduce) {
	.tai-wordmark-clip::after { display: none; animation: none; }
	html body .tai .tai-wordmark-hero .tai-kicker {
		animation-name: tai-kicker-fade;
		animation-duration: 4.9s;
		animation-timing-function: ease;
	}
	@keyframes tai-kicker-fade {
		0% { opacity: 0; }
		18.4% { opacity: 1; }
		79.6% { opacity: 1; }
		100% { opacity: 0; visibility: hidden; }
	}
}

.tai-starters { display: flex; flex-direction: column; gap: 14px; text-align: left; max-width: 640px; margin: 0 auto; }
.tai-topic { }
.tai-topic h3 { font-size: 11px; letter-spacing: .01em; text-transform: none; color: var(--tai-cyan); margin: 0 0 8px; font-weight: 700; }
.tai-topic-chips { display: flex; flex-wrap: wrap; gap: 8px; }

.tai-chip, .tai-iconbtn, .tai-send, .tai-fab, .tai-src, .tai-follow button, .tai-tool, .tai-act {
	appearance: none;
	border: 1px solid var(--tai-line);
	background: rgba(142,67,240,.12);
	color: var(--tai-ink);
	border-radius: 999px;
	padding: 7px 12px;
	cursor: pointer;
	transition: transform 180ms var(--tai-ease), opacity 180ms var(--tai-ease);
	will-change: transform;
}
.tai-chip:hover, .tai-iconbtn:hover, .tai-send:hover, .tai-fab:hover, .tai-src:hover, .tai-follow button:hover, .tai-tool:hover, .tai-act:hover {
	transform: translate3d(0, -1px, 0);
	opacity: .95;
}
.tai-chip:active, .tai-iconbtn:active, .tai-send:active, .tai-fab:active, .tai-src:active, .tai-follow button:active, .tai-tool:active, .tai-act:active {
	transform: scale(.96);
}
.tai-chip.is-on { background: rgba(94,200,255,.2); border-color: rgba(94,200,255,.45); }
.tai-iconbtn[data-tai-mute][aria-pressed="true"] { opacity: .55; }
.tai-iconbtn {
	background: transparent;
	padding: 6px 10px;
	font-size: 13px;
}
.tai-iconbtn:disabled, .tai-send:disabled, .tai-chip:disabled { opacity: .4; cursor: default; transform: none; }
.tai-send {
	background: var(--tai-accent);
	border-color: transparent;
	color: #fff;
	font-weight: 700;
	padding: 8px 16px;
}

.tai-msgs { display: flex; flex-direction: column; gap: 16px; }
.tai-msg {
	display: flex; gap: 10px; align-items: flex-start;
	opacity: 0;
	transform: translate3d(0, 10px, 0);
	animation: tai-enter var(--tai-t) var(--tai-ease) forwards;
	will-change: transform, opacity;
}
.tai-msg.is-user { flex-direction: row-reverse; }
.tai-msg .tai-bubble {
	max-width: min(100%, 640px);
	background: var(--tai-panel-2);
	border: 1px solid var(--tai-line);
	border-radius: 16px;
	padding: 12px 14px;
}
.tai-msg.is-user .tai-bubble {
	background: rgba(142,67,240,.2);
}
.tai-bar-name .tai-orbwrap,
.tai-msg .tai-orbwrap { cursor: pointer; }
.tai-msg .tai-orbwrap { flex: 0 0 auto; margin-top: 2px; }
.tai-md { overflow-wrap: break-word; word-break: break-word; }
.tai-md p { margin: 0 0 .7em; }
.tai-md p:last-child { margin-bottom: 0; }
.tai-md ul, .tai-md ol { margin: 0 0 .7em; padding-left: 1.2em; }
.tai-md table { width: 100%; border-collapse: collapse; margin: 0 0 .7em; font-size: 14px; }
.tai-md th, .tai-md td { border: 1px solid var(--tai-line); padding: 6px 8px; text-align: left; }
.tai-md a { word-break: break-word; }
.tai-cite {
	display: inline-flex; align-items: center; justify-content: center;
	min-width: 1.4em; height: 1.4em; padding: 0 4px; margin: 0 1px;
	border-radius: 999px; background: rgba(94,200,255,.2);
	color: var(--tai-cyan); font-size: 11px; font-weight: 700; text-decoration: none;
	transform: translate3d(0, 0, 0);
	transition: transform 160ms var(--tai-ease), opacity 160ms var(--tai-ease), box-shadow 160ms var(--tai-ease);
	border: 0;
	appearance: none;
	-webkit-appearance: none;
	font-family: inherit;
	line-height: 1;
	cursor: default;
}
html body .tai a.tai-cite,
html body .tai button.tai-cite,
html body .tai a.tai-src,
html body .tai button.tai-src,
html body .tai a.tai-tool,
html body .tai .tai-more a {
	cursor: pointer;
}
html body .tai a.tai-cite:hover,
html body .tai button.tai-cite:hover {
	transform: translate3d(0, -1px, 0);
}
html body .tai .tai-cite.tai-core,
html body .tai .tai-src.is-nolink {
	cursor: default;
}
html body .tai .tai-src.is-flash {
	outline: 2px solid var(--tai-cyan);
	box-shadow: 0 0 0 4px rgba(94,200,255,.28);
}

.tai-sources, .tai-follow, .tai-tools, .tai-actions {
	display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px;
}
.tai-src, .tai-tool, .tai-follow button, .tai-act {
	font-size: 13px; text-decoration: none; display: inline-flex; align-items: center;
	background: rgba(94,200,255,.08);
}
.tai-src, .tai-tool { border-radius: 12px; }
html body .tai a.tai-src,
html body .tai button.tai-src {
	position: relative;
	z-index: 1;
	pointer-events: auto;
	flex-direction: column;
	align-items: flex-start;
	gap: 2px;
	text-align: left;
	border: 0;
	font-family: inherit;
	color: inherit;
	appearance: none;
	-webkit-appearance: none;
	max-width: 100%;
}
html body .tai .tai-src-dest {
	display: block;
	font-size: 11px;
	font-weight: 400;
	line-height: 1.3;
	opacity: .78;
}
.tai-src, .tai-follow button, .tai-tool {
	opacity: 0;
	transform: translate3d(0, 8px, 0);
	animation: tai-enter 280ms var(--tai-ease) forwards;
	animation-delay: calc(var(--i, 0) * 55ms);
}
.tai-actions { margin-top: 8px; }
.tai-act { background: transparent; font-size: 12px; opacity: .8; }

.tai-composer {
	padding: 8px 14px 12px;
	border-top: 1px solid var(--tai-line);
	background: var(--tai-panel);
}
.tai-modes { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.tai-form {
	display: flex; align-items: flex-end; gap: 8px;
	background: var(--tai-panel-2);
	border: 1px solid var(--tai-line);
	border-radius: 16px;
	padding: 8px 8px 8px 12px;
	transition: transform 200ms var(--tai-ease), opacity 200ms var(--tai-ease);
}
.tai-form:focus-within { transform: translate3d(0, -1px, 0); }
.tai-in {
	flex: 1; width: 100%;
	background: transparent; color: var(--tai-ink);
	border: 0; outline: none; resize: none;
	min-height: 24px; max-height: 160px;
	line-height: 1.45; padding: 6px 0;
	/* No scrollbar while the text fits (the animated placeholder can wrap past one line on narrow screens).
	   grow() in JS switches overflow-y to auto only when typed text is taller than max-height. */
	overflow-x: hidden; overflow-y: hidden;
	/* Height is set instantly in JS — no height animation, no layout jank. */
}
.tai-form-actions { display: flex; align-items: center; gap: 4px; }
.tai-hint { font-size: 12px; color: var(--tai-muted); margin: 8px 2px 0; }
.tai-hint a { color: var(--tai-cyan); }


.tai-menuwrap { position: relative; }
.tai-menu {
	position: absolute;
	right: 0;
	top: calc(100% + 8px);
	width: min(280px, 80vw);
	background: var(--tai-panel-2);
	border: 1px solid var(--tai-line);
	border-radius: 16px;
	padding: 12px;
	z-index: 12;
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 6px;
	opacity: 0;
	transform: translate3d(0, -8px, 0);
	pointer-events: none;
	transition: transform 220ms var(--tai-ease), opacity 220ms var(--tai-ease);
}
.tai-menu.is-open { opacity: 1; transform: translate3d(0, 0, 0); pointer-events: auto; }
.tai-menu .tai-chip, .tai-menu .tai-iconbtn { border-radius: 12px; text-align: left; }
.tai-menu-label {
	margin: 8px 2px 2px;
	font-size: 11px;
	letter-spacing: .12em;
	text-transform: none;
	color: var(--tai-cyan);
	font-weight: 700;
}
.tai-menu-label:first-child { margin-top: 0; }
.tai-moreqs {
	appearance: none;
	background: transparent;
	border: 0;
	color: var(--tai-cyan);
	cursor: pointer;
	padding: 8px 4px;
	font: inherit;
	font-size: 13px;
	transition: opacity 180ms var(--tai-ease), transform 180ms var(--tai-ease);
}
.tai-moreqs:hover { transform: translate3d(0, -1px, 0); }
.tai-more-panel { margin-top: 12px; display: flex; flex-direction: column; gap: 14px; text-align: left; }
.tai-featured { justify-content: center; }

/* Widget */
.tai-widget { position: relative; }
.tai-fab {
	position: fixed; right: 18px; bottom: 18px; z-index: 40;
	display: inline-flex; align-items: center; gap: 8px;
	box-shadow: none;
}
.tai-pop {
	position: fixed; right: 16px; bottom: 76px; z-index: 41;
	width: min(420px, calc(100vw - 24px));
	transform: translate3d(0, 12px, 0);
	opacity: 0;
	pointer-events: none;
	transition: transform var(--tai-t) var(--tai-ease), opacity var(--tai-t) var(--tai-ease);
}
.tai-pop.is-open { transform: translate3d(0, 0, 0); opacity: 1; pointer-events: auto; }
.tai-pop .tai-app { padding: 0; max-width: none; }
.tai-pop .tai-shell { min-height: min(70vh, 640px); max-height: 80vh; }
.tai-pop-h {
	display: flex; justify-content: space-between; align-items: center;
	padding: 8px 12px; background: var(--tai-panel); border: 1px solid var(--tai-line);
	border-bottom: 0; border-radius: 16px 16px 0 0;
}
.tai-pop .tai-shell { border-radius: 0 0 16px 16px; }

.tai-share { background: var(--tai-bg); color: var(--tai-ink); padding: 24px 16px; }
.tai-share-m { margin: 16px 0; padding: 12px 14px; background: var(--tai-panel); border-radius: 12px; }
.tai-share-foot { color: var(--tai-muted); }

/* Mobile full-screen chat */
@media (max-width: 640px) {
	.tai-page { padding-bottom: 0; }
	.tai-hero { padding: 16px 16px 4px; }
	.tai-title { font-size: 28px; }
	.tai-app { padding: 0; margin: 8px 0 0; max-width: none; }
	.tai-bar { padding: 8px 8px; gap: 6px; }
	.tai-bar-name span { font-size: 14px; }
	.tai-iconbtn { padding: 6px 8px; font-size: 12px; }
	.tai-bar-tools { gap: 2px; flex: 1; justify-content: flex-end; min-width: 0; }
	.tai-shell {
		border-radius: 16px 16px 0 0;
		min-height: calc(100dvh - 80px);
		border-left: 0; border-right: 0; border-bottom: 0;
	}
	.tai-thread { padding: 14px 12px 6px; }
	.tai-composer { padding: 8px 10px calc(10px + env(safe-area-inset-bottom, 0px)); }
	.tai-modes { gap: 6px; }
	.tai-chip { font-size: 12px; padding: 6px 10px; }
	.tai-fab { right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
	.tai-pop { right: 0; left: 0; bottom: 0; width: 100vw; }
	.tai-pop .tai-shell, .tai-pop-h { border-radius: 0; }
	.tai-pop .tai-shell { max-height: none; min-height: calc(100dvh - 48px); }
}

@media (prefers-reduced-motion: reduce) {
	.tai *, .tai *::before, .tai *::after {
		animation: none !important;
		transition: none !important;
		scroll-behavior: auto !important;
	}
	.tai-orbwrap, .tai-orb, .tai-orbwrap::before, .tai-orbwrap::after, .tai-msg, .tai-src, .tai-follow button, .tai-tool, .tai-form {
		opacity: 1;
		transform: none;
	}
	.tai-sparks, .tai-bulb-shimmer { display: none; }
	.tai-bulb-filament { opacity: .6; }
	.tai-bulb-flash, .tai-flash .tai-bulb-flash, .tai-flash .tai-orbwrap::after, .tai-flash .tai-orb {
		opacity: 0;
		transform: none;
		animation: none !important;
	}
	.tai-thinking .tai-bulb-warm { opacity: 1; }
	.tai-side {
		opacity: 0;
		transform: translate3d(-105%, 0, 0);
		pointer-events: none;
	}
	.tai-app.tai-side-open .tai-side {
		opacity: 1;
		transform: none;
		pointer-events: auto;
	}
	.tai-pop { opacity: 0; transform: translate3d(0, 12px, 0); }
	.tai-pop.is-open { opacity: 1; transform: none; }
	.tai-menu { opacity: 0; transform: none; }
	.tai-menu.is-open { opacity: 1; }
}


/* Start screen: bulb, one line, the box, two prompts. */
.tai-app.tai-empty .tai-shell {
	background: transparent;
	border-color: transparent;
	min-height: min(72vh, 760px);
}
.tai-app.tai-empty .tai-main {
	justify-content: center;
}
.tai-app.tai-empty .tai-bar {
	position: absolute;
	top: 8px;
	right: 8px;
	left: auto;
	background: transparent;
	border: 0;
	padding: 0;
	z-index: 9;
	width: auto;
	justify-content: flex-end;
}
.tai-app.tai-empty .tai-bar-name { display: none; }
.tai-app.tai-empty .tai-thread { overflow: visible; padding: 12px 8px 0; flex: 0 0 auto; }
.tai-app.tai-empty .tai-welcome {
	padding: 36px 8px 8px;
	display: flex;
	flex-direction: column;
	align-items: center;
}
.tai-app.tai-empty .tai-hello {
	font-size: clamp(20px, 3vw, 28px);
	font-weight: 600;
	color: var(--tai-ink);
	margin: 16px 0 0;
	max-width: none;
}
.tai-app.tai-empty .tai-composer {
	border-top: 0;
	background: transparent;
	max-width: 640px;
	margin: 0 auto;
	width: 100%;
}
.tai-app.tai-empty .tai-starters { width: 100%; max-width: 640px; margin: 14px auto 0; }
.tai-app.tai-empty .tai-featured { justify-content: center; }
.tai-app.tai-empty .tai-hint:empty { display: none; }

.tai-menubtn {
	width: 40px;
	height: 40px;
	padding: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
}
.tai-kebab {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 3px;
	width: 16px;
}
.tai-kebab i {
	display: block;
	width: 16px;
	height: 2px;
	border-radius: 1px;
	background: currentColor;
	opacity: .9;
}
.tai-ideas {
	display: flex;
	flex-direction: column;
	gap: 10px;
	max-height: 240px;
	overflow: auto;
	padding: 4px 0 6px;
}
.tai-menu-note { font-size: 12px; color: var(--tai-muted); margin: 8px 2px 0; }

/* Invite glow on the question box: a slow, quiet wash. Opacity only — no scale — so it never pulses or flashes. */
.tai-form { position: relative; }
.tai-form.tai-invite::before {
	content: "";
	position: absolute;
	inset: -4px;
	border-radius: 20px;
	background: radial-gradient(circle at 50% 50%, rgba(142,67,240,.15) 0%, rgba(94,200,255,.07) 40%, transparent 58%);
	opacity: .13;
	transform: none;
	pointer-events: none;
	z-index: 0;
	animation: tai-invite 10s ease-in-out infinite;
	will-change: opacity;
}
.tai-form.tai-invite { z-index: 1; }
.tai-form > * { position: relative; z-index: 1; }
@keyframes tai-invite {
	0%, 100% { opacity: .08; }
	50% { opacity: .16; }
}

@media (max-width: 640px) {
	.tai-app.tai-empty .tai-welcome { padding: 28px 8px 4px; }
	.tai-app.tai-empty .tai-shell { min-height: calc(100dvh - 80px); }
}

@media (prefers-reduced-motion: reduce) {
	.tai-form.tai-invite::before {
		animation: none !important;
		opacity: .12;
		transform: none;
	}
}

/* ========== 0.3.0.1: full-width shell, persistent sidebar, usage ========== */
.tai-page {
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
	width: 100vw;
	max-width: 100vw;
	padding: 0;
}
.tai-app {
	max-width: none;
	margin: 0;
	padding: 0;
}
.tai-shell,
.tai-app.tai-empty .tai-shell {
	background: transparent;
	border: 0;
	border-radius: 0;
	overflow: visible;
	min-height: calc(100dvh - 4rem);
	flex-direction: row;
	align-items: stretch;
}
.tai-app:not(.tai-empty) .tai-shell { background: transparent; }

/* Desktop: sidebar always in the flow, 272px. */
@media (min-width: 900px) {
	.tai-side,
	.tai-app.tai-empty .tai-side,
	.tai-app.tai-side-open .tai-side,
	.tai-app:not(.tai-side-open) .tai-side {
		position: relative;
		top: auto; left: auto; bottom: auto;
		width: 272px;
		flex: 0 0 272px;
		transform: none;
		opacity: 1;
		pointer-events: auto;
		background: var(--tai-panel-2);
		border-right: 1px solid var(--tai-line);
		min-height: calc(100dvh - 4rem);
	}
	.tai-side-toggle { display: none !important; }
	.tai-app.tai-empty .tai-bar {
		position: relative;
		top: auto;
		right: auto;
		left: auto;
		width: auto;
		justify-content: flex-end;
		background: transparent;
		border: 0;
		padding: 10px 16px 0;
	}
	.tai-app.tai-empty .tai-bar-name { display: none; }
}

.tai-main { flex: 1; min-width: 0; }
.tai-side { overflow: hidden; }
.tai-side button.tai-newchat {
	display: block;
	width: 100%;
	box-sizing: border-box;
	appearance: none;
	-webkit-appearance: none;
	margin: 2px 0 12px;
	padding: 4px 10px;
	min-height: 0;
	height: auto;
	line-height: 1.3;
	border-radius: 999px;
	border: 1px solid var(--tai-line);
	background: transparent;
	color: var(--tai-muted);
	font-family: inherit;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .04em;
	cursor: pointer;
	text-align: center;
	box-shadow: none;
	transition: background 180ms var(--tai-ease, ease-out), color 180ms var(--tai-ease, ease-out);
}
.tai-side button.tai-newchat:hover,
.tai-side button.tai-newchat:focus {
	background: rgba(142,67,240,.16);
	color: var(--tai-ink);
	outline: none;
}
.tai-side-h { margin-bottom: 4px; }
.tai-side-label {
	font-size: 11px;
	letter-spacing: .08em;
	text-transform: none;
	color: var(--tai-muted);
	margin: 14px 2px 8px;
	font-weight: 600;
}
.tai-usage {
	padding: 10px 10px 12px;
	border: 1px solid var(--tai-line);
	border-radius: 14px;
	background: rgba(0,0,0,.16);
	margin: 0 0 4px;
}
.tai[data-theme="light"] .tai-usage { background: rgba(255,255,255,.45); }
.tai-level { margin: 0 0 6px; font-size: 14px; font-weight: 600; }
.tai-level a { color: inherit; text-decoration: none; }
.tai-level a:hover { color: var(--tai-accent, #c9a6ff); }
.tai-usage-count { margin: 0 0 8px; font-size: 12px; color: var(--tai-muted); }
.tai-usage-bar {
	height: 4px;
	border-radius: 99px;
	background: rgba(255,255,255,.1);
	overflow: hidden;
	margin: 0 0 8px;
}
.tai[data-theme="light"] .tai-usage-bar { background: rgba(20,10,30,.12); }
.tai-usage-bar i {
	display: block;
	height: 100%;
	border-radius: 99px;
	background: linear-gradient(90deg, #8e43f0, #5ec8ff);
}
.tai-usage-note { margin: 0; font-size: 12px; color: var(--tai-muted); line-height: 1.45; }
.tai-usage-note a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.tai-usage-note a:hover { color: var(--tai-ink); }
/* Upgrade / member signup: one clear button, not a banner. */
html body .tai a.tai-cta,
html body .tai .tai-cta {
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: 100%;
	margin: 10px 0 0;
	padding: 10px 14px;
	border: 0;
	border-radius: 12px;
	font-family: inherit !important;
	font-size: 13px !important;
	font-weight: 700 !important;
	line-height: 1.2 !important;
	letter-spacing: 0.01em;
	text-align: center;
	text-decoration: none !important;
	color: #fff !important;
	background: linear-gradient(135deg, #8e43f0, #6300e2);
	box-shadow: 0 8px 20px rgba(99, 0, 226, 0.28);
	cursor: pointer;
	transition: filter 0.15s ease, transform 0.15s ease;
}
html body .tai a.tai-cta:hover,
html body .tai a.tai-cta:focus {
	filter: brightness(1.1);
	color: #fff !important;
	transform: translateY(-1px);
	outline: none;
}
html body .tai a.tai-cta:focus-visible {
	outline: 2px solid var(--tai-sky, #5ec8ff);
	outline-offset: 2px;
}
.tai-menu-cta { margin: 0 0 4px; }
.tai-menu-cta:empty { display: none; }
.tai-menu a.tai-cta { margin: 0; }
.tai-upgrade {
	margin-top: 8px;
	padding: 8px 10px;
	border-radius: 10px;
	border: 1px solid rgba(142,67,240,.35);
	background: rgba(142,67,240,.1);
}
.tai-upgrade p { margin: 0; font-size: 12px; line-height: 1.45; color: var(--tai-ink); }
.tai-upgrade a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.tai-chats .tai-chat-ren { opacity: .45; font-size: 13px; }
.tai-chats li:hover .tai-chat-ren, .tai-chats li:hover .tai-chat-del { opacity: .9; }

.tai-cite { text-decoration: none; }
.tai-src.is-nolink { cursor: default; opacity: .7; }
.tai-src.is-nolink:hover,
.tai-src.is-nolink:active { transform: none; }

/* Mobile: sidebar stays a slide-in drawer behind the menu button. */
@media (max-width: 899px) {
	.tai-shell,
	.tai-app.tai-empty .tai-shell {
		flex-direction: column;
		min-height: calc(100dvh - 2rem);
	}
	.tai-side-toggle { display: inline-flex; }
	.tai-app.tai-empty .tai-bar {
		position: relative;
		justify-content: space-between;
		background: transparent;
		border: 0;
		padding: 8px 10px 0;
	}
	.tai-app.tai-empty .tai-bar-name { display: none; }
	.tai-side {
		position: fixed;
		top: 0; left: 0; bottom: 0;
		width: min(280px, 86vw);
		z-index: 20;
		transform: translate3d(-105%, 0, 0);
		opacity: 0;
		pointer-events: none;
		background: var(--tai-panel-2);
		box-shadow: 16px 0 40px rgba(0,0,0,.35);
	}
	.tai-app.tai-side-open .tai-side {
		transform: translate3d(0, 0, 0);
		opacity: 1;
		pointer-events: auto;
	}
}

@media (prefers-reduced-motion: reduce) {
	@media (min-width: 900px) {
		.tai-side,
		.tai-app:not(.tai-side-open) .tai-side {
			opacity: 1 !important;
			transform: none !important;
			pointer-events: auto !important;
		}
	}
}

/* Keep the top bar at the top; centre only the start cluster under it. */
.tai-app.tai-empty .tai-main {
	justify-content: flex-start;
}
.tai-app.tai-empty .tai-thread { margin-top: auto; }
.tai-app.tai-empty .tai-composer { margin-bottom: auto; }
.tai-side-ico {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 3px;
	width: 16px;
}
.tai-side-ico i {
	display: block;
	height: 2px;
	border-radius: 1px;
	background: currentColor;
	opacity: .9;
}
.tai-side-ico i:nth-child(1) { width: 16px; }
.tai-side-ico i:nth-child(2) { width: 12px; }
.tai-side-ico i:nth-child(3) { width: 14px; }

.tai-starters {
	transition: opacity 280ms ease-out, transform 280ms ease-out;
}
.tai-starters.is-fading {
	opacity: 0;
	transform: translate3d(0, -6px, 0);
	pointer-events: none;
}
.tai-thinking-msg {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 2px 0;
	min-height: 1.6em;
	color: var(--tai-muted);
	font-size: 15px;
}
.tai-thinking-label { letter-spacing: .01em; }
.tai-dots {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	height: 10px;
}
.tai-dots i {
	display: block;
	width: 5px;
	height: 5px;
	border-radius: 50%;
	background: currentColor;
	opacity: .3;
	animation: tai-dot 1.1s ease-in-out infinite;
}
.tai-dots i:nth-child(2) { animation-delay: .16s; }
.tai-dots i:nth-child(3) { animation-delay: .32s; }
@keyframes tai-dot {
	0%, 80%, 100% { opacity: .3; transform: translate3d(0, 0, 0); }
	40% { opacity: 1; transform: translate3d(0, -2px, 0); }
}
@media (prefers-reduced-motion: reduce) {
	.tai-starters { transition: none; }
	.tai-dots i { animation: none; opacity: .7; transform: none; }
}


/* ========== 0.3.0.2 ========== */

/* Scrolling: the PAGE scrolls, never a trapped message list. Cause of the 0.3.0.1 trap: .tai-thread was an
   overflow:auto box with overscroll-behavior:contain, which stops the wheel from reaching the page in Chrome
   even when the list has nothing to scroll. */
html body .tai-page .tai-thread {
	overflow: visible !important;
	max-height: none !important;
	overscroll-behavior: auto !important;
	scroll-behavior: auto;
	flex: 1 0 auto;
}
html body .tai .tai-pop .tai-thread { overflow-y: auto !important; overscroll-behavior: auto !important; }
html body .tai-page .tai-chats { overscroll-behavior: auto; }
html body .tai-page .tai-app:not(.tai-empty) .tai-composer {
	position: sticky;
	bottom: 0;
	z-index: 6;
	background: linear-gradient(to top, var(--tai-bg) 78%, rgba(0,0,0,0));
	pointer-events: none;
}
html body .tai-page .tai-app:not(.tai-empty) .tai-composer .tai-form,
html body .tai-page .tai-app:not(.tai-empty) .tai-composer .tai-starters,
html body .tai-page .tai-app:not(.tai-empty) .tai-composer .tai-hint,
html body .tai-page .tai-app:not(.tai-empty) .tai-composer .tai-modes {
	pointer-events: auto;
	position: relative;
	z-index: 1;
}
html body .tai-page .tai-thread {
	padding-bottom: 28px;
}
/* The sidebar stays in view on desktop while the page scrolls. */
@media (min-width: 900px) {
	html body .tai-page .tai-shell { align-items: flex-start; }
	html body .tai-page .tai-side,
	html body .tai-page .tai-app.tai-empty .tai-side,
	html body .tai-page .tai-app:not(.tai-side-open) .tai-side {
		position: sticky;
		top: 0;
		align-self: flex-start;
		height: 100vh;
		height: 100dvh;
		max-height: 100dvh;
		min-height: 0;
		overflow-y: auto;
		transform: none;
		opacity: 1;
		pointer-events: auto;
	}
	html body .tai-page .tai-main { align-self: stretch; }
}

/* Hidden means hidden, whatever the theme or our own display rules say. */
html body .tai [hidden] { display: none !important; }
html body .tai .tai-starters.is-away { display: none !important; }
html body .tai-app:not(.tai-empty):not(.tai-leaving) .tai-starters { display: none !important; }

/* Never all caps: beat theme button, link and heading styles. */
html body .tai,
html body .tai *,
html body .tai *::before,
html body .tai *::after,
html body .tai button,
html body .tai button.tai-chip,
html body .tai button.tai-newchat,
html body .tai button.tai-chat-open,
html body .tai button.tai-send,
html body .tai button.tai-mic,
html body .tai button.tai-act,
html body .tai a,
html body .tai a.tai-src,
html body .tai a.tai-cite,
html body .tai a.tai-tool,
html body .tai input,
html body .tai textarea,
html body .tai-toast {
	text-transform: none !important;
	letter-spacing: normal !important;
	font-variant-caps: normal !important;
}

/* Thumbs up / down */
.tai-act.tai-act-ico { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 28px; padding: 0; }
.tai-act.tai-act-ico svg { display: block; }
.tai-act.tai-act-down svg { transform: scaleY(-1); }
.tai-act.tai-act-ico.is-on { opacity: 1; color: var(--tai-accent); border-color: var(--tai-accent); background: rgba(142,67,240,.16); }

/* Core fact chip, in the same family as the source chips. */
html body .tai .tai-cite.tai-core {
	min-width: 0;
	padding: 0 8px;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 600;
	cursor: help;
	color: var(--tai-cyan);
	border: 1px solid rgba(94,200,255,.4);
	background: rgba(94,200,255,.1);
	text-decoration: none;
	white-space: nowrap;
}

/* Same type size and weight on every theme (some themes give buttons large, light type). */
html body .tai button.tai-chip,
html body .tai .tai-follow button { font-size: 13px !important; font-weight: 400 !important; line-height: 1.35 !important; font-family: inherit !important; }
html body .tai button.tai-send { font-size: 13px !important; font-weight: 600 !important; line-height: 1.2 !important; font-family: inherit !important; }
html body .tai button.tai-mic,
html body .tai button.tai-stop { font-size: 12px !important; font-weight: 500 !important; line-height: 1.2 !important; font-family: inherit !important; }
html body .tai button.tai-act { font-size: 12px !important; font-weight: 500 !important; line-height: 1.2 !important; font-family: inherit !important; }
html body .tai .tai-src { font-size: 13px !important; font-weight: 500 !important; line-height: 1.3 !important; }
html body .tai button.tai-chat-open, html body .tai button.tai-newchat { font-size: 12px !important; font-weight: 500 !important; line-height: 1.3 !important; font-family: inherit !important; }

/* CO₂ swap offer: a quiet line under the existing upgrade nudge, only when the person can afford it. */
html body .tai .tai-swap { margin: 6px 0 0; }
html body .tai button.tai-swap-btn,
html body .tai .tai-swap-btn {
	appearance: none;
	background: none;
	border: 0;
	padding: 0;
	margin: 0;
	font: inherit;
	font-size: 12px !important;
	font-weight: 400 !important;
	line-height: 1.45 !important;
	letter-spacing: normal !important;
	text-transform: none !important;
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
	cursor: pointer;
}
html body .tai button.tai-swap-btn:hover { color: var(--tai-cyan); }
html body .tai button.tai-swap-btn:disabled { opacity: .6; cursor: default; text-decoration: none; }


/* Soft lavender focus outline on the question box. Static (not animated); kept under reduced motion. */
html body .tai .tai-form:focus-within {
	transform: translate3d(0, -1px, 0);
	border-color: rgba(201, 166, 255, .55);
	box-shadow: 0 0 0 1px rgba(142, 67, 240, .28), 0 0 14px rgba(142, 67, 240, .16);
	outline: none;
}
html body .tai .tai-form.tai-invite:focus-within::before {
	animation: none;
	opacity: .1;
}

/* Keep the box dark when the theme would paint a focused input white. */
html body .tai textarea.tai-in,
html body .tai textarea.tai-in:hover,
html body .tai textarea.tai-in:focus,
html body .tai textarea.tai-in:focus-visible,
html body .tai textarea.tai-in:active {
	background: transparent !important;
	background-color: transparent !important;
	color: var(--tai-ink) !important;
	-webkit-text-fill-color: var(--tai-ink) !important;
	caret-color: var(--tai-ink);
	box-shadow: none !important;
	outline: none !important;
	border: 0 !important;
	/* Beat theme textarea rules that force a scrollbar; not !important so grow() can turn it on when needed. */
	overflow-x: hidden;
	overflow-y: hidden;
}
html body .tai textarea.tai-in::placeholder {
	color: var(--tai-muted) !important;
	opacity: .75 !important;
	-webkit-text-fill-color: var(--tai-muted) !important;
}


/* Official The Climate Con mark and wording, matching the live site header. Small, top right, links home. */
html body .tai .tai-bar-end {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	margin-left: auto;
	flex: 0 0 auto;
}
html body .tai a.tai-by {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5em;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	text-decoration: none !important;
	color: #FFFFFF;
	font-family: Montserrat, "Helvetica Neue", Arial, sans-serif !important;
	line-height: 1.1;
	white-space: nowrap;
}
html body .tai a.tai-by .tai-by-text {
	font-size: 14px !important;
	font-weight: 800 !important;
	letter-spacing: 0.06em !important;
	text-transform: uppercase !important;
	font-variant-caps: normal !important;
	color: inherit;
	-webkit-text-fill-color: currentColor;
	line-height: 1.1;
}
html body .tai a.tai-by:hover,
html body .tai a.tai-by:focus-visible {
	color: #c9a6ff;
}
html body .tai[data-theme="light"] a.tai-by {
	color: #150E1F;
}
html body .tai[data-theme="light"] a.tai-by:hover,
html body .tai[data-theme="light"] a.tai-by:focus-visible {
	color: #7a2ee0;
}
html body .tai .tai-tcc {
	display: block;
	flex: 0 0 auto;
	width: 48px;
	height: 48px;
	object-fit: contain;
	object-position: center center;
	background: none;
	filter: none;
	-webkit-mask: none;
	mask: none;
}
@media (max-width: 899px) {
	html body .tai .tai-tcc {
		width: 40px;
		height: 40px;
	}
	html body .tai a.tai-by .tai-by-text {
		font-size: 12px !important;
		letter-spacing: 0.04em !important;
	}
}
@media (max-width: 359px) {
	/* Same breakpoint as the live site header: keep the mark, hide the wording. */
	html body .tai a.tai-by .tai-by-text {
		display: none;
	}
}

/* Language flag: far right of the Lumen app bar, not the site header. */
html body .tai .tai-bar,
html body .tai .tai-bar-end,
html body .tai .tai-main,
html body .tai .tai-shell,
html body .tai .tai-app {
	overflow: visible;
}
html body .tai .tai-lang {
	position: relative;
	flex: 0 0 auto;
	z-index: 30;
}
html body .tai .tai-lang-btn {
	width: 40px;
	height: 40px;
	padding: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	flex-shrink: 0;
}
html body .tai .tai-lang-btn[aria-expanded="true"] {
	background: rgba(142,67,240,.16);
}
html body .tai .tai-flag {
	display: block;
	width: 22px;
	height: 15px;
	border-radius: 2px;
	box-shadow: 0 0 0 1px rgba(255,255,255,.18);
}
html body .tai .tai-lang-list {
	position: absolute;
	right: 0;
	top: calc(100% + 8px);
	width: min(280px, calc(100vw - 16px));
	max-height: min(70vh, 420px);
	overflow-x: hidden;
	overflow-y: visible;
	background: var(--tai-panel-2);
	border: 1px solid var(--tai-line);
	border-radius: 16px;
	padding: 8px;
	z-index: 40;
	display: flex;
	flex-direction: column;
	gap: 2px;
	opacity: 0;
	transform: translate3d(0, -8px, 0);
	pointer-events: none;
	transition: transform 220ms var(--tai-ease), opacity 220ms var(--tai-ease);
	box-shadow: 0 16px 40px rgba(0,0,0,.35);
}
html body .tai .tai-lang-list.is-open {
	opacity: 1;
	transform: translate3d(0, 0, 0);
	pointer-events: auto;
}
html body .tai .tai-lang-opt {
	appearance: none;
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	margin: 0;
	padding: 8px 10px;
	border: 0;
	border-radius: 12px;
	background: transparent;
	color: var(--tai-ink);
	font: inherit;
	font-size: 14px;
	line-height: 1.3;
	text-align: left;
	cursor: pointer;
}
html body .tai .tai-lang-opt:hover,
html body .tai .tai-lang-opt:focus-visible {
	background: rgba(142,67,240,.16);
	outline: none;
}
html body .tai .tai-lang-opt.is-on {
	background: rgba(142,67,240,.22);
}
html body .tai .tai-lang-name {
	min-width: 0;
	white-space: nowrap;
}
@media (max-width: 899px) {
	html body .tai .tai-lang-btn {
		width: 40px;
		height: 40px;
	}
	html body .tai .tai-bar-end {
		gap: 6px;
		min-width: 0;
	}
	html body .tai a.tai-by {
		min-width: 0;
	}
	html body .tai .tai-lang {
		order: 5;
		margin-left: 0;
	}
	/* Keep the flag on the far right of the app bar, even on a tight phone. */
	html body .tai .tai-lang-list {
		right: 0;
		left: auto;
		width: min(280px, calc(100vw - 12px));
	}
}
@media (max-width: 359px) {
	html body .tai .tai-lang-btn {
		width: 36px;
		height: 36px;
	}
}
@media (prefers-reduced-motion: reduce) {
	html body .tai .tai-lang-list {
		transition: none;
		transform: none;
	}
}


/* 0.3.0.19 — flag menu taps on iOS 15 (iPhone SE): the list takes the first tap.
   [hidden] really hides it (the display:flex above used to override hidden), so pointer-events can be on as soon as it shows.
   No scroll box unless the list truly overflows (.is-scroll is set by the script). */
html body .tai .tai-lang-list[hidden] {
	display: none !important;
}
html body .tai .tai-lang-list.is-open {
	pointer-events: auto;
}
html body .tai .tai-lang-list.is-scroll {
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}
html body .tai .tai-lang-btn,
html body .tai .tai-lang-opt {
	touch-action: manipulation;
	-webkit-tap-highlight-color: transparent;
	-webkit-user-select: none;
	user-select: none;
}
/* The button itself is the tap target, never the flag SVG or the name inside it. */
html body .tai .tai-lang-btn *,
html body .tai .tai-lang-opt * {
	pointer-events: none;
}
html body .tai .tai-lang-opt:active {
	background: rgba(142,67,240,.28);
}

/* Visible confirmation that the flag reset the chat: the start screen fades back in. */
@keyframes tai-relang-in {
	from { opacity: 0; transform: translate3d(0, 6px, 0); }
	to { opacity: 1; transform: none; }
}
html body .tai .tai-app.tai-relang .tai-welcome,
html body .tai .tai-app.tai-relang .tai-starters,
html body .tai .tai-app.tai-relang .tai-form {
	animation: tai-relang-in 420ms var(--tai-ease, ease) both;
}
@media (prefers-reduced-motion: reduce) {
	html body .tai .tai-app.tai-relang .tai-welcome,
	html body .tai .tai-app.tai-relang .tai-starters,
	html body .tai .tai-app.tai-relang .tai-form {
		animation: none;
	}
}

/* ========== Mobile New chat pill (page + widget). The Back toast was removed in 0.3.0.24; Back is silent. ========== */
html body .tai .tai-newpill-slot {
	display: flex;
	justify-content: center;
	align-items: center;
	position: sticky;
	top: calc(8px + env(safe-area-inset-top, 0px));
	z-index: 5;
	padding: 0 12px 8px;
	pointer-events: none;
	transition: transform 220ms var(--tai-ease), opacity 220ms var(--tai-ease);
}
html body .tai .tai-newpill {
	pointer-events: auto;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	padding: 8px 14px 8px 12px;
	border-radius: 999px;
	border: 1px solid rgba(142, 67, 240, 0.55);
	background: rgba(21, 14, 31, 0.94);
	color: var(--tai-ink);
	font-family: inherit;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: 0.01em;
	cursor: pointer;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
	appearance: none;
	-webkit-appearance: none;
}
html body .tai[data-theme="light"] .tai-newpill {
	background: rgba(255, 255, 255, 0.94);
	border-color: rgba(122, 46, 224, 0.45);
}
html body .tai .tai-newpill:hover,
html body .tai .tai-newpill:focus-visible {
	border-color: #ffb020;
	outline: none;
}
.tai-newpill-ico {
	width: 16px;
	height: 16px;
	flex: 0 0 auto;
	display: block;
	color: #ffb020;
}
html body .tai .tai-newpill-slot.is-away {
	opacity: 0;
	transform: translate3d(0, -12px, 0);
	pointer-events: none;
}
@media (min-width: 900px) {
	html body .tai .tai-newpill-slot {
		display: none !important;
	}
}
@media (prefers-reduced-motion: reduce) {
	html body .tai .tai-newpill-slot {
		transition: none;
	}
}

/* 0.3.0.24: long URLs or words in source chips, bubbles and links must wrap inside the bubble on 320–375px phones. */
html body .tai .tai-msg,
html body .tai .tai-msg .tai-bubble,
html body .tai .tai-bubble a,
html body .tai .tai-sources,
html body .tai a.tai-src,
html body .tai button.tai-src,
html body .tai .tai-src-dest,
html body .tai .tai-more a {
	overflow-wrap: anywhere;
	word-break: break-word;
	min-width: 0;
	max-width: 100%;
}
html body .tai a.tai-src,
html body .tai button.tai-src { white-space: normal; box-sizing: border-box; }

/* 0.3.0.24: in a chat the Lumen name joins the app bar, so on phones keep the Climate Con mark and hide its wording (it pushed the menu and flag off-screen at 375px). The start screen is unchanged. */
@media (max-width: 479px) {
	html body .tai .tai-app:not(.tai-empty) a.tai-by .tai-by-text {
		display: none;
	}
}


/* 0.3.0.25: year-safe wrap already on .tai-md (break-word, not anywhere). */

/* Desktop/tablet collapse tab, mid-height on the sidebar edge. */
.tai-side-tab {
	display: none;
	flex: 0 0 20px;
	width: 20px;
	align-self: center;
	position: relative;
	z-index: 9;
	height: 56px;
	padding: 0;
	margin: 0 -1px 0 -1px;
	border: 1px solid var(--tai-line);
	border-radius: 0 12px 12px 0;
	background: var(--tai-panel-2);
	color: var(--tai-ink);
	cursor: pointer;
	box-shadow: 0 0 0 1px rgba(240, 193, 75, .12);
}
.tai-side-tab:hover,
.tai-side-tab:focus-visible {
	background: var(--tai-panel);
	border-color: var(--tai-accent);
	color: #f0c14b;
	outline: none;
}
.tai-side-tab-ico {
	display: block;
	width: 8px;
	height: 8px;
	margin: 0 auto;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(135deg); /* points left, hide */
	transition: transform var(--tai-t) var(--tai-ease);
}
.tai-app.tai-side-collapsed .tai-side-tab-ico {
	transform: rotate(-45deg); /* points right, show */
}
@media (min-width: 900px) {
	html body .tai .tai-side-tab { display: flex; align-items: center; justify-content: center; }
	html body .tai .tai-side,
	html body .tai-page .tai-side,
	html body .tai-page .tai-app.tai-empty .tai-side {
		transition: width var(--tai-t-slow) var(--tai-ease), flex-basis var(--tai-t-slow) var(--tai-ease), opacity var(--tai-t) var(--tai-ease), padding var(--tai-t-slow) var(--tai-ease), border-color var(--tai-t) var(--tai-ease);
		overflow-x: hidden;
	}
	html body .tai .tai-app.tai-side-collapsed .tai-side,
	html body .tai-page .tai-app.tai-side-collapsed .tai-side,
	html body .tai-page .tai-app.tai-empty.tai-side-collapsed .tai-side,
	html body .tai-page .tai-app.tai-side-collapsed.tai-empty .tai-side {
		width: 0 !important;
		flex: 0 0 0 !important;
		min-width: 0 !important;
		padding-left: 0 !important;
		padding-right: 0 !important;
		border-right-width: 0 !important;
		opacity: 0 !important;
		overflow: hidden !important;
		pointer-events: none !important;
	}
}
@media (max-width: 899px) {
	html body .tai .tai-side-tab { display: none !important; }
	html body .tai .tai-app.tai-side-collapsed .tai-side {
		/* mobile drawer is independent of the desktop collapse flag */
	}
}
@media (prefers-reduced-motion: reduce) {
	html body .tai .tai-side-tab-ico,
	html body .tai .tai-side {
		transition: none !important;
	}
}

/* Daily-limit upgrade card: not an answer bubble; no copy/regen/thumbs. */
html body .tai .tai-bubble.tai-bubble-limit {
	background: var(--tai-panel-2);
	border: 1px solid var(--tai-accent);
	box-shadow: 0 0 0 1px rgba(142,67,240,.18);
	padding: 16px 18px 18px;
	max-width: 36rem;
}
html body .tai .tai-limit-card { color: var(--tai-ink); }
html body .tai .tai-limit-title {
	font-size: 16px;
	font-weight: 650;
	margin: 0 0 .4em;
	color: #f0c14b;
}
html body .tai .tai-limit-lead,
html body .tai .tai-limit-card p { margin: 0 0 .55em; }
html body .tai .tai-limit-price { color: var(--tai-cyan); font-weight: 600; }
html body .tai .tai-limit-perk { color: var(--tai-muted); font-size: 13px; }
html body .tai .tai-limit-card .tai-cta { margin-top: 8px; display: inline-flex; }

/* Right-menu web search row and blue lock. */
html body .tai .tai-web-item {
	display: flex !important;
	align-items: center;
	gap: 8px;
	width: 100%;
}
html body .tai .tai-web-item .tai-web-lab { flex: 1; text-align: left; }
html body .tai .tai-web-left { color: var(--tai-muted); font-size: 12px; }
html body .tai .tai-web-item .tai-lock {
	color: var(--tai-cyan);
	flex: 0 0 auto;
	margin-left: auto;
}
html body .tai .tai-web-item.is-locked {
	opacity: .78;
	color: var(--tai-muted);
}
html body .tai .tai-switch {
	position: relative;
	width: 32px;
	height: 18px;
	border-radius: 999px;
	background: rgba(255,255,255,.14);
	flex: 0 0 32px;
	margin-left: auto;
}
html body .tai[data-theme="light"] .tai-switch { background: rgba(21,14,31,.18); }
html body .tai .tai-switch::after {
	content: "";
	position: absolute;
	top: 2px;
	left: 2px;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: var(--tai-ink);
	transition: transform var(--tai-t) var(--tai-ease);
}
html body .tai .tai-web-item.is-on .tai-switch { background: var(--tai-cyan); }
html body .tai .tai-web-item.is-on .tai-switch::after { transform: translateX(14px); }
html body .tai .tai-web-item.is-on { color: var(--tai-ink); }

html body .tai .tai-web-note {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 0 0 .6em;
	color: var(--tai-cyan);
	font-size: 13px;
}
html body .tai .tai-globe { flex: 0 0 auto; }
html body .tai a.tai-src-web,
html body .tai .tai-src-web { border-color: rgba(94,200,255,.45); }
html body .tai .tai-shell { overflow-x: hidden; }
