.es-qst {
	--qst-navy: #1F3864;
	--qst-amber: #C9A21A;
	--qst-line: #dde2ea;
	--qst-bg: #f6f8fb;
	--qst-text: #1d2433;
	font-family: "IBM Plex Sans", system-ui, sans-serif;
	color: var(--qst-text);
	max-width: 760px;
	margin: 0 auto;
}
.es-qst *, .es-qst *::before, .es-qst *::after { box-sizing: border-box; }

.es-qst-card {
	background: #fff;
	border: 1px solid var(--qst-line);
	border-radius: 10px;
	padding: 18px 20px;
	margin: 0 0 16px;
}
.es-qst-h {
	color: var(--qst-navy);
	font-size: 1.05rem;
	font-weight: 600;
	margin: 0 0 12px;
	padding-bottom: 6px;
	border-bottom: 2px solid var(--qst-amber);
	display: inline-block;
}
.es-qst-note { font-size: .9rem; color: #5b6475; margin: -4px 0 12px; }

.es-qst-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
	align-items: center;
	padding: 6px 0;
}
.es-qst-row label { font-size: .92rem; }
.es-qst-row input,
.es-qst-row select {
	width: 100%;
	font: inherit;
	font-family: "JetBrains Mono", ui-monospace, monospace;
	font-size: .9rem;
	padding: 8px 10px;
	border: 1px solid var(--qst-line);
	border-radius: 6px;
	background: #fff;
	color: var(--qst-text);
}
.es-qst-row select { font-family: "IBM Plex Sans", system-ui, sans-serif; }
.es-qst-row input:focus,
.es-qst-row select:focus { outline: 2px solid var(--qst-amber); outline-offset: 1px; border-color: var(--qst-amber); }
.es-qst-row input.es-qst-bad { border-color: #c0392b; }

.es-qst-btn {
	width: 100%;
	font: inherit;
	font-weight: 600;
	padding: 12px;
	border: 0;
	border-radius: 8px;
	background: var(--qst-navy);
	color: #fff;
	cursor: pointer;
}
.es-qst-btn:hover { background: #172b4d; }
.es-qst-btn:disabled { opacity: .6; cursor: wait; }

.es-qst-loading {
	visibility: hidden;
	min-height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	font-size: .9rem;
	color: #5b6475;
	margin: 8px 0;
}
.es-qst.is-loading .es-qst-loading { visibility: visible; }
.es-qst-spin {
	width: 16px; height: 16px;
	border: 2px solid var(--qst-line);
	border-top-color: var(--qst-navy);
	border-radius: 50%;
	animation: es-qst-spin .8s linear infinite;
}
@keyframes es-qst-spin { to { transform: rotate(360deg); } }

.es-qst-error {
	background: #fdecea;
	border: 1px solid #f5c2bd;
	color: #8a1f14;
	border-radius: 8px;
	padding: 12px 14px;
	margin-bottom: 16px;
}

.es-qst-warn {
	background: #fff7e0;
	border-left: 4px solid var(--qst-amber);
	padding: 10px 12px;
	font-size: .9rem;
	margin: 0 0 12px;
}
.es-qst-warn[hidden] { display: none; }
.es-qst-table { width: 100%; border-collapse: collapse; margin: 0 0 12px; }
.es-qst-table td { border-bottom: 1px solid var(--qst-line); padding: 8px 6px; font-size: .92rem; }
.es-qst-table td:nth-child(2) {
	font-family: "JetBrains Mono", ui-monospace, monospace;
	font-variant-numeric: tabular-nums;
	text-align: right;
	font-weight: 600;
	color: var(--qst-navy);
}
.es-qst-table td:nth-child(3) { width: 48px; color: #5b6475; }
.es-qst-eq {
	font-family: "JetBrains Mono", ui-monospace, monospace;
	background: var(--qst-bg);
	border-radius: 6px;
	padding: 8px 10px;
	font-size: .9rem;
	margin: 0 0 10px;
}
.es-qst img { max-width: 100%; height: auto; display: block; margin: 8px auto 0; }

.es-qst-fig {
	margin: 8px 0 0;
	border: 1px solid var(--qst-line);
	border-radius: 8px;
	background: #fff;
	overflow: hidden;
}
.es-qst-canvas { display: block; width: 100%; }
.es-qst-fig figcaption {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 16px;
	align-items: center;
	padding: 8px 12px;
	border-top: 1px solid var(--qst-line);
	background: var(--qst-bg);
	font-size: .82rem;
	color: #5b6475;
	line-height: 1.4;
}
.es-qst-key { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.es-qst-key i { display: inline-block; width: 22px; height: 0; border-top: 3px solid; }
.es-qst-key i.-initial { border-top: 2px dashed var(--qst-navy); }
.es-qst-key i.-final { border-top-color: var(--qst-amber); }
.es-qst-key i.-chord { border-top: 1px dashed #c3cad6; }
.es-qst-scale { flex-basis: 100%; font-style: italic; }

.es-qst-toggle {
	font: inherit;
	font-weight: 600;
	color: var(--qst-navy);
	background: none;
	border: 1px solid var(--qst-navy);
	border-radius: 6px;
	padding: 8px 12px;
	cursor: pointer;
}
.es-qst-steps { display: none; margin: 14px 0 0; padding-left: 22px; }
.es-qst.-show-steps .es-qst-steps { display: block; }
.es-qst-steps li {
	font-family: "JetBrains Mono", ui-monospace, monospace;
	font-size: .85rem;
	line-height: 1.6;
	padding: 3px 0;
	overflow-wrap: anywhere;
}

@media (max-width: 560px) {
	.es-qst-card { padding: 14px; }
	.es-qst-row { grid-template-columns: 1fr; gap: 4px; }
}
