@import url("https://fonts.googleapis.com/css2?family=Caveat:wght@600;700&family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&family=Sora:wght@400;500;600;700&display=swap");

:root {
	--accent: #b496dc;
	--accent-strong: #9a78cc;
	--accent-contrast: #140c1f;
	--accent-soft: rgba(180, 150, 220, 0.13);
	--accent-line: rgba(180, 150, 220, 0.34);

	--bg: #0a0a0a;
	--bg-deep: #050505;
	--surface: #131313;
	--surface-2: #1a1a1a;
	--surface-3: #202020;
	--border: rgba(255, 255, 255, 0.07);
	--border-strong: rgba(255, 255, 255, 0.13);
	--text: #ededed;
	--text-dim: rgba(237, 237, 237, 0.62);
	--text-faint: rgba(237, 237, 237, 0.38);
	--danger: #f87171;

	--star: 226, 216, 245;
	--constellation: 160, 140, 195;

	--font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	--font-script: "Caveat", "Segoe Script", cursive;
	--font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
	--font-ai: "Sora", var(--font-body);

	--radius: 14px;
	--radius-sm: 10px;
	--radius-xs: 7px;
	--ease: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
	--shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
	--shadow-lg: 0 18px 50px rgba(0, 0, 0, 0.55);
}

:root[data-theme="verdant"] {
	--accent: #6ee7a7;
	--accent-strong: #34d399;
	--accent-contrast: #04140c;
	--accent-soft: rgba(110, 231, 167, 0.12);
	--accent-line: rgba(110, 231, 167, 0.32);
	--star: 216, 245, 230;
	--constellation: 130, 190, 160;
}

:root[data-theme="midnight"] {
	--accent: #5b9dff;
	--accent-strong: #3b82f6;
	--accent-contrast: #04101f;
	--accent-soft: rgba(91, 157, 255, 0.13);
	--accent-line: rgba(91, 157, 255, 0.34);
	--star: 214, 228, 255;
	--constellation: 120, 150, 200;
}

:root[data-theme="dusk"] {
	--accent: #a78bfa;
	--accent-strong: #8b5cf6;
	--accent-contrast: #12081f;
	--accent-soft: rgba(167, 139, 250, 0.13);
	--accent-line: rgba(167, 139, 250, 0.34);
	--star: 228, 218, 255;
	--constellation: 150, 130, 200;
}

:root[data-theme="ember"] {
	--accent: #fb923c;
	--accent-strong: #f97316;
	--accent-contrast: #1c0c02;
	--accent-soft: rgba(251, 146, 60, 0.13);
	--accent-line: rgba(251, 146, 60, 0.34);
	--star: 255, 226, 200;
	--constellation: 200, 150, 110;
}

:root[data-theme="rose"] {
	--accent: #fb7185;
	--accent-strong: #f43f5e;
	--accent-contrast: #1c060b;
	--accent-soft: rgba(251, 113, 133, 0.13);
	--accent-line: rgba(251, 113, 133, 0.34);
	--star: 255, 214, 224;
	--constellation: 200, 130, 150;
}

:root[data-theme="nord"] {
	--accent: #7fd1de;
	--accent-strong: #56b6c2;
	--accent-contrast: #041416;
	--accent-soft: rgba(127, 209, 222, 0.13);
	--accent-line: rgba(127, 209, 222, 0.34);
	--star: 214, 240, 245;
	--constellation: 120, 170, 180;
}

:root[data-theme="sand"] {
	--accent: #e2c08d;
	--accent-strong: #cfa76a;
	--accent-contrast: #1a1207;
	--accent-soft: rgba(226, 192, 141, 0.13);
	--accent-line: rgba(226, 192, 141, 0.34);
	--star: 245, 235, 215;
	--constellation: 190, 170, 140;
}

:root[data-theme="sakura"] {
	--accent: #f7a8c4;
	--accent-strong: #ec6f9e;
	--accent-contrast: #1d0a13;
	--accent-soft: rgba(247, 168, 196, 0.13);
	--accent-line: rgba(247, 168, 196, 0.34);
	--star: 255, 224, 235;
	--constellation: 210, 150, 175;
}

:root[data-mode="light"] {
	--bg: #f7f7f5;
	--bg-deep: #ffffff;
	--surface: #ffffff;
	--surface-2: #f1f1ee;
	--surface-3: #e7e7e3;
	--border: rgba(0, 0, 0, 0.09);
	--border-strong: rgba(0, 0, 0, 0.16);
	--text: #16161a;
	--text-dim: rgba(22, 22, 26, 0.64);
	--text-faint: rgba(22, 22, 26, 0.42);
	--star: 90, 90, 110;
	--constellation: 130, 130, 150;
	--shadow: 0 2px 10px rgba(0, 0, 0, 0.07);
	--shadow-lg: 0 18px 50px rgba(0, 0, 0, 0.13);
}

:root[data-mode="light"] .accent-on-dark {
	color: var(--accent-strong);
}

* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

html,
body {
	height: 100%;
}

body {
	font-family: var(--font-body);
	background: var(--bg);
	color: var(--text);
	min-height: 100vh;
	overflow: hidden;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

/* Slow accent haze behind the starfield — Akura's own layer, not part of the
   reference look. Themed automatically because it reuses the accent token. */
body::before {
	content: "";
	position: fixed;
	inset: -25%;
	z-index: 0;
	background:
		radial-gradient(36% 28% at 22% 26%, var(--accent-soft), transparent 70%),
		radial-gradient(30% 24% at 78% 72%, var(--accent-soft), transparent 72%);
	opacity: 0.75;
	pointer-events: none;
	animation: haze 52s ease-in-out infinite alternate;
}

@keyframes haze {
	from {
		transform: translate3d(-2%, -1%, 0) scale(1);
	}
	to {
		transform: translate3d(2%, 2%, 0) scale(1.12);
	}
}

#bg-canvas {
	position: fixed;
	inset: 0;
	width: 100vw;
	height: 100vh;
	z-index: 0;
	pointer-events: none;
}

body.no-stars #bg-canvas,
body.no-stars::before {
	display: none;
}

.view {
	position: relative;
	z-index: 1;
	min-height: 100vh;
}

.hidden {
	display: none !important;
}

::selection {
	background: var(--accent-soft);
	color: var(--text);
}

.script-title {
	position: relative;
	font-family: var(--font-script);
	font-weight: 700;
	font-size: clamp(2.6rem, 6vw, 3.6rem);
	line-height: 1;
	letter-spacing: 0.01em;
	color: var(--text);
}

.page-title {
	position: relative;
	display: inline-block;
	font-family: var(--font-script);
	font-weight: 700;
	font-size: 2.6rem;
	line-height: 1.05;
	color: var(--text);
}

/* Hand-drawn accent swash under the wordmarks. */
.script-title::after,
.page-title::after {
	content: "";
	position: absolute;
	right: 6%;
	bottom: 1px;
	left: 6%;
	height: 2px;
	background: linear-gradient(90deg, transparent, var(--accent), transparent);
	border-radius: 2px;
	opacity: 0.5;
	transform: rotate(-0.8deg);
}

.scroll-thin::-webkit-scrollbar {
	width: 8px;
	height: 8px;
}

.scroll-thin::-webkit-scrollbar-track {
	background: transparent;
}

.scroll-thin::-webkit-scrollbar-thumb {
	background: var(--border-strong);
	border-radius: 99px;
}

.scroll-thin::-webkit-scrollbar-thumb:hover {
	background: var(--text-faint);
}

/* ---------- loading ---------- */

.loading-overlay {
	position: fixed;
	inset: 0;
	z-index: 100;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--bg);
}

.loading-overlay.overlay-scoped {
	position: absolute;
}

#loading-canvas {
	position: absolute;
	inset: 0;
	pointer-events: none;
}

.loading-content {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 18px;
}

.loading-dots {
	display: flex;
	gap: 7px;
}

.loading-dots span {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--accent);
	animation: pulse 1.2s ease-in-out infinite;
}

.loading-dots span:nth-child(2) {
	animation-delay: 0.16s;
}

.loading-dots span:nth-child(3) {
	animation-delay: 0.32s;
}

@keyframes pulse {
	0%,
	80%,
	100% {
		opacity: 0.25;
		transform: scale(0.8);
	}
	40% {
		opacity: 1;
		transform: scale(1);
	}
}

.loading-text {
	font-size: 0.85rem;
	color: var(--text-dim);
	letter-spacing: 0.01em;
}

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

#login-view {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
}

.login-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 22px;
	width: 100%;
	max-width: 330px;
	text-align: center;
}

#login-form {
	display: flex;
	flex-direction: column;
	gap: 10px;
	width: 100%;
}

.field {
	width: 100%;
	padding: 12px 14px;
	font-family: inherit;
	font-size: 0.92rem;
	color: var(--text);
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	outline: none;
	transition: border-color var(--ease), box-shadow var(--ease);
}

.field::placeholder {
	color: var(--text-faint);
}

.field:focus {
	border-color: var(--accent-line);
	box-shadow: 0 0 0 3px var(--accent-soft);
}

.btn-primary {
	padding: 12px 18px;
	font-family: inherit;
	font-size: 0.9rem;
	font-weight: 600;
	color: var(--accent-contrast);
	background: var(--accent);
	border: none;
	border-radius: var(--radius-sm);
	cursor: pointer;
	transition: filter var(--ease), transform var(--ease);
}

.btn-primary:hover {
	filter: brightness(1.08);
}

.btn-primary:active {
	transform: scale(0.985);
}

.btn-ghost {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 8px 13px;
	font-family: inherit;
	font-size: 0.83rem;
	font-weight: 500;
	color: var(--text-dim);
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius-xs);
	cursor: pointer;
	transition: all var(--ease);
}

.btn-ghost:hover {
	color: var(--text);
	background: var(--surface-2);
	border-color: var(--border-strong);
}

.error-text {
	min-height: 18px;
	font-size: 0.82rem;
	color: var(--danger);
}

/* ---------- home ---------- */

#home-view {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 40px 24px 90px;
	overflow-y: auto;
}

