/* Cain's Casio VZ Editor - 90s techno / rave themed responsive layout */

:root {
	--bg: #06031a;
	--bg-2: #0a0526;
	--panel: #0e0a26;
	--panel-mod: #1d0f3a;
	--edge: #4a3480;
	--edge-hi: #8a5cf0;
	--fg: #eef0ff;
	--fg-dim: #9188bb;

	--neon-magenta: #ff28d8;
	--neon-magenta-dim: #7a1466;
	--neon-cyan: #1cf3ff;
	--neon-cyan-dim: #0d5c66;
	--neon-purple: #b13bff;
	--neon-yellow: #e8ff3c;
	--neon-red: #ff3b6b;

	--accent: var(--neon-magenta);
	--accent-2: var(--neon-cyan);
	--screen: #0a0620;
	--screen-line: rgba(28, 243, 255, 0.16);

	--font-display: 'Orbitron', 'Chakra Petch', sans-serif;
	--font-body: 'Chakra Petch', Verdana, Geneva, Tahoma, sans-serif;

	--gap: 8px;
	--pad: 8px;
	--label-col: 46px;
	--value-col: 28px;
	--radius: 6px;
	--glow-cyan: 0 0 10px rgba(28, 243, 255, 0.55);
	--glow-magenta: 0 0 10px rgba(255, 40, 216, 0.6);
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	min-height: 100vh;
	font-family: var(--font-body);
	font-size: 11px;
	line-height: 1.4;
	color: var(--fg);
	background-color: var(--bg);
	background-image:
		linear-gradient(rgba(28, 243, 255, 0.05) 1px, transparent 1px),
		linear-gradient(90deg, rgba(255, 40, 216, 0.045) 1px, transparent 1px),
		radial-gradient(ellipse 70% 45% at 50% -10%, rgba(178, 59, 255, 0.28), transparent 60%),
		radial-gradient(ellipse 60% 40% at 90% 110%, rgba(28, 243, 255, 0.16), transparent 60%);
	background-size: 28px 28px, 28px 28px, 100% 100%, 100% 100%;
	background-attachment: fixed;
	overflow-x: hidden;
}

h1,
h2 {
	margin: 0;
	font-family: var(--font-display);
	font-weight: 700;
	letter-spacing: 0.04em;
}

/* Reusable neon SVG icon: crisp at any size, recolours via currentColor. */
.icon {
	width: 16px;
	height: 16px;
	flex: 0 0 auto;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
	overflow: visible;
}

.icon-defs {
	position: absolute;
	width: 0;
	height: 0;
	overflow: hidden;
}

/* ---------------------------------------------------------------- header */

.app-header {
	position: sticky;
	top: 0;
	z-index: 40;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--gap);
	padding: var(--pad) var(--pad) var(--pad) calc(var(--pad) + env(safe-area-inset-left));
	background-color: rgba(6, 3, 26, 0.92);
	backdrop-filter: blur(6px);
	border-bottom: 1px solid var(--edge);
	box-shadow: 0 1px 0 rgba(28, 243, 255, 0.25), 0 4px 24px -8px rgba(178, 59, 255, 0.5);
}

.app-header h1 {
	flex: 1 1 auto;
	font-size: clamp(14px, 2.4vw, 22px);
	white-space: nowrap;
	color: var(--fg);
	text-shadow: 0 0 6px rgba(28, 243, 255, 0.65), 0 0 18px rgba(255, 40, 216, 0.35);
}

.toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--gap);
}

.toolbar-group {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
}

.midi-status {
	flex-basis: 100%;
	margin: 0;
	color: var(--neon-yellow);
	text-shadow: 0 0 6px rgba(232, 255, 60, 0.5);
}

.midi-status:empty {
	display: none;
}

/* ------------------------------------------------------------ page grid */

.app {
	display: flex;
	flex-direction: column;
	gap: var(--gap);
	padding: var(--gap);
	padding-left: calc(var(--gap) + env(safe-area-inset-left));
	padding-right: calc(var(--gap) + env(safe-area-inset-right));
	padding-bottom: calc(var(--gap) + env(safe-area-inset-bottom));
}

