:root {
	color-scheme: light;
	--bg: #e9dcc6;
	--paper: #f6ead5;
	--paper-deep: #ead3ae;
	--panel: #f8ecd8;
	--panel-line: #c8ad7e;
	--paper-rule: rgba(47, 131, 198, 0.16);
	--paper-margin: rgba(239, 93, 119, 0.16);
	--ink: #273242;
	--text: #273242;
	--muted: #6f7f86;
	--blue: #276fa8;
	--green: #347c61;
	--pink: #ef5d77;
	--yellow: #f0c75e;
	--navy: #101b2e;
	--accent: var(--blue);
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	min-height: 100vh;
	background:
		linear-gradient(135deg, rgba(255, 249, 237, 0.74), rgba(232, 244, 248, 0.42)),
		url("space-background.jpg") center / cover fixed,
		var(--bg);
	color: var(--text);
	font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.toy-shell {
	display: grid;
	width: min(100%, 1360px);
	margin-inline: auto;
	grid-template-columns: minmax(500px, 1.18fr) minmax(320px, 0.82fr);
	grid-template-areas:
		"intro intro"
		"sheet preview"
		"credits credits";
	gap: 16px;
	padding: 18px;
	align-items: start;
}

.intro-panel {
	grid-area: intro;
	display: flex;
	align-items: end;
	justify-content: space-between;
	gap: 18px;
	padding: 14px 18px 16px;
	border: 2px solid rgba(39, 50, 66, 0.24);
	border-radius: 12px;
	background:
		linear-gradient(90deg, transparent 0 31px, rgba(239, 93, 119, 0.12) 32px 34px, transparent 35px),
		repeating-linear-gradient(0deg, transparent 0 26px, rgba(47, 131, 198, 0.12) 27px 28px),
		rgba(248, 236, 216, 0.9);
	box-shadow: 0 8px 0 rgba(39, 50, 66, 0.08), 0 16px 32px rgba(105, 82, 42, 0.13);
}

.intro-panel h1 {
	margin: 0 0 5px;
	color: var(--ink);
}

.intro-panel p {
	max-width: 760px;
	margin: 0;
	color: var(--ink);
	line-height: 1.42;
}

.intro-kicker {
	margin-bottom: 3px !important;
	color: var(--muted) !important;
	font-size: 12px;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.intro-note {
	flex: 0 0 auto;
	max-width: 230px !important;
	color: var(--muted) !important;
	font-size: 12px;
	text-align: right;
}

.credits-panel {
	grid-area: credits;
	display: flex;
	justify-content: space-between;
	gap: 12px;
	padding: 0 4px 2px;
	color: rgba(39, 50, 66, 0.78);
	font-size: 12px;
	line-height: 1.35;
}

.panel {
	background:
		linear-gradient(90deg, transparent 0 31px, var(--paper-margin) 32px 34px, transparent 35px),
		repeating-linear-gradient(0deg, transparent 0 26px, var(--paper-rule) 27px 28px),
		linear-gradient(rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.28)),
		var(--panel);
	border: 2px solid var(--panel-line);
	border-radius: 12px;
	box-shadow: 0 10px 0 rgba(39, 50, 66, 0.08), 0 18px 34px rgba(105, 82, 42, 0.16);
	padding: 16px;
	position: relative;
	overflow: visible;
}

.panel:hover,
.panel:focus-within {
	z-index: 3;
}

h1,
h2,
h3,
p {
	margin-top: 0;
}

h1 {
	margin-bottom: 4px;
	font-size: 22px;
	letter-spacing: 0;
	color: var(--green);
}

h2 {
	font-size: 22px;
	letter-spacing: 0;
	color: var(--blue);
}

.section-heading,
.metadata-header,
.preview-output-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
}

.section-heading,
.preview-output-header h2 {
	font-size: 22px;
	line-height: 1.15;
}

.sheet-panel > .section-heading {
	color: var(--ink);
}

.preview-panel > header .section-heading {
	color: var(--green);
}

