/* AllBlogIdeas AI Chat - widget styles.
 * Everything is scoped under #abi-root so the theme cannot break the widget and
 * the widget cannot break the theme. See DESIGN.md for the design system.
 */

/* ============================================================
 * Tokens
 * ============================================================ */
#abi-root {
	/* Light (default). */
	--abi-accent: #c2410c;
	--abi-accent-deep: #9a3412;
	--abi-accent-tint: #fef2ec;
	--abi-on-accent: #ffffff;
	--abi-bg: #fffdfb;
	--abi-surface: #fbf7f4;
	--abi-bubble-bot: #ffffff;
	--abi-border: transparent;
	--abi-text: #2a1d16;
	--abi-text-soft: #6b5a4f;
	--abi-success: #25d366;

	--abi-shadow-launcher: 0 8px 24px rgba(154, 52, 18, .30);
	--abi-shadow-panel: 0 1px 2px rgba(40, 20, 10, .06), 0 24px 60px rgba(40, 20, 10, .20);
	--abi-shadow-card: 0 1px 2px rgba(40, 20, 10, .05), 0 6px 18px rgba(40, 20, 10, .10);

	--abi-font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	--abi-font-display: "Fraunces", Georgia, "Times New Roman", serif;

	--abi-radius-panel: 20px;
	--abi-radius-bubble: 16px;
	--abi-radius-pill: 14px;

	--abi-ease-spring: cubic-bezier(.22, 1, .36, 1);

	--abi-z: 2147483000;

	/* Launcher anchor (overridable from settings to avoid theme buttons such as
	 * a scroll-to-top control). --abi-edge-y is the gap from the bottom; the
	 * panel/nudge sit above the 60px launcher plus a 12px gap. */
	--abi-edge-x: 24px;
	--abi-edge-y: 24px;

	/* Launcher look (overridable from settings). The panel/nudge sit a fixed
	 * 12px above the launcher, so the stack gap tracks the launcher size. */
	--abi-launch-size: 60px;
	--abi-launch-bg: linear-gradient(135deg, var(--abi-accent), var(--abi-accent-deep));
	--abi-launch-ring: 0 0 0 0 rgba(0, 0, 0, 0);
	--abi-stack-gap: calc(var(--abi-launch-size) + 12px);
}

/* Dark via OS preference, unless the visitor/setting forced light. */
@media (prefers-color-scheme: dark) {
	#abi-root:not([data-theme="light"]) {
		--abi-accent: #e2632b;
		--abi-accent-deep: #c2410c;
		--abi-accent-tint: #3a241a;
		--abi-bg: #1b1410;
		--abi-surface: #221a14;
		--abi-bubble-bot: #2a201a;
		--abi-border: transparent;
		--abi-text: #f5ebe4;
		--abi-text-soft: #c9b8ad;

		--abi-shadow-launcher: 0 8px 28px rgba(0, 0, 0, .55);
		--abi-shadow-panel: 0 1px 2px rgba(0, 0, 0, .4), 0 24px 60px rgba(0, 0, 0, .55);
		--abi-shadow-card: 0 1px 2px rgba(0, 0, 0, .35), 0 6px 18px rgba(0, 0, 0, .45);
	}
}

/* Forced dark (settings / toggle). */
#abi-root[data-theme="dark"] {
	--abi-accent: #e2632b;
	--abi-accent-deep: #c2410c;
	--abi-accent-tint: #3a241a;
	--abi-bg: #1b1410;
	--abi-surface: #221a14;
	--abi-bubble-bot: #2a201a;
	--abi-border: transparent;
	--abi-text: #f5ebe4;
	--abi-text-soft: #c9b8ad;

	--abi-shadow-launcher: 0 8px 28px rgba(0, 0, 0, .55);
	--abi-shadow-panel: 0 1px 2px rgba(0, 0, 0, .4), 0 24px 60px rgba(0, 0, 0, .55);
	--abi-shadow-card: 0 1px 2px rgba(0, 0, 0, .35), 0 6px 18px rgba(0, 0, 0, .45);
}

/* ============================================================
 * Reset (contained)
 * ============================================================ */
#abi-root,
#abi-root *,
#abi-root *::before,
#abi-root *::after {
	box-sizing: border-box;
}

#abi-root {
	font-family: var(--abi-font-body);
	font-size: 14px;
	line-height: 1.5;
	color: var(--abi-text);
	text-align: left;
	font-weight: 400;
	letter-spacing: normal;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

