/* UCE Test Suite — Theme
   Color palette: deep blue gradient · warm gold accents · frosted glass surfaces */
@font-face {
	font-family: 'default_sans';
	src: url('../examples/uce-starter/themes/common/fonts/b612/b612-regular.ttf') format('truetype');
	font-style: normal;
	font-weight: 400;
	font-display: swap;
}
@font-face {
	font-family: 'default_sans';
	src: url('../examples/uce-starter/themes/common/fonts/b612/b612-bold.ttf') format('truetype');
	font-style: normal;
	font-weight: 700;
	font-display: swap;
}
@font-face {
	font-family: 'default_mono';
	src: url('../examples/uce-starter/themes/common/fonts/b612/b612-mono-regular.ttf') format('truetype');
	font-style: normal;
	font-weight: 400;
	font-display: swap;
}
@font-face {
	font-family: 'default_mono';
	src: url('../examples/uce-starter/themes/common/fonts/b612/b612-mono-bold.ttf') format('truetype');
	font-style: normal;
	font-weight: 700;
	font-display: swap;
}

:root {
	--bg: #113399;
	--bg-grad: linear-gradient(168deg, #1a3daa 0%, #113399 40%, #0d2880 100%);
	--bg-surface: rgba(255, 255, 255, 0.05);
	--bg-surface-hover: rgba(255, 255, 255, 0.09);
	--bg-inset: rgba(0, 0, 0, 0.28);
	--bg-code: rgba(0, 0, 0, 0.3);
	--text: #dfe5f2;
	--text-dim: rgba(200, 210, 235, 0.6);
	--text-muted: rgba(200, 210, 235, 0.35);
	--accent: #f0c430;
	--accent-dim: rgba(240, 196, 48, 0.08);
	--accent-hover: #ffd95c;
	--accent-glow: rgba(240, 196, 48, 0.15);
	--border: rgba(255, 255, 255, 0.06);
	--border-strong: rgba(255, 255, 255, 0.14);
	--shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
	--shadow-md: 0 4px 16px rgba(0, 0, 0, 0.25);
	--font-sans: 'default_sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
	--font-mono: 'default_mono', 'SF Mono', 'Cascadia Code', 'Fira Code', Consolas, monospace;
	--radius: 10px;
	--radius-lg: 16px;
	--ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset ── */

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

* {
	font-family: inherit;
	font-size: inherit;
	color: inherit;
	line-height: inherit;
}

/* ── Base ── */

html {
	font-size: 15px;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

body {
	max-width: 1100px;
	margin: 0 auto;
	padding: 0 24px 64px;
	font-family: var(--font-sans);
	font-size: 1rem;
	line-height: 1.65;
	background: var(--bg-grad);
	background-attachment: fixed;
	color: var(--text);
	min-height: 100vh;
}

/* ── Typography ── */

h1 {
	font-family: var(--font-mono);
	font-size: 1.6rem;
	font-weight: 700;
	letter-spacing: -0.02em;
	padding: 32px 0 20px;
	border-bottom: 2px solid transparent;
	border-image: linear-gradient(90deg, var(--accent) 0%, rgba(240, 196, 48, 0.15) 100%) 1;
	margin-bottom: 28px;
}

h1 a {
	text-decoration: none;
	color: var(--text);
	transition: color 150ms var(--ease);
}

h1 a:hover {
	color: var(--accent);
}

h2 {
	font-family: var(--font-mono);
	font-size: 1.15rem;
	font-weight: 600;
	letter-spacing: -0.01em;
	margin: 24px 0 16px;
	padding-bottom: 8px;
	border-bottom: 1px solid var(--border);
	color: var(--text-dim);
}

h3 {
	font-family: var(--font-mono);
	font-size: 0.82rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--text-dim);
	margin: 0 0 10px;
}

a {
	color: var(--accent);
	text-decoration: none;
	transition: color 150ms var(--ease);
}

a:hover {
	color: var(--accent-hover);
	text-decoration: underline;
	text-underline-offset: 2px;
}

/* ── Page sections ── */

body > section,
body > div:not(.test-grid):not(.system-info):not(.grid-heading),
body > p {
	background: var(--bg-surface);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 20px 24px;
	margin-bottom: 16px;
	box-shadow: var(--shadow-sm);
}

/* ── Test Card Grid ── */

.test-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 10px;
	margin-bottom: 24px;
}

.test-card {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 16px 20px;
	background: var(--bg-surface);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	text-decoration: none;
	color: var(--text);
	box-shadow: var(--shadow-sm);
	transition: all 200ms var(--ease);
}

.test-card:hover {
	background: var(--bg-surface-hover);
	border-color: var(--border-strong);
	text-decoration: none;
	transform: translateY(-2px);
	box-shadow: var(--shadow-md);
}

.test-card strong {
	font-family: var(--font-mono);
	font-size: 0.92rem;
	color: var(--accent);
}

.test-card span {
	font-size: 0.82rem;
	color: var(--text-dim);
	line-height: 1.4;
}

.grid-heading {
	grid-column: 1 / -1;
	font-family: var(--font-mono);
	font-size: 0.72rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--text-muted);
	margin: 0;
	padding: 14px 0 2px;
	border: none;
	background: none;
}