.preview-output-header h2 {
	color: var(--blue);
	margin-bottom: 0;
}

.heading-aside {
	color: var(--muted);
	font-size: 0.72em;
	font-weight: 700;
	white-space: nowrap;
}

.step-number {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	margin-right: 10px;
	padding-top: 2px;
	border: 2px solid currentColor;
	border-radius: 50%;
	background: #f8efdf;
	font-size: 18px;
	font-weight: 900;
	line-height: 0.95;
	vertical-align: middle;
}

.step-number span {
	font-size: 8px;
	font-weight: 900;
	line-height: 1;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.sheet-panel {
	grid-area: sheet;
}

.sheet-panel .friend-image-panel,
.sheet-panel .rig-file-panel {
	border-color: rgba(39, 50, 66, 0.22);
}

.sheet-panel .toolbar-label,
.sheet-panel .inline-field span,
.sheet-panel .source-key-inline-control span,
.sheet-panel .metadata-header h3 {
	color: var(--ink);
}

.sheet-panel .sheet-toolbar {
	border-color: rgba(39, 50, 66, 0.32);
}

.sheet-panel .tool-separator {
	background: rgba(39, 50, 66, 0.22);
}

.sheet-panel .help-tip {
	border-color: rgba(39, 50, 66, 0.34);
	color: var(--ink);
}

.sheet-panel .rig-panel {
	border-color: rgba(39, 50, 66, 0.28);
}

.sheet-panel .metadata-badge {
	background: rgba(39, 50, 66, 0.08);
	border-color: rgba(39, 50, 66, 0.28);
	color: var(--ink);
}

.preview-panel {
	grid-area: preview;
	background:
		linear-gradient(90deg, transparent 0 31px, rgba(239, 93, 119, 0.14) 32px 34px, transparent 35px),
		repeating-linear-gradient(0deg, transparent 0 26px, rgba(61, 148, 111, 0.14) 27px 28px),
		linear-gradient(rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.3)),
		var(--panel);
}

.sheet-setup {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 8px;
	margin-bottom: 12px;
}

.sheet-setup-row {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	grid-column: 1 / -1;
	gap: 8px;
	align-items: end;
}

.friend-image-panel,
.rig-file-panel {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 8px;
	padding: 10px;
	border: 2px solid rgba(47, 131, 198, 0.22);
	border-radius: 8px;
	background: rgba(255, 253, 247, 0.56);
}

.friend-image-panel .file-field,
.rig-file-panel .file-field {
	margin-bottom: 0;
}

.panel-hint {
	margin: 0;
	color: var(--muted);
	font-size: 12px;
	line-height: 1.35;
}

.friend-image-row,
.rig-file-row {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 8px;
	align-items: end;
}

.rig-file-actions {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 8px;
	justify-content: start;
}

.friend-image-panel .icon-button,
.rig-file-panel .icon-button {
	min-width: 38px;
	min-height: 38px;
}

.rig-file-actions .icon-button {
	width: 100%;
	padding: 0 9px;
	font-size: 12px;
}

.preview-tools {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 12px;
	margin-bottom: 10px;
}

.preview-tools-below {
	justify-content: space-between;
	flex-wrap: nowrap;
	margin-top: 10px;
	margin-bottom: 0;
}

.preview-tools-below > .icon-button {
	width: 38px;
	flex: 0 0 auto;
}

.preview-tools-below > .toggle-row {
	width: auto;
	flex: 0 1 auto;
	margin-left: auto;
	white-space: nowrap;
}

.sheet-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-start;
	gap: 6px;
	margin-bottom: 12px;
	padding: 8px 10px;
	border: 2px solid rgba(47, 131, 198, 0.34);
	border-radius: 10px;
	background: rgba(255, 250, 240, 0.68);
}

.sheet-panel.is-rig-mode .mode-note {
	border-color: rgba(52, 124, 97, 0.36);
	background: rgba(223, 245, 235, 0.72);
	color: var(--ink);
}

.tool-cluster {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
}

