:root[data-theme="light"] {
	--bg-a: #f4f7f2;
	--bg-b: #dde6e0;
	--panel: #fffefa;
	--panel-surface: #fffefa;
	--panel-shadow: 0 12px 28px rgba(17, 26, 22, 0.08);
	--ink: #13211a;
	--ink-soft: #455a50;
	--accent: #0a7a5a;
	--accent-2: #315fc4;
	--line: #c6d2ca;
	--control-border: color-mix(in srgb, var(--accent) 50%, black);
	--control-bg-top: #edf8f2;
	--control-bg-bottom: #d9eee3;
	--control-ink: var(--ink);
	--input-bg: #ffffff;
	--input-ink: var(--ink);
	--surface-soft: #f3f7f4;
	--surface-strong: #ffffff;
	--preview-bg: #12161c;
	--theme-btn-bg-top: #fff4bf;
	--theme-btn-bg-bottom: #ffdf7e;
	--theme-btn-border: #c89b2b;
	--theme-btn-ink: #3b2b08;
}

:root,
:root[data-theme="dark"] {
	--bg-a: #151719;
	--bg-b: #20231f;
	--panel: #20241f;
	--panel-surface: #222720;
	--panel-shadow: 0 14px 30px rgba(0, 0, 0, 0.32);
	--ink: #eef2e8;
	--ink-soft: #bdc9b8;
	--accent: #79bf88;
	--accent-2: #7fb4de;
	--line: #465141;
	--control-border: #63705d;
	--control-bg-top: #31392f;
	--control-bg-bottom: #2a3228;
	--control-ink: #f1f7ec;
	--input-bg: #171b16;
	--input-ink: #f1f7ec;
	--surface-soft: #252c23;
	--surface-strong: #1b201a;
	--preview-bg: #101418;
	--theme-btn-bg-top: #ffeaa3;
	--theme-btn-bg-bottom: #e0c166;
	--theme-btn-border: #b88f2f;
	--theme-btn-ink: #2f2204;
}

:root[data-theme="grey"] {
	--bg-a: #4f5652;
	--bg-b: #3f4744;
	--panel: #59625d;
	--panel-surface: #5f6863;
	--panel-shadow: 0 12px 24px rgba(20, 24, 22, 0.34);
	--ink: #f2f6f0;
	--ink-soft: #d1dbd1;
	--accent: #a9d08e;
	--accent-2: #a6c3ef;
	--line: #879287;
	--control-border: #a0aaa0;
	--control-bg-top: #737d74;
	--control-bg-bottom: #657066;
	--control-ink: #f6faf4;
	--input-bg: #535d55;
	--input-ink: #f6faf4;
	--surface-soft: #56615a;
	--surface-strong: #667067;
	--preview-bg: #11161b;
	--theme-btn-bg-top: #eceff4;
	--theme-btn-bg-bottom: #cfd5df;
	--theme-btn-border: #9aa5b5;
	--theme-btn-ink: #2a3440;
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	min-height: 100vh;
	font-family: "Space Grotesk", system-ui, sans-serif;
	color: var(--ink);
	background:
		linear-gradient(160deg, color-mix(in srgb, var(--bg-a) 86%, #0f7354 14%), var(--bg-b));
}

.app {
	width: min(1380px, 96vw);
	margin: 24px auto 40px;
	display: grid;
	gap: 14px;
}

.app-header-title-row {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	flex-wrap: wrap;
	gap: 12px;
}

.app-header h1 {
	margin: 0;
	font-size: clamp(1.5rem, 3vw, 2.2rem);
	letter-spacing: 0;
}

.return-main-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 1px solid var(--control-border);
	border-radius: 8px;
	padding: 8px 12px;
	background: linear-gradient(180deg, var(--control-bg-top), var(--control-bg-bottom));
	color: var(--control-ink);
	line-height: 1.15;
	text-decoration: none;
	white-space: nowrap;
}

.return-main-link:hover {
	border-color: color-mix(in srgb, var(--accent) 65%, var(--control-border));
}

.app-header p {
	margin: 4px 0 0;
	color: var(--ink-soft);
}

.mode-tabs {
	display: inline-flex;
	flex-wrap: wrap;
	gap: 6px;
	align-items: center;
	border: 1px solid var(--line);
	border-radius: 8px;
	padding: 5px;
	background: var(--surface-strong);
	width: fit-content;
	max-width: 100%;
}

.mode-tab {
	border-color: transparent;
	background: transparent;
	box-shadow: none;
}

.mode-tab.is-active {
	border-color: color-mix(in srgb, var(--accent) 70%, var(--control-border));
	background: linear-gradient(180deg, var(--control-bg-top), var(--control-bg-bottom));
	box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent);
}