.home-inner {
	display: flex;
	flex-direction: column;
	align-items: center;
	width: 100%;
	max-width: 390px;
	animation: rise 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes rise {
	from {
		opacity: 0;
		transform: translateY(12px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

.home-wordmark {
	margin-bottom: 26px;
}

@property --ring-angle {
	syntax: "<angle>";
	initial-value: 0deg;
	inherits: false;
}

.search-form {
	position: relative;
	width: 100%;
}

.search-input {
	width: 100%;
	padding: 14px 20px;
	font-family: inherit;
	font-size: 0.92rem;
	color: var(--text);
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 99px;
	outline: none;
	transition: border-color var(--ease), box-shadow var(--ease), background var(--ease);
}

.search-input::placeholder {
	color: var(--text-faint);
}

.search-input:focus {
	background: var(--surface-2);
}

/* A light travels around the rim of the field at all times, and brightens into a
   glow on focus. The ring is a conic gradient masked down to its own 1.5px border. */
.search-form::before,
.search-wrap::before {
	content: "";
	position: absolute;
	inset: -2px;
	padding: 1.5px;
	/* A bright head with a short tail behind it, so one light reads as moving
	   around the rim rather than the rim itself being lit. */
	background: conic-gradient(
		from var(--ring-angle),
		var(--accent-strong) 0deg,
		var(--accent) 12deg,
		var(--accent-line) 38deg,
		transparent 70deg,
		transparent 360deg
	);
	border-radius: 99px;
	opacity: 0.45;
	transition: opacity 0.3s ease, filter 0.3s ease;
	pointer-events: none;
	animation: ringSpin 3.4s linear infinite;
	-webkit-mask:
		linear-gradient(#fff 0 0) content-box,
		linear-gradient(#fff 0 0);
	mask:
		linear-gradient(#fff 0 0) content-box,
		linear-gradient(#fff 0 0);
	-webkit-mask-composite: xor;
	mask-composite: exclude;
}

/* Focus does not start the light, it lights it up. drop-shadow follows the alpha
   of the gradient, so only the travelling segment glows — never the whole rim. */
.search-form:focus-within::before,
.search-wrap:focus-within::before {
	opacity: 1;
	filter: drop-shadow(0 0 5px var(--accent)) drop-shadow(0 0 14px var(--accent));
}

/* Performance mode keeps the rim but stops it travelling. */
body.no-stars .search-form::before,
body.no-stars .search-wrap::before {
	animation: none;
}

@keyframes ringSpin {
	to {
		--ring-angle: 360deg;
	}
}

/* No @property support: hold a steady accent rim rather than a frozen gradient. */
@supports not (background: conic-gradient(from var(--ring-angle), red, blue)) {
	.search-form::before,
	.search-wrap::before {
		background: var(--accent);
		animation: none;
	}
}

.search-hint {
	margin-top: 10px;
	font-size: 0.74rem;
	color: var(--text-faint);
	text-align: center;
}

.search-hint kbd {
	font-family: var(--font-mono);
	font-size: 0.7rem;
	padding: 1px 5px;
	color: var(--text-dim);
	background: var(--surface-2);
	border: 1px solid var(--border);
	border-radius: 4px;
}

.quick-apps {
	width: 100%;
	margin-top: 34px;
}

.quick-apps-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 12px;
}

/* Section headings carry a short accent tick instead of sitting bare. */
.quick-apps-head h2 {
	display: flex;
	gap: 9px;
	align-items: center;
	font-size: 0.88rem;
	font-weight: 600;
	color: var(--text);
}

.quick-apps-head h2::before {
	content: "";
	width: 3px;
	height: 13px;
	background: var(--accent);
	border-radius: 2px;
}

.quick-apps-edit {
	padding: 4px 11px;
	font-family: inherit;
	font-size: 0.75rem;
	color: var(--text-dim);
	background: var(--surface-2);
	border: 1px solid var(--border);
	border-radius: var(--radius-xs);
	cursor: pointer;
	transition: all var(--ease);
}

.quick-apps-edit:hover {
	color: var(--text);
	border-color: var(--border-strong);
}

.quick-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 10px;
}

.quick-tile {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 9px;
	padding: 15px 6px 12px;
	background: var(--surface);
	border: 1px solid transparent;
	border-radius: var(--radius-sm);
	cursor: pointer;
	transition: background var(--ease), border-color var(--ease), transform var(--ease);
}

.quick-tile:hover {
	background: var(--surface-2);
	border-color: var(--border-strong);
	transform: translateY(-2px);
}

.quick-tile:focus-visible {
	outline: none;
	border-color: var(--accent-line);
	box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Icon sits on its own rounded plate that lights up with the accent on hover. */
.quick-tile-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	color: var(--text);
	background: var(--surface-2);
	border-radius: 11px;
	box-shadow: inset 0 1px 0 var(--border-strong);
	transition: background var(--ease), color var(--ease);
}

.quick-tile:hover .quick-tile-icon {
	color: var(--accent);
	background: var(--accent-soft);
}

.quick-tile-icon svg {
	width: 19px;
	height: 19px;
}

.quick-tile-icon img,
.quick-tile-icon .site-fallback {
	width: 20px;
	height: 20px;
	font-size: 0.7rem;
	background: none;
	border-radius: 5px;
	object-fit: cover;
}

.quick-tile-label {
	max-width: 100%;
	overflow: hidden;
	font-size: 0.72rem;
	color: var(--text-dim);
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* The first nine tiles are reachable by pressing their number. */
.quick-tile-key {
	position: absolute;
	top: 6px;
	left: 8px;
	font-family: var(--font-mono);
	font-size: 0.6rem;
	color: var(--text-faint);
	opacity: 0;
	transition: opacity var(--ease), color var(--ease);
	pointer-events: none;
}

.quick-grid.hint .quick-tile-key,
.quick-tile:hover .quick-tile-key {
	opacity: 1;
}

.quick-tile:hover .quick-tile-key {
	color: var(--accent);
}

.quick-tile-remove {
	position: absolute;
	top: -6px;
	right: -6px;
	display: none;
	align-items: center;
	justify-content: center;
	width: 19px;
	height: 19px;
	color: var(--text);
	background: var(--surface-3);
	border: 1px solid var(--border-strong);
	border-radius: 50%;
	cursor: pointer;
}

.quick-grid.editing .quick-tile-remove {
	display: flex;
}

.quick-grid.editing .quick-tile {
	animation: jiggle 0.4s ease-in-out infinite alternate;
}

@keyframes jiggle {
	from {
		transform: rotate(-0.6deg);
	}
	to {
		transform: rotate(0.6deg);
	}
}

/* ---------- footer ---------- */

.site-footer {
	position: fixed;
	right: 22px;
	bottom: 16px;
	z-index: 5;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 9px;
	font-size: 0.76rem;
}

.site-footer button,
.site-footer a {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-family: inherit;
	font-size: 0.76rem;
	color: var(--text-faint);
	background: none;
	border: none;
	text-decoration: none;
	cursor: pointer;
	transition: color var(--ease);
}

.site-footer button:hover,
.site-footer a:hover {
	color: var(--text);
}

.site-footer .dot {
	color: var(--text-faint);
	opacity: 0.5;
}

.conn-status {
	display: inline-flex;
	gap: 6px;
	align-items: center;
	font-size: 0.76rem;
	color: var(--text-faint);
}

.conn-status i {
	width: 6px;
	height: 6px;
	background: var(--text-faint);
	border-radius: 50%;
	transition: background var(--ease), box-shadow var(--ease);
}

.conn-status.live i {
	background: var(--accent);
	box-shadow: 0 0 0 3px var(--accent-soft);
}

.conn-status.live {
	color: var(--text-dim);
}

.site-footer svg {
	width: 13px;
	height: 13px;
}

/* ---------- generic page shell ---------- */

.page {
	max-width: 1180px;
	height: 100vh;
	padding: 46px 34px 80px;
	margin: 0 auto;
	overflow-y: auto;
}

.back-link {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	margin-bottom: 12px;
	font-family: inherit;
	font-size: 0.82rem;
	color: var(--accent);
	background: none;
	border: none;
	cursor: pointer;
	transition: opacity var(--ease);
}

.back-link:hover {
	opacity: 0.75;
}

.page-sub {
	margin-top: 8px;
	font-size: 0.86rem;
	color: var(--text-dim);
}

/* ---------- sites / games grids ---------- */

.toolbar {
	display: flex;
	gap: 10px;
	align-items: center;
	margin: 26px 0 22px;
}

.toolbar .search-input {
	flex: 1;
}

.search-wrap {
	position: relative;
	flex: 1;
}

.search-wrap svg {
	position: absolute;
	top: 50%;
	left: 17px;
	z-index: 1;
	width: 15px;
	height: 15px;
	color: var(--text-faint);
	transform: translateY(-50%);
	pointer-events: none;
}

.search-wrap .search-input {
	padding-left: 43px;
}

.chip-toggle {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 12px 16px;
	font-family: inherit;
	font-size: 0.84rem;
	color: var(--text-dim);
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	cursor: pointer;
	transition: all var(--ease);
}

.chip-toggle:hover {
	color: var(--text);
	border-color: var(--border-strong);
}

.chip-toggle.active {
	color: var(--accent);
	background: var(--accent-soft);
	border-color: var(--accent-line);
}

.chip-toggle svg {
	width: 15px;
	height: 15px;
}

.games-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
	gap: 14px;
	padding-bottom: 40px;
}

.game-tile {
	position: relative;
	display: block;
	aspect-ratio: 1;
	overflow: hidden;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	cursor: pointer;
	transition: transform var(--ease), border-color var(--ease);
}

.game-tile:hover {
	border-color: var(--accent-line);
	transform: translateY(-3px);
}

.game-tile:focus-visible {
	outline: none;
	border-color: var(--accent);
	box-shadow: 0 0 0 3px var(--accent-soft);
}

.game-tile img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.game-fallback {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 6px;
	width: 100%;
	height: 100%;
	padding: 8px;
	background: linear-gradient(150deg, var(--surface-2), var(--surface));
}

.game-fallback span {
	font-family: var(--font-script);
	font-size: 2rem;
	color: var(--accent);
}

.game-fallback small {
	font-size: 0.68rem;
	color: var(--text-faint);
	text-align: center;
	line-height: 1.25;
}

.game-title {
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	padding: 16px 8px 7px;
	font-size: 0.72rem;
	color: #fff;
	background: linear-gradient(transparent, rgba(0, 0, 0, 0.86));
	opacity: 0;
	transition: opacity var(--ease);
}

.game-tile:hover .game-title {
	opacity: 1;
}

.game-fav {
	position: absolute;
	top: 6px;
	right: 6px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	color: #fff;
	background: rgba(0, 0, 0, 0.5);
	border: none;
	border-radius: 50%;
	opacity: 0;
	cursor: pointer;
	transition: opacity var(--ease), color var(--ease);
}

.game-tile:hover .game-fav,
.game-fav.on {
	opacity: 1;
}

.game-fav.on {
	color: var(--accent);
}

.game-fav svg {
	width: 14px;
	height: 14px;
}

.empty-state {
	padding: 60px 20px;
	font-size: 0.88rem;
	color: var(--text-faint);
	text-align: center;
}

.site-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
	gap: 12px;
	padding-bottom: 40px;
}

.site-card {
	display: flex;
	gap: 13px;
	align-items: center;
	padding: 14px;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	cursor: pointer;
	transition: all var(--ease);
}

.site-card:hover {
	background: var(--surface-2);
	border-color: var(--accent-line);
	transform: translateY(-2px);
}

.site-card:focus-visible {
	outline: none;
	border-color: var(--accent);
	box-shadow: 0 0 0 3px var(--accent-soft);
}

.site-icon,
.site-fallback {
	flex-shrink: 0;
	width: 34px;
	height: 34px;
	border-radius: 8px;
}

.site-fallback {
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 0.95rem;
	font-weight: 600;
	color: var(--accent);
	background: var(--surface-3);
}

.site-info {
	min-width: 0;
}

.site-name {
	overflow: hidden;
	font-size: 0.88rem;
	font-weight: 500;
	color: var(--text);
	text-overflow: ellipsis;
	white-space: nowrap;
}

.site-desc {
	overflow: hidden;
	font-size: 0.76rem;
	color: var(--text-faint);
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* ---------- command palette ---------- */

.palette-overlay {
	position: fixed;
	inset: 0;
	z-index: 200;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding-top: 14vh;
	background: rgba(0, 0, 0, 0.62);
	backdrop-filter: blur(6px);
	animation: fade 0.14s ease;
}

@keyframes fade {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

.palette {
	width: 100%;
	max-width: 560px;
	overflow: hidden;
	background: var(--surface);
	border: 1px solid var(--border-strong);
	border-radius: var(--radius);
	box-shadow: var(--shadow-lg);
}

.palette input {
	width: 100%;
	padding: 16px 18px;
	font-family: inherit;
	font-size: 0.95rem;
	color: var(--text);
	background: none;
	border: none;
	border-bottom: 1px solid var(--border);
	outline: none;
}

.palette input::placeholder {
	color: var(--text-faint);
}

.palette-results {
	max-height: 330px;
	overflow-y: auto;
}

.palette-item {
	display: flex;
	gap: 11px;
	align-items: center;
	padding: 11px 18px;
	font-size: 0.86rem;
	color: var(--text-dim);
	cursor: pointer;
}

.palette-item .pi-kind {
	margin-left: auto;
	font-size: 0.7rem;
	color: var(--text-faint);
}

.palette-item.active,
.palette-item:hover {
	color: var(--text);
	background: var(--surface-2);
}

.palette-item.active {
	box-shadow: inset 2px 0 0 var(--accent);
}

.palette-empty {
	padding: 26px;
	font-size: 0.85rem;
	color: var(--text-faint);
	text-align: center;
}

/* ---------- settings ---------- */

.settings-quick {
	display: flex;
	gap: 10px;
	margin: 20px 0 26px;
}

.settings-layout {
	display: grid;
	grid-template-columns: 210px 1fr;
	gap: 26px;
	align-items: start;
}

.settings-rail {
	display: flex;
	flex-direction: column;
	gap: 3px;
	position: sticky;
	top: 0;
}

.rail-item {
	display: flex;
	gap: 11px;
	align-items: center;
	padding: 11px 14px;
	font-family: inherit;
	font-size: 0.87rem;
	color: var(--text-dim);
	text-align: left;
	background: none;
	border: none;
	border-radius: var(--radius-sm);
	cursor: pointer;
	transition: all var(--ease);
}

.rail-item svg {
	width: 16px;
	height: 16px;
}

.rail-item:hover {
	color: var(--text);
	background: var(--surface);
}

.rail-item.active {
	color: var(--accent);
	background: var(--accent-soft);
}

.settings-panels {
	display: flex;
	flex-direction: column;
	gap: 18px;
	padding-bottom: 60px;
}

/* No overflow clipping here — dropdowns opened inside a panel have to escape it. */
.panel {
	position: relative;
	padding: 24px;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
}

/* Light catching the top edge of every panel. Inset past the corner radius so it
   stays inside the rounded edge without needing overflow: hidden. */
.panel::before {
	content: "";
	position: absolute;
	top: 0;
	right: var(--radius);
	left: var(--radius);
	height: 1px;
	background: linear-gradient(90deg, transparent, var(--border-strong), transparent);
}

.panel h3 {
	display: flex;
	gap: 8px;
	align-items: center;
	font-size: 1.02rem;
	font-weight: 600;
	color: var(--text);
}

.panel h3 svg {
	width: 17px;
	height: 17px;
	color: var(--accent);
}

.panel-desc {
	margin: 6px 0 18px;
	font-size: 0.83rem;
	color: var(--text-dim);
}

.settings-section {
	display: none;
	flex-direction: column;
	gap: 18px;
}

.settings-section.active {
	display: flex;
	animation: fade 0.16s ease;
}

.mode-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 12px;
}

.mode-card {
	display: flex;
	flex-direction: column;
	gap: 9px;
	align-items: center;
	padding: 18px 12px;
	font-family: inherit;
	font-size: 0.85rem;
	color: var(--text-dim);
	background: var(--bg);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	cursor: pointer;
	transition: all var(--ease);
}

.mode-card svg {
	width: 19px;
	height: 19px;
}

.mode-card:hover {
	color: var(--text);
	border-color: var(--border-strong);
}

.mode-card.active {
	color: var(--accent);
	background: var(--accent-soft);
	border-color: var(--accent-line);
}

.theme-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 12px;
}

.theme-card {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 9px;
	padding: 15px;
	font-family: inherit;
	text-align: left;
	background: var(--bg);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	cursor: pointer;
	transition: all var(--ease);
}

.theme-card:hover {
	border-color: var(--border-strong);
}

.theme-card.active {
	background: var(--accent-soft);
	border-color: var(--accent-line);
}

.theme-dots {
	display: flex;
}

.theme-dots i {
	width: 15px;
	height: 15px;
	border: 2px solid var(--surface);
	border-radius: 50%;
}

.theme-dots i + i {
	margin-left: -5px;
}

.theme-card-name {
	font-size: 0.87rem;
	font-weight: 600;
	color: var(--text);
}

.theme-card-desc {
	font-size: 0.76rem;
	color: var(--text-dim);
}

.theme-check {
	position: absolute;
	top: 13px;
	right: 13px;
	display: none;
	color: var(--accent);
}

.theme-card.active .theme-check {
	display: block;
}

.theme-check svg {
	width: 15px;
	height: 15px;
}

.setting-row {
	display: flex;
	gap: 18px;
	align-items: center;
	justify-content: space-between;
	padding: 14px 0;
	border-bottom: 1px solid var(--border);
}

.setting-row:last-child {
	padding-bottom: 0;
	border-bottom: none;
}

.setting-row:first-of-type {
	padding-top: 0;
}

.setting-copy {
	min-width: 0;
}

.setting-name {
	font-size: 0.88rem;
	font-weight: 500;
	color: var(--text);
}

.setting-hint {
	margin-top: 3px;
	font-size: 0.78rem;
	color: var(--text-faint);
	line-height: 1.45;
}

.setting-control {
	display: flex;
	flex-shrink: 0;
	gap: 8px;
	align-items: center;
}

.setting-control .field {
	width: 260px;
}

.toggle {
	position: relative;
	flex-shrink: 0;
	width: 40px;
	height: 23px;
	cursor: pointer;
}

.toggle input {
	position: absolute;
	width: 100%;
	height: 100%;
	margin: 0;
	opacity: 0;
	cursor: pointer;
	z-index: 2;
}

.toggle-track {
	position: absolute;
	inset: 0;
	background: var(--surface-3);
	border-radius: 99px;
	transition: background var(--ease);
	pointer-events: none;
}

.toggle-track::before {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 17px;
	height: 17px;
	background: var(--text-faint);
	border-radius: 50%;
	transition: transform var(--ease), background var(--ease);
}

.toggle input:checked + .toggle-track {
	background: var(--accent-soft);
}

.toggle input:checked + .toggle-track::before {
	background: var(--accent);
	transform: translateX(17px);
}

.toggle input:focus-visible + .toggle-track {
	box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ---------- dropdown ---------- */

.dropdown {
	position: relative;
	min-width: 190px;
}

.dropdown-trigger {
	display: flex;
	gap: 10px;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	padding: 11px 13px;
	font-family: inherit;
	font-size: 0.84rem;
	color: var(--text);
	text-align: left;
	background: var(--surface-2);
	border: 1px solid var(--border);
	border-radius: var(--radius-xs);
	cursor: pointer;
	outline: none;
	transition: border-color var(--ease), background var(--ease);
}

.dropdown-trigger:hover {
	border-color: var(--border-strong);
}

.dropdown-trigger:focus-visible,
.dropdown.open .dropdown-trigger {
	border-color: var(--accent-line);
	box-shadow: 0 0 0 3px var(--accent-soft);
}

.dropdown-value {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.dropdown-chevron {
	display: flex;
	flex-shrink: 0;
	color: var(--text-faint);
	transition: transform var(--ease), color var(--ease);
}

.dropdown-chevron svg {
	width: 14px;
	height: 14px;
}

.dropdown.open .dropdown-chevron {
	color: var(--accent);
	transform: rotate(180deg);
}

/* Anchored to the trigger's right edge and sized to its content, so long option
   names widen the menu leftwards instead of being cut off. */
.dropdown-menu {
	position: absolute;
	top: calc(100% + 6px);
	right: 0;
	left: auto;
	z-index: 60;
	width: max-content;
	min-width: 100%;
	max-width: min(440px, 92vw);
	max-height: 290px;
	padding: 5px;
	overflow-x: hidden;
	overflow-y: auto;
	background: var(--surface);
	border: 1px solid var(--border-strong);
	border-radius: var(--radius-sm);
	box-shadow: var(--shadow-lg);
	animation: dropIn 0.13s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Flipped above the trigger when there is no room below. */
.dropdown.up .dropdown-menu {
	top: auto;
	bottom: calc(100% + 6px);
	animation-name: dropUp;
}

@keyframes dropIn {
	from {
		opacity: 0;
		transform: translateY(-5px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

@keyframes dropUp {
	from {
		opacity: 0;
		transform: translateY(5px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

.dropdown-option {
	display: flex;
	gap: 10px;
	align-items: center;
	padding: 9px 11px;
	font-size: 0.83rem;
	color: var(--text-dim);
	border-radius: var(--radius-xs);
	cursor: pointer;
}

.dropdown-option.active {
	color: var(--text);
	background: var(--surface-2);
}

.dropdown-option.selected {
	color: var(--accent);
}

.dropdown-option-text {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

/* Model names are never clipped — the menu grows to fit them instead. */
.dropdown-option-label {
	white-space: nowrap;
}

.dropdown-option-note {
	font-size: 0.72rem;
	color: var(--text-faint);
	line-height: 1.35;
}

.dropdown-tick {
	display: flex;
	flex-shrink: 0;
	margin-left: auto;
	opacity: 0;
}

.dropdown-option.selected .dropdown-tick {
	opacity: 1;
}

.dropdown-tick svg {
	width: 14px;
	height: 14px;
}

.danger-btn {
	padding: 9px 14px;
	font-family: inherit;
	font-size: 0.83rem;
	color: var(--danger);
	background: rgba(248, 113, 113, 0.1);
	border: 1px solid rgba(248, 113, 113, 0.3);
	border-radius: var(--radius-xs);
	cursor: pointer;
	transition: all var(--ease);
}

.danger-btn:hover {
	background: rgba(248, 113, 113, 0.18);
}

.danger-btn-solid {
	font-weight: 600;
	color: #fff;
	background: var(--danger);
	border-color: var(--danger);
}

.danger-btn-solid:hover {
	background: #ef4444;
}

.danger-btn-solid:disabled {
	opacity: 0.6;
	cursor: default;
}

.panel-danger {
	border-color: rgba(248, 113, 113, 0.3);
}

.panel-danger h3 svg {
	color: var(--danger);
}

.panel-danger::before {
	background: linear-gradient(90deg, transparent, rgba(248, 113, 113, 0.5), transparent);
}

.history-list {
	display: flex;
	flex-direction: column;
	gap: 2px;
	max-height: 320px;
	overflow-y: auto;
}

.history-row {
	display: flex;
	gap: 10px;
	align-items: center;
	padding: 9px 10px;
	border-radius: var(--radius-xs);
	cursor: pointer;
	transition: background var(--ease);
}

.history-row:hover {
	background: var(--surface-2);
}

.history-row img {
	width: 16px;
	height: 16px;
	border-radius: 4px;
}

.history-row .hr-title {
	overflow: hidden;
	font-size: 0.85rem;
	color: var(--text);
	text-overflow: ellipsis;
	white-space: nowrap;
}

.history-row .hr-url {
	overflow: hidden;
	margin-left: auto;
	font-size: 0.75rem;
	color: var(--text-faint);
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* ---------- proxy view ---------- */

#proxy-view,
#browser-view {
	display: flex;
	flex-direction: column;
	height: 100vh;
	background: var(--bg);
}

.proxy-nav {
	display: flex;
	flex-shrink: 0;
	gap: 12px;
	align-items: center;
	padding: 9px 14px;
	background: var(--surface);
	border-bottom: 1px solid var(--border);
	transition: margin-top var(--ease);
}

.proxy-nav.hidden-bar {
	margin-top: -52px;
}

.proxy-title {
	overflow: hidden;
	font-size: 0.87rem;
	font-weight: 500;
	color: var(--text);
	text-overflow: ellipsis;
	white-space: nowrap;
}

.proxy-nav-right {
	display: flex;
	gap: 7px;
	align-items: center;
	margin-left: auto;
}

.icon-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	color: var(--text-dim);
	background: none;
	border: 1px solid transparent;
	border-radius: var(--radius-xs);
	cursor: pointer;
	transition: all var(--ease);
}

.icon-btn:hover {
	color: var(--text);
	background: var(--surface-2);
}

.icon-btn:disabled {
	opacity: 0.3;
	cursor: default;
}

.icon-btn svg {
	width: 17px;
	height: 17px;
}

#proxy-container,
#browser-content {
	position: relative;
	flex: 1;
	overflow: hidden;
}

#proxy-container iframe,
#browser-content iframe {
	width: 100%;
	height: 100%;
	border: none;
	transition: opacity 0.25s ease;
}

#browser-content iframe.hidden-tab {
	display: none;
}

.proxy-show-bar {
	position: absolute;
	top: 0;
	left: 50%;
	z-index: 20;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 20px;
	color: var(--text-dim);
	background: var(--surface);
	border: 1px solid var(--border);
	border-top: none;
	border-radius: 0 0 8px 8px;
	cursor: pointer;
	transform: translateX(-50%);
	transition: color var(--ease);
}

.proxy-show-bar:hover {
	color: var(--accent);
}

.proxy-error {
	position: absolute;
	inset: 0;
	z-index: 15;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background: var(--bg);
}

.error-card {
	display: flex;
	flex-direction: column;
	gap: 14px;
	align-items: center;
	max-width: 420px;
	padding: 38px 30px;
	text-align: center;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
}

.error-icon {
	color: var(--accent);
}

.error-title {
	font-size: 1.28rem;
	font-weight: 600;
}

.error-msg {
	font-size: 0.88rem;
	color: var(--text-dim);
}

.error-warning {
	padding: 10px 15px;
	font-size: 0.8rem;
	color: var(--accent);
	background: var(--accent-soft);
	border: 1px solid var(--accent-line);
	border-radius: var(--radius-sm);
	line-height: 1.5;
}

/* ---------- browser chrome ---------- */

.browser-chrome {
	flex-shrink: 0;
	background: var(--surface);
	border-bottom: 1px solid var(--border);
	transition: margin-top var(--ease);
}

.browser-chrome.hidden-bar {
	margin-top: -88px;
}

.browser-tabs {
	display: flex;
	gap: 5px;
	align-items: center;
	padding: 7px 10px 0;
}

.browser-tab-list {
	display: flex;
	flex: 1;
	gap: 4px;
	overflow-x: auto;
}

.browser-tab-list::-webkit-scrollbar {
	display: none;
}

.browser-tab {
	display: flex;
	flex-shrink: 0;
	gap: 7px;
	align-items: center;
	max-width: 190px;
	padding: 7px 10px;
	background: var(--surface-2);
	border: 1px solid transparent;
	border-radius: 8px 8px 0 0;
	cursor: pointer;
	transition: all var(--ease);
}

.browser-tab:hover {
	background: var(--surface-3);
}

.browser-tab.active {
	background: var(--bg);
	border-color: var(--border);
	border-bottom-color: transparent;
}

.browser-tab-icon,
.browser-tab-fallback {
	flex-shrink: 0;
	width: 15px;
	height: 15px;
	border-radius: 3px;
}

.browser-tab-fallback {
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 0.62rem;
	font-weight: 600;
	color: var(--accent);
	background: var(--surface-3);
}

.browser-tab-label {
	overflow: hidden;
	font-size: 0.78rem;
	color: var(--text-dim);
	text-overflow: ellipsis;
	white-space: nowrap;
}

.browser-tab.active .browser-tab-label {
	color: var(--text);
}

.browser-tab-close {
	display: flex;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
	width: 17px;
	height: 17px;
	color: var(--text-faint);
	background: none;
	border: none;
	border-radius: 4px;
	cursor: pointer;
}

.browser-tab-close:hover {
	color: var(--text);
	background: var(--surface-3);
}

.browser-new-tab {
	display: flex;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
	width: 27px;
	height: 27px;
	color: var(--text-dim);
	background: none;
	border: none;
	border-radius: var(--radius-xs);
	cursor: pointer;
}

.browser-new-tab:hover {
	color: var(--text);
	background: var(--surface-2);
}

.browser-toolbar {
	display: flex;
	gap: 6px;
	align-items: center;
	padding: 8px 10px;
}

.browser-form {
	flex: 1;
}

#browser-address {
	width: 100%;
	padding: 8px 14px;
	font-family: inherit;
	font-size: 0.84rem;
	color: var(--text);
	background: var(--bg);
	border: 1px solid var(--border);
	border-radius: 99px;
	outline: none;
	transition: border-color var(--ease), box-shadow var(--ease);
}

#browser-address::placeholder {
	color: var(--text-faint);
}

#browser-address:focus {
	border-color: var(--accent-line);
	box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ---------- AI ---------- */

#ai-view {
	display: flex;
	height: 100vh;
	overflow: hidden;
	font-family: var(--font-ai);
}

.ai-sidebar {
	display: flex;
	flex-direction: column;
	flex-shrink: 0;
	width: 236px;
	background: var(--bg-deep);
	border-right: 1px solid var(--border);
}

.ai-sidebar-head {
	display: flex;
	gap: 8px;
	align-items: center;
	padding: 13px;
	border-bottom: 1px solid var(--border);
}

.ai-new-chat {
	display: flex;
	flex: 1;
	gap: 7px;
	align-items: center;
	justify-content: center;
	padding: 9px;
	font-family: inherit;
	font-size: 0.83rem;
	font-weight: 500;
	color: var(--accent-contrast);
	background: var(--accent);
	border: none;
	border-radius: var(--radius-xs);
	cursor: pointer;
	transition: filter var(--ease);
}

.ai-new-chat:hover {
	filter: brightness(1.08);
}

.ai-new-chat svg {
	width: 14px;
	height: 14px;
}

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

.ai-chat-row {
	display: flex;
	gap: 4px;
	align-items: center;
	border-radius: var(--radius-xs);
	transition: background var(--ease);
}

.ai-chat-row:hover {
	background: var(--surface);
}

.ai-chat-row.active {
	background: var(--accent-soft);
}

.ai-chat-label {
	flex: 1;
	overflow: hidden;
	padding: 9px 10px;
	font-family: inherit;
	font-size: 0.82rem;
	color: var(--text-dim);
	text-align: left;
	text-overflow: ellipsis;
	white-space: nowrap;
	background: none;
	border: none;
	cursor: pointer;
}

.ai-chat-row.active .ai-chat-label {
	color: var(--accent);
}

.ai-chat-rename,
.ai-chat-delete {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	margin-right: 2px;
	color: var(--text-faint);
	background: none;
	border: none;
	border-radius: 5px;
	opacity: 0;
	cursor: pointer;
}

.ai-chat-delete {
	margin-right: 5px;
}

.ai-chat-row:hover .ai-chat-rename,
.ai-chat-row:hover .ai-chat-delete {
	opacity: 1;
}

.ai-chat-rename:hover {
	color: var(--text);
}

.ai-chat-delete:hover {
	color: var(--danger);
}

.ai-chat-rename-input {
	flex: 1;
	min-width: 0;
	padding: 8px 9px;
	margin: 0 1px;
	font-family: inherit;
	font-size: 0.82rem;
	color: var(--text);
	background: var(--surface-2);
	border: 1px solid var(--accent-line);
	border-radius: 6px;
	outline: none;
}

.ai-main {
	display: flex;
	flex: 1;
	flex-direction: column;
	min-width: 0;
}

.ai-header {
	display: flex;
	flex-shrink: 0;
	gap: 11px;
	align-items: center;
	padding: 11px 18px;
	border-bottom: 1px solid var(--border);
}

.ai-header h2 {
	font-family: var(--font-script);
	font-size: 1.5rem;
	font-weight: 700;
}

.ai-header-right {
	margin-left: auto;
}

.ai-messages {
	flex: 1;
	padding: 26px 18px;
	overflow-y: auto;
}

.ai-empty {
	display: flex;
	flex-direction: column;
	gap: 12px;
	align-items: center;
	justify-content: center;
	height: 100%;
	text-align: center;
}

.ai-empty p {
	font-size: 0.88rem;
	color: var(--text-dim);
}

.ai-suggestions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: center;
	max-width: 520px;
	margin-top: 12px;
}

.ai-suggestion {
	padding: 9px 14px;
	font-family: inherit;
	font-size: 0.81rem;
	color: var(--text-dim);
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 99px;
	cursor: pointer;
	transition: all var(--ease);
}

.ai-suggestion:hover {
	color: var(--text);
	border-color: var(--accent-line);
}

.ai-message {
	display: flex;
	gap: 13px;
	max-width: 780px;
	margin: 0 auto 26px;
	animation: rise 0.22s ease;
}

/* User turns read like a ChatGPT-style bubble: no avatar, right-aligned,
   capped width so long messages don't stretch edge to edge. */
.ai-message.user {
	justify-content: flex-end;
}

.ai-message.user .ai-avatar {
	display: none;
}

.ai-message.user .ai-message-col {
	flex: 0 1 auto;
	max-width: 76%;
}

.ai-avatar {
	display: flex;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	margin-top: 2px;
	color: var(--accent);
	background: var(--accent-soft);
	border-radius: 8px;
}

.ai-message-col {
	min-width: 0;
	flex: 1;
}

.ai-message-body {
	font-size: 0.92rem;
	line-height: 1.65;
	color: var(--text);
	word-wrap: break-word;
}

.ai-message.user .ai-message-body {
	padding: 10px 15px;
	white-space: pre-wrap;
	background: var(--surface-2);
	border-radius: 17px;
	box-shadow: var(--shadow);
}

.ai-message.error .ai-message-body {
	padding: 11px 14px;
	font-size: 0.85rem;
	color: var(--danger);
	background: rgba(248, 113, 113, 0.08);
	border: 1px solid rgba(248, 113, 113, 0.25);
	border-radius: var(--radius-sm);
}

.ai-message-actions {
	display: flex;
	gap: 6px;
	align-items: center;
	margin-top: 8px;
	opacity: 0;
	transition: opacity var(--ease);
}

.ai-message.user .ai-message-actions {
	justify-content: flex-end;
}

.ai-message:hover .ai-message-actions {
	opacity: 1;
}

.ai-message-actions button {
	padding: 3px 9px;
	font-family: inherit;
	font-size: 0.72rem;
	color: var(--text-faint);
	background: none;
	border: 1px solid var(--border);
	border-radius: 5px;
	cursor: pointer;
	transition: all var(--ease);
}

.ai-message-actions button:hover {
	color: var(--text);
	border-color: var(--border-strong);
}

/* ---------- attachments, tool status, sources, actions ---------- */

.ai-msg-attachments {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	justify-content: flex-end;
	margin-bottom: 6px;
}

.ai-msg-attachment {
	overflow: hidden;
	border-radius: 12px;
	box-shadow: var(--shadow);
}

.ai-msg-attachment img {
	display: block;
	max-width: 220px;
	max-height: 220px;
	object-fit: cover;
}

.ai-tool-status {
	display: flex;
	gap: 9px;
	align-items: center;
	padding: 9px 13px;
	margin-bottom: 10px;
	font-size: 0.83rem;
	color: var(--text-dim);
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 99px;
	width: fit-content;
}

.ai-tool-spinner {
	width: 12px;
	height: 12px;
	border: 2px solid var(--accent-line);
	border-top-color: var(--accent);
	border-radius: 50%;
	animation: spin 0.7s linear infinite;
}

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

.ai-action-note {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 12px;
	margin-top: 10px;
	font-size: 0.78rem;
	color: var(--accent);
	background: var(--accent-soft);
	border: 1px solid var(--accent-line);
	border-radius: 99px;
}

.ai-sources {
	margin-top: 14px;
}

.ai-sources-label {
	margin-bottom: 7px;
	font-size: 0.72rem;
	font-weight: 600;
	color: var(--text-faint);
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.ai-sources-list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.ai-source-chip {
	display: flex;
	flex-direction: column;
	gap: 2px;
	max-width: 200px;
	padding: 8px 11px;
	text-decoration: none;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	transition: border-color var(--ease), background var(--ease);
}

.ai-source-chip:hover {
	background: var(--surface-2);
	border-color: var(--accent-line);
}

.ai-source-title {
	overflow: hidden;
	font-size: 0.78rem;
	color: var(--text);
	text-overflow: ellipsis;
	white-space: nowrap;
}

.ai-source-domain {
	overflow: hidden;
	font-size: 0.7rem;
	color: var(--text-faint);
	text-overflow: ellipsis;
	white-space: nowrap;
}

.ai-image-gallery {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
	gap: 8px;
	max-width: 560px;
	margin: 10px 0;
}

.ai-image-tile {
	display: block;
	aspect-ratio: 1;
	overflow: hidden;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	transition: border-color var(--ease), transform var(--ease);
}

.ai-image-tile:hover {
	border-color: var(--accent-line);
	transform: translateY(-2px);
}

.ai-image-tile img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	background: var(--surface-2);
}

.md-image-link {
	display: inline-block;
}

.md-image {
	display: block;
	max-width: 100%;
	max-height: 360px;
	margin: 8px 0;
	border-radius: var(--radius-sm);
	border: 1px solid var(--border);
}

.ai-reasoning {
	margin-bottom: 12px;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
}

.ai-reasoning summary {
	padding: 9px 13px;
	font-size: 0.79rem;
	color: var(--text-faint);
	cursor: pointer;
	list-style: none;
}

.ai-reasoning summary::-webkit-details-marker {
	display: none;
}

.ai-reasoning summary::before {
	content: "›";
	display: inline-block;
	margin-right: 7px;
	transition: transform var(--ease);
}

.ai-reasoning[open] summary::before {
	transform: rotate(90deg);
}

.ai-reasoning-text {
	max-height: 210px;
	padding: 0 13px 11px;
	overflow-y: auto;
	font-size: 0.79rem;
	color: var(--text-faint);
	line-height: 1.55;
	white-space: pre-wrap;
}

.ai-thinking {
	display: flex;
	gap: 5px;
	align-items: center;
	height: 24px;
}

.ai-thinking span {
	width: 6px;
	height: 6px;
	background: var(--accent);
	border-radius: 50%;
	animation: pulse 1.2s ease-in-out infinite;
}

.ai-thinking span:nth-child(2) {
	animation-delay: 0.16s;
}

.ai-thinking span:nth-child(3) {
	animation-delay: 0.32s;
}

.ai-input-area {
	flex-shrink: 0;
	padding: 14px 18px 18px;
	border-top: 1px solid var(--border);
}

.ai-attach-tray {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	max-width: 780px;
	margin: 0 auto 10px;
}

.ai-attach-chip {
	position: relative;
	width: 52px;
	height: 52px;
	overflow: hidden;
	border-radius: 10px;
	box-shadow: var(--shadow);
}

.ai-attach-chip img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.ai-attach-chip button {
	position: absolute;
	top: 2px;
	right: 2px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 17px;
	height: 17px;
	color: #fff;
	background: rgba(0, 0, 0, 0.6);
	border: none;
	border-radius: 50%;
	cursor: pointer;
}

.ai-input-wrap {
	display: flex;
	gap: 9px;
	align-items: flex-end;
	max-width: 780px;
	margin: 0 auto;
}

.ai-attach-btn {
	display: flex;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	color: var(--text-dim);
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	cursor: pointer;
	transition: all var(--ease);
}

.ai-attach-btn:hover {
	color: var(--accent);
	border-color: var(--accent-line);
}

.ai-attach-btn svg {
	width: 18px;
	height: 18px;
}

.ai-input {
	flex: 1;
	max-height: 200px;
	padding: 12px 15px;
	font-family: inherit;
	font-size: 0.89rem;
	line-height: 1.5;
	color: var(--text);
	resize: none;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	outline: none;
	transition: border-color var(--ease), box-shadow var(--ease);
}

.ai-input::placeholder {
	color: var(--text-faint);
}

.ai-input:focus {
	border-color: var(--accent-line);
	box-shadow: 0 0 0 3px var(--accent-soft);
}

.ai-send,
.ai-stop {
	display: flex;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	border: none;
	border-radius: var(--radius-sm);
	cursor: pointer;
	transition: filter var(--ease);
}

.ai-send {
	color: var(--accent-contrast);
	background: var(--accent);
}

.ai-stop {
	color: var(--danger);
	background: rgba(248, 113, 113, 0.12);
	border: 1px solid rgba(248, 113, 113, 0.3);
}

.ai-send:hover,
.ai-stop:hover {
	filter: brightness(1.1);
}

.ai-send svg,
.ai-stop svg {
	width: 18px;
	height: 18px;
}

.ai-sidebar-toggle {
	display: none;
}

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

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

.ai-md p {
	margin: 0 0 10px;
}

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

.ai-md h1,
.ai-md h2,
.ai-md h3,
.ai-md h4 {
	margin: 18px 0 8px;
	font-weight: 600;
	line-height: 1.3;
}

.ai-md h1 {
	font-size: 1.28rem;
}

.ai-md h2 {
	font-size: 1.12rem;
}

.ai-md h3 {
	font-size: 1rem;
}

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

.ai-md li {
	margin-bottom: 4px;
}

.ai-md a {
	color: var(--accent);
	text-decoration: none;
	border-bottom: 1px solid var(--accent-line);
}

.ai-md a:hover {
	border-bottom-color: var(--accent);
}

.ai-md blockquote {
	margin: 0 0 10px;
	padding: 3px 0 3px 14px;
	color: var(--text-dim);
	border-left: 2px solid var(--accent-line);
}

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

.ai-md code {
	padding: 2px 5px;
	font-family: var(--font-mono);
	font-size: 0.84em;
	color: var(--accent);
	background: var(--surface-2);
	border-radius: 4px;
}

.md-table-wrap {
	margin-bottom: 12px;
	overflow-x: auto;
}

.ai-md table {
	width: 100%;
	font-size: 0.84rem;
	border-collapse: collapse;
}

.ai-md th,
.ai-md td {
	padding: 8px 11px;
	text-align: left;
	border: 1px solid var(--border);
}

.ai-md th {
	font-weight: 600;
	background: var(--surface-2);
}

pre.md-code {
	position: relative;
	margin: 0 0 12px;
	padding: 14px 15px;
	overflow-x: auto;
	font-family: var(--font-mono);
	font-size: 0.81rem;
	line-height: 1.6;
	background: var(--bg-deep);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
}

pre.md-code code {
	padding: 0;
	color: var(--text);
	background: none;
	border-radius: 0;
}

.md-code-copy {
	position: absolute;
	top: 8px;
	right: 8px;
	padding: 3px 9px;
	font-family: inherit;
	font-size: 0.7rem;
	color: var(--text-faint);
	background: var(--surface-2);
	border: 1px solid var(--border);
	border-radius: 5px;
	opacity: 0;
	cursor: pointer;
	transition: all var(--ease);
}

pre.md-code:hover .md-code-copy {
	opacity: 1;
}

.md-code-copy:hover {
	color: var(--accent);
	border-color: var(--accent-line);
}

.md-code-lang {
	position: absolute;
	top: 10px;
	right: 62px;
	font-family: var(--font-mono);
	font-size: 0.66rem;
	color: var(--text-faint);
	pointer-events: none;
}

.tok-comment {
	color: var(--text-faint);
	font-style: italic;
}

.tok-keyword {
	color: var(--accent);
}

.tok-string {
	color: #fbbf24;
}

.tok-number {
	color: #f97316;
}

.tok-function {
	color: #60a5fa;
}

.tok-punct {
	color: var(--text-dim);
}

:root[data-mode="light"] .tok-string {
	color: #b45309;
}

:root[data-mode="light"] .tok-number {
	color: #c2410c;
}

:root[data-mode="light"] .tok-function {
	color: #1d4ed8;
}

:root[data-mode="light"] .tok-keyword {
	color: var(--accent-strong);
}

:root[data-mode="light"] .ai-md code {
	color: var(--accent-strong);
}

/* ---------- math (native MathML) ---------- */

.akura-math-inline {
	display: inline-block;
	font-size: 1.02em;
	vertical-align: middle;
}

.akura-math-block {
	display: block;
	margin: 12px 0;
	overflow-x: auto;
	font-size: 1.12em;
	text-align: center;
}

math {
	color: var(--text);
}

/* ---------- context menu ---------- */

.akura-context-menu {
	position: fixed;
	z-index: 500;
	min-width: 200px;
	padding: 5px;
	background: var(--surface);
	border: 1px solid var(--border-strong);
	border-radius: var(--radius-sm);
	box-shadow: var(--shadow-lg);
	animation: dropIn 0.12s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.akura-context-item {
	display: flex;
	gap: 10px;
	align-items: center;
	width: 100%;
	padding: 9px 11px;
	font-family: inherit;
	font-size: 0.83rem;
	color: var(--text-dim);
	text-align: left;
	background: none;
	border: none;
	border-radius: var(--radius-xs);
	cursor: pointer;
}

.akura-context-item:hover:not(:disabled) {
	color: var(--text);
	background: var(--surface-2);
}

.akura-context-item:disabled {
	color: var(--text-faint);
	cursor: default;
}

.akura-context-item svg {
	flex-shrink: 0;
	color: var(--accent);
}

.akura-context-sep {
	height: 1px;
	margin: 5px 4px;
	background: var(--border);
}

.akura-toast {
	position: fixed;
	bottom: 26px;
	left: 50%;
	z-index: 600;
	padding: 9px 16px;
	font-size: 0.82rem;
	color: var(--text);
	background: var(--surface-2);
	border: 1px solid var(--border-strong);
	border-radius: 99px;
	box-shadow: var(--shadow-lg);
	opacity: 0;
	transform: translate(-50%, 6px);
	transition: opacity 0.2s ease, transform 0.2s ease;
	pointer-events: none;
}

.akura-toast.show {
	opacity: 1;
	transform: translate(-50%, 0);
}

/* ---------- responsive ---------- */

@media (max-width: 900px) {
	.settings-layout {
		grid-template-columns: 1fr;
	}

	.settings-rail {
		position: static;
		flex-direction: row;
		overflow-x: auto;
	}

	.rail-item {
		flex-shrink: 0;
	}
}

@media (max-width: 760px) {
	.page {
		padding: 32px 18px 80px;
	}

	.ai-sidebar {
		position: absolute;
		top: 0;
		bottom: 0;
		left: 0;
		z-index: 30;
		transform: translateX(-100%);
		transition: transform var(--ease);
	}

	.ai-sidebar.open {
		transform: none;
		box-shadow: var(--shadow-lg);
	}

	.ai-sidebar-toggle {
		display: flex;
	}

	.theme-grid,
	.mode-grid {
		grid-template-columns: 1fr;
	}

	.setting-row {
		flex-direction: column;
		align-items: flex-start;
		gap: 10px;
	}

	.setting-control .field {
		width: 100%;
	}

	.site-footer {
		right: 0;
		left: 0;
		justify-content: center;
	}
}

@media (max-width: 420px) {
	.quick-grid {
		grid-template-columns: repeat(3, 1fr);
	}

	.games-grid {
		grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
	}
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}

/* Akura Chat */

#chat-view {
	position: relative;
	height: 100%;
	overflow: hidden;
}

.dc-auth {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
	padding: 24px;
}

.dc-auth-back {
	position: absolute;
	top: 18px;
	left: 18px;
}

.dc-auth-card {
	position: relative;
	max-width: 400px;
	width: 100%;
}

.dc-auth-card::before {
	content: "";
	position: absolute;
	top: -60px;
	left: 50%;
	z-index: -1;
	width: 280px;
	height: 280px;
	background: radial-gradient(circle, var(--accent-soft), transparent 72%);
	transform: translateX(-50%);
	pointer-events: none;
}

.dc-auth-card .panel-desc {
	margin: 6px 0 22px;
	text-align: center;
}

.chat-auth-tabs {
	display: flex;
	gap: 6px;
	padding: 4px;
	margin-bottom: 22px;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius-xs);
}

.chat-auth-tab {
	flex: 1;
	padding: 10px;
	font-family: inherit;
	font-size: 0.82rem;
	font-weight: 500;
	color: var(--text-dim);
	background: none;
	border: none;
	border-radius: 7px;
	cursor: pointer;
	transition: all var(--ease);
}

.chat-auth-tab.active {
	color: var(--accent-contrast);
	background: var(--accent);
	box-shadow: var(--shadow);
}

#chat-auth-form {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.chat-remember-row {
	padding: 4px 0;
	border-bottom: none;
}

.chat-account-list {
	margin-top: 24px;
}

.chat-account-list-label {
	margin-bottom: 10px;
	font-size: 0.76rem;
	color: var(--text-faint);
}

.chat-account-chip {
	padding: 7px 13px;
	margin: 0 8px 8px 0;
	font-family: inherit;
	font-size: 0.8rem;
	color: var(--text-dim);
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 99px;
	cursor: pointer;
	transition: all var(--ease);
}

.chat-account-chip:hover {
	color: var(--text);
	border-color: var(--accent-line);
}

.dc-app {
	display: grid;
	grid-template-columns: 72px 240px 1fr;
	height: 100%;
}

.dc-rail {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	padding: 12px 0;
	overflow-y: auto;
	background: var(--bg-deep);
	border-right: 1px solid var(--border);
}

.dc-rail-icon {
	display: flex;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	color: var(--text-dim);
	cursor: pointer;
	background: var(--surface);
	border: none;
	border-radius: 16px;
	transition: border-radius var(--ease), background var(--ease), color var(--ease), transform var(--ease);
}

.dc-rail-icon svg {
	width: 20px;
	height: 20px;
}

.dc-rail-icon:hover {
	color: var(--accent-contrast);
	background: var(--accent);
	border-radius: 14px;
	transform: translateY(-1px);
}

.dc-rail-icon.active {
	color: var(--accent-contrast);
	background: var(--accent);
	border-radius: 14px;
	box-shadow: 0 0 0 2px var(--accent-line);
}

.dc-rail-sep {
	width: 28px;
	height: 2px;
	margin: 2px 0;
	background: var(--border-strong);
	border-radius: 2px;
}

.dc-rail-rooms {
	display: flex;
	flex-direction: column;
	flex: 1;
	gap: 8px;
	min-height: 0;
	overflow-x: hidden;
	overflow-y: auto;
}

.dc-rail-room {
	display: flex;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	font-family: var(--font-script);
	font-size: 1.05rem;
	font-weight: 700;
	color: var(--accent);
	cursor: pointer;
	background: linear-gradient(150deg, var(--accent-soft), var(--surface-2));
	border: none;
	border-radius: 16px;
	transition: border-radius var(--ease), transform var(--ease), box-shadow var(--ease);
}

.dc-rail-room:hover {
	border-radius: 14px;
	transform: translateY(-1px);
}

.dc-rail-room.active {
	border-radius: 14px;
	box-shadow: 0 0 0 2px var(--accent);
}

.dc-add {
	color: var(--accent);
}

.dc-sidebar {
	display: flex;
	flex-direction: column;
	min-width: 0;
	background: var(--surface);
	border-right: 1px solid var(--border);
}

.dc-search-btn {
	flex-shrink: 0;
	padding: 10px 12px;
	margin: 10px 10px 0;
	font-family: inherit;
	font-size: 0.8rem;
	color: var(--text-faint);
	text-align: left;
	cursor: pointer;
	background: var(--bg-deep);
	border: 1px solid var(--border);
	border-radius: var(--radius-xs);
	transition: border-color var(--ease);
}

.dc-search-btn:hover {
	border-color: var(--accent-line);
}

.dc-sidebar-scroll {
	flex: 1;
	min-height: 0;
	padding: 10px;
	overflow-y: auto;
}

.dc-nav-item {
	display: flex;
	gap: 10px;
	align-items: center;
	width: 100%;
	padding: 9px 10px;
	margin-bottom: 12px;
	font-family: inherit;
	font-size: 0.85rem;
	font-weight: 500;
	color: var(--text-dim);
	text-align: left;
	cursor: pointer;
	background: none;
	border: none;
	border-radius: var(--radius-xs);
	transition: background var(--ease), color var(--ease);
}

.dc-nav-item svg {
	width: 17px;
	height: 17px;
}

.dc-nav-item:hover {
	color: var(--text);
	background: var(--surface-2);
}

.dc-nav-item.active {
	color: var(--accent-contrast);
	background: var(--accent);
}

.dc-badge {
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	margin-left: auto;
	font-size: 0.68rem;
	font-weight: 700;
	color: #fff;
	background: var(--danger);
	border-radius: 99px;
}

.dc-section-label {
	padding: 0 6px;
	margin-bottom: 8px;
	font-size: 0.68rem;
	font-weight: 700;
	color: var(--text-faint);
	text-transform: uppercase;
	letter-spacing: 0.06em;
}

.dc-section-row {
	display: flex;
	align-items: center;
	margin-top: 16px;
}

.dc-list {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin-bottom: 12px;
}

.dc-room-tabs {
	display: flex;
	gap: 4px;
	padding: 3px;
	margin-bottom: 10px;
	background: var(--bg-deep);
	border: 1px solid var(--border);
	border-radius: var(--radius-xs);
}

.dc-room-tab {
	flex: 1;
	padding: 7px;
	font-family: inherit;
	font-size: 0.76rem;
	font-weight: 500;
	color: var(--text-dim);
	background: none;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	transition: all var(--ease);
}

.dc-room-tab.active {
	color: var(--accent-contrast);
	background: var(--accent);
}

.dc-user-bar {
	display: flex;
	flex-shrink: 0;
	gap: 8px;
	align-items: center;
	padding: 10px;
	background: var(--bg-deep);
	border-top: 1px solid var(--border);
}

.dc-user-avatar {
	width: 34px;
	height: 34px;
	font-size: 0.85rem;
}

.dc-user-info {
	flex: 1;
	min-width: 0;
}

.dc-user-name {
	overflow: hidden;
	font-size: 0.83rem;
	font-weight: 600;
	color: var(--text);
	text-overflow: ellipsis;
	white-space: nowrap;
}

.dc-user-status {
	font-size: 0.7rem;
	color: var(--text-faint);
}

.dc-main {
	position: relative;
	display: flex;
	flex-direction: column;
	min-width: 0;
	/* Without min-height:0 a grid item refuses to shrink below its content, so
	   a long message list grows the column past the viewport and pushes the
	   composer off the bottom. This bounds it so .dc-messages scrolls instead. */
	min-height: 0;
	height: 100%;
	overflow: hidden;
}

.dc-empty {
	display: flex;
	flex: 1;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 10px;
	text-align: center;
}

.dc-content {
	display: flex;
	flex: 1;
	flex-direction: column;
	min-height: 0;
}

.dc-content-header {
	display: flex;
	flex-shrink: 0;
	gap: 10px;
	align-items: center;
	padding: 14px 20px;
	font-weight: 600;
	border-bottom: 1px solid var(--border);
}

.dc-content-header svg {
	width: 18px;
	height: 18px;
	color: var(--accent);
}

.dc-friends-tabs {
	display: flex;
	gap: 6px;
	margin-left: 18px;
}

.dc-friends-tab {
	padding: 6px 12px;
	font-family: inherit;
	font-size: 0.8rem;
	font-weight: 500;
	color: var(--text-dim);
	cursor: pointer;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 99px;
	transition: all var(--ease);
}

.dc-friends-tab:hover {
	color: var(--text);
	border-color: var(--accent-line);
}

.dc-friends-tab.active {
	color: var(--accent-contrast);
	background: var(--accent);
	border-color: transparent;
}

.dc-content-body {
	flex: 1;
	min-height: 0;
	padding: 18px 20px;
	overflow-y: auto;
}

.dc-friends-add {
	max-width: 480px;
	margin-bottom: 18px;
}

.dc-friends-add form {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-top: 12px;
}

.dc-friend-row {
	display: flex;
	gap: 12px;
	align-items: center;
	padding: 10px 14px;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	transition: border-color var(--ease), background var(--ease);
}

.dc-friend-row:hover {
	border-color: var(--accent-line);
	background: var(--surface-2);
}

.dc-friend-row.clickable {
	cursor: pointer;
}

.dc-friend-name {
	flex: 1;
	font-size: 0.88rem;
	font-weight: 600;
	color: var(--text);
}

.dc-friend-actions {
	display: flex;
	gap: 8px;
}

.dc-convo-header {
	display: flex;
	flex-shrink: 0;
	gap: 12px;
	align-items: center;
	padding: 11px 18px;
	border-bottom: 1px solid var(--border);
}

.dc-convo-headtext {
	display: flex;
	flex-direction: column;
	gap: 1px;
	min-width: 0;
}

.dc-convo-headtext h3 {
	overflow: hidden;
	font-size: 0.98rem;
	font-weight: 600;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.dc-mobile-back {
	display: none;
}

.dc-messages {
	display: flex;
	flex: 1;
	flex-direction: column;
	align-items: center;
	min-height: 0;
	padding: 22px 18px;
	overflow-y: auto;
}

.dc-composer {
	display: flex;
	flex-direction: column;
	flex-shrink: 0;
	gap: 10px;
	padding: 14px 18px;
	border-top: 1px solid var(--border);
}

.dc-composer-row {
	position: relative;
	display: flex;
	gap: 8px;
	align-items: center;
}

.dc-composer-input {
	flex: 1;
}

.dc-gif-btn {
	font-size: 0.72rem;
	font-weight: 700;
}

.dc-emoji-suggest {
	display: flex;
	flex-direction: column;
	max-height: 220px;
	padding: 6px;
	overflow-y: auto;
	background: var(--surface-2);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	box-shadow: var(--shadow);
}

.dc-emoji-suggest-item {
	display: flex;
	gap: 10px;
	align-items: center;
	padding: 7px 9px;
	font-family: inherit;
	font-size: 0.85rem;
	color: var(--text);
	text-align: left;
	cursor: pointer;
	background: none;
	border: none;
	border-radius: 7px;
}

.dc-emoji-suggest-item .emoji {
	font-size: 1.1rem;
}

.dc-emoji-suggest-item.active,
.dc-emoji-suggest-item:hover {
	background: var(--accent-soft);
}

.dc-modal-overlay {
	position: fixed;
	inset: 0;
	z-index: 600;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	background: rgba(0, 0, 0, 0.55);
	backdrop-filter: blur(3px);
}

.dc-modal {
	position: relative;
	width: 100%;
	max-width: 440px;
	max-height: 86vh;
}

.dc-modal-scroll {
	display: flex;
	flex-direction: column;
	gap: 16px;
	max-height: 86vh;
	overflow-y: auto;
}

.dc-modal-close {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 2;
	background: var(--surface-2);
	border: 1px solid var(--border);
	box-shadow: var(--shadow);
}

.dc-modal-close:hover {
	color: var(--text);
	background: var(--surface-3);
}

.dc-modal-scroll > .panel:first-child > h3 {
	padding-right: 36px;
}

.dc-profile-modal {
	max-width: 380px;
}

.dc-profile-panel {
	overflow: hidden;
}

.dc-profile-banner {
	position: relative;
	display: flex;
	align-items: flex-end;
	justify-content: center;
	width: calc(100% + 48px);
	height: 96px;
	margin: -24px -24px 0;
	padding-bottom: 8px;
	cursor: pointer;
	background: linear-gradient(150deg, var(--accent-soft), var(--surface-2));
	background-size: cover;
	background-position: center;
	border: none;
}

.dc-profile-banner-img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

#dc-profile-banner-hint {
	position: relative;
	z-index: 1;
	padding: 4px 10px;
	font-size: 0.72rem;
	color: #fff;
	background: rgba(0, 0, 0, 0.5);
	border-radius: 99px;
	opacity: 0;
	transition: opacity var(--ease);
}

.dc-profile-banner:hover #dc-profile-banner-hint {
	opacity: 1;
}

.dc-profile-edit-avatar {
	display: flex;
	flex-direction: column;
	gap: 10px;
	align-items: center;
	margin: -32px 0 18px;
}

.dc-profile-edit-avatar .chat-avatar {
	position: relative;
	z-index: 1;
	width: 72px;
	height: 72px;
	font-size: 1.5rem;
	box-shadow: 0 0 0 4px var(--surface), 0 0 0 1px var(--accent-line) inset;
}

.dc-status-picker {
	display: flex;
	flex-direction: column;
	gap: 4px;
	margin-bottom: 16px;
}

.dc-status-option {
	display: flex;
	gap: 10px;
	align-items: center;
	padding: 8px 10px;
	font-family: inherit;
	font-size: 0.84rem;
	color: var(--text-dim);
	text-align: left;
	cursor: pointer;
	background: none;
	border: none;
	border-radius: 7px;
	transition: background var(--ease), color var(--ease);
}

.dc-status-option:hover {
	background: var(--surface);
	color: var(--text);
}

.dc-status-option.active {
	color: var(--text);
	background: var(--accent-soft);
}

.dc-notify-row {
	margin-bottom: 16px;
}

.dc-status-dot {
	display: inline-block;
	flex-shrink: 0;
	width: 10px;
	height: 10px;
	border-radius: 50%;
}

.dot-online {
	background: #3ba55c;
}

.dot-idle {
	background: #faa61a;
}

.dot-dnd {
	background: #ed4245;
}

.dot-offline {
	background: var(--text-faint);
}

.chat-avatar-status {
	position: absolute;
	right: -1px;
	bottom: -1px;
	z-index: 2;
	width: 12px;
	height: 12px;
	background: var(--text-faint);
	border: 2px solid var(--surface);
	border-radius: 50%;
}

.chat-avatar-status.dot-online {
	background: #3ba55c;
}

.chat-avatar-status.dot-idle {
	background: #faa61a;
}

.chat-avatar-status.dot-dnd {
	background: #ed4245;
}

.chat-avatar-status.dot-offline {
	display: none;
}

.chat-avatar-sm .chat-avatar-status {
	width: 9px;
	height: 9px;
	border-width: 1.5px;
}

.dc-field-label {
	display: block;
	margin-bottom: 6px;
	font-size: 0.78rem;
	font-weight: 500;
	color: var(--text-dim);
}

.dc-bio-input {
	width: 100%;
	min-height: 80px;
	margin-bottom: 12px;
	font-family: inherit;
	resize: vertical;
}

.dc-gif-panel {
	position: absolute;
	right: 18px;
	bottom: 74px;
	z-index: 50;
	display: flex;
	flex-direction: column;
	width: 340px;
	height: 380px;
	padding: 10px;
	background: var(--surface-2);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
}

.dc-gif-tabs {
	display: flex;
	gap: 6px;
	margin-bottom: 8px;
}

.dc-gif-tab {
	flex: 1;
	padding: 7px;
	font-family: inherit;
	font-size: 0.78rem;
	color: var(--text-dim);
	cursor: pointer;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 7px;
}

.dc-gif-tab.active {
	color: var(--accent-contrast);
	background: var(--accent);
	border-color: transparent;
}

#dc-gif-search {
	margin-bottom: 8px;
}

.dc-gif-results {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 6px;
	flex: 1;
	min-height: 0;
	overflow-y: auto;
}

.dc-gif-item {
	position: relative;
}

.dc-gif-item img {
	display: block;
	width: 100%;
	height: 90px;
	object-fit: cover;
	cursor: pointer;
	background: var(--surface);
	border-radius: 8px;
}

.dc-gif-fav-btn {
	position: absolute;
	top: 5px;
	right: 5px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	color: #fff;
	cursor: pointer;
	background: rgba(0, 0, 0, 0.55);
	border: none;
	border-radius: 50%;
	opacity: 0;
	transition: opacity var(--ease), transform var(--ease);
}

.dc-gif-fav-btn svg {
	width: 13px;
	height: 13px;
}

.dc-gif-item:hover .dc-gif-fav-btn,
.dc-gif-fav-btn.on {
	opacity: 1;
}

.dc-gif-fav-btn:hover {
	transform: scale(1.12);
}

.dc-gif-fav-btn.on {
	color: gold;
}

.dc-gif-fav-btn.on svg {
	fill: gold;
}

.dc-gif-empty {
	grid-column: 1 / -1;
	padding: 20px;
	font-size: 0.8rem;
	color: var(--text-faint);
	text-align: center;
}

@media (max-width: 700px) {
	.dc-app {
		grid-template-columns: 60px 1fr;
	}

	.dc-sidebar {
		position: fixed;
		inset: 0 0 0 60px;
		z-index: 40;
	}

	.dc-main {
		position: fixed;
		inset: 0;
		z-index: 30;
		transform: translateX(100%);
		transition: transform var(--ease);
	}

	.dc-main.dc-main-active {
		transform: translateX(0);
	}

	.dc-mobile-back {
		display: flex;
	}

	/* The composer packs an attach button, the input, emoji, GIF and Send onto
	   one row; on a narrow screen that squeezes the input down to nothing, so
	   tighten the padding, gaps and button sizes to hand the input back room. */
	.dc-composer {
		padding: 10px 12px;
	}

	.dc-composer-row {
		gap: 6px;
	}

	.dc-composer-row .ai-attach-btn {
		width: 38px;
		height: 38px;
	}

	.dc-composer-row .btn-primary {
		padding-left: 14px;
		padding-right: 14px;
	}

	.dc-messages {
		padding: 16px 12px;
	}

	.dc-content-body {
		padding: 14px 12px;
	}

	/* Full-width bubbles read better than a centred 720px column on a phone. */
	.chat-msg {
		max-width: 100%;
	}
}

.chat-avatar {
	position: relative;
	display: flex;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	overflow: hidden;
	font-size: 1.15rem;
	font-weight: 700;
	color: var(--accent);
	background: linear-gradient(150deg, var(--accent-soft), var(--surface-2));
	border-radius: 50%;
	box-shadow: 0 0 0 3px var(--accent-soft), 0 0 0 1px var(--accent-line) inset;
	transition: box-shadow var(--ease), transform var(--ease);
}

.chat-avatar img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.chat-avatar-btn {
	padding: 0;
	cursor: pointer;
	background: var(--accent-soft);
	border: none;
}

.chat-avatar-btn:hover {
	box-shadow: 0 0 0 3px var(--accent-soft), 0 0 0 1px var(--accent) inset, 0 0 18px var(--accent-soft);
	transform: scale(1.04);
}

.chat-avatar-edit {
	position: absolute;
	inset: auto 0 0 0;
	padding: 3px 0;
	font-size: 0.6rem;
	font-weight: 600;
	color: #fff;
	text-align: center;
	background: rgba(0, 0, 0, 0.55);
	opacity: 0;
	transition: opacity var(--ease);
}

.chat-avatar-btn:hover .chat-avatar-edit {
	opacity: 1;
}

.chat-avatar-sm {
	width: 30px;
	height: 30px;
	font-size: 0.72rem;
	box-shadow: 0 0 0 2px var(--accent-soft);
}

.chat-room-empty {
	padding: 20px;
	font-size: 0.85rem;
	color: var(--text-faint);
	text-align: center;
	background: var(--surface);
	border: 1px dashed var(--border);
	border-radius: var(--radius-sm);
}

.chat-room-row {
	position: relative;
	display: flex;
	gap: 13px;
	align-items: center;
	width: 100%;
	padding: 13px 16px;
	overflow: hidden;
	font-family: inherit;
	text-align: left;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	cursor: pointer;
	transition: transform var(--ease), border-color var(--ease), background var(--ease), box-shadow var(--ease);
}

.chat-room-row::before {
	content: "";
	position: absolute;
	top: 0;
	right: var(--radius-sm);
	left: var(--radius-sm);
	height: 1px;
	background: linear-gradient(90deg, transparent, var(--border-strong), transparent);
}

.chat-room-row:hover {
	border-color: var(--accent-line);
	background: var(--surface-2);
	box-shadow: var(--shadow);
	transform: translateY(-2px);
}

.chat-room-icon {
	display: flex;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	font-family: var(--font-script);
	font-size: 1.05rem;
	font-weight: 700;
	color: var(--accent);
	background: linear-gradient(150deg, var(--accent-soft), var(--surface-2));
	border-radius: 11px;
	box-shadow: 0 0 0 1px var(--accent-line) inset;
}

.chat-room-row-text {
	display: flex;
	flex-direction: column;
	gap: 3px;
	min-width: 0;
}

.chat-room-row-tags {
	display: flex;
	gap: 6px;
	align-items: center;
}

.chat-room-row-name {
	overflow: hidden;
	font-size: 0.9rem;
	font-weight: 600;
	color: var(--text);
	text-overflow: ellipsis;
	white-space: nowrap;
}

.chat-room-lock {
	padding: 3px 9px;
	font-size: 0.72rem;
	color: var(--text-faint);
	background: var(--bg-deep);
	border-radius: 99px;
}

.chat-room-mine {
	padding: 3px 9px;
	font-size: 0.72rem;
	color: var(--accent);
	background: var(--accent-soft);
	border-radius: 99px;
}

/* The bell is the first right-aligned control and is always shown for a room,
   so it carries the auto margin; the settings gear (owner only) sits beside it. */
.dc-room-notify {
	margin-left: auto;
}

.dc-room-notify.on {
	color: var(--accent);
}

.dc-room-notify.on svg {
	fill: var(--accent-soft);
}

.chat-room-settings {
	margin-left: 4px;
}

.chat-room-menu {
	position: fixed;
	z-index: 500;
	display: flex;
	flex-direction: column;
	width: 190px;
	padding: 6px;
	background: var(--surface-2);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	box-shadow: var(--shadow);
	animation: rise 0.15s ease;
}

.chat-room-menu-item {
	padding: 9px 11px;
	font-family: inherit;
	font-size: 0.84rem;
	color: var(--text);
	text-align: left;
	background: none;
	border: none;
	border-radius: 7px;
	cursor: pointer;
	transition: background var(--ease);
}

.chat-room-menu-item:hover {
	background: var(--surface);
}

.chat-room-menu-item.danger {
	color: var(--danger);
}

.chat-room-row-by {
	font-size: 0.76rem;
	color: var(--text-faint);
}

.chat-form-panel {
	margin-bottom: 20px;
}

.chat-form-panel h3 {
	margin-bottom: 4px;
}

.chat-form-panel form {
	display: flex;
	flex-direction: column;
	gap: 14px;
	margin-top: 14px;
}

.chat-room-sub {
	font-size: 0.76rem;
	color: var(--text-faint);
}

.chat-msg {
	display: flex;
	flex-shrink: 0;
	gap: 11px;
	width: 100%;
	max-width: 720px;
	margin-bottom: 20px;
	animation: rise 0.22s ease;
}

.chat-msg-col {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	min-width: 0;
	max-width: 520px;
}

.chat-msg-self .chat-msg-col {
	align-items: flex-end;
}

.chat-msg-meta {
	margin-bottom: 4px;
	font-size: 0.74rem;
	color: var(--text-faint);
}

.chat-msg-body {
	display: inline-block;
	max-width: 100%;
	padding: 10px 14px;
	font-size: 0.9rem;
	line-height: 1.5;
	color: var(--text);
	word-wrap: break-word;
	white-space: pre-wrap;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 16px 16px 16px 5px;
	box-shadow: var(--shadow);
}

.chat-msg-image {
	display: block;
	max-width: min(320px, 100%);
	margin-top: 6px;
	border: 1px solid var(--border);
	border-radius: 14px;
	box-shadow: var(--shadow);
}

.chat-msg-image:first-child {
	margin-top: 0;
}

.chat-msg-self {
	flex-direction: row-reverse;
	text-align: right;
}

.chat-msg-self .chat-msg-body {
	color: var(--accent-contrast);
	text-align: left;
	background: linear-gradient(150deg, var(--accent), var(--accent-strong));
	border-color: transparent;
	border-radius: 16px 16px 5px 16px;
}

.chat-msg-broken {
	font-style: italic;
	color: var(--text-faint);
	background: var(--surface) !important;
}

.chat-msg-receipt {
	margin-top: 4px;
	font-size: 0.7rem;
	color: var(--text-faint);
}

.chat-msg-pending {
	opacity: 0.6;
}

.chat-attach-preview {
	position: relative;
	display: inline-flex;
	width: fit-content;
	padding: 6px;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
}

.chat-attach-preview img {
	display: block;
	max-height: 90px;
	border-radius: 8px;
}

.chat-attach-remove {
	position: absolute;
	top: -7px;
	right: -7px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
	font-size: 0.9rem;
	line-height: 1;
	color: var(--text);
	cursor: pointer;
	background: var(--surface-2);
	border: 1px solid var(--border);
	border-radius: 50%;
}

/* Akura Music */

#music-view {
	display: flex;
	flex-direction: column;
	height: 100%;
	background: var(--bg);
}

.mz-app {
	display: grid;
	flex: 1;
	grid-template-columns: 260px 1fr;
	min-height: 0;
}

.mz-sidebar {
	display: flex;
	flex-direction: column;
	min-height: 0;
	background: var(--bg-deep);
	border-right: 1px solid var(--border);
}

.mz-sidebar-head {
	display: flex;
	gap: 10px;
	align-items: center;
	padding: 16px 14px 18px;
}

.mz-wordmark {
	font-family: var(--font-script);
	font-size: 1.75rem;
	font-weight: 700;
	color: var(--text);
}

.mz-nav-item {
	display: flex;
	gap: 10px;
	align-items: center;
	width: calc(100% - 20px);
	padding: 9px 10px;
	margin: 0 10px 2px;
	font-family: inherit;
	font-size: 0.85rem;
	font-weight: 500;
	color: var(--text-dim);
	text-align: left;
	cursor: pointer;
	background: none;
	border: none;
	border-radius: 7px;
	transition: background var(--ease), color var(--ease);
}

.mz-nav-item svg {
	width: 17px;
	height: 17px;
}

.mz-nav-item:hover {
	color: var(--text);
	background: var(--surface-2);
}

.mz-nav-item.active {
	color: var(--accent);
	background: var(--accent-soft);
}

.mz-sidebar-scroll {
	flex: 1;
	min-height: 0;
	padding: 12px 10px 16px;
	overflow-y: auto;
}

.mz-liked-row {
	display: flex;
	gap: 12px;
	align-items: center;
	width: 100%;
	padding: 10px;
	margin: 0 0 14px;
	text-align: left;
	cursor: pointer;
	background: linear-gradient(135deg, var(--accent), var(--accent-strong));
	border: none;
	border-radius: 10px;
	box-shadow: var(--shadow);
	transition: transform var(--ease), box-shadow var(--ease);
}

.mz-liked-row:hover {
	box-shadow: var(--shadow-lg);
	transform: translateY(-1px);
}

.mz-liked-row.active {
	box-shadow: 0 0 0 2px var(--accent-line), var(--shadow-lg);
}

.mz-liked-icon {
	display: flex;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	color: var(--accent-contrast);
	background: rgba(255, 255, 255, 0.22);
	border-radius: 8px;
}

.mz-liked-icon svg {
	width: 17px;
	height: 17px;
}

.mz-liked-text {
	display: flex;
	flex-direction: column;
	gap: 1px;
	min-width: 0;
}

.mz-liked-title {
	font-size: 0.86rem;
	font-weight: 700;
	color: var(--accent-contrast);
}

.mz-liked-count {
	font-size: 0.72rem;
	color: var(--accent-contrast);
	opacity: 0.75;
}

.mz-section-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 4px 6px 8px;
}

.mz-section-row .dc-section-label {
	margin-bottom: 0;
}

.mz-sidebar .dc-section-label {
	color: var(--text-faint);
}

.mz-sidebar .dc-list {
	gap: 4px;
}

.mz-playlist-row {
	display: flex;
	gap: 10px;
	align-items: center;
	width: 100%;
	padding: 8px 10px;
	font-family: inherit;
	text-align: left;
	cursor: pointer;
	background: var(--surface);
	border: 1px solid transparent;
	border-radius: 8px;
	transition: background var(--ease), border-color var(--ease);
}

.mz-playlist-row:hover {
	background: var(--surface-2);
	border-color: var(--border);
}

.mz-playlist-row.active {
	background: var(--accent-soft);
	border-color: var(--accent-line);
}

.mz-playlist-text {
	display: flex;
	flex-direction: column;
	gap: 1px;
	min-width: 0;
}

.mz-playlist-name {
	overflow: hidden;
	font-size: 0.82rem;
	font-weight: 600;
	color: var(--text);
	text-overflow: ellipsis;
	white-space: nowrap;
}

.mz-playlist-count {
	font-size: 0.7rem;
	color: var(--text-faint);
}

.mz-main {
	display: flex;
	flex-direction: column;
	min-height: 0;
}

.mz-search-bar {
	flex-shrink: 0;
	padding: 22px 26px 16px;
}

.mz-search-wrap {
	position: relative;
	width: 100%;
}

.mz-search-icon {
	position: absolute;
	top: 50%;
	left: 15px;
	width: 17px;
	height: 17px;
	color: var(--text-faint);
	pointer-events: none;
	transform: translateY(-50%);
}

.mz-search-input {
	width: 100%;
	padding: 13px 16px 13px 42px;
	font-size: 0.95rem;
	background: var(--surface-2);
	border-color: var(--border);
	color: var(--text);
}

.mz-search-input::placeholder {
	color: var(--text-faint);
}

.mz-track-list {
	flex: 1;
	min-height: 0;
	padding: 4px 20px 24px;
	overflow-y: auto;
}

.mz-track-row {
	display: grid;
	grid-template-columns: 40px 1fr auto auto auto;
	gap: 14px;
	align-items: center;
	padding: 8px 10px;
	cursor: pointer;
	border-radius: 8px;
	transition: background var(--ease);
}

.mz-track-row:hover {
	background: var(--surface-2);
}

.mz-track-row.playing {
	background: var(--accent-soft);
}

.mz-track-cover {
	width: 40px;
	height: 40px;
	object-fit: cover;
	background: var(--surface-2);
	border-radius: 5px;
}

.mz-track-text {
	min-width: 0;
}

.mz-track-title {
	overflow: hidden;
	font-size: 0.86rem;
	font-weight: 500;
	color: var(--text);
	text-overflow: ellipsis;
	white-space: nowrap;
}

.mz-track-artist {
	overflow: hidden;
	font-size: 0.78rem;
	color: var(--text-faint);
	text-overflow: ellipsis;
	white-space: nowrap;
}

.mz-track-duration {
	font-size: 0.78rem;
	color: var(--text-faint);
}

.mz-track-like,
.mz-track-add {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	color: var(--text-faint);
	background: none;
	border: none;
	border-radius: 50%;
	opacity: 0;
	transition: opacity var(--ease), background var(--ease), color var(--ease), transform var(--ease);
}

.mz-track-row:hover .mz-track-like,
.mz-track-row:hover .mz-track-add {
	opacity: 1;
}

.mz-track-like.liked {
	color: var(--accent);
	opacity: 1;
}

.mz-track-like:hover,
.mz-track-add:hover {
	color: var(--text);
	background: var(--surface-3);
	transform: scale(1.08);
}

.mz-track-like.liked:hover {
	color: var(--accent);
}

.mz-track-empty {
	padding: 40px 20px;
	font-size: 0.85rem;
	color: var(--text-faint);
	text-align: center;
}

.mz-player-bar {
	display: grid;
	flex-shrink: 0;
	grid-template-columns: 260px 1fr 180px;
	gap: 20px;
	align-items: center;
	height: 84px;
	padding: 0 20px;
	background: var(--bg-deep);
	border-top: 1px solid var(--border);
}

.mz-player-track {
	display: flex;
	gap: 12px;
	align-items: center;
	min-width: 0;
}

.mz-player-cover {
	flex-shrink: 0;
	width: 52px;
	height: 52px;
	background: var(--surface-2) center/cover no-repeat;
	border-radius: 6px;
}

.mz-player-info {
	min-width: 0;
}

.mz-player-title {
	overflow: hidden;
	font-size: 0.85rem;
	font-weight: 500;
	color: var(--text);
	text-overflow: ellipsis;
	white-space: nowrap;
}

.mz-player-artist {
	overflow: hidden;
	font-size: 0.76rem;
	color: var(--text-faint);
	text-overflow: ellipsis;
	white-space: nowrap;
}

.mz-player-controls {
	display: flex;
	flex-direction: column;
	gap: 6px;
	align-items: center;
	max-width: 560px;
	margin: 0 auto;
}

.mz-player-buttons {
	display: flex;
	gap: 14px;
	align-items: center;
}

.mz-player-buttons .icon-btn {
	color: var(--text-dim);
}

.mz-player-buttons .icon-btn:hover {
	color: var(--text);
}

.mz-toggle-btn.on {
	color: var(--accent);
}

.mz-toggle-btn.on:hover {
	color: var(--accent);
}

.mz-toggle-btn.on::after {
	content: "";
	display: block;
	width: 4px;
	height: 4px;
	margin: 2px auto 0;
	background: var(--accent);
	border-radius: 50%;
}

.mz-smart-btn.loading {
	animation: mz-spin 0.9s linear infinite;
}

@keyframes mz-spin {
	from {
		transform: rotate(0deg);
	}
	to {
		transform: rotate(360deg);
	}
}

.mz-player-play {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	color: var(--accent-contrast);
	cursor: pointer;
	background: var(--accent);
	border: none;
	border-radius: 50%;
	transition: transform var(--ease);
}

.mz-player-play:hover {
	transform: scale(1.06);
}

.mz-player-play svg {
	width: 15px;
	height: 15px;
}

.mz-seek-row {
	display: flex;
	gap: 8px;
	align-items: center;
	width: 100%;
}

.mz-time {
	flex-shrink: 0;
	width: 34px;
	font-size: 0.7rem;
	color: var(--text-faint);
}

.mz-time:last-child {
	text-align: right;
}

.mz-seek,
.mz-volume {
	appearance: none;
	flex: 1;
	height: 5px;
	cursor: pointer;
	background: linear-gradient(
		to right,
		var(--accent) 0%,
		var(--accent) var(--mz-fill, 0%),
		var(--surface-3) var(--mz-fill, 0%),
		var(--surface-3) 100%
	);
	border-radius: 99px;
	transition: height var(--ease);
}

.mz-seek::-webkit-slider-thumb,
.mz-volume::-webkit-slider-thumb {
	appearance: none;
	width: 12px;
	height: 12px;
	background: #fff;
	border: none;
	border-radius: 50%;
	box-shadow: 0 0 0 1px var(--accent-line), 0 1px 4px rgba(0, 0, 0, 0.35);
	transition: transform var(--ease);
}

.mz-seek:hover::-webkit-slider-thumb,
.mz-volume:hover::-webkit-slider-thumb {
	transform: scale(1.15);
}

.mz-seek::-moz-range-thumb,
.mz-volume::-moz-range-thumb {
	width: 12px;
	height: 12px;
	background: #fff;
	border: none;
	border-radius: 50%;
	box-shadow: 0 0 0 1px var(--accent-line), 0 1px 4px rgba(0, 0, 0, 0.35);
}

.mz-seek::-moz-range-progress,
.mz-volume::-moz-range-progress {
	height: 5px;
	background: var(--accent);
	border-radius: 99px;
}

.mz-player-volume {
	display: flex;
	gap: 10px;
	align-items: center;
	color: var(--text-faint);
}

.mz-player-volume svg {
	flex-shrink: 0;
	width: 17px;
	height: 17px;
}

.mz-volume {
	width: 90px;
}

#launcher-view {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
}