.sheet-tool-line {
	flex-wrap: wrap;
	width: 100%;
	overflow: visible;
}

.toolbar-label {
	color: var(--blue);
	font-weight: 800;
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	white-space: nowrap;
}

.stacked-toolbar-label {
	line-height: 0.95;
	text-align: center;
	white-space: normal;
}

.sheet-tool-help {
	flex: 0 0 auto;
	order: 99;
	margin-left: auto;
}

.sheet-tool-line .button-icon,
.sheet-tool-line .toolbar-icon {
	width: 18px;
	height: 18px;
}

.tool-action-group {
	display: inline-flex;
	flex: 0 0 auto;
	flex-wrap: nowrap;
	align-items: center;
	gap: 6px;
}

.tool-separator {
	flex: 0 0 1px;
	align-self: stretch;
	min-height: 28px;
	background: rgba(47, 131, 198, 0.22);
}

.toggle-row {
	display: inline-flex;
	grid-auto-flow: column;
	align-items: center;
	gap: 8px;
	margin-bottom: 0;
	color: var(--ink);
	font-weight: 700;
}

.toggle-row input {
	width: auto;
	margin: 0;
}

.toggle-row .help-tip {
	margin-left: 2px;
}

h3 {
	margin-bottom: 0;
	font-size: 14px;
}

p,
.note {
	color: var(--muted);
}

canvas {
	display: block;
	width: 100%;
	border: 2px solid #c9b285;
	border-radius: 8px;
	background: #f7edd9;
	box-shadow: inset 0 0 0 1px rgba(255, 250, 240, 0.72);
}

#sheet {
	width: 100%;
	height: 100%;
	image-rendering: pixelated;
}

.sheet-canvas-frame {
	position: relative;
	width: min(100%, clamp(640px, 55vw, 860px));
	aspect-ratio: 297 / 210;
	margin-inline: auto;
	border-radius: 10px;
}

.sheet-canvas-frame::before {
	content: attr(data-mode-label);
	position: absolute;
	z-index: 4;
	top: 10px;
	left: 10px;
	padding: 5px 8px;
	border: 2px solid rgba(39, 50, 66, 0.28);
	border-radius: 999px;
	background: rgba(255, 253, 247, 0.9);
	color: var(--ink);
	font-size: 11px;
	font-weight: 900;
	line-height: 1;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	pointer-events: none;
}

.sheet-canvas-frame[data-mode="rig"]::before {
	border-color: rgba(52, 124, 97, 0.46);
	background: rgba(223, 245, 235, 0.94);
	color: #1c5c43;
}

.sheet-canvas-frame[data-mode="paint"] #sheet {
	border-color: #c9b285;
}

.sheet-canvas-frame[data-mode="rig"] #sheet {
	border-color: #c9b285;
}

.mode-note {
	margin-top: 6px;
	padding: 7px 9px;
	border: 1px solid rgba(39, 50, 66, 0.18);
	border-radius: 8px;
	background: rgba(255, 253, 247, 0.54);
}

.preview-stage {
	position: relative;
	width: min(100%, 480px);
	margin-inline: auto;
}

#preview {
	width: 100%;
	max-width: 100%;
	aspect-ratio: 1;
	height: auto;
	margin-inline: auto;
	image-rendering: auto;
	border-color: #243554;
	background:
		radial-gradient(circle at 22% 18%, rgba(240, 199, 94, 0.9) 0 2px, transparent 3px),
		radial-gradient(circle at 72% 28%, rgba(255, 255, 255, 0.72) 0 1.5px, transparent 2.5px),
		linear-gradient(#101b2e, #17233b 72%, #26334f);
	box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.06), 0 8px 0 rgba(16, 27, 46, 0.12);
}

.preview-output {
	margin-top: 16px;
	padding-top: 14px;
	border-top: 2px dashed rgba(61, 148, 111, 0.28);
}

.preview-output-header {
	margin-bottom: 12px;
}

.preview-output-header .note {
	margin-bottom: 0;
}