#abi-root button {
	font: inherit;
	color: inherit;
	background: none;
	border: none;
	margin: 0;
	padding: 0;
	cursor: pointer;
	text-align: inherit;
}

#abi-root input,
#abi-root textarea {
	font: inherit;
	color: inherit;
	margin: 0;
	background: none;
}

#abi-root p,
#abi-root h4 {
	margin: 0;
	font-weight: inherit;
}

#abi-root a {
	color: var(--abi-accent);
	text-decoration: none;
	font-weight: 600;
}

#abi-root a:hover {
	text-decoration: underline;
}

#abi-root img,
#abi-root svg {
	display: block;
	max-width: 100%;
}

#abi-root ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

#abi-root :focus-visible {
	outline: 2px solid var(--abi-accent);
	outline-offset: 2px;
	border-radius: 6px;
}

/* ============================================================
 * Launcher
 * ============================================================ */
#abi-root .abi-launcher {
	position: fixed;
	right: var(--abi-edge-x);
	bottom: var(--abi-edge-y);
	z-index: var(--abi-z);
	width: var(--abi-launch-size);
	height: var(--abi-launch-size);
	border-radius: 50%;
	background: var(--abi-launch-bg);
	color: var(--abi-on-accent);
	box-shadow: var(--abi-shadow-launcher), var(--abi-launch-ring);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform .18s var(--abi-ease-spring), box-shadow .18s ease;
}

/* Left-corner placement (setting). Flip horizontal anchor + open origin. */
#abi-root[data-pos="left"] .abi-launcher,
#abi-root[data-pos="left"] .abi-nudge,
#abi-root[data-pos="left"] .abi-panel {
	right: auto;
	left: var(--abi-edge-x);
}

#abi-root[data-pos="left"] .abi-panel {
	transform-origin: bottom left;
}

#abi-root[data-pos="left"] .abi-nudge {
	border-bottom-right-radius: var(--abi-radius-bubble);
	border-bottom-left-radius: 4px;
}

#abi-root .abi-launcher:hover {
	transform: scale(1.06);
}

#abi-root .abi-launcher:active {
	transform: scale(.96);
}

#abi-root .abi-launcher svg {
	width: calc(var(--abi-launch-size) * .44);
	height: calc(var(--abi-launch-size) * .44);
	position: absolute;
	transition: opacity .2s ease, transform .25s var(--abi-ease-spring);
}

#abi-root .abi-launcher .abi-ico-close {
	opacity: 0;
	transform: rotate(-45deg) scale(.6);
}

#abi-root.is-open .abi-launcher .abi-ico-chat {
	opacity: 0;
	transform: rotate(45deg) scale(.6);
}

#abi-root.is-open .abi-launcher .abi-ico-close {
	opacity: 1;
	transform: rotate(0) scale(1);
}

/* One-time attention pulse ~4s after load. */
#abi-root .abi-launcher::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: 50%;
	box-shadow: 0 0 0 0 rgba(194, 65, 12, .45);
	opacity: 0;
}

#abi-root.abi-pulse .abi-launcher::after {
	animation: abi-pulse 1.6s var(--abi-ease-spring) 2;
}

@keyframes abi-pulse {
	0% { box-shadow: 0 0 0 0 rgba(194, 65, 12, .45); opacity: 1; }
	100% { box-shadow: 0 0 0 18px rgba(194, 65, 12, 0); opacity: 0; }
}

/* Unread dot. */
#abi-root .abi-launcher .abi-dot {
	position: absolute;
	top: 2px;
	right: 2px;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: #ef4444;
	border: 2px solid var(--abi-bg);
	transform: scale(0);
	transition: transform .2s var(--abi-ease-spring);
}

#abi-root.has-unread .abi-launcher .abi-dot {
	transform: scale(1);
}

/* ============================================================
 * Nudge teaser
 * ============================================================ */
#abi-root .abi-nudge {
	position: fixed;
	right: var(--abi-edge-x);
	bottom: calc(var(--abi-edge-y) + var(--abi-stack-gap));
	z-index: var(--abi-z);
	max-width: 240px;
	display: none;
	align-items: flex-start;
	gap: 8px;
	padding: 12px 14px;
	background: var(--abi-bubble-bot);
	color: var(--abi-text);
	border: 1px solid var(--abi-border);
	border-radius: var(--abi-radius-bubble);
	border-bottom-right-radius: 4px;
	box-shadow: var(--abi-shadow-card);
	font-size: 13px;
	line-height: 1.45;
}

