/* Fontxsis LITE — tablet shell; icons + chrome match Fontxsis Glyphs Builder (copied styles) */

:root {
	--fx-bg: #0b0d0f;
	--fx-bg-panel: #111318;
	--fx-bg-soft: #171a20;
	--fx-bg-rail: #111318;
	--fx-bg-card: #0b0d0f;
	--fx-bg-card-hover: #151820;

	/* Accent = light gray / white (no blue) */
	--fx-blue: #e5e7eb;
	--fx-blue-hover: #ffffff;
	--fx-blue-soft: rgba(255, 255, 255, 0.16);
	--fx-blue-tint: rgba(255, 255, 255, 0.22);
	--fx-blue-ring: rgba(255, 255, 255, 0.4);
	--fx-on-blue: #0b0d0f;

	--fx-text: #ffffff;
	--fx-text-secondary: rgba(255, 255, 255, 0.65);
	--fx-text-muted: rgba(255, 255, 255, 0.42);
	--fx-text-faint: rgba(255, 255, 255, 0.32);

	--fx-border: rgba(255, 255, 255, 0.08);
	--fx-border-strong: rgba(255, 255, 255, 0.14);
	--fx-shadow-panel: 0 12px 32px rgba(0, 0, 0, 0.28);

	--fx-radius-sm: 4px;
	--fx-radius: 6px;
	--fx-radius-lg: 8px;
	--fx-font: "Roboto", "Segoe UI", system-ui, sans-serif;

	--lite-top-h: 48px;
	--lite-rail-w: 50px;
	--lite-panel-w: 220px;
	--lite-dock-w: 52px;
	--lite-draw-w: min(560px, 46vw, 72vh);
	--lite-controls-w: min(240px, 20vw);
	--lite-glyphs-w: min(280px, 28vw);
	--lite-danger: #f07178;
	--lite-canvas-bg: #050607;
	--lite-ink: #f9fafb;
	--lite-line-rule: rgba(255, 255, 255, 0.09);
	/* Overridden by JS (visualViewport) for accurate iPad / Home Screen height */
	--lite-app-height: 100dvh;

	color-scheme: dark;
}

/* Light theme — monochrome (no blue) */
html[data-fx-theme='light'] {
	--fx-bg: #f4f4f5;
	--fx-bg-panel: #ffffff;
	--fx-bg-soft: #ececee;
	--fx-bg-rail: #f0f0f2;
	--fx-bg-card: #ffffff;
	--fx-bg-card-hover: #e8e8ea;

	--fx-blue: #1a1a1a;
	--fx-blue-hover: #000000;
	--fx-blue-soft: rgba(0, 0, 0, 0.1);
	--fx-blue-tint: rgba(0, 0, 0, 0.14);
	--fx-blue-ring: rgba(0, 0, 0, 0.28);
	--fx-on-blue: #ffffff;

	--fx-text: #111113;
	--fx-text-secondary: rgba(17, 17, 19, 0.68);
	--fx-text-muted: rgba(17, 17, 19, 0.48);
	--fx-text-faint: rgba(17, 17, 19, 0.36);

	--fx-border: rgba(0, 0, 0, 0.08);
	--fx-border-strong: rgba(0, 0, 0, 0.14);
	--fx-shadow-panel: 0 12px 32px rgba(0, 0, 0, 0.12);

	--lite-danger: #c9444c;
	--lite-canvas-bg: #fafafa;
	--lite-ink: #111113;
	--lite-line-rule: rgba(17, 17, 19, 0.12);

	color-scheme: light;
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	margin: 0;
	height: var(--lite-app-height, 100%);
	min-height: var(--lite-app-height, 100%);
	min-height: -webkit-fill-available;
	font-family: var(--fx-font);
	-webkit-tap-highlight-color: transparent;
	touch-action: manipulation;
	overflow: hidden;
}

body {
	margin: 0;
	height: inherit;
	min-height: inherit;
	font-family: inherit;
	-webkit-tap-highlight-color: transparent;
	touch-action: manipulation;
	overflow: hidden;
}

body.lite-stage-page {
	position: fixed;
	inset: 0;
	width: 100%;
	max-width: 100%;
	height: var(--lite-app-height, 100%);
	min-height: var(--lite-app-height, 100%);
	max-height: var(--lite-app-height, 100%);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background: var(--fx-bg);
	color: var(--fx-text);
	padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px)
		env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
	box-sizing: border-box;
}

@supports (height: 100dvh) {
	:root {
		--lite-app-height: 100dvh;
	}
}

@supports (height: 100svh) {
	:root {
		--lite-app-height: 100svh;
	}
}

.visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	border: 0;
}

.lite-app {
	position: relative;
	flex: 1;
	width: 100%;
	max-width: 100%;
	height: 100%;
	min-height: 0;
	display: flex;
	flex-direction: column;
	background: var(--fx-bg);
	overflow: hidden;
}

/* ——— Top bar (Fontxsis surfaces) ——— */
.lite-top {
	height: var(--lite-top-h);
	flex: 0 0 auto;
	display: grid;
	grid-template-columns: auto minmax(120px, 200px) 1fr;
	align-items: center;
	gap: 0.85rem;
	padding: 0 0.85rem 0 0.75rem;
	border-bottom: 1px solid var(--fx-border);
	background: rgba(17, 19, 24, 0.94);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
}

.lite-top__brand {
	display: flex;
	align-items: center;
	gap: 0.55rem;
	min-width: 0;
}

.lite-top__mark {
	width: 26px;
	height: 26px;
	display: block;
	flex: none;
	object-fit: contain;
	border-radius: 6px;
	filter: none;
}

.lite-top__titles {
	display: flex;
	align-items: baseline;
	gap: 0.35rem;
	line-height: 1;
}

.lite-top__name {
	font-weight: 700;
	font-size: 1.15rem;
	letter-spacing: -0.02em;
}

.lite-top__lite {
	font-weight: 700;
	font-size: 0.65rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--fx-blue-hover);
}

.lite-top__fontname input {
	width: 100%;
	height: 36px;
	border: 1px solid var(--fx-border);
	border-radius: var(--fx-radius-sm);
	background: var(--fx-bg-soft);
	color: var(--fx-text);
	padding: 0 0.7rem;
	font: 500 0.9rem/1 var(--fx-font);
}

.lite-top__fontname input:focus {
	outline: none;
	border-color: var(--fx-blue);
	box-shadow: 0 0 0 3px var(--fx-blue-soft);
}

/* Full-width font preview under header (Fontxsis fx-font-preview) */
.lite-font-preview {
	flex: 0 0 auto;
	width: 100%;
	border-bottom: 1px solid var(--fx-border);
	background: var(--fx-bg);
	z-index: 2;
}

.lite-font-preview__body {
	display: flex;
	align-items: stretch;
	width: 100%;
	height: var(--lite-preview-h, 88px);
	min-height: 64px;
	background: #0e0e10;
	color: #f5f5f5;
	font-family: "FontxsisLitePreview", var(--fx-font);
	font-synthesis: none;
}

.lite-font-preview__rail {
	flex: 0 0 22px;
	display: flex;
	align-items: center;
	justify-content: center;
	writing-mode: vertical-rl;
	transform: rotate(180deg);
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.45);
	border-right: 1px solid rgba(255, 255, 255, 0.08);
	user-select: none;
}

.lite-font-preview__stage {
	flex: 1;
	min-width: 0;
	padding: 10px 16px;
	overflow: auto;
	outline: none;
	caret-color: #e5e7eb;
	color: #ffffff;
	font-family: var(--fx-font);
	font-weight: 400;
	font-synthesis: none;
	font-size: clamp(1.75rem, 4.5vw, 2.75rem);
	line-height: 1.2;
	letter-spacing: 0;
	text-align: left;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
	word-break: break-word;
	font-kerning: normal;
	cursor: text;
}

.lite-font-preview__stage .lite-preview-ink {
	color: var(--fx-text);
	font-family: "FontxsisLitePreview", var(--fx-font);
	font-weight: 400;
	font-kerning: normal;
}

.lite-font-preview__stage .lite-preview-ghost {
	color: var(--fx-text-faint);
	font-family: var(--fx-font);
	font-weight: 400;
}

.lite-font-preview__stage:empty::before {
	content: attr(data-placeholder);
	color: rgba(255, 255, 255, 0.35);
	font-family: var(--fx-font);
	font-size: 16px;
	font-weight: 500;
	letter-spacing: 0;
	pointer-events: none;
}

.lite-top__actions {
	display: flex;
	align-items: center;
	gap: 0.45rem;
	justify-self: end;
}

.lite-theme-toggle {
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 1px solid var(--fx-border-strong);
	border-radius: var(--fx-radius-sm);
	background: var(--fx-bg-soft);
	color: var(--fx-text-muted);
	flex-shrink: 0;
	cursor: pointer;
}

.lite-theme-toggle:hover {
	background: rgba(255, 255, 255, 0.08);
	color: var(--fx-text);
	border-color: rgba(255, 255, 255, 0.28);
}

html[data-fx-theme='light'] .lite-theme-toggle:hover {
	background: rgba(0, 0, 0, 0.06);
	border-color: rgba(0, 0, 0, 0.2);
}

.lite-theme-toggle__icon {
	display: block;
}

.lite-theme-toggle__icon--sun {
	display: none;
}

html[data-fx-theme='dark'] .lite-theme-toggle__icon--moon {
	display: none;
}

html[data-fx-theme='dark'] .lite-theme-toggle__icon--sun {
	display: block;
}

.lite-btn {
	height: 36px;
	padding: 0 0.9rem;
	border-radius: var(--fx-radius-sm);
	border: 1px solid transparent;
	font: 600 0.85rem/1 var(--fx-font);
	cursor: pointer;
}