.grid-heading:first-child {
	padding-top: 0;
}

.docs-link {
	float: right;
	font-size: 0.55em;
	font-weight: 400;
	opacity: 0.5;
	transition: opacity 150ms var(--ease);
}

.docs-link:hover {
	opacity: 1;
}

.dim {
	opacity: 0.4;
}

/* ── Forms ── */

form > div, label {
	display: block;
	padding: 6px 0;
}

label {
	font-size: 0.88rem;
	font-weight: 600;
	color: var(--text-dim);
}

input, textarea, select {
	background: var(--bg-inset);
	border: 1px solid var(--border-strong);
	border-radius: 6px;
	color: var(--text);
	font-family: var(--font-sans);
	transition: border-color 150ms var(--ease), background 150ms var(--ease);
}

input[type=text], textarea {
	padding: 10px 14px;
	width: 100%;
}

input[type=text]:hover, textarea:hover,
input[type=text]:focus, textarea:focus {
	border-color: var(--accent);
	outline: none;
	background: rgba(0, 0, 0, 0.28);
}

input[type=submit], button {
	padding: 10px 20px;
	font-weight: 600;
	cursor: pointer;
	background: var(--accent-dim);
	border: 1px solid rgba(255, 214, 68, 0.25);
	color: var(--accent);
	border-radius: 6px;
}

input[type=submit]:hover, button:hover {
	background: rgba(255, 214, 68, 0.2);
	border-color: var(--accent);
	color: var(--accent-hover);
}

textarea {
	min-height: 120px;
	resize: vertical;
}

/* ── Code / Output ── */

pre {
	padding: 16px 20px;
	overflow: auto;
	background: var(--bg-code);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	font-family: var(--font-mono);
	font-size: 0.85rem;
	line-height: 1.6;
	white-space: pre-wrap;
	box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.12);
}

code {
	font-family: var(--font-mono);
	font-size: 0.9em;
	padding: 2px 6px;
	background: var(--bg-inset);
	border-radius: 4px;
}

pre code {
	padding: 0;
	background: none;
}

/* ── Lists ── */

ul {
	list-style: none;
	padding: 0;
}

li {
	padding: 4px 0;
}

li a {
	font-family: var(--font-mono);
	font-size: 0.92rem;
}

/* ── System Info ── */

.system-info {
	margin-top: 32px;
	padding: 16px 20px;
	background: var(--bg-code);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow-sm);
}

.system-info h3 {
	margin-bottom: 12px;
}

.system-info pre {
	border: none;
	padding: 0;
	background: transparent;
	margin: 0;
	font-size: 0.82rem;
}

/* ── Details / Summary ── */

details {
	background: var(--bg-surface);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	margin-bottom: 16px;
	box-shadow: var(--shadow-sm);
}

summary {
	padding: 14px 20px;
	cursor: pointer;
	font-weight: 600;
	user-select: none;
	transition: color 150ms var(--ease);
}

summary:hover {
	color: var(--accent);
}

details[open] summary {
	border-bottom: 1px solid var(--border);
}

details pre {
	border: none;
	border-radius: 0 0 var(--radius) var(--radius);
	margin: 0;
}

/* ── Sections (markdown, etc.) ── */

section {
	margin-bottom: 16px;
}

section h2 {
	border-bottom: none;
	margin: 0 0 12px;
	padding: 0;
}

