:root {
	--bg: #0c0e13;
	--bg-soft: #11141b;
	--elev: #161a23;
	--elev2: #1d2330;
	--border: #262d3b;
	--border-soft: #1d222d;
	--text: #e7eaf2;
	--muted: #8d96ab;
	--faint: #626c82;
	--accent: #7f9dff;
	--accent-ink: #0a1024;
	--user-bg: #21305a;
	--user-border: #2e4279;
	--code-bg: #0a0c11;
	--code-inline: #1b2130;
	--ok: #4ade80;
	--warn: #fbbf24;
	--err: #fb7185;
	--shadow: 0 10px 34px rgba(0, 0, 0, 0.45);
	--safe-top: env(safe-area-inset-top, 0px);
	--safe-bottom: env(safe-area-inset-bottom, 0px);
	--font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "PingFang SC",
		"Hiragino Sans GB", "Microsoft YaHei", Roboto, sans-serif;
	--mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: light) {
	:root {
		--bg: #f4f6fa;
		--bg-soft: #eef1f7;
		--elev: #ffffff;
		--elev2: #f0f3fa;
		--border: #dce1ec;
		--border-soft: #e8ecf4;
		--text: #161a23;
		--muted: #5d6679;
		--faint: #8a93a7;
		--accent: #3d5bd9;
		--accent-ink: #ffffff;
		--user-bg: #e3e9ff;
		--user-border: #cfd9ff;
		--code-bg: #f3f5fa;
		--code-inline: #e9edf6;
		--ok: #16a34a;
		--warn: #b45309;
		--err: #dc2626;
		--shadow: 0 10px 30px rgba(31, 41, 55, 0.12);
	}
}

* {
	box-sizing: border-box;
	-webkit-tap-highlight-color: transparent;
}

html,
body {
	height: 100%;
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: var(--font);
	font-size: 15.5px;
	-webkit-font-smoothing: antialiased;
	overscroll-behavior-y: none;
}

button,
input,
textarea {
	font-family: inherit;
	color: inherit;
}

button {
	cursor: pointer;
}

.hidden {
	display: none !important;
}

/* ---------------------------------- app ---------------------------------- */

.app {
	display: flex;
	flex-direction: column;
	height: 100dvh;
}

.topbar {
	position: relative;
	z-index: 20;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: calc(8px + var(--safe-top)) 10px 8px;
	background: color-mix(in srgb, var(--bg) 86%, transparent);
	backdrop-filter: blur(14px);
	-webkit-backdrop-filter: blur(14px);
	border-bottom: 1px solid var(--border-soft);
}

.icon-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border: 0;
	border-radius: 10px;
	background: transparent;
	color: var(--text);
	font-size: 18px;
	line-height: 1;
	flex: 0 0 auto;
}

.icon-btn:active {
	background: var(--elev2);
}

.title-wrap {
	flex: 1;
	min-width: 0;
	padding: 0 2px;
}

