html,
body,
#root {
	height: 100%;
	margin: 0;
}

body {
	min-height: 100vh;
	min-height: 100dvh;
	overflow-x: hidden;
	background-image:
		linear-gradient(rgba(58, 41, 112, 0.5), rgba(58, 41, 112, 0.5)),
		var(--custom-bg-image, url("/bg.png"));
	background-repeat: no-repeat, no-repeat;
	background-size: cover, cover;
	background-position: center center, center center;
	background-attachment: fixed, fixed;
	color: #f8efff;
	font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}

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

.app-shell.auth-mode {
	min-height: 100vh;
}

.topbar {
	min-height: 58px;
	position: relative;
	z-index: 2147483645;
	display: flex;
	align-items: center;
	justify-content: flex-start;
	gap: 28px;
	padding: max(6px, env(safe-area-inset-top)) 24px 6px;
	background: transparent;
	border-bottom: 2px solid rgba(78, 59, 141, 0.6);
	box-shadow:
		inset 0 -1px 0 rgba(255, 255, 255, 0.18),
		0 8px 20px rgba(26, 12, 63, 0.18);
	-webkit-backdrop-filter: blur(10px) saturate(120%);
	backdrop-filter: blur(10px) saturate(120%);
}

.brand {
	text-decoration: none;
	font-size: 26px;
	font-weight: 800;
	letter-spacing: 1px;
	color: #ff8edb;
	text-shadow: 2px 2px 0 #4b368f;
}

.nav-links {
	display: flex;
	gap: 20px;
	font-size: 18px;
	font-weight: 700;
	color: #f2e7ff;
	text-shadow: 1px 1px 0 #4b368f;
}

.topbar-right {
	margin-left: auto;
	position: relative;
	z-index: 2147483646;
	display: flex;
	align-items: center;
	gap: 14px;
}

.glass-toggle-btn {
	height: 34px;
	line-height: 30px;
	padding: 0 12px;
	font-size: 13px;
	white-space: nowrap;
}

.appearance-menu {
	position: fixed;
	top: calc(env(safe-area-inset-top) + 68px);
	right: max(12px, env(safe-area-inset-right));
	left: auto;
	bottom: auto;
	width: auto;
	z-index: 2147483647;
}

.appearance-select {
	height: 34px;
	min-width: 126px;
	padding: 0 12px;
	font-size: 13px;
	font-weight: 800;
	color: #fdf8ff;
	border: 2px solid rgba(236, 223, 255, 0.62);
	border-radius: 10px;
	background: transparent;
	box-shadow:
		0 1px 0 rgba(255, 255, 255, 0.35) inset,
		0 8px 20px rgba(16, 9, 41, 0.18);
	text-shadow: 1px 1px 0 rgba(60, 42, 109, 0.7);
	outline: none;
	-webkit-backdrop-filter: blur(12px) saturate(132%);
	backdrop-filter: blur(12px) saturate(132%);
	cursor: pointer;
}

.appearance-select:focus {
	border-color: rgba(245, 236, 255, 0.86);
	box-shadow:
		0 0 0 2px rgba(215, 191, 255, 0.2),
		0 1px 0 rgba(255, 255, 255, 0.45) inset,
		0 10px 24px rgba(16, 9, 41, 0.24);
}

.appearance-select:hover {
	background: transparent;
	border-color: rgba(245, 236, 255, 0.82);
	box-shadow:
		0 1px 0 rgba(255, 255, 255, 0.45) inset,
		0 10px 24px rgba(16, 9, 41, 0.24);
}

.appearance-dropdown {
	position: absolute;
	top: calc(100% + 8px);
	right: 0;
	min-width: 170px;
	padding: 6px;
	border: 2px solid #8b68d9;
	border-radius: 12px;
	background: linear-gradient(180deg, rgba(123, 96, 194, 0.98) 0%, rgba(95, 70, 168, 0.98) 100%);
	box-shadow: 0 12px 26px rgba(20, 10, 50, 0.35);
	z-index: 2147483647;
}

.appearance-option {
	display: block;
	width: 100%;
	height: 34px;
	line-height: 30px;
	padding: 0 10px;
	text-align: left;
	font-size: 13px;
	font-weight: 800;
	color: #fdf8ff;
	border: 2px solid transparent;
	border-radius: 9px;
	background: transparent;
	text-shadow: 1px 1px 0 #604097;
}

.appearance-option:hover {
	border-color: rgba(215, 186, 255, 0.6);
	background: rgba(255, 255, 255, 0.12);
}

.appearance-option.active {
	border-color: rgba(236, 223, 255, 0.8);
	background: linear-gradient(180deg, #d0b8ff 0%, #b287ff 100%);
}

.topbar .notify-btn,
.topbar .glass-toggle-btn {
	border-color: rgba(236, 223, 255, 0.62);
	background: transparent;
	box-shadow:
		0 1px 0 rgba(255, 255, 255, 0.35) inset,
		0 8px 20px rgba(16, 9, 41, 0.18);
	-webkit-backdrop-filter: blur(12px) saturate(132%);
	backdrop-filter: blur(12px) saturate(132%);
}

.topbar .notify-btn:hover,
.topbar .glass-toggle-btn:hover {
	background: transparent;
	border-color: rgba(245, 236, 255, 0.82);
	box-shadow:
		0 1px 0 rgba(255, 255, 255, 0.45) inset,
		0 10px 24px rgba(16, 9, 41, 0.24);
}

.topbar .notify-btn:active,
.topbar .glass-toggle-btn:active {
	background: transparent;
	box-shadow:
		0 1px 0 rgba(255, 255, 255, 0.24) inset,
		0 6px 14px rgba(16, 9, 41, 0.2);
}

.notify-wrap {
	position: relative;
}

.notify-btn {
	position: relative;
	min-width: 44px;
	padding: 0 10px;
	font-size: 18px;
}

.notify-badge {
	position: absolute;
	top: -6px;
	right: -6px;
	min-width: 18px;
	height: 18px;
	padding: 0 4px;
	border-radius: 999px;
	background: #ff89d8;
	color: #472a75;
	font-size: 11px;
	font-weight: 900;
	line-height: 18px;
	text-align: center;
	text-shadow: none;
}

.notify-panel {
	position: fixed;
	top: var(--notify-panel-top, calc(env(safe-area-inset-top) + 68px));
	right: var(--notify-panel-right, 16px);
	width: min(360px, 85vw);
	border: 2px solid rgba(148, 117, 225, 0.85);
	background: transparent;
	box-shadow: 0 12px 30px rgba(26, 12, 63, 0.45);
	-webkit-backdrop-filter: blur(12px) saturate(120%);
	backdrop-filter: blur(12px) saturate(120%);
	z-index: 2147483647;
	border-radius: 12px;
}

.notify-overlay {
	position: fixed;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
	background: transparent;
	padding: 0;
	margin: 0;
	z-index: 2147483646;
	border-radius: 0;
	box-shadow: none;
}

.notify-overlay:hover {
	background: transparent;
	border: 0;
}

.notify-mobile-layer {
	position: fixed;
	inset: 0;
	z-index: 2147483646;
}

.notify-head {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	padding: 8px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.2);
	font-weight: 700;
}

.notify-head-title {
	justify-self: center;
	text-align: center;
}

.notify-head button {
	height: 28px;
	line-height: 24px;
	padding: 0 10px;
	font-size: 12px;
}

.notify-head > button:first-child {
	justify-self: start;
}

.notify-head-spacer {
	justify-self: end;
	visibility: hidden;
	pointer-events: none;
}

