/*
 * Lothis webchat
 * A full-viewport application shell layered on the existing Lothis design
 * system. Chat content lives only in the memory of the current browser tab.
 */

:root {
	--lothis-chat-topbar-base: 4rem;
	--lothis-chat-topbar: calc(var(--lothis-chat-topbar-base) + env(safe-area-inset-top));
	--lothis-chat-reading: 48rem;
	--lothis-chat-viewport-height: 100dvh;
	--lothis-chat-viewport-offset: 0px;
}

.lothis-chat-app [hidden] {
	display: none !important;
}

html.lothis-chat-page,
html.lothis-chat-page body,
html:has(.lothis-chat-app),
body:has(.lothis-chat-app) {
	height: 100%;
	overflow: hidden;
}

html.lothis-chat-page body,
body:has(.lothis-chat-app) {
	padding: 0 !important;
}

.lothis-chat-skip {
	position: fixed;
	top: calc(env(safe-area-inset-top) + 0.75rem);
	left: 50%;
	z-index: 10000;
	display: inline-flex;
	min-height: var(--lothis-control-hit, 2.75rem);
	box-sizing: border-box;
	align-items: center;
	padding: 0.5rem 0.8rem;
	border-radius: 999px;
	background: var(--lothis-ink);
	color: var(--lothis-canvas) !important;
	font-size: 0.84rem;
	font-weight: 600;
	transform: translate(-50%, -160%);
	transition: transform 160ms ease;
}

.lothis-chat-skip:focus {
	transform: translate(-50%, 0);
}

.lothis-chat-app {
	position: fixed;
	top: var(--lothis-chat-viewport-offset);
	right: 0;
	bottom: auto;
	left: 0;
	z-index: 500;
	display: grid;
	width: 100%;
	height: var(--lothis-chat-viewport-height);
	min-width: 18rem;
	margin: 0 !important;
	grid-template-rows: var(--lothis-chat-topbar) minmax(0, 1fr) auto;
	overflow: hidden;
	background:
		radial-gradient(circle at 15% -20%, var(--lothis-atmosphere-one), transparent 37rem),
		radial-gradient(circle at 92% 8%, var(--lothis-atmosphere-two), transparent 32rem),
		var(--lothis-canvas);
	color: var(--lothis-ink);
	isolation: isolate;
	font-size: 1rem;
	line-height: 1.55;
	grid-template-columns: 17.25rem minmax(0, 1fr);
}

body.admin-bar .lothis-chat-app {
	top: calc(var(--lothis-chat-viewport-offset) + 32px);
	height: calc(var(--lothis-chat-viewport-height) - 32px);
}

.lothis-chat-app::before {
	content: "";
	position: fixed;
	inset: 0;
	z-index: -1;
	pointer-events: none;
	background-image: radial-gradient(circle, color-mix(in srgb, var(--lothis-accent) 16%, transparent) 0.7px, transparent 0.8px);
	background-size: 34px 34px;
	mask-image: linear-gradient(to bottom, black, transparent 55%);
	opacity: 0.28;
}

.lothis-chat-app[data-state="booting"]::after {
	content: "";
	position: fixed;
	top: 50%;
	left: 50%;
	z-index: 60;
	width: 44px;
	height: 44px;
	background: url("../images/lothis-mark-micro.svg") center / 44px 44px no-repeat;
	opacity: 0.78;
	transform: translate(-50%, -50%);
	pointer-events: none;
}

	.lothis-chat-app[data-state="booting"] > .lothis-chat-topbar,
	.lothis-chat-app[data-state="booting"] > .lothis-chat-sidebar,
	.lothis-chat-app[data-state="booting"] > .lothis-chat-sidebar-backdrop,
	.lothis-chat-app[data-state="booting"] > .lothis-chat-network,
.lothis-chat-app[data-state="booting"] > .lothis-chat-main,
.lothis-chat-app[data-state="booting"] > .lothis-chat-composer-shell,
	.lothis-chat-app[data-flow="onboarding"] > .lothis-chat-topbar,
	.lothis-chat-app[data-flow="onboarding"] > .lothis-chat-sidebar,
	.lothis-chat-app[data-flow="onboarding"] > .lothis-chat-sidebar-backdrop,
.lothis-chat-app[data-flow="onboarding"] > .lothis-chat-network,
.lothis-chat-app[data-flow="onboarding"] > .lothis-chat-main,
.lothis-chat-app[data-flow="onboarding"] > .lothis-chat-composer-shell,
body:has(.lothis-chat-app[data-flow="onboarding"]) > .lothis-chat-skip {
	visibility: hidden;
	opacity: 0;
	pointer-events: none;
}

.lothis-chat-topbar {
	position: relative;
	z-index: 30;
	display: flex;
	min-width: 0;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding:
		calc(0.65rem + env(safe-area-inset-top))
		max(clamp(0.85rem, 2.5vw, 1.5rem), env(safe-area-inset-right))
		0.65rem
		max(clamp(0.85rem, 2.5vw, 1.5rem), env(safe-area-inset-left));
	border-bottom: 1px solid color-mix(in srgb, var(--lothis-line) 78%, transparent);
	background: color-mix(in srgb, var(--lothis-canvas) 77%, transparent);
	grid-column: 1 / -1;
	grid-row: 1;
	-webkit-backdrop-filter: saturate(145%) blur(24px);
	backdrop-filter: saturate(145%) blur(24px);
}

.lothis-chat-topbar-leading {
	display: flex;
	min-width: 0;
	align-items: center;
	gap: 0.45rem;
}

.lothis-chat-icon-button.lothis-chat-history-toggle,
.lothis-chat-icon-button.lothis-chat-sidebar-close {
	display: none;
}

.lothis-chat-brand {
	display: inline-flex;
	min-width: 0;
	min-height: 2.75rem;
	align-items: center;
	gap: 0.55rem;
	color: var(--lothis-ink) !important;
	font-size: 0.96rem;
	font-weight: 690;
	letter-spacing: -0.03em;
	text-decoration: none !important;
}

.lothis-chat-brand-mark {
	display: block;
	width: 32px;
	height: 32px;
	flex: 0 0 auto;
	background: url("../images/lothis-mark-micro.svg") center / 32px 32px no-repeat;
}

.lothis-chat-topbar-actions {
	display: flex;
	min-width: 0;
	align-items: center;
	gap: 0.35rem;
}

.lothis-chat-sidebar {
	position: relative;
	z-index: 25;
	display: grid;
	min-width: 0;
	min-height: 0;
	grid-column: 1;
	grid-row: 2 / 4;
	grid-template-rows: auto auto minmax(0, 1fr) auto;
	gap: 0.7rem;
	box-sizing: border-box;
	padding: 0.85rem 0.7rem max(0.85rem, env(safe-area-inset-bottom)) max(0.7rem, env(safe-area-inset-left));
	border-right: 1px solid color-mix(in srgb, var(--lothis-line) 76%, transparent);
	background: color-mix(in srgb, var(--lothis-surface-solid) 72%, transparent);
	-webkit-backdrop-filter: saturate(125%) blur(22px);
	backdrop-filter: saturate(125%) blur(22px);
}

.lothis-chat-sidebar-header,
.lothis-chat-sidebar-header > div,
.lothis-chat-sidebar-session {
	display: flex;
	align-items: center;
}

.lothis-chat-sidebar-header {
	min-height: 2.75rem;
	justify-content: space-between;
	gap: 0.5rem;
	padding: 0 0.3rem;
}

.lothis-chat-sidebar-header > div {
	min-width: 0;
	gap: 0.55rem;
}

