/* Speed Calculator — Teal & Navy theme */

.spc-widget {
	--spc-navy-950: #0a1120;
	--spc-navy-900: #0f172a;
	--spc-navy-800: #16223b;
	--spc-navy-700: #1e2c4a;
	--spc-teal-300: #5eead4;
	--spc-teal-400: #2dd4bf;
	--spc-teal-600: #0d9488;
	--spc-text-soft: #94a3b8;
	--spc-text-faint: #4c5c7a;

	max-width: 480px;
	margin: 2rem auto;
	padding: 2rem 1.75rem 1.75rem;
	border-radius: 22px;
	background: linear-gradient(160deg, var(--spc-navy-900) 0%, var(--spc-navy-950) 100%);
	box-shadow:
		0 20px 45px -15px rgba(10, 17, 32, 0.55),
		0 0 0 1px rgba(45, 212, 191, 0.12),
		inset 0 1px 0 rgba(255, 255, 255, 0.04);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	position: relative;
	overflow: hidden;
	box-sizing: border-box;
}

.spc-widget *,
.spc-widget *::before,
.spc-widget *::after {
	box-sizing: border-box;
}

.spc-widget::before {
	content: "";
	position: absolute;
	top: -60%;
	left: 50%;
	width: 140%;
	height: 140%;
	transform: translateX(-50%);
	background: radial-gradient(circle, rgba(45, 212, 191, 0.14) 0%, rgba(45, 212, 191, 0) 60%);
	pointer-events: none;
}

.spc-header {
	text-align: center;
	margin-bottom: 1.25rem;
	position: relative;
}

.spc-eyebrow {
	display: inline-block;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.22em;
	color: var(--spc-teal-300);
	text-transform: uppercase;
}

.spc-title {
	margin: 0.35rem 0 0;
	font-size: 1.5rem;
	font-weight: 800;
	color: #f1f5f9;
	letter-spacing: -0.01em;
}

/* ---------- Tabs ---------- */

.spc-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 0.3rem;
	padding: 0.3rem;
	margin-bottom: 1.1rem;
	background: rgba(15, 23, 42, 0.55);
	border: 1px solid rgba(94, 234, 212, 0.15);
	border-radius: 14px;
}

.spc-tab {
	flex: 1;
	min-width: 30%;
	padding: 0.6rem 0.3rem;
	border: none;
	border-radius: 10px;
	background: transparent;
	color: var(--spc-text-soft);
	font-family: inherit;
	font-size: 0.76rem;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease;
}

.spc-tab:hover {
	color: #e2e8f0;
}

.spc-tab.is-active {
	background: linear-gradient(135deg, var(--spc-teal-400), var(--spc-teal-600));
	color: var(--spc-navy-950);
	box-shadow: 0 6px 16px -6px rgba(20, 184, 166, 0.6);
}

/* ---------- Rows ---------- */

.spc-rows {
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
	margin-bottom: 1rem;
}

.spc-row {
	display: grid;
	grid-template-columns: 80px 1fr 90px;
	align-items: center;
	gap: 0.5rem;
	padding: 0.4rem 0.6rem;
	border-radius: 12px;
	background: rgba(15, 23, 42, 0.55);
	border: 1px solid rgba(94, 234, 212, 0.12);
	transition: border-color 0.2s ease, background 0.2s ease;
}

.spc-row.is-computed {
	border-color: rgba(94, 234, 212, 0.45);
	background: rgba(45, 212, 191, 0.1);
}

.spc-row-label {
	font-size: 0.78rem;
	font-weight: 700;
	color: var(--spc-teal-300);
}

.spc-input {
	width: 100%;
	padding: 0.55rem 0.6rem;
	border-radius: 9px;
	border: 1px solid rgba(94, 234, 212, 0.18);
	background: var(--spc-navy-800);
	color: #f1f5f9;
	font-family: inherit;
	font-size: 0.95rem;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	outline: none;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.spc-input::placeholder {
	color: #506080;
	font-weight: 500;
}

.spc-input:focus {
	border-color: var(--spc-teal-400);
	box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.18);
}

.spc-input:disabled {
	color: var(--spc-teal-300);
	cursor: default;
	opacity: 1;
}

.spc-unit {
	width: 100%;
	padding: 0.55rem 0.4rem;
	border-radius: 9px;
	border: 1px solid rgba(94, 234, 212, 0.18);
	background: var(--spc-navy-800);
	color: #cbd5e1;
	font-family: inherit;
	font-size: 0.82rem;
	font-weight: 600;
	outline: none;
	cursor: pointer;
}

/* ---------- Error ---------- */

.spc-error {
	margin-bottom: 1rem;
	padding: 0.7rem 0.9rem;
	border-radius: 10px;
	background: rgba(220, 38, 38, 0.12);
	border: 1px solid rgba(248, 113, 113, 0.3);
	color: #fca5a5;
	font-size: 0.85rem;
	line-height: 1.5;
}

/* ---------- Velocity conversion grid ---------- */

.spc-velocity-grid {
	margin-bottom: 1rem;
}

.spc-grid-title {
	display: block;
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	color: var(--spc-text-faint);
	margin-bottom: 0.5rem;
}

.spc-grid {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	gap: 0.45rem;
}

.spc-cell {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.25rem;
	padding: 0.6rem 0.25rem;
	border-radius: 10px;
	background: rgba(30, 44, 74, 0.45);
	border: 1px solid rgba(94, 234, 212, 0.15);
	text-align: center;
}

.spc-cell-label {
	font-size: 0.62rem;
	font-weight: 700;
	color: var(--spc-text-faint);
}

.spc-cell-value {
	font-size: 0.82rem;
	font-weight: 800;
	color: var(--spc-teal-300);
	font-variant-numeric: tabular-nums;
	word-break: break-word;
}

/* ---------- Formula ---------- */

.spc-formula {
	margin-top: 0.5rem;
	font-size: 0.8rem;
	font-weight: 600;
	color: var(--spc-text-faint);
	text-align: center;
}

@media (max-width: 460px) {
	.spc-row {
		grid-template-columns: 60px 1fr 80px;
	}
	.spc-grid {
		grid-template-columns: repeat(3, 1fr);
	}
}
