.a21-assistant {
	--a21-brand: #0b3d91;
	--a21-brand-dark: #082c68;
	--a21-bg: #ffffff;
	--a21-soft: #f2f5fa;
	--a21-border: #d5dce8;
	--a21-text: #1a1f2b;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: var(--a21-text);
	box-sizing: border-box;
}
.a21-assistant *, .a21-assistant *::before, .a21-assistant *::after { box-sizing: inherit; }

/* ---------- panel ---------- */
.a21-panel {
	display: flex;
	flex-direction: column;
	background: var(--a21-bg);
	border: 1px solid var(--a21-border);
	border-radius: 14px;
	overflow: hidden;
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
}
.a21-inline .a21-panel {
	width: 100%;
	max-width: 560px;
	height: min(75vh, 680px);
	min-height: 420px;
	margin: 0 auto;
}

.a21-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 14px;
	background: var(--a21-brand);
	color: #fff;
}
.a21-title { font-weight: 600; font-size: 17px; }
.a21-head-btns { display: flex; align-items: center; gap: 8px; }
.a21-header .a21-link { color: #dbe6ff; }
.a21-close {
	background: transparent;
	border: 0;
	color: #fff;
	font-size: 28px;
	line-height: 1;
	min-width: 44px;
	min-height: 44px;
	cursor: pointer;
}

.a21-link {
	background: none;
	border: 0;
	padding: 8px;
	font-size: 14px;
	color: var(--a21-brand);
	text-decoration: underline;
	cursor: pointer;
}

/* ---------- messages ---------- */
.a21-messages {
	flex: 1 1 auto;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	padding: 14px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	background: var(--a21-soft);
}
.a21-msg {
	max-width: 88%;
	padding: 10px 13px;
	border-radius: 14px;
	font-size: 16px;
	line-height: 1.4;
	word-wrap: break-word;
	overflow-wrap: anywhere;
}
.a21-assistant .a21-msg a { color: inherit; text-decoration: underline; font-weight: 600; }

.a21-me { align-self: flex-end; background: var(--a21-brand); color: #fff; border-bottom-right-radius: 4px; }
.a21-assistant .a21-msg.a21-bot { align-self: flex-start; background: #fff; border: 1px solid var(--a21-border); border-bottom-left-radius: 4px; color: var(--a21-text); }
.a21-typing { opacity: 0.6; font-style: italic; }
.a21-thumb { display: block; max-width: 100%; max-height: 180px; border-radius: 8px; margin-bottom: 6px; }

/* ---------- quick-start chips ---------- */
.a21-quick {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding: 10px 14px;
	background: var(--a21-soft);
	border-top: 1px solid var(--a21-border);
}
.a21-chip {
	background: #fff;
	border: 1px solid var(--a21-brand);
	color: var(--a21-brand);
	border-radius: 999px;
	padding: 10px 14px;
	font-size: 15px;
	min-height: 44px;
	cursor: pointer;
}
.a21-chip:active { background: var(--a21-brand); color: #fff; }

/* ---------- photo preview ---------- */
.a21-preview {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 14px;
	border-top: 1px solid var(--a21-border);
	background: #fff;
}
.a21-preview[hidden] { display: none; }
.a21-preview img { height: 56px; width: auto; border-radius: 6px; border: 1px solid var(--a21-border); }

/* ---------- composer ---------- */
.a21-composer {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	padding: 10px 12px;
	border-top: 1px solid var(--a21-border);
	background: #fff;
}
.a21-file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.a21-attach {
	flex: 0 0 auto;
	width: 46px;
	height: 46px;
	border-radius: 50%;
	border: 1px solid var(--a21-border);
	background: var(--a21-soft);
	font-size: 22px;
	cursor: pointer;
}
.a21-input {
	flex: 1 1 auto;
	min-height: 46px;
	max-height: 120px;
	padding: 11px 12px;
	border: 1px solid var(--a21-border);
	border-radius: 12px;
	font: inherit;
	font-size: 16px; /* 16px stops iOS from zooming on focus */
	resize: none;
	background: #fff;
	color: var(--a21-text);
}
.a21-send {
	flex: 0 0 auto;
	min-height: 46px;
	padding: 0 18px;
	border: 0;
	border-radius: 12px;
	background: var(--a21-brand);
	color: #fff;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
}
.a21-send:disabled, .a21-attach:disabled, .a21-input:disabled { opacity: 0.55; cursor: not-allowed; }
.a21-send:hover:not(:disabled) { background: var(--a21-brand-dark); }

.a21-note {
	padding: 6px 14px 10px;
	font-size: 12px;
	color: #5b6475;
	background: #fff;
	text-align: center;
}

/* ---------- floating mode ---------- */
.a21-floating { position: fixed; right: 16px; bottom: 16px; z-index: 99999; }
.a21-floating .a21-launcher {
	background: var(--a21-brand);
	color: #fff;
	border: 0;
	border-radius: 999px;
	padding: 14px 20px;
	min-height: 48px;
	font-size: 16px;
	font-weight: 600;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
	cursor: pointer;
}
.a21-floating .a21-panel {
	display: none;
	width: 380px;
	height: min(80vh, 640px);
	position: absolute;
	right: 0;
	bottom: 0;
}
.a21-floating.a21-open .a21-panel { display: flex; }
.a21-floating.a21-open .a21-launcher { display: none; }

@media (max-width: 600px) {
	.a21-floating { right: 0; bottom: 0; }
	.a21-floating .a21-launcher { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
	.a21-floating .a21-panel {
		position: fixed;
		inset: 0;
		width: 100%;
		height: 100vh;
		height: 100dvh;
		border-radius: 0;
		border: 0;
	}
	.a21-floating .a21-header { padding-top: calc(12px + env(safe-area-inset-top, 0px)); }
	.a21-floating .a21-note { padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
}
