.gpd-ai {
	--gpd-ink: #f5f1e8;
	--gpd-muted: #b7b1a5;
	--gpd-deep: #080a10;
	--gpd-panel: rgba(18, 20, 28, 0.82);
	--gpd-line: rgba(255, 255, 255, 0.13);
	--gpd-gold: #d8b36a;
	--gpd-gold-bright: #f0d28e;
	--gpd-blue: #83b8ff;
	--gpd-radius: 1.5rem;
	position: relative;
	isolation: isolate;
	box-sizing: border-box;
	width: 100%;
	color: var(--gpd-ink);
	font-family: var(--wp--preset--font-family--body, "Inter", "Helvetica Neue", Arial, sans-serif);
	-webkit-font-smoothing: antialiased;
}

.gpd-ai *,
.gpd-ai *::before,
.gpd-ai *::after {
	box-sizing: inherit;
}

.gpd-ai--search {
	display: grid;
	min-height: clamp(34rem, 78svh, 54rem);
	place-items: center;
	overflow: hidden;
	padding: clamp(5rem, 11vw, 10rem) clamp(1rem, 4vw, 3rem);
	background:
		radial-gradient(circle at 50% 12%, rgba(96, 126, 184, 0.22), transparent 36rem),
		radial-gradient(circle at 8% 82%, rgba(178, 131, 56, 0.12), transparent 30rem),
		linear-gradient(145deg, #07090f 0%, #0b0d14 54%, #08090d 100%);
}

.gpd-ai--search::before {
	position: absolute;
	z-index: -1;
	inset: 0;
	background-image:
		linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
		linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
	background-size: 4.5rem 4.5rem;
	content: "";
	mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.55), transparent 88%);
}

.gpd-ai__search-inner {
	width: min(100%, 60rem);
	text-align: center;
}

.gpd-ai__eyebrow {
	margin: 0 0 1rem;
	color: var(--gpd-gold-bright);
	font-size: clamp(0.69rem, 1.2vw, 0.78rem);
	font-weight: 720;
	letter-spacing: 0.18em;
	line-height: 1.3;
	text-transform: uppercase;
}

.gpd-ai__search-inner > h2,
.gpd-ai__intro > :is(h1, h2) {
	margin: 0;
	color: var(--gpd-ink);
	font-family: var(--wp--preset--font-family--heading, "Iowan Old Style", "Palatino Linotype", Georgia, serif);
	font-size: clamp(2.35rem, 6vw, 5.5rem);
	font-weight: 500;
	letter-spacing: -0.045em;
	line-height: 0.98;
	text-wrap: balance;
}

