/* ——— San Francisco (1984) — self‑hosted ——— */
@font-face {
	font-family: "San Francisco 1984";
	src: url("./assets/fonts/SF1984-Regular.woff2") format("woff2"),
		url("./assets/fonts/SF1984-Regular.woff") format("woff");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

:root {
	--bg: #0e243e;
	--panel: #121a2a;
	--muted: #7e8aa3;
	--fg: #eef3ff;
	--card: #111d2e;
	--muted: #9fb0c8;
	--text: #eaf0fb;
}
* {
	box-sizing: border-box;
}
html,
body {
	height: 100%;
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--fg);
	font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
	/* display: grid;
	grid-template-columns: 340px 1fr;
	grid-template-rows: auto 1fr;
	grid-template-areas: "header header" "sidebar main";
	gap: 10px; */
	padding: 10px;
}

#app {
	height: 100%;
	width: 100%;
	display: grid;
	grid-template-columns: 340px 1fr;
	grid-template-rows: auto 1fr;
	grid-template-areas: "header header" "sidebar main";
	gap: 10px;
	padding: 10px;
	display: none;
}

header {
	grid-area: header;
	/* background: linear-gradient(
		90deg,
		rgba(110, 231, 183, 0.06),
		rgba(147, 197, 253, 0.06)
	); */
	/* border: 1px solid rgba(255, 255, 255, 0.06); */
	border-radius: 14px;
	padding: 10px 14px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	max-height: 80px !important;
}
header h1 {
	font-size: 16px;
	margin: 0 0 10px;
	letter-spacing: 0.3px;
	font-weight: 600;
}

.card {
	margin: calc(100vh / 6) auto 0;
	width: min(460px, 92vw);
	background: var(--card);
	padding: 24px;
	border-radius: 16px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.logo {
	width: 160px;
}

.sidebar {
	grid-area: sidebar;
	background: var(--panel);
	border: 1px solid rgba(255, 255, 255, 0.06);
	border-radius: 14px;
	padding: 14px;
	overflow: auto;
	-ms-overflow-style: none; /* IE and Edge */
	scrollbar-width: none; /* Firefox */
}

.sidebar::-webkit-scrollbar {
	display: none;
}

.main {
	grid-area: main;
	background: var(--panel);
	border: 1px solid rgba(255, 255, 255, 0.06);
	border-radius: 14px;
	padding: 14px;
	display: grid;
	grid-template-rows: 1fr auto;
	gap: 10px;
	min-height: 0;
}
.stage-wrap {
	position: relative;
	background: repeating-conic-gradient(
			from 45deg,
			#101b30 0% 25%,
			#0b1424 0% 50%
		)
		50%/24px 24px;
	border-radius: 12px;
	border: 1px dashed rgba(255, 255, 255, 0.08);
	display: grid;
	place-items: center;
	min-height: 300px;
	height: calc(100vh - 190px);
	overflow: hidden;
}
.stage-label {
	position: absolute;
	top: 10px;
	left: 10px;
	font-size: 12px;
	color: var(--muted);
	background: rgba(0, 0, 0, 0.35);
	padding: 4px 8px;
	border-radius: 999px;
	border: 1px solid rgba(255, 255, 255, 0.06);
}
.group {
	margin-bottom: 16px;
}
.group h3 {
	margin: 12px 0 8px;
	font-size: 13px;
	color: var(--muted);
	font-weight: 600;
}
label {
	display: block;
	font-size: 13px;
	margin: 8px 0 4px;
	color: #cfd7ea;
}
input,
select,
textarea,
button {
	width: 100%;
	padding: 10px;
	border-radius: 10px;
	border: 1px solid rgba(255, 255, 255, 0.08);
	background: #0c1424;
	color: #eaf1ff;
}
input[type="range"] {
	padding: 0;
}
input[type="color"] {
	height: 40px;
	padding: 4px;
}
input[type="email"] {
	height: 50px;
	padding: 10px;
	margin-bottom: 10px;
}
textarea {
	resize: vertical;
	min-height: 70px;
}
button {
	cursor: pointer;
	background: linear-gradient(180deg, #1b2a45, #121a2a);
	border: 1px solid rgba(255, 255, 255, 0.08);
}
button.primary {
	background: linear-gradient(180deg, #1b3a2f, #0f2a22);
	border-color: rgba(110, 231, 183, 0.35);
}
.footer-bar {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: center;
}
.btns {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}
.hint {
	font-size: 12px;
	color: var(--muted);
}
.divider {
	height: 1px;
	background: rgba(255, 255, 255, 0.06);
	margin: 10px 0;
	border-radius: 2px;
}
.pill {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 10px;
	font-size: 12px;
	border-radius: 999px;
	border: 1px solid rgba(255, 255, 255, 0.08);
	background: #0c1424;
}
.grid-2 {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
}
.grid-3 {
	display: grid;
	grid-template-columns: 1fr 1fr 1fr;
	gap: 8px;
}

/* Canvas fitting */
#canvasHost {
	position: relative;
	width: 100%;
	height: 100%;
}
#canvasHost canvas {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%) scale(1);
	transform-origin: center center;
	width: auto;
	height: auto;
	display: block;
}

/* Layers UI */
.layer-card {
	background: #0b1424;
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 12px;
	padding: 12px;
	margin-top: 10px;
}
.layer-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 6px;
}
.layer-head .small-btns {
	display: flex;
	gap: 6px;
}
.layer-head button {
	padding: 6px 8px;
}

