/* FMS Speaker Test Online — every rule is scoped under .fms-st so the theme is untouched */

.fms-st {
	--fms-card: #161412;
	--fms-panel: #1d1a18;
	--fms-panel-2: #24201d;
	--fms-line: rgba(255, 255, 255, 0.07);
	--fms-line-warm: rgba(255, 128, 40, 0.32);
	--fms-text: #f5f1ec;
	--fms-muted: #978d85;
	--fms-orange: #ff7a1a;
	--fms-orange-deep: #ff5a00;
	--fms-green: #37d27c;

	box-sizing: border-box;
	max-width: 480px;
	margin: 0 auto;
	display: grid;
	gap: 18px;
	font-family: Inter, "Segoe UI", Roboto, system-ui, -apple-system, sans-serif;
	color: var(--fms-text);
	line-height: 1.4;
	-webkit-font-smoothing: antialiased;
}

.fms-st *,
.fms-st *::before,
.fms-st *::after {
	box-sizing: inherit;
}

.fms-st p {
	margin: 0;
}

/* Neutralise theme button styles */
.fms-st button {
	-webkit-appearance: none;
	appearance: none;
	margin: 0;
	font: inherit;
	text-transform: none;
	letter-spacing: normal;
	text-decoration: none;
	box-shadow: none;
	cursor: pointer;
	line-height: 1.2;
}

.fms-st button:disabled {
	cursor: not-allowed;
}

.fms-st button:focus-visible,
.fms-st input:focus-visible {
	outline: 2px solid var(--fms-orange);
	outline-offset: 2px;
}

/* Card */
.fms-st__card {
	position: relative;
	padding: 22px;
	border-radius: 22px;
	border: 1px solid var(--fms-line-warm);
	background:
		radial-gradient(circle at 0% 0%, rgba(255, 110, 20, 0.2), transparent 42%),
		radial-gradient(circle at 100% 100%, rgba(255, 110, 20, 0.08), transparent 40%),
		var(--fms-card);
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
	display: grid;
	gap: 16px;
}

/* Header */
.fms-st__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.fms-st__brand {
	display: flex;
	align-items: center;
	gap: 12px;
	min-width: 0;
}

.fms-st__logo {
	flex: 0 0 auto;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	display: grid;
	place-items: center;
	color: var(--fms-orange);
	border: 1.5px solid var(--fms-orange);
	background: rgba(255, 122, 26, 0.08);
}

.fms-st__logo svg {
	width: 20px;
	height: 20px;
}

.fms-st__title {
	font-size: 17px;
	font-weight: 700;
	color: var(--fms-text);
}

.fms-st__sub {
	font-size: 12.5px;
	color: var(--fms-muted);
}

.fms-st__pill {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 7px 13px;
	border-radius: 999px;
	font-size: 12.5px;
	font-weight: 500;
	color: var(--fms-text);
	background: var(--fms-panel-2);
	border: 1px solid var(--fms-line);
}

.fms-st__dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--fms-green);
}

.fms-st__pill.is-busy .fms-st__dot {
	background: var(--fms-orange);
}

.fms-st__pill.is-off .fms-st__dot {
	background: #5f5752;
}

.fms-st__pill.is-error .fms-st__dot {
	background: #ff4d4d;
}

/* Dial */
.fms-st__dial {
	position: relative;
	width: 196px;
	height: 196px;
	margin: 6px auto 2px;
}

.fms-st__ring {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	transform: rotate(-90deg);
}

.fms-st__ring-track {
	fill: none;
	stroke: #2a2522;
	stroke-width: 6;
}

.fms-st__ring-fill {
	fill: none;
	stroke: var(--fms-orange);
	stroke-width: 6;
	stroke-linecap: round;
	stroke-dasharray: 339.292;
	stroke-dashoffset: 339.292;
	filter: drop-shadow(0 0 6px rgba(255, 122, 26, 0.55));
}