#abi-root.nudge-visible .abi-nudge {
	display: flex;
	animation: abi-rise 260ms var(--abi-ease-spring) both;
}

#abi-root .abi-nudge-close {
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
	color: var(--abi-text-soft);
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
}

#abi-root .abi-nudge-close:hover {
	background: var(--abi-surface);
}

/* ============================================================
 * Panel
 * ============================================================ */
#abi-root .abi-panel {
	position: fixed;
	right: var(--abi-edge-x);
	bottom: calc(var(--abi-edge-y) + var(--abi-stack-gap));
	z-index: var(--abi-z);
	width: 384px;
	height: 600px;
	max-width: calc(100vw - 32px);
	max-height: calc(100vh - 120px);
	background: var(--abi-bg);
	border: 1px solid var(--abi-border);
	border-radius: var(--abi-radius-panel);
	box-shadow: var(--abi-shadow-panel);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	transform-origin: bottom right;
	opacity: 0;
	transform: scale(.96);
	pointer-events: none;
	transition: opacity .22s var(--abi-ease-spring), transform .22s var(--abi-ease-spring);
}

#abi-root.is-open .abi-panel {
	opacity: 1;
	transform: scale(1);
	pointer-events: auto;
}

#abi-root .abi-panel[hidden] {
	display: none;
}

/* ============================================================
 * Header
 * ============================================================ */
#abi-root .abi-header {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 16px;
	background: linear-gradient(135deg, var(--abi-accent), var(--abi-accent-deep));
	color: var(--abi-on-accent);
	position: relative;
}

#abi-root .abi-avatar {
	width: 40px;
	height: 40px;
	border-radius: 12px;
	flex: 0 0 auto;
	box-shadow: 0 2px 6px rgba(0, 0, 0, .18);
}

#abi-root .abi-brand {
	flex: 1 1 auto;
	min-width: 0;
}

#abi-root .abi-title {
	font-family: var(--abi-font-display);
	font-size: 16px;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: .2px;
}

#abi-root .abi-subtitle {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 12px;
	font-weight: 500;
	opacity: .92;
	margin-top: 2px;
}

#abi-root .abi-status-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--abi-success);
	box-shadow: 0 0 0 2px rgba(255, 255, 255, .35);
	flex: 0 0 auto;
}

#abi-root .abi-header-actions {
	display: flex;
	align-items: center;
	gap: 2px;
	flex: 0 0 auto;
}

#abi-root .abi-iconbtn {
	width: 32px;
	height: 32px;
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--abi-on-accent);
	opacity: .9;
	transition: background .15s ease, opacity .15s ease;
}

#abi-root .abi-iconbtn:hover {
	background: rgba(255, 255, 255, .16);
	opacity: 1;
}

#abi-root .abi-iconbtn svg {
	width: 18px;
	height: 18px;
}

/* Overflow menu */
#abi-root .abi-menu {
	position: absolute;
	top: 52px;
	right: 12px;
	min-width: 150px;
	background: var(--abi-bubble-bot);
	color: var(--abi-text);
	border: 1px solid var(--abi-border);
	border-radius: 12px;
	box-shadow: var(--abi-shadow-card);
	padding: 6px;
	display: none;
	z-index: 2;
}

#abi-root .abi-menu[data-open="1"] {
	display: block;
	animation: abi-rise 160ms var(--abi-ease-spring) both;
}

#abi-root .abi-menu button {
	display: flex;
	align-items: center;
	gap: 8px;
	width: 100%;
	padding: 9px 10px;
	border-radius: 8px;
	font-size: 13px;
	color: var(--abi-text);
}

#abi-root .abi-menu button:hover {
	background: var(--abi-surface);
}

#abi-root .abi-menu svg {
	width: 15px;
	height: 15px;
	color: var(--abi-text-soft);
}

/* ============================================================
 * Body / messages
 * ============================================================ */
#abi-root .abi-body {
	position: relative;
	flex: 1 1 auto;
	overflow: hidden;
	display: flex;
	flex-direction: column;
}

#abi-root .abi-messages {
	flex: 1 1 auto;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 16px;
	background: var(--abi-surface);
	display: flex;
	flex-direction: column;
	gap: 12px;
	scroll-behavior: smooth;
}

#abi-root .abi-row {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	max-width: 100%;
}

