.torfy-nth-prime-calculator {
	--torfy-nth-prime-ink: #18212f;
	--torfy-nth-prime-muted: #5f6c7c;
	--torfy-nth-prime-border: #dce3ec;
	--torfy-nth-prime-soft: #f6f8fb;
	--torfy-nth-prime-accent: #2563eb;
	--torfy-nth-prime-accent-dark: #1d4ed8;
	--torfy-nth-prime-success: #0f8f52;
	--torfy-nth-prime-success-soft: #e8f7ef;
	--torfy-nth-prime-danger: #b42318;
	--torfy-nth-prime-danger-soft: #fff1f0;
	color: var(--torfy-nth-prime-ink);
	font-family: inherit;
	margin: 32px auto;
	max-width: 880px;
}

.torfy-nth-prime-calculator *,
.torfy-nth-prime-calculator *::before,
.torfy-nth-prime-calculator *::after {
	box-sizing: border-box;
}

.torfy-nth-prime-card {
	background: #fff;
	border: 1px solid rgba(220, 227, 236, 0.9);
	border-radius: 18px;
	box-shadow: 0 18px 50px rgba(24, 33, 47, 0.12);
	padding: 28px;
}

.torfy-nth-prime-header {
	align-items: flex-start;
	display: flex;
	gap: 18px;
	justify-content: space-between;
	margin-bottom: 24px;
}

.torfy-nth-prime-title {
	color: var(--torfy-nth-prime-ink);
	font-size: clamp(1.65rem, 1.4rem + 1vw, 2.45rem);
	font-weight: 760;
	letter-spacing: 0;
	line-height: 1.14;
	margin: 0 0 10px;
}

.torfy-nth-prime-description {
	color: var(--torfy-nth-prime-muted);
	font-size: 1rem;
	line-height: 1.65;
	margin: 0;
	max-width: 690px;
}

.torfy-nth-prime-badge,
.torfy-nth-prime-success-badge,
.torfy-nth-prime-status {
	align-items: center;
	border-radius: 999px;
	display: inline-flex;
	font-size: 0.78rem;
	font-weight: 700;
	gap: 8px;
	letter-spacing: 0;
	white-space: nowrap;
}

.torfy-nth-prime-badge {
	background: #edf4ff;
	color: var(--torfy-nth-prime-accent-dark);
	padding: 8px 12px;
}

.torfy-nth-prime-form {
	align-items: end;
	display: grid;
	gap: 14px;
	grid-template-columns: 1fr auto;
	margin-bottom: 14px;
}

.torfy-nth-prime-field {
	display: grid;
	gap: 8px;
}

.torfy-nth-prime-label {
	color: var(--torfy-nth-prime-ink);
	font-size: 0.92rem;
	font-weight: 700;
}

.torfy-nth-prime-input {
	appearance: none;
	background: var(--torfy-nth-prime-soft);
	border: 1px solid var(--torfy-nth-prime-border);
	border-radius: 12px;
	color: var(--torfy-nth-prime-ink);
	font: inherit;
	font-size: 1rem;
	min-height: 52px;
	outline: none;
	padding: 0 16px;
	transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
	width: 100%;
}

.torfy-nth-prime-input:focus {
	background: #fff;
	border-color: var(--torfy-nth-prime-accent);
	box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14);
}

.torfy-nth-prime-button {
	align-items: center;
	background: var(--torfy-nth-prime-accent);
	border: 0;
	border-radius: 12px;
	color: #fff;
	cursor: pointer;
	display: inline-flex;
	font: inherit;
	font-size: 0.98rem;
	font-weight: 800;
	justify-content: center;
	min-height: 52px;
	min-width: 170px;
	padding: 0 20px;
	transition: background 160ms ease, transform 160ms ease, opacity 160ms ease;
}

.torfy-nth-prime-button:hover,
.torfy-nth-prime-button:focus {
	background: var(--torfy-nth-prime-accent-dark);
}

.torfy-nth-prime-button:active {
	transform: translateY(1px);
}

.torfy-nth-prime-button:disabled {
	cursor: wait;
	opacity: 0.68;
	transform: none;
}

.torfy-nth-prime-message {
	border-radius: 12px;
	font-size: 0.94rem;
	font-weight: 650;
	margin: 0 0 18px;
	min-height: 0;
}

.torfy-nth-prime-message:not(:empty) {
	padding: 12px 14px;
}

.torfy-nth-prime-message.is-error {
	background: var(--torfy-nth-prime-danger-soft);
	color: var(--torfy-nth-prime-danger);
}