.row {
	display: grid;
	gap: var(--gap);
	align-items: start;
}

.row-top {
	grid-template-columns: minmax(190px, 1fr) minmax(0, 2.4fr);
}

.row-bottom {
	grid-template-columns: minmax(230px, 1fr) minmax(0, 1.8fr);
}

.panel {
	min-width: 0;
	padding: var(--pad);
	background-color: var(--panel);
	background-image: linear-gradient(160deg, rgba(178, 59, 255, 0.08), transparent 55%);
	border: 1px solid var(--edge);
	border-radius: var(--radius);
	box-shadow: 0 0 0 1px rgba(28, 243, 255, 0.06), 0 8px 28px -14px rgba(178, 59, 255, 0.6);
}

.panel-title {
	margin-bottom: 6px;
	font-family: var(--font-display);
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.14em;
	color: var(--accent-2);
	text-shadow: 0 0 8px rgba(28, 243, 255, 0.55);
}

.modules {
	display: grid;
	gap: var(--gap);
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 620px) {
	.modules {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

@media (min-width: 1340px) {
	.modules {
		grid-template-columns: repeat(8, minmax(0, 1fr));
	}
}

@media (max-width: 900px) {
	.row-bottom {
		grid-template-columns: minmax(0, 1fr);
	}
}

@media (max-width: 640px) {
	.row-top {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* Narrow module columns need tighter label / value gutters. */
@media (max-width: 1100px) {
	.VZmodule,
	.VZmodule_mod {
		--label-col: 38px;
		--value-col: 20px;
		--pad: 6px;
	}
}

/* ------------------------------------------------------------- controls */

.ctl {
	display: grid;
	grid-template-columns: var(--label-col) minmax(0, 1fr) var(--value-col);
	align-items: center;
	gap: 6px;
	margin-bottom: 4px;
}

.ctl > span {
	overflow: hidden;
	color: var(--fg-dim);
	text-overflow: ellipsis;
	white-space: nowrap;
}

.ctl-value {
	font-variant-numeric: tabular-nums;
	text-align: right;
	color: var(--accent-2);
}

.ctl-wide {
	grid-template-columns: var(--label-col) minmax(0, 1fr);
}

.chk {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	cursor: pointer;
}

.field {
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

.field > span {
	color: var(--fg-dim);
}

.section-head {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 6px 0 3px;
	color: var(--fg-dim);
}

.section-head > span {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.readout {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 2px 4px;
	margin-bottom: 4px;
}

.readout > span {
	color: var(--fg-dim);
}

.readout output {
	font-variant-numeric: tabular-nums;
	color: var(--neon-yellow);
}

/* --------------------------------------------------------- form widgets */

input,
select,
button,
output {
	font: inherit;
	color: inherit;
}

.btn,
button {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 26px;
	padding: 3px 10px;
	background-color: #140b2c;
	color: var(--fg);
	border: 1px solid var(--edge);
	border-radius: var(--radius);
	cursor: pointer;
	transition: border-color 0.15s, box-shadow 0.15s, color 0.15s;
}

.btn .icon,
button .icon {
	color: var(--accent-2);
}

.btn:hover,
button:hover {
	border-color: var(--accent-2);
	box-shadow: var(--glow-cyan);
}

/* Icon-only controls keep their explicit box; don't inherit toolbar min-height/padding. */
.polarity-btn,
.lock-btn,
.wave-btn,
.route-btn,
.module-toggle,
.overlay-close,
.op-badge {
	min-height: 0;
	padding: 0;
}

.btn-accent {
	background-color: var(--neon-magenta-dim);
	border-color: var(--accent);
}

.btn-accent .icon {
	color: var(--fg);
}

.btn-accent:hover {
	box-shadow: var(--glow-magenta);
}

select,
input[type=text],
input[type=file] {
	max-width: 100%;
	min-height: 24px;
	padding: 2px 4px;
	background-color: #140b2c;
	border: 1px solid var(--edge);
	border-radius: var(--radius);
}

select:focus,
input[type=text]:focus {
	border-color: var(--accent-2);
	box-shadow: var(--glow-cyan);
}

input[type=text] {
	width: 100%;
	min-width: 0;
}

input[type=checkbox] {
	width: 16px;
	height: 16px;
	margin: 0;
	accent-color: var(--accent);
}

input[type=range] {
	-webkit-appearance: none;
	appearance: none;
	width: 100%;
	min-width: 0;
	height: 16px;
	margin: 0;
	background: transparent;
	cursor: pointer;
	touch-action: none;
}

input[type=range]::-webkit-slider-runnable-track {
	height: 8px;
	background: linear-gradient(90deg, var(--neon-cyan-dim), var(--edge));
	border: 1px solid var(--edge);
	border-radius: 2px;
}

input[type=range]::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 14px;
	height: 16px;
	margin-top: -4px;
	background-color: var(--accent);
	border: 1px solid #1a0a20;
	border-radius: 2px;
	box-shadow: var(--glow-magenta);
}

input[type=range]::-moz-range-track {
	height: 8px;
	background: linear-gradient(90deg, var(--neon-cyan-dim), var(--edge));
	border: 1px solid var(--edge);
	border-radius: 2px;
}

input[type=range]::-moz-range-thumb {
	width: 14px;
	height: 16px;
	background-color: var(--accent);
	border: 1px solid #1a0a20;
	border-radius: 2px;
	box-shadow: var(--glow-magenta);
}

:focus-visible {
	outline: 2px solid var(--accent-2);
	outline-offset: 1px;
}

/* Bigger hit areas on touch devices (iPad). */
@media (pointer: coarse) {
	body {
		font-size: 12px;
	}

	input[type=range] {
		height: 44px;
	}

	input[type=range]::-webkit-slider-runnable-track {
		height: 18px;
	}

	input[type=range]::-webkit-slider-thumb {
		width: 34px;
		height: 44px;
		margin-top: -13px;
		border-radius: 4px;
	}

	input[type=range]::-moz-range-track {
		height: 18px;
	}

	input[type=range]::-moz-range-thumb {
		width: 34px;
		height: 44px;
		border-radius: 4px;
	}

	input[type=checkbox] {
		width: 22px;
		height: 22px;
	}

	.btn,
	button,
	select {
		min-height: 36px;
	}

	.overlay canvas {
		min-height: 260px;
	}

	.module-toggle {
		width: 52px;
		height: 28px;
	}

	.polarity-btn {
		width: 30px;
		height: 30px;
		min-width: 30px;
	}

	.lock-btn,
	.wave-btn {
		width: 30px;
		height: 30px;
	}

	.overlay-close {
		width: 46px;
		height: 46px;
	}

	.overlay-close .icon {
		width: 22px;
		height: 22px;
	}

	.op-badge {
		min-height: 40px;
	}

	.route-btn {
		width: 34px;
		height: 34px;
	}
}

/* --------------------------------------------------------------- canvas */

canvas {
	display: block;
	width: 100%;
	height: auto;
	background-color: var(--screen);
	border-radius: 3px;
	touch-action: none;
}

/* ------------------------------------------------------- global (tone) */

#global .ctl {
	--label-col: 52px;
}

/* ------------------------------------------------- algorithm line graph */

.VZlines {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 6px;
}

.VZline {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 5px;
	min-width: 0;
	padding: 6px 4px;
	background-color: var(--screen);
	border: 1px solid var(--edge);
	border-radius: var(--radius);
}

.line-label {
	font-family: var(--font-display);
	font-size: 9px;
	letter-spacing: 0.1em;
	color: var(--fg-dim);
}

.sum {
	display: none;
}

.op-badge {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 2px;
	width: 100%;
	min-height: 46px;
	background-color: #140b2c;
	border: 1px solid var(--edge);
	border-radius: var(--radius);
	color: var(--accent-2);
	cursor: pointer;
	transition: border-color 0.15s, box-shadow 0.15s, color 0.15s;
}

.op-badge .icon {
	width: 18px;
	height: 18px;
}

.op-badge .op-name {
	font-family: var(--font-display);
	font-size: 8.5px;
	letter-spacing: 0.08em;
}

.op-badge:hover {
	border-color: var(--accent-2);
	box-shadow: var(--glow-cyan);
}

.op-badge.phase {
	color: var(--neon-purple);
}

.op-badge.ring {
	color: var(--neon-magenta);
}

.op-badge.mix {
	box-shadow: 0 0 12px -2px rgba(28, 243, 255, 0.45) inset;
}

.op-badge.phase {
	box-shadow: 0 0 12px -2px rgba(177, 59, 255, 0.45) inset;
}

.op-badge.ring {
	box-shadow: 0 0 12px -2px rgba(255, 40, 216, 0.45) inset;
}

.connector {
	display: none;
}

.route-btn {
	width: 26px;
	height: 26px;
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background-color: #140b2c;
	border: 1px solid var(--edge);
	border-radius: 50%;
	color: var(--fg-dim);
	cursor: pointer;
	transition: border-color 0.15s, box-shadow 0.15s, color 0.15s;
}

.route-btn .icon {
	width: 14px;
	height: 14px;
}

.route-btn:hover {
	border-color: var(--accent-2);
	color: var(--accent-2);
	box-shadow: var(--glow-cyan);
}

.route-btn.extPhase {
	color: var(--neon-yellow);
	border-color: var(--neon-yellow);
	box-shadow: 0 0 10px rgba(232, 255, 60, 0.5);
}

/* Scale the whole diagram down when the panel gets narrow. */
@media (max-width: 1100px) {
	.op-badge {
		min-height: 38px;
	}
}

/* ------------------------------------------------------------- modules */

.VZmodule,
.VZmodule_mod {
	min-width: 0;
	padding: var(--pad);
	background-color: var(--panel);
	background-image: linear-gradient(160deg, rgba(28, 243, 255, 0.06), transparent 55%);
	color: var(--fg);
	border: 1px solid var(--edge);
	border-radius: var(--radius);
	box-shadow: 0 0 0 1px rgba(28, 243, 255, 0.05), 0 8px 24px -16px rgba(178, 59, 255, 0.7);
}

.VZmodule_mod {
	background-color: var(--panel-mod);
	background-image: linear-gradient(160deg, rgba(255, 40, 216, 0.1), transparent 55%);
	border-color: var(--neon-magenta-dim);
}

.module-head {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-bottom: 4px;
}

.module-num {
	font-family: var(--font-display);
	font-weight: 700;
	letter-spacing: 0.06em;
	color: var(--fg-dim);
}

/* Module on/off power toggle. */
.module-toggle {
	-webkit-appearance: none;
	appearance: none;
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 22px;
	background-color: #140b2c;
	border: 1px solid var(--edge);
	border-radius: 999px;
	color: var(--fg-dim);
	cursor: pointer;
	transition: border-color 0.15s, box-shadow 0.15s, color 0.15s;
}

.module-toggle .icon {
	width: 13px;
	height: 13px;
}

.module-toggle.active {
	color: var(--neon-yellow);
	border-color: var(--neon-yellow);
	box-shadow: 0 0 12px rgba(232, 255, 60, 0.6);
}

.module-toggle.inactive {
	color: var(--fg-dim);
}

.module-toggle:hover {
	border-color: var(--accent-2);
}

/* Lock buttons (envelope / key follow link). */
.lock-btn {
	-webkit-appearance: none;
	appearance: none;
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	background-color: #140b2c;
	border: 1px solid var(--edge);
	border-radius: var(--radius);
	color: var(--fg-dim);
	cursor: pointer;
	transition: border-color 0.15s, box-shadow 0.15s, color 0.15s;
}

.lock-btn.locked {
	color: var(--neon-magenta);
	border-color: var(--neon-magenta);
	box-shadow: var(--glow-magenta);
}

.lock-btn:hover {
	border-color: var(--accent-2);
}

.wave-row {
	display: grid;
	grid-template-columns: 22px minmax(0, 1fr) 22px;
	align-items: center;
	gap: 4px;
}

.wave-btn {
	-webkit-appearance: none;
	appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 28px;
	background-color: #140b2c;
	border: 1px solid var(--edge);
	border-radius: var(--radius);
	color: var(--accent-2);
	cursor: pointer;
	transition: border-color 0.15s, box-shadow 0.15s;
}

.wave-btn:hover {
	border-color: var(--accent-2);
	box-shadow: var(--glow-cyan);
}

.wave-btn .icon {
	width: 14px;
	height: 14px;
}

.wave-name {
	display: block;
	margin-top: 2px;
	text-align: center;
	color: var(--fg-dim);
	text-transform: capitalize;
}

/* Detune polarity toggle. */
.polarity-btn {
	-webkit-appearance: none;
	appearance: none;
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
	min-width: 20px;
	aspect-ratio: 1;
	background-color: #140b2c;
	border: 1px solid var(--edge);
	border-radius: 50%;
	cursor: pointer;
	transition: border-color 0.15s, box-shadow 0.15s, color 0.15s;
}

.polarity-btn .icon {
	width: 12px;
	height: 12px;
}

.polarity-btn.positive {
	color: var(--neon-cyan);
	border-color: var(--neon-cyan);
	box-shadow: var(--glow-cyan);
}

.polarity-btn.negative {
	color: var(--neon-magenta);
	border-color: var(--neon-magenta);
	box-shadow: var(--glow-magenta);
}

/* Velocity curve / mod-wave mini scopes, drawn as live inline SVG paths. */
.curve,
.modwave {
	display: block;
	background-color: var(--screen);
	background-image:
		linear-gradient(var(--screen-line) 1px, transparent 1px),
		linear-gradient(90deg, var(--screen-line) 1px, transparent 1px);
	background-size: 25% 25%;
	border: 1px solid var(--edge);
	border-radius: 3px;
	cursor: pointer;
}

.curve {
	width: 34px;
	height: 34px;
	flex: 0 0 auto;
}

.curve path,
.modwave path {
	fill: none;
	stroke: var(--neon-cyan);
	stroke-width: 6;
	stroke-linecap: round;
	stroke-linejoin: round;
	vector-effect: non-scaling-stroke;
	filter: drop-shadow(0 0 3px rgba(28, 243, 255, 0.85));
}

.curve-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	margin-bottom: 4px;
}

.curve-row .ctl {
	--label-col: 32px;
	flex: 1 1 100px;
	margin-bottom: 0;
}

.modwave {
	width: 100%;
	max-width: 90px;
	height: 34px;
}

.modwave path {
	stroke: var(--neon-purple);
	filter: drop-shadow(0 0 3px rgba(177, 59, 255, 0.85));
}

/* ---------------------------------------------------------- modulation */

#modulation .mod-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: var(--gap) calc(var(--gap) * 2);
}

#pitchEnvelope,
#vibrato,
#tremolo {
	min-width: 0;
}

.mod-title {
	margin-bottom: 4px;
	font-family: var(--font-display);
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--neon-purple);
	text-shadow: 0 0 8px rgba(177, 59, 255, 0.55);
}