/* ── Unit Browser ── */

.unit-toolbar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
	margin-bottom: 16px;
}

.unit-toolbar p {
	margin: 0;
	color: var(--text-dim);
}

.unit-count {
	font-family: var(--font-mono);
	font-size: 0.82rem;
	color: var(--text-dim);
	padding: 6px 10px;
	background: var(--bg-code);
	border: 1px solid var(--border);
	border-radius: 999px;
}

.status-badge {
	display: inline-flex;
	align-items: center;
	padding: 4px 10px;
	border-radius: 999px;
	font-family: var(--font-mono);
	font-size: 0.72rem;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	border: 1px solid var(--border);
	background: var(--bg-code);
	white-space: nowrap;
}

.status-ok {
	color: #9ff0b3;
	border-color: rgba(159, 240, 179, 0.25);
	background: rgba(38, 105, 58, 0.22);
}

.status-warn {
	color: #ffd97a;
	border-color: rgba(255, 217, 122, 0.26);
	background: rgba(120, 88, 22, 0.25);
}

.status-error {
	color: #ff9e9e;
	border-color: rgba(255, 158, 158, 0.3);
	background: rgba(122, 34, 34, 0.28);
}

.status-muted {
	color: var(--text-dim);
	border-color: var(--border);
	background: var(--bg-code);
}

.unit-browser-layout {
	display: grid;
	grid-template-columns: minmax(250px, 320px) minmax(0, 1fr);
	gap: 18px;
	align-items: start;
}

.unit-sidebar,
.unit-detail-pane {
	min-width: 0;
}

.unit-sidebar-header,
.unit-detail-header {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 12px;
	margin-bottom: 14px;
}

.unit-sidebar-header h2,
.unit-detail-pane h2,
.unit-detail-header h3 {
	margin: 0;
}

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

.unit-list-item {
	display: block;
	text-decoration: none;
}

.unit-list-item:hover {
	text-decoration: none;
	background: rgba(255, 255, 255, 0.05);
}

.unit-list-item.is-selected {
	border-color: rgba(240, 196, 48, 0.32);
	background: rgba(240, 196, 48, 0.08);
	box-shadow: 0 0 0 1px rgba(240, 196, 48, 0.08), var(--shadow-sm);
}

.unit-list-title-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 10px;
	margin-bottom: 6px;
}

.unit-list-title-row strong {
	font-family: var(--font-mono);
	font-size: 0.78rem;
	color: var(--text);
	word-break: break-word;
}

.unit-list-path {
	font-family: var(--font-mono);
	font-size: 0.72rem;
	color: var(--text-muted);
	word-break: break-word;
	margin-bottom: 6px;
	line-height: 1.45;
}

.unit-list-meta {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	font-size: 0.74rem;
	color: var(--text-dim);
}

.unit-list-meta span {
	padding: 2px 6px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid rgba(255, 255, 255, 0.05);
}

.unit-list-error {
	margin-top: 8px;
	font-size: 0.74rem;
	color: #ffb7b7;
	line-height: 1.4;
}

.unit-actions {
	display: flex;
	gap: 10px;
	align-items: center;
	flex-wrap: wrap;
}

.unit-actions a {
	font-size: 0.82rem;
	font-family: var(--font-mono);
}

.unit-detail-path {
	margin: 6px 0 0;
	color: var(--text-dim);
}

.detail-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 12px;
	margin-bottom: 16px;
}

.detail-card {
	padding: 16px 18px;
	background: var(--bg-code);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow-sm);
}

.detail-card strong {
	display: block;
	font-family: var(--font-mono);
	font-size: 0.74rem;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--text-muted);
	margin-bottom: 8px;
}

.detail-card span,
.detail-card code {
	font-size: 0.88rem;
	word-break: break-word;
}

@media (max-width: 920px) {
	.unit-browser-layout {
		grid-template-columns: 1fr;
	}

	.unit-sidebar-header,
	.unit-detail-header {
		flex-direction: column;
	}
}

/* ── Scrollbar ── */

::-webkit-scrollbar {
	width: 8px;
	height: 8px;
}

::-webkit-scrollbar-track {
	background: transparent;
}

::-webkit-scrollbar-thumb {
	background: rgba(255, 255, 255, 0.15);
	border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
	background: rgba(255, 255, 255, 0.25);
}