.panel {
	background: var(--panel-surface);
	border: 1px solid var(--line);
	border-radius: 8px;
	padding: 14px;
	box-shadow: var(--panel-shadow);
}

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

.panel h2 {
	margin: 0;
	font-size: 1.05rem;
	letter-spacing: 0;
}

.inline-controls {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
	font-size: 0.95rem;
}

.physical-size-control {
	display: grid;
	grid-template-columns: minmax(86px, 100px) auto;
	gap: 8px;
	align-items: center;
}

.conversion-readout {
	color: var(--ink);
	font-family: "IBM Plex Mono", ui-monospace, monospace;
	font-size: 0.82rem;
	white-space: nowrap;
}

.theme-toggle-btn {
	position: fixed;
	top: 12px;
	right: 12px;
	z-index: 140;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 1.25rem;
	border: 1px solid var(--theme-btn-border);
	background: linear-gradient(180deg, var(--theme-btn-bg-top), var(--theme-btn-bg-bottom));
	color: var(--theme-btn-ink);
	box-shadow: 0 7px 20px rgba(12, 18, 15, 0.22);
	line-height: 1;
	padding: 0;
}

.theme-toggle-btn:focus-visible {
	outline: 2px solid color-mix(in srgb, var(--accent) 65%, white);
	outline-offset: 2px;
}

button,
input,
select {
	font: inherit;
}

button {
	border: 1px solid var(--control-border);
	background: linear-gradient(180deg, var(--control-bg-top), var(--control-bg-bottom));
	color: var(--control-ink);
	border-radius: 8px;
	padding: 8px 12px;
	cursor: pointer;
	line-height: 1.15;
}

button:hover:not(:disabled) {
	border-color: color-mix(in srgb, var(--accent) 65%, var(--control-border));
}

button:disabled {
	border-color: color-mix(in srgb, var(--control-border) 55%, var(--panel-surface));
	background: color-mix(in srgb, var(--control-bg-bottom) 45%, var(--panel-surface));
	color: color-mix(in srgb, var(--control-ink) 42%, var(--ink-muted));
	box-shadow: none;
	cursor: not-allowed;
	opacity: 0.62;
}

button:focus-visible,
.return-main-link:focus-visible,
input:focus-visible,
select:focus-visible {
	outline: 2px solid color-mix(in srgb, var(--accent) 70%, white);
	outline-offset: 2px;
}

textarea,
input,
select {
	font-family: "IBM Plex Mono", ui-monospace, monospace;
	border: 1px solid var(--line);
	background: var(--input-bg);
	color: var(--input-ink);
	border-radius: 6px;
	padding: 7px 8px;
	min-height: 36px;
}

label {
	display: grid;
	gap: 4px;
	color: var(--ink-soft);
	font-size: 0.86rem;
}

label input,
label select {
	color: var(--input-ink);
	font-size: 0.92rem;
}

.checkbox-label {
	display: flex;
	align-items: center;
	gap: 8px;
	color: var(--ink);
	min-height: 36px;
}

.checkbox-label input {
	min-height: auto;
}

.checkbox-label.is-disabled {
	opacity: 0.58;
}

.filament-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
	gap: 10px;
	align-items: start;
}