.lite-btn--icon {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding-left: 0.7rem;
}

.lite-btn--icon svg {
	flex: none;
	display: block;
}

.lite-btn--ghost {
	background: transparent;
	border-color: var(--fx-border-strong);
	color: var(--fx-text);
}

.lite-btn--ghost:hover {
	background: var(--fx-bg-soft);
}

.lite-btn--primary {
	background: var(--fx-blue);
	color: var(--fx-on-blue);
	border-color: var(--fx-blue);
}

.lite-btn--primary:hover {
	background: var(--fx-blue-hover);
	border-color: var(--fx-blue-hover);
}

/* ——— Body ——— */
.lite-body {
	flex: 1;
	min-height: 0;
	display: grid;
	grid-template-columns: calc(var(--lite-rail-w) + var(--lite-panel-w)) minmax(0, 1fr) var(--lite-dock-w) var(--lite-glyphs-w);
	grid-template-rows: minmax(0, 1fr);
	overflow: hidden;
}

.lite-tools {
	display: grid;
	grid-template-columns: var(--lite-rail-w) 1fr;
	min-height: 0;
	min-width: 0;
	height: 100%;
	overflow: hidden;
	border-right: 1px solid var(--fx-border);
	background: var(--fx-bg-panel);
}

/*
 * Fontxsis toolrail button chrome (copied from fontxsis.css).
 * Position overridden for LITE left column (not floating over canvas).
 */
.lite-tools .fx-vz-toolrail,
.lite-tools__rail.fx-vz-toolrail {
	position: static;
	top: auto;
	left: auto;
	z-index: auto;
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 4px;
	padding: 6px;
	border-radius: 0;
	border: 0;
	border-right: 1px solid var(--fx-border);
	background: rgba(17, 19, 24, 0.94);
	box-shadow: none;
	backdrop-filter: none;
	-webkit-backdrop-filter: none;
	pointer-events: auto;
	overflow: auto;
	min-height: 0;
}

.fx-vz-toolrail__btn {
	display: grid;
	place-items: center;
	width: 38px;
	height: 38px;
	padding: 0;
	border: 1px solid transparent;
	border-radius: 10px;
	background: transparent;
	color: #f9fafb;
	cursor: pointer;
	transition:
		border-color 0.12s ease,
		background 0.12s ease,
		color 0.12s ease,
		box-shadow 0.12s ease;
	flex: none;
}

.fx-vz-toolrail__btn svg {
	width: 18px;
	height: 18px;
	flex-shrink: 0;
	color: inherit;
}

.fx-vz-toolrail__btn:hover:not(.is-active) {
	border-color: transparent;
	color: #ffffff;
	background: rgba(255, 255, 255, 0.08);
}

.fx-vz-toolrail__btn.is-active {
	border-color: var(--fx-blue);
	background: var(--fx-blue);
	color: var(--fx-on-blue);
	box-shadow: none;
}

.fx-vz-toolrail__btn svg [fill]:not([fill='none']) {
	fill: currentColor;
}

.fx-vz-toolrail__btn svg [stroke]:not([stroke='none']) {
	stroke: currentColor;
}

.lite-tools__panel {
	padding: 0.9rem 0.85rem;
	overflow: auto;
}

.lite-tools__title {
	margin: 0 0 0.3rem;
	font-size: 1.05rem;
	font-weight: 700;
	letter-spacing: -0.02em;
}

.lite-tools__hint {
	margin: 0 0 0.9rem;
	color: var(--fx-text-muted);
	font-size: 0.82rem;
	line-height: 1.4;
}

/* Brush panel — image-2 layout (3-col dark tiles) + Fontxsis presets */
.lite-brush {
	margin-top: 0.45rem;
	display: flex;
	flex-direction: column;
	gap: 0.55rem;
}

.lite-brush__heading {
	margin: 0;
	font: 700 0.8rem/1.2 var(--fx-font);
	color: #f5f5f5;
	letter-spacing: 0.01em;
}

.lite-brush__presets {
	display: flex;
	flex-direction: column;
	gap: 6px;
	max-height: min(42vh, 360px);
	overflow: auto;
	padding: 2px 4px 4px 1px;
	scrollbar-width: thin;
	scrollbar-color: rgba(255, 255, 255, 0.28) rgba(255, 255, 255, 0.06);
}

.lite-brush__presets::-webkit-scrollbar {
	width: 6px;
}
.lite-brush__presets::-webkit-scrollbar-thumb {
	background: rgba(255, 255, 255, 0.28);
	border-radius: 99px;
}
.lite-brush__presets::-webkit-scrollbar-track {
	background: rgba(255, 255, 255, 0.06);
	border-radius: 99px;
}

.lite-brush__preset {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 8px;
	width: 100%;
	min-width: 0;
	margin: 0;
	padding: 10px 12px 12px;
	border-radius: 10px;
	border: 1px solid rgba(255, 255, 255, 0.1);
	background: #1c1c1e;
	color: #e8e8ea;
	cursor: pointer;
	text-align: left;
	font: inherit;
	transition: border-color 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
}

.lite-brush__preset:hover {
	background: #252528;
	border-color: rgba(255, 255, 255, 0.28);
	color: #f5f5f5;
}

.lite-brush__preset.is-on {
	background: #222226;
	border-color: #ffffff;
	box-shadow: 0 0 0 1px #ffffff;
	color: #ffffff;
}

.lite-brush__preset-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	min-width: 0;
}

.lite-brush__preset-label {
	display: block;
	min-width: 0;
	flex: 1;
	font: 600 0.78rem/1.2 var(--fx-font);
	letter-spacing: 0.01em;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	color: inherit;
}

.lite-brush__preset.is-on .lite-brush__preset-label {
	font-weight: 700;
	color: #ffffff;
}

.lite-brush__preset-icon {
	flex-shrink: 0;
	display: grid;
	place-items: center;
	width: 18px;
	height: 18px;
	color: inherit;
	opacity: 0.72;
}

.lite-brush__preset.is-on .lite-brush__preset-icon {
	opacity: 1;
}

.lite-brush__preset-icon svg {
	display: block;
	width: 16px;
	height: 16px;
}

.lite-brush__preset-preview {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 36px;
	color: inherit;
}

.lite-brush__preset-preview svg {
	display: block;
	width: 100%;
	max-width: none;
	height: 36px;
}

.lite-pen {
	display: flex;
	flex-direction: column;
	gap: 0.55rem;
	margin-bottom: 0.35rem;
}

.lite-pen[hidden] {
	display: none !important;
}

.lite-pen__heading {
	margin: 0;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--fx-text-secondary);
}

.lite-pen__label {
	margin: 0.15rem 0 0;
	font-size: 0.68rem;
	font-weight: 700;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	color: var(--fx-text-muted);
}

.lite-pen__modes {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
}

.lite-pen__btn {
	min-width: 0;
	width: 100%;
	height: 36px;
	border-radius: 6px;
	border: 1px solid rgba(255, 255, 255, 0.12);
	background: #1a1d21;
	color: #e5e7eb;
	font: inherit;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
}

.lite-pen__btn:hover {
	border-color: rgba(255, 255, 255, 0.35);
	background: rgba(255, 255, 255, 0.1);
}

.lite-pen__btn.is-on {
	background: var(--fx-blue);
	border-color: var(--fx-blue);
	color: var(--fx-on-blue);
}

.lite-pen__hint {
	margin: 0.15rem 0 0;
	font-size: 0.68rem;
	line-height: 1.35;
	color: var(--fx-text-faint);
}

.lite-pen__cap[hidden] {
	display: none !important;
}

.lite-select-stroke {
	display: flex;
	flex-direction: column;
	gap: 0.55rem;
	margin-bottom: 0.35rem;
}

.lite-select-stroke[hidden] {
	display: none !important;
}

/* Tool settings visibility: class display must not override [hidden] */
.lite-brush[hidden],
.lite-field[hidden] {
	display: none !important;
}

.lite-tools__note {
	margin: 1.1rem 0 0;
	padding-top: 0.75rem;
	border-top: 1px solid var(--fx-border);
	color: var(--fx-text-faint);
	font-size: 0.72rem;
	line-height: 1.4;
}

.lite-field {
	display: block;
	margin-bottom: 0.45rem;
}

.lite-field.fx-track-slider {
	width: 100%;
	min-width: 0;
}

/* Fontxsis track sliders (kern-style) — dark theme for LITE */
.lite-app .fx-track-slider__shell {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: 30px;
	border-radius: 6px;
	background: rgba(237, 242, 247, 0.063);
	overflow: hidden;
	transition: background 0.12s ease;
}

.lite-app .fx-track-slider__shell:hover {
	background: rgba(237, 242, 247, 0.085);
}

.lite-app .fx-track-slider__fill {
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: 0;
	border-radius: 6px 0 0 6px;
	background: rgba(237, 242, 247, 0.125);
	pointer-events: none;
	z-index: 1;
	transition: width 0.08s linear;
}

.lite-app .fx-track-slider__ticks {
	position: absolute;
	left: 34%;
	right: 16%;
	top: 50%;
	transform: translateY(-50%);
	height: 9px;
	display: flex;
	justify-content: space-evenly;
	align-items: stretch;
	pointer-events: none;
	z-index: 2;
}

.lite-app .fx-track-slider__ticks span {
	width: 1px;
	background: rgba(237, 242, 247, 0.16);
}

.lite-app .fx-track-slider__thumb {
	position: absolute;
	top: 50%;
	left: 0;
	width: 4px;
	height: 18px;
	transform: translate(-50%, -50%);
	border-radius: 3px;
	background: #c4c4c4;
	pointer-events: none;
	z-index: 3;
	transition: left 0.08s linear, background 0.12s ease;
}