.torfy-nth-prime-progress {
	display: grid;
	gap: 16px;
}

.torfy-nth-prime-results {
	display: grid;
	gap: 14px;
}

.torfy-nth-prime-result-card {
	background: #fff;
	border: 1px solid var(--torfy-nth-prime-border);
	border-radius: 14px;
	display: grid;
	gap: 14px;
	grid-template-columns: 26px 1fr;
	padding: 18px;
	position: relative;
}

.torfy-nth-prime-step-marker {
	align-items: center;
	display: flex;
	flex-direction: column;
	padding-top: 4px;
}

.torfy-nth-prime-step-dot {
	background: var(--torfy-nth-prime-accent);
	border: 4px solid #dbeafe;
	border-radius: 999px;
	height: 18px;
	width: 18px;
}

.torfy-nth-prime-result-card.is-complete .torfy-nth-prime-step-dot {
	background: var(--torfy-nth-prime-success);
	border-color: var(--torfy-nth-prime-success-soft);
}

.torfy-nth-prime-step-line {
	background: var(--torfy-nth-prime-border);
	flex: 1;
	margin-top: 8px;
	min-height: 42px;
	width: 2px;
}

.torfy-nth-prime-result-card:last-child .torfy-nth-prime-step-line {
	display: none;
}

.torfy-nth-prime-result-content {
	min-width: 0;
}

.torfy-nth-prime-result-top {
	align-items: center;
	display: flex;
	gap: 12px;
	justify-content: space-between;
	margin-bottom: 8px;
}

.torfy-nth-prime-step-label {
	color: var(--torfy-nth-prime-muted);
	font-size: 0.82rem;
	font-weight: 800;
	margin: 0;
	text-transform: uppercase;
}

.torfy-nth-prime-status {
	background: #eef2ff;
	color: #3730a3;
	padding: 7px 10px;
}

.torfy-nth-prime-status.is-success,
.torfy-nth-prime-success-badge {
	background: var(--torfy-nth-prime-success-soft);
	color: var(--torfy-nth-prime-success);
	padding: 7px 10px;
}

.torfy-nth-prime-method-title {
	color: var(--torfy-nth-prime-ink);
	font-size: 1.05rem;
	font-weight: 760;
	line-height: 1.35;
	margin: 0 0 10px;
}

.torfy-nth-prime-loading {
	color: var(--torfy-nth-prime-muted);
	font-size: 0.96rem;
	margin: 0;
}

.torfy-nth-prime-spinner {
	animation: torfy-nth-prime-spin 800ms linear infinite;
	border: 2px solid rgba(55, 48, 163, 0.22);
	border-top-color: #3730a3;
	border-radius: 999px;
	display: inline-block;
	height: 14px;
	width: 14px;
}

.torfy-nth-prime-facts {
	display: grid;
	gap: 10px;
	margin: 0;
}

.torfy-nth-prime-facts div {
	background: var(--torfy-nth-prime-soft);
	border: 1px solid #edf1f6;
	border-radius: 12px;
	display: grid;
	gap: 4px;
	padding: 12px;
}

.torfy-nth-prime-facts dt {
	color: var(--torfy-nth-prime-muted);
	font-size: 0.78rem;
	font-weight: 800;
	margin: 0;
	text-transform: uppercase;
}

.torfy-nth-prime-facts dd {
	color: var(--torfy-nth-prime-ink);
	font-size: 0.98rem;
	font-weight: 650;
	margin: 0;
	overflow-wrap: anywhere;
}

.torfy-nth-prime-summary-card {
	background: #f0fbf5;
	border: 1px solid #bfe8d0;
	border-radius: 14px;
	padding: 20px;
}

.torfy-nth-prime-summary-card h3 {
	color: var(--torfy-nth-prime-ink);
	font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.65rem);
	font-weight: 800;
	letter-spacing: 0;
	line-height: 1.25;
	margin: 12px 0 0;
}

@keyframes torfy-nth-prime-spin {
	to {
		transform: rotate(360deg);
	}
}

@media (max-width: 680px) {
	.torfy-nth-prime-calculator {
		margin: 20px auto;
	}

	.torfy-nth-prime-card {
		border-radius: 14px;
		padding: 20px;
	}

	.torfy-nth-prime-header,
	.torfy-nth-prime-result-top {
		align-items: flex-start;
		flex-direction: column;
	}

	.torfy-nth-prime-form {
		grid-template-columns: 1fr;
	}

	.torfy-nth-prime-button {
		width: 100%;
	}
}