#abi-root .abi-row.abi-from-user {
	flex-direction: row-reverse;
}

#abi-root .abi-row-avatar {
	width: 26px;
	height: 26px;
	border-radius: 8px;
	flex: 0 0 auto;
}

#abi-root .abi-col {
	display: flex;
	flex-direction: column;
	max-width: 84%;
	min-width: 0;
}

#abi-root .abi-from-user .abi-col {
	align-items: flex-end;
}

#abi-root .abi-from-bot .abi-col {
	align-items: flex-start;
}

#abi-root .abi-bubble {
	position: relative;
	max-width: 100%;
	padding: 10px 13px;
	border-radius: var(--abi-radius-bubble);
	font-size: 14px;
	line-height: 1.5;
	word-wrap: break-word;
	overflow-wrap: anywhere;
	animation: abi-rise 260ms var(--abi-ease-spring) both;
	/* Inherited from the row; drives the DESIGN.md 40ms entrance cascade. */
	animation-delay: var(--abi-stagger, 0ms);
}

#abi-root .abi-from-bot .abi-bubble {
	background: var(--abi-bubble-bot);
	border: 1px solid var(--abi-border);
	color: var(--abi-text);
	border-bottom-left-radius: 4px;
}

#abi-root .abi-from-user .abi-bubble {
	background: var(--abi-accent);
	color: var(--abi-on-accent);
	border-bottom-right-radius: 4px;
}

#abi-root .abi-from-user .abi-bubble a {
	color: var(--abi-on-accent);
	text-decoration: underline;
}

#abi-root .abi-bubble p + p {
	margin-top: 8px;
}

#abi-root .abi-bubble ul,
#abi-root .abi-bubble ol {
	margin: 6px 0 6px 18px;
	padding: 0;
	list-style: revert;
}

#abi-root .abi-bubble code {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 12.5px;
	background: var(--abi-accent-tint);
	padding: 1px 5px;
	border-radius: 5px;
}

#abi-root .abi-from-user .abi-bubble code {
	background: rgba(255, 255, 255, .18);
}

#abi-root .abi-bubble pre {
	margin: 8px 0;
	padding: 10px 12px;
	background: var(--abi-surface);
	border: 1px solid var(--abi-border);
	border-radius: var(--abi-radius-bubble);
	overflow-x: auto;
}

#abi-root .abi-bubble pre code {
	display: block;
	background: none;
	padding: 0;
	border-radius: 0;
	font-size: 12.5px;
	line-height: 1.5;
	white-space: pre;
	color: var(--abi-text);
}

#abi-root .abi-from-user .abi-bubble pre {
	background: rgba(255, 255, 255, .14);
	border-color: rgba(255, 255, 255, .22);
}

#abi-root .abi-from-user .abi-bubble pre code {
	color: var(--abi-on-accent);
}

/* Timestamp on hover */
#abi-root .abi-time {
	font-size: 11px;
	color: var(--abi-text-soft);
	margin: 2px 6px 0;
	opacity: 0;
	transition: opacity .15s ease;
	align-self: flex-end;
}

#abi-root .abi-from-bot .abi-time {
	align-self: flex-start;
}

#abi-root .abi-row:hover .abi-time,
#abi-root .abi-row:focus-within .abi-time {
	opacity: 1;
}

/* Typing indicator */
#abi-root .abi-typing {
	display: inline-flex;
	gap: 4px;
	align-items: center;
	padding: 13px;
}

#abi-root .abi-typing span {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--abi-text-soft);
	animation: abi-bounce 1.2s infinite ease-in-out;
}

#abi-root .abi-typing span:nth-child(2) { animation-delay: .15s; }
#abi-root .abi-typing span:nth-child(3) { animation-delay: .3s; }

@keyframes abi-bounce {
	0%, 80%, 100% { transform: translateY(0); opacity: .5; }
	40% { transform: translateY(-5px); opacity: 1; }
}

/* Streaming caret (reserved for /stream) */
#abi-root .abi-caret::after {
	content: "";
	display: inline-block;
	width: 2px;
	height: 1em;
	margin-left: 2px;
	vertical-align: text-bottom;
	background: currentColor;
	animation: abi-blink 1s steps(2) infinite;
}

@keyframes abi-blink {
	0%, 50% { opacity: 1; }
	50.01%, 100% { opacity: 0; }
}

/* Welcome */
#abi-root .abi-welcome {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