.lothis-chat-sidebar-header strong {
	overflow: hidden;
	font-size: 0.78rem;
	font-weight: 680;
	letter-spacing: -0.015em;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.lothis-chat-sidebar-mark {
	position: relative;
	display: block;
	width: 24px;
	height: 24px;
	flex: 0 0 24px;
	background: url("../images/lothis-mark-micro.svg") center / 24px 24px no-repeat;
}

.lothis-chat-sidebar-mark::after {
	content: "";
	position: absolute;
	inset: -8px;
	z-index: -1;
	border-radius: 50%;
	background: radial-gradient(circle, color-mix(in srgb, var(--lothis-accent) 23%, transparent), transparent 68%);
	opacity: 0.18;
	animation: lothis-chat-breathe-aura 6.2s cubic-bezier(.45,0,.3,1) infinite;
}

.lothis-chat-sidebar-new {
	display: flex;
	width: 100%;
	min-height: var(--lothis-control-hit, 2.75rem);
	box-sizing: border-box;
	align-items: center;
	gap: 0.65rem;
	padding: 0.55rem 0.75rem;
	border: 1px solid color-mix(in srgb, var(--lothis-accent) 22%, var(--lothis-line));
	border-radius: 0.9rem;
	background: color-mix(in srgb, var(--lothis-accent-soft) 42%, var(--lothis-surface-solid));
	color: var(--lothis-ink);
	font: inherit;
	font-size: 0.8rem;
	font-weight: 630;
	cursor: pointer;
	transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.lothis-chat-sidebar-new:hover:not(:disabled) {
	border-color: color-mix(in srgb, var(--lothis-accent) 48%, var(--lothis-line));
	background: color-mix(in srgb, var(--lothis-accent-soft) 70%, var(--lothis-surface-solid));
	transform: translateY(-1px);
}

.lothis-chat-sidebar-new svg,
.lothis-chat-history-remove svg {
	width: 1rem;
	height: 1rem;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.lothis-chat-history-scroll {
	min-height: 0;
	overflow-x: hidden;
	overflow-y: auto;
	overscroll-behavior: contain;
	scrollbar-width: thin;
}

.lothis-chat-history-empty {
	margin: 0;
	padding: 1.05rem 0.75rem;
	color: var(--lothis-faint);
	font-size: 0.75rem;
	line-height: 1.48;
}

.lothis-chat-history {
	display: grid;
	gap: 0.18rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.lothis-chat-history-item {
	display: grid;
	min-width: 0;
	grid-template-columns: minmax(0, 1fr) 2.75rem;
	align-items: center;
	border-radius: 0.85rem;
	animation: lothis-chat-history-in 260ms cubic-bezier(.2,.75,.25,1) both;
	transition: opacity 170ms ease, transform 170ms ease;
}

.lothis-chat-history-item.is-current {
	background: color-mix(in srgb, var(--lothis-accent-soft) 52%, transparent);
}

.lothis-chat-history-item.is-removing {
	opacity: 0;
	transform: translateX(-0.8rem) scale(0.97);
}

@keyframes lothis-chat-history-in {
	from { opacity: 0; transform: translateY(0.35rem) scale(0.985); }
	to { opacity: 1; transform: translateY(0) scale(1); }
}

.lothis-chat-history-select,
.lothis-chat-history-remove {
	border: 0;
	background: transparent;
	color: var(--lothis-ink);
	font: inherit;
	cursor: pointer;
}

.lothis-chat-history-select {
	display: grid;
	min-width: 0;
	min-height: var(--lothis-control-hit, 2.75rem);
	align-content: center;
	gap: 0.04rem;
	padding: 0.42rem 0.35rem 0.42rem 0.7rem;
	text-align: left;
}

.lothis-chat-history-select > span,
.lothis-chat-history-select > small {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.lothis-chat-history-select > span {
	font-size: 0.78rem;
	font-weight: 570;
}

.lothis-chat-history-select > small {
	color: var(--lothis-faint);
	font-size: 0.67rem;
}

.lothis-chat-history-remove {
	display: grid;
	width: 2.75rem;
	height: 2.75rem;
	place-items: center;
	padding: 0;
	border-radius: 50%;
	opacity: 0.52;
	transition: background-color 160ms ease, opacity 160ms ease, transform 160ms ease;
}

.lothis-chat-history-item:hover .lothis-chat-history-remove,
.lothis-chat-history-remove:focus-visible {
	opacity: 1;
}

.lothis-chat-history-remove:hover:not(:disabled) {
	background: color-mix(in srgb, var(--lothis-ink) 6%, transparent);
	transform: rotate(4deg) scale(1.04);
}

.lothis-chat-sidebar-session {
	gap: 0.45rem;
	margin: 0;
	padding: 0.35rem 0.65rem 0;
	color: var(--lothis-faint);
	font-size: 0.69rem;
}

.lothis-chat-sidebar-session > span:first-child {
	width: 0.42rem;
	height: 0.42rem;
	border-radius: 50%;
	background: var(--lothis-accent);
	box-shadow: 0 0 0 0.25rem color-mix(in srgb, var(--lothis-accent) 10%, transparent);
}

.lothis-chat-sidebar-backdrop {
	position: absolute;
	inset: var(--lothis-chat-topbar) 0 0;
	z-index: 50;
	padding: 0;
	border: 0;
	background: color-mix(in srgb, var(--lothis-ink) 31%, transparent);
	-webkit-backdrop-filter: blur(2px);
	backdrop-filter: blur(2px);
}

.lothis-chat-icon-button,
.lothis-chat-account-button,
.lothis-chat-atmosphere > summary {
	box-sizing: border-box;
	border: 1px solid var(--lothis-line);
	background: color-mix(in srgb, var(--lothis-surface) 82%, transparent);
	box-shadow: 0 3px 12px color-mix(in srgb, var(--lothis-ink) 5%, transparent);
	color: var(--lothis-ink);
	-webkit-backdrop-filter: blur(16px);
	backdrop-filter: blur(16px);
	cursor: pointer;
	transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.lothis-chat-icon-button,
.lothis-chat-atmosphere > summary {
	display: grid;
	width: var(--lothis-control-hit, 2.75rem);
	height: var(--lothis-control-hit, 2.75rem);
	min-width: var(--lothis-control-hit, 2.75rem);
	place-items: center;
	padding: 0;
	border-radius: 50%;
	list-style: none;
}

.lothis-chat-atmosphere > summary::-webkit-details-marker {
	display: none;
}

.lothis-chat-icon-button:hover:not(:disabled),
.lothis-chat-account-button:hover:not(:disabled),
.lothis-chat-atmosphere > summary:hover {
	border-color: var(--lothis-line-strong);
	background: var(--lothis-surface-solid);
	transform: translateY(-1px);
}

.lothis-chat-icon-button svg,
.lothis-chat-atmosphere > summary svg,
.lothis-chat-dialog-close svg,
.lothis-chat-send svg {
	width: 1.15rem;
	height: 1.15rem;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.lothis-chat-account-button {
	position: relative;
	display: inline-flex;
	min-height: var(--lothis-control-hit, 2.75rem);
	align-items: center;
	gap: 0.5rem;
	padding: 0.3rem 0.75rem 0.3rem 0.35rem;
	border-radius: 999px;
	font: inherit;
	font-size: 0.82rem;
	font-weight: 600;
	min-width: 0;
	max-width: min(15rem, 42vw);
}

.lothis-chat-account-label {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.lothis-chat-account-button:disabled,
.lothis-chat-starters button:disabled {
	cursor: wait;
	opacity: 0.64;
	transform: none;
}

.lothis-chat-plan-badge,
.lothis-chat-account-plan-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 1px solid color-mix(in srgb, var(--lothis-line-strong) 62%, transparent);
	border-radius: 999px;
	background: color-mix(in srgb, var(--lothis-surface-solid) 74%, transparent);
	color: var(--lothis-muted);
	font-weight: 640;
	letter-spacing: 0.015em;
	line-height: 1;
	white-space: nowrap;
}

.lothis-chat-plan-badge {
	min-height: 1.5rem;
	padding: 0.18rem 0.48rem;
	font-size: 0.75rem;
}

.lothis-chat-plan-badge[data-tier="premium"],
.lothis-chat-account-plan-badge[data-tier="premium"] {
	border-color: color-mix(in srgb, var(--lothis-accent) 36%, var(--lothis-line));
	background: color-mix(in srgb, var(--lothis-accent-soft) 72%, transparent);
	color: color-mix(in srgb, var(--lothis-accent) 72%, var(--lothis-ink));
}

.lothis-chat-plan-badge[data-status="degraded"],
.lothis-chat-account-plan-badge[data-status="degraded"] {
	border-color: color-mix(in srgb, #d77320 36%, var(--lothis-line));
	background: color-mix(in srgb, #fff4e5 72%, transparent);
	color: #7a4215;
}

.lothis-chat-account-avatar,
.lothis-chat-account-large-avatar {
	position: relative;
	display: block;
	border-radius: 50%;
	background:
		radial-gradient(circle at 50% 35%, var(--lothis-surface-solid) 0 13%, transparent 14%),
		radial-gradient(circle at 50% 79%, var(--lothis-surface-solid) 0 24%, transparent 25%),
		linear-gradient(145deg, var(--lothis-accent), color-mix(in srgb, var(--lothis-accent) 50%, #238ee5));
}

.lothis-chat-account-avatar {
	width: 2rem;
	height: 2rem;
	flex: 0 0 auto;
}

.lothis-chat-account-large-avatar {
	width: 3.75rem;
	height: 3.75rem;
	margin: 0 auto 1rem;
}

.lothis-chat-atmosphere {
	position: relative;
}

.lothis-chat-atmosphere-panel {
	position: absolute;
	top: calc(100% + 0.65rem);
	right: 0;
	width: min(20rem, calc(100vw - 2rem));
	box-sizing: border-box;
	padding: 1rem;
	border: 1px solid var(--lothis-line);
	border-radius: 1.35rem;
	background: color-mix(in srgb, var(--lothis-surface-solid) 97.5%, transparent);
	box-shadow: 0 26px 80px color-mix(in srgb, var(--lothis-ink) 15%, transparent);
	-webkit-backdrop-filter: blur(24px);
	backdrop-filter: blur(24px);
	transform-origin: top right;
}

.lothis-chat-atmosphere[open]:not(.is-closing) .lothis-chat-atmosphere-panel {
	animation: lothis-chat-popover-in 200ms cubic-bezier(.2, .75, .25, 1) both;
}

.lothis-chat-atmosphere.is-closing .lothis-chat-atmosphere-panel {
	pointer-events: none;
	animation: lothis-chat-popover-out 140ms cubic-bezier(.4, 0, 1, 1) both;
}

@keyframes lothis-chat-popover-in {
	from { opacity: 0; transform: translateY(-0.35rem) scale(0.975); }
	to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes lothis-chat-popover-out {
	from { opacity: 1; transform: translateY(0) scale(1); }
	to { opacity: 0; transform: translateY(-0.25rem) scale(0.985); }
}

.lothis-chat-atmosphere-panel > p {
	margin: 0 0 0.75rem;
	color: var(--lothis-muted);
	font-size: 0.86rem;
}

.lothis-chat-palette-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.45rem;
}

.lothis-chat-palette-grid button {
	display: flex;
	min-height: var(--lothis-control-hit, 2.75rem);
	align-items: center;
	gap: 0.5rem;
	padding: 0.35rem 0.55rem;
	border: 1px solid transparent;
	border-radius: 0.8rem;
	background: transparent;
	color: var(--lothis-ink);
	font: inherit;
	font-size: 0.8rem;
	cursor: pointer;
}

.lothis-chat-palette-grid button:hover,
.lothis-chat-palette-grid button[aria-pressed="true"] {
	border-color: var(--lothis-line);
	background: var(--lothis-accent-soft);
}

.lothis-chat-palette-grid button[aria-pressed="true"]::after {
	content: "\2713";
	width: 1.1rem;
	height: 1.1rem;
	margin-left: auto;
	border-radius: 50%;
	background: var(--lothis-accent);
	color: var(--lothis-on-accent);
	font-size: 0.72rem;
	font-weight: 800;
	line-height: 1.1rem;
	text-align: center;
}

.lothis-chat-palette-grid button > .lothis-chat-palette-swatch {
	width: 1.35rem;
	height: 1.35rem;
	border-radius: 50%;
	box-shadow: inset 0 0 0 1px rgba(255,255,255,.35);
}

.lothis-chat-palette-grid button[data-lothis-palette-choice="dew"] > .lothis-chat-palette-swatch { background: linear-gradient(135deg, #65dc9c, #168dbe); }
.lothis-chat-palette-grid button[data-lothis-palette-choice="tide"] > .lothis-chat-palette-swatch { background: linear-gradient(135deg, #63b7e9, #645acb); }
.lothis-chat-palette-grid button[data-lothis-palette-choice="blossom"] > .lothis-chat-palette-swatch { background: linear-gradient(135deg, #ef90b9, #a66be2); }
.lothis-chat-palette-grid button[data-lothis-palette-choice="glow"] > .lothis-chat-palette-swatch { background: linear-gradient(135deg, #f7b766, #db6d53); }

.lothis-chat-network {
	position: fixed;
	top: calc(var(--lothis-chat-topbar) + 0.65rem);
	left: 50%;
	z-index: 40;
	max-width: calc(100vw - 2rem);
	padding: 0.58rem 0.9rem;
	border: 1px solid color-mix(in srgb, #d77320 38%, var(--lothis-line));
	border-radius: 999px;
	background: color-mix(in srgb, #fff4e5 92%, transparent);
	box-shadow: var(--lothis-shadow-control);
	color: #703b12;
	font-size: 0.8rem;
	font-weight: 620;
	text-align: center;
	transform: translateX(-50%);
	-webkit-backdrop-filter: blur(14px);
	backdrop-filter: blur(14px);
}

:root[data-lothis-theme="dark"] .lothis-chat-network {
	background: color-mix(in srgb, #3b2819 94%, transparent);
	color: #ffd9ad;
}

.lothis-chat-main {
	position: relative;
	display: flex;
	min-height: 0;
	flex-direction: column;
	overflow-x: hidden;
	overflow-y: auto;
	overscroll-behavior: contain;
	scroll-behavior: smooth;
	scrollbar-gutter: stable both-edges;
	padding:
		clamp(1rem, 3vw, 2rem)
		max(clamp(1rem, 4vw, 2.5rem), env(safe-area-inset-right))
		clamp(1rem, 3vw, 2rem)
		max(clamp(1rem, 4vw, 2.5rem), env(safe-area-inset-left));
	grid-column: 2;
	grid-row: 2;
}

.lothis-chat-empty {
	position: relative;
	display: flex;
	width: min(100%, 52rem);
	min-height: 100%;
	box-sizing: border-box;
	flex: 1;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	align-self: center;
	padding: clamp(2.5rem, 6vh, 5rem) 0 clamp(1.75rem, 4vh, 3rem);
	text-align: center;
}

.lothis-chat-empty-glow {
	position: absolute;
	top: 50%;
	left: 50%;
	z-index: -1;
	width: min(80vw, 38rem);
	aspect-ratio: 1.15;
	border-radius: 50%;
	background:
		radial-gradient(circle at 38% 45%, var(--lothis-atmosphere-one), transparent 52%),
		radial-gradient(circle at 66% 54%, var(--lothis-atmosphere-two), transparent 54%);
	filter: blur(10px);
	opacity: 0.8;
	transform: translate(-50%, -53%);
	pointer-events: none;
	animation: lothis-chat-organic-glow 12s cubic-bezier(.45,0,.3,1) infinite;
}

@keyframes lothis-chat-organic-glow {
	0%, 100% { opacity: 0.68; transform: translate(-51%, -52%) scale(0.92) rotate(-2deg); }
	42% { opacity: 0.88; transform: translate(-48%, -55%) scale(1.06) rotate(2deg); }
	76% { opacity: 0.76; transform: translate(-52%, -50%) scale(0.98) rotate(0deg); }
}

.lothis-chat-empty.is-arriving > :not(.lothis-chat-empty-glow) {
	animation: lothis-chat-empty-arrive 420ms cubic-bezier(.2,.75,.25,1) both;
}

.lothis-chat-empty.is-arriving > :nth-child(3) { animation-delay: 35ms; }
.lothis-chat-empty.is-arriving > :nth-child(4) { animation-delay: 60ms; }
.lothis-chat-empty.is-arriving > :nth-child(5) { animation-delay: 85ms; }
.lothis-chat-empty.is-arriving > :nth-child(n + 6) { animation-delay: 110ms; }

@keyframes lothis-chat-empty-arrive {
	from { opacity: 0; transform: translateY(0.55rem) scale(0.99); }
	to { opacity: 1; transform: translateY(0) scale(1); }
}

.lothis-chat-breathing-mark,
.lothis-chat-login-mark,
.lothis-chat-thinking-mark {
	display: block;
	background: url("../images/lothis-mark.svg") center / contain no-repeat;
}

.lothis-chat-breathing-mark {
	position: relative;
	isolation: isolate;
	width: clamp(4.75rem, 10vw, 6rem);
	aspect-ratio: 1;
	margin-bottom: 1.15rem;
}

.lothis-chat-breathing-mark::after {
	content: "";
	position: absolute;
	inset: -36%;
	z-index: -1;
	border-radius: 50%;
	background: radial-gradient(circle, color-mix(in srgb, var(--lothis-accent) 24%, transparent), transparent 67%);
	opacity: 0.2;
	pointer-events: none;
	animation: lothis-chat-breathe-aura 5.4s cubic-bezier(.45,0,.3,1) infinite;
}

@keyframes lothis-chat-breathe-aura {
	0%, 100% { opacity: 0.11; transform: scale(0.8); }
	40%, 50% { opacity: 0.34; transform: scale(1.06); }
	82% { opacity: 0.18; transform: scale(0.9); }
}

.lothis-chat-eyebrow {
	margin: 0 0 0.7rem;
	color: var(--lothis-accent);
	font-size: 0.72rem;
	font-weight: 720;
	letter-spacing: 0.09em;
	line-height: 1.2;
	text-transform: uppercase;
}

.lothis-chat-empty h1 {
	max-width: 46rem;
	margin: 0;
	font-size: clamp(2.15rem, 4.75vw, 3.6rem);
	font-weight: 680;
	letter-spacing: -0.052em;
	line-height: 1.01;
	text-wrap: balance;
}

.lothis-chat-intro {
	max-width: 35rem;
	margin: 0.85rem 0 0;
	color: var(--lothis-muted);
	font-size: clamp(0.96rem, 1.35vw, 1.08rem);
	line-height: 1.55;
	text-wrap: balance;
}

.lothis-chat-personalization-nudge {
	display: grid;
	width: min(100%, 34rem);
	box-sizing: border-box;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: center;
	gap: 0.9rem;
	margin-top: 1.25rem;
	padding: 0.85rem 0.9rem 0.85rem 1rem;
	border: 1px solid color-mix(in srgb, var(--lothis-accent) 24%, var(--lothis-line));
	border-radius: 1.1rem;
	background: linear-gradient(145deg, color-mix(in srgb, var(--lothis-accent-soft) 56%, transparent), var(--lothis-surface-solid));
	box-shadow: 0 12px 36px color-mix(in srgb, var(--lothis-ink) 6%, transparent);
	text-align: left;
}

.lothis-chat-personalization-nudge[hidden] {
	display: none;
}

.lothis-chat-personalization-nudge strong {
	font-size: 0.82rem;
	font-weight: 670;
}

.lothis-chat-personalization-nudge p {
	margin: 0.22rem 0 0;
	color: var(--lothis-muted);
	font-size: 0.74rem;
	line-height: 1.4;
}

.lothis-chat-personalization-nudge button {
	min-height: var(--lothis-control-hit, 2.75rem);
	padding: 0.45rem 0.78rem;
	border: 1px solid var(--lothis-line);
	border-radius: 999px;
	background: var(--lothis-surface-solid);
	color: var(--lothis-ink);
	font: inherit;
	font-size: 0.76rem;
	font-weight: 620;
	white-space: nowrap;
	cursor: pointer;
}

.lothis-chat-starters {
	display: grid;
	width: min(100%, 42rem);
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 0.55rem;
	margin-top: clamp(1.5rem, 4vh, 2.5rem);
}

.lothis-chat-starters button {
	min-height: 3.75rem;
	padding: 0.65rem 0.8rem;
	border: 1px solid var(--lothis-line);
	border-radius: 0.9rem;
	background: color-mix(in srgb, var(--lothis-surface) 84%, transparent);
	box-shadow: 0 4px 18px color-mix(in srgb, var(--lothis-ink) 4%, transparent);
	color: var(--lothis-ink);
	font: inherit;
	font-size: 0.84rem;
	line-height: 1.4;
	text-align: left;
	cursor: pointer;
	-webkit-backdrop-filter: blur(16px);
	backdrop-filter: blur(16px);
	transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.lothis-chat-starters button:hover:not(:disabled) {
	border-color: var(--lothis-line-strong);
	background: var(--lothis-surface-solid);
	transform: translateY(-2px);
}

.lothis-chat-messages {
	width: min(100%, var(--lothis-chat-reading));
	box-sizing: border-box;
	margin: 0 auto;
	padding: clamp(1.5rem, 4vw, 3rem) 0 1.25rem;
	list-style: none;
}

.lothis-chat-message {
	display: flex;
	margin: 0 0 1.35rem;
	animation: lothis-chat-message-in 280ms ease both;
}

@keyframes lothis-chat-message-in {
	from { opacity: 0; transform: translateY(8px); }
	to { opacity: 1; transform: translateY(0); }
}

.lothis-chat-message--user {
	justify-content: flex-end;
}

.lothis-chat-message--failed {
	align-items: flex-end;
	flex-direction: column;
	gap: 0.45rem;
}

.lothis-chat-message--failed .lothis-chat-message-bubble {
	border: 1px solid color-mix(in srgb, var(--lothis-danger-text) 38%, transparent);
	opacity: 0.78;
}

.lothis-chat-message--failed [data-chat-retry] {
	min-height: var(--lothis-control-hit, 2.75rem);
	padding: 0.45rem 0.75rem;
	border: 1px solid color-mix(in srgb, var(--lothis-danger-text) 32%, var(--lothis-line));
	border-radius: 999px;
	background: var(--lothis-surface-solid);
	color: var(--lothis-danger-text);
	font: inherit;
	font-size: 0.76rem;
	font-weight: 600;
	cursor: pointer;
	transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease, opacity 160ms ease;
}

.lothis-chat-message--failed [data-chat-retry]:disabled {
	cursor: wait;
	opacity: 0.58;
}

.lothis-chat-message-bubble {
	max-width: min(88%, 39rem);
	white-space: pre-wrap;
	word-break: break-word;
}

.lothis-chat-message--user .lothis-chat-message-bubble {
	padding: 0.78rem 1.05rem;
	border-radius: 1.35rem 1.35rem 0.35rem 1.35rem;
	background: var(--lothis-user-bubble);
	color: #fff;
	font-size: 0.9375rem;
	line-height: 1.52;
}

.lothis-chat-message--assistant {
	position: relative;
	padding-left: 2.65rem;
}

.lothis-chat-message--assistant::before {
	content: "";
	position: absolute;
	top: 0.05rem;
	left: 0;
	width: 28px;
	height: 28px;
	background: url("../images/lothis-mark-micro.svg") center / 28px 28px no-repeat;
}

.lothis-chat-message--assistant .lothis-chat-message-bubble {
	padding-top: 0.05rem;
	color: var(--lothis-ink);
	font-size: 1rem;
	line-height: 1.62;
}

.lothis-chat-message-meta {
	margin-top: 0.6rem;
	color: var(--lothis-faint);
	font-size: 0.75rem;
}

.lothis-chat-guest-gate {
	display: grid;
	width: min(100%, 34rem);
	box-sizing: border-box;
	gap: 0.48rem;
	margin: 1.75rem auto 1.35rem;
	padding: 1.05rem;
	border: 1px solid color-mix(in srgb, var(--lothis-accent) 32%, var(--lothis-line));
	border-radius: 1.25rem;
	background: color-mix(in srgb, var(--lothis-accent-soft) 70%, var(--lothis-surface-solid));
	box-shadow: 0 12px 36px color-mix(in srgb, var(--lothis-accent) 8%, transparent);
	text-align: left;
	-webkit-backdrop-filter: blur(16px);
	backdrop-filter: blur(16px);
}

.lothis-chat-guest-gate__title,
.lothis-chat-guest-gate__description {
	margin: 0;
}

.lothis-chat-guest-gate__title {
	color: var(--lothis-ink);
	font-size: 1rem;
	font-weight: 670;
	letter-spacing: -0.02em;
}

.lothis-chat-guest-gate__description {
	color: var(--lothis-muted);
	font-size: 0.84rem;
	line-height: 1.5;
}

.lothis-chat-guest-gate__action {
	display: inline-flex;
	width: fit-content;
	min-height: var(--lothis-control-hit, 2.75rem);
	box-sizing: border-box;
	align-items: center;
	justify-content: center;
	margin-top: 0.3rem;
	padding: 0.5rem 0.9rem;
	border: 1px solid var(--lothis-accent);
	border-radius: 999px;
	background: var(--lothis-accent);
	color: var(--lothis-on-accent);
	font: inherit;
	font-size: 0.82rem;
	font-weight: 620;
	cursor: pointer;
	transition: background-color 160ms ease, transform 160ms ease;
}

.lothis-chat-guest-gate__action:hover {
	background: var(--lothis-accent-hover);
	transform: translateY(-1px);
}

.lothis-chat-message--risk .lothis-chat-message-bubble {
	width: min(100%, 40rem);
	box-sizing: border-box;
	padding: 1rem 1.1rem;
	border: 1px solid color-mix(in srgb, #d97023 38%, var(--lothis-line));
	border-radius: 1.2rem;
	background: color-mix(in srgb, #fff4e7 68%, var(--lothis-surface-solid));
}

:root[data-lothis-theme="dark"] .lothis-chat-message--risk .lothis-chat-message-bubble {
	background: color-mix(in srgb, #3a2719 66%, var(--lothis-surface-solid));
}

:root[data-lothis-theme="dark"] .lothis-chat-account-plan[data-status="degraded"],
:root[data-lothis-theme="dark"] .lothis-chat-plan-badge[data-status="degraded"],
:root[data-lothis-theme="dark"] .lothis-chat-account-plan-badge[data-status="degraded"] {
	background: color-mix(in srgb, #3a2719 66%, var(--lothis-surface-solid));
	color: #ffd9ad;
}

@media (prefers-color-scheme: dark) {
	:root:not([data-lothis-theme="light"]) .lothis-chat-network {
		background: color-mix(in srgb, #3b2819 94%, transparent);
		color: #ffd9ad;
	}

	:root:not([data-lothis-theme="light"]) .lothis-chat-message--risk .lothis-chat-message-bubble {
		background: color-mix(in srgb, #3a2719 66%, var(--lothis-surface-solid));
	}

	:root:not([data-lothis-theme="light"]) .lothis-chat-account-plan[data-status="degraded"],
	:root:not([data-lothis-theme="light"]) .lothis-chat-plan-badge[data-status="degraded"],
	:root:not([data-lothis-theme="light"]) .lothis-chat-account-plan-badge[data-status="degraded"] {
		background: color-mix(in srgb, #3a2719 66%, var(--lothis-surface-solid));
		color: #ffd9ad;
	}
}

.lothis-chat-support-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.55rem;
	margin-top: 0.85rem;
}

.lothis-chat-support-actions a {
	display: inline-flex;
	min-height: var(--lothis-control-hit, 2.75rem);
	align-items: center;
	padding: 0 0.75rem;
	border: 1px solid currentColor;
	border-radius: 999px;
	color: var(--lothis-ink);
	font-size: 0.8rem;
	font-weight: 600;
	text-decoration: none;
}

.lothis-chat-thinking {
	display: flex;
	width: min(100%, var(--lothis-chat-reading));
	box-sizing: border-box;
	align-items: center;
	gap: 0.55rem;
	margin: 0 auto;
	padding: 0 0 1.3rem 0;
	color: var(--lothis-muted);
	font-size: 0.82rem;
}

.lothis-chat-thinking-mark {
	width: 28px;
	height: 28px;
	background-image: url("../images/lothis-mark-micro.svg");
}

.lothis-chat-thinking-dots {
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
}

.lothis-chat-thinking-dots i {
	width: 0.25rem;
	height: 0.25rem;
	border-radius: 50%;
	background: currentColor;
	animation: lothis-chat-dot 1.15s ease-in-out infinite;
}

.lothis-chat-thinking-dots i:nth-child(2) { animation-delay: 130ms; }
.lothis-chat-thinking-dots i:nth-child(3) { animation-delay: 260ms; }

@keyframes lothis-chat-dot {
	0%, 65%, 100% { opacity: 0.28; transform: translateY(0); }
	32% { opacity: 1; transform: translateY(-2px); }
}

.lothis-chat-composer-shell {
	position: relative;
	z-index: 20;
	min-width: 0;
	box-sizing: border-box;
	padding:
		0.85rem
		max(clamp(1rem, 4vw, 2.5rem), env(safe-area-inset-right))
		max(0.75rem, env(safe-area-inset-bottom))
		max(clamp(1rem, 4vw, 2.5rem), env(safe-area-inset-left));
	background: linear-gradient(to bottom, transparent, var(--lothis-canvas) 27%, var(--lothis-canvas) 100%);
	pointer-events: none;
	grid-column: 2;
	grid-row: 3;
}

.lothis-chat-composer {
	display: flex;
	width: min(100%, var(--lothis-chat-reading));
	min-height: 3.5rem;
	box-sizing: border-box;
	align-items: flex-end;
	gap: 0.45rem;
	margin-inline: auto;
	padding: 0.32rem 0.36rem 0.32rem 0.95rem;
	border: 1px solid var(--lothis-line);
	border-radius: 1.75rem;
	background: color-mix(in srgb, var(--lothis-surface-solid) 94%, transparent);
	box-shadow: 0 12px 40px color-mix(in srgb, var(--lothis-ink) 8%, transparent), inset 0 1px rgba(255,255,255,.24);
	-webkit-backdrop-filter: blur(22px);
	backdrop-filter: blur(22px);
	pointer-events: auto;
	transition: border-color 160ms ease, box-shadow 160ms ease;
}

.lothis-chat-composer:focus-within {
	border-color: color-mix(in srgb, var(--lothis-accent) 55%, var(--lothis-line));
	box-shadow: 0 12px 42px color-mix(in srgb, var(--lothis-accent) 10%, transparent), 0 0 0 3px color-mix(in srgb, var(--lothis-accent) 10%, transparent);
}

.lothis-chat-composer textarea {
	width: 100%;
	max-height: 10rem;
	min-height: var(--lothis-control-hit, 2.75rem);
	box-sizing: border-box;
	align-self: center;
	margin: 0;
	padding: 0.6rem 0 0.5rem;
	resize: none;
	border: 0;
	outline: 0;
	background: transparent;
	box-shadow: none;
	color: var(--lothis-ink);
	font: inherit;
	font-size: 0.9375rem;
	line-height: 1.45;
	transition: opacity 160ms ease;
}

.lothis-chat-composer textarea::placeholder {
	color: var(--lothis-faint);
	opacity: 1;
}

.lothis-chat-composer-gate {
	width: 100%;
	min-height: var(--lothis-control-hit, 2.75rem);
	box-sizing: border-box;
	align-self: center;
	margin: 0;
	padding: 0.6rem 0 0.5rem;
	border: 0;
	outline: 0;
	background: transparent;
	box-shadow: none;
	color: var(--lothis-faint);
	font: inherit;
	font-size: 0.9375rem;
	line-height: 1.45;
	text-align: left;
	cursor: text;
}

.lothis-chat-composer textarea:disabled {
	cursor: not-allowed;
	opacity: 0.64;
}

.lothis-chat-send {
	display: grid;
	width: var(--lothis-control-hit, 2.75rem);
	height: var(--lothis-control-hit, 2.75rem);
	min-width: var(--lothis-control-hit, 2.75rem);
	place-items: center;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--lothis-accent);
	color: var(--lothis-on-accent);
	cursor: pointer;
	transition: opacity 160ms ease, transform 160ms ease, background-color 160ms ease;
}

.lothis-chat-send:hover:not(:disabled) {
	background: var(--lothis-accent-hover);
	transform: translateY(-1px);
}

.lothis-chat-send:disabled {
	background: color-mix(in srgb, var(--lothis-muted) 14%, var(--lothis-surface-solid));
	color: var(--lothis-faint);
	cursor: default;
}

.lothis-chat-dialog {
	width: min(92vw, 32rem);
	max-height: min(90dvh, 49rem);
	box-sizing: border-box;
	padding: 0;
	overflow: auto;
	border: 1px solid var(--lothis-line);
	border-radius: 1.5rem;
	background: color-mix(in srgb, var(--lothis-surface-solid) 94%, transparent);
	box-shadow: 0 38px 120px rgba(0, 20, 24, 0.25);
	color: var(--lothis-ink);
	-webkit-backdrop-filter: saturate(130%) blur(28px);
	backdrop-filter: saturate(130%) blur(28px);
	opacity: 0;
	transform: translateY(0.8rem) scale(0.985);
	transition: opacity 200ms ease, transform 280ms cubic-bezier(.2, .8, .25, 1);
	transition:
		opacity 200ms ease,
		transform 280ms cubic-bezier(.2, .8, .25, 1),
		display 280ms allow-discrete,
		overlay 280ms allow-discrete;
}

.lothis-chat-dialog[open] {
	opacity: 1;
	transform: translateY(0) scale(1);
}

@starting-style {
	.lothis-chat-dialog[open] {
		opacity: 0;
		transform: translateY(0.8rem) scale(0.985);
	}
}

.lothis-chat-dialog::backdrop {
	background: color-mix(in srgb, #061a18 38%, transparent);
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
	opacity: 0;
	transition:
		opacity 220ms ease,
		display 280ms allow-discrete,
		overlay 280ms allow-discrete;
}

.lothis-chat-dialog[open]::backdrop {
	opacity: 1;
}

@starting-style {
	.lothis-chat-dialog[open]::backdrop {
		opacity: 0;
	}
}

.lothis-chat-dialog-close-form {
	position: sticky;
	top: 0;
	z-index: 2;
	height: 0;
	margin: 0;
}

.lothis-chat-dialog-close {
	position: absolute;
	top: 0.9rem;
	right: 0.9rem;
	display: grid;
	width: var(--lothis-control-hit, 2.75rem);
	height: var(--lothis-control-hit, 2.75rem);
	place-items: center;
	padding: 0;
	border: 1px solid var(--lothis-line);
	border-radius: 50%;
	background: var(--lothis-surface);
	color: var(--lothis-ink);
	cursor: pointer;
}

.lothis-chat-dialog-content {
	padding: clamp(1.75rem, 5vw, 2.25rem);
	text-align: center;
}

.lothis-chat-login-mark {
	position: relative;
	isolation: isolate;
	width: 4rem;
	height: 4rem;
	margin: 0 auto 1rem;
}

.lothis-chat-login-mark::after {
	content: "";
	position: absolute;
	inset: -24%;
	z-index: -1;
	border-radius: 50%;
	background: radial-gradient(circle, color-mix(in srgb, var(--lothis-accent) 20%, transparent), transparent 68%);
	animation: lothis-chat-breathe-aura 5.4s ease-in-out infinite;
}

.lothis-chat-dialog h2 {
	margin: 0;
	font-size: clamp(1.65rem, 4.5vw, 2.1rem);
	letter-spacing: -0.042em;
	line-height: 1.04;
	text-wrap: balance;
	overflow-wrap: anywhere;
}

.lothis-chat-dialog h2 + p,
.lothis-chat-dialog-content > p:not(.lothis-chat-eyebrow):not(.lothis-chat-auth-status):not(.lothis-chat-login-legal) {
	margin: 1rem auto 0;
	color: var(--lothis-muted);
	font-size: 0.94rem;
	line-height: 1.55;
}

.lothis-chat-onboarding-dialog {
	width: min(94vw, 42rem);
	max-height: min(92dvh, 46rem);
	overflow: hidden;
	border-radius: 1.75rem;
}

.lothis-chat-onboarding-shell {
	display: grid;
	height: min(44rem, calc(92dvh - 2px));
	max-height: inherit;
	grid-template-rows: auto minmax(0, 1fr);
}

.lothis-chat-onboarding-header {
	display: grid;
	grid-template-columns: 44px minmax(0, 1fr);
	gap: 0.75rem;
	align-items: center;
	padding: 1rem 1.25rem 0.9rem;
	border-bottom: 1px solid var(--lothis-line);
	background: color-mix(in srgb, var(--lothis-surface-solid) 90%, transparent);
	-webkit-backdrop-filter: saturate(125%) blur(20px);
	backdrop-filter: saturate(125%) blur(20px);
}

.lothis-chat-onboarding-brand {
	position: relative;
	display: grid;
	width: 44px;
	height: 44px;
	isolation: isolate;
	place-items: center;
}

.lothis-chat-onboarding-brand::before {
	content: "";
	position: absolute;
	inset: -7px;
	z-index: -1;
	border-radius: 50%;
	background: radial-gradient(circle, color-mix(in srgb, var(--lothis-accent) 24%, transparent), transparent 68%);
	animation: lothis-chat-breathe-aura 5.4s ease-in-out infinite;
}

.lothis-chat-onboarding-brand > span {
	display: block;
	width: 32px;
	height: 32px;
	background: url("../images/lothis-mark-micro.svg") center / 32px 32px no-repeat;
}

.lothis-chat-onboarding-progress-copy {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
	font-size: 0.78rem;
	line-height: 1.25;
}

.lothis-chat-onboarding-progress-copy strong {
	font-size: 0.88rem;
	font-weight: 670;
	letter-spacing: -0.015em;
}

.lothis-chat-onboarding-progress-copy span {
	color: var(--lothis-faint);
	font-variant-numeric: tabular-nums;
}

.lothis-chat-onboarding-progress {
	grid-column: 2;
	height: 3px;
	overflow: hidden;
	border-radius: 999px;
	background: color-mix(in srgb, var(--lothis-ink) 9%, transparent);
}

.lothis-chat-onboarding-progress i {
	display: block;
	height: 100%;
	border-radius: inherit;
	background: linear-gradient(90deg, var(--lothis-accent), color-mix(in srgb, var(--lothis-accent) 58%, #299be8));
	transition: width 300ms cubic-bezier(.2, .75, .25, 1);
}

.lothis-chat-onboarding-form {
	display: grid;
	min-height: 0;
	grid-template-rows: minmax(0, 1fr) auto;
}

.lothis-chat-onboarding-body {
	overflow-x: hidden;
	overflow-y: auto;
	padding: clamp(1.4rem, 4vw, 2rem) clamp(1.2rem, 5vw, 2.25rem);
	overscroll-behavior: contain;
	scrollbar-gutter: stable;
}

.lothis-chat-onboarding-step {
	max-width: 35rem;
	margin-inline: auto;
	text-align: left;
	animation: lothis-chat-onboarding-step-in 260ms cubic-bezier(.2, .75, .25, 1) both;
}

@keyframes lothis-chat-onboarding-step-in {
	from { opacity: 0; transform: translateX(0.75rem); }
	to { opacity: 1; transform: translateX(0); }
}

.lothis-chat-onboarding-step h2 {
	font-size: clamp(1.65rem, 4vw, 2rem);
	line-height: 1.08;
}

.lothis-chat-onboarding-step h2 + p {
	max-width: 34rem;
	margin: 0.75rem 0 0;
	color: var(--lothis-muted);
	font-size: 0.9rem;
	line-height: 1.52;
}

.lothis-chat-onboarding-options,
.lothis-chat-onboarding-length {
	min-width: 0;
	margin: 1.35rem 0 0;
	padding: 0;
	border: 0;
}

.lothis-chat-onboarding-options legend,
.lothis-chat-onboarding-length legend {
	margin-bottom: 0.65rem;
	color: var(--lothis-muted);
	font-size: 0.76rem;
	font-weight: 650;
}

.lothis-chat-onboarding-options {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.55rem;
}

.lothis-chat-onboarding-choice {
	position: relative;
	display: grid;
	min-height: 4.4rem;
	box-sizing: border-box;
	grid-template-columns: 1.15rem minmax(0, 1fr);
	align-items: start;
	gap: 0.65rem;
	padding: 0.78rem;
	border: 1px solid var(--lothis-line);
	border-radius: 1rem;
	background: color-mix(in srgb, var(--lothis-surface) 72%, transparent);
	cursor: pointer;
	transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.lothis-chat-onboarding-choice:hover {
	border-color: var(--lothis-line-strong);
	background: var(--lothis-surface-solid);
	transform: translateY(-1px);
}

.lothis-chat-onboarding-choice:has(input:checked) {
	border-color: color-mix(in srgb, var(--lothis-accent) 68%, var(--lothis-line));
	background: color-mix(in srgb, var(--lothis-accent-soft) 66%, var(--lothis-surface-solid));
	box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--lothis-accent) 16%, transparent);
}

.lothis-chat-onboarding-choice input,
.lothis-chat-onboarding-length input,
.lothis-chat-onboarding-check input {
	width: 1.1rem;
	height: 1.1rem;
	margin: 0.08rem 0 0;
	accent-color: var(--lothis-accent);
}

.lothis-chat-onboarding-choice span,
.lothis-chat-onboarding-check span {
	display: grid;
	gap: 0.22rem;
}

.lothis-chat-onboarding-choice strong,
.lothis-chat-onboarding-check strong {
	font-size: 0.84rem;
	font-weight: 650;
	line-height: 1.25;
}

.lothis-chat-onboarding-choice small,
.lothis-chat-onboarding-check small {
	color: var(--lothis-muted);
	font-size: 0.75rem;
	line-height: 1.4;
}

.lothis-chat-onboarding-length {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 0.35rem;
}

.lothis-chat-onboarding-length legend {
	grid-column: 1 / -1;
}

.lothis-chat-onboarding-length label {
	position: relative;
	display: grid;
	min-height: var(--lothis-control-hit, 2.75rem);
	place-items: center;
	padding: 0.25rem 0.45rem;
	border: 1px solid var(--lothis-line);
	border-radius: 0.8rem;
	background: var(--lothis-surface);
	font-size: 0.78rem;
	font-weight: 600;
	cursor: pointer;
}

.lothis-chat-onboarding-length label:has(input:checked) {
	border-color: var(--lothis-accent);
	background: var(--lothis-accent-soft);
}

.lothis-chat-onboarding-length input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.lothis-chat-onboarding-choice:has(input:focus-visible),
.lothis-chat-onboarding-length label:has(input:focus-visible),
.lothis-chat-onboarding-check:has(input:focus-visible) {
	outline: 3px solid color-mix(in srgb, var(--lothis-accent) 52%, transparent);
	outline-offset: 2px;
}

.lothis-chat-onboarding-choice input:focus-visible,
.lothis-chat-onboarding-length input:focus-visible,
.lothis-chat-onboarding-check input:focus-visible {
	outline: 0;
}

.lothis-chat-onboarding-preview {
	margin-top: 0.8rem;
	padding: 0.9rem 1rem;
	border: 1px solid color-mix(in srgb, var(--lothis-accent) 24%, var(--lothis-line));
	border-radius: 1rem;
	background: linear-gradient(145deg, color-mix(in srgb, var(--lothis-accent-soft) 58%, transparent), var(--lothis-surface-solid));
}

.lothis-chat-onboarding-preview > span {
	color: var(--lothis-accent);
	font-size: 0.68rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.lothis-chat-onboarding-preview p {
	margin: 0.4rem 0 0;
	font-size: 0.84rem;
	line-height: 1.5;
}

.lothis-chat-field {
	display: grid;
	gap: 0.4rem;
	margin-top: 1.25rem;
	color: var(--lothis-muted);
	font-size: 0.76rem;
	font-weight: 620;
	text-align: left;
}

.lothis-chat-field input,
.lothis-chat-field select {
	width: 100%;
	min-height: var(--lothis-control-hit, 2.75rem);
	box-sizing: border-box;
	padding: 0.62rem 0.8rem;
	border: 1px solid var(--lothis-line);
	border-radius: 0.85rem;
	background: var(--lothis-surface-solid);
	color: var(--lothis-ink);
	font: inherit;
	font-size: 0.9rem;
	font-weight: 480;
}

.lothis-chat-field-note {
	color: var(--lothis-faint);
	font-size: 0.72rem;
	font-weight: 450;
	line-height: 1.35;
}

.lothis-chat-onboarding-footnote {
	margin: 0.65rem 0 0;
	color: var(--lothis-faint);
	font-size: 0.75rem;
	line-height: 1.4;
}

.lothis-chat-onboarding-palettes {
	margin-top: 1.35rem;
}

.lothis-chat-onboarding-check {
	display: grid;
	grid-template-columns: 1.15rem minmax(0, 1fr);
	gap: 0.7rem;
	margin-top: 0.65rem;
	padding: 0.85rem;
	border: 1px solid var(--lothis-line);
	border-radius: 1rem;
	background: color-mix(in srgb, var(--lothis-surface) 76%, transparent);
	text-align: left;
	cursor: pointer;
}

.lothis-chat-onboarding-check:has(input:checked) {
	border-color: color-mix(in srgb, var(--lothis-accent) 58%, var(--lothis-line));
	background: color-mix(in srgb, var(--lothis-accent-soft) 60%, var(--lothis-surface-solid));
}

.lothis-chat-inline-link {
	display: inline-flex;
	min-height: var(--lothis-control-hit, 2.75rem);
	align-items: center;
	margin-top: 0.55rem;
	color: var(--lothis-accent);
	font-size: 0.78rem;
	font-weight: 620;
}

.lothis-chat-onboarding-safety-card {
	margin-top: 1rem;
	border: 1px solid color-mix(in srgb, var(--lothis-accent) 25%, var(--lothis-line));
	border-radius: 1rem;
	background: var(--lothis-surface);
	overflow: hidden;
}

.lothis-chat-onboarding-safety-card summary {
	display: flex;
	min-height: var(--lothis-control-hit, 2.75rem);
	box-sizing: border-box;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 0.72rem 0.9rem;
	font-size: 0.8rem;
	font-weight: 640;
	cursor: pointer;
	list-style: none;
}

.lothis-chat-onboarding-safety-card summary::-webkit-details-marker {
	display: none;
}

.lothis-chat-onboarding-safety-card summary::after {
	content: "+";
	color: var(--lothis-accent);
	font-size: 1rem;
	font-weight: 500;
	transition: transform 180ms ease;
}

.lothis-chat-onboarding-safety-card[open] summary::after {
	transform: rotate(45deg);
}

.lothis-chat-onboarding-safety-body {
	padding: 0 0.9rem 0.9rem;
	border-top: 1px solid color-mix(in srgb, var(--lothis-line) 74%, transparent);
}

.lothis-chat-onboarding-safety-card p {
	margin: 0.75rem 0 0;
	color: var(--lothis-muted);
	font-size: 0.78rem;
	line-height: 1.45;
}

.lothis-chat-onboarding-safety-body > div {
	display: flex;
	flex-wrap: wrap;
	gap: 0.45rem;
	margin-top: 0.7rem;
}

.lothis-chat-onboarding-safety-card a {
	display: inline-flex;
	min-height: 2.25rem;
	align-items: center;
	padding: 0 0.68rem;
	border: 1px solid var(--lothis-line);
	border-radius: 999px;
	color: var(--lothis-ink);
	font-size: 0.74rem;
	font-weight: 620;
	text-decoration: none;
}

@media (max-width: 900px) {
	.lothis-chat-app {
		grid-template-columns: minmax(0, 1fr);
	}

	.lothis-chat-topbar {
		z-index: 70;
	}

	.lothis-chat-icon-button.lothis-chat-history-toggle,
	.lothis-chat-icon-button.lothis-chat-sidebar-close {
		display: grid;
	}

	.lothis-chat-sidebar {
		position: absolute;
		top: var(--lothis-chat-topbar);
		bottom: 0;
		left: 0;
		z-index: 60;
		width: min(87vw, 20rem);
		grid-column: auto;
		grid-row: auto;
		padding-left: max(0.7rem, env(safe-area-inset-left));
		border-right-color: color-mix(in srgb, var(--lothis-line-strong) 82%, transparent);
		box-shadow: 1.25rem 0 4rem color-mix(in srgb, var(--lothis-ink) 15%, transparent);
		transform: translateX(-105%);
		transition: transform 280ms cubic-bezier(.2,.75,.25,1);
	}

	.lothis-chat-sidebar[data-open="true"] {
		transform: translateX(0);
	}

	.lothis-chat-main {
		grid-column: 1;
	}

	.lothis-chat-composer-shell {
		grid-column: 1;
	}

	.lothis-chat-sidebar-backdrop:not([hidden]) {
		animation: lothis-chat-backdrop-in 200ms ease both;
	}

	@keyframes lothis-chat-backdrop-in {
		from { opacity: 0; }
		to { opacity: 1; }
	}
}

.lothis-chat-onboarding-footer {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: center;
	gap: 1rem;
	padding: 0.8rem 1.25rem max(0.8rem, env(safe-area-inset-bottom));
	border-top: 1px solid var(--lothis-line);
	background: color-mix(in srgb, var(--lothis-surface-solid) 92%, transparent);
	-webkit-backdrop-filter: saturate(125%) blur(20px);
	backdrop-filter: saturate(125%) blur(20px);
}

.lothis-chat-onboarding-footer > div {
	display: flex;
	gap: 0.5rem;
}

.lothis-chat-onboarding-back,
.lothis-chat-onboarding-next {
	width: auto;
	min-width: 7rem;
	margin: 0;
}

.lothis-chat-onboarding-back {
	min-height: var(--lothis-control-hit, 2.75rem);
	padding: 0.5rem 0.85rem;
	border: 0;
	background: transparent;
	color: var(--lothis-muted);
	font: inherit;
	font-size: 0.84rem;
	font-weight: 600;
	cursor: pointer;
}

.lothis-chat-onboarding-status {
	margin: 0;
	color: var(--lothis-danger-text);
	font-size: 0.74rem;
	line-height: 1.35;
}

.lothis-chat-personalization {
	margin-top: 1rem;
	padding: 0.85rem 0 0;
	border-top: 1px solid var(--lothis-line);
	text-align: left;
}

.lothis-chat-personalization summary {
	display: flex;
	min-height: var(--lothis-control-hit, 2.75rem);
	align-items: center;
	font-size: 0.86rem;
	font-weight: 650;
	cursor: pointer;
}

.lothis-chat-personalization > p {
	margin: 0.3rem 0 0;
	color: var(--lothis-muted);
	font-size: 0.78rem;
	line-height: 1.45;
}

.lothis-chat-personalization .lothis-chat-field {
	margin-top: 0.75rem;
}

.lothis-chat-personalization-actions {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 0.5rem;
	margin-top: 0.85rem;
}

.lothis-chat-personalization-actions .lothis-chat-secondary-button {
	width: auto;
	margin: 0;
	padding-inline: 1rem;
}

.lothis-chat-account-plan {
	margin-top: 1.35rem;
	padding: 1rem;
	border: 1px solid var(--lothis-line);
	border-radius: 1.2rem;
	background: color-mix(in srgb, var(--lothis-accent-soft) 34%, var(--lothis-surface-solid));
	text-align: left;
}

.lothis-chat-account-plan[data-status="degraded"] {
	background: color-mix(in srgb, #fff4e5 48%, var(--lothis-surface-solid));
}

.lothis-chat-account-plan-badge {
	min-height: 1.55rem;
	padding: 0.25rem 0.58rem;
	font-size: 0.75rem;
}

.lothis-chat-account-plan h3 {
	margin: 0.75rem 0 0;
	font-size: 1.1rem;
	letter-spacing: -0.025em;
	line-height: 1.2;
}

.lothis-chat-account-plan p {
	margin: 0.45rem 0 0;
	color: var(--lothis-muted);
	font-size: 0.8rem;
	line-height: 1.52;
}

.lothis-chat-account-plan .lothis-chat-account-plan-quota {
	margin-top: 0.8rem;
	padding-top: 0.75rem;
	border-top: 1px solid var(--lothis-line);
	color: var(--lothis-ink);
	font-weight: 620;
}

.lothis-chat-consent {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 0.75rem;
	margin-top: 1.4rem;
	padding: 1rem;
	border: 1px solid var(--lothis-line);
	border-radius: 1.1rem;
	background: color-mix(in srgb, var(--lothis-accent-soft) 48%, transparent);
	font-size: 0.8rem;
	line-height: 1.48;
	text-align: left;
	cursor: pointer;
}

.lothis-chat-consent input {
	width: 1.2rem;
	height: 1.2rem;
	margin: 0.08rem 0 0;
	accent-color: var(--lothis-accent);
}

.lothis-chat-auth-buttons {
	display: grid;
	gap: 0.55rem;
	margin-top: 1rem;
}

.lothis-chat-provider-button,
.lothis-chat-primary-button,
.lothis-chat-secondary-button,
.lothis-chat-danger-button {
	display: inline-flex;
	width: 100%;
	min-height: var(--lothis-control-hit, 2.75rem);
	box-sizing: border-box;
	align-items: center;
	justify-content: center;
	gap: 0.6rem;
	padding: 0.5rem 0.85rem;
	border-radius: 999px;
	font: inherit;
	font-size: 0.86rem;
	font-weight: 600;
	cursor: pointer;
	transition: opacity 160ms ease, transform 160ms ease, border-color 160ms ease;
}

.lothis-chat-provider-button:hover:not(:disabled),
.lothis-chat-primary-button:hover:not(:disabled),
.lothis-chat-secondary-button:hover:not(:disabled),
.lothis-chat-danger-button:hover:not(:disabled) {
	transform: translateY(-1px);
}

.lothis-chat-provider-button:disabled,
.lothis-chat-primary-button:disabled,
.lothis-chat-danger-button:disabled {
	opacity: 0.42;
	cursor: not-allowed;
}

.lothis-chat-provider-button svg {
	width: 1.2rem;
	height: 1.2rem;
	flex: 0 0 auto;
}

.lothis-chat-provider-button--google {
	border: 1px solid var(--lothis-line);
	background: var(--lothis-surface-solid);
	color: var(--lothis-ink);
}

.lothis-chat-provider-button--apple {
	border: 1px solid var(--lothis-ink);
	background: var(--lothis-ink);
	color: var(--lothis-canvas);
}

.lothis-chat-provider-button--apple svg {
	fill: currentColor;
}

.lothis-chat-primary-button {
	border: 1px solid var(--lothis-accent);
	background: var(--lothis-accent);
	color: var(--lothis-on-accent);
}

.lothis-chat-secondary-button {
	margin-top: 1.1rem;
	border: 1px solid var(--lothis-line);
	background: var(--lothis-surface-solid);
	color: var(--lothis-ink);
	text-decoration: none;
}

.lothis-chat-danger-button {
	margin-top: 0.65rem;
	border: 1px solid #c54848;
	background: #b83e3e;
	color: #fff;
}

.lothis-chat-auth-status,
.lothis-chat-handoff-note,
.lothis-chat-login-legal,
.lothis-chat-account-status {
	margin: 0.85rem 0 0;
	color: var(--lothis-faint);
	font-size: 0.75rem;
	line-height: 1.45;
}

.lothis-chat-handoff-note {
	padding-top: 0.8rem;
	border-top: 1px solid var(--lothis-line);
}

.lothis-chat-auth-status[data-kind="error"],
.lothis-chat-account-status[data-kind="error"] {
	color: var(--lothis-danger-text);
}

.lothis-chat-login-legal a {
	color: inherit;
}

.lothis-chat-delete-panel {
	margin-top: 1rem;
	padding-top: 1rem;
	border-top: 1px solid var(--lothis-line);
	text-align: left;
}

.lothis-chat-delete-panel summary {
	min-height: var(--lothis-control-hit, 2.75rem);
	display: flex;
	align-items: center;
	color: var(--lothis-danger-text);
	font-size: 0.82rem;
	font-weight: 590;
	cursor: pointer;
}

.lothis-chat-delete-panel p,
.lothis-chat-delete-panel label {
	color: var(--lothis-muted);
	font-size: 0.76rem;
	line-height: 1.5;
}

.lothis-chat-delete-panel label {
	display: block;
	margin: 0.8rem 0 0.4rem;
}

.lothis-chat-delete-panel input {
	width: 100%;
	min-height: 2.9rem;
	box-sizing: border-box;
	padding: 0.55rem 0.8rem;
	border: 1px solid var(--lothis-line);
	border-radius: 0.8rem;
	background: var(--lothis-canvas);
	color: var(--lothis-ink);
	font: inherit;
}

@media (max-width: 782px) {
	body.admin-bar .lothis-chat-app {
		top: calc(var(--lothis-chat-viewport-offset) + 46px);
		height: calc(var(--lothis-chat-viewport-height) - 46px);
	}
}

@media (max-width: 700px) {
	:root {
		--lothis-chat-topbar-base: 3.75rem;
	}

	.lothis-chat-topbar {
		padding-right: max(0.7rem, env(safe-area-inset-right));
		padding-left: max(0.7rem, env(safe-area-inset-left));
		-webkit-backdrop-filter: saturate(125%) blur(14px);
		backdrop-filter: saturate(125%) blur(14px);
	}

	.lothis-chat-atmosphere {
		position: static;
	}

	.lothis-chat-atmosphere-panel {
		top: calc(100% + 0.45rem);
		right: max(0.7rem, env(safe-area-inset-right));
		left: max(0.7rem, env(safe-area-inset-left));
		width: auto;
		max-width: none;
		padding: 0.85rem;
		border-radius: 1.25rem;
	}

	.lothis-chat-brand > span:last-child,
	.lothis-chat-plan-badge {
		display: none;
	}

	.lothis-chat-account-label {
		display: none;
	}

	.lothis-chat-brand {
		min-width: 2.75rem;
		justify-content: center;
	}

	.lothis-chat-account-button {
		width: var(--lothis-control-hit, 2.75rem);
		padding: 0.3rem;
	}

	.lothis-chat-brand-mark {
		width: 1.9rem;
		height: 1.9rem;
	}

	.lothis-chat-main {
		padding-right: max(1rem, env(safe-area-inset-right));
		padding-left: max(1rem, env(safe-area-inset-left));
	}

	.lothis-chat-empty {
		justify-content: flex-start;
		padding-top: clamp(2.5rem, 6vh, 3.75rem);
	}

	.lothis-chat-breathing-mark {
		width: 4.75rem;
	}

	.lothis-chat-empty h1 {
		font-size: clamp(2.1rem, 9.5vw, 2.65rem);
		letter-spacing: -0.046em;
	}

	.lothis-chat-personalization-nudge {
		grid-template-columns: 1fr;
		gap: 0.6rem;
	}

	.lothis-chat-personalization-nudge button {
		justify-self: start;
	}

	.lothis-chat-starters {
		grid-template-columns: 1fr;
		gap: 0.5rem;
		margin-top: 1.5rem;
	}

	.lothis-chat-starters button {
		min-height: var(--lothis-control-hit, 2.75rem);
		padding: 0.45rem 0.7rem;
		text-align: center;
	}

	.lothis-chat-message-bubble {
		max-width: 91%;
	}

	.lothis-chat-message--assistant {
		padding-left: 2.35rem;
	}

	.lothis-chat-composer-shell {
		padding:
			0.75rem
			max(0.7rem, env(safe-area-inset-right))
			max(0.5rem, env(safe-area-inset-bottom))
			max(0.7rem, env(safe-area-inset-left));
	}

	.lothis-chat-composer {
		min-height: 3.5rem;
		padding-left: 0.85rem;
		-webkit-backdrop-filter: blur(14px);
		backdrop-filter: blur(14px);
	}

	.lothis-chat-composer textarea,
	.lothis-chat-composer-gate {
		font-size: 1rem;
	}

	.lothis-chat-dialog {
		position: fixed;
		inset: auto 0 0;
		width: 100%;
		max-width: none;
		max-height: calc(var(--lothis-chat-viewport-height) - max(0.5rem, env(safe-area-inset-top)));
		margin: 0 auto;
		border-right: 0;
		border-bottom: 0;
		border-left: 0;
		border-radius: 1.5rem 1.5rem 0 0;
		background: color-mix(in srgb, var(--lothis-surface-solid) 97%, transparent);
		-webkit-backdrop-filter: saturate(115%) blur(16px);
		backdrop-filter: saturate(115%) blur(16px);
		overscroll-behavior: contain;
		scrollbar-width: thin;
	}

	.lothis-chat-dialog-content {
		padding: 2rem max(1.1rem, env(safe-area-inset-right)) max(1.35rem, env(safe-area-inset-bottom)) max(1.1rem, env(safe-area-inset-left));
	}

	.lothis-chat-onboarding-dialog {
		inset: 0;
		width: 100%;
		height: var(--lothis-chat-viewport-height, 100dvh);
		max-height: none;
		margin: 0;
		border: 0;
		border-radius: 0;
		background: var(--lothis-surface-solid);
	}

	.lothis-chat-onboarding-shell {
		height: 100%;
		max-height: none;
	}

	.lothis-chat-onboarding-header {
		padding:
			max(0.75rem, env(safe-area-inset-top))
			max(1rem, env(safe-area-inset-right))
			0.75rem
			max(1rem, env(safe-area-inset-left));
	}

	.lothis-chat-onboarding-body {
		padding: 1.35rem max(1rem, env(safe-area-inset-right)) 1.5rem max(1rem, env(safe-area-inset-left));
		scrollbar-gutter: auto;
	}

	.lothis-chat-onboarding-footer {
		grid-template-columns: 1fr;
		gap: 0.35rem;
		padding: 0.65rem max(1rem, env(safe-area-inset-right)) max(0.65rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
	}

	.lothis-chat-onboarding-footer > div {
		justify-content: flex-end;
	}

	.lothis-chat-onboarding-status:empty {
		display: none;
	}
}

@media (min-width: 360px) and (max-width: 700px) {
	.lothis-chat-brand > span:last-child {
		display: inline;
	}

	.lothis-chat-brand {
		min-width: 0;
		justify-content: flex-start;
	}

	.lothis-chat-account-button:not([data-authenticated]) {
		width: auto;
		padding-right: 0.75rem;
	}

	.lothis-chat-account-button:not([data-authenticated]) .lothis-chat-account-label {
		display: inline;
	}
}

@media (max-width: 390px) {
	.lothis-chat-topbar-actions {
		gap: 0.1rem;
	}

	.lothis-chat-brand-mark {
		width: 1.9rem;
		height: 1.9rem;
	}

	.lothis-chat-account-avatar {
		width: 1.85rem;
		height: 1.85rem;
	}

	.lothis-chat-onboarding-options {
		grid-template-columns: 1fr;
	}

	.lothis-chat-onboarding-choice {
		min-height: 3.8rem;
	}

	.lothis-chat-onboarding-back,
	.lothis-chat-onboarding-next {
		min-width: 0;
	}
}

@media (max-width: 390px) and (max-height: 680px) {
	.lothis-chat-dialog-content {
		padding-top: 1.35rem;
	}

	.lothis-chat-login-mark {
		width: 3.25rem;
		height: 3.25rem;
		margin-bottom: 0.55rem;
	}

	.lothis-chat-dialog .lothis-chat-eyebrow {
		margin-bottom: 0.45rem;
	}

	.lothis-chat-dialog h2 {
		font-size: 1.6rem;
	}

	.lothis-chat-dialog h2 + p,
	.lothis-chat-dialog-content > p:not(.lothis-chat-eyebrow):not(.lothis-chat-auth-status):not(.lothis-chat-login-legal) {
		margin-top: 0.55rem;
		font-size: 0.84rem;
		line-height: 1.42;
	}

	.lothis-chat-consent {
		gap: 0.6rem;
		margin-top: 0.7rem;
		padding: 0.72rem;
		font-size: 0.78rem;
		line-height: 1.38;
	}

	.lothis-chat-auth-buttons {
		gap: 0.5rem;
		margin-top: 0.65rem;
	}

	.lothis-chat-provider-button,
	.lothis-chat-primary-button {
		min-height: var(--lothis-control-hit, 2.75rem);
	}

	.lothis-chat-auth-status,
	.lothis-chat-handoff-note,
	.lothis-chat-login-legal {
		margin-top: 0.5rem;
		font-size: 0.75rem;
	}
}

@media (hover: none) {
	.lothis-chat-icon-button:hover:not(:disabled),
	.lothis-chat-account-button:hover:not(:disabled),
	.lothis-chat-atmosphere > summary:hover,
	.lothis-chat-starters button:hover:not(:disabled),
	.lothis-chat-send:hover:not(:disabled),
	.lothis-chat-provider-button:hover:not(:disabled),
	.lothis-chat-primary-button:hover:not(:disabled),
	.lothis-chat-secondary-button:hover:not(:disabled),
	.lothis-chat-danger-button:hover:not(:disabled),
	.lothis-chat-guest-gate__action:hover {
		transform: none;
	}
}

.lothis-chat-icon-button:active:not(:disabled),
.lothis-chat-account-button:active:not(:disabled),
.lothis-chat-atmosphere > summary:active,
.lothis-chat-starters button:active:not(:disabled),
.lothis-chat-send:active:not(:disabled),
.lothis-chat-provider-button:active:not(:disabled),
.lothis-chat-primary-button:active:not(:disabled),
.lothis-chat-secondary-button:active:not(:disabled),
.lothis-chat-danger-button:active:not(:disabled),
.lothis-chat-guest-gate__action:active {
	transform: scale(0.975);
}

.lothis-chat-message--failed [data-chat-retry]:active:not(:disabled) {
	transform: scale(0.975);
}

@media (max-width: 700px) and (max-height: 720px) {
	.lothis-chat-main {
		padding-top: 0.75rem;
	}

	.lothis-chat-empty {
		padding-top: 0.75rem;
		padding-bottom: 0.5rem;
	}

	.lothis-chat-breathing-mark {
		width: 3.75rem;
		margin-bottom: 0.6rem;
	}

	.lothis-chat-empty .lothis-chat-eyebrow {
		display: none;
	}

	.lothis-chat-empty h1 {
		font-size: clamp(2rem, 10vw, 2.75rem);
		line-height: 1.02;
	}

	.lothis-chat-intro {
		margin-top: 0.55rem;
		font-size: 0.92rem;
		line-height: 1.42;
	}

	.lothis-chat-starters {
		gap: 0.45rem;
		margin-top: 1rem;
	}

	.lothis-chat-starters button {
		min-height: var(--lothis-control-hit, 2.75rem);
		padding-block: 0.45rem;
	}

	.lothis-chat-starters button:nth-child(n + 3) {
		display: none;
	}
}

@media (orientation: landscape) and (max-height: 500px) {
	.lothis-chat-main {
		padding-top: 0.45rem;
		padding-bottom: 0.45rem;
	}

	.lothis-chat-empty {
		padding: 0.35rem 0;
	}

	.lothis-chat-breathing-mark,
	.lothis-chat-empty .lothis-chat-eyebrow,
	.lothis-chat-intro {
		display: none;
	}

	.lothis-chat-empty h1 {
		font-size: clamp(1.8rem, 5vw, 2.45rem);
	}

	.lothis-chat-starters {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		margin-top: 0.7rem;
	}

	.lothis-chat-starters button {
		min-height: var(--lothis-control-hit, 2.75rem);
	}

	.lothis-chat-starters button:nth-child(n + 3) {
		display: none;
	}

	.lothis-chat-atmosphere {
		position: static;
	}

	.lothis-chat-atmosphere-panel {
		top: calc(100% + 0.45rem);
		right: max(0.7rem, env(safe-area-inset-right));
		left: auto;
		width: min(20rem, calc(100vw - 1.4rem));
		max-width: calc(100vw - 1.4rem);
	}

	.lothis-chat-composer-shell {
		padding-top: 0.65rem;
	}

}

@media (prefers-reduced-motion: reduce) {
	.lothis-chat-breathing-mark,
	.lothis-chat-login-mark,
	.lothis-chat-thinking-mark,
		.lothis-chat-thinking-dots i,
		.lothis-chat-message,
		.lothis-chat-onboarding-step,
		.lothis-chat-empty.is-arriving > :not(.lothis-chat-empty-glow),
		.lothis-chat-history-item {
			animation: none !important;
		}

	.lothis-chat-breathing-mark::after,
		.lothis-chat-login-mark::after,
		.lothis-chat-onboarding-brand::before,
		.lothis-chat-sidebar-mark::after {
		opacity: 0.16;
		animation: none !important;
		transform: scale(0.92);
	}

	.lothis-chat-onboarding-progress i {
		transition: none !important;
	}

		.lothis-chat-atmosphere-panel,
		.lothis-chat-sidebar,
		.lothis-chat-sidebar-backdrop,
		.lothis-chat-empty-glow,
		.lothis-chat-dialog,
	.lothis-chat-dialog::backdrop {
		animation: none !important;
		transition: none !important;
	}

	.lothis-chat-main {
		scroll-behavior: auto;
	}
}

@media (prefers-reduced-transparency: reduce) {
		.lothis-chat-topbar,
		.lothis-chat-sidebar,
		.lothis-chat-sidebar-backdrop,
	.lothis-chat-icon-button,
	.lothis-chat-account-button,
	.lothis-chat-atmosphere > summary,
	.lothis-chat-atmosphere-panel,
	.lothis-chat-composer,
		.lothis-chat-dialog,
		.lothis-chat-onboarding-header,
		.lothis-chat-onboarding-footer,
		.lothis-chat-onboarding-choice,
		.lothis-chat-onboarding-check,
		.lothis-chat-onboarding-preview,
		.lothis-chat-personalization-nudge,
		.lothis-chat-account-plan,
		.lothis-chat-plan-badge,
		.lothis-chat-account-plan-badge,
		.lothis-chat-starters button,
			.lothis-chat-guest-gate {
		background: var(--lothis-surface-solid);
		-webkit-backdrop-filter: none;
		backdrop-filter: none;
	}

	.lothis-chat-empty-glow,
	.lothis-chat-app::before {
		display: none;
	}
}

@media (prefers-contrast: more) {
		.lothis-chat-topbar,
		.lothis-chat-sidebar,
		.lothis-chat-sidebar-new,
		.lothis-chat-history-item,
	.lothis-chat-icon-button,
	.lothis-chat-account-button,
	.lothis-chat-atmosphere > summary,
	.lothis-chat-atmosphere-panel,
	.lothis-chat-starters button,
	.lothis-chat-composer,
		.lothis-chat-dialog,
		.lothis-chat-onboarding-choice,
		.lothis-chat-onboarding-check,
		.lothis-chat-onboarding-preview,
		.lothis-chat-personalization-nudge,
		.lothis-chat-field input,
		.lothis-chat-field select,
		.lothis-chat-account-plan,
		.lothis-chat-plan-badge,
		.lothis-chat-account-plan-badge,
		.lothis-chat-consent,
		.lothis-chat-guest-gate {
		border-width: 2px;
	}
}

@media (forced-colors: active) {
	.lothis-chat-palette-grid button[aria-pressed="true"]::after {
		border: 1px solid ButtonText;
		background: Canvas;
		color: CanvasText;
	}

	.lothis-chat-account-avatar,
	.lothis-chat-account-large-avatar {
		border: 1px solid ButtonText;
	}

	.lothis-chat-guest-gate,
	.lothis-chat-guest-gate__action {
		border: 1px solid ButtonText;
	}

		.lothis-chat-brand-mark,
		.lothis-chat-sidebar-mark,
	.lothis-chat-breathing-mark,
	.lothis-chat-login-mark,
	.lothis-chat-thinking-mark,
	.lothis-chat-message--assistant::before,
	.lothis-chat-onboarding-brand > span {
		forced-color-adjust: none;
	}
}

@media print {
	.lothis-chat-app,
	.lothis-chat-skip {
		display: none !important;
	}
}