.filament-slot {
	display: grid;
	gap: 7px;
	padding: 9px;
	border: 1px solid var(--line);
	border-radius: 8px;
	background: var(--surface-soft);
	align-self: start;
}

.filament-slot-label {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 8px;
	font-size: 0.9rem;
	color: var(--ink);
}

.channel-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 26px;
	border-radius: 6px;
	border: 1px solid var(--line);
	background: var(--surface-strong);
	font-family: "IBM Plex Mono", ui-monospace, monospace;
	font-weight: 500;
}

.filament-slot-row {
	display: flex;
	gap: 8px;
	align-items: center;
}

.filament-slot-field-label {
	min-width: 24px;
	color: var(--ink-soft);
	font-family: "IBM Plex Mono", ui-monospace, monospace;
	font-size: 0.82rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.filament-slot-row .filament-color-input,
.filament-slot-row .filament-name-input,
.filament-slot-row .color-picker,
.filament-slot-row .filament-td-input {
	flex: 1 1 auto;
	min-width: 0;
}

.filament-slot-row .color-picker .cp_input {
	display: none !important;
}

.filament-slot-row .color-picker .cp_button {
	flex: 1 1 auto;
	aspect-ratio: auto;
	width: 100%;
}

.filament-slot-row .color-picker .cp_caret {
	display: none;
}

.filament-preset-btn.is-active {
	border-color: color-mix(in srgb, var(--accent) 78%, black);
	box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 50%, transparent);
}

.settings-grid,
.sheet-options {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 10px;
	margin-top: 10px;
}

.advanced-config .settings-grid {
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	align-items: end;
}

.sheet-options {
	border-top: 1px solid var(--line);
	padding-top: 10px;
}

.top-surface-options {
	grid-template-columns: repeat(12, minmax(0, 1fr));
	align-items: end;
}

.top-surface-options > label,
.top-surface-options > .checkbox-label {
	grid-column: span 3;
	min-width: 0;
}

.top-surface-options select,
.top-surface-options input {
	width: 100%;
	min-width: 0;
}

.top-surface-options .top-surface-wide-option {
	grid-column: span 4;
}

.top-surface-options .top-surface-compact-option {
	align-self: end;
	min-height: 36px;
}

.top-surface-options .top-surface-compact-option input {
	width: auto;
	min-width: auto;
}

.top-surface-options .range-label {
	grid-column: span 4;
}

.sheet-gallery {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
	gap: 10px;
	margin-top: 4px;
}

.sheet-card {
	display: grid;
	gap: 8px;
	padding: 8px;
	text-align: left;
	background: var(--surface-soft);
	border-color: var(--line);
}

.sheet-card canvas {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 6px;
	background: var(--preview-bg);
	border: 1px solid rgba(255, 255, 255, 0.12);
}

.sheet-card span {
	font-weight: 600;
}

.sheet-card.is-active {
	border-color: color-mix(in srgb, var(--accent) 80%, black);
	box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 55%, transparent);
}

.range-label {
	grid-template-columns: 1fr auto;
	align-items: center;
	column-gap: 10px;
}

.range-label input {
	grid-column: 1 / -1;
	width: 100%;
	padding: 0;
	min-height: 28px;
	accent-color: var(--accent);
}

.range-value {
	color: var(--ink);
	font-family: "IBM Plex Mono", ui-monospace, monospace;
	font-size: 0.82rem;
}

.filament-select-control {
	display: grid;
	gap: 6px;
	color: var(--ink-soft);
	font-size: 0.86rem;
	grid-column: 1 / -1;
}

.filament-select-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
	gap: 8px 12px;
}

.compact-checkbox-label {
	min-height: 30px;
}

.advanced-config {
	margin-top: 10px;
	border-top: 1px solid var(--line);
	padding-top: 10px;
}

.advanced-config summary {
	cursor: pointer;
	color: var(--ink);
	font-weight: 600;
}

.advanced-config label {
	min-width: 0;
}

.advanced-config label input,
.advanced-config label select {
	width: 100%;
	min-width: 0;
}