#abi-root .abi-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 2px;
}

#abi-root .abi-chip {
	background: var(--abi-bubble-bot);
	border: 1px solid var(--abi-border);
	color: var(--abi-accent-deep);
	font-size: 12.5px;
	font-weight: 500;
	padding: 8px 12px;
	border-radius: var(--abi-radius-pill);
	transition: background .15s ease, transform .12s var(--abi-ease-spring), border-color .15s ease;
}

#abi-root[data-theme="dark"] .abi-chip,
#abi-root:not([data-theme="light"]) .abi-chip {
	color: var(--abi-text);
}

#abi-root .abi-chip:hover {
	background: var(--abi-accent-tint);
	border-color: var(--abi-accent);
}

#abi-root .abi-chip:active {
	transform: scale(.96);
}

/* Scroll-to-latest */
#abi-root .abi-scrollbtn {
	position: absolute;
	left: 50%;
	bottom: 12px;
	transform: translateX(-50%) translateY(8px);
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: var(--abi-bubble-bot);
	color: var(--abi-accent);
	border: 1px solid var(--abi-border);
	box-shadow: var(--abi-shadow-card);
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	pointer-events: none;
	transition: opacity .18s ease, transform .18s var(--abi-ease-spring);
}

#abi-root .abi-scrollbtn svg {
	width: 16px;
	height: 16px;
}

#abi-root.show-scrollbtn .abi-scrollbtn {
	opacity: 1;
	pointer-events: auto;
	transform: translateX(-50%) translateY(0);
}

/* ============================================================
 * Cards (handoff + newsletter)
 * ============================================================ */
#abi-root .abi-card {
	background: var(--abi-bubble-bot);
	border: 1px solid var(--abi-border);
	border-radius: var(--abi-radius-bubble);
	border-bottom-left-radius: 4px;
	padding: 14px;
	box-shadow: var(--abi-shadow-card);
	max-width: 92%;
	align-self: flex-start;
	animation: abi-rise 260ms var(--abi-ease-spring) both;
	animation-delay: var(--abi-stagger, 0ms);
}

#abi-root .abi-card-title {
	font-size: 13.5px;
	font-weight: 600;
	margin-bottom: 10px;
	color: var(--abi-text);
}

#abi-root .abi-cta {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

#abi-root .abi-btn {
	flex: 1 1 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	text-align: center;
	font-size: 13px;
	font-weight: 600;
	padding: 10px 12px;
	border-radius: 12px;
	transition: transform .12s var(--abi-ease-spring), filter .15s ease;
}

#abi-root .abi-btn svg {
	width: 16px;
	height: 16px;
}

#abi-root .abi-btn:hover {
	filter: brightness(.97);
	text-decoration: none;
}

#abi-root .abi-btn:active {
	transform: scale(.97);
}

#abi-root .abi-btn-wa {
	background: var(--abi-success);
	color: #fff;
}

#abi-root .abi-btn-email {
	background: var(--abi-surface);
	border: 1px solid var(--abi-border);
	color: var(--abi-accent-deep);
}

#abi-root:not([data-theme="light"]) .abi-btn-email {
	color: var(--abi-text);
}

/* Newsletter form */
#abi-root .abi-form {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

#abi-root .abi-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	opacity: 0;
}

#abi-root .abi-input {
	width: 100%;
	border: 1px solid var(--abi-border);
	border-radius: 12px;
	padding: 10px 12px;
	font-size: 13px;
	background: var(--abi-bg);
	color: var(--abi-text);
	transition: border-color .15s ease, box-shadow .15s ease;
}

#abi-root .abi-input::placeholder {
	color: var(--abi-text-soft);
}

#abi-root .abi-input:focus {
	outline: none;
	border-color: var(--abi-accent);
	box-shadow: 0 0 0 3px var(--abi-accent-tint);
}

#abi-root .abi-submit {
	background: var(--abi-accent);
	color: var(--abi-on-accent);
	border-radius: 12px;
	padding: 11px;
	font-size: 13px;
	font-weight: 600;
	transition: transform .12s var(--abi-ease-spring), filter .15s ease;
}

#abi-root .abi-submit:hover { filter: brightness(.97); }
#abi-root .abi-submit:active { transform: scale(.98); }

#abi-root .abi-submit[disabled] {
	opacity: .6;
	cursor: default;
}

#abi-root .abi-form-error {
	font-size: 12px;
	color: #dc2626;
	min-height: 0;
}