.launcher-inner {
	display: flex;
	flex-direction: column;
	align-items: center;
	width: 100%;
	max-width: 760px;
	text-align: center;
}

.launcher-sub {
	margin-bottom: 30px;
	font-size: 0.92rem;
	color: var(--text-dim);
}

.launcher-cards {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 18px;
	width: 100%;
}

.launcher-card {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 12px;
	padding: 30px 26px;
	text-align: left;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	cursor: pointer;
	transition: border-color var(--ease), transform var(--ease), background var(--ease);
}

.launcher-card:hover {
	border-color: var(--accent-line);
	background: var(--surface-2);
	transform: translateY(-3px);
}

.launcher-card-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	color: var(--accent);
	background: var(--accent-soft);
	border-radius: var(--radius-sm);
}

.launcher-card-title {
	font-size: 1.14rem;
	font-weight: 600;
	color: var(--text);
}

.launcher-card-desc {
	font-size: 0.85rem;
	line-height: 1.55;
	color: var(--text-dim);
}

.launcher-card-cta {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	margin-top: auto;
	padding-top: 8px;
	font-size: 0.82rem;
	font-weight: 600;
	color: var(--accent);
}

.launcher-card-experimental {
	background: linear-gradient(160deg, var(--surface), var(--surface-2));
}