.gpd-ai__composer {
	display: flex;
	align-items: flex-end;
	width: min(100%, 55rem);
	min-height: 4.25rem;
	margin: clamp(2rem, 5vw, 3.5rem) auto 0;
	padding: 0.55rem 0.6rem 0.55rem 1.35rem;
	border: 1px solid rgba(255, 255, 255, 0.18);
	border-radius: 999px;
	background: rgba(247, 244, 237, 0.97);
	box-shadow:
		0 1.5rem 4.5rem rgba(0, 0, 0, 0.38),
		inset 0 1px 0 rgba(255, 255, 255, 0.82);
	transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.gpd-ai__composer:focus-within {
	border-color: rgba(216, 179, 106, 0.9);
	box-shadow:
		0 1.6rem 5rem rgba(0, 0, 0, 0.45),
		0 0 0 4px rgba(216, 179, 106, 0.13);
}

.gpd-ai__composer input,
.gpd-ai__composer textarea {
	min-width: 0;
	flex: 1 1 auto;
	margin: 0;
	padding: 0.78rem 0.25rem;
	border: 0;
	border-radius: 0;
	outline: 0;
	background: transparent;
	box-shadow: none;
	color: #151821;
	font: inherit;
	font-size: clamp(1rem, 2vw, 1.08rem);
	line-height: 1.45;
}

.gpd-ai__composer :is(input, textarea):focus-visible {
	outline: 3px solid var(--gpd-blue);
	outline-offset: 3px;
}

.gpd-ai__composer textarea {
	min-height: 2.5rem;
	max-height: 11rem;
	resize: none;
	overflow-y: auto;
}

.gpd-ai__composer input::placeholder,
.gpd-ai__composer textarea::placeholder {
	color: #656a75;
	opacity: 1;
}

.gpd-ai__submit {
	display: inline-grid;
	width: 3.1rem;
	height: 3.1rem;
	flex: 0 0 3.1rem;
	place-items: center;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #11141c;
	box-shadow: none;
	color: #fff;
	cursor: pointer;
	font: inherit;
	font-size: 1.35rem;
	line-height: 1;
	transition: background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.gpd-ai__submit:hover {
	background: #2b2418;
	color: var(--gpd-gold-bright);
	transform: translateY(-1px);
}

.gpd-ai__submit:focus-visible {
	outline: 3px solid var(--gpd-blue);
	outline-offset: 3px;
}

.gpd-ai__submit:disabled {
	cursor: wait;
	opacity: 0.45;
	transform: none;
}

.gpd-ai__search-note {
	margin: 1rem 0 0;
	color: var(--gpd-muted);
	font-size: 0.82rem;
	letter-spacing: 0.015em;
}

.gpd-ai__noscript {
	margin: 0.85rem auto 0;
	color: var(--gpd-muted);
	font-size: 0.86rem;
	line-height: 1.55;
	text-align: center;
}

.gpd-ai__noscript a {
	color: var(--gpd-gold-bright);
}

.gpd-ai--chat {
	min-height: min(79svh, 58rem);
	padding: clamp(1.5rem, 4vw, 3rem) clamp(0.75rem, 3vw, 2rem);
	border: 1px solid var(--gpd-line);
	border-radius: clamp(1.25rem, 3vw, 2.25rem);
	background:
		radial-gradient(circle at 50% 5%, rgba(92, 118, 165, 0.18), transparent 29rem),
		linear-gradient(160deg, rgba(11, 13, 20, 0.985), rgba(7, 8, 12, 0.99));
	box-shadow: 0 2rem 6rem rgba(0, 0, 0, 0.25);
}

.gpd-ai__stage {
	display: flex;
	width: min(100%, 68rem);
	min-height: calc(min(79svh, 58rem) - clamp(3rem, 8vw, 6rem));
	margin: 0 auto;
	flex-direction: column;
	justify-content: center;
}

.gpd-ai__intro {
	width: min(100%, 57rem);
	margin: 0 auto;
	text-align: center;
	transition: opacity 180ms ease, transform 180ms ease;
}

.gpd-ai--chat .gpd-ai__intro > :is(h1, h2) {
	font-size: clamp(2.35rem, 6vw, 4.9rem);
}

.gpd-ai--chat .gpd-ai__composer-wrap {
	width: min(100%, 57rem);
	margin: 0 auto;
}

.gpd-ai--chat .gpd-ai__composer {
	margin-top: clamp(1.75rem, 4vw, 3rem);
}

.gpd-ai__messages {
	display: flex;
	width: min(100%, 54rem);
	margin: 0 auto;
	padding: 1rem 0 2rem;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 1.25rem;
}

.gpd-ai__messages:empty {
	display: none;
}

.gpd-ai--chat.has-thread .gpd-ai__stage {
	justify-content: flex-start;
}

.gpd-ai--chat.has-thread .gpd-ai__intro {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
}

.gpd-ai--chat.has-thread .gpd-ai__messages {
	display: flex;
}

.gpd-ai--chat.has-thread .gpd-ai__composer-wrap {
	position: sticky;
	z-index: 4;
	bottom: max(0.75rem, env(safe-area-inset-bottom));
	padding-top: 0.4rem;
	background: linear-gradient(to bottom, transparent, rgba(7, 8, 12, 0.96) 28%);
}

.gpd-ai--chat.has-thread .gpd-ai__composer {
	margin-top: 0.75rem;
	box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.45);
}

.gpd-ai__message {
	display: flex;
	width: 100%;
	animation: gpd-message-in 260ms ease both;
}

.gpd-ai__message--user {
	justify-content: flex-end;
}

.gpd-ai__message-body {
	max-width: min(88%, 46rem);
	color: var(--gpd-ink);
	font-size: clamp(0.98rem, 1.4vw, 1.08rem);
	line-height: 1.72;
	overflow-wrap: anywhere;
}

.gpd-ai__message--user .gpd-ai__message-body {
	padding: 0.8rem 1.1rem;
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 1.2rem 1.2rem 0.35rem 1.2rem;
	background: rgba(255, 255, 255, 0.09);
	color: #f7f4ed;
}

.gpd-ai__message--assistant .gpd-ai__message-body {
	width: 100%;
	max-width: 100%;
	padding: 0.2rem 0;
}

.gpd-ai__message-body > :first-child {
	margin-top: 0;
}

.gpd-ai__message-body > :last-child {
	margin-bottom: 0;
}

.gpd-ai__message-body p,
.gpd-ai__message-body ul,
.gpd-ai__message-body ol,
.gpd-ai__message-body blockquote,
.gpd-ai__message-body pre {
	margin: 0 0 1rem;
}

.gpd-ai__message-body ul,
.gpd-ai__message-body ol {
	padding-inline-start: 1.4rem;
}

.gpd-ai__message-body li + li {
	margin-top: 0.45rem;
}

.gpd-ai__message-body h3,
.gpd-ai__message-body h4,
.gpd-ai__message-body h5,
.gpd-ai__message-body h6 {
	margin: 1.6rem 0 0.65rem;
	color: #fff;
	font-family: var(--wp--preset--font-family--heading, Georgia, serif);
	font-size: clamp(1.15rem, 2vw, 1.45rem);
	font-weight: 620;
	letter-spacing: -0.015em;
	line-height: 1.25;
}

.gpd-ai__message-body strong {
	color: #fff;
	font-weight: 720;
}

.gpd-ai__message-body code {
	padding: 0.12rem 0.35rem;
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 0.35rem;
	background: rgba(255, 255, 255, 0.07);
	color: #f5d99d;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 0.88em;
}

.gpd-ai__message-body pre {
	max-width: 100%;
	overflow-x: auto;
	padding: 1rem;
	border: 1px solid var(--gpd-line);
	border-radius: 0.8rem;
	background: rgba(0, 0, 0, 0.3);
}

.gpd-ai__message-body pre code {
	padding: 0;
	border: 0;
	background: none;
	color: #e8e6df;
}

.gpd-ai__message-body blockquote {
	padding: 0.2rem 0 0.2rem 1rem;
	border-inline-start: 3px solid var(--gpd-gold);
	color: #d4cfc4;
}

.gpd-ai__message-body .gpd-ai__upgrade-callout {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.35rem;
	margin-top: 1rem;
	padding: 0.8rem 1rem;
	border: 1px solid rgba(216, 178, 92, 0.28);
	border-radius: 0.8rem;
	background: rgba(216, 178, 92, 0.08);
	color: #d9d5ca;
	font-size: 0.94rem;
}

.gpd-ai__upgrade-callout a {
	color: #f1d28c;
	font-weight: 720;
	text-underline-offset: 0.18em;
}

.gpd-ai__thinking {
	display: inline-flex;
	align-items: center;
	min-height: 2rem;
	gap: 0.3rem;
}

.gpd-ai__thinking i {
	width: 0.42rem;
	height: 0.42rem;
	border-radius: 50%;
	background: var(--gpd-gold);
	animation: gpd-thinking 1.1s ease-in-out infinite;
}

.gpd-ai__thinking i:nth-child(2) { animation-delay: 130ms; }
.gpd-ai__thinking i:nth-child(3) { animation-delay: 260ms; }

.gpd-ai__meta {
	display: flex;
	min-height: 1.5rem;
	align-items: center;
	justify-content: center;
	gap: 0.75rem;
	padding: 0.55rem 0.65rem 0;
	color: var(--gpd-muted);
	font-size: 0.77rem;
	line-height: 1.35;
	text-align: center;
}

.gpd-ai__meta p {
	margin: 0;
}

.gpd-ai__meta a {
	color: var(--gpd-gold-bright);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.18em;
}

.gpd-ai__meta a[hidden] {
	display: none;
}

.gpd-math {
	color: #fff7e6;
}

.gpd-math--inline {
	display: inline-flex;
	align-items: baseline;
	max-width: 100%;
	margin-inline: 0.08em;
	vertical-align: -0.08em;
}

.gpd-math--display {
	display: block;
	width: 100%;
	max-width: 100%;
	margin: 1.3rem 0;
	overflow-x: auto;
	padding: 1rem 1.25rem;
	border: 1px solid rgba(216, 179, 106, 0.25);
	border-radius: 0.75rem;
	background: rgba(216, 179, 106, 0.055);
	font-size: clamp(1.05rem, 2.4vw, 1.3rem);
	line-height: 1.85;
	text-align: center;
	white-space: nowrap;
	scrollbar-width: thin;
}

.gpd-math .katex {
	color: inherit;
	font-size: 1.04em;
}

.gpd-ai-plan-limits dl {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 1rem;
	margin: 0;
}

.gpd-ai-plan-limits dl > div {
	padding: 1rem;
	border: 1px solid currentColor;
	border-radius: 0.75rem;
}

.gpd-ai-plan-limits dt {
	font-weight: 700;
}

.gpd-ai-plan-limits dd {
	margin: 0.3rem 0 0;
}

.gpd-ai .screen-reader-text {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	margin: -1px !important;
	overflow: hidden !important;
	padding: 0 !important;
	border: 0 !important;
	clip: rect(0 0 0 0) !important;
	clip-path: inset(50%) !important;
	white-space: nowrap !important;
}

@keyframes gpd-message-in {
	from { opacity: 0; transform: translateY(0.45rem); }
	to { opacity: 1; transform: translateY(0); }
}

@keyframes gpd-thinking {
	0%, 70%, 100% { opacity: 0.35; transform: translateY(0); }
	35% { opacity: 1; transform: translateY(-0.22rem); }
}

@media (max-width: 700px) {
	.gpd-ai--search {
		min-height: 72svh;
		padding-inline: 0.85rem;
	}

	.gpd-ai h2 {
		font-size: clamp(2.25rem, 12vw, 3.6rem);
	}

	.gpd-ai__composer {
		min-height: 3.85rem;
		padding: 0.42rem 0.45rem 0.42rem 1rem;
	}

	.gpd-ai__submit {
		width: 2.95rem;
		height: 2.95rem;
		flex-basis: 2.95rem;
	}

	.gpd-ai--chat {
		min-height: 76svh;
		padding: 1.1rem 0.7rem;
		border-radius: 1.25rem;
	}

	.gpd-ai__stage {
		min-height: calc(76svh - 2.2rem);
	}

	.gpd-ai__message-body {
		max-width: 94%;
		font-size: 0.98rem;
		line-height: 1.65;
	}

	.gpd-ai__messages {
		padding-inline: 0.2rem;
	}

	.gpd-ai--chat.has-thread .gpd-ai__composer-wrap {
		bottom: max(0.35rem, env(safe-area-inset-bottom));
	}

	.gpd-ai-plan-limits dl {
		grid-template-columns: 1fr;
	}
}

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

@media (forced-colors: active) {
	.gpd-ai__composer,
	.gpd-ai__message--user .gpd-ai__message-body,
	.gpd-math--display {
		border: 1px solid CanvasText;
	}

	.gpd-ai__submit {
		border: 1px solid ButtonText;
	}

	.gpd-ai__composer :is(input, textarea):focus-visible,
	.gpd-ai__submit:focus-visible {
		outline: 3px solid Highlight;
		outline-offset: 3px;
	}
}