.lite-app .fx-track-slider__shell:hover .fx-track-slider__thumb {
	background: #e0e0e0;
}

.lite-app .fx-track-slider__shell.is-dragging .fx-track-slider__fill,
.lite-app .fx-track-slider__shell.is-dragging .fx-track-slider__thumb {
	transition: none;
}

.lite-app .fx-track-slider__shell.is-dragging .fx-track-slider__thumb {
	background: #ffffff;
}

.lite-app .fx-track-slider__label {
	position: relative;
	z-index: 4;
	flex: 0 1 auto;
	min-width: 0;
	padding-left: 10px;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.35px;
	text-transform: uppercase;
	color: rgba(237, 242, 247, 0.565);
	pointer-events: none;
	white-space: nowrap;
}

.lite-app .fx-track-slider__value {
	position: relative;
	z-index: 4;
	flex: 0 0 auto;
	padding-right: 10px;
	font-size: 11px;
	font-weight: 700;
	color: rgba(237, 242, 247, 0.565);
	pointer-events: none;
	font-variant-numeric: tabular-nums;
}

.lite-app .fx-track-slider__shell .fx-track-slider__input {
	position: absolute;
	inset: 0;
	flex: none;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent !important;
	accent-color: transparent;
	cursor: pointer;
	z-index: 5;
	-webkit-appearance: none;
	appearance: none;
}

.lite-app .fx-track-slider__shell .fx-track-slider__input::-webkit-slider-runnable-track {
	height: 30px;
	border-radius: 0;
	background: transparent !important;
	border: 0;
}

.lite-app .fx-track-slider__shell .fx-track-slider__input::-webkit-slider-thumb {
	-webkit-appearance: none;
	width: 14px;
	height: 30px;
	margin-top: 0;
	border-radius: 0;
	background: transparent !important;
	border: 0;
	box-shadow: none;
}

.lite-app .fx-track-slider__shell .fx-track-slider__input::-moz-range-track {
	height: 30px;
	background: transparent !important;
	border: 0;
}

.lite-app .fx-track-slider__shell .fx-track-slider__input::-moz-range-thumb {
	width: 14px;
	height: 30px;
	border: 0;
	border-radius: 0;
	background: transparent !important;
	box-shadow: none;
}

.lite-app .fx-track-slider__shell .fx-track-slider__input:focus {
	outline: none;
}

.lite-app .fx-track-slider__shell .fx-track-slider__input:disabled {
	cursor: not-allowed;
	opacity: 0.42;
}

/* Stage — full height for square canvas */
.lite-stage {
	min-width: 0;
	min-height: 0;
	height: 100%;
	display: flex;
	flex-direction: column;
	align-items: stretch;
	justify-content: flex-start;
	gap: 0;
	padding: 0.65rem 0.75rem;
	padding-bottom: max(0.65rem, env(safe-area-inset-bottom, 0px));
	background: var(--fx-bg);
	overflow: hidden;
}

/*
 * Square canvas fills the stage (no bottom dock).
 * container-type:size → min(100cqw, 100cqh); JS sets --lite-canvas-side.
 */
.lite-canvas-wrap {
	flex: 1 1 auto;
	min-width: 0;
	min-height: 0;
	width: 100%;
	max-width: 100%;
	display: grid;
	place-items: center;
	container-type: size;
}

.lite-canvas {
	position: relative;
	width: var(--lite-canvas-side, min(100cqw, 100cqh));
	height: var(--lite-canvas-side, min(100cqw, 100cqh));
	max-width: 100%;
	max-height: 100%;
	border-radius: var(--fx-radius-lg);
	border: 1px solid var(--fx-border-strong);
	background: var(--lite-canvas-bg);
	box-shadow: var(--fx-shadow-panel);
	overflow: hidden;
}

@supports not (width: 1cqw) {
	.lite-canvas-wrap {
		aspect-ratio: 1;
		width: min(100%, 100%);
		max-height: 100%;
		margin: 0 auto;
	}

	.lite-canvas {
		width: 100%;
		height: 100%;
	}
}

/* ——— Vertical canvas dock (between stage and glyphs) ——— */
.lite-dock {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-width: 0;
	min-height: 0;
	height: 100%;
	padding: 10px 6px;
	border-left: 1px solid var(--fx-border);
	background: var(--fx-bg-panel);
	overflow: auto;
}

.lite-dock__sep {
	width: 22px;
	height: 1px;
	margin: 2px 0;
	background: var(--fx-border);
	flex-shrink: 0;
}