.record-overlay {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.35);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.18s ease;
}
.record-overlay.show {
	opacity: 1;
}

.record-pill {
	display: flex;
	align-items: center;
	gap: 10px;
	background: rgba(12, 20, 36, 0.9);
	border: 1px solid rgba(255, 255, 255, 0.12);
	padding: 10px 14px;
	border-radius: 999px;
	font-weight: 600;
	color: #eef3ff;
}

.spinner {
	width: 18px;
	height: 18px;
	border-radius: 50%;
	border: 3px solid rgba(255, 255, 255, 0.25);
	border-top-color: #fff;
	animation: spin 0.9s linear infinite;
}

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

/* button {
	padding: 12px 16px;
	border: 0;
	border-radius: 12px;
	background: #2563eb;
	color: white;
	cursor: pointer;
	font-weight: 600;
} */
button[disabled] {
	opacity: 0.65;
	cursor: progress;
}
.msg {
	margin-top: 10px;
	font-size: 0.95rem;
	min-height: 1.2em;
}
.ok {
	color: #86efac;
}
.err {
	color: #fca5a5;
}

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

.icon-btn {
	position: relative;
	width: 36px;
	height: 36px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 999px;
	background: linear-gradient(180deg, #1b2a45, #121a2a);
	border: 1px solid rgba(255, 255, 255, 0.12);
	color: var(--text);
	text-decoration: none;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
	transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
}
.icon-btn:hover,
.icon-btn:focus-visible {
	transform: translateY(-1px);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.icon-btn:active {
	transform: translateY(0);
}

/* tiny tooltip */
.icon-btn[data-tooltip]::after {
	content: attr(data-tooltip);
	position: absolute;
	bottom: -34px;
	left: 50%;
	transform: translateX(-50%) scale(0.95);
	background: #0c1424;
	border: 1px solid rgba(255, 255, 255, 0.12);
	color: var(--text);
	font-size: 12px;
	padding: 6px 8px;
	border-radius: 8px;
	white-space: nowrap;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.12s ease, transform 0.12s ease;
}
.icon-btn:hover::after,
.icon-btn:focus-visible::after {
	opacity: 1;
	transform: translateX(-50%) scale(1);
}

.fab-feedback {
	position: fixed;
	right: 16px;
	top: 36px;
	z-index: 1000;
	display: inline-flex;
	align-items: center;
	padding: 10px 14px;
	border-radius: 999px;
	background: linear-gradient(180deg, #1b2a45, #121a2a);
	border: 1px solid rgba(255, 255, 255, 0.12);
	color: var(--text);
	text-decoration: none;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.fab-feedback:hover,
.fab-feedback:focus-visible {
	transform: translateY(-1px);
	box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
}