/* -------------------------------------------------------------- vz bank */

.bank-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	margin-bottom: 6px;
}

.bank-head .panel-title {
	margin: 0;
}

#vzBankFile {
	flex: 1 1 140px;
	min-width: 0;
	overflow: hidden;
	color: var(--fg-dim);
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* The native file input is replaced by its own label, styled as a button. */
.file-btn {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 26px;
	padding: 3px 10px;
	background-color: var(--neon-magenta-dim);
	border: 1px solid var(--accent);
	border-radius: var(--radius);
	cursor: pointer;
}

.file-btn .icon {
	color: var(--fg);
}

.file-btn:hover {
	box-shadow: var(--glow-magenta);
}

.file-btn:focus-within {
	outline: 2px solid var(--accent-2);
	outline-offset: 1px;
}

.file-btn input[type=file] {
	position: absolute;
	width: 1px;
	height: 1px;
	min-height: 0;
	padding: 0;
	border: none;
	opacity: 0;
}

.bank-grid {
	display: grid;
	grid-template-columns: repeat(8, minmax(0, 1fr));
	gap: 2px;
}

@media (max-width: 560px) {
	.bank-grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

.bank-grid output {
	display: block;
	min-height: 22px;
	overflow: hidden;
	padding: 3px 2px;
	background-color: #140b2c;
	border: 1px solid var(--edge);
	border-radius: 2px;
	text-align: center;
	text-overflow: ellipsis;
	white-space: nowrap;
	color: var(--fg-dim);
	cursor: pointer;
	transition: border-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.bank-grid output:hover {
	border-color: var(--accent-2);
	color: var(--fg);
	box-shadow: var(--glow-cyan);
}

/* ------------------------------------------------------------ overlays */

.overlay {
	position: fixed;
	top: 50%;
	left: 50%;
	z-index: 100;
	width: min(1200px, calc(100vw - 2 * var(--gap)));
	max-height: calc(100vh - 2 * var(--gap));
	overflow: auto;
	padding: var(--pad);
	transform: translate(-50%, -50%);
	background-color: var(--panel);
	color: var(--fg);
	border: 1px solid var(--accent-2);
	border-radius: var(--radius);
	box-shadow: 0 0 0 100vmax rgba(3, 1, 12, 0.72), 0 0 40px -6px rgba(28, 243, 255, 0.5);
}

.hideEnvelope {
	visibility: hidden;
	z-index: 0;
	pointer-events: none;
}

.showEnvelope {
	visibility: visible;
	z-index: 100;
	pointer-events: auto;
}

.overlay-head {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 6px;
}

.overlay-head .panel-title {
	flex: 1 1 auto;
	margin: 0;
}

.overlay-close {
	-webkit-appearance: none;
	appearance: none;
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	background-color: #140b2c;
	border: 1px solid var(--edge);
	border-radius: 50%;
	color: var(--neon-red);
	cursor: pointer;
	transition: border-color 0.15s, box-shadow 0.15s;
}

.overlay-close:hover {
	border-color: var(--neon-red);
	box-shadow: 0 0 10px rgba(255, 59, 107, 0.6);
}

.overlay-close .icon {
	width: 20px;
	height: 20px;
	stroke-width: 2.4;
}

.env-table {
	width: 100%;
	margin-top: 6px;
	border-collapse: collapse;
	table-layout: fixed;
}

.env-table th,
.env-table td {
	padding: 2px;
	border: 1px solid var(--edge);
	font-size: 10px;
	font-weight: 400;
	text-align: center;
}

.env-table th {
	color: var(--accent-2);
	font-family: var(--font-display);
}

.env-table th:first-child,
.env-table td:first-child {
	width: 46px;
	color: var(--fg-dim);
	text-align: left;
}

input[type=text].envText {
	width: 100%;
	min-width: 0;
	height: auto;
	padding: 2px;
	text-align: center;
	background-color: #140b2c;
}

/* Piano-style test keys */
.test-tones {
	gap: 2px;
	align-items: flex-start;
}

/* Normal: white piano keys */
.test-tones > button:not(.octave-btn) {
	background: none;
	color: #fff;
	border: 1px solid #999;
	border-radius: 0 0 3px 3px;
	height: 42px;
	max-width: 20px;
	padding: 6px;
}

/* Black keys */
.test-tones > button:nth-child(3),
.test-tones > button:nth-child(5),
.test-tones > button:nth-child(7),
.test-tones > button:nth-child(9),
.test-tones > button:nth-child(11) {
	background: #111;
	color: #fff;
	border: 1px solid #000;
	border-radius: 0 0 3px 3px;
	height: 30px;
	padding: 0px !important;
}



/* Pressed keys */
.test-tones > button:active {
	background: #d8d8d8;
	transform: translateY(1px);
}

.test-tones > button:nth-child(3):active,
.test-tones > button:nth-child(5):active,
.test-tones > button:nth-child(7):active,
.test-tones > button:nth-child(9):active,
.test-tones > button:nth-child(11):active {
	background: #333;
	color: #fff;
}

/* Keep octave arrows visually separate */
.test-tones > .octave-btn:active {
	background: #d8d8d8;
}
/* Octave navigation: simple white < > arrows */
.test-tones > .octave-btn {
	background: transparent;
	color: #fff;
	border: none;
	border-radius: 0;
	width: 28px;
	padding: 0;
	font-family: Arial, sans-serif;
	font-size: 20px !important;
	line-height: 42px;
	justify-content: center;
	box-shadow: none;
}