/**
 * Fix My Speaker — tool styles.
 * The card always renders light because it sits on the dark hero.
 */

.fms-tool {
	--fms-accent: #12909e;
	--fms-accent-deep: #0b6e78;
	--fms-accent-soft: #e3f4f5;
	--fms-amber: #b4720f;
	--fms-ink: #0d1618;
	--fms-ink-2: #445b60;
	--fms-ink-3: #7d9499;
	--fms-surface: #ffffff;
	--fms-track: #e6edee;
	--fms-line: #dde6e7;
	--fms-progress: 0;

	background: var(--fms-surface);
	border-radius: 20px;
	padding: 26px 22px 22px;
	max-width: 480px;
	margin-inline: auto;
	color: var(--fms-ink);
	display: flex;
	flex-direction: column;
	gap: 20px;
	box-shadow:
		0 1px 2px rgba(7, 26, 31, 0.08),
		0 18px 40px -18px rgba(7, 26, 31, 0.55);
	text-align: left;
}

.fms-tool__label {
	font-size: 0.68rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--fms-ink-3);
	margin: 0 0 9px;
	font-weight: 600;
}

.fms-tool__group {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 8px;
}

.fms-tool__chip {
	font: inherit;
	font-size: 0.9rem;
	font-weight: 500;
	line-height: 1.25;
	min-height: 46px;
	padding: 10px 12px;
	border: 1px solid var(--fms-line);
	border-radius: 12px;
	background: #f7fafa;
	color: var(--fms-ink-2);
	cursor: pointer;
	transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.fms-tool__chip:hover:not(:disabled) {
	border-color: var(--fms-accent);
	color: var(--fms-ink);
}

.fms-tool__chip[aria-pressed="true"] {
	background: var(--fms-accent-soft);
	border-color: var(--fms-accent);
	color: var(--fms-accent-deep);
	font-weight: 650;
	box-shadow: inset 0 0 0 1px var(--fms-accent);
}

.fms-tool__chip:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

.fms-tool__chip:focus-visible {
	outline: 2px solid var(--fms-accent);
	outline-offset: 2px;
}

.fms-tool__gauge {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
}

.fms-tool__ring {
	width: 172px;
	height: 172px;
	border-radius: 50%;
	display: grid;
	place-items: center;
	background: conic-gradient(
		var(--fms-accent) calc(var(--fms-progress) * 1%),
		var(--fms-track) 0
	);
	transition: background 0.2s linear;
}

.fms-tool__ring::before {
	content: "";
	grid-area: 1 / 1;
	width: 142px;
	height: 142px;
	border-radius: 50%;
	background: var(--fms-surface);
	box-shadow: inset 0 1px 10px rgba(7, 26, 31, 0.06);
}

.fms-tool__percent {
	grid-area: 1 / 1;
	font-size: 2.3rem;
	font-weight: 650;
	font-variant-numeric: tabular-nums;
	letter-spacing: -0.02em;
	color: var(--fms-ink);
	z-index: 1;
}

.fms-tool[data-fms-running] .fms-tool__percent {
	color: var(--fms-accent-deep);
}

.fms-tool__status {
	font-size: 0.88rem;
	line-height: 1.55;
	color: var(--fms-ink-2);
	text-align: center;
	margin: 0;
	min-height: 3.1em;
}

.fms-tool__actions {
	display: flex;
	gap: 9px;
}

.fms-tool__btn {
	font: inherit;
	font-size: 1rem;
	font-weight: 650;
	min-height: 52px;
	padding: 14px 18px;
	border-radius: 13px;
	border: 1px solid transparent;
	cursor: pointer;
	transition: filter 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.fms-tool__btn:focus-visible {
	outline: 2px solid var(--fms-accent);
	outline-offset: 2px;
}

.fms-tool__btn--play {
	flex: 1 1 auto;
	background: linear-gradient(180deg, var(--fms-accent) 0%, var(--fms-accent-deep) 100%);
	color: #ffffff;
	box-shadow: 0 6px 16px -8px rgba(11, 110, 120, 0.9);
}

.fms-tool__btn--play:hover {
	filter: brightness(1.07);
}

.fms-tool__btn--ghost {
	background: transparent;
	border-color: var(--fms-line);
	color: var(--fms-ink-2);
}

.fms-tool__btn--ghost:hover {
	border-color: var(--fms-accent);
	color: var(--fms-ink);
}

.fms-tool__btn--wide {
	width: 100%;
}

.fms-tool__notice,
.fms-tool__result {
	font-size: 0.86rem;
	line-height: 1.6;
	margin: 0;
	padding: 12px 14px;
	border-radius: 12px;
}

.fms-tool__notice {
	background: #fdf4e7;
	color: var(--fms-amber);
	border: 1px solid #f0d6ab;
}

.fms-tool__result {
	background: var(--fms-accent-soft);
	color: var(--fms-ink);
	border: 1px solid #a9d8dc;
}

.fms-tool__steps {
	margin: 0;
	padding: 16px 0 0;
	list-style: none;
	border-top: 1px solid var(--fms-line);
	font-size: 0.85rem;
	color: var(--fms-ink-2);
	line-height: 1.55;
	counter-reset: fms;
	display: flex;
	flex-direction: column;
	gap: 7px;
}

.fms-tool__steps li {
	counter-increment: fms;
	display: grid;
	grid-template-columns: 20px 1fr;
	gap: 10px;
	align-items: start;
}

.fms-tool__steps li::before {
	content: counter(fms);
	font-size: 0.7rem;
	font-weight: 700;
	color: var(--fms-accent-deep);
	background: var(--fms-accent-soft);
	border-radius: 50%;
	width: 20px;
	height: 20px;
	display: grid;
	place-items: center;
	margin-top: 1px;
}

.fms-tool [hidden] {
	display: none !important;
}

@media (max-width: 400px) {
	.fms-tool {
		padding: 20px 15px 18px;
		border-radius: 16px;
	}
	.fms-tool__ring {
		width: 150px;
		height: 150px;
	}
	.fms-tool__ring::before {
		width: 124px;
		height: 124px;
	}
	.fms-tool__percent {
		font-size: 2rem;
	}
	.fms-tool__chip {
		font-size: 0.85rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.fms-tool__ring,
	.fms-tool__chip,
	.fms-tool__btn {
		transition: none;
	}
}