.launcher-badge {
	position: absolute;
	top: 18px;
	right: 18px;
	padding: 3px 9px;
	font-size: 0.66rem;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--accent-contrast);
	background: var(--accent);
	border-radius: 99px;
}

@media (max-width: 640px) {
	.launcher-cards {
		grid-template-columns: 1fr;
	}
}

#os-view {
	position: fixed;
	inset: 0;
	z-index: 2;
	min-height: 0;
	overflow: hidden;
}

#os-desktop {
	position: absolute;
	inset: 0;
	overflow: hidden;
	background: radial-gradient(120% 90% at 18% 0%, var(--accent-soft), transparent 55%), var(--bg-deep);
	user-select: none;
}

#os-desktop.os-theme-wallpaper {
	background:
		radial-gradient(120% 90% at 18% 0%, var(--accent-soft), transparent 55%),
		radial-gradient(90% 70% at 92% 100%, var(--accent-soft), transparent 60%),
		var(--bg-deep);
}

#os-desktop.os-refresh-flash {
	animation: osRefresh 0.26s ease;
}

@keyframes osRefresh {
	0% {
		filter: brightness(1);
	}
	40% {
		filter: brightness(1.16);
	}
	100% {
		filter: brightness(1);
	}
}

#os-windows-layer {
	position: absolute;
	inset: 0;
	pointer-events: none;
}