.notify-list {
	max-height: 320px;
	overflow: auto;
	padding: 8px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.notify-item {
	padding: 8px;
	border: 1px solid rgba(255, 255, 255, 0.2);
	background: rgba(255, 255, 255, 0.06);
	font-size: 13px;
	cursor: pointer;
	border-radius: 10px;
}

.notify-item.unread {
	border-color: rgba(255, 163, 230, 0.8);
	background: rgba(255, 163, 230, 0.14);
}

.notify-content {
	margin-top: 4px;
	opacity: 0.92;
	word-break: break-word;
}

.notify-time {
	margin-top: 4px;
	font-size: 11px;
	opacity: 0.75;
}

.notify-empty {
	padding: 10px;
	text-align: center;
	opacity: 0.8;
}

.announcement-modal-layer {
	position: fixed;
	inset: 0;
	z-index: 2147483647;
	display: grid;
	place-items: center;
	padding: 24px;
}

.announcement-modal-overlay {
	position: absolute;
	inset: 0;
	background: rgba(10, 8, 20, 0.34);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
}

.announcement-modal-card,
.announcement-page-shell,
.announcement-entry {
	position: relative;
	overflow: hidden;
	isolation: isolate;
	background: rgba(255, 255, 255, 0.08);
	border-radius: 28px;
	box-shadow:
		0 18px 46px rgba(12, 10, 28, 0.34),
		0 0 22px rgba(255, 255, 255, 0.08);
}

.announcement-modal-card::before,
.announcement-page-shell::before,
.announcement-entry::before {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
	filter: var(--glass-filter, url(#glass-distortion));
	background: transparent;
	z-index: 0;
}

.announcement-modal-card::after,
.announcement-page-shell::after,
.announcement-entry::after {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	background: rgba(255, 255, 255, 0.02);
	box-shadow:
		inset 2px 2px 1px 0 rgba(255, 255, 255, 0.56),
		inset -1px -1px 1px 1px rgba(255, 255, 255, 0.44);
	z-index: 2;
}

.announcement-modal-card > *,
.announcement-page-shell > *,
.announcement-entry > * {
	position: relative;
	z-index: 3;
}

.announcement-modal-card {
	width: min(680px, calc(100vw - 32px));
	padding: 24px 24px 22px;
	color: #fff8ff;
}

.announcement-modal-tag,
.announcement-page-tag {
	display: inline-flex;
	align-items: center;
	padding: 6px 12px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.14);
	color: #fff7fb;
	font-size: 12px;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.announcement-modal-card h3,
.announcement-page-shell h2,
.announcement-entry h3 {
	margin: 12px 0 0;
}

.announcement-modal-time,
.announcement-entry time {
	margin-top: 8px;
	font-size: 12px;
	opacity: 0.8;
}

.announcement-modal-content,
.announcement-entry-content {
	margin-top: 16px;
	line-height: 1.75;
	white-space: pre-wrap;
	word-break: break-word;
}

.announcement-modal-action {
	margin-top: 20px;
	min-width: 108px;
}

.announcement-page {
	width: min(980px, 94vw);
	margin: 18px auto 40px;
}

.announcement-page-shell {
	padding: 26px 24px;
}

.announcement-page-toolbar {
	display: flex;
	justify-content: flex-start;
	margin-bottom: 8px;
}

.announcement-back-btn {
	height: 36px;
	padding: 0 14px;
	border-radius: 999px;
	border: 1px solid rgba(255, 255, 255, 0.28);
	background: rgba(255, 255, 255, 0.1);
	color: #fff8ff;
	font-weight: 700;
	cursor: pointer;
}

.announcement-page-subtitle {
	margin: 10px 0 0;
	opacity: 0.82;
}

.announcement-page-list {
	margin-top: 18px;
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.announcement-entry {
	padding: 20px 20px 18px;
}

.announcement-entry-head {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 16px;
}

.announcement-entry-meta {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 8px;
}

.announcement-importance,
.announcement-unread-dot {
	display: inline-flex;
	align-items: center;
	padding: 4px 10px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 800;
}

.announcement-importance-required,
.announcement-unread-dot {
	background: rgba(255, 84, 112, 0.18);
	color: #ffd7df;
}

.announcement-importance-optional {
	background: rgba(255, 255, 255, 0.12);
	color: #f4ecff;
}

.announcement-entry-actions {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 10px;
}

.announcement-read-btn {
	height: 34px;
	padding: 0 12px;
	border-radius: 999px;
	border: 1px solid rgba(255, 255, 255, 0.24);
	background: rgba(255, 255, 255, 0.1);
	color: #fff8ff;
	font-weight: 700;
	cursor: pointer;
}

.announcement-read-btn:disabled {
	opacity: 0.68;
	cursor: default;
}

.announcement-page-empty {
	padding: 24px;
	text-align: center;
	opacity: 0.82;
}

.nav-links a,
.nav-links span {
	color: inherit;
	text-decoration: none;
}

.announcement-link {
	position: relative;
	display: inline-flex;
	align-items: center;
}

.announcement-badge {
	position: absolute;
	top: -8px;
	right: -14px;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 999px;
	background: #ff4a63;
	color: #fff;
	font-size: 11px;
	font-weight: 800;
	line-height: 1;
	box-shadow: 0 6px 14px rgba(255, 74, 99, 0.38);
}

.nav-links a:hover {
	color: #ffe7ff;
	text-decoration: underline;
}

/* ── AI Chat Page ─────────────────────────────────────────── */

.ai-chat-page {
	position: fixed;
	inset: 0;
	display: flex;
	flex-direction: column;
	z-index: 2147483646;
	background: rgba(5, 6, 10, 0.45);
	-webkit-backdrop-filter: url(#frosted);
	backdrop-filter: url(#frosted);
}

/* ── Header ── */
.ai-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 20px;
	padding-top: calc(12px + env(safe-area-inset-top));
	border-bottom: 1px solid rgba(255, 255, 255, 0.15);
	background: rgba(255, 255, 255, 0.08);
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
	-webkit-backdrop-filter: url(#frosted);
	backdrop-filter: url(#frosted);
	flex-shrink: 0;
}

.ai-header-left,
.ai-header-right {
	display: flex;
	align-items: center;
	gap: 8px;
}

.ai-header-title {
	font-size: 15px;
	font-weight: 800;
	letter-spacing: 0.5px;
	color: rgba(255, 255, 255, 0.9);
}

.ai-character-toggle {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 4px 12px 4px 4px;
	border-radius: 20px;
	border: 1.5px solid rgba(255, 255, 255, 0.18);
	background: rgba(255, 255, 255, 0.08);
	cursor: pointer;
	transition: background 0.18s, border-color 0.18s;
	color: inherit;
	font: inherit;
}

.ai-character-toggle:hover {
	background: rgba(255, 255, 255, 0.14);
	border-color: rgba(255, 255, 255, 0.3);
}

.ai-character-switch-hint {
	font-size: 11px;
	font-weight: 800;
	color: #ff69b4;
	text-shadow: 0 0 6px rgba(255, 105, 180, 0.5);
	white-space: nowrap;
	pointer-events: none;
}

.ai-character-toggle-img {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	object-fit: cover;
}

.ai-header-btn {
	padding: 6px 14px;
	font-size: 13px;
	font-weight: 700;
	border-radius: 10px;
	border: 1.5px solid rgba(255, 255, 255, 0.18);
	background: rgba(255, 255, 255, 0.08);
	color: rgba(255, 255, 255, 0.85);
	cursor: pointer;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 2px 8px rgba(0, 0, 0, 0.1);
	-webkit-backdrop-filter: url(#frosted);
	backdrop-filter: url(#frosted);
	transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.ai-header-btn:hover {
	background: rgba(255, 255, 255, 0.14);
	border-color: rgba(255, 255, 255, 0.3);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ── Conversation area ── */
.ai-conversation {
	flex: 1;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
}

/* ── Welcome hero ── */
.ai-welcome {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 12px;
	padding: 48px 24px;
	opacity: 0.85;
}

.ai-welcome-icon {
	font-size: 56px;
	line-height: 1;
	background: linear-gradient(135deg, #60a5fa, #818cf8, #f472b6);
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
}

.ai-welcome-title {
	font-size: 24px;
	font-weight: 800;
	color: rgba(255, 255, 255, 0.92);
	letter-spacing: 0.5px;
}

.ai-welcome-sub {
	font-size: 14px;
	color: rgba(255, 255, 255, 0.5);
}

/* ── Messages list ── */
.ai-messages {
	display: flex;
	flex-direction: column;
	max-width: 768px;
	width: 100%;
	margin: 0 auto;
	padding: 24px 20px;
}

.ai-msg-row {
	display: flex;
	gap: 12px;
	padding: 16px 0;
	max-width: 80%;
}

.ai-msg-row:last-of-type {
	border-bottom: none;
}

.ai-msg-assistant {
	align-self: flex-start;
	flex-direction: row;
}

.ai-msg-user {
	align-self: flex-end;
	flex-direction: row-reverse;
}

.ai-avatar {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	overflow: hidden;
	border: 1.5px solid rgba(255, 255, 255, 0.2);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 2px 8px rgba(0, 0, 0, 0.12);
	-webkit-backdrop-filter: url(#frosted);
	backdrop-filter: url(#frosted);
}

.ai-avatar-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 50%;
}

.ai-msg-user .ai-avatar {
	background: rgba(167, 139, 250, 0.15);
	border-color: rgba(167, 139, 250, 0.3);
}

.ai-msg-assistant .ai-avatar {
	background: rgba(129, 140, 248, 0.12);
	border-color: rgba(129, 140, 248, 0.25);
}

.ai-msg-body {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
}

.ai-msg-user .ai-msg-body {
	align-items: flex-end;
	text-align: right;
}

/* ── Liquid Glass Bubble ── */
.ai-msg-bubble {
	position: relative;
	padding: 10px 14px;
	max-width: 100%;
	background: rgba(255, 255, 255, 0.08);
	border: 1.5px solid rgba(255, 255, 255, 0.18);
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, 0.25),
		0 0 0 1px rgba(255, 255, 255, 0.06),
		0 8px 24px rgba(0, 0, 0, 0.18);
	-webkit-backdrop-filter: url(#frosted);
	backdrop-filter: url(#frosted);
	transition: background 0.3s ease, box-shadow 0.3s ease;
}

.ai-msg-user .ai-msg-bubble {
	border-radius: 18px 18px 4px 18px;
	background: rgba(167, 139, 250, 0.12);
	border-color: rgba(167, 139, 250, 0.25);
}

.ai-msg-assistant .ai-msg-bubble {
	border-radius: 18px 18px 18px 4px;
	background: rgba(255, 255, 255, 0.06);
}

.ai-msg-name {
	font-size: 12px;
	font-weight: 700;
	color: rgba(255, 255, 255, 0.55);
	margin-bottom: 4px;
}

.ai-msg-text {
	font-size: 15px;
	line-height: 1.7;
	color: rgba(255, 255, 255, 0.88);
	word-break: break-word;
	white-space: pre-wrap;
}

.ai-tts-bar {
	margin-top: 6px;
	display: flex;
	gap: 6px;
	align-items: center;
}

.ai-tts-btn {
	background: none;
	border: 1px solid rgba(255, 255, 255, 0.18);
	border-radius: 20px;
	color: rgba(255, 255, 255, 0.55);
	font-size: 12px;
	padding: 3px 10px;
	cursor: pointer;
	transition: color 0.2s, border-color 0.2s, background 0.2s;
	line-height: 1.5;
}

.ai-tts-btn:hover:not(:disabled) {
	color: rgba(255, 255, 255, 0.85);
	border-color: rgba(167, 139, 250, 0.5);
	background: rgba(167, 139, 250, 0.1);
}

.ai-tts-btn:disabled {
	opacity: 0.5;
	cursor: default;
}

.ai-tts-btn.ai-tts-playing {
	color: rgba(167, 139, 250, 0.9);
	border-color: rgba(167, 139, 250, 0.55);
	background: rgba(167, 139, 250, 0.12);
}

/* TTS admin section */
.tts-active-bar { margin-bottom: 12px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tts-active-bar select { flex: 1; min-width: 220px; }
.tts-clear-btn { margin-left: 8px; }
.tts-clone-h6 { margin-top: 0; margin-bottom: 8px; }
.tts-voices-h6 { margin-bottom: 8px; }
.tts-clone-form { display: flex; flex-direction: column; gap: 6px; max-width: 480px; margin-bottom: 12px; }
.admin-page .tts-active-bar select,
.admin-page .tts-clone-form select {
	width: 100%;
	height: 46px;
	min-height: 46px;
	line-height: 44px;
	font-size: 16px;
	font-weight: 600;
	border: 1px solid rgba(168, 142, 248, 0.78);
	background-color: rgba(42, 30, 98, 0.9);
	background-image: linear-gradient(180deg, rgba(74, 56, 150, 0.5), rgba(46, 33, 110, 0.92));
	color: rgba(246, 240, 255, 0.96);
	border-radius: 12px;
	padding: 0 40px 0 14px;
	-webkit-backdrop-filter: blur(8px) saturate(120%);
	backdrop-filter: blur(8px) saturate(120%);
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 8px 18px rgba(23, 12, 62, 0.3);
	-webkit-appearance: none;
	appearance: none;
	background-repeat: no-repeat;
	background-position: right 14px center;
	background-size: 12px 8px;
	background-image:
		linear-gradient(180deg, rgba(74, 56, 150, 0.5), rgba(46, 33, 110, 0.92)),
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23e8deff' d='M1.41.59 6 5.17 10.59.59 12 2l-6 6-6-6z'/%3E%3C/svg%3E");
	transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.admin-page .tts-active-bar select:hover,
.admin-page .tts-clone-form select:hover {
	border-color: rgba(211, 192, 255, 0.95);
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12), 0 0 0 2px rgba(170, 138, 255, 0.2), 0 10px 20px rgba(30, 14, 80, 0.35);
}

.admin-page .tts-active-bar select:focus,
.admin-page .tts-clone-form select:focus {
	outline: none;
	border-color: rgba(222, 206, 255, 0.98);
	box-shadow: 0 0 0 2px rgba(174, 140, 255, 0.32), 0 0 20px rgba(146, 114, 236, 0.35);
}

.admin-page .tts-active-bar select option,
.admin-page .tts-clone-form select option {
	color: #efe8ff;
	background: #2b1d66;
}

.admin-page .tts-active-bar select:disabled,
.admin-page .tts-clone-form select:disabled {
	opacity: 0.62;
	cursor: not-allowed;
	filter: saturate(0.7);
}
.tts-voice-id-cell { font-size: 11px; }
.tts-status-ok { color: #4ade80; }
.tts-status-deploying { color: #fbbf24; }
.tts-status-error { color: #f87171; }
.tts-actions-cell { display: flex; gap: 4px; flex-wrap: wrap; }
.tts-hint { font-size: 12px; opacity: 0.6; margin-top: 10px; }
.admin-table-scroll { overflow-x: auto; }
.ai-prompt-form { display: flex; flex-direction: column; gap: 10px; }
.ai-prompt-label { font-size: 13px; display: flex; align-items: center; gap: 8px; }
.ai-prompt-badge {
	font-size: 11px;
	padding: 2px 8px;
	border-radius: 20px;
	border: 1px solid rgba(255,255,255,0.3);
	background: rgba(255,255,255,0.08);
	color: rgba(233,221,255,0.75);
}
.ai-prompt-badge--custom {
	border-color: rgba(151,121,226,0.85);
	background: rgba(151,121,226,0.18);
	color: #d4baff;
}
.ai-prompt-textarea {
	width: 100%;
	resize: vertical;
	min-height: 320px;
	border: 1px solid rgba(255, 255, 255, 0.28);
	background: rgba(255, 255, 255, 0);
	color: inherit;
	border-radius: 10px;
	padding: 10px 12px;
	font-size: 14px;
	line-height: 1.6;
	-webkit-backdrop-filter: blur(8px) saturate(116%);
	backdrop-filter: blur(8px) saturate(116%);
	box-sizing: border-box;
}
.ai-prompt-textarea::placeholder { color: rgba(233,221,255,0.55); }
.ai-prompt-textarea:focus {
	outline: none;
	border-color: rgba(151,121,226,0.85);
	box-shadow: 0 0 0 2px rgba(204,173,255,0.2);
}
.ai-prompt-actions { display: flex; gap: 8px; align-items: center; }
.tts-also-label { display: flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; -webkit-user-select: none; user-select: none; }

.admin-page input[type="checkbox"] {
	appearance: none;
	width: 18px;
	height: 18px;
	border: 2px solid rgba(155, 128, 241, 0.9);
	border-radius: 6px;
	background: linear-gradient(180deg, rgba(56, 38, 120, 0.82), rgba(42, 29, 93, 0.9));
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12), 0 0 0 1px rgba(8, 6, 20, 0.4);
	position: relative;
	cursor: pointer;
	transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.admin-page input[type="checkbox"]:hover {
	border-color: rgba(199, 170, 255, 0.95);
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16), 0 0 10px rgba(142, 108, 238, 0.45);
}

.admin-page input[type="checkbox"]:checked {
	background: linear-gradient(180deg, rgba(188, 154, 255, 0.96), rgba(132, 98, 236, 0.98));
	border-color: rgba(233, 218, 255, 0.96);
	box-shadow: 0 0 12px rgba(174, 139, 255, 0.55);
}

.admin-page input[type="checkbox"]:checked::after {
	content: "";
	position: absolute;
	left: 4px;
	top: 0px;
	width: 5px;
	height: 10px;
	border: solid #281860;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

.ai-cursor {
	animation: blink 1s step-end infinite;
}

@keyframes blink {
	50% { opacity: 0; }
}

.ai-thinking {
	color: rgba(255, 255, 255, 0.5);
	font-style: italic;
}

.ai-thinking-dots {
	animation: pulse-fade 1.5s ease-in-out infinite;
}

@keyframes pulse-fade {
	0%, 100% { opacity: 0.4; }
	50% { opacity: 1; }
}

/* ── Bottom input dock ── */
.ai-input-dock {
	flex-shrink: 0;
	padding: 12px 20px;
	padding-bottom: calc(16px + env(safe-area-inset-bottom));
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
}

.ai-error-tip {
	font-size: 13px;
	color: #f87171;
	background: rgba(248, 113, 113, 0.1);
	border: 1px solid rgba(248, 113, 113, 0.2);
	border-radius: 10px;
	padding: 6px 14px;
	max-width: 768px;
	width: 100%;
	text-align: center;
}

.ai-input-glass {
	display: flex;
	align-items: center;
	gap: 10px;
	max-width: 768px;
	width: 100%;
	padding: 8px 8px 8px 18px;
	border-radius: 16px;
	border: 1.5px solid rgba(255, 255, 255, 0.18);
	background: rgba(255, 255, 255, 0.08);
	-webkit-backdrop-filter: url(#frosted);
	backdrop-filter: url(#frosted);
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, 0.25),
		0 0 0 1px rgba(255, 255, 255, 0.06),
		0 8px 28px rgba(0, 0, 0, 0.2);
	transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.ai-input-glass:focus-within {
	border-color: rgba(167, 139, 250, 0.5);
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, 0.3),
		0 0 0 2px rgba(167, 139, 250, 0.15),
		0 8px 32px rgba(0, 0, 0, 0.25);
}

.ai-input {
	flex: 1;
	height: 38px;
	font-size: 15px;
	border: none;
	background: transparent;
	color: #f0e8ff;
	outline: none;
}

.ai-input::placeholder {
	color: rgba(255, 255, 255, 0.35);
}

.ai-send-btn {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	border: 1.5px solid rgba(255, 255, 255, 0.25);
	background: rgba(167, 139, 250, 0.2);
	color: #fff;
	font-size: 18px;
	font-weight: 800;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	flex-shrink: 0;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 2px 8px rgba(0, 0, 0, 0.15);
	-webkit-backdrop-filter: url(#frosted);
	backdrop-filter: url(#frosted);
	transition: background 0.3s ease, transform 0.15s ease, box-shadow 0.3s ease;
}

.ai-send-btn:hover:not(:disabled) {
	transform: scale(1.08);
	background: rgba(167, 139, 250, 0.35);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 4px 12px rgba(0, 0, 0, 0.2);
}

.ai-send-btn:disabled {
	opacity: 0.35;
	cursor: default;
}

.ai-send-spinner {
	display: inline-block;
	animation: spin 0.8s linear infinite;
}

@keyframes spin {
	to { transform: rotate(360deg); }
}

/* ── Sidebar ── */
.ai-sidebar-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.45);
	z-index: 2147483647;
}

.ai-sidebar {
	position: fixed;
	top: 0;
	left: 0;
	bottom: 0;
	width: 280px;
	max-width: 80vw;
	z-index: 2147483647;
	display: flex;
	flex-direction: column;
	background: rgba(5, 6, 10, 0.55);
	-webkit-backdrop-filter: url(#frosted);
	backdrop-filter: url(#frosted);
	border-right: 1.5px solid rgba(255, 255, 255, 0.15);
	box-shadow: 4px 0 24px rgba(0, 0, 0, 0.2);
	transform: translateX(-100%);
	transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.ai-sidebar.ai-sidebar-open {
	transform: translateX(0);
}

.ai-sidebar-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 16px 12px;
	padding-top: calc(16px + env(safe-area-inset-top));
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.ai-sidebar-title {
	font-size: 15px;
	font-weight: 800;
	color: rgba(255, 255, 255, 0.88);
}

.ai-sidebar-close {
	width: 28px;
	height: 28px;
	border-radius: 6px;
	border: none;
	background: rgba(255, 255, 255, 0.08);
	color: rgba(255, 255, 255, 0.7);
	font-size: 14px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s;
}

.ai-sidebar-close:hover {
	background: rgba(255, 255, 255, 0.15);
}

.ai-sidebar-actions {
	display: flex;
	gap: 8px;
	padding: 12px 16px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.ai-sidebar-actions .ai-header-btn {
	flex: 1;
	text-align: center;
	font-size: 12px;
	padding: 5px 8px;
}

.ai-danger-btn {
	border-color: rgba(248, 113, 113, 0.3) !important;
	color: rgba(248, 113, 113, 0.85) !important;
}

.ai-danger-btn:hover {
	background: rgba(248, 113, 113, 0.12) !important;
	border-color: rgba(248, 113, 113, 0.5) !important;
}

.ai-sidebar-list {
	flex: 1;
	overflow-y: auto;
	padding: 8px;
}

.ai-sidebar-empty {
	text-align: center;
	color: rgba(255, 255, 255, 0.35);
	font-size: 13px;
	padding: 32px 0;
}

.ai-sidebar-item {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 12px;
	border-radius: 10px;
	cursor: pointer;
	transition: background 0.18s;
	margin-bottom: 2px;
}

.ai-sidebar-item:hover {
	background: rgba(255, 255, 255, 0.1);
	border: 1px solid rgba(255, 255, 255, 0.12);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.ai-sidebar-item-active {
	background: rgba(167, 139, 250, 0.15);
	border: 1.5px solid rgba(167, 139, 250, 0.3);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 2px 8px rgba(0, 0, 0, 0.1);
}

.ai-sidebar-item-avatar {
	width: 22px;
	height: 22px;
	border-radius: 50%;
	flex-shrink: 0;
	object-fit: cover;
}

.ai-sidebar-item-title {
	flex: 1;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-size: 13px;
	color: rgba(255, 255, 255, 0.78);
}

.ai-sidebar-item-del {
	width: 22px;
	height: 22px;
	border-radius: 5px;
	border: none;
	background: transparent;
	color: rgba(255, 255, 255, 0.35);
	font-size: 11px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	opacity: 0;
	transition: opacity 0.15s, background 0.15s, color 0.15s;
}

.ai-sidebar-item:hover .ai-sidebar-item-del {
	opacity: 1;
}

.ai-sidebar-item-del:hover {
	background: rgba(248, 113, 113, 0.2);
	color: #f87171;
}

/* Sidebar bottom settings */
.ai-sidebar-bottom {
	padding: 12px 16px;
	border-top: 1px solid rgba(255, 255, 255, 0.08);
	margin-top: auto;
}

.ai-settings-btn {
	width: 100%;
	text-align: center;
	padding: 10px 0 !important;
	border-radius: 10px !important;
	font-size: 14px !important;
}

.ai-custom-api-badge {
	background: rgba(99, 102, 241, 0.25);
	color: #a5b4fc;
	font-size: 12px;
	text-align: center;
	padding: 4px 8px;
	border-radius: 6px;
	margin-bottom: 8px;
}

/* Warning dialog */
.ai-warning-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.6);
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 2147483647;
	padding: 20px;
}

.ai-warning-dialog {
	background: rgba(30, 30, 40, 0.95);
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 16px;
	padding: 32px 28px;
	max-width: 420px;
	width: 100%;
	text-align: center;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.ai-warning-title {
	font-size: 20px;
	font-weight: 700;
	color: #fbbf24;
	margin-bottom: 16px;
}

.ai-warning-text {
	font-size: 14px;
	line-height: 1.7;
	color: rgba(255, 255, 255, 0.78);
	margin-bottom: 24px;
}

.ai-warning-btn {
	background: rgba(99, 102, 241, 0.35);
	border: 1px solid rgba(99, 102, 241, 0.5);
	color: #c7d2fe;
	font-size: 15px;
	padding: 10px 32px;
	border-radius: 10px;
	cursor: pointer;
	transition: background 0.2s;
}

.ai-warning-btn:hover {
	background: rgba(99, 102, 241, 0.55);
}

/* API Settings dialog */
.ai-api-settings-dialog {
	background: rgba(30, 30, 40, 0.95);
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 16px;
	padding: 28px 24px;
	max-width: 440px;
	width: 100%;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.ai-api-settings-title {
	font-size: 18px;
	font-weight: 700;
	color: #e2e8f0;
	margin-bottom: 20px;
	text-align: center;
}

.ai-api-label {
	display: block;
	font-size: 13px;
	color: rgba(255, 255, 255, 0.6);
	margin-bottom: 6px;
	margin-top: 12px;
}

.ai-api-label:first-of-type {
	margin-top: 0;
}

.ai-api-input {
	width: 100%;
	background: rgba(255, 255, 255, 0.06);
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 8px;
	padding: 10px 12px;
	color: #e2e8f0;
	font-size: 14px;
	outline: none;
	box-sizing: border-box;
	transition: border-color 0.2s;
}

.ai-api-input:focus {
	border-color: rgba(99, 102, 241, 0.6);
}

.ai-api-input::placeholder {
	color: rgba(255, 255, 255, 0.25);
}

.ai-api-btns {
	display: flex;
	gap: 10px;
	margin-top: 20px;
}

.ai-api-btns .ai-warning-btn {
	flex: 1;
	text-align: center;
}

.ai-api-reset-btn {
	background: rgba(248, 113, 113, 0.2) !important;
	border-color: rgba(248, 113, 113, 0.4) !important;
	color: #fca5a5 !important;
}

.ai-api-reset-btn:hover {
	background: rgba(248, 113, 113, 0.35) !important;
}

/* ── End AI Chat Page ─────────────────────────────────────── */

.chat {
	width: min(1240px, 97vw);
	margin: 28px auto;
	padding: 0 4px calc(72px + env(safe-area-inset-bottom));
	position: relative;
	z-index: 1;
}

.chat.auth-chat {
	width: min(1240px, 97vw);
	margin: 0 auto;
	padding: max(18px, env(safe-area-inset-top)) 4px calc(72px + env(safe-area-inset-bottom));
	min-height: 100vh;
	min-height: 100dvh;
	display: flex;
	align-items: center;
	justify-content: center;
}

.loading {
	margin: 0;
	text-align: center;
	font-size: 18px;
	font-weight: 700;
}

.board {
	display: flex;
	flex-direction: column;
	gap: 14px;
	padding: 18px;
	border: 3px solid rgba(130, 102, 206, 0.95);
	background: transparent;
	box-shadow:
		0 0 0 3px rgba(183, 155, 247, 0.25) inset,
		0 18px 40px rgba(40, 25, 86, 0.4);
	border-radius: 14px;
}

.board.board-glass {
	border: 0;
	background: transparent;
	box-shadow:
		0 0 0 2px rgba(208, 187, 255, 0.28) inset,
		0 18px 40px rgba(40, 25, 86, 0.28);
	-webkit-backdrop-filter: blur(12px) saturate(120%);
	backdrop-filter: blur(12px) saturate(120%);
}

.board.board-liquid {
	position: relative;
	display: flex;
	overflow: hidden;
	isolation: isolate;
	border: 0;
	background: transparent;
	transition: box-shadow 0.4s cubic-bezier(0.175, 0.885, 0.32, 2.2),
		padding 0.4s cubic-bezier(0.175, 0.885, 0.32, 2.2),
		border-radius 0.4s cubic-bezier(0.175, 0.885, 0.32, 2.2);
	box-shadow:
		0 6px 6px rgba(0, 0, 0, 0.2),
		0 0 20px rgba(0, 0, 0, 0.08);
}

.board.board-liquid.messages-expanded {
	overflow: visible;
}

.board.board-liquid::before,
.board.board-liquid::after {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
}

.board.board-liquid::before {
	-webkit-backdrop-filter: blur(3px);
	backdrop-filter: blur(3px);
	filter: var(--glass-filter, url(#glass-distortion));
	overflow: hidden;
	isolation: isolate;
	background: transparent;
	z-index: 0;
}

.board.board-liquid::after {
	background: rgba(255, 255, 255, 0);
	box-shadow:
		inset 2px 2px 1px 0 rgba(255, 255, 255, 0.5),
		inset -1px -1px 1px 1px rgba(255, 255, 255, 0.5);
	z-index: 2;
}

.board.board-liquid > * {
	position: relative;
	z-index: 3;
}

/* Explicitly reinforce glass / liquid effects in the expanded state so that
   no cascade, transition or GPU-texture-limit issue can silently drop them. */
.app-shell.mode-glass .board.messages-expanded {
	-webkit-backdrop-filter: blur(16px) saturate(138%) !important;
	backdrop-filter: blur(16px) saturate(138%) !important;
	background: transparent !important;
}

.board.board-liquid.messages-expanded::before {
	-webkit-backdrop-filter: blur(3px) !important;
	backdrop-filter: blur(3px) !important;
	filter: var(--glass-filter, url(#glass-distortion)) !important;
}

.app-shell.mode-glass .topbar,
.app-shell.mode-glass .notify-panel,
.notify-mobile-layer.mode-glass .notify-panel,
.app-shell.mode-glass .board,
.app-shell.mode-glass .board-title,
.app-shell.mode-glass .board-header,
.app-shell.mode-glass .jump-toolbar,
.app-shell.mode-glass .background-customizer,
.app-shell.mode-glass .profile-form,
.app-shell.mode-glass .messages-toolbar,
.app-shell.mode-glass .message-row,
.app-shell.mode-glass .reply-item,
.app-shell.mode-glass .composer-form.sticky-bottom {
	background: transparent !important;
	-webkit-backdrop-filter: blur(16px) saturate(138%);
	backdrop-filter: blur(16px) saturate(138%);
	box-shadow:
		0 1px 0 rgba(255, 255, 255, 0.34) inset,
		0 12px 34px rgba(13, 10, 36, 0.24);
}

.app-shell.mode-glass .board {
	border: 0;
}

.app-shell.mode-glass .message-row,
.app-shell.mode-glass .reply-item {
	background: transparent !important;
	-webkit-backdrop-filter: none;
	backdrop-filter: none;
	box-shadow: none;
}

.app-shell.mode-glass .board-title,
.app-shell.mode-glass .board-header,
.app-shell.mode-glass .jump-toolbar,
.app-shell.mode-glass .background-customizer,
.app-shell.mode-glass .profile-form,
.app-shell.mode-glass .messages-toolbar,
.app-shell.mode-glass .message-row,
.app-shell.mode-glass .reply-item,
.app-shell.mode-glass .composer-form.sticky-bottom,
.app-shell.mode-glass .notify-panel,
.notify-mobile-layer.mode-glass .notify-panel {
	border-color: rgba(235, 226, 255, 0.52);
}

.app-shell.mode-liquid .topbar,
.app-shell.mode-liquid .board-header,
.app-shell.mode-liquid .jump-toolbar,
.app-shell.mode-liquid .background-customizer,
.app-shell.mode-liquid .profile-form,
.app-shell.mode-liquid .messages-toolbar,
.app-shell.mode-liquid .composer-form.sticky-bottom {
	position: relative;
	overflow: hidden;
	isolation: isolate;
	background: transparent !important;
	border: 0 !important;
	box-shadow:
		0 6px 6px rgba(0, 0, 0, 0.2),
		0 0 18px rgba(0, 0, 0, 0.08);
}

.app-shell.mode-liquid .topbar {
	overflow: visible;
}

.app-shell.mode-liquid .topbar::before,
.app-shell.mode-liquid .board-header::before,
.app-shell.mode-liquid .jump-toolbar::before,
.app-shell.mode-liquid .background-customizer::before,
.app-shell.mode-liquid .profile-form::before,
.app-shell.mode-liquid .messages-toolbar::before,
.app-shell.mode-liquid .composer-form.sticky-bottom::before {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	-webkit-backdrop-filter: blur(3px);
	backdrop-filter: blur(3px);
	filter: var(--glass-filter, url(#glass-distortion));
	overflow: hidden;
	isolation: isolate;
	background: transparent;
	z-index: 0;
}

.app-shell.mode-liquid .topbar::after,
.app-shell.mode-liquid .board-header::after,
.app-shell.mode-liquid .jump-toolbar::after,
.app-shell.mode-liquid .background-customizer::after,
.app-shell.mode-liquid .profile-form::after,
.app-shell.mode-liquid .messages-toolbar::after,
.app-shell.mode-liquid .composer-form.sticky-bottom::after {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	background: rgba(255, 255, 255, 0);
	box-shadow:
		inset 2px 2px 1px 0 rgba(255, 255, 255, 0.5),
		inset -1px -1px 1px 1px rgba(255, 255, 255, 0.5);
	z-index: 2;
}

.app-shell.mode-liquid .topbar > *,
.app-shell.mode-liquid .board-header > *,
.app-shell.mode-liquid .jump-toolbar > *,
.app-shell.mode-liquid .background-customizer > *,
.app-shell.mode-liquid .profile-form > *,
.app-shell.mode-liquid .messages-toolbar > *,
.app-shell.mode-liquid .composer-form.sticky-bottom > * {
	position: relative;
	z-index: 3;
}

.app-shell.mode-liquid .board-title {
	position: relative;
	z-index: 6;
}

.notify-mobile-layer.mode-liquid .notify-panel {
	position: fixed;
	overflow: hidden;
	isolation: isolate;
	background: transparent !important;
	border: 0 !important;
	box-shadow:
		0 6px 6px rgba(0, 0, 0, 0.2),
		0 0 18px rgba(0, 0, 0, 0.08);
}

.notify-mobile-layer.mode-liquid .notify-panel::before {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	-webkit-backdrop-filter: blur(3px);
	backdrop-filter: blur(3px);
	filter: var(--glass-filter, url(#glass-distortion));
	overflow: hidden;
	isolation: isolate;
	background: transparent;
	z-index: 0;
}

.notify-mobile-layer.mode-liquid .notify-panel::after {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	background: rgba(255, 255, 255, 0);
	box-shadow:
		inset 2px 2px 1px 0 rgba(255, 255, 255, 0.5),
		inset -1px -1px 1px 1px rgba(255, 255, 255, 0.5);
	z-index: 2;
}

.notify-mobile-layer.mode-liquid .notify-panel > * {
	position: relative;
	z-index: 3;
}

.liquid-filter-defs {
	position: absolute;
	width: 0;
	height: 0;
	pointer-events: none;
	opacity: 0;
}

.board-title {
	align-self: center;
	padding: 10px 24px;
	font-size: 46px;
	font-weight: 900;
	letter-spacing: 4px;
	line-height: 1;
	color: #efe2ff;
	background: transparent;
	border: 4px solid rgba(138, 109, 219, 0.95);
	text-shadow: 2px 2px 0 #5f459f;
}

.board-header {
	margin: 0;
	padding: 10px 12px;
	border: 2px solid rgba(148, 117, 225, 0.85);
	background: transparent;
	border-radius: 12px;
}

.jump-toolbar {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 8px;
	padding: 8px 10px;
	border: 2px solid rgba(148, 117, 225, 0.85);
	background: transparent;
	border-radius: 12px;
}

.jump-item {
	display: flex;
	gap: 6px;
	margin: 0;
}

.jump-item input {
	flex: 1;
	height: 32px;
	margin: 0;
	font-size: 12px;
}

.jump-item button {
	height: 32px;
	line-height: 28px;
	padding: 0 10px;
	font-size: 12px;
}

.user-info {
	display: flex;
	gap: 10px;
	align-items: center;
	color: #f5ebff;
}

.muted {
	color: #e8dafb;
	font-size: 12px;
	font-weight: 700;
}

.align-right {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
}

.board button,
.board .button,
.board .button-primary {
	background: transparent;
	font-size: 16px;
	line-height: 30px;
	border-color: rgba(218, 201, 255, 0.85);
	color: #f4ecff;
	text-shadow: 1px 1px 0 rgba(67, 45, 123, 0.85);
}

.board button:hover,
.board .button:hover,
.board .button-primary:hover {
	background: rgba(255, 255, 255, 0.08);
	border-color: rgba(237, 223, 255, 0.95);
	color: #fff;
}

button,
.button,
.button-primary {
	margin: 0;
	height: 34px;
	line-height: 30px;
	padding: 0 14px;
	border: 2px solid #8b68d9;
	background: linear-gradient(180deg, #c5a7ff 0%, #a67bf0 100%);
	color: #fdf8ff;
	font-weight: 800;
	text-shadow: 1px 1px 0 #604097;
	border-radius: 10px;
	box-shadow: none;
}

button:hover,
.button:hover,
.button-primary:hover {
	border-color: #9c76ea;
	background: linear-gradient(180deg, #d0b8ff 0%, #b287ff 100%);
	color: #fff;
}

button:disabled {
	opacity: 0.75;
	cursor: not-allowed;
}

.profile-form {
	margin: 0;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 10px;
	border: 2px solid rgba(148, 117, 225, 0.85);
	background: transparent;
	border-radius: 12px;
}

.background-customizer {
	padding: 8px 10px;
	border: 2px solid rgba(148, 117, 225, 0.85);
	background: transparent;
	border-radius: 12px;
}

.background-form {
	margin: 0;
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

.background-file-control {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 34px;
	line-height: 30px;
	padding: 0 14px;
	border: 2px solid #8b68d9;
	background: linear-gradient(180deg, #c5a7ff 0%, #a67bf0 100%);
	color: #fdf8ff;
	font-weight: 800;
	text-shadow: 1px 1px 0 #604097;
	border-radius: 10px;
	cursor: pointer;
	white-space: nowrap;
}

.background-file-control:hover {
	border-color: #9c76ea;
	background: linear-gradient(180deg, #d0b8ff 0%, #b287ff 100%);
}

.background-file-control input[type="file"] {
	position: absolute;
	inset: 0;
	opacity: 0;
	cursor: pointer;
}

.profile-input {
	flex: 1;
	min-width: 0;
}

input[type="text"],
input[type="password"],
input[type="url"] {
	margin: 0;
	height: 38px;
	border: 2px solid rgba(151, 121, 226, 0.85);
	background: transparent;
	color: #fff;
	border-radius: 10px;
	box-shadow:
		0 1px 0 rgba(255, 255, 255, 0.22) inset,
		0 8px 18px rgba(26, 12, 63, 0.18);
	-webkit-backdrop-filter: blur(18px) saturate(138%);
	backdrop-filter: blur(18px) saturate(138%);
}

input::placeholder {
	color: rgba(233, 221, 255, 0.75);
}

input:focus {
	border-color: #d4baff;
	box-shadow:
		0 0 0 2px rgba(204, 173, 255, 0.25),
		0 1px 0 rgba(255, 255, 255, 0.3) inset,
		0 10px 24px rgba(26, 12, 63, 0.22);
}

.messages {
	max-height: 50vh;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding-right: 2px;
}

.messages.expanded {
	max-height: none !important;
	height: auto !important;
	overflow: visible !important;
	padding-right: 0;
}

.messages-toolbar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 8px;
	padding: 8px 10px;
	border: 2px solid rgba(148, 117, 225, 0.85);
	background: transparent;
	border-radius: 12px;
}

.messages-toolbar-actions {
	display: flex;
	align-items: center;
	gap: 8px;
}

.messages-toolbar button {
	height: 30px;
	line-height: 26px;
	padding: 0 10px;
	font-size: 12px;
}

.picker-toolbar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 8px;
	min-width: 0;
	margin-bottom: 6px;
}

.picker-toolbar .picker-title {
	margin-bottom: 0;
	min-width: 0;
	overflow-wrap: anywhere;
}

.picker-toggle {
	height: 28px;
	line-height: 24px;
	padding: 0 10px;
	font-size: 12px;
}


.messages::-webkit-scrollbar {
	width: 10px;
}

.messages::-webkit-scrollbar-thumb {
	background: rgba(201, 172, 255, 0.62);
	border: 2px solid rgba(105, 79, 175, 0.62);
}

.message-row {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	border: 3px solid rgba(126, 99, 201, 0.95);
	background: transparent;
	padding: 12px;
	border-radius: 12px;
	transition: box-shadow 220ms ease, border-color 220ms ease;
}

.message-row.jump-highlight {
	border-color: rgba(255, 223, 153, 0.95);
	box-shadow: 0 0 0 3px rgba(255, 218, 133, 0.35);
}

.floor-tag {
	min-width: 62px;
	font-weight: 900;
	font-size: 35px;
	line-height: 1;
	color: #ff97de;
	text-shadow: 2px 2px 0 #614298;
}

.message-body {
	flex: 1;
	min-width: 0;
	word-break: break-word;
	font-size: 24px;
	line-height: 1.5;
	font-weight: 700;
	color: #fff5ff;
	text-shadow: 1px 1px 0 #583b94;
}

.message-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: center;
	margin-bottom: 6px;
	font-size: 16px;
	color: #f1e4ff;
	font-weight: 800;
	word-break: normal;
}

.message-meta span {
	white-space: nowrap;
}

.message-tail {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
	margin-top: 8px;
}

.message-content-inline,
.reply-content-inline {
	display: flex;
	align-items: center;
	gap: 6px;
	flex-wrap: wrap;
}

.reply-content-inline {
	margin-top: 2px;
}

.board .inline-expand-btn,
.board .reply-list-toggle-btn {
	height: 22px;
	line-height: 18px;
	padding: 0 8px;
	font-size: 11px;
	font-weight: 800;
	white-space: nowrap;
	border-radius: 999px;
	border-color: rgba(224, 210, 255, 0.9);
	background: rgba(255, 255, 255, 0.06);
	color: #f6ecff;
	text-shadow: 1px 1px 0 rgba(67, 45, 123, 0.72);
}

.board .inline-expand-btn:hover,
.board .reply-list-toggle-btn:hover {
	background: rgba(255, 255, 255, 0.12);
	border-color: rgba(242, 231, 255, 0.95);
}

.reply-list-footer {
	display: flex;
	justify-content: flex-end;
	margin-top: 2px;
}

.message-tail button {
	height: 28px;
	line-height: 24px;
	font-size: 12px;
	padding: 0 12px;
}

.message-tail .like-btn {
	transition: color 0.2s ease, border-color 0.2s ease;
}

.message-tail .like-btn.liked {
	color: #ff6b9d;
	border-color: rgba(255, 107, 157, 0.7);
	text-shadow: 0 0 6px rgba(255, 107, 157, 0.4);
}

.message-tail .like-btn.liked:hover {
	border-color: rgba(255, 107, 157, 0.9);
}

.reply-list {
	margin-top: 10px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.reply-item {
	display: flex;
	gap: 8px;
	padding: 8px;
	border: 1px dashed rgba(255, 255, 255, 0.25);
	background: transparent;
	border-radius: 10px;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.reply-item.reply-highlight {
	border-color: rgba(120, 184, 255, 0.95);
	box-shadow: 0 0 0 2px rgba(120, 184, 255, 0.25);
}

.reply-item .avatar {
	width: 28px;
	height: 28px;
	min-width: 28px;
}

.reply-body {
	flex: 1;
	font-size: 14px;
	word-break: break-word;
}

.reply-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	font-size: 12px;
	opacity: 0.9;
	margin-bottom: 4px;
	align-items: center;
	word-break: normal;
}

.reply-meta span {
	white-space: nowrap;
}

.reply-meta button {
	height: 24px;
	line-height: 20px;
	padding: 0 8px;
	font-size: 11px;
}

.reply-mention {
	color: #72b8ff;
	font-weight: 900;
}

.reply-form {
	margin-top: 10px;
	display: flex;
	gap: 8px;
}

.reply-form input {
	flex: 1;
	height: 34px;
	margin: 0;
}

.reply-form button {
	height: 34px;
	line-height: 30px;
	padding: 0 10px;
	font-size: 12px;
}

.delete-floor {
	padding: 0 10px;
	height: 28px;
	line-height: 24px;
	font-size: 12px;
	margin-left: auto;
	border-color: #ff9add;
	background: linear-gradient(180deg, #ffc8f0 0%, #f49ee2 100%);
	text-shadow: none;
	color: #663164;
}

.send-message {
	padding: 0;
	flex: 0 0 70px;
	min-width: 64px;
	font-size: 24px !important;
	font-weight: 900;
}

.composer-form {
	margin: 0;
	display: flex;
	gap: 8px;
	align-items: center;
}

.board.messages-expanded {
	position: relative;
	padding-bottom: calc(104px + env(safe-area-inset-bottom));
}

.board.messages-expanded .composer-form.sticky-bottom {
	position: sticky;
	left: auto;
	right: auto;
	transform: none;
	bottom: max(8px, env(safe-area-inset-bottom));
	width: auto;
	max-width: none;
	z-index: 25;
}

.composer-form.sticky-bottom {
	position: sticky;
	bottom: max(8px, env(safe-area-inset-bottom));
	z-index: 25;
	padding: 8px;
	border: 2px solid rgba(148, 117, 225, 0.85);
	background: transparent;
	border-radius: 12px;
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
	transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.app-shell.mode-liquid .board.messages-expanded .composer-form.sticky-bottom {
	position: sticky;
	overflow: visible;
	-webkit-backdrop-filter: none;
	backdrop-filter: none;
	background: rgba(255, 255, 255, 0.08);
	border: 1px solid rgba(238, 231, 255, 0.42);
	box-shadow:
		0 1px 0 rgba(255, 255, 255, 0.32) inset,
		0 10px 24px rgba(16, 10, 40, 0.26);
}

.board.messages-expanded .composer-form.sticky-bottom:hover {
	border-color: rgba(236, 223, 255, 0.95);
	background: rgba(255, 255, 255, 0.08);
	box-shadow:
		0 1px 0 rgba(255, 255, 255, 0.3) inset,
		0 10px 24px rgba(26, 12, 63, 0.26);
}

.app-shell.mode-glass .board.messages-expanded .composer-form.sticky-bottom:hover {
	background: transparent !important;
	border-color: rgba(245, 235, 255, 0.98);
	box-shadow:
		0 1px 0 rgba(255, 255, 255, 0.42) inset,
		0 14px 30px rgba(16, 10, 40, 0.32);
}

.app-shell.mode-glass .board.messages-expanded .composer-form.sticky-bottom {
	overflow: visible;
	-webkit-backdrop-filter: blur(16px) saturate(138%);
	backdrop-filter: blur(16px) saturate(138%);
	background: transparent !important;
	border: 2px solid rgba(235, 226, 255, 0.52);
	box-shadow:
		0 1px 0 rgba(255, 255, 255, 0.34) inset,
		0 12px 34px rgba(13, 10, 36, 0.24);
}

.app-shell.mode-liquid .board.messages-expanded .composer-form.sticky-bottom::before,
.app-shell.mode-liquid .board.messages-expanded .composer-form.sticky-bottom::after {
	display: none;
}

.app-shell.mode-liquid .board.messages-expanded .composer-form.sticky-bottom:hover {
	border-color: rgba(245, 236, 255, 0.6) !important;
	background: rgba(255, 255, 255, 0.1) !important;
}


.back-to-top-btn {
	position: fixed;
	right: 14px;
	bottom: calc(14px + env(safe-area-inset-bottom));
	width: 36px;
	height: 36px;
	padding: 0;
	border-radius: 999px;
	font-size: 18px;
	line-height: 32px;
	font-weight: 900;
	z-index: 2147483646;
	border: 2px solid rgba(222, 206, 255, 0.9);
	color: #f8efff;
	background: rgba(108, 83, 183, 0.72);
	text-shadow: 1px 1px 0 rgba(67, 45, 123, 0.85);
	box-shadow: 0 8px 20px rgba(20, 10, 50, 0.28);
	transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.back-to-top-btn:hover {
	transform: translateY(-1px);
	border-color: rgba(245, 236, 255, 0.98);
	background: rgba(131, 103, 206, 0.86);
	box-shadow: 0 10px 22px rgba(20, 10, 50, 0.34);
}

.app-shell.mode-glass .back-to-top-btn {
	background: transparent;
	border-color: rgba(236, 223, 255, 0.72);
	box-shadow:
		0 1px 0 rgba(255, 255, 255, 0.35) inset,
		0 10px 22px rgba(16, 9, 41, 0.24);
	-webkit-backdrop-filter: blur(12px) saturate(132%);
	backdrop-filter: blur(12px) saturate(132%);
}

.app-shell.mode-glass .back-to-top-btn:hover {
	background: transparent;
	border-color: rgba(245, 236, 255, 0.92);
	box-shadow:
		0 1px 0 rgba(255, 255, 255, 0.45) inset,
		0 12px 26px rgba(16, 9, 41, 0.3);
}

.app-shell.mode-liquid .back-to-top-btn {
	position: fixed;
	overflow: hidden;
	isolation: isolate;
	background: transparent;
	border: 0;
	box-shadow:
		0 6px 6px rgba(0, 0, 0, 0.2),
		0 0 16px rgba(0, 0, 0, 0.08);
}

.app-shell.mode-liquid .back-to-top-btn::before {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	-webkit-backdrop-filter: blur(3px);
	backdrop-filter: blur(3px);
	filter: var(--glass-filter, url(#glass-distortion));
	background: transparent;
	z-index: 0;
}

.app-shell.mode-liquid .back-to-top-btn::after {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	background: rgba(255, 255, 255, 0);
	box-shadow:
		inset 2px 2px 1px 0 rgba(255, 255, 255, 0.5),
		inset -1px -1px 1px 1px rgba(255, 255, 255, 0.5);
	z-index: 1;
}

.app-shell.mode-liquid .back-to-top-btn:hover {
	box-shadow:
		0 9px 14px rgba(0, 0, 0, 0.25),
		0 0 20px rgba(255, 255, 255, 0.14);
}

.app-shell.mode-liquid .back-to-top-btn {
	color: #f8efff;
	text-shadow: 1px 1px 0 rgba(67, 45, 123, 0.85);
}

@media (min-width: 641px) {
	.board.messages-expanded {
		padding-bottom: calc(152px + env(safe-area-inset-bottom));
	}

	.composer-form.sticky-bottom {
		bottom: calc(66px + env(safe-area-inset-bottom));
	}

	.board.messages-expanded .composer-form.sticky-bottom {
		position: sticky;
		left: auto;
		right: auto;
		transform: none;
		bottom: calc(64px + env(safe-area-inset-bottom));
		width: auto;
		max-width: none;
		z-index: 25;
	}

	/* PC 端输入框统一使用平铺模式样式与行为，不跟随玻璃/液态特效 */
	.app-shell.mode-glass .composer-form.sticky-bottom,
	.app-shell.mode-liquid .composer-form.sticky-bottom,
	.app-shell.mode-glass .board.messages-expanded .composer-form.sticky-bottom,
	.app-shell.mode-liquid .board.messages-expanded .composer-form.sticky-bottom {
		position: sticky;
		bottom: calc(64px + env(safe-area-inset-bottom));
		left: auto;
		right: auto;
		width: auto;
		max-width: none;
		z-index: 25;
		overflow: visible;
		border: 2px solid rgba(148, 117, 225, 0.85) !important;
		background: transparent !important;
		box-shadow: none !important;
		-webkit-backdrop-filter: none !important;
		backdrop-filter: none !important;
	}

	.app-shell.mode-liquid .composer-form.sticky-bottom::before,
	.app-shell.mode-liquid .composer-form.sticky-bottom::after {
		display: none !important;
	}

	.app-shell.mode-glass .board.messages-expanded .composer-form.sticky-bottom:hover,
	.app-shell.mode-liquid .board.messages-expanded .composer-form.sticky-bottom:hover {
		border-color: rgba(236, 223, 255, 0.95) !important;
		background: rgba(255, 255, 255, 0.08) !important;
		box-shadow:
			0 1px 0 rgba(255, 255, 255, 0.3) inset,
			0 10px 24px rgba(26, 12, 63, 0.26) !important;
	}

	/* PC 端复刻移动端展开态外观（不含输入框） */
	.app-shell.mode-glass .board.messages-expanded .messages-toolbar,
	.app-shell.mode-glass .board.messages-expanded .message-row,
	.app-shell.mode-glass .board.messages-expanded .reply-item {
		background: transparent !important;
		border-color: rgba(235, 226, 255, 0.52);
	}

	.app-shell.mode-liquid .board.messages-expanded .message-row,
	.app-shell.mode-liquid .board.messages-expanded .reply-item,
	.app-shell.mode-liquid .board.messages-expanded .messages-toolbar {
		overflow: visible;
		box-shadow: none;
		-webkit-backdrop-filter: none;
		backdrop-filter: none;
	}

	.app-shell.mode-liquid .board.messages-expanded .message-row::before,
	.app-shell.mode-liquid .board.messages-expanded .message-row::after,
	.app-shell.mode-liquid .board.messages-expanded .reply-item::before,
	.app-shell.mode-liquid .board.messages-expanded .reply-item::after,
	.app-shell.mode-liquid .board.messages-expanded .messages-toolbar::before,
	.app-shell.mode-liquid .board.messages-expanded .messages-toolbar::after {
		display: none;
	}

	.app-shell.mode-liquid .board.messages-expanded .message-row {
		border: 1px solid rgba(238, 231, 255, 0.28);
		background: transparent !important;
	}
}

.composer-input {
	flex: 1;
	min-width: 0;
}

.avatar {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	object-fit: cover;
	background: #b89be7;
	border: 2px solid rgba(241, 225, 255, 0.85);
}

.auth-wrap {
	display: flex;
	justify-content: center;
	align-items: center;
	position: relative;
	z-index: 1;
	min-height: 72vh;
	overflow: hidden;
	border: 1px solid rgba(233, 220, 255, 0.34);
	box-shadow:
		0 0 0 1px rgba(255, 255, 255, 0.16) inset,
		0 26px 60px rgba(30, 17, 66, 0.45);
	border-radius: 18px;
	-webkit-backdrop-filter: saturate(112%);
	backdrop-filter: saturate(112%);
}

.auth-wrap::before {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	z-index: 1;
	background:
		radial-gradient(circle at 16% 12%, rgba(255, 255, 255, 0.35), transparent 38%),
		radial-gradient(circle at 84% 88%, rgba(207, 180, 255, 0.22), transparent 45%);
}

.auth-wrap::after {
	content: "";
	position: absolute;
	inset: 1px;
	border-radius: 17px;
	pointer-events: none;
	z-index: 1;
	background: linear-gradient(140deg, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0.03) 45%, rgba(255, 255, 255, 0.08) 100%);
}

.auth-screen-bg-track {
	position: fixed;
	inset: 0;
	z-index: 0;
	pointer-events: none;
	overflow: hidden;
}

.auth-bg-screen {
	position: absolute;
	inset: 0;
	background-size: cover;
	background-repeat: no-repeat;
	background-position: center;
	opacity: 0;
	transition: opacity 900ms ease;
	filter: none;
	transform: none;
}

.auth-bg-screen.active {
	opacity: 1;
}

.auth-bg-track {
	position: absolute;
	inset: 0;
	z-index: 0;
}

.auth-bg {
	position: absolute;
	inset: 0;
	background-size: cover;
	background-repeat: no-repeat;
	background-position: center;
	opacity: 0;
	transition: opacity 900ms ease;
	filter: none;
}

.auth-bg::after {
	content: "";
	position: absolute;
	inset: 0;
	background: transparent;
}

.auth-bg-0 {
	background-image: url("https://r2-jk.makuraly.xyz/photo/1%20(11).jpg");
}

.auth-bg-1 {
	background-image: url("https://r2-jk.makuraly.xyz/photo/1%20(6).jpg");
}

.auth-bg-2 {
	background-image: url("https://r2-jk.makuraly.xyz/photo/1%20(2).jpg");
}

.auth-bg.active {
	opacity: 1;
}

.auth-panel {
	width: min(520px, 100%);
	position: relative;
	z-index: 2;
	padding: 20px;
	border: 1px solid rgba(236, 223, 255, 0.38);
	background: rgba(112, 83, 181, 0.22);
	box-shadow:
		0 0 0 1px rgba(255, 255, 255, 0.2) inset,
		0 14px 34px rgba(37, 20, 83, 0.36);
	border-radius: 16px;
	-webkit-backdrop-filter: saturate(116%);
	backdrop-filter: saturate(116%);
}

.auth-panel::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 36%;
	pointer-events: none;
	border-radius: 16px 16px 40% 40%;
	background: linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0));
}

.auth-header {
	display: flex;
	justify-content: center;
	align-items: center;
	margin-bottom: 14px;
}

.auth-header h5 {
	margin: 0;
	font-size: 30px;
	font-weight: 900;
	color: #f7ebff;
	text-shadow: 2px 2px 0 #5c3f98;
}

.auth-tabs {
	display: flex;
	gap: 8px;
}

.auth-tabs button {
	width: 74px;
	height: 32px;
	line-height: 28px;
	padding: 0;
	opacity: 0.75;
	border: 1px solid rgba(236, 223, 255, 0.38);
	background: rgba(183, 155, 247, 0.2);
	box-shadow: 0 4px 14px rgba(32, 16, 67, 0.2) inset;
}

.auth-tabs-prominent {
	margin-bottom: 14px;
	gap: 10px;
}

.auth-tabs-prominent button {
	flex: 1;
	max-width: none;
	height: 42px;
	line-height: 38px;
	font-size: 16px;
	font-weight: 900;
	opacity: 0.9;
	border-width: 2px;
}

.auth-tabs button.active {
	opacity: 1;
	border-color: rgba(255, 255, 255, 0.6);
	background: linear-gradient(180deg, rgba(227, 206, 255, 0.55) 0%, rgba(183, 141, 253, 0.42) 100%);
	box-shadow:
		0 0 0 1px rgba(255, 255, 255, 0.25) inset,
		0 10px 24px rgba(67, 43, 126, 0.3);
}

.auth-form {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin: 0;
}

.auth-form label {
	margin: 0;
	font-size: 14px;
	font-weight: 700;
	color: #efdcff;
}

.auth-form input {
	border: 1px solid rgba(236, 223, 255, 0.36);
	background: rgba(133, 104, 202, 0.28);
	box-shadow:
		0 1px 0 rgba(255, 255, 255, 0.25) inset,
		0 10px 24px rgba(27, 14, 59, 0.2);
	color: #f8efff;
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
}

.auth-form input::placeholder {
	color: rgba(242, 228, 255, 0.75);
}

.auth-form input:focus {
	border-color: rgba(255, 255, 255, 0.62);
	box-shadow:
		0 0 0 1px rgba(255, 255, 255, 0.2) inset,
		0 0 0 3px rgba(198, 171, 255, 0.22),
		0 12px 28px rgba(33, 17, 70, 0.3);
}

.avatar-picker-section {
	margin-top: 2px;
}

.picker-toolbar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 8px;
	margin-bottom: 6px;
}

.picker-toolbar .picker-title {
	margin-bottom: 0;
}

.picker-title {
	font-size: 12px;
	font-weight: 700;
	color: rgba(245, 235, 255, 0.92);
	margin-bottom: 6px;
}

.picker-toggle {
	height: 28px;
	line-height: 24px;
	padding: 0 10px;
	font-size: 12px;
}

.avatar-picker {
	display: grid;
	grid-template-columns: repeat(8, minmax(0, 1fr));
	gap: 6px;
}

.avatar-option {
	padding: 0;
	width: 100%;
	aspect-ratio: 1 / 1;
	border-radius: 50%;
	overflow: hidden;
	border: 2px solid rgba(255, 255, 255, 0.24);
	background: rgba(255, 255, 255, 0.04);
	height: auto;
	line-height: normal;
}

.avatar-option img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.avatar-option.active {
	border-color: #fff;
	box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35);
}

.profile-avatar-picker {
	padding: 8px 10px;
	border: 2px solid rgba(148, 117, 225, 0.85);
	background: rgba(102, 76, 170, 0.45);
	border-radius: 12px;
}

.auth-submit {
	margin-top: 6px;
	width: 100%;
}

.auth-switch {
	margin-top: 12px;
	font-size: 12px;
	font-weight: 700;
	color: rgba(246, 236, 255, 0.9);
	text-align: center;
	text-shadow: 0 1px 2px rgba(33, 17, 70, 0.35);
}

.error-tip {
	color: #ffd0f2;
	font-size: 13px;
	font-weight: 700;
	margin-bottom: 0;
	text-shadow: 1px 1px 0 #6c3d74;
}

.error-tip-spaced {
	margin-top: 8px;
}

.bottom-dock {
	position: fixed;
	left: 0;
	right: 0;
	bottom: max(14px, env(safe-area-inset-bottom));
	display: flex;
	justify-content: center;
	z-index: 20;
	pointer-events: none;
}

.glass-home-btn {
	pointer-events: auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 230px;
	height: 42px;
	padding: 0 18px;
	border-radius: 999px;
	border: 1px solid rgba(255, 255, 255, 0.42);
	background: rgba(255, 255, 255, 0.08);
	color: rgba(255, 255, 255, 0.96);
	text-decoration: none;
	font-size: 14px;
	font-weight: 800;
	text-shadow: 0 1px 0 rgba(0, 0, 0, 0.28);
	-webkit-backdrop-filter: blur(12px) saturate(1);
	backdrop-filter: blur(12px) saturate(1);
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, 0.32),
		0 8px 22px rgba(0, 0, 0, 0.2);
	transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.glass-home-btn:hover {
	transform: translateY(-1px);
	background: rgba(255, 255, 255, 0.14);
	border-color: rgba(255, 255, 255, 0.6);
	color: #fff;
}

.admin-page {
	width: min(1100px, 95vw);
	margin: 28px auto;
	padding: 18px;
	position: relative;
	overflow: hidden;
	isolation: isolate;
	border: 2px solid rgba(219, 202, 255, 0.42);
	background: rgba(255, 255, 255, 0);
	box-shadow:
		0 0 0 1px rgba(255, 255, 255, 0.16) inset,
		0 18px 40px rgba(40, 25, 86, 0.35);
	border-radius: 22px;
}

.admin-login {
	max-width: 420px;
	margin: 20px auto;
	padding: 14px;
	position: relative;
	overflow: hidden;
	isolation: isolate;
	border: 1px solid rgba(255, 255, 255, 0.28);
	background: rgba(255, 255, 255, 0);
	border-radius: 16px;
}

.admin-login form {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.admin-toolbar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 10px;
	margin-bottom: 14px;
}

.admin-toolbar > div {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

.admin-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
	gap: 12px;
}

@media (min-width: 769px) {
	.admin-card-wide {
		grid-column: 1 / -1;
	}
}

.admin-card {
	padding: 12px;
	position: relative;
	overflow: hidden;
	isolation: isolate;
	border: 1px solid rgba(255, 255, 255, 0.26);
	background: rgba(255, 255, 255, 0);
	border-radius: 16px;
}

.admin-page::before,
.admin-login::before,
.admin-card::before,
.admin-message-item::before,
.admin-reply-list::before,
.admin-announcement-item::before {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	clip-path: inset(0 round inherit);
	pointer-events: none;
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
	filter: var(--glass-filter, url(#glass-distortion));
	background: transparent;
	z-index: 0;
}

.admin-page::after,
.admin-login::after,
.admin-card::after,
.admin-message-item::after,
.admin-reply-list::after,
.admin-announcement-item::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	clip-path: inset(0 round inherit);
	pointer-events: none;
	background: rgba(255, 255, 255, 0);
	box-shadow:
		inset 2px 2px 1px 0 rgba(255, 255, 255, 0.5),
		inset -1px -1px 1px 1px rgba(255, 255, 255, 0.34);
	z-index: 1;
}

.admin-page > *,
.admin-login > *,
.admin-card > *,
.admin-message-item > *,
.admin-reply-list > *,
.admin-announcement-item > * {
	position: relative;
	z-index: 2;
}

.admin-card h5 {
	margin: 0 0 10px;
}

.admin-group-title {
	grid-column: 1 / -1;
	margin: 18px 0 4px;
	padding: 0 2px;
	font-size: 17px;
	font-weight: 800;
	color: #e8d5ff;
	text-shadow: 1px 1px 0 #3c2a6d;
	border-bottom: 1.5px solid rgba(200, 180, 255, 0.22);
	padding-bottom: 6px;
}

.admin-group-title:first-child {
	margin-top: 0;
}

.admin-card-header {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 10px;
	padding: 6px 10px;
	font-size: 15px;
	font-weight: 800;
	color: #f2e7ff;
	cursor: pointer;
	border-radius: 10px;
	transition: background 0.18s;
	list-style: none;
	-webkit-user-select: none;
	user-select: none;
}

.admin-card-header::-webkit-details-marker {
	display: none;
}

.admin-card-header::before {
	content: "▸";
	display: inline-block;
	font-size: 13px;
	transition: transform 0.2s ease;
	color: #c4a8ff;
}

details.admin-card[open] > .admin-card-header::before {
	transform: rotate(90deg);
}

.admin-card-header:hover {
	background: rgba(255, 255, 255, 0.06);
}

details.admin-card:not([open]) {
	padding: 4px 12px;
}

details.admin-card:not([open]) > .admin-card-header {
	margin-bottom: 0;
}

.admin-scroll {
	max-height: 58vh;
	overflow: auto;
}

.admin-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 13px;
}

.admin-table th,
.admin-table td {
	padding: 6px 8px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.2);
	text-align: left;
	vertical-align: top;
}

.admin-message-item {
	padding: 8px;
	position: relative;
	overflow: hidden;
	isolation: isolate;
	border: 1px solid rgba(255, 255, 255, 0.22);
	margin-bottom: 8px;
	background: rgba(255, 255, 255, 0);
	display: flex;
	flex-direction: column;
	gap: 6px;
	border-radius: 10px;
}

.admin-reply-list {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 6px;
	position: relative;
	overflow: hidden;
	isolation: isolate;
	border: 1px dashed rgba(255, 255, 255, 0.22);
	background: rgba(255, 255, 255, 0);
	border-radius: 10px;
}

.admin-reply-item {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 8px;
	font-size: 12px;
}

.admin-reply-item button {
	height: 24px;
	line-height: 20px;
	padding: 0 8px;
	font-size: 11px;
}

.admin-announcement-form {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-bottom: 14px;
}

.admin-announcement-form-header,
.admin-announcement-form-actions,
.admin-announcement-actions,
.admin-announcement-meta {
	display: flex;
	align-items: center;
}

.admin-announcement-form-header,
.admin-announcement-form-actions {
	justify-content: space-between;
	gap: 10px;
}

.admin-announcement-actions {
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 8px;
}

.admin-announcement-secondary {
	background: rgba(255, 255, 255, 0.12);
}

.admin-announcement-form input,
.admin-announcement-form textarea,
.admin-announcement-form select {
	width: 100%;
	border: 1px solid rgba(255, 255, 255, 0.28);
	background: rgba(255, 255, 255, 0);
	color: inherit;
	border-radius: 10px;
	padding: 10px 12px;
	-webkit-backdrop-filter: blur(8px) saturate(116%);
	backdrop-filter: blur(8px) saturate(116%);
}

.admin-announcement-form textarea {
	resize: vertical;
	min-height: 140px;
}

.admin-announcement-list {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.admin-announcement-item {
	padding: 10px 12px;
	position: relative;
	overflow: hidden;
	isolation: isolate;
	border: 1px solid rgba(255, 255, 255, 0.24);
	background: rgba(255, 255, 255, 0);
	border-radius: 12px;
}

.admin-announcement-head {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 10px;
}

.admin-announcement-content {
	margin-top: 10px;
	line-height: 1.7;
	white-space: pre-wrap;
	word-break: break-word;
}

.admin-announcement-meta {
	margin-top: 8px;
	color: rgba(255, 255, 255, 0.72);
	font-size: 12px;
}

@media (max-width: 900px) {
	.brand {
		font-size: 22px;
	}

	.nav-links {
		font-size: 16px;
	}

	.chat {
		width: 96vw;
		margin-top: 18px;
	}

	.board-title {
		font-size: 34px;
		padding: 8px 14px;
	}

	.announcement-page {
		width: min(96vw, 720px);
	}

	.announcement-entry-head {
		flex-direction: column;
	}

	.floor-tag {
		font-size: 28px;
		min-width: 52px;
	}

	.message-body {
		font-size: 19px;
	}

	.jump-toolbar {
		grid-template-columns: 1fr;
	}

	.avatar-picker {
		grid-template-columns: repeat(6, minmax(0, 1fr));
	}

	.glass-home-btn {
		min-width: 200px;
		height: 40px;
		font-size: 13px;
	}

	.admin-grid {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 640px) {
	.announcement-modal-layer {
		padding: 12px;
	}

	.announcement-modal-card,
	.announcement-page-shell,
	.announcement-entry {
		border-radius: 20px;
	}

	.announcement-modal-card,
	.announcement-page-shell {
		padding: 18px 16px;
	}

	.appearance-menu {
		top: calc(env(safe-area-inset-top) + 64px);
		right: max(8px, env(safe-area-inset-right));
	}

	.appearance-dropdown {
		position: absolute;
		top: calc(100% + 8px);
		right: 0;
		left: auto;
		min-width: 168px;
		max-width: calc(100vw - 24px);
		z-index: 2147483647;
	}

	body {
		background-position: center center, 56% center;
	}

	.notify-panel {
		position: fixed;
		top: calc(env(safe-area-inset-top) + 10px);
		left: 8px;
		right: 8px;
		width: auto;
		max-height: calc(100dvh - env(safe-area-inset-top) - 20px);
		z-index: 2147483647;
	}

	.notify-list {
		max-height: min(58dvh, 420px);
	}

	.notify-overlay {
		z-index: 2147483646;
	}

	.bottom-dock {
		display: none;
	}

	.chat {
		width: 100%;
		margin: 12px 0 0;
		padding: 0 8px calc(92px + env(safe-area-inset-bottom));
	}

	.board {
		padding: 12px;
		gap: 10px;
	}

	.board-title {
		font-size: 24px;
		letter-spacing: 1px;
		padding: 8px 10px;
	}

	.messages {
		max-height: 56vh;
		gap: 10px;
	}

	.messages.expanded {
		max-height: none !important;
		height: auto !important;
		overflow: visible !important;
		padding-right: 0;
	}

	.message-row {
		padding: 8px;
		gap: 8px;
	}

	.messages-toolbar {
		display: flex;
		justify-content: space-between;
		align-items: center;
		gap: 8px;
		padding: 7px 8px;
		border: 2px solid rgba(148, 117, 225, 0.85);
		background: transparent;
		border-radius: 12px;
	}

	.messages-toolbar .muted {
		font-size: 11px;
	}

	.messages-toolbar-actions {
		gap: 6px;
	}

	.messages-toolbar button {
		height: 28px;
		line-height: 24px;
		font-size: 11px;
	}

	.app-shell.mode-liquid .message-row,
	.app-shell.mode-liquid .reply-item,
	.app-shell.mode-liquid .messages-toolbar,
	.app-shell.mode-liquid .composer-form.sticky-bottom {
		overflow: visible;
		box-shadow: none;
		-webkit-backdrop-filter: none;
		backdrop-filter: none;
	}

	.app-shell.mode-liquid .board.messages-expanded .composer-form.sticky-bottom {
		border: 1px solid rgba(238, 231, 255, 0.28) !important;
		background: rgba(255, 255, 255, 0.06) !important;
		position: sticky;
		bottom: max(8px, env(safe-area-inset-bottom));
		left: auto;
		right: auto;
		width: auto;
		z-index: 25;
	}

	.app-shell.mode-liquid .board.messages-expanded .composer-form.sticky-bottom:hover {
		border-color: rgba(245, 236, 255, 0.6) !important;
		background: rgba(255, 255, 255, 0.1) !important;
	}

	.app-shell.mode-liquid .message-row::before,
	.app-shell.mode-liquid .message-row::after,
	.app-shell.mode-liquid .reply-item::before,
	.app-shell.mode-liquid .reply-item::after,
	.app-shell.mode-liquid .messages-toolbar::before,
	.app-shell.mode-liquid .messages-toolbar::after,
	.app-shell.mode-liquid .composer-form.sticky-bottom::before,
	.app-shell.mode-liquid .composer-form.sticky-bottom::after {
		display: none;
	}

	.app-shell.mode-liquid .message-row {
		border: 1px solid rgba(238, 231, 255, 0.28);
		background: transparent !important;
	}

	.picker-toolbar {
		display: flex;
		justify-content: space-between;
		align-items: center;
		gap: 8px;
		margin-bottom: 6px;
	}

	.picker-toolbar .picker-title {
		margin-bottom: 0;
	}

	.picker-toggle {
		height: 28px;
		line-height: 24px;
		padding: 0 10px;
		font-size: 12px;
	}

	.floor-tag {
		min-width: 40px;
		font-size: 20px;
	}

	.avatar {
		width: 34px;
		height: 34px;
	}

	.message-body {
		font-size: 17px;
		line-height: 1.45;
	}

	.message-meta {
		gap: 6px;
		margin-bottom: 4px;
		font-size: 13px;
	}

	.message-meta span {
		font-size: 12px;
	}

	.reply-item {
		padding: 6px;
		gap: 6px;
	}

	.reply-item .avatar {
		width: 24px;
		height: 24px;
		min-width: 24px;
	}

	.reply-body {
		font-size: 13px;
	}

	.reply-meta {
		gap: 6px;
		font-size: 11px;
		line-height: 1.3;
	}

	.reply-meta span {
		white-space: normal;
	}

	.reply-meta button {
		height: 22px;
		line-height: 18px;
		padding: 0 6px;
		font-size: 10px;
	}

	.board .inline-expand-btn,
	.board .reply-list-toggle-btn {
		height: 20px;
		line-height: 16px;
		padding: 0 7px;
		font-size: 10px;
	}

	.reply-form {
		flex-direction: column;
		align-items: stretch;
	}

	.reply-form button {
		width: 100%;
	}

	.profile-form,
	.background-form,
	.composer-form {
		flex-direction: column;
		align-items: stretch;
	}

	.board.messages-expanded .composer-form.sticky-bottom {
		left: 8px;
		right: 8px;
		transform: none;
		width: auto;
		max-width: none;
		bottom: calc(10px + env(safe-area-inset-bottom));
	}

	.background-form > button,
	.background-form > .background-file-control {
		width: 100%;
		max-width: 100%;
		min-width: 0;
		box-sizing: border-box;
	}

	.background-file-control {
		width: 100%;
	}

	.send-message {
		flex: 0 0 auto;
		width: 100%;
	}

	.glass-home-btn {
		min-width: 0;
		width: calc(100vw - 30px);
		max-width: 420px;
	}

	.back-to-top-btn {
		right: 10px;
		bottom: calc(12px + env(safe-area-inset-bottom));
		width: 34px;
		height: 34px;
		font-size: 16px;
		line-height: 30px;
	}

	/* AI Chat mobile */
	.ai-header {
		padding: 10px 12px;
		padding-top: calc(10px + env(safe-area-inset-top));
	}

	.ai-header-title {
		font-size: 14px;
	}

	.ai-header-btn {
		padding: 5px 10px;
		font-size: 12px;
	}

	.ai-messages {
		padding: 16px 14px;
	}

	.ai-msg-row {
		gap: 10px;
		padding: 14px 0;
	}

	.ai-welcome-title {
		font-size: 20px;
	}

	.ai-input-dock {
		padding: 8px 12px;
		padding-bottom: calc(12px + env(safe-area-inset-bottom));
	}

	.ai-input-glass {
		padding: 6px 6px 6px 14px;
		border-radius: 14px;
	}

	.ai-sidebar {
		width: 260px;
	}

	.ai-sidebar-item-del {
		opacity: 1;
	}
}

@media (max-width: 420px) {
	body {
		background-size: cover, cover;
		background-position: center center, center center;
	}
}

@media (max-aspect-ratio: 3/4) {
	body {
		background-position: center center, 60% center;
	}
}

@media (max-aspect-ratio: 9/16) {
	body {
		background-position: center center, 64% center;
	}
}

@media (min-aspect-ratio: 16/9) {
	body {
		background-position: center center, center 42%;
	}
}

@media (min-aspect-ratio: 21/9) {
	body {
		background-position: center center, center 34%;
	}
}

@media (orientation: landscape) and (max-height: 520px) {
	body {
		background-position: center center, center 38%;
	}
}

/* ===== Custom Confirm Dialog ===== */

.confirm-modal-layer {
	position: fixed;
	inset: 0;
	z-index: 2147483647;
	display: grid;
	place-items: center;
	padding: 24px;
}

.confirm-modal-overlay {
	position: absolute;
	inset: 0;
	background: rgba(10, 8, 20, 0.44);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
}

.confirm-modal-card {
	position: relative;
	overflow: hidden;
	isolation: isolate;
	background: rgba(255, 255, 255, 0.08);
	border-radius: 22px;
	box-shadow:
		0 18px 46px rgba(12, 10, 28, 0.44),
		0 0 22px rgba(255, 255, 255, 0.08);
	width: min(360px, calc(100vw - 32px));
	padding: 30px 26px 22px;
	color: #fff8ff;
}

.confirm-modal-card::before {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
	filter: var(--glass-filter, url(#glass-distortion));
	background: transparent;
	z-index: 0;
}

.confirm-modal-card::after {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	background: rgba(255, 255, 255, 0.02);
	box-shadow:
		inset 2px 2px 1px 0 rgba(255, 255, 255, 0.56),
		inset -1px -1px 1px 1px rgba(255, 255, 255, 0.44);
	z-index: 2;
}

.confirm-modal-card > * {
	position: relative;
	z-index: 3;
}

.confirm-modal-message {
	margin: 0 0 24px;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.65;
	text-align: center;
	color: #f0e6ff;
	text-shadow: 0 1px 3px rgba(30, 10, 60, 0.5);
}

.confirm-modal-actions {
	display: flex;
	gap: 12px;
	justify-content: center;
}

.confirm-modal-cancel {
	background: rgba(255, 255, 255, 0.06) !important;
	border: 2px solid rgba(210, 190, 255, 0.45) !important;
	color: #d4c0f5 !important;
	text-shadow: none !important;
	min-width: 90px;
}

.confirm-modal-cancel:hover {
	background: rgba(255, 255, 255, 0.12) !important;
	border-color: rgba(230, 215, 255, 0.75) !important;
	color: #ede0ff !important;
}

.confirm-modal-ok {
	min-width: 90px;
}