.preview-settings-grid {
	display: grid;
	gap: 8px;
	margin-bottom: 12px;
}

.compact-select-grid {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

.shared-preview-settings {
	grid-template-columns: repeat(5, minmax(0, 1fr));
}

.animation-pad {
	position: absolute;
	z-index: 5;
	top: 10px;
	right: 10px;
	display: grid;
	grid-template-columns: repeat(3, 30px);
	justify-content: center;
	gap: 4px;
	margin: 0;
	padding: 6px;
	border: 1px solid rgba(52, 124, 97, 0.24);
	border-radius: 8px;
	background: rgba(248, 239, 223, 0.78);
	box-shadow: 0 6px 12px rgba(16, 27, 46, 0.12);
}

.animation-pad button {
	min-height: 26px;
	padding: 0;
	border-width: 1px;
	border-color: rgba(52, 124, 97, 0.34);
	background: rgba(248, 239, 223, 0.9);
	color: var(--green);
	font-size: 0;
	font-weight: 900;
	line-height: 1;
	letter-spacing: 0;
}

.animation-pad button::before {
	font-size: 15px;
	text-transform: uppercase;
}

.animation-pad button[data-animation-key="nw"]::before {
	content: "\2196";
}

.animation-pad button[data-animation-key="n"]::before {
	content: "\2191";
}

.animation-pad button[data-animation-key="ne"]::before {
	content: "\2197";
}

.animation-pad button[data-animation-key="w"]::before {
	content: "\2190";
}

.animation-pad button[data-animation-key="jump"]::before {
	content: "J";
	font-size: 10px;
}

.animation-pad button[data-animation-key="e"]::before {
	content: "\2192";
}

.animation-pad button[data-animation-key="sw"]::before {
	content: "\2199";
}

.animation-pad button[data-animation-key="s"]::before {
	content: "\2193";
}

.animation-pad button[data-animation-key="se"]::before {
	content: "\2198";
}

.animation-pad button.is-active {
	background: #dff5eb;
	border-color: var(--green);
	box-shadow: inset 0 0 0 2px rgba(84, 235, 199, 0.18);
	color: #1c5c43;
}

.animation-pad .wander-button {
	grid-column: 1 / -1;
	min-height: 24px;
	font-size: 10px;
	text-transform: uppercase;
}

.animation-pad .wander-button::before {
	content: none;
}

.preview-pause-button {
	position: absolute;
	z-index: 5;
	right: 10px;
	bottom: 10px;
	width: 34px;
	min-width: 34px;
	min-height: 34px;
	background: rgba(248, 239, 223, 0.86);
	box-shadow: 0 6px 12px rgba(16, 27, 46, 0.12);
}

.export-panel-grid {
	display: grid;
	grid-template-columns: minmax(0, 6fr) minmax(0, 4fr);
	gap: 10px;
}

.export-panel {
	display: grid;
	gap: 10px;
	align-content: start;
	padding: 10px;
	border: 2px solid rgba(205, 185, 143, 0.82);
	border-radius: 8px;
	background: rgba(255, 253, 247, 0.74);
}

.export-panel-heading {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
}

.export-panel-heading h3 {
	margin: 0;
	color: var(--blue);
}

.export-panel-heading span {
	color: var(--muted);
	font-size: 11px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.08em;
}

.sprite-export-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 76px;
	gap: 8px 6px;
	align-items: center;
}

.sprite-export-grid .icon-label-button {
	min-height: 44px;
}

.sprite-export-grid .xml-export-button {
	width: 76px;
	min-height: 44px;
	justify-self: end;
	padding: 8px 9px;
	font-size: 12px;
	background: rgba(248, 239, 223, 0.58);
	border-width: 1px;
	gap: 5px;
}

.heading-number-field {
	display: inline-grid;
	grid-template-columns: auto 52px;
	align-items: center;
	gap: 6px;
	margin-bottom: 0;
}

.heading-number-field span {
	color: var(--muted);
	font-size: 11px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.08em;
}