.fms-st__dial-inner {
	position: absolute;
	inset: 22px;
	border-radius: 50%;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 4px;
	text-align: center;
	background: radial-gradient(circle at 50% 35%, #211d1b, #141211 70%);
	box-shadow:
		inset 0 2px 10px rgba(0, 0, 0, 0.6),
		0 0 0 1px rgba(255, 255, 255, 0.04);
}

.fms-st__dial-big {
	font-size: 50px;
	font-weight: 800;
	letter-spacing: -0.02em;
	color: var(--fms-text);
	line-height: 1;
}

.fms-st__dial-big.is-long {
	font-size: 27px;
}

.fms-st__dial-small {
	font-size: 11.5px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--fms-muted);
}

/* Now playing panel */
.fms-st__now {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 16px;
	border-radius: 12px;
	background: var(--fms-panel);
	border: 1px solid var(--fms-line);
}

.fms-st__now-label {
	font-size: 11px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--fms-muted);
}

.fms-st__now-value {
	font-size: 14px;
	font-weight: 700;
	color: var(--fms-orange);
	text-align: right;
}

.fms-st__hint {
	font-size: 13.5px;
	text-align: center;
	color: #d8d1ca;
}

.fms-st__group-label {
	font-size: 11px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--fms-muted);
	margin-bottom: -6px !important;
}

/* Modes */
.fms-st__modes {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
}

.fms-st .fms-st__mode {
	display: flex;
	align-items: center;
	gap: 11px;
	width: 100%;
	padding: 12px;
	border-radius: 12px;
	text-align: left;
	color: var(--fms-text);
	background: var(--fms-panel);
	border: 1px solid var(--fms-line);
	transition: border-color 0.15s ease, background 0.15s ease;
}

.fms-st .fms-st__mode:hover {
	border-color: rgba(255, 128, 40, 0.45);
	background: var(--fms-panel);
	color: var(--fms-text);
}

.fms-st .fms-st__mode.is-active {
	border-color: var(--fms-orange);
	background:
		linear-gradient(135deg, rgba(255, 122, 26, 0.2), rgba(255, 122, 26, 0.03)),
		var(--fms-panel);
}

.fms-st__mode-icon {
	flex: 0 0 auto;
	width: 32px;
	height: 32px;
	border-radius: 8px;
	display: grid;
	place-items: center;
	font-size: 14px;
	font-weight: 800;
	color: var(--fms-orange);
	background: rgba(255, 122, 26, 0.09);
	border: 1px solid rgba(255, 122, 26, 0.35);
}

.fms-st__mode-icon svg {
	width: 16px;
	height: 16px;
}

.fms-st__mode-text {
	display: grid;
	gap: 2px;
	min-width: 0;
}

.fms-st__mode-text strong {
	font-size: 13.5px;
	font-weight: 700;
	color: var(--fms-text);
}

.fms-st__mode-text small {
	font-size: 11.5px;
	color: var(--fms-muted);
}

/* Actions */
.fms-st__actions {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 10px;
}