.lite-dock__btn {
	width: 40px;
	min-height: 40px;
	padding: 0;
	border: 0;
	border-radius: 10px;
	display: inline-grid;
	place-items: center;
	background: transparent;
	color: var(--fx-text, #e5e7eb);
	cursor: pointer;
	transition: background 0.12s ease, color 0.12s ease;
	flex-shrink: 0;
}

.lite-dock__btn--label {
	width: 100%;
	min-height: 44px;
	padding: 6px 2px;
	font-size: 0.62rem;
	font-weight: 650;
	letter-spacing: 0.02em;
	line-height: 1.15;
	text-align: center;
	writing-mode: horizontal-tb;
}

.lite-dock__btn.is-active {
	background: rgba(37, 99, 235, 0.22);
	color: #93c5fd;
}

.lite-dock__icon {
	display: block;
}

.lite-dock__icon--flip {
	transform: scaleX(-1);
}

.lite-dock__btn:hover,
.lite-dock__btn:focus-visible {
	background: rgba(255, 255, 255, 0.08);
	outline: none;
}

.lite-dock__btn:active {
	background: rgba(255, 255, 255, 0.12);
}

.lite-dock__btn--danger {
	color: #f87171;
}

.lite-dock__btn--danger:hover,
.lite-dock__btn--danger:focus-visible {
	background: rgba(248, 113, 113, 0.16);
	color: #fca5a5;
}

html[data-fx-theme='light'] .lite-dock {
	background: var(--fx-bg-panel, #f8fafc);
}

html[data-fx-theme='light'] .lite-dock__btn {
	color: #0f172a;
}

html[data-fx-theme='light'] .lite-dock__btn:hover,
html[data-fx-theme='light'] .lite-dock__btn:focus-visible {
	background: rgba(37, 99, 235, 0.1);
}

html[data-fx-theme='light'] .lite-dock__btn.is-active {
	background: rgba(37, 99, 235, 0.14);
	color: #1d4ed8;
}

html[data-fx-theme='light'] .lite-dock__btn--danger {
	color: #dc2626;
}

html[data-fx-theme='light'] .lite-dock__btn--danger:hover,
html[data-fx-theme='light'] .lite-dock__btn--danger:focus-visible {
	background: rgba(220, 38, 38, 0.12);
	color: #b91c1c;
}

html[data-fx-theme='light'] .lite-dock__sep {
	background: rgba(15, 23, 42, 0.12);
}

.lite-canvas.is-grid {
	background-image:
		linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
		linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
	background-size: 32px 32px, 32px 32px;
	background-position: center;
}

.lite-metrics {
	position: absolute;
	/* Tall writing cell (Scriptscript-like): less top/bottom, more side pad */
	inset: 1.5% 10%;
	pointer-events: none;
	transition: opacity 0.15s ease;
	container-type: size;
	/* Fontxsis Glyphs-style metric guide colors */
	--lite-metric-guide: #c5d96a;
	--lite-metric-guide-label: rgba(197, 217, 106, 0.95);
}

.lite-metrics.is-hidden {
	opacity: 0;
}

.lite-metrics__line {
	position: absolute;
	left: 0;
	right: 0;
	height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-top: 1px dashed var(--lite-metric-guide);
	background: transparent;
	transform: translateY(-0.5px);
}

.lite-metrics__badge {
	position: absolute;
	left: 0;
	top: 0;
	transform: translate(-50%, -50%);
	width: 12.5px;
	height: 12.5px;
	border-radius: 50%;
	border: 1px solid var(--lite-metric-guide);
	background: rgba(28, 28, 30, 0.94);
	color: var(--lite-metric-guide-label);
	font: 600 9px "Roboto", system-ui, sans-serif;
	line-height: 12.5px;
	text-align: center;
	letter-spacing: 0;
	box-sizing: border-box;
}

.lite-metrics__val {
	position: absolute;
	right: 2px;
	top: 0;
	transform: translateY(calc(-100% - 2px));
	font: 500 10px "JetBrains Mono", ui-monospace, monospace;
	color: var(--lite-metric-guide-label);
	letter-spacing: 0;
	white-space: nowrap;
	pointer-events: none;
}

.lite-metrics__lsb,
.lite-metrics__rsb {
	position: absolute;
	top: 0;
	bottom: 0;
	width: 0;
	border-left: 1px solid rgba(197, 217, 106, 0.55);
	background: transparent;
}

.lite-metrics__lsb { left: 0; }
.lite-metrics__rsb { right: 0; border-left: 0; border-right: 1px solid rgba(197, 217, 106, 0.55); }

.lite-metrics__lsb::before,
.lite-metrics__rsb::before {
	position: absolute;
	top: -0.85rem;
	left: 50%;
	transform: translateX(-50%);
	font-size: 0.58rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	color: var(--lite-metric-guide-label);
	content: "L";
}

.lite-metrics__rsb::before {
	content: "R";
}

/*
 * Ghost drawn on canvas (Fontxsis drawGhostGlyph): Roboto 400, ink @ 0.2,
 * sized to GHOST_REF cap/xHeight → baseline.
 */
.lite-ghost-canvas {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
	z-index: 1;
}

.lite-ink-canvas {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	z-index: 2;
	cursor: crosshair;
	touch-action: none;
}

/* Sticky Shape Modes bar (Select / Edit, ≥2 shapes) */
.lite-sticky {
	position: absolute;
	top: 12px;
	left: 50%;
	z-index: 6;
	transform: translateX(-50%) translateY(-6px);
	opacity: 0;
	pointer-events: none;
	transition:
		opacity 0.18s ease,
		transform 0.18s ease;
}

.lite-sticky:not([hidden]) {
	opacity: 1;
	transform: translateX(-50%) translateY(0);
	pointer-events: auto;
}

.lite-sticky__inner {
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 6px 8px;
	border-radius: 10px;
	border: 1px solid rgba(255, 255, 255, 0.12);
	background: rgba(17, 19, 24, 0.96);
	box-shadow:
		0 1px 2px rgba(0, 0, 0, 0.35),
		0 12px 32px rgba(0, 0, 0, 0.45);
}

.lite-sticky__modes {
	display: flex;
	align-items: center;
	gap: 2px;
}

.lite-sticky__sep {
	width: 1px;
	height: 22px;
	margin: 0 4px;
	background: rgba(255, 255, 255, 0.14);
	flex: none;
}

.lite-sticky__btn {
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	border-radius: 10px;
	background: transparent;
	color: #e5e7eb;
	cursor: pointer;
	transition:
		background 0.12s ease,
		color 0.12s ease;
}

.lite-sticky__btn:hover:not(:disabled) {
	background: rgba(255, 255, 255, 0.08);
}

.lite-sticky__btn:disabled {
	opacity: 0.35;
	cursor: not-allowed;
}

.lite-sticky__btn--danger {
	color: var(--lite-danger);
}

.lite-sticky__btn--danger:hover:not(:disabled) {
	background: rgba(240, 113, 120, 0.12);
}

.lite-sticky__btn svg {
	display: block;
	width: 18px;
	height: 18px;
}

html[data-fx-theme='light'] .lite-sticky__inner {
	border-color: rgba(0, 0, 0, 0.1);
	background: #ffffff;
	box-shadow:
		0 1px 2px rgba(15, 23, 42, 0.04),
		0 10px 28px rgba(15, 23, 42, 0.12);
}

html[data-fx-theme='light'] .lite-sticky__btn {
	color: #1f2937;
}

html[data-fx-theme='light'] .lite-sticky__btn:hover:not(:disabled) {
	background: #f3f4f6;
}

html[data-fx-theme='light'] .lite-sticky__btn--danger {
	color: var(--lite-danger);
}

html[data-fx-theme='light'] .lite-sticky__btn--danger:hover:not(:disabled) {
	background: #fef2f2;
}

html[data-fx-theme='light'] .lite-sticky__sep {
	background: rgba(15, 23, 42, 0.1);
}

/* Glyphs — match Fontxsis card surfaces */
.lite-glyphs {
	min-height: 0;
	min-width: 0;
	height: 100%;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	gap: 0.65rem;
	padding: 0.75rem;
	border-left: 1px solid var(--fx-border);
	background: var(--fx-bg-panel);
}

.lite-glyphs__tabs,
.lite-glyphs .fx-kern__specimen-tabs {
	display: flex;
	flex-direction: row;
	flex-wrap: nowrap;
	align-items: stretch;
	gap: 2px;
	padding: 3px;
	margin: 0;
	border: 0;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.08);
	box-sizing: border-box;
	overflow: hidden;
	flex: none;
}

.lite-glyphs__tab,
.lite-glyphs .fx-kern__specimen-tab {
	appearance: none;
	flex: 1 1 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 0;
	min-height: 28px;
	height: auto;
	padding: 5px 4px;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: #9ca3af;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: -0.02em;
	line-height: 1.1;
	text-align: center;
	white-space: nowrap;
	cursor: pointer;
	transition: background 0.12s ease, color 0.12s ease;
}

.lite-glyphs__tab:hover,
.lite-glyphs .fx-kern__specimen-tab:hover {
	color: #f3f4f6;
	background: transparent;
	border-color: transparent;
}

.lite-glyphs__tab.is-active,
.lite-glyphs .fx-kern__specimen-tab.is-active {
	background: rgba(255, 255, 255, 0.16);
	border-color: transparent;
	color: #f9fafb;
	box-shadow: none;
}

.lite-glyphs__grid {
	flex: 1;
	min-height: 0;
	overflow: auto;
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 0.35rem;
	align-content: start;
}

.lite-glyphs__pager {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.45rem;
	flex: none;
	padding: 0.1rem 0;
}

.lite-glyphs__pager[hidden] {
	display: none !important;
}

.lite-glyphs__pager-btn {
	width: 28px;
	height: 28px;
	padding: 0;
	border: 1px solid var(--fx-border-strong);
	border-radius: var(--fx-radius-sm);
	background: var(--fx-bg-soft);
	color: var(--fx-text);
	font: 600 1rem/1 var(--fx-font);
	cursor: pointer;
}

.lite-glyphs__pager-btn:hover:not(:disabled) {
	border-color: var(--fx-blue);
	background: var(--fx-blue-soft);
}

.lite-glyphs__pager-btn:disabled {
	opacity: 0.35;
	cursor: default;
}

.lite-glyphs__pager-label {
	min-width: 3.5rem;
	text-align: center;
	font: 650 0.72rem/1 var(--fx-font);
	letter-spacing: 0.04em;
	color: var(--fx-text-secondary);
	font-variant-numeric: tabular-nums;
}

.lite-glyph-nav {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.55rem;
	flex: none;
	padding: 0.35rem 0.5rem;
	border-top: 1px solid var(--fx-border-strong);
	background: var(--fx-bg-panel);
}

.lite-glyph-nav__btn {
	width: 32px;
	height: 32px;
	padding: 0;
	border: 1px solid var(--fx-border-strong);
	border-radius: var(--fx-radius-sm);
	background: var(--fx-bg-soft);
	color: var(--fx-text);
	font: 600 1.15rem/1 var(--fx-font);
	cursor: pointer;
}

.lite-glyph-nav__btn:hover:not(:disabled) {
	border-color: var(--fx-blue);
	background: var(--fx-blue-soft);
}

.lite-glyph-nav__btn:disabled {
	opacity: 0.35;
	cursor: default;
}

.lite-glyph-nav__current {
	min-width: 2.2rem;
	text-align: center;
	font: 700 1.05rem/1 var(--fx-font);
	color: var(--fx-text);
	letter-spacing: 0.02em;
}

.lite-glyph {
	aspect-ratio: 1;
	border: 1px solid var(--fx-border);
	border-radius: var(--fx-radius-sm);
	background: var(--fx-bg-card);
	color: var(--fx-text-secondary);
	font-weight: 700;
	font-size: 1.15rem;
	cursor: pointer;
	display: grid;
	place-items: center;
}

.lite-glyph:hover {
	background: var(--fx-bg-card-hover);
	border-color: var(--fx-border-strong);
	color: var(--fx-text);
}

.lite-glyph.is-active {
	border-color: var(--fx-blue);
	box-shadow: 0 0 0 2px var(--fx-blue-soft);
	color: var(--fx-text);
	background: rgba(255, 255, 255, 0.1);
}

@keyframes lite-pro-sweep {
	0% {
		left: -120%;
	}
	45%,
	100% {
		left: 140%;
	}
}

.lite-glyphs__smart {
	position: relative;
	overflow: hidden;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 44px;
	margin: 0;
	padding: 12px 14px;
	border: 0;
	border-radius: 10px;
	background: #3366ff;
	color: #ffffff;
	font: 700 13px/1.2 var(--fx-font);
	letter-spacing: 0.01em;
	cursor: pointer;
	box-shadow: 0 1px 2px rgba(51, 102, 255, 0.28);
	transition: background 0.12s ease;
}

.lite-glyphs__smart:hover {
	background: #4d7aff;
	color: #ffffff;
}

.lite-glyphs__smart:active {
	background: #2a56e0;
}

.lite-glyphs__smart::before {
	content: '';
	position: absolute;
	top: 0;
	left: -120%;
	width: 55%;
	height: 100%;
	background: linear-gradient(
		105deg,
		transparent 0%,
		rgba(255, 255, 255, 0.12) 35%,
		rgba(255, 255, 255, 0.72) 50%,
		rgba(255, 255, 255, 0.12) 65%,
		transparent 100%
	);
	transform: skewX(-18deg);
	animation: lite-pro-sweep 2.8s ease-in-out infinite;
	pointer-events: none;
	z-index: 0;
}

@media (prefers-reduced-motion: reduce) {
	.lite-glyphs__smart::before {
		animation: none;
		display: none;
	}
}

.lite-glyphs__smart-inner {
	position: relative;
	z-index: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
}

.lite-glyphs__smart-icon {
	flex: 0 0 auto;
	display: block;
	width: 16px;
	height: 16px;
}

.lite-glyphs__smart-label {
	line-height: 1.2;
}

.lite-glyphs__view {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 44px;
	margin: 0;
	padding: 12px 14px;
	border: 1px solid var(--fx-border-strong);
	border-radius: 10px;
	background: var(--fx-bg-soft);
	color: var(--fx-text);
	font: 700 13px/1.2 var(--fx-font);
	letter-spacing: 0.01em;
	cursor: pointer;
	transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.lite-glyphs__view:hover {
	background: var(--fx-bg-card-hover);
	border-color: var(--fx-blue-tint);
	color: var(--fx-text);
}

.lite-glyphs__view:active {
	background: var(--fx-blue-soft);
}

.lite-glyphs__view-inner {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
}

.lite-glyphs__view-icon {
	flex: 0 0 auto;
	display: block;
	width: 16px;
	height: 16px;
	opacity: 0.85;
}

.lite-glyphs__view-label {
	line-height: 1.2;
}

.lite-glyphs__clear {
	height: 40px;
	border: 1px solid var(--fx-border);
	border-radius: var(--fx-radius-sm);
	background: transparent;
	color: var(--fx-text-muted);
	font: 600 0.82rem/1 var(--fx-font);
	cursor: pointer;
}

.lite-glyphs__clear:hover {
	color: var(--lite-danger);
	border-color: rgba(240, 113, 120, 0.45);
}

@media (max-width: 980px) {
	:root {
		--lite-glyphs-w: min(100%, 100vw);
		--lite-panel-w: 180px;
	}

	.lite-body {
		grid-template-columns: var(--lite-rail-w) minmax(0, 1fr) var(--lite-dock-w);
		grid-template-rows: 1fr minmax(160px, 32vh);
	}

	.lite-tools {
		grid-template-columns: 1fr;
	}

	.lite-tools__panel {
		display: none;
	}

	.lite-glyphs {
		grid-column: 1 / -1;
		max-height: none;
		height: 100%;
		min-height: 0;
		border-left: 0;
		border-top: 1px solid var(--fx-border);
	}

	.lite-glyphs__grid {
		grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
	}

	.lite-top {
		grid-template-columns: auto 1fr auto;
	}

	.lite-top__fontname {
		display: none;
	}
}

@media (max-width: 720px) {
	:root {
		--lite-top-h: 52px;
		--lite-rail-w: 46px;
	}

	.lite-font-preview__body {
		height: 72px;
	}

	.lite-font-preview__stage {
		font-size: 1.5rem;
		padding: 8px 12px;
	}

	.lite-top {
		grid-template-columns: 1fr auto;
		gap: 0.5rem;
		padding: 0 0.55rem 0 0.45rem;
	}

	.lite-top__name {
		font-size: 1rem;
	}

	.lite-workspace {
		min-width: 0;
	}
}

@media (min-width: 1280px) {
	:root {
		--lite-glyphs-w: min(320px, 22vw);
		--lite-panel-w: 220px;
	}
}

/* ——— Export modal (phase-1 UI) ——— */
/* ——— Test drive (Smart Kerning preview) ——— */
.lite-testdrive {
	position: absolute;
	inset: 0;
	z-index: 40;
	display: flex;
	flex-direction: column;
	gap: 0;
	padding: 1rem 1.15rem 1.15rem;
	background: var(--fx-bg-panel);
	color: var(--fx-text);
	overflow: hidden;
}

.lite-testdrive[hidden] {
	display: none !important;
}

.lite-testdrive__header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1rem;
	flex: 0 0 auto;
	margin-bottom: 0.85rem;
}

.lite-testdrive__title {
	margin: 0;
	font-size: 1.35rem;
	font-weight: 700;
	letter-spacing: -0.02em;
	color: var(--fx-text);
}

.lite-testdrive__lead {
	margin: 0.35rem 0 0;
	font-size: 0.88rem;
	line-height: 1.35;
	color: var(--fx-text-secondary);
}

.lite-testdrive__close {
	flex: 0 0 auto;
	width: 36px;
	height: 36px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: var(--fx-text-muted);
	cursor: pointer;
}

.lite-testdrive__close:hover {
	background: var(--fx-bg-soft);
	color: var(--fx-text);
}

.lite-testdrive__compose {
	flex: 0 0 auto;
	display: flex;
	flex-direction: column;
	gap: 0.65rem;
	margin-bottom: 0.85rem;
}

.lite-testdrive__input {
	width: 100%;
	height: 48px;
	padding: 0 1rem;
	border: 1px solid var(--fx-border);
	border-radius: 12px;
	background: var(--fx-bg);
	color: var(--fx-text);
	font: 500 1rem/1.2 var(--fx-font);
	outline: none;
}

.lite-testdrive__input::placeholder {
	color: var(--fx-text-faint);
}

.lite-testdrive__input:focus {
	border-color: var(--fx-border-strong);
	box-shadow: 0 0 0 3px var(--fx-blue-soft);
}

.lite-testdrive__toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.65rem 0.75rem;
}