.advanced-config .checkbox-label input {
	width: auto;
}

.footer-text-control {
	display: grid;
	grid-template-columns: auto minmax(220px, 1fr);
	gap: 10px;
	align-items: end;
	grid-column: 1 / -1;
}

.header-append-label {
	grid-column: 1 / -1;
}

.header-append-label input {
	width: 100%;
}

.footer-override-label {
	min-width: 0;
}

.footer-override-label input {
	width: 100%;
}

@media (max-width: 640px) {
	.top-surface-options {
		grid-template-columns: 1fr;
	}

	.top-surface-options > label,
	.top-surface-options > .checkbox-label,
	.top-surface-options .top-surface-wide-option,
	.top-surface-options .range-label {
		grid-column: 1 / -1;
	}

	.footer-text-control {
		grid-template-columns: 1fr;
	}
}

.import-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: end;
}

.file-control {
	min-width: min(320px, 100%);
}

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

.decoded-metadata {
	margin-top: 10px;
	border-top: 1px solid var(--line);
	padding-top: 10px;
}

.decoded-metadata summary {
	cursor: pointer;
	color: var(--ink);
	font-weight: 600;
}

.decoded-metadata pre {
	max-height: min(48vh, 520px);
	overflow: auto;
	margin: 10px 0 0;
	padding: 10px;
	border: 1px solid var(--line);
	border-radius: 8px;
	background: var(--surface-strong);
	color: var(--ink);
	font-family: "IBM Plex Mono", ui-monospace, monospace;
	font-size: 0.78rem;
	line-height: 1.35;
	white-space: pre-wrap;
	word-break: break-word;
}

.preview-meta.is-error {
	color: #ffb3a8;
}

.hidden {
	display: none !important;
}

.preview-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(220px, 300px);
	gap: 14px;
	align-items: start;
}

.preview-panel {
	min-width: 0;
}

.preview-title-status {
	display: inline-flex;
	align-items: baseline;
	gap: 10px;
	min-width: 0;
}

.preview-generating-status {
	position: absolute;
	inset: 0;
	z-index: 45;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.2);
	color: var(--ink);
	font-family: "IBM Plex Mono", ui-monospace, monospace;
	font-size: 0.82rem;
	white-space: nowrap;
	cursor: progress;
}

.preview-generating-status span {
	padding: 7px 12px;
	border: 1px solid color-mix(in srgb, var(--line) 70%, white);
	border-radius: 8px;
	background: color-mix(in srgb, var(--panel-surface) 88%, black);
	box-shadow: 0 10px 28px rgba(0, 0, 0, 0.32);
}

.preview-column {
	display: grid;
	gap: 14px;
	min-width: 0;
}

.side-surface-preview-panels {
	display: grid;
	gap: 14px;
	min-width: 0;
}

.side-surface-preview-panel .preview-frame,
.preview-frame.no-inner-scroll {
	overflow: visible;
	max-height: none;
}

.download-group {
	position: relative;
	display: inline-flex;
	align-items: stretch;
}

.download-group #downloadRawBtn {
	border-radius: 8px 0 0 8px;
}

.download-menu-btn {
	width: 42px;
	border-left: 0;
	border-radius: 0 8px 8px 0;
	padding: 8px 0;
	font-family: "IBM Plex Mono", ui-monospace, monospace;
}

.download-menu {
	position: absolute;
	right: 0;
	top: calc(100% + 6px);
	z-index: 20;
	width: 260px;
	background: var(--panel-surface);
	border: 1px solid var(--line);
	border-radius: 8px;
	box-shadow: var(--panel-shadow);
	padding: 6px;
}

.download-menu button {
	width: 100%;
	text-align: left;
}

.preview-frame {
	position: relative;
	overflow: auto;
	background:
		linear-gradient(45deg, rgba(255, 255, 255, 0.06) 25%, transparent 25%),
		linear-gradient(-45deg, rgba(255, 255, 255, 0.06) 25%, transparent 25%),
		linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.06) 75%),
		linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.06) 75%),
		var(--preview-bg);
	background-size: 24px 24px;
	background-position: 0 0, 0 12px, 12px -12px, -12px 0;
	border: 1px solid var(--line);
	border-radius: 8px;
	max-height: min(70vh, 820px);
}