.title {
	font-size: 15px;
	font-weight: 600;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.subtitle {
	margin-top: 2px;
	font-size: 11.5px;
	color: var(--muted);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.dot {
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: var(--faint);
	flex: 0 0 auto;
	margin: 0 4px;
	transition: background 0.2s;
}

.dot.live {
	background: var(--accent);
	animation: pulse 1.1s ease-in-out infinite;
}

.dot.err {
	background: var(--err);
}

@keyframes pulse {
	0%,
	100% {
		opacity: 1;
		transform: scale(1);
	}
	50% {
		opacity: 0.35;
		transform: scale(0.82);
	}
}

.banner {
	position: relative;
	z-index: 19;
	padding: 6px 12px;
	background: color-mix(in srgb, var(--warn) 14%, var(--bg));
	color: var(--warn);
	font-size: 12.5px;
	text-align: center;
	border-bottom: 1px solid var(--border-soft);
}

/* -------------------------------- messages ------------------------------- */

.messages {
	flex: 1;
	overflow-y: auto;
	overflow-x: hidden;
	padding: 6px 12px calc(28px + var(--safe-bottom));
	scroll-behavior: smooth;
}

.inner {
	max-width: 880px;
	margin: 0 auto;
}

.msg {
	max-width: 880px;
	margin: 0 auto;
	animation: fade-in 0.18s ease-out;
}

@keyframes fade-in {
	from {
		opacity: 0;
		transform: translateY(3px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

.msg.user {
	display: flex;
	justify-content: flex-end;
	margin: 16px auto 10px;
}

.msg.user .bubble {
	max-width: 86%;
	padding: 9px 13px;
	background: var(--user-bg);
	border: 1px solid var(--user-border);
	border-radius: 16px 16px 5px 16px;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
	line-height: 1.55;
	font-size: 15px;
}

.msg.assistant {
	margin: 14px auto;
}

.msg.assistant > .md:first-child {
	margin-top: 2px;
}

.msg.assistant .foot,
.msg.error .foot {
	display: flex;
	gap: 8px;
	align-items: center;
	margin-top: 8px;
	color: var(--faint);
	font-size: 11.5px;
}

.msg .error-box {
	margin-top: 8px;
	padding: 10px 12px;
	border: 1px solid color-mix(in srgb, var(--err) 40%, var(--border));
	background: color-mix(in srgb, var(--err) 10%, transparent);
	color: var(--err);
	border-radius: 10px;
	font-size: 13.5px;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}

.msg.notice,
.notice {
	max-width: 880px;
	margin: 10px auto;
	padding: 7px 11px;
	border-radius: 9px;
	background: var(--elev);
	border: 1px solid var(--border-soft);
	color: var(--muted);
	font-size: 12.5px;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}

.msg.notice.warn,
.notice.warn {
	color: var(--warn);
	border-color: color-mix(in srgb, var(--warn) 30%, var(--border));
}

.msg.notice.error,
.notice.error {
	color: var(--err);
	border-color: color-mix(in srgb, var(--err) 30%, var(--border));
}

.typing {
	display: inline-flex;
	gap: 4px;
	padding: 4px 0 8px;
}

.typing i {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--accent);
	opacity: 0.35;
	animation: blink 1.2s infinite;
}

.typing i:nth-child(2) {
	animation-delay: 0.15s;
}
.typing i:nth-child(3) {
	animation-delay: 0.3s;
}

@keyframes blink {
	0%,
	100% {
		opacity: 0.25;
	}
	50% {
		opacity: 1;
	}
}

/* ------------------------------- markdown -------------------------------- */

.md {
	line-height: 1.68;
	overflow-wrap: anywhere;
}

.md.pre-wrap {
	white-space: pre-wrap;
}

.md > :first-child {
	margin-top: 0;
}

.md > :last-child {
	margin-bottom: 0;
}

.md p {
	margin: 0 0 11px;
}

.md h1,
.md h2,
.md h3,
.md h4,
.md h5,
.md h6 {
	margin: 18px 0 8px;
	line-height: 1.35;
	font-weight: 650;
}

.md h1 {
	font-size: 1.35em;
}
.md h2 {
	font-size: 1.22em;
}
.md h3 {
	font-size: 1.1em;
}
.md h4,
.md h5,
.md h6 {
	font-size: 1em;
}

.md ul,
.md ol {
	margin: 0 0 11px;
	padding-left: 22px;
}

.md li {
	margin: 3px 0;
}

.md li > p {
	margin: 0;
}

.md blockquote {
	margin: 10px 0;
	padding: 2px 0 2px 12px;
	border-left: 3px solid var(--border);
	color: var(--muted);
}

.md hr {
	border: 0;
	border-top: 1px solid var(--border);
	margin: 16px 0;
}

.md a {
	color: var(--accent);
	text-decoration: none;
}

.md a:active {
	text-decoration: underline;
}

.md code {
	font-family: var(--mono);
	font-size: 0.9em;
	background: var(--code-inline);
	padding: 1.5px 5px;
	border-radius: 5px;
}

.md pre {
	position: relative;
	margin: 10px 0 12px;
	padding: 12px 12px;
	background: var(--code-bg);
	border: 1px solid var(--border-soft);
	border-radius: 11px;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.md pre code {
	display: block;
	background: none;
	padding: 0;
	font-size: 12.8px;
	line-height: 1.6;
	white-space: pre;
}

.copy-btn {
	position: absolute;
	top: 6px;
	right: 6px;
	padding: 3px 8px;
	border: 1px solid var(--border);
	border-radius: 7px;
	background: var(--elev);
	color: var(--muted);
	font-size: 11px;
	opacity: 0.75;
}

.copy-btn:active {
	opacity: 1;
}

.md table {
	display: block;
	width: max-content;
	max-width: 100%;
	overflow-x: auto;
	border-collapse: collapse;
	margin: 10px 0 12px;
	font-size: 0.94em;
}

.md th,
.md td {
	border: 1px solid var(--border);
	padding: 5px 9px;
	text-align: left;
	white-space: nowrap;
}

.md th {
	background: var(--elev);
	font-weight: 600;
}

.md img {
	max-width: 100%;
	border-radius: 10px;
}

/* -------------------------------- thinking ------------------------------- */

details.thinking {
	margin: 8px 0;
	padding: 6px 11px;
	border: 1px dashed var(--border);
	border-radius: 11px;
}

details.thinking summary {
	cursor: pointer;
	color: var(--muted);
	font-size: 12.5px;
	user-select: none;
}

details.thinking[open] summary {
	margin-bottom: 6px;
}

details.thinking pre {
	margin: 0;
	padding: 0;
	background: none;
	border: 0;
	color: var(--muted);
	font-family: var(--font);
	font-size: 13px;
	line-height: 1.6;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
	max-height: 260px;
	overflow-y: auto;
}

/* --------------------------------- tools --------------------------------- */

.tool {
	margin: 9px 0;
	border: 1px solid var(--border);
	background: var(--bg-soft);
	border-radius: 12px;
	overflow: hidden;
}

.tool-head {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 11px;
	cursor: pointer;
	min-height: 38px;
}

.tool-status {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--warn);
	flex: 0 0 auto;
	animation: pulse 1.2s infinite;
}

.tool.done .tool-status {
	background: var(--ok);
	animation: none;
}

.tool.error .tool-status {
	background: var(--err);
	animation: none;
}

.tool-name {
	font-size: 12.5px;
	font-weight: 650;
	color: var(--text);
	flex: 0 0 auto;
	font-family: var(--mono);
}

.tool-summary {
	flex: 1;
	min-width: 0;
	color: var(--muted);
	font-size: 12px;
	font-family: var(--mono);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.tool-chev {
	color: var(--faint);
	font-size: 10px;
	transition: transform 0.15s;
}

.tool.open .tool-chev {
	transform: rotate(180deg);
}

.tool-body {
	display: none;
	border-top: 1px solid var(--border-soft);
	padding: 8px 11px 10px;
}

.tool.open .tool-body {
	display: block;
}

.tool-label {
	margin: 2px 0 4px;
	color: var(--faint);
	font-size: 10.5px;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.tool pre {
	margin: 0 0 8px;
	padding: 8px 9px;
	background: var(--code-bg);
	border: 1px solid var(--border-soft);
	border-radius: 8px;
	font-family: var(--mono);
	font-size: 12px;
	line-height: 1.55;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
	max-height: 320px;
	overflow-y: auto;
}

.tool pre:last-child {
	margin-bottom: 0;
}

.tool.error .tool-result {
	color: var(--err);
}

.tool-running-note {
	color: var(--faint);
	font-size: 11.5px;
	font-family: var(--mono);
	white-space: pre-wrap;
	max-height: 120px;
	overflow: hidden;
}

/* ------------------------------- composer -------------------------------- */

.composer {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 22;
	padding: 10px 12px calc(10px + var(--safe-bottom));
	background: linear-gradient(to top, var(--bg) 62%, color-mix(in srgb, var(--bg) 0%, transparent));
	pointer-events: none;
}

.composer-inner {
	pointer-events: auto;
	max-width: 880px;
	margin: 0 auto;
	padding: 7px;
	background: var(--elev);
	border: 1px solid var(--border);
	border-radius: 18px;
	box-shadow: var(--shadow);
}

.queue-row {
	display: flex;
	gap: 6px;
	padding: 2px 6px 6px;
	flex-wrap: wrap;
}

.chip {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 3px 8px;
	border-radius: 999px;
	background: var(--elev2);
	border: 1px solid var(--border);
	color: var(--muted);
	font-size: 11.5px;
	max-width: 100%;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.attachments {
	display: flex;
	gap: 8px;
	padding: 2px 4px 8px;
	overflow-x: auto;
}

.attachments:empty {
	display: none;
}

.attachment {
	position: relative;
	flex: 0 0 auto;
}

.attachment img {
	width: 62px;
	height: 62px;
	object-fit: cover;
	border-radius: 10px;
	border: 1px solid var(--border);
	display: block;
}

.attachment button {
	position: absolute;
	top: -5px;
	right: -5px;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	border: 1px solid var(--border);
	background: var(--elev2);
	color: var(--text);
	font-size: 11px;
	line-height: 1;
	padding: 0;
}

.composer-row {
	display: flex;
	align-items: flex-end;
	gap: 4px;
}

.composer textarea {
	flex: 1;
	min-width: 0;
	max-height: 40dvh;
	margin: 0;
	padding: 8px 6px;
	border: 0;
	outline: 0;
	background: transparent;
	color: var(--text);
	font-size: 16px;
	line-height: 1.45;
	resize: none;
	overflow-y: auto;
}

.composer textarea::placeholder {
	color: var(--faint);
}

.attach-btn {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	border: 0;
	background: transparent;
	color: var(--muted);
	font-size: 22px;
	line-height: 1;
	flex: 0 0 auto;
}

.send-btn {
	width: 38px;
	height: 38px;
	border-radius: 50%;
	border: 0;
	background: var(--accent);
	color: var(--accent-ink);
	font-size: 19px;
	font-weight: 700;
	line-height: 1;
	flex: 0 0 auto;
	transition: opacity 0.15s, transform 0.1s;
}

.send-btn:active {
	transform: scale(0.94);
}

.send-btn:disabled {
	opacity: 0.35;
}

.send-btn.stop {
	background: var(--err);
	color: #fff;
}

.composer-foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 2px 4px 0;
	min-height: 20px;
	font-size: 11px;
	color: var(--faint);
}

.behavior {
	border: 0;
	background: transparent;
	color: var(--faint);
	font-size: 11px;
	padding: 2px 4px;
	border-radius: 6px;
}

.behavior:active {
	background: var(--elev2);
}

.jump {
	position: fixed;
	bottom: calc(118px + var(--safe-bottom));
	left: 50%;
	transform: translateX(-50%);
	z-index: 21;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	border: 1px solid var(--border);
	background: var(--elev);
	color: var(--text);
	box-shadow: var(--shadow);
	font-size: 15px;
}

/* --------------------------------- drawer -------------------------------- */

.drawer {
	position: fixed;
	inset: 0;
	z-index: 60;
	display: none;
	background: rgba(0, 0, 0, 0.5);
}

.drawer.open {
	display: block;
}

.drawer-panel {
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: min(86vw, 370px);
	display: flex;
	flex-direction: column;
	background: var(--elev);
	border-right: 1px solid var(--border);
	padding-top: var(--safe-top);
	animation: slide-in 0.18s ease-out;
}

@keyframes slide-in {
	from {
		transform: translateX(-100%);
	}
	to {
		transform: none;
	}
}

.drawer-head {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 12px 14px;
	border-bottom: 1px solid var(--border);
}

.drawer-head h2 {
	margin: 0;
	font-size: 15px;
	flex: 1;
}

.new-btn {
	border: 1px solid var(--border);
	background: var(--elev2);
	color: var(--text);
	border-radius: 9px;
	padding: 6px 10px;
	font-size: 12.5px;
}

.session-list {
	flex: 1;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}

.session-item {
	padding: 11px 14px;
	border-bottom: 1px solid var(--border-soft);
	cursor: pointer;
}

.session-item:active {
	background: var(--elev2);
}

.session-item.active {
	background: var(--elev2);
	box-shadow: inset 3px 0 0 var(--accent);
}

.session-item .si-title {
	font-size: 13.5px;
	line-height: 1.45;
	overflow: hidden;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.session-item .si-meta {
	margin-top: 4px;
	display: flex;
	gap: 8px;
	color: var(--faint);
	font-size: 11px;
	white-space: nowrap;
	overflow: hidden;
}

.session-empty {
	padding: 30px 16px;
	text-align: center;
	color: var(--faint);
	font-size: 13px;
}

/* --------------------------------- modal --------------------------------- */

.modal {
	position: fixed;
	inset: 0;
	z-index: 70;
	display: flex;
	align-items: flex-end;
	justify-content: center;
	background: rgba(0, 0, 0, 0.55);
}

.modal-card {
	width: 100%;
	max-width: 560px;
	max-height: 82dvh;
	overflow-y: auto;
	background: var(--elev);
	border: 1px solid var(--border);
	border-radius: 18px 18px 0 0;
	padding: 16px 16px calc(16px + var(--safe-bottom));
	animation: slide-up 0.18s ease-out;
}

@keyframes slide-up {
	from {
		transform: translateY(16px);
		opacity: 0.6;
	}
	to {
		transform: none;
		opacity: 1;
	}
}

@media (min-width: 640px) {
	.modal {
		align-items: center;
	}
	.modal-card {
		border-radius: 18px;
		margin: 20px;
		padding-bottom: 16px;
	}
}

.modal-head {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 12px;
}

.modal-head h3 {
	margin: 0;
	font-size: 16px;
	flex: 1;
}

.modal-close {
	border: 0;
	background: transparent;
	color: var(--muted);
	font-size: 20px;
	width: 32px;
	height: 32px;
	border-radius: 8px;
}

.field {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin: 12px 0;
}

.field label {
	font-size: 12px;
	color: var(--muted);
}

.field input {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid var(--border);
	border-radius: 10px;
	background: var(--bg-soft);
	color: var(--text);
	font-size: 15px;
	outline: none;
}

.field input:focus {
	border-color: var(--accent);
}

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 9px 14px;
	border-radius: 10px;
	border: 1px solid var(--border);
	background: var(--elev2);
	color: var(--text);
	font-size: 14px;
}

.btn.primary {
	background: var(--accent);
	border-color: var(--accent);
	color: var(--accent-ink);
	font-weight: 600;
}

.btn.danger {
	background: transparent;
	border-color: color-mix(in srgb, var(--err) 40%, var(--border));
	color: var(--err);
}

.btn-row {
	display: flex;
	gap: 8px;
	justify-content: flex-end;
	margin-top: 14px;
}

.menu-list {
	display: flex;
	flex-direction: column;
}

.menu-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 13px 6px;
	border: 0;
	border-bottom: 1px solid var(--border-soft);
	background: transparent;
	color: var(--text);
	font-size: 14.5px;
	text-align: left;
	width: 100%;
}

.menu-item:last-child {
	border-bottom: 0;
}

.menu-item .mi-icon {
	width: 20px;
	text-align: center;
	color: var(--muted);
}

.menu-item .mi-sub {
	margin-left: auto;
	color: var(--faint);
	font-size: 12px;
	max-width: 45%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.model-search {
	width: 100%;
	padding: 9px 11px;
	margin-bottom: 10px;
	border: 1px solid var(--border);
	border-radius: 9px;
	background: var(--bg-soft);
	color: var(--text);
	font-size: 14px;
	outline: none;
}

.model-item {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	padding: 9px 8px;
	border: 0;
	border-bottom: 1px solid var(--border-soft);
	background: transparent;
	color: var(--text);
	text-align: left;
	font-size: 13.5px;
}

.model-item.active {
	color: var(--accent);
}

.model-item .mi-provider {
	color: var(--faint);
	font-size: 11px;
	margin-left: auto;
}

.level-item {
	display: flex;
	justify-content: space-between;
}

/* --------------------------------- login --------------------------------- */

.login-wrap {
	min-height: 100dvh;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background: radial-gradient(80% 60% at 50% 0%, color-mix(in srgb, var(--accent) 12%, transparent), transparent),
		var(--bg);
}

.login-card {
	width: 100%;
	max-width: 340px;
	text-align: center;
}

.login-logo {
	width: 76px;
	height: 76px;
	border-radius: 20px;
	margin: 0 auto 18px;
	display: block;
	box-shadow: var(--shadow);
}

.login-card h1 {
	margin: 0 0 6px;
	font-size: 22px;
	letter-spacing: 0.01em;
}

.login-card p {
	margin: 0 0 22px;
	color: var(--muted);
	font-size: 13px;
}

.login-card input {
	width: 100%;
	padding: 13px 14px;
	margin-bottom: 10px;
	border: 1px solid var(--border);
	border-radius: 12px;
	background: var(--elev);
	color: var(--text);
	font-size: 16px;
	outline: none;
	text-align: center;
}

.login-card input:focus {
	border-color: var(--accent);
}

.login-card .btn {
	width: 100%;
	padding: 12px;
	font-size: 15px;
	border-radius: 12px;
}

.login-err {
	margin-top: 12px;
	color: var(--err);
	font-size: 13px;
	min-height: 18px;
}

@media (max-width: 420px) {
	.messages {
		padding-left: 10px;
		padding-right: 10px;
	}
	.msg.user .bubble {
		max-width: 90%;
	}
}

/* user images */
.msg.user .bubble.has-images,
.msg.user.has-images .bubble {
	background: transparent;
	border-color: transparent;
	padding: 0;
}

.user-images {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(96px, 140px));
	gap: 6px;
	justify-content: end;
	margin-bottom: 6px;
}

.user-images img {
	width: 100%;
	aspect-ratio: 1;
	object-fit: cover;
	border-radius: 12px;
	border: 1px solid var(--border);
	display: block;
}

.img-chip {
	display: inline-block;
	margin-bottom: 6px;
	padding: 3px 8px;
	border-radius: 8px;
	background: var(--elev2);
	color: var(--muted);
	font-size: 11.5px;
}

.msg.user.has-images .user-text {
	display: inline-block;
	max-width: 100%;
	padding: 8px 12px;
	background: var(--user-bg);
	border: 1px solid var(--user-border);
	border-radius: 14px 14px 5px 14px;
}

/* empty state */
.empty-state {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 16vh 20px 20px;
	text-align: center;
	color: var(--muted);
	animation: fade-in 0.25s ease-out;
}

.empty-state img {
	width: 64px;
	height: 64px;
	border-radius: 16px;
	margin-bottom: 14px;
	box-shadow: var(--shadow);
	opacity: 0.95;
}

.empty-state h2 {
	margin: 0 0 6px;
	font-size: 20px;
	color: var(--text);
	letter-spacing: 0.01em;
}

.empty-state p {
	margin: 0;
	font-size: 13px;
	line-height: 1.7;
	white-space: pre-line;
}

/* two-factor settings */
.qr-img {
	display: block;
	width: 200px;
	height: 200px;
	margin: 6px auto 12px;
	padding: 8px;
	background: #fff;
	border-radius: 12px;
	border: 1px solid var(--border);
}

.secret-line {
	margin-bottom: 10px;
	padding: 8px 10px;
	background: var(--code-bg);
	border: 1px solid var(--border-soft);
	border-radius: 8px;
	font-family: var(--mono);
	font-size: 12.5px;
	word-break: break-all;
	text-align: center;
	user-select: all;
}

.recovery-codes {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 6px;
	margin: 8px 0 4px;
}

.recovery-codes code {
	padding: 7px 8px;
	background: var(--code-bg);
	border: 1px solid var(--border-soft);
	border-radius: 8px;
	font-family: var(--mono);
	font-size: 13px;
	text-align: center;
	user-select: all;
}

.settings-section {
	margin-top: 16px;
	padding-top: 12px;
	border-top: 1px solid var(--border-soft);
}

.settings-section h4 {
	margin: 0 0 6px;
	font-size: 13.5px;
}

.hint-text {
	margin: 0 0 10px;
	color: var(--muted);
	font-size: 12.5px;
	line-height: 1.65;
}

.form-err {
	min-height: 16px;
	margin-top: 8px;
	color: var(--err);
	font-size: 12.5px;
}