.lite-testdrive__style {
	display: inline-flex;
	align-items: center;
	height: 30px;
	padding: 0 0.75rem;
	border: 1px solid var(--fx-border);
	border-radius: 6px;
	background: var(--fx-bg-soft);
	font-size: 0.82rem;
	font-weight: 600;
	color: var(--fx-text);
	user-select: none;
}

.lite-testdrive__case {
	display: inline-flex;
	align-items: stretch;
	height: 30px;
	padding: 2px;
	border-radius: 6px;
	background: rgba(255, 255, 255, 0.06);
	gap: 2px;
}

.lite-testdrive__case-btn {
	appearance: none;
	margin: 0;
	padding: 0 10px;
	border: 0;
	border-radius: 4px;
	background: transparent;
	color: var(--fx-text-muted);
	font: 700 10px/1 var(--fx-font);
	letter-spacing: 0.04em;
	text-transform: uppercase;
	cursor: pointer;
	white-space: nowrap;
}

.lite-testdrive__case-btn:hover {
	color: var(--fx-text);
}

.lite-testdrive__case-btn.is-on {
	background: rgba(255, 255, 255, 0.14);
	color: var(--fx-text);
}

html[data-fx-theme='light'] .lite-testdrive__case {
	background: rgba(0, 0, 0, 0.06);
}

html[data-fx-theme='light'] .lite-testdrive__case-btn.is-on {
	background: #1a1a1a;
	color: #ffffff;
}

.lite-testdrive__slider {
	flex: 1 1 160px;
	min-width: 140px;
	max-width: 280px;
	margin: 0;
}

.lite-testdrive__smart {
	flex: 0 0 auto;
	width: auto;
	min-height: 30px;
	padding: 0 12px;
	margin-left: auto;
}

.lite-testdrive__smart .lite-glyphs__smart-label {
	font-size: 12px;
}

.lite-testdrive__stage-wrap {
	flex: 1;
	min-height: 0;
	border: 1px solid var(--fx-border);
	border-radius: 12px;
	background: var(--fx-bg);
	overflow: auto;
}

.lite-testdrive__stage {
	padding: 1.25rem 1.35rem;
	color: var(--fx-text-faint);
	font-family: var(--fx-font);
	font-weight: 400;
	font-synthesis: none;
	font-size: 74px;
	line-height: 1.15;
	overflow-wrap: anywhere;
	word-break: break-word;
	white-space: pre-wrap;
}

.lite-testdrive__stage.is-custom {
	/* Custom typed sample still mixes ink + ghost spans */
	color: var(--fx-text-faint);
}

.lite-testdrive__ink {
	color: var(--fx-text);
	font-family: "FontxsisLitePreview", var(--fx-font);
	font-weight: 400;
}

.lite-testdrive__ghost {
	color: var(--fx-text-faint);
	font-family: var(--fx-font);
	font-weight: 400;
}

/* ——— Smart Metrics modal (on Preview Font) ——— */
.lite-testdrive > .lite-smart-modal {
	/* Cover full Preview surface (bleed past .lite-testdrive padding) */
	top: -1rem;
	right: -1.15rem;
	bottom: -1.15rem;
	left: -1.15rem;
	z-index: 50;
}

.lite-smart-modal {
	position: absolute;
	inset: 0;
	z-index: 90;
	display: grid;
	place-items: center;
	padding: 1rem;
}

.lite-smart-modal[hidden] {
	display: none !important;
}

.lite-smart-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
}

.lite-smart-modal__card {
	position: relative;
	z-index: 1;
	width: min(360px, 100%);
	border-radius: 14px;
	border: 1px solid var(--fx-border);
	background: var(--fx-bg-panel);
	box-shadow: var(--fx-shadow-panel);
	overflow: hidden;
}

.lite-smart-modal__body {
	padding: 1.25rem 1.25rem 0.85rem;
}

.lite-smart-modal__title {
	margin: 0;
	font-size: 1.15rem;
	font-weight: 700;
	letter-spacing: -0.02em;
	color: var(--fx-text);
}

.lite-smart-modal__text {
	margin: 0.4rem 0 1rem;
	font-size: 0.85rem;
	line-height: 1.4;
	color: var(--fx-text-secondary);
}

.lite-smart-modal__label {
	display: block;
	margin: 0 0 0.4rem;
	font-size: 0.78rem;
	font-weight: 700;
	color: var(--fx-text);
}

.lite-smart-modal__input {
	width: 100%;
	height: 42px;
	padding: 0 0.75rem;
	border: 1px solid var(--fx-border);
	border-radius: 8px;
	background: var(--fx-bg);
	color: var(--fx-text);
	font: 600 1rem/1 var(--fx-font);
	outline: none;
}

.lite-smart-modal__input:focus {
	border-color: #3366ff;
	box-shadow: 0 0 0 3px rgba(51, 102, 255, 0.22);
}

.lite-smart-modal__hint {
	margin: 0.45rem 0 0;
	font-size: 0.72rem;
	line-height: 1.35;
	color: var(--fx-text-muted);
}

.lite-smart-modal__actions {
	display: flex;
	justify-content: flex-end;
	align-items: center;
	gap: 0.5rem;
	padding: 0.85rem 1.25rem 1.15rem;
	border-top: 1px solid var(--fx-border);
}

.lite-smart-modal__run {
	appearance: none;
	position: relative;
	overflow: hidden;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 40px;
	margin: 0;
	padding: 0 14px;
	border: 0;
	border-radius: 8px;
	background: #3366ff;
	color: #fff;
	font: 700 0.85rem/1 var(--fx-font);
	cursor: pointer;
	box-shadow: 0 1px 2px rgba(51, 102, 255, 0.28);
}

.lite-smart-modal__run:hover {
	background: #4d7aff;
}

.lite-smart-modal__run-inner {
	position: relative;
	z-index: 1;
	display: inline-flex;
	align-items: center;
	gap: 7px;
}