.heading-number-field input {
	width: 52px;
	padding: 5px 6px;
	font: 12px/1.2 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.compact-field {
	gap: 4px;
	margin-bottom: 0;
	font-size: 12px;
}

.compact-field span {
	color: var(--green);
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	font-size: 11px;
}

.compact-field select {
	padding: 8px 9px;
	font-size: 12px;
}

.compact-field input[type="number"] {
	padding: 8px 9px;
	font: 12px/1.2 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.compact-field .compact-color-input,
.source-key-inline-control .compact-color-input,
.toolbar-color-field .compact-color-input {
	width: 32px;
	height: 32px;
	padding: 0;
	border: 0;
	border-radius: 4px;
	background: currentColor;
	cursor: pointer;
	overflow: hidden;
	appearance: none;
	-webkit-appearance: none;
}

.compact-color-input::-webkit-color-swatch-wrapper {
	padding: 0;
}

.compact-color-input::-webkit-color-swatch {
	border: 0;
	border-radius: 4px;
}

.compact-color-input::-moz-color-swatch {
	border: 0;
	border-radius: 4px;
}

.toolbar-color-field {
	display: inline-flex;
	grid-auto-flow: column;
	align-items: center;
	gap: 8px;
	margin-bottom: 0;
}

.source-key-definition {
	margin: 0;
	color: var(--muted);
	font: 12px/1.35 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.source-key-line {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
	width: 100%;
	margin: 10px 0 0;
	color: var(--muted);
	font: 12px/1.35 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.source-key-line .help-tip {
	margin-left: auto;
}

.source-key-line > span + span::before {
	content: " | ";
	color: rgba(111, 127, 134, 0.42);
}

.source-key-inline-control {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 0;
	color: var(--muted);
	font: inherit;
}

.source-key-inline-control span {
	color: var(--blue);
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	font-size: 11px;
}

.source-key-inline-control output {
	color: var(--text);
	font: inherit;
}

.source-key-tolerance-control {
	min-width: 224px;
}

.source-key-tolerance-control input {
	width: 144px;
	height: 18px;
	accent-color: var(--accent);
}

.source-key-tolerance-control input[type="range"] {
	appearance: none;
	-webkit-appearance: none;
	background: transparent;
	cursor: pointer;
}

.source-key-tolerance-control input[type="range"]::-webkit-slider-runnable-track {
	height: 6px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.2);
}

.source-key-tolerance-control input[type="range"]::-webkit-slider-thumb {
	width: 16px;
	height: 16px;
	margin-top: -5px;
	border: 0;
	border-radius: 50%;
	background: var(--accent);
	-webkit-appearance: none;
}

.source-key-tolerance-control input[type="range"]::-moz-range-track {
	height: 6px;
	border: 0;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.2);
}

.source-key-tolerance-control input[type="range"]::-moz-range-thumb {
	width: 16px;
	height: 16px;
	border: 0;
	border-radius: 50%;
	background: var(--accent);
}

label {
	display: grid;
	gap: 7px;
	margin-bottom: 14px;
	color: var(--muted);
	font-size: 13px;
}

.inline-field {
	display: grid;
	grid-template-columns: 86px minmax(0, 1fr);
	align-items: center;
	gap: 10px;
	margin-bottom: 0;
}

.inline-field span {
	color: var(--blue);
	font-weight: 800;
}

.file-field input {
	padding: 7px 8px;
	min-width: 0;
}

select,
input,
button {
	width: 100%;
	border: 2px solid #cdb98f;
	border-radius: 8px;
	background: #f8efdf;
	color: var(--text);
	padding: 9px 10px;
}

button {
	cursor: pointer;
	background: #dbe9f5;
	font-family: inherit;
	text-transform: none;
	letter-spacing: 0;
	font-weight: 800;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
}

.button-icon,
.toolbar-icon {
	flex: 0 0 auto;
	width: 20px;
	height: 20px;
	filter: invert(34%) sepia(74%) saturate(908%) hue-rotate(173deg) brightness(90%) contrast(90%);
	pointer-events: none;
}

.toolbar-icon {
	width: 18px;
	height: 18px;
	opacity: 0.86;
}

button:disabled {
	opacity: 0.45;
	cursor: default;
	filter: none;
}

.icon-button,
.tool-button,
.size-button,
.icon-label-button {
	min-height: 38px;
}

.icon-button {
	min-width: 38px;
	padding: 0;
	font-size: 18px;
	line-height: 1;
}

.icon-button .button-icon {
	width: 21px;
	height: 21px;
}

.icon-label-button {
	font-size: 12px;
	text-transform: none;
	letter-spacing: 0.02em;
}

.secondary-export-button {
	background: rgba(248, 239, 223, 0.78);
}

.help-tip {
	position: relative;
	z-index: 6;
	flex: 0 0 auto;
	width: 24px;
	min-height: 24px;
	padding: 0;
	border: 2px solid rgba(39, 111, 168, 0.34);
	border-radius: 50%;
	background: #f8efdf;
	color: var(--blue);
	font: 800 14px/1 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	text-transform: none;
	letter-spacing: 0;
}

.help-tip::after {
	content: attr(data-tip);
	position: absolute;
	z-index: 20;
	right: 0;
	top: calc(100% + 8px);
	width: min(260px, 70vw);
	padding: 8px 10px;
	border: 2px solid rgba(39, 111, 168, 0.28);
	border-radius: 8px;
	background: #fff7e6;
	box-shadow: 0 8px 18px rgba(105, 82, 42, 0.2);
	color: var(--ink);
	font: 12px/1.35 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	text-align: left;
	white-space: normal;
	opacity: 0;
	pointer-events: none;
	transform: translateY(-4px);
	transition: opacity 120ms ease, transform 120ms ease;
}

.help-tip:hover::after,
.help-tip:focus-visible::after {
	opacity: 1;
	transform: translateY(0);
}

.help-tip:not([data-tip])::after {
	content: attr(title);
}

.tool-button {
	min-width: 42px;
	padding: 0 9px;
	border-width: 1px;
	font-size: 13px;
	text-transform: none;
	letter-spacing: 0.01em;
}

.sheet-tool-line .tool-button {
	min-height: 34px;
	min-width: 38px;
	padding: 0 7px;
	font-size: 12px;
}

.tool-button.is-active {
	background: #dff5eb;
	border-color: var(--green);
	color: #1c5c43;
}

.size-button {
	width: 34px;
	min-height: 34px;
	padding: 0;
	border-color: transparent;
	border-radius: 8px;
	background: transparent;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.size-button:hover,
.size-button:active {
	background: transparent;
	filter: none;
}

.size-dot {
	display: inline-block;
	border-radius: 999px;
	background: var(--ink);
	box-shadow: 0 0 0 0 transparent;
	transition: box-shadow 120ms ease, background 120ms ease;
}

.size-button.is-active .size-dot {
	background: var(--pink);
	box-shadow: 0 0 0 4px rgba(239, 93, 119, 0.22);
}

.size-dot-2 {
	width: 6px;
	height: 6px;
}

.size-dot-4 {
	width: 10px;
	height: 10px;
}

.size-dot-8 {
	width: 16px;
	height: 16px;
}

.size-dot-16 {
	width: 22px;
	height: 22px;
}

button:hover {
	filter: brightness(1.08);
}

button:active {
	transform: translateY(1px);
}

.rig-panel {
	margin-top: 12px;
	margin-bottom: 12px;
	padding: 10px;
	border: 2px dashed rgba(47, 131, 198, 0.28);
	border-radius: 10px;
	background: rgba(255, 250, 240, 0.56);
}

.metadata-header {
	margin-top: 0;
}

.rig-mode-hint {
	margin: 0;
	color: var(--ink);
	font-size: 12px;
	line-height: 1.35;
}

.advanced-rig-values {
	border-top: 1px dashed rgba(39, 50, 66, 0.18);
	padding-top: 8px;
}

.advanced-rig-values summary {
	cursor: pointer;
	color: var(--muted);
	font-size: 11px;
	font-weight: 800;
	line-height: 1.3;
	text-transform: uppercase;
	letter-spacing: 0.06em;
}

.advanced-rig-values[open] summary {
	color: var(--ink);
}

.metadata-readout {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 8px;
	margin-top: 10px;
	max-height: none;
	overflow: visible;
	font: 12px/1.4 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.rig-tools {
	display: grid;
	gap: 8px;
	margin-bottom: 4px;
}

.metadata-part {
	min-width: 0;
	padding: 8px;
	border: 2px solid rgba(205, 185, 143, 0.82);
	border-radius: 8px;
	background: rgba(255, 253, 247, 0.92);
}

.metadata-part-heading {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin-bottom: 4px;
}

.metadata-badge {
	padding: 2px 6px;
	border-radius: 999px;
	background: #dbe9f5;
	border: 1px solid rgba(47, 131, 198, 0.34);
	color: var(--blue);
	font: 10px/1.2 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	text-transform: uppercase;
	letter-spacing: 0.08em;
}

.metadata-fields {
	display: grid;
	gap: 8px;
	margin-top: 6px;
}

.inspector-group {
	display: grid;
	grid-template-columns: 76px 1fr;
	gap: 6px;
	align-items: start;
}

.inspector-group-label {
	padding-top: 7px;
	color: var(--muted);
	font-size: 10px;
	text-transform: uppercase;
	letter-spacing: 0.08em;
}

.inspector-group-fields {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 4px;
}

.inspector-field {
	gap: 4px;
	margin-bottom: 0;
	font-size: 10px;
}

.inspector-field span {
	color: var(--muted);
	line-height: 1.15;
}

.inspector-field input {
	padding: 5px 6px;
	font: inherit;
}

.inspector-field-readonly {
	min-width: 0;
}

.inspector-group-readonly {
	align-items: center;
}

.inspector-value {
	display: block;
	min-height: 27px;
	padding: 5px 6px;
	border: 1px solid rgba(205, 185, 143, 0.62);
	border-radius: 6px;
	background: rgba(234, 211, 174, 0.24);
	color: var(--ink);
	font: inherit;
}

.inspector-sample-box {
	min-height: 0;
	padding: 4px 6px;
	border-style: dashed;
	white-space: nowrap;
}

.metadata-part strong {
	display: block;
	margin-bottom: 4px;
	color: var(--ink);
	font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.metadata-line {
	color: var(--muted);
	white-space: pre-wrap;
}

@media (max-width: 1050px) {
	.metadata-readout {
		grid-template-columns: 1fr;
	}
	.toy-shell {
		grid-template-columns: 1fr;
		grid-template-areas:
			"intro"
			"sheet"
			"preview"
			"credits";
	}

	.intro-panel {
		display: block;
	}

	.intro-note {
		max-width: none !important;
		margin-top: 8px !important;
		text-align: left;
	}

	.credits-panel {
		display: block;
	}

	.inline-field,
	.sheet-setup,
	.rig-file-panel {
		grid-template-columns: 1fr;
	}

	.quick-steps {
		grid-template-columns: 1fr;
	}

	.sheet-setup-row {
		grid-template-columns: 1fr;
	}

	.compact-select-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.shared-preview-settings,
	.export-panel-grid {
		grid-template-columns: 1fr;
	}

	.sheet-toolbar {
		align-items: stretch;
	}

	.tool-cluster-actions {
		margin-left: 0;
	}
}

@media (max-width: 620px) {
	.heading-aside {
		display: block;
		margin-top: 2px;
		white-space: normal;
	}

	.compact-select-grid {
		grid-template-columns: 1fr;
	}

	.sprite-export-grid {
		grid-template-columns: 1fr;
	}

	.sprite-export-grid .xml-export-button {
		width: 100%;
		justify-self: stretch;
	}
}