.os-wallpaper-mark {
	position: absolute;
	left: 5%;
	bottom: 9%;
	z-index: 0;
	font-family: var(--font-script);
	font-weight: 700;
	font-size: clamp(3rem, 9vw, 7.5rem);
	color: var(--text);
	letter-spacing: 0.01em;
	opacity: 0.1;
	pointer-events: none;
	user-select: none;
	display: none;
}

#os-desktop.os-theme-wallpaper .os-wallpaper-mark {
	display: block;
}

.os-boot {
	position: absolute;
	inset: 0;
	z-index: 999;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--bg-deep);
	transition: opacity 0.32s ease;
}

.os-boot.os-boot-out {
	opacity: 0;
	pointer-events: none;
}

.os-boot-inner {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 22px;
	width: 260px;
}

.os-boot-logo {
	font-family: var(--font-script);
	font-size: 2.6rem;
	font-weight: 700;
	color: var(--text);
	animation: osBootPulse 1.6s ease-in-out infinite;
}

@keyframes osBootPulse {
	0%,
	100% {
		opacity: 0.82;
	}
	50% {
		opacity: 1;
	}
}

.os-boot-bar {
	width: 100%;
	height: 3px;
	overflow: hidden;
	background: var(--surface-2);
	border-radius: 99px;
}