.fms-st .fms-st__play {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 9px;
	min-height: 54px;
	padding: 0 20px;
	border-radius: 12px;
	border: 0;
	font-size: 16px;
	font-weight: 700;
	color: #1c0e03;
	background: linear-gradient(180deg, #ff8a2e, var(--fms-orange-deep));
	box-shadow: 0 10px 26px rgba(255, 100, 10, 0.3);
	transition: filter 0.15s ease, transform 0.1s ease;
}

.fms-st .fms-st__play:hover {
	filter: brightness(1.06);
	color: #1c0e03;
	background: linear-gradient(180deg, #ff8a2e, var(--fms-orange-deep));
}

.fms-st .fms-st__play:disabled {
	opacity: 0.55;
	filter: saturate(0.7);
	box-shadow: none;
}

.fms-st .fms-st__play:active {
	transform: translateY(1px);
}

.fms-st__play svg {
	width: 16px;
	height: 16px;
}

.fms-st .fms-st__stop {
	min-height: 54px;
	padding: 0 22px;
	border-radius: 12px;
	font-size: 15px;
	font-weight: 600;
	color: var(--fms-text);
	background: var(--fms-panel-2);
	border: 1px solid var(--fms-line);
}

.fms-st .fms-st__stop:hover:not(:disabled) {
	border-color: rgba(255, 255, 255, 0.18);
	background: var(--fms-panel-2);
	color: var(--fms-text);
}

.fms-st .fms-st__stop:disabled {
	opacity: 0.45;
}

/* Result + answer */
.fms-st__result {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 14px;
	border-radius: 12px;
	background: var(--fms-panel);
	border: 1px dashed rgba(255, 128, 40, 0.4);
	font-size: 14px;
	font-weight: 600;
}

.fms-st__result[hidden],
.fms-st__answer[hidden] {
	display: none;
}

.fms-st__result-btns {
	display: flex;
	gap: 8px;
}

.fms-st .fms-st__chip {
	padding: 8px 16px;
	border-radius: 999px;
	font-size: 13.5px;
	font-weight: 600;
	color: var(--fms-text);
	background: var(--fms-panel-2);
	border: 1px solid var(--fms-line);
}

.fms-st .fms-st__chip:hover {
	border-color: var(--fms-orange);
	background: var(--fms-panel-2);
	color: var(--fms-text);
}

.fms-st__answer {
	padding: 14px 16px;
	border-radius: 12px;
	background: var(--fms-panel);
	border: 1px solid var(--fms-line);
	font-size: 13.5px;
	color: #ddd6cf;
}

.fms-st__answer strong {
	display: block;
	margin-bottom: 6px;
	color: var(--fms-text);
}

.fms-st__answer ul {
	margin: 0;
	padding-left: 18px;
	display: grid;
	gap: 5px;
}

.fms-st__answer.is-good strong {
	color: var(--fms-green);
}

/* Level slider */
.fms-st__level {
	padding: 14px 16px 16px;
	border-radius: 12px;
	background: var(--fms-panel);
	border: 1px solid var(--fms-line);
	display: grid;
	gap: 12px;
}

.fms-st__level-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.fms-st__level-label {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 13.5px;
	color: #ddd6cf;
}

.fms-st__level-label svg {
	width: 12px;
	height: 12px;
	color: var(--fms-muted);
}

.fms-st__level-value {
	font-size: 14px;
	font-weight: 700;
	color: var(--fms-orange);
}

.fms-st__range {
	--fill: 40%;
	-webkit-appearance: none;
	appearance: none;
	width: 100%;
	height: 4px;
	margin: 0;
	border-radius: 999px;
	background: linear-gradient(90deg, var(--fms-orange) var(--fill), #3a3330 var(--fill));
	cursor: pointer;
}

.fms-st__range::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #fff;
	border: 3px solid var(--fms-orange);
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.fms-st__range::-moz-range-thumb {
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: #fff;
	border: 3px solid var(--fms-orange);
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.fms-st__note {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	font-size: 12px;
	color: var(--fms-muted);
}

.fms-st__note svg {
	flex: 0 0 auto;
	width: 14px;
	height: 14px;
	margin-top: 1px;
	color: var(--fms-orange);
}

/* Microphone meter */
.fms-st__meter {
	height: 16px;
	border-radius: 999px;
	background: var(--fms-panel);
	border: 1px solid var(--fms-line);
	overflow: hidden;
}

.fms-st__meter-fill {
	height: 100%;
	width: 0%;
	border-radius: inherit;
	background: linear-gradient(90deg, #ffb066, var(--fms-orange) 55%, var(--fms-orange-deep));
	box-shadow: 0 0 12px rgba(255, 122, 26, 0.5);
}

/* Playing state */
@media (prefers-reduced-motion: no-preference) {
	.fms-st__card.is-playing .fms-st__dial-inner {
		animation: fms-st-pulse 1.2s ease-in-out infinite;
	}
}

@keyframes fms-st-pulse {
	0%, 100% {
		box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.04);
	}
	50% {
		box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.6), 0 0 26px rgba(255, 122, 26, 0.28);
	}
}

/* Small screens */
@media (max-width: 400px) {
	.fms-st__card {
		padding: 18px;
	}

	.fms-st__dial {
		width: 168px;
		height: 168px;
	}

	.fms-st__dial-big {
		font-size: 42px;
	}

	.fms-st__mode-text small {
		display: none;
	}
}

@media (max-width: 340px) {
	.fms-st__modes {
		grid-template-columns: 1fr;
	}
}