#previewCanvas,
#rawDownloadCanvas,
#rawMiniCanvas,
.sheet-card canvas,
.side-surface-preview-panel canvas {
	display: block;
	width: 100%;
	height: auto;
	background: transparent;
	image-rendering: pixelated;
	image-rendering: crisp-edges;
}

.patch-hover-enabled {
	cursor: crosshair;
}

.top-surface-patch-tooltip {
	position: fixed;
	z-index: 40;
	width: min(420px, calc(100vw - 24px));
	max-height: min(460px, calc(100vh - 24px));
	overflow: auto;
	padding: 10px;
	border: 1px solid color-mix(in srgb, var(--accent) 36%, var(--line));
	border-radius: 8px;
	background: color-mix(in srgb, var(--panel-surface) 94%, black);
	box-shadow: 0 16px 34px rgba(0, 0, 0, 0.34);
	color: var(--ink);
	pointer-events: none;
	font-size: 0.84rem;
}

:root[data-theme="light"] .top-surface-patch-tooltip {
	background: color-mix(in srgb, var(--panel-surface) 96%, white);
	box-shadow: 0 16px 34px rgba(17, 26, 22, 0.18);
}

.patch-tooltip-title {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 8px;
	margin-bottom: 8px;
	font-weight: 700;
}

.patch-tooltip-title span {
	color: var(--ink-soft);
	font-family: "IBM Plex Mono", ui-monospace, monospace;
	font-size: 0.76rem;
	font-weight: 500;
}

.patch-tooltip-body {
	display: grid;
	grid-template-columns: 42px minmax(0, 1fr);
	gap: 10px;
	align-items: start;
}

.patch-tooltip-body.no-stack-preview {
	grid-template-columns: minmax(0, 1fr);
}

.patch-stack-preview {
	display: flex;
	flex-direction: column;
	width: 42px;
	height: 180px;
	overflow: hidden;
	border: 1px solid rgba(255, 255, 255, 0.28);
	border-radius: 6px;
	background: var(--preview-bg);
}

:root[data-theme="light"] .patch-stack-preview {
	border-color: rgba(0, 0, 0, 0.22);
}

.patch-stack-layer {
	flex: 1 1 0;
	min-height: 3px;
	border-top: 1px solid rgba(0, 0, 0, 0.22);
}

.patch-stack-layer:first-child {
	border-top: 0;
}

.raw-offset-tooltip-visual {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 68px;
	gap: 10px;
	align-items: stretch;
	margin-bottom: 8px;
	min-width: 0;
}

.raw-offset-stack-preview {
	display: flex;
	flex-direction: column;
	justify-content: stretch;
	gap: 3px;
	min-width: 0;
	height: 118px;
	padding: 6px;
	border: 1px solid rgba(255, 255, 255, 0.22);
	border-radius: 6px;
	background: color-mix(in srgb, var(--preview-bg) 82%, black);
}

:root[data-theme="light"] .raw-offset-stack-preview {
	border-color: rgba(0, 0, 0, 0.18);
	background: color-mix(in srgb, var(--preview-bg) 72%, white);
}

.raw-offset-stack-row {
	flex: 1 1 0;
	min-height: 14px;
	display: flex;
	align-items: stretch;
	min-width: 0;
}