.os-boot-bar-fill {
	width: 0%;
	height: 100%;
	background: var(--accent);
	border-radius: 99px;
	transition: width 1.3s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.os-boot-status {
	font-size: 0.78rem;
	color: var(--text-faint);
}

.os-window {
	position: absolute;
	display: flex;
	flex-direction: column;
	min-width: 380px;
	min-height: 260px;
	overflow: hidden;
	background: var(--surface);
	border: 1px solid var(--border-strong);
	border-radius: var(--radius);
	box-shadow: var(--shadow-lg);
	pointer-events: auto;
	transform: translateZ(0);
	animation: osWindowIn 0.16s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes osWindowIn {
	from {
		opacity: 0;
		transform: translateZ(0) scale(0.97) translateY(6px);
	}
	to {
		opacity: 1;
		transform: translateZ(0) scale(1) translateY(0);
	}
}

.os-window.focused {
	border-color: var(--accent-line);
	box-shadow: 0 22px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--accent-line);
}

.os-window-maximized {
	top: 0 !important;
	left: 0 !important;
	width: 100% !important;
	height: 100% !important;
	border-radius: 0;
	cursor: default !important;
}

.os-window-titlebar {
	display: flex;
	flex-shrink: 0;
	align-items: center;
	height: 42px;
	padding: 0 9px 0 13px;
	background: var(--surface-2);
	border-bottom: 1px solid var(--border);
	touch-action: none;
}

.os-window-icon {
	display: flex;
	align-items: center;
	width: 19px;
	height: 19px;
	margin-right: 10px;
}

.os-window-icon svg {
	width: 100%;
	height: 100%;
}

.os-window-title {
	overflow: hidden;
	font-size: 0.8rem;
	font-weight: 500;
	color: var(--text-dim);
	text-overflow: ellipsis;
	white-space: nowrap;
}

.os-window.focused .os-window-title {
	color: var(--text);
}

.os-window-controls {
	display: flex;
	gap: 4px;
	margin-left: auto;
}

.os-win-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	color: var(--text-faint);
	background: none;
	border: none;
	border-radius: var(--radius-xs);
	cursor: pointer;
	transition: background var(--ease), color var(--ease);
}

.os-win-btn:hover {
	color: var(--text);
	background: var(--surface-3);
}

.os-win-close:hover {
	color: #fff;
	background: #e5484d;
}

.os-window-body {
	position: relative;
	flex: 1;
	min-height: 0;
	margin: 0 8px 8px 0;
	overflow: hidden;
	background: var(--bg);
	border-radius: 0 0 var(--radius) 0;
}

.os-window-maximized .os-window-body {
	margin: 0;
	border-radius: 0;
}


#os-taskbar-hotzone {
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 899;
	height: 10px;
}

#os-taskbar {
	position: absolute;
	bottom: 8px;
	left: 50%;
	z-index: 900;
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 6px 10px;
	background: rgba(20, 20, 20, 0.72);
	border: 1px solid var(--border-strong);
	border-radius: 16px;
	box-shadow: var(--shadow-lg);
	backdrop-filter: blur(14px) saturate(1.4);
	transform: translate(-50%, calc(100% - 6px));
	transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}

:root[data-mode="light"] #os-taskbar {
	background: rgba(255, 255, 255, 0.78);
}

#os-taskbar-hotzone:hover ~ #os-taskbar,
#os-taskbar:hover,
#os-taskbar.menu-open,
#os-taskbar.os-no-autohide {
	transform: translate(-50%, 0);
}

.os-start-btn {
	display: flex;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	color: var(--text);
	background: none;
	border: none;
	border-radius: 11px;
	cursor: pointer;
	transition: background var(--ease), color var(--ease);
}

.os-start-btn:hover,
#os-taskbar.menu-open .os-start-btn {
	color: var(--accent);
	background: var(--accent-soft);
}

.os-taskbar-apps {
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 0 4px;
}

.os-taskbar-app {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 6px;
	background: none;
	border: none;
	border-radius: 11px;
	cursor: pointer;
	transition: background var(--ease), transform var(--ease);
}

.os-taskbar-app svg {
	width: 100%;
	height: 100%;
}

.os-taskbar-app:hover {
	background: var(--surface-3);
	transform: translateY(-2px);
}

.os-taskbar-app::after {
	content: "";
	position: absolute;
	bottom: -1px;
	left: 50%;
	width: 4px;
	height: 4px;
	background: var(--text-faint);
	border-radius: 50%;
	opacity: 0;
	transform: translateX(-50%);
	transition: opacity var(--ease), background var(--ease), width var(--ease);
}

.os-taskbar-app.running::after {
	opacity: 1;
}

.os-taskbar-app.focused::after {
	width: 14px;
	background: var(--accent);
}

.os-taskbar-clock {
	padding: 0 12px 0 6px;
	font-size: 0.78rem;
	font-weight: 500;
	color: var(--text-dim);
	white-space: nowrap;
}