#abi-root .abi-card-done {
	font-size: 13.5px;
	line-height: 1.5;
	color: var(--abi-text);
	display: flex;
	align-items: center;
	gap: 8px;
}

#abi-root .abi-card-done svg {
	width: 18px;
	height: 18px;
	color: var(--abi-success);
	flex: 0 0 auto;
}

/* ============================================================
 * Composer
 * ============================================================ */
#abi-root .abi-composer {
	position: relative;
	flex: 0 0 auto;
	display: flex;
	align-items: flex-end;
	gap: 8px;
	padding: 12px;
	border-top: 1px solid var(--abi-border);
	background: var(--abi-bg);
}

#abi-root .abi-textarea {
	flex: 1 1 auto;
	resize: none;
	border: 1px solid var(--abi-border);
	border-radius: var(--abi-radius-pill);
	padding: 10px 14px;
	font-size: 14px;
	line-height: 1.4;
	max-height: 120px;
	overflow-y: auto;
	background: var(--abi-surface);
	color: var(--abi-text);
	transition: border-color .15s ease, box-shadow .15s ease;
}

#abi-root .abi-textarea::placeholder {
	color: var(--abi-text-soft);
}

#abi-root .abi-textarea:focus {
	outline: none;
	border-color: var(--abi-accent);
	box-shadow: 0 0 0 3px var(--abi-accent-tint);
}

#abi-root .abi-charcount {
	position: absolute;
	right: 60px;
	bottom: 18px;
	font-size: 10px;
	color: var(--abi-text-soft);
	opacity: 0;
	transition: opacity .15s ease;
	pointer-events: none;
}

#abi-root .abi-charcount.show {
	opacity: 1;
}

#abi-root .abi-charcount.over {
	color: #dc2626;
}

#abi-root .abi-send {
	flex: 0 0 auto;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: var(--abi-accent);
	color: var(--abi-on-accent);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform .12s var(--abi-ease-spring), opacity .15s ease, filter .15s ease;
}

#abi-root .abi-send svg {
	width: 18px;
	height: 18px;
}

#abi-root .abi-send:hover {
	filter: brightness(.96);
}

#abi-root .abi-send:active {
	transform: scale(.9);
}

#abi-root .abi-send[disabled] {
	opacity: .45;
	cursor: default;
}

/* ============================================================
 * Shared motion
 * ============================================================ */
@keyframes abi-rise {
	from { opacity: 0; transform: translateY(8px); }
	to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
 * Mobile takeover (<= 480px)
 * ============================================================ */
@media (max-width: 480px) {
	#abi-root .abi-panel {
		right: 0;
		bottom: 0;
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
		max-width: 100%;
		max-height: 100%;
		border-radius: 0;
		border: none;
	}

	/* Keep the launcher clear of the home indicator / gesture bar. */
	#abi-root .abi-launcher {
		bottom: calc(var(--abi-edge-y) + env(safe-area-inset-bottom));
	}

	#abi-root .abi-nudge {
		bottom: calc(var(--abi-edge-y) + var(--abi-stack-gap) + env(safe-area-inset-bottom));
	}

	#abi-root .abi-header {
		padding-top: calc(14px + env(safe-area-inset-top));
		padding-left: calc(16px + env(safe-area-inset-left));
		padding-right: calc(16px + env(safe-area-inset-right));
	}

	#abi-root .abi-composer {
		padding-bottom: calc(12px + env(safe-area-inset-bottom));
		padding-left: calc(12px + env(safe-area-inset-left));
		padding-right: calc(12px + env(safe-area-inset-right));
	}

	#abi-root .abi-messages {
		padding-left: calc(16px + env(safe-area-inset-left));
		padding-right: calc(16px + env(safe-area-inset-right));
	}

	#abi-root .abi-bubble {
		max-width: 85%;
	}
}

/* ============================================================
 * Reduced motion
 * ============================================================ */
@media (prefers-reduced-motion: reduce) {
	#abi-root *,
	#abi-root *::before,
	#abi-root *::after {
		animation-duration: .001ms !important;
		animation-delay: 0ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: .001ms !important;
		scroll-behavior: auto !important;
	}

	#abi-root.abi-pulse .abi-launcher::after {
		animation: none;
	}

	#abi-root .abi-panel {
		transition: opacity .12s linear;
		transform: none;
	}

	#abi-root.is-open .abi-panel {
		transform: none;
	}
}