.raw-offset-stack-fill {
	width: var(--offset-width, 18%);
	min-width: 18%;
	display: flex;
	align-items: center;
	justify-content: flex-start;
	padding: 0 6px;
	border-radius: 4px;
	background: var(--filament-color, #fff);
	box-shadow:
		inset 0 0 0 1px rgba(255, 255, 255, 0.52),
		0 0 0 1px rgba(0, 0, 0, 0.56);
	color: #101412;
	font-family: "IBM Plex Mono", ui-monospace, monospace;
	font-size: 0.68rem;
	font-weight: 700;
	line-height: 1;
	overflow: hidden;
}

.raw-offset-stack-fill.is-dark-fill {
	box-shadow:
		inset 0 0 0 1px rgba(255, 255, 255, 0.72),
		0 0 0 1px rgba(255, 255, 255, 0.42),
		0 1px 4px rgba(255, 255, 255, 0.22);
	color: #f4f7f2;
}

.raw-offset-stack-fill span {
	text-shadow: 0 1px 2px rgba(255, 255, 255, 0.55);
}

.raw-offset-stack-fill.is-dark-fill span {
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
}

.raw-offset-predicted-color {
	min-height: 118px;
	border: 1px solid rgba(255, 255, 255, 0.28);
	border-radius: 6px;
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.16);
	background: var(--preview-bg);
}

:root[data-theme="light"] .raw-offset-predicted-color {
	border-color: rgba(0, 0, 0, 0.22);
}

.patch-tooltip-meta {
	display: grid;
	gap: 5px;
	min-width: 0;
}

.patch-tooltip-row {
	display: grid;
	grid-template-columns: 86px minmax(0, 1fr);
	gap: 8px;
	line-height: 1.25;
}

.patch-tooltip-body.no-stack-preview .patch-tooltip-row {
	grid-template-columns: 112px minmax(0, 1fr);
}

.patch-tooltip-row dt {
	color: var(--ink-soft);
}

.patch-tooltip-row dd {
	margin: 0;
	min-width: 0;
	word-break: normal;
	overflow-wrap: anywhere;
	font-family: "IBM Plex Mono", ui-monospace, monospace;
	font-size: 0.78rem;
}

.patch-slot-counts {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
}

.patch-slot-chip {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	min-width: 0;
}

.patch-slot-chip::before {
	content: "";
	width: 11px;
	height: 11px;
	flex: 0 0 auto;
	border-radius: 2px;
	border: 1px solid rgba(255, 255, 255, 0.35);
	background: var(--chip-color, #fff);
}

.preview-toggle {
	margin-top: 8px;
	display: flex;
	align-items: center;
}

.raw-download-preview {
	margin-top: 6px;
	display: grid;
	gap: 6px;
}

.raw-preview-frame {
	max-height: min(48vh, 520px);
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
}

#rawDownloadCanvas {
	display: block;
	width: auto;
	max-width: 100%;
	max-height: min(48vh, 520px);
	height: auto;
	background: transparent;
}

.preview-meta {
	margin-top: 8px;
	color: var(--ink-soft);
	font-family: "IBM Plex Mono", ui-monospace, monospace;
	font-size: 0.82rem;
	word-break: break-word;
}

.channel-panel {
	display: grid;
	gap: 10px;
}

.channel-legend {
	display: grid;
	gap: 8px;
}

.legend-row {
	display: grid;
	grid-template-columns: 32px 1fr;
	gap: 8px;
	align-items: center;
	font-size: 0.9rem;
}

.legend-swatch {
	width: 32px;
	height: 32px;
	border-radius: 7px;
	border: 1px solid rgba(255, 255, 255, 0.32);
}

.legend-meta {
	display: grid;
	gap: 1px;
}

.legend-meta strong {
	font-size: 0.9rem;
}

.legend-meta span {
	color: var(--ink-soft);
	font-family: "IBM Plex Mono", ui-monospace, monospace;
	font-size: 0.78rem;
}

.raw-swatch {
	border: 1px solid var(--line);
	border-radius: 8px;
	padding: 8px;
	background: var(--surface-soft);
}

#rawMiniCanvas {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 6px;
}

@media (max-width: 880px) {
	.app-header-title-row {
		align-items: flex-start;
		flex-direction: column;
	}

	.panel-title-row {
		align-items: flex-start;
		flex-direction: column;
	}

	.preview-layout {
		grid-template-columns: 1fr;
	}

	.theme-toggle-btn {
		position: absolute;
	}
}