.os-start-menu {
	position: absolute;
	bottom: 68px;
	left: 50%;
	z-index: 950;
	display: flex;
	flex-direction: column;
	width: min(460px, 90vw);
	max-height: 66vh;
	background: var(--surface);
	border: 1px solid var(--border-strong);
	border-radius: var(--radius);
	box-shadow: var(--shadow-lg);
	transform: translate(-50%, 10px) scale(0.98);
	opacity: 0;
	transition: transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.18s ease;
	pointer-events: none;
}

.os-start-menu.open {
	transform: translate(-50%, 0) scale(1);
	opacity: 1;
	pointer-events: auto;
}

.os-start-head {
	flex-shrink: 0;
	padding: 20px 22px 8px;
	text-align: center;
}

.os-start-head h3 {
	font-family: var(--font-script);
	font-size: 1.4rem;
	color: var(--text);
}

.os-start-head p {
	margin-top: 2px;
	font-size: 0.78rem;
	color: var(--text-faint);
}

.os-start-grid {
	display: grid;
	flex: 1;
	grid-template-columns: repeat(3, 1fr);
	align-content: flex-start;
	gap: 4px;
	padding: 8px 16px;
	overflow-y: auto;
}

.os-start-tile {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	padding: 14px 6px;
	font-family: inherit;
	font-size: 0.78rem;
	font-weight: 500;
	color: var(--text-dim);
	text-align: center;
	background: none;
	border: none;
	border-radius: var(--radius-sm);
	cursor: pointer;
	transition: background var(--ease), color var(--ease);
}

.os-start-tile:hover {
	color: var(--text);
	background: var(--surface-2);
}

.os-start-tile-icon {
	display: flex;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
}

.os-start-tile-icon svg {
	width: 100%;
	height: 100%;
}

.os-start-foot {
	flex-shrink: 0;
	padding: 12px 16px 18px;
	border-top: 1px solid var(--border);
}

.os-start-switch {
	width: 100%;
	padding: 9px;
	font-family: inherit;
	font-size: 0.8rem;
	font-weight: 500;
	color: var(--text-dim);
	background: var(--surface-2);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	cursor: pointer;
	transition: color var(--ease), border-color var(--ease);
}

.os-start-switch:hover {
	color: var(--text);
	border-color: var(--accent-line);
}

.os-context-menu {
	position: absolute;
	z-index: 960;
	min-width: 220px;
	padding: 5px;
	background: var(--surface);
	border: 1px solid var(--border-strong);
	border-radius: var(--radius-sm);
	box-shadow: var(--shadow-lg);
	animation: dropIn 0.12s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.os-context-item {
	width: 100%;
	padding: 9px 11px;
	font-family: inherit;
	font-size: 0.83rem;
	color: var(--text-dim);
	text-align: left;
	background: none;
	border: none;
	border-radius: var(--radius-xs);
	cursor: pointer;
}

.os-context-item:hover {
	color: var(--text);
	background: var(--surface-2);
}

.os-context-sep {
	height: 1px;
	margin: 5px 4px;
	background: var(--border);
}

.os-panel {
	position: absolute;
	top: 50%;
	left: 50%;
	z-index: 970;
	width: min(460px, 88vw);
	max-height: 74vh;
	padding: 16px 18px 20px;
	overflow-y: auto;
	background: var(--surface);
	border: 1px solid var(--border-strong);
	border-radius: var(--radius);
	box-shadow: var(--shadow-lg);
	transform: translate(-50%, -50%);
	animation: dropIn 0.16s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.os-panel-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 12px;
}

.os-panel-head h3 {
	font-size: 1rem;
	font-weight: 600;
	color: var(--text);
}

.os-panel-close {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	color: var(--text-faint);
	background: var(--surface-2);
	border: 1px solid var(--border);
	border-radius: var(--radius-xs);
	cursor: pointer;
}

.os-panel-close:hover {
	color: var(--text);
}

.os-wallpaper-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 10px;
}

.os-wallpaper-swatch {
	position: relative;
	display: flex;
	align-items: flex-end;
	height: 66px;
	padding: 6px;
	overflow: hidden;
	background-size: cover;
	border: 2px solid transparent;
	border-radius: var(--radius-sm);
	cursor: pointer;
}

.os-wallpaper-swatch.active {
	border-color: var(--accent);
}

.os-wallpaper-label {
	padding: 2px 6px;
	font-size: 0.68rem;
	font-weight: 600;
	color: #fff;
	background: rgba(0, 0, 0, 0.45);
	border-radius: 5px;
}

#os-view #ai-view,
#os-view #browser-view,
#os-view #proxy-view,
#os-view #games-view,
#os-view #settings-view,
#os-view #chat-view,
#os-view #music-view {
	height: 100%;
	min-height: 0;
}

#os-view .view {
	height: 100%;
	min-height: 0;
}

#os-view .page {
	height: 100%;
}

#os-view #browser-content,
#os-view #proxy-container,
#os-view .browser-chrome,
#os-view .mz-app,
#os-view .dc-app,
#os-view .ai-messages {
	min-height: 0;
	min-width: 0;
}

#os-view #ai-back,
#os-view #games-back,
#os-view #settings-back,
#os-view #mz-back,
#os-view #dc-back,
#os-view #chat-back,
#os-view #browser-home,
#os-view #anime-back,
#os-view #proxy-back,
#os-view #sites-back,
#os-view #movies-back {
	display: none;
}

#os-view #ai-view {
	--accent: #9aa0ab;
	--accent-strong: #7d838d;
	--accent-contrast: #14161a;
	--accent-soft: rgba(154, 160, 171, 0.14);
	--accent-line: rgba(154, 160, 171, 0.34);
	background: var(--bg-deep);
}

#os-view #ai-view .ai-sidebar {
	background: var(--bg-deep);
	border-right: 1px solid var(--border);
}

#os-view #ai-view .ai-sidebar-head {
	border-bottom: 1px solid var(--border);
}

#os-view #ai-view .ai-header {
	background: var(--surface);
	border-bottom: 1px solid var(--border);
}

#os-view #ai-view .ai-header h2 {
	font-size: 0.9rem;
	font-weight: 600;
	letter-spacing: 0.02em;
	text-transform: lowercase;
	color: var(--text);
}

#os-view #ai-view .ai-header h2::before {
	content: "❯ ";
	color: var(--accent);
}

#os-view #ai-view .ai-message-body {
	font-size: 0.87rem;
}

#os-view #ai-view .ai-message.user .ai-message-body {
	background: var(--surface-2);
	border: 1px solid var(--border-strong);
	border-radius: 8px;
}

#os-view #ai-view .ai-avatar {
	border-radius: 6px;
}

#os-view #ai-view .ai-new-chat,
#os-view #ai-view .ai-suggestion {
	border-radius: 6px;
}

.ai-header-title {
	display: flex;
	flex-direction: column;
	gap: 1px;
	overflow: hidden;
}

.ai-header-title h2 {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.ai-header-model {
	display: none;
	font-size: 0.72rem;
	color: var(--text-faint);
}

.ai-personality-btn {
	position: relative;
	display: none;
	align-items: center;
	gap: 6px;
	padding: 6px 10px;
	font-family: inherit;
	font-size: 0.76rem;
	color: var(--text-dim);
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 99px;
	cursor: pointer;
	transition: all var(--ease);
}

.ai-personality-btn:hover {
	color: var(--text);
	border-color: var(--accent-line);
}

.ai-personality-menu {
	position: absolute;
	top: 46px;
	right: 14px;
	z-index: 30;
	width: 230px;
	padding: 5px;
	background: var(--surface);
	border: 1px solid var(--border-strong);
	border-radius: var(--radius-sm);
	box-shadow: var(--shadow-lg);
}

.ai-personality-item {
	display: block;
	width: 100%;
	padding: 8px 10px;
	font-family: inherit;
	font-size: 0.8rem;
	color: var(--text-dim);
	text-align: left;
	background: none;
	border: none;
	border-radius: var(--radius-xs);
	cursor: pointer;
}

.ai-personality-item:hover {
	color: var(--text);
	background: var(--surface-2);
}

.ai-personality-item.active {
	color: var(--accent);
	background: var(--accent-soft);
}

.ai-personality-item-hint {
	display: block;
	margin-top: 1px;
	font-size: 0.68rem;
	color: var(--text-faint);
}

.ai-model-groups {
	display: none;
	flex-direction: column;
	flex-shrink: 0;
	gap: 12px;
	max-height: 46%;
	padding: 10px 10px 12px;
	overflow-y: auto;
	border-bottom: 1px solid var(--border);
}

.ai-model-group-label {
	padding: 0 6px;
	font-size: 0.64rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--text-faint);
}

.ai-model-row {
	display: flex;
	align-items: center;
	gap: 8px;
	width: 100%;
	padding: 7px 8px;
	margin-top: 2px;
	font-family: inherit;
	font-size: 0.79rem;
	color: var(--text-dim);
	text-align: left;
	background: none;
	border: none;
	border-radius: var(--radius-xs);
	cursor: pointer;
	transition: background var(--ease), color var(--ease);
}

.ai-model-row:hover {
	color: var(--text);
	background: var(--surface);
}

.ai-model-row.active {
	color: var(--text);
	background: var(--accent-soft);
}

.ai-model-dot {
	flex-shrink: 0;
	width: 6px;
	height: 6px;
	background: var(--text-faint);
	border-radius: 50%;
}

.ai-model-row.active .ai-model-dot {
	background: var(--accent);
}

.ai-model-name {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.ai-hero-grid {
	display: none;
	grid-template-columns: repeat(2, 1fr);
	gap: 10px;
	max-width: 520px;
	margin-top: 18px;
}

.ai-hero-card {
	padding: 14px 16px;
	text-align: left;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	cursor: pointer;
	transition: all var(--ease);
}

.ai-hero-card:hover {
	border-color: var(--accent-line);
	background: var(--surface-2);
}

.ai-hero-card-title {
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--text);
}

.ai-hero-card-sub {
	margin-top: 2px;
	font-size: 0.76rem;
	color: var(--text-faint);
}

#os-view #ai-view .ai-header-model,
#os-view #ai-view .ai-personality-btn,
#os-view #ai-view .ai-model-groups {
	display: flex;
}

#os-view #ai-view .ai-hero-grid {
	display: grid;
}

#os-view #ai-view .ai-suggestions,
#os-view #ai-view .ai-empty > p {
	display: none;
}

#os-view #ai-view .ai-empty .script-title {
	font-family: var(--font-ai);
	font-size: 1.6rem;
	font-weight: 700;
}

#os-view #ai-view .ai-empty .script-title::after {
	display: none;
}

#os-view #music-view {
	--accent: #1db954;
	--accent-strong: #1ed760;
	--accent-contrast: #06170d;
	--accent-soft: rgba(29, 185, 84, 0.14);
	--accent-line: rgba(29, 185, 84, 0.4);
}

#os-view #music-view .mz-sidebar {
	background: #060907;
}

#os-view #music-view .mz-player-play {
	color: #06170d;
}

#os-view #browser-view {
	--accent: #ff8a3d;
	--accent-strong: #ff7139;
	--accent-contrast: #1a0a02;
	--accent-soft: rgba(255, 138, 61, 0.14);
	--accent-line: rgba(255, 138, 61, 0.36);
}

#os-view #games-view {
	--accent: #5b7bff;
	--accent-strong: #4361ee;
	--accent-contrast: #050915;
	--accent-soft: rgba(91, 123, 255, 0.14);
	--accent-line: rgba(91, 123, 255, 0.36);
	background: var(--bg-deep);
}

#os-view #games-view .game-tile {
	background: var(--surface);
	border-radius: 12px;
	box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
}

#os-view #games-view .game-tile:hover {
	box-shadow: 0 14px 30px rgba(91, 123, 255, 0.28);
	transform: translateY(-4px) scale(1.02);
}

#os-view #games-view .game-title {
	padding-top: 26px;
	opacity: 1;
	background: linear-gradient(transparent, rgba(5, 9, 21, 0.92));
}

#os-view #games-view .game-fav {
	backdrop-filter: blur(4px);
}

#os-view #games-view .chip-toggle.on {
	background: var(--accent);
	border-color: var(--accent);
}

#os-view #chat-view {
	--accent: #7c8cff;
	--accent-strong: #5f70f2;
	--accent-contrast: #06081a;
	--accent-soft: rgba(124, 140, 255, 0.14);
	--accent-line: rgba(124, 140, 255, 0.36);
}

#os-view #settings-view {
	--accent: #b0b6c0;
	--accent-strong: #8d94a1;
	--accent-contrast: #101216;
	--accent-soft: rgba(176, 182, 192, 0.14);
	--accent-line: rgba(176, 182, 192, 0.36);
}

.an-tabs {
	display: flex;
	gap: 6px;
	padding: 0 28px;
	margin: 4px 0 18px;
	overflow-x: auto;
}

.an-tab {
	flex-shrink: 0;
	padding: 8px 14px;
	font-family: inherit;
	font-size: 0.82rem;
	font-weight: 500;
	color: var(--text-dim);
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 99px;
	cursor: pointer;
	transition: all var(--ease);
}

.an-tab:hover {
	color: var(--text);
}

.an-tab.active {
	color: #ffe8f1;
	background: #b23a6b;
	border-color: #b23a6b;
}

.an-shell {
	position: relative;
	height: 100%;
	overflow-y: auto;
	background: var(--bg-deep);
}

.an-back {
	position: absolute;
	top: 16px;
	left: 20px;
	z-index: 5;
	padding: 5px 10px;
	background: rgba(0, 0, 0, 0.4);
	border-radius: 99px;
}

.an-topbar {
	position: relative;
	z-index: 4;
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	align-items: center;
	justify-content: space-between;
	padding: 16px 28px;
}

.an-topbar .page-title {
	margin: 0;
	font-family: var(--font-script);
	font-size: 1.7rem;
	font-weight: 700;
}

.an-topbar .page-sub {
	display: none;
}

.an-search {
	width: min(320px, 60vw);
}

.an-hero {
	position: relative;
	height: 42vh;
	min-height: 240px;
	margin-top: -8px;
	overflow: hidden;
}

.an-hero-backdrop {
	position: absolute;
	inset: 0;
	background-position: center 20%;
	background-size: cover;
}

.an-hero::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(0deg, var(--bg-deep) 4%, transparent 55%), linear-gradient(90deg, rgba(0, 0, 0, 0.7), transparent 60%);
}

.an-hero-info {
	position: absolute;
	left: 28px;
	bottom: 26px;
	z-index: 2;
	max-width: 580px;
}

.an-hero-title {
	font-size: 1.8rem;
	font-weight: 700;
	color: #fff;
	text-shadow: 0 2px 12px rgba(0, 0, 0, 0.7);
}

.an-hero-overview {
	display: -webkit-box;
	margin-top: 8px;
	overflow: hidden;
	font-size: 0.86rem;
	line-height: 1.55;
	color: rgba(255, 255, 255, 0.85);
	text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
}

.an-hero-actions {
	margin-top: 14px;
}

.an-hero-btn {
	background: #b23a6b;
}

.an-hero-btn:hover {
	background: #c9497d;
}

.an-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 16px;
	padding: 20px 28px 40px;
}

.an-card {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 0;
	text-align: left;
	background: none;
	border: none;
	cursor: pointer;
	overflow: hidden;
	border-radius: var(--radius-sm);
}

.an-card-cover {
	width: 100%;
	aspect-ratio: 2 / 3;
	object-fit: cover;
	background: var(--surface-2);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	transition: transform var(--ease), border-color var(--ease), box-shadow var(--ease);
}

.an-card:hover .an-card-cover {
	border-color: #b23a6b;
	transform: translateY(-4px) scale(1.02);
	box-shadow: 0 8px 24px rgba(178, 58, 107, 0.3);
}

.an-card-meta {
	display: flex;
	flex-direction: column;
	gap: 3px;
	padding: 2px 0;
}

.an-card-title {
	overflow: hidden;
	font-size: 0.82rem;
	font-weight: 500;
	color: var(--text);
	text-overflow: ellipsis;
	white-space: nowrap;
}

.an-card-score {
	font-size: 0.74rem;
	color: #e08bab;
}

.an-empty {
	grid-column: 1 / -1;
	padding: 40px 0;
	font-size: 0.86rem;
	color: var(--text-faint);
	text-align: center;
}

.an-detail-modal {
	max-width: 640px;
}

.an-detail-panel {
	overflow: hidden;
	padding: 0;
}

.an-detail-banner {
	height: 140px;
	background-position: center;
	background-size: cover;
	border-radius: var(--radius) var(--radius) 0 0;
}

.an-detail-head {
	display: flex;
	gap: 16px;
	padding: 18px 20px 0;
}

.an-detail-cover {
	flex-shrink: 0;
	width: 92px;
	aspect-ratio: 2 / 3;
	object-fit: cover;
	margin-top: -46px;
	background: var(--surface-2);
	border: 2px solid var(--surface);
	border-radius: var(--radius-sm);
}

.an-detail-head h3 {
	font-size: 1.1rem;
	font-weight: 600;
	color: var(--text);
}

.an-detail-metarow {
	margin-top: 4px;
	font-size: 0.78rem;
	color: var(--text-faint);
}

.an-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 5px;
	margin-top: 8px;
}

