/* Utility tools — light palette. */
.smgpu-tool {
	--smgpu-border: #e1e7f3;
	--smgpu-primary: #0b5cff;
	--smgpu-muted: #5b6475;
	padding: clamp(1rem, 2.5vw, 1.5rem);
	color: #0b1220;
	background: #fff;
	border: 1px solid #e1e7f3;
	border-radius: 12px;
	box-sizing: border-box;
}

.smgpu-tool * {
	box-sizing: border-box;
}

.smgpu-tool .smgpu-buttons {
	margin: 0 0 1rem;
}

.smgpu-tool__canvas {
	display: block;
	width: 100%;
	height: auto;
	margin-bottom: 1rem;
	border: 1px solid #e1e7f3;
	border-radius: 8px;
}

.smgpu-tool__out {
	min-height: 2rem;
	font-size: 0.95rem;
}

.smgpu-tool .smgpu-table th {
	width: 38%;
	color: #5b6475;
}

.smgpu-tool .smgpu-table tr:last-child th,
.smgpu-tool .smgpu-table tr:last-child td {
	color: inherit;
	font-weight: inherit;
	border-bottom: 0;
}

.smgpu-tool .smgpu-btn--primary {
	color: #fff;
	background: #0b5cff;
}

.smgpu-tool .smgpu-btn--ghost {
	color: #0b1220;
	background: #fff;
	border: 1px solid #e1e7f3;
}

.smgpu-tool .smgpu-note,
.smgpu-tool .smgpu-notice {
	font-size: 0.85rem;
	color: #5b6475;
}

.smgpu-tool .smgpu-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
}

.smgpu-tablewrap {
	overflow-x: auto;
}

.smgpu-table--grid thead th {
	width: auto;
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: #5b6475;
	white-space: nowrap;
}

.smgpu-table--grid td {
	white-space: nowrap;
}

.smgpu-screen {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: grid;
	align-items: end;
	justify-items: center;
	padding: 1rem;
	cursor: pointer;
	outline: 0;
}

.smgpu-screen[hidden] {
	display: none;
}

.smgpu-screen__hint {
	margin: 0;
	padding: 0.35rem 0.75rem;
	font: 0.85rem system-ui, sans-serif;
	background: rgba(255, 255, 255, 0.0);
}

.smgpu-tool .smgpu-advice {
	padding-left: 1.2rem;
	margin: 0 0 1rem;
	line-height: 1.6;
}

.smgpu-controls-row { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 1rem; }
.smgpu-field { display: grid; gap: 0.25rem; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: #5b6475; }
.smgpu-field select { min-width: 10rem; padding: 0.55rem 0.75rem; font: inherit; font-size: 0.95rem; text-transform: none; letter-spacing: 0; color: #0b1220; background: #fff; border: 1px solid #e1e7f3; border-radius: 8px; }
.smgpu-tool .smgpu-btn[hidden] { display: none; }

/* ---- responsive ---- */
.smgpu-tool { max-width: 100%; min-width: 0; overflow-wrap: break-word; -webkit-tap-highlight-color: rgba(11, 92, 255, 0.15); }
.smgpu-tool :focus-visible { outline: 3px solid #1a73e8; outline-offset: 2px; }
.smgpu-tool img, .smgpu-tool svg, .smgpu-tool video, .smgpu-tool canvas { max-width: 100%; }
.smgpu-tool canvas { touch-action: manipulation; }
.smgpu-tool pre { max-width: 100%; overflow-x: auto; }
.smgpu-tool .smgpu-btn { min-height: 44px; }
.smgpu-tool .smgpu-buttons { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.smgpu-tool input:not([type='checkbox']):not([type='radio']):not([type='range']), .smgpu-tool select, .smgpu-tool textarea { max-width: 100%; min-height: 44px; font-size: 1rem; }
.smgpu-tool input[type='checkbox'], .smgpu-tool input[type='radio'] { width: 22px; height: 22px; accent-color: #0b5cff; }
.smgpu-tool input[type='range'] { width: 100%; min-height: 44px; }
.smgpu-tool__out { overflow-x: auto; }
.smgpu-tool .smgpu-table { max-width: 100%; }
.smgpu-tool .smgpu-table td, .smgpu-tool .smgpu-table th { overflow-wrap: anywhere; }
.smgpu-tablewrap { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; background: linear-gradient(90deg, #fff 30%, rgba(255, 255, 255, 0)) 0 0 / 2.5rem 100% no-repeat local, linear-gradient(270deg, #fff 30%, rgba(255, 255, 255, 0)) 100% 0 / 2.5rem 100% no-repeat local, radial-gradient(farthest-side at 0 50%, rgba(11, 18, 32, 0.18), rgba(11, 18, 32, 0)) 0 0 / 0.8rem 100% no-repeat scroll, radial-gradient(farthest-side at 100% 50%, rgba(11, 18, 32, 0.18), rgba(11, 18, 32, 0)) 100% 0 / 0.8rem 100% no-repeat scroll; }
.smgpu-tablewrap:focus-visible { outline: 3px solid #1a73e8; outline-offset: 2px; }
.smgpu-table--grid th, .smgpu-table--grid td { padding-inline: 0.6rem; }
.smgpu-controls-row { align-items: end; }
.smgpu-field select { max-width: 100%; }
.smgpu-screen { padding: max(1rem, env(safe-area-inset-top, 0px)) max(1rem, env(safe-area-inset-right, 0px)) max(1rem, env(safe-area-inset-bottom, 0px)) max(1rem, env(safe-area-inset-left, 0px)); touch-action: manipulation; }
.smgpu-screen__hint { font-size: 1rem; }
@media (max-width: 640px) {
	.smgpu-tool { padding: 0.9rem; border-radius: 10px; }
	.smgpu-controls-row { display: grid; grid-template-columns: 1fr; gap: 0.75rem; }
	.smgpu-field select { width: 100%; min-width: 0; }
	.smgpu-tool .smgpu-buttons .smgpu-btn { flex: 1 1 calc(50% - 0.25rem); }
	.smgpu-tool .smgpu-table th { width: 44%; }
}
@media (max-width: 400px) { .smgpu-tool .smgpu-buttons .smgpu-btn { flex-basis: 100%; } }
@media (max-height: 480px) and (orientation: landscape) { .smgpu-screen { padding-block: 0.5rem; } }
@media (prefers-reduced-motion: reduce) { .smgpu-tool * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; } }
@media print { .smgpu-tool { border: 0; padding: 0; } .smgpu-tool .smgpu-buttons, .smgpu-screen { display: none !important; } }