.lite-smart-modal__run::before {
	content: '';
	position: absolute;
	top: 0;
	left: -120%;
	width: 55%;
	height: 100%;
	background: linear-gradient(
		105deg,
		transparent 0%,
		rgba(255, 255, 255, 0.12) 35%,
		rgba(255, 255, 255, 0.72) 50%,
		rgba(255, 255, 255, 0.12) 65%,
		transparent 100%
	);
	transform: skewX(-18deg);
	animation: lite-pro-sweep 2.8s ease-in-out infinite;
	pointer-events: none;
	z-index: 0;
}

@media (prefers-reduced-motion: reduce) {
	.lite-smart-modal__run::before {
		animation: none;
		display: none;
	}
}

/* ——— Smart loading / done ——— */
.lite-smart-loading {
	position: absolute;
	inset: 0;
	z-index: 90;
	display: grid;
	place-items: center;
	padding: 1rem;
	background: rgba(0, 0, 0, 0.45);
}

.lite-smart-loading[hidden] {
	display: none !important;
}

.lite-smart-loading__card {
	width: min(280px, 100%);
	padding: 1.25rem 1.35rem 1.1rem;
	border-radius: 14px;
	background: var(--fx-panel, #16181d);
	border: 1px solid var(--fx-border, #2a2e36);
	text-align: center;
}

.lite-smart-loading__logo {
	display: block;
	width: 40px;
	height: 40px;
	margin: 0 auto 0.85rem;
	object-fit: contain;
	animation: lite-smart-spin 1.1s linear infinite;
}

.lite-smart-loading__track {
	height: 8px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.1);
	overflow: hidden;
}

.lite-smart-loading__bar {
	height: 100%;
	width: 0%;
	border-radius: inherit;
	background: linear-gradient(
		90deg,
		#e5e7eb 0%,
		#ffffff 55%,
		#e5e7eb 100%
	);
	background-size: 200% 100%;
	animation: lite-smart-bar-sheen 1.2s linear infinite;
	transition: width 0.12s linear;
}

.lite-smart-loading__pct {
	margin: 0.65rem 0 0;
	font-size: 0.8rem;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	color: var(--fx-muted, #9ca3af);
}

@keyframes lite-smart-spin {
	to {
		transform: rotate(360deg);
	}
}

@keyframes lite-smart-bar-sheen {
	0% {
		background-position: 100% 0;
	}
	100% {
		background-position: -100% 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.lite-smart-loading__logo,
	.lite-smart-loading__bar {
		animation: none;
	}
}

html[data-fx-theme='light'] .lite-smart-loading {
	background: rgba(0, 0, 0, 0.28);
}

html[data-fx-theme='light'] .lite-smart-loading__track {
	background: rgba(0, 0, 0, 0.08);
}

html[data-fx-theme='light'] .lite-smart-loading__bar {
	background: linear-gradient(90deg, #1a1a1a 0%, #3f3f46 55%, #1a1a1a 100%);
	background-size: 200% 100%;
}

.lite-smart-done {
	z-index: 92;
}

.lite-smart-done__card {
	position: relative;
	width: min(320px, 100%);
}

.lite-smart-done__close {
	position: absolute;
	top: 0.55rem;
	right: 0.65rem;
	border: 0;
	background: transparent;
	color: var(--fx-muted, #9ca3af);
	font-size: 1.35rem;
	line-height: 1;
	cursor: pointer;
}

.lite-smart-done__body {
	padding: 1.1rem 1.2rem 0.35rem;
}

.lite-smart-done__title {
	margin: 0 0 0.75rem;
	font-size: 1.05rem;
	font-weight: 650;
	color: var(--fx-text, #f3f4f6);
}

.lite-smart-done__metrics {
	display: flex;
	align-items: baseline;
	gap: 0.55rem;
	flex-wrap: wrap;
}

.lite-smart-done__metric {
	display: flex;
	align-items: baseline;
	gap: 0.3rem;
}

.lite-smart-done__count {
	font-size: 1.35rem;
	font-weight: 700;
	color: var(--fx-text, #f3f4f6);
}

.lite-smart-done__metric-label,
.lite-smart-done__metric-sep {
	font-size: 0.78rem;
	color: var(--fx-muted, #9ca3af);
}

.lite-smart-done__status {
	margin: 0.7rem 0 0;
	font-size: 0.82rem;
	color: var(--fx-muted, #9ca3af);
}

/* ——— Export modal ——— */
.lite-modal {
	position: absolute;
	inset: 0;
	z-index: 80;
	display: grid;
	place-items: center;
	padding: 1rem;
}

.lite-modal[hidden] {
	display: none !important;
}

.lite-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.62);
}

.lite-modal__panel {
	position: relative;
	z-index: 1;
	width: min(420px, 100%);
	max-height: min(92%, 560px);
	overflow: auto;
	border-radius: var(--fx-radius-lg);
	border: 1px solid var(--fx-border-strong);
	background: var(--fx-bg-panel);
	box-shadow: var(--fx-shadow-panel);
	display: flex;
	flex-direction: column;
}

.lite-modal__header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 1.15rem 1.15rem 0.35rem;
}

.lite-modal__heading {
	min-width: 0;
}

.lite-modal__title {
	margin: 0;
	font: 700 1.2rem/1.2 var(--fx-font);
	letter-spacing: -0.02em;
	color: var(--fx-text);
}

.lite-modal__lead {
	margin: 0.55rem 0 0;
	font: 400 0.82rem/1.45 var(--fx-font);
	color: var(--fx-text-secondary);
}

.lite-modal__lead strong {
	color: var(--fx-text);
	font-weight: 600;
}

.lite-modal__close {
	flex: none;
	width: 32px;
	height: 32px;
	margin: -0.2rem -0.2rem 0 0;
	border: 0;
	border-radius: var(--fx-radius-sm);
	background: transparent;
	color: var(--fx-text-muted);
	cursor: pointer;
	display: grid;
	place-items: center;
}

.lite-modal__close:hover {
	background: rgba(255, 255, 255, 0.08);
	color: var(--fx-text);
}

.lite-modal__body {
	padding: 0.75rem 1.15rem 0.35rem;
	display: flex;
	flex-direction: column;
	gap: 0.9rem;
}

.lite-modal__field {
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
}

.lite-modal__label {
	font: 700 0.78rem/1 var(--fx-font);
	color: var(--fx-text);
}

.lite-modal__input {
	height: 40px;
	border: 1px solid var(--fx-border-strong);
	border-radius: var(--fx-radius-sm);
	background: var(--fx-bg-soft);
	color: var(--fx-text);
	padding: 0 0.75rem;
	font: 500 0.92rem/1 var(--fx-font);
}

.lite-modal__input:focus {
	outline: none;
	border-color: rgba(255, 255, 255, 0.45);
	box-shadow: 0 0 0 3px var(--fx-blue-soft);
}

.lite-modal__coverage {
	border: 1px solid var(--fx-border);
	border-radius: var(--fx-radius);
	background: var(--fx-bg-card);
	padding: 0.85rem 0.9rem;
}

.lite-modal__coverage-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
}

.lite-modal__coverage-title {
	margin: 0;
	font: 700 0.78rem/1 var(--fx-font);
	color: var(--fx-text);
}

.lite-modal__badge {
	flex: none;
	min-width: 3.25rem;
	padding: 0.28rem 0.55rem;
	border-radius: 999px;
	border: 1px solid var(--fx-border-strong);
	background: rgba(255, 255, 255, 0.06);
	color: var(--fx-text-secondary);
	font: 700 0.68rem/1 var(--fx-font);
	text-align: center;
	letter-spacing: 0.02em;
}

.lite-modal__warn {
	display: flex;
	align-items: flex-start;
	gap: 0.45rem;
	margin: 0.7rem 0 0;
	font: 600 0.8rem/1.35 var(--fx-font);
	color: #e8e8e8;
}

.lite-modal__warn[hidden],
.lite-modal__ok[hidden],
.lite-modal__phase[hidden] {
	display: none !important;
}

.lite-modal__warn-mark {
	flex: none;
	width: 1.05rem;
	height: 1.05rem;
	margin-top: 0.05rem;
	border-radius: 50%;
	border: 1.5px solid #e8e8e8;
	display: grid;
	place-items: center;
	font: 700 0.65rem/1 var(--fx-font);
}

.lite-modal__note {
	margin: 0.45rem 0 0;
	font: 400 0.74rem/1.4 var(--fx-font);
	color: var(--fx-text-muted);
}

.lite-modal__ok {
	margin: 0.7rem 0 0;
	font: 500 0.8rem/1.35 var(--fx-font);
	color: var(--fx-text-secondary);
}

.lite-modal__phase {
	margin: 0;
	padding: 0.65rem 0.75rem;
	border-radius: var(--fx-radius-sm);
	border: 1px solid var(--fx-border-strong);
	background: rgba(255, 255, 255, 0.05);
	font: 500 0.78rem/1.4 var(--fx-font);
	color: var(--fx-text-secondary);
}

.lite-modal__footer {
	display: flex;
	justify-content: flex-end;
	gap: 0.55rem;
	padding: 0.85rem 1.15rem 1.15rem;
}

/* ——— Light theme surface overrides (hardcoded dark chrome) ——— */
html[data-fx-theme='light'] body.lite-stage-page {
	background:
		radial-gradient(900px 400px at 50% 0%, rgba(0, 0, 0, 0.04), transparent 55%),
		#e8e8ea;
}

html[data-fx-theme='light'] .lite-preview-bar {
	border-bottom-color: rgba(0, 0, 0, 0.08);
}

html[data-fx-theme='light'] .lite-top {
	background: rgba(255, 255, 255, 0.94);
}

html[data-fx-theme='light'] .lite-top__mark {
	filter: invert(1);
}

html[data-fx-theme='light'] .lite-font-preview__body {
	background: #f7f7f8;
	color: #111113;
}

html[data-fx-theme='light'] .lite-font-preview__rail {
	color: rgba(17, 17, 19, 0.45);
	border-right-color: rgba(0, 0, 0, 0.08);
}

html[data-fx-theme='light'] .lite-font-preview__stage {
	caret-color: #1a1a1a;
	color: #111113;
}

html[data-fx-theme='light'] .lite-tools .fx-vz-toolrail,
html[data-fx-theme='light'] .lite-tools__rail.fx-vz-toolrail {
	background: rgba(255, 255, 255, 0.96);
	border-right-color: rgba(0, 0, 0, 0.08);
}

html[data-fx-theme='light'] .fx-vz-toolrail__btn {
	color: #1a1a1a;
}

html[data-fx-theme='light'] .fx-vz-toolrail__btn:hover:not(.is-active) {
	color: #000000;
	background: rgba(0, 0, 0, 0.06);
}

html[data-fx-theme='light'] .fx-vz-toolrail__btn.is-active {
	color: var(--fx-on-blue);
}

html[data-fx-theme='light'] .lite-canvas.is-grid {
	background-image:
		linear-gradient(rgba(0, 0, 0, 0.06) 1px, transparent 1px),
		linear-gradient(90deg, rgba(0, 0, 0, 0.06) 1px, transparent 1px);
}

html[data-fx-theme='light'] .lite-metrics {
	--lite-metric-guide: #9aad3a;
	--lite-metric-guide-label: #7a8a2e;
}

html[data-fx-theme='light'] .lite-metrics__badge {
	background: rgba(255, 255, 255, 0.96);
}

html[data-fx-theme='light'] .lite-metrics__lsb,
html[data-fx-theme='light'] .lite-metrics__rsb {
	border-left-color: rgba(154, 173, 58, 0.55);
	border-right-color: rgba(154, 173, 58, 0.55);
	background: transparent;
}

html[data-fx-theme='light'] .lite-brush__preset {
	background: #f4f4f5;
	border-color: rgba(0, 0, 0, 0.1);
	color: #27272a;
}

html[data-fx-theme='light'] .lite-brush__preset:hover {
	background: #ececee;
	border-color: rgba(0, 0, 0, 0.22);
	color: #111113;
}

html[data-fx-theme='light'] .lite-brush__preset.is-on {
	background: #111113;
	border-color: #111113;
	color: #ffffff;
	box-shadow: 0 0 0 1px #111113;
}

html[data-fx-theme='light'] .lite-brush__presets {
	scrollbar-color: rgba(0, 0, 0, 0.28) rgba(0, 0, 0, 0.06);
}

/* Track sliders — light theme contrast */
html[data-fx-theme='light'] .lite-app .fx-track-slider__shell {
	background: rgba(0, 0, 0, 0.08);
}

html[data-fx-theme='light'] .lite-app .fx-track-slider__shell:hover {
	background: rgba(0, 0, 0, 0.11);
}

html[data-fx-theme='light'] .lite-app .fx-track-slider__fill {
	background: rgba(0, 0, 0, 0.14);
}

html[data-fx-theme='light'] .lite-app .fx-track-slider__ticks span {
	background: rgba(0, 0, 0, 0.18);
}

html[data-fx-theme='light'] .lite-app .fx-track-slider__thumb {
	background: #3a3a3c;
}

html[data-fx-theme='light'] .lite-app .fx-track-slider__shell:hover .fx-track-slider__thumb {
	background: #1a1a1a;
}

html[data-fx-theme='light'] .lite-app .fx-track-slider__shell.is-dragging .fx-track-slider__thumb {
	background: #000000;
}

html[data-fx-theme='light'] .lite-app .fx-track-slider__label,
html[data-fx-theme='light'] .lite-app .fx-track-slider__value {
	color: rgba(17, 17, 19, 0.72);
}

html[data-fx-theme='light'] .lite-pen__btn {
	background: #f0f0f2;
	border-color: rgba(0, 0, 0, 0.12);
	color: #1a1a1a;
}

html[data-fx-theme='light'] .lite-pen__btn:hover {
	border-color: rgba(0, 0, 0, 0.28);
	background: rgba(0, 0, 0, 0.06);
}

html[data-fx-theme='light'] .lite-pen__heading,
html[data-fx-theme='light'] .lite-pen__label {
	color: rgba(17, 17, 19, 0.72);
}

html[data-fx-theme='light'] .lite-pen__hint {
	color: rgba(17, 17, 19, 0.48);
}

html[data-fx-theme='light'] .lite-pen__btn.is-on {
	background: #1a1a1a;
	border-color: #1a1a1a;
	color: #ffffff;
}

html[data-fx-theme='light'] .lite-glyphs__tabs,
html[data-fx-theme='light'] .lite-glyphs .fx-kern__specimen-tabs {
	background: rgba(0, 0, 0, 0.06);
}

html[data-fx-theme='light'] .lite-glyphs__tab,
html[data-fx-theme='light'] .lite-glyphs .fx-kern__specimen-tab {
	color: rgba(17, 17, 19, 0.55);
}

html[data-fx-theme='light'] .lite-glyphs__tab:hover,
html[data-fx-theme='light'] .lite-glyphs .fx-kern__specimen-tab:hover {
	color: #111113;
	background: transparent;
}

html[data-fx-theme='light'] .lite-glyphs__tab.is-active,
html[data-fx-theme='light'] .lite-glyphs .fx-kern__specimen-tab.is-active {
	background: #1a1a1a;
	color: #ffffff;
}

html[data-fx-theme='light'] .lite-modal__warn {
	color: #1a1a1a;
}

html[data-fx-theme='light'] .lite-modal__warn-mark {
	border-color: #1a1a1a;
}

/* ——— Confirm dialog (New Font) — Fontxsis fx-confirm style ——— */
.lite-confirm {
	position: fixed;
	inset: 0;
	z-index: 280;
	display: grid;
	place-items: center;
	padding: 24px;
}

.lite-confirm[hidden] {
	display: none !important;
}

.lite-confirm__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, 0.42);
	backdrop-filter: blur(3px);
	-webkit-backdrop-filter: blur(3px);
}

.lite-confirm__card {
	position: relative;
	z-index: 1;
	width: min(380px, 100%);
	border: 1px solid var(--fx-border-strong);
	border-radius: 12px;
	background: #ffffff;
	box-shadow: 0 18px 48px rgba(15, 23, 42, 0.18);
	overflow: hidden;
	color: var(--fx-text);
}

.lite-confirm__body {
	padding: 20px 18px 16px;
}

.lite-confirm__title {
	margin: 0;
	font-size: 1.125rem;
	font-weight: 800;
	letter-spacing: -0.02em;
	color: var(--fx-text);
}

.lite-confirm__text {
	margin: 8px 0 0;
	font-size: 0.84rem;
	line-height: 1.45;
	color: var(--fx-text-muted, rgba(17, 17, 19, 0.62));
}

.lite-confirm__actions {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
	padding: 14px 16px;
	border-top: 1px solid var(--fx-border);
	background: var(--fx-bg-soft, #f4f4f5);
}

.lite-confirm__btn {
	min-height: 34px;
	padding: 0 14px;
	border-radius: 10px;
	font: inherit;
	font-size: 0.8125rem;
	font-weight: 700;
	cursor: pointer;
	transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.lite-confirm__btn--ghost {
	border: 1px solid var(--fx-border-strong);
	background: #fff;
	color: var(--fx-text-secondary, rgba(17, 17, 19, 0.72));
}

.lite-confirm__btn--ghost:hover {
	background: #f8fafc;
	color: var(--fx-text);
}

.lite-confirm__btn--primary {
	border: 0;
	background: var(--fx-blue);
	color: var(--fx-on-blue);
}

.lite-confirm__btn--primary:hover {
	background: var(--fx-blue-hover);
	color: var(--fx-on-blue);
}

html[data-fx-theme='dark'] .lite-confirm__backdrop {
	background: rgba(4, 5, 8, 0.72);
}

html[data-fx-theme='dark'] .lite-confirm__card {
	background: var(--fx-bg-panel, #121214);
	border-color: var(--fx-border-strong);
	box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
	color: var(--fx-text);
}

html[data-fx-theme='dark'] .lite-confirm__title {
	color: #ffffff;
}

html[data-fx-theme='dark'] .lite-confirm__text {
	color: rgba(255, 255, 255, 0.65);
}

html[data-fx-theme='dark'] .lite-confirm__actions {
	border-top-color: rgba(255, 255, 255, 0.1);
	background: rgba(255, 255, 255, 0.04);
}

html[data-fx-theme='dark'] .lite-confirm__btn--ghost {
	border-color: rgba(255, 255, 255, 0.18);
	background: transparent;
	color: rgba(255, 255, 255, 0.78);
}

html[data-fx-theme='dark'] .lite-confirm__btn--ghost:hover {
	background: rgba(255, 255, 255, 0.08);
	color: #ffffff;
}

html[data-fx-theme='light'] .lite-col-preview .lite-font-preview__body {
	background: #ffffff;
	color: #111113;
}

/* ========== Blueprint 3-column shell (Calligrapher-like layout, LITE theme) ========== */
.lite-body {
	display: grid;
	/* Preview (center) flexes; draw stays a fixed-ish board — large square, not wide. */
	grid-template-columns: var(--lite-draw-w) minmax(0, 1fr) var(--lite-controls-w);
	grid-template-rows: minmax(0, 1fr);
	gap: 0;
	overflow: hidden;
}

.lite-col-draw {
	display: grid;
	/* Vertical tools (red zone) | canvas ; then glyph nav ; Script */
	grid-template-columns: auto minmax(0, 1fr);
	grid-template-rows: minmax(0, 1fr) auto minmax(100px, 14%);
	grid-template-areas:
		'chrome stage'
		'glyphnav glyphnav'
		'glyphs glyphs';
	min-width: 0;
	min-height: 0;
	height: 100%;
	border-right: 1px solid var(--fx-border-strong);
	background: var(--fx-bg);
	overflow: hidden;
}

.lite-col-draw .lite-stage {
	grid-area: stage;
}

.lite-col-draw .lite-glyph-nav {
	grid-area: glyphnav;
}

.lite-col-draw .lite-draw-chrome {
	grid-area: chrome;
}

.lite-col-draw .lite-glyphs {
	grid-area: glyphs;
}

.lite-draw-chrome {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	justify-content: flex-start;
	gap: 0;
	width: auto;
	min-width: 46px;
	max-width: 56px;
	min-height: 0;
	height: 100%;
	border-top: 0;
	border-right: 1px solid var(--fx-border-strong);
	border-bottom: 0;
	background: var(--fx-bg-panel);
	overflow: auto;
}

.lite-col-draw .lite-tools {
	display: block;
	flex: 0 0 auto;
	min-width: 0;
	height: auto;
	border-right: 0;
	background: transparent;
	overflow: visible;
}

.lite-col-draw .lite-tools .fx-vz-toolrail,
.lite-col-draw .lite-tools__rail.fx-vz-toolrail {
	flex-direction: column;
	flex-wrap: nowrap;
	align-items: center;
	justify-content: flex-start;
	gap: 2px;
	padding: 6px 4px;
	border-right: 0;
	background: transparent;
	overflow: visible;
}

.lite-col-draw .fx-vz-toolrail__btn {
	width: 34px;
	height: 34px;
	border-radius: 6px;
}

.lite-col-draw .lite-dock {
	flex: 0 0 auto;
	flex-direction: column;
	flex-wrap: nowrap;
	align-items: center;
	justify-content: flex-start;
	height: auto;
	width: 100%;
	max-width: none;
	margin-top: auto;
	padding: 6px 4px 8px;
	border-left: 0;
	border-top: 1px solid var(--fx-border);
	border-right: 0;
	background: transparent;
	overflow: visible;
}

.lite-col-draw .lite-dock__sep {
	width: 22px;
	height: 1px;
	margin: 4px 0;
}

.lite-col-draw .lite-dock__btn {
	width: 34px;
	min-height: 34px;
	border-radius: 6px;
}

.lite-col-draw .lite-dock__btn--label {
	width: 100%;
	min-height: 36px;
	padding: 4px 2px;
	font-size: 0.58rem;
	writing-mode: horizontal-tb;
}

.lite-col-draw .lite-stage {
	padding: 0;
	background: var(--fx-bg-soft);
	/* Stage claims remaining height so the square canvas can grow tall */
	min-height: 0;
	display: flex;
	flex-direction: column;
	align-items: stretch;
	justify-content: center;
}

.lite-col-draw .lite-canvas-wrap {
	flex: 1 1 auto;
	width: 100%;
	height: 100%;
	min-width: 0;
	min-height: 0;
}

.lite-col-draw .lite-canvas {
	border-radius: var(--fx-radius);
	box-shadow: none;
	width: var(--lite-canvas-side, min(100cqw, 100cqh));
	height: var(--lite-canvas-side, min(100cqw, 100cqh));
	max-width: 100%;
	max-height: 100%;
}

.lite-col-draw .lite-glyphs {
	border-left: 0;
	border-top: 1px solid var(--fx-border-strong);
	max-height: none;
	height: 100%;
	min-height: 0;
	padding: 0.45rem 0.55rem 0.55rem;
	background: var(--fx-bg-panel);
}

.lite-col-draw .lite-glyphs__grid {
	grid-template-columns: repeat(auto-fill, minmax(36px, 1fr));
	gap: 3px;
}

.lite-col-draw .lite-glyphs__view {
	display: none;
}

/* Center: lined notebook preview */
.lite-font-preview.lite-col-preview {
	flex: unset;
	width: auto;
	min-width: 0;
	min-height: 0;
	height: 100%;
	border-bottom: 0;
	border-right: 1px solid var(--fx-border-strong);
	display: flex;
	flex-direction: column;
	background: var(--fx-bg);
	z-index: 1;
}

.lite-col-preview .lite-font-preview__body {
	flex: 1;
	min-height: 0;
	height: auto;
	display: flex;
	flex-direction: column;
	border: 0;
	border-radius: 0;
	--lite-preview-size: 40px;
	--lite-preview-lh: 48px;
	background: var(--fx-bg-panel);
}

.lite-col-preview .lite-font-preview__rail {
	position: static;
	writing-mode: horizontal-tb;
	transform: none;
	padding: 0.55rem 0.85rem 0.25rem;
	font-size: 0.65rem;
	letter-spacing: 0.16em;
	border: 0;
	opacity: 0.7;
}

.lite-col-preview .lite-font-preview__stage {
	flex: 1;
	min-height: 0;
	height: auto;
	padding: 0 1.1rem 1.25rem;
	font-size: var(--lite-preview-size, 40px);
	line-height: var(--lite-preview-lh, 48px);
	overflow: auto;
	text-align: left;
	background: transparent;
}

.lite-font-preview__stage .lite-preview-ink,
.lite-font-preview__stage .lite-preview-ghost {
	vertical-align: baseline;
	line-height: inherit;
}

.lite-font-preview__stage .lite-preview-ghost {
	/* Ghost stays on alphabetic baseline when Size / Line height change */
	position: static;
}

.lite-preview-type[hidden] {
	display: none !important;
}

.lite-preview-type {
	display: flex;
	flex-direction: column;
	gap: 0.55rem;
	margin-top: 0.25rem;
}

.lite-font-preview__foot {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 0.5rem;
	padding: 0.45rem 0.75rem;
	border-top: 1px solid var(--fx-border);
	background: var(--fx-bg-panel);
}

.lite-font-preview__foot-btn {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.35rem 0.7rem;
	border: 1px solid var(--fx-border-strong);
	border-radius: var(--fx-radius-sm);
	background: transparent;
	color: var(--fx-text-secondary);
	font: 600 0.75rem/1 var(--fx-font);
	cursor: pointer;
}

.lite-font-preview__foot-btn:hover {
	color: var(--fx-text);
	border-color: var(--fx-blue);
	background: var(--fx-blue-soft);
}

/* Right: tool options */
.lite-col-controls {
	display: flex;
	flex-direction: column;
	min-width: 0;
	min-height: 0;
	height: 100%;
	overflow: hidden;
	background: var(--fx-bg-panel);
}

.lite-col-controls .lite-tools__panel {
	flex: 1;
	min-height: 0;
	height: 100%;
	overflow: auto;
	padding: 0.75rem 0.85rem 1rem;
	border: 0;
	display: flex;
	flex-direction: column;
	gap: 0.65rem;
}

.lite-col-controls .lite-tools__title {
	font-size: 0.95rem;
}

.lite-col-controls .lite-tools__hint,
.lite-col-controls .lite-tools__note {
	font-size: 0.75rem;
}

.lite-top {
	height: var(--lite-top-h);
	background: var(--fx-bg-panel);
	backdrop-filter: none;
	-webkit-backdrop-filter: none;
	border-bottom: 1px solid var(--fx-border-strong);
}

@media (max-width: 1100px) {
	:root {
		--lite-draw-w: min(480px, 48vw, 68vh);
		--lite-controls-w: min(210px, 22vw);
	}
}

@media (max-width: 980px) {
	.lite-body {
		grid-template-columns: minmax(0, 1fr) var(--lite-controls-w);
		grid-template-rows: minmax(300px, 56vh) minmax(0, 1fr);
	}

	.lite-col-draw {
		grid-column: 1 / 2;
		grid-row: 1 / 2;
		grid-template-columns: auto minmax(0, 1fr);
		grid-template-rows: minmax(0, 1fr) auto;
		grid-template-areas:
			'chrome stage'
			'glyphnav glyphnav';
		border-right: 0;
		border-bottom: 1px solid var(--fx-border-strong);
	}

	.lite-col-draw .lite-glyphs {
		display: none;
	}

	.lite-col-preview {
		grid-column: 1 / 2;
		grid-row: 2 / 3;
		border-right: 0;
	}

	.lite-col-controls {
		grid-column: 2 / 3;
		grid-row: 1 / 3;
	}

	.lite-col-controls .lite-tools__panel {
		display: flex !important;
	}
}

@media (max-width: 720px) {
	.lite-body {
		grid-template-columns: 1fr;
		grid-template-rows: minmax(280px, 50vh) minmax(120px, 24vh) minmax(0, 1fr);
	}

	.lite-col-draw,
	.lite-col-preview,
	.lite-col-controls {
		grid-column: 1 / -1;
		grid-row: auto;
		height: auto;
		min-height: 0;
	}

	.lite-col-draw {
		grid-template-columns: auto minmax(0, 1fr);
		grid-template-rows: minmax(0, 1fr) auto;
		grid-template-areas:
			'chrome stage'
			'glyphnav glyphnav';
		min-height: 50vh;
	}

	.lite-col-controls {
		border-top: 1px solid var(--fx-border-strong);
		max-height: 36vh;
	}
}

@media (min-width: 1280px) {
	:root {
		/* Prefer height-driven board width so the square fills stage height */
		--lite-draw-w: min(640px, 48vw, 74vh);
		--lite-controls-w: min(250px, 18vw);
	}

	.lite-col-draw {
		grid-template-columns: auto minmax(0, 1fr);
		grid-template-rows: minmax(0, 1fr) auto minmax(100px, 14%);
		grid-template-areas:
			'chrome stage'
			'glyphnav glyphnav'
			'glyphs glyphs';
	}
}