.an-chip {
	padding: 3px 9px;
	font-size: 0.7rem;
	color: #e08bab;
	background: rgba(178, 58, 107, 0.14);
	border-radius: 99px;
}

.an-detail-desc {
	margin: 16px 20px 0;
	font-size: 0.84rem;
	line-height: 1.6;
	color: var(--text-dim);
}

.an-episode-head {
	margin: 18px 20px 0;
	font-size: 0.88rem;
	font-weight: 600;
	color: var(--text);
}

.an-episode-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
	gap: 6px;
	padding: 10px 20px 20px;
	max-height: 220px;
	overflow-y: auto;
}

.an-episode-btn {
	padding: 8px 0;
	font-family: inherit;
	font-size: 0.78rem;
	color: var(--text-dim);
	background: var(--surface-2);
	border: 1px solid var(--border);
	border-radius: var(--radius-xs);
	cursor: pointer;
	transition: all var(--ease);
}

.an-episode-btn:hover {
	color: #ffe8f1;
	background: #b23a6b;
	border-color: #b23a6b;
}

.an-player-wrap {
	padding: 0 20px 20px;
}

.an-player {
	width: 100%;
	max-height: 360px;
	background: #000;
	border-radius: var(--radius-sm);
}

.mv-shell {
	position: relative;
	height: 100%;
	overflow-y: auto;
	background: var(--bg-deep);
}

.mv-back {
	position: absolute;
	top: 16px;
	left: 20px;
	z-index: 5;
	padding: 5px 10px;
	background: rgba(0, 0, 0, 0.4);
	border-radius: 99px;
}

.mv-topbar {
	position: relative;
	z-index: 4;
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	align-items: center;
	justify-content: space-between;
	padding: 16px 28px;
}

.mv-wordmark {
	font-family: var(--font-script);
	font-size: 1.7rem;
	font-weight: 700;
	color: var(--text);
}

.mv-search {
	width: min(280px, 60vw);
}

.mv-hero {
	position: relative;
	height: 46vh;
	min-height: 260px;
	margin-top: -8px;
	overflow: hidden;
}

.mv-hero-backdrop {
	position: absolute;
	inset: 0;
	background-position: center 20%;
	background-size: cover;
}

.mv-hero::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(0deg, var(--bg-deep) 4%, transparent 55%), linear-gradient(90deg, rgba(0, 0, 0, 0.65), transparent 60%);
}

.mv-hero-info {
	position: absolute;
	right: 28px;
	bottom: 26px;
	left: 28px;
	z-index: 2;
	max-width: 560px;
}

.mv-hero-title {
	font-size: 1.9rem;
	font-weight: 700;
	color: #fff;
	text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}

.mv-hero-overview {
	display: -webkit-box;
	margin-top: 8px;
	overflow: hidden;
	font-size: 0.86rem;
	line-height: 1.55;
	color: rgba(255, 255, 255, 0.85);
	text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
}

.mv-hero-actions {
	margin-top: 14px;
}

.mv-key-note {
	margin: 20px 28px;
	padding: 14px 16px;
	font-size: 0.84rem;
	color: var(--text-dim);
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
}

.mv-key-note code {
	padding: 2px 5px;
	font-family: var(--font-mono);
	background: var(--surface-2);
	border-radius: 4px;
}

.mv-rows {
	display: flex;
	flex-direction: column;
	gap: 22px;
	padding: 10px 0 40px;
}

.mv-row-title {
	margin: 0 28px 10px;
	font-size: 1.02rem;
	font-weight: 600;
	color: var(--text);
}

.mv-row-track {
	display: flex;
	gap: 12px;
	padding: 0 28px 6px;
	overflow-x: auto;
}

.mv-card {
	display: flex;
	flex-direction: column;
	flex-shrink: 0;
	gap: 6px;
	width: 140px;
	padding: 0;
	text-align: left;
	background: none;
	border: none;
	cursor: pointer;
}

.mv-card-poster {
	width: 100%;
	aspect-ratio: 2 / 3;
	object-fit: cover;
	background: var(--surface-2);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	transition: transform var(--ease), border-color var(--ease);
}

.mv-card:hover .mv-card-poster {
	border-color: #d92a3d;
	transform: translateY(-4px) scale(1.03);
}

.mv-card-title {
	overflow: hidden;
	font-size: 0.78rem;
	color: var(--text-dim);
	text-overflow: ellipsis;
	white-space: nowrap;
}

.mv-detail-modal {
	max-width: 640px;
}

.mv-cast-chips .an-chip {
	color: var(--text-dim);
	background: var(--surface-2);
}

.mv-trailer-wrap {
	margin: 16px 20px 20px;
}

.mv-trailer-btn {
	background: #d92a3d;
}

.mv-trailer-frame {
	width: 100%;
	aspect-ratio: 16 / 9;
	border: none;
	border-radius: var(--radius-sm);
}

.ak-player-overlay {
	position: fixed;
	inset: 0;
	z-index: 800;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	background: rgba(0, 0, 0, 0.9);
	backdrop-filter: blur(4px);
}

.ak-player-close {
	position: absolute;
	top: 16px;
	right: 16px;
	z-index: 2;
	background: rgba(0, 0, 0, 0.6);
	border: 1px solid rgba(255, 255, 255, 0.15);
	color: #fff;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.ak-player-close:hover {
	background: rgba(217, 42, 61, 0.8);
	color: #fff;
}

.ak-player-frame {
	width: 100%;
	max-width: 1200px;
	height: 100%;
	max-height: 90vh;
	aspect-ratio: 16 / 9;
	border: none;
	border-radius: var(--radius-sm);
	background: #000;
	box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
}

.an-card-overlay {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: flex-end;
	padding: 8px;
	background: linear-gradient(0deg, rgba(0,0,0,0.85) 0%, transparent 50%);
	opacity: 0;
	transition: opacity var(--ease);
	border-radius: var(--radius-sm);
}

.an-card:hover .an-card-overlay {
	opacity: 1;
}

.an-card-sub {
	display: flex;
	gap: 8px;
	align-items: center;
	font-size: 0.72rem;
	color: rgba(255,255,255,0.8);
}

.an-grid-skeleton {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 16px;
	padding: 20px;
}

.an-grid-skeleton::before {
	content: "";
	grid-column: 1 / -1;
	height: 200px;
	background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface) 50%, var(--surface-2) 100%);
	background-size: 200% 100%;
	animation: an-shimmer 1.5s infinite;
	border-radius: var(--radius-sm);
}

.an-detail-skeleton {
	height: 300px;
	background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface) 50%, var(--surface-2) 100%);
	background-size: 200% 100%;
	animation: an-shimmer 1.5s infinite;
	border-radius: var(--radius-sm);
}

@keyframes an-shimmer {
	0% { background-position: 200% 0; }
	100% { background-position: -200% 0; }
}

.an-season-row {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding: 0 20px 12px;
}

.an-season-btn {
	min-width: 38px;
	padding: 6px 12px;
	font-size: 0.84rem;
	font-weight: 600;
	color: var(--text-dim);
	background: var(--surface-2);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	cursor: pointer;
	transition: all var(--ease);
}

.an-season-btn:hover {
	color: var(--text);
	border-color: var(--accent);
}

.an-season-btn.active {
	color: #fff;
	background: var(--accent);
	border-color: var(--accent);
}

.an-episode-btn-wide {
	display: flex;
	flex-direction: column;
	gap: 2px;
	width: 100%;
	padding: 8px 14px;
	text-align: left;
}

.an-ep-label {
	font-size: 0.78rem;
	font-weight: 600;
	color: var(--accent);
}

.an-ep-title {
	font-size: 0.82rem;
	color: var(--text-dim);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.mv-action-row {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
	margin: 16px 20px 20px;
}

.mv-play-btn {
	background: #d92a3d;
}

.mv-play-btn:hover {
	background: #b8202f;
}

.mv-hero-play {
	background: #fff;
	color: #000;
}

.mv-hero-play:hover {
	background: rgba(255, 255, 255, 0.85);
}

.mv-hero-info-btn {
	background: rgba(255, 255, 255, 0.25);
	color: #fff;
}

.mv-hero-info-btn:hover {
	background: rgba(255, 255, 255, 0.35);
}

@media (max-width: 760px) {
	#os-taskbar {
		gap: 3px;
		padding: 5px 7px;
	}

	.os-taskbar-clock {
		display: none;
	}

	.os-start-menu {
		width: 94vw;
	}
}

.an-watch,
.mv-watch {
	container-type: inline-size;
	display: flex;
	flex-direction: column;
	height: 100%;
	background: #000;
	color: #f2f2f2;
}

.aw-head {
	display: flex;
	flex-shrink: 0;
	align-items: center;
	gap: 14px;
	padding: 10px 16px;
	background: #0d0d0e;
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.aw-back {
	display: inline-flex;
	flex-shrink: 0;
	align-items: center;
	gap: 5px;
	padding: 6px 12px;
	font-family: inherit;
	font-size: 0.78rem;
	color: #cfcfcf;
	background: rgba(255, 255, 255, 0.06);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 99px;
	cursor: pointer;
	transition: background var(--ease), color var(--ease);
}

.aw-back:hover {
	color: #fff;
	background: rgba(255, 255, 255, 0.12);
}

.aw-head-title {
	overflow: hidden;
	font-size: 0.82rem;
	font-weight: 600;
	color: #a8a8a8;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.aw-body {
	display: flex;
	flex: 1;
	min-height: 0;
}

.mw-body {
	flex: 1;
	min-height: 0;
	overflow-y: auto;
}

.aw-player-col {
	display: flex;
	flex: 1;
	min-width: 0;
	flex-direction: column;
	overflow-y: auto;
}

.aw-player-wrap {
	position: relative;
	flex-shrink: 0;
	width: 100%;
	aspect-ratio: 16 / 9;
	background: #000;
}

.aw-player-frame {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: none;
}

.aw-info {
	padding: 18px 22px 30px;
}

.mw-info {
	max-width: 860px;
}

.aw-title {
	margin: 0 0 12px;
	font-size: 1.15rem;
	font-weight: 700;
	color: #fff;
}

.aw-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 14px;
}

.aw-action-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 7px 13px;
	font-family: inherit;
	font-size: 0.76rem;
	font-weight: 600;
	color: #d6d6d6;
	text-decoration: none;
	background: #17171a;
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: var(--radius-xs);
	cursor: pointer;
	transition: background var(--ease), color var(--ease), border-color var(--ease);
}

.aw-action-btn:hover {
	color: #fff;
	background: #232327;
	border-color: rgba(255, 255, 255, 0.16);
}

.aw-action-btn.copied {
	color: var(--accent);
	border-color: var(--accent-line);
}

.aw-desc {
	max-width: 780px;
	margin: 0;
	overflow: hidden;
	font-size: 0.85rem;
	line-height: 1.6;
	color: #b3b3b3;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.aw-desc.expanded {
	-webkit-line-clamp: unset;
}

.aw-desc-more {
	padding: 0;
	margin-top: 4px;
	font-family: inherit;
	font-size: 0.78rem;
	font-weight: 600;
	color: var(--accent);
	background: none;
	border: none;
	cursor: pointer;
}

.aw-modebox {
	max-width: 780px;
	margin-top: 20px;
	padding: 14px 16px;
	background: #111113;
	border: 1px solid rgba(255, 255, 255, 0.07);
	border-radius: var(--radius-sm);
}

.aw-mode-row {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.aw-mode-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 14px;
	font-family: inherit;
	font-size: 0.78rem;
	font-weight: 600;
	color: #c2c2c2;
	background: #1c1c20;
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: var(--radius-xs);
	cursor: pointer;
	transition: background var(--ease), color var(--ease);
}

.aw-mode-btn:hover {
	color: #fff;
	background: #26262b;
}

.aw-mode-btn.active {
	color: var(--accent-contrast);
	background: var(--accent);
	border-color: var(--accent);
}

.aw-mode-note {
	margin: 10px 0 0;
	font-size: 0.74rem;
	color: var(--text-faint);
}

.aw-server-row {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 12px;
}

.aw-server-btn {
	padding: 7px 13px;
	font-family: inherit;
	font-size: 0.76rem;
	color: #b3b3b3;
	background: #17171a;
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 99px;
	cursor: pointer;
	transition: background var(--ease), color var(--ease), border-color var(--ease);
}

.aw-server-btn:hover {
	color: #fff;
	border-color: rgba(255, 255, 255, 0.2);
}

.aw-server-btn.active {
	color: var(--accent-contrast);
	background: var(--accent);
	border-color: var(--accent);
}

.aw-episodes-col {
	display: flex;
	flex-direction: column;
	flex-shrink: 0;
	width: 340px;
	min-height: 0;
	background: #0a0a0b;
	border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.aw-ep-head {
	display: flex;
	flex-shrink: 0;
	align-items: center;
	gap: 8px;
	padding: 14px 14px 10px;
}

.aw-ep-head h3 {
	flex: 1;
	margin: 0;
	font-size: 0.95rem;
	font-weight: 700;
	color: #fff;
}

.aw-ep-icon-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	color: #9a9a9a;
	background: none;
	border: none;
	border-radius: var(--radius-xs);
	cursor: pointer;
	transition: background var(--ease), color var(--ease);
}

.aw-ep-icon-btn:hover {
	color: #fff;
	background: rgba(255, 255, 255, 0.08);
}

.aw-ep-icon-btn.active {
	color: var(--accent);
}

.aw-ep-search-wrap {
	position: relative;
	flex-shrink: 0;
	padding: 0 14px 10px;
}

.aw-ep-search-wrap svg {
	position: absolute;
	top: 50%;
	left: 24px;
	color: #6b6b6b;
	transform: translateY(-50%);
	pointer-events: none;
}

.aw-ep-search {
	width: 100%;
	padding: 8px 12px 8px 32px;
	font-family: inherit;
	font-size: 0.8rem;
	color: #f2f2f2;
	background: #17171a;
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: var(--radius-xs);
	outline: none;
}

.aw-ep-search:focus {
	border-color: var(--accent-line);
}

.aw-ep-list {
	flex: 1;
	min-height: 0;
	padding: 4px 10px 14px;
	overflow-y: auto;
}

.aw-ep-row {
	display: flex;
	width: 100%;
	gap: 10px;
	padding: 8px;
	margin-bottom: 4px;
	text-align: left;
	background: none;
	border: none;
	border-radius: var(--radius-xs);
	cursor: pointer;
	transition: background var(--ease);
}

.aw-ep-row:hover {
	background: rgba(255, 255, 255, 0.05);
}

.aw-ep-row.active {
	background: rgba(180, 150, 220, 0.1);
}

.aw-ep-thumb {
	position: relative;
	flex-shrink: 0;
	width: 92px;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: #1a1a1c;
	border-radius: 5px;
}

.aw-ep-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.aw-ep-thumb-play {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.45);
}

.aw-ep-row:not(.active) .aw-ep-thumb-play {
	display: none;
}

.aw-ep-badges {
	position: absolute;
	top: 3px;
	right: 3px;
	display: flex;
	gap: 3px;
}

.aw-ep-badge {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 16px;
	height: 16px;
	color: #fff;
	background: rgba(0, 0, 0, 0.6);
	border-radius: 3px;
}

.aw-ep-badge svg {
	width: 10px;
	height: 10px;
}

.aw-ep-meta {
	flex: 1;
	min-width: 0;
}

.aw-ep-title-row {
	display: flex;
	align-items: baseline;
	gap: 6px;
	font-size: 0.82rem;
	font-weight: 700;
	color: #fff;
}

.aw-ep-row.active .aw-ep-title-row {
	color: var(--accent);
}

.aw-ep-desc {
	display: -webkit-box;
	margin-top: 3px;
	overflow: hidden;
	font-size: 0.72rem;
	line-height: 1.45;
	color: #8c8c8c;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.aw-ep-empty {
	padding: 30px 12px;
	font-size: 0.8rem;
	color: var(--text-faint);
	text-align: center;
}

@container (max-width: 760px) {
	.aw-body {
		flex-direction: column;
	}

	.aw-episodes-col {
		width: 100%;
		max-height: 280px;
		border-top: 1px solid rgba(255, 255, 255, 0.08);
		border-left: none;
	}
}

.cl-shell {
	height: 100%;
	overflow-y: auto;
	background: var(--bg-deep);
}

.cl-head {
	position: sticky;
	top: 0;
	z-index: 2;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 18px 24px;
	background: var(--bg-deep);
	border-bottom: 1px solid var(--border);
}

.cl-head .page-title {
	flex: 1;
	margin: 0;
}

.cl-body {
	padding: 6px 24px 32px;
}

.cl-entry {
	padding: 16px 0;
	border-bottom: 1px solid var(--border);
}

.cl-entry:last-child {
	border-bottom: none;
}

.cl-entry-title {
	font-size: 0.7rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--text-faint);
}

.cl-entry-new .cl-entry-title {
	color: var(--accent);
}

.cl-entry-item {
	margin-top: 8px;
	font-size: 0.88rem;
	line-height: 1.55;
	color: var(--text-dim);
}

.cl-empty {
	padding: 40px 0;
	font-size: 0.86rem;
	color: var(--text-faint);
	text-align: center;
}
