.asi-calculator {
	--asi-navy: #0b1526;
	--asi-panel: #142238;
	--asi-panel-hover: #1b2c47;
	--asi-border: #223452;
	--asi-text-soft: #7c8aa6;
	--asi-teal: #2dd4bf;
	--asi-teal-deep: #26b3a1;

	max-width: 440px;
	margin: 24px 0;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	box-sizing: border-box;
}

.asi-calculator *,
.asi-calculator *::before,
.asi-calculator *::after {
	box-sizing: inherit;
}

.asi-panel {
	background: var(--asi-navy);
	border: 1px solid var(--asi-border);
	border-radius: 18px;
	overflow: hidden;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.asi-header {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 18px 22px;
	border-bottom: 1px solid var(--asi-border);
}

.asi-header-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 26px;
	border-radius: 8px;
	border: 1.5px solid var(--asi-teal);
	color: var(--asi-teal);
	font-size: 11px;
	font-weight: 700;
	flex-shrink: 0;
}

.asi-heading {
	margin: 0;
	font-size: 16px;
	font-weight: 700;
	color: #ffffff;
	letter-spacing: -0.01em;
}

.asi-body {
	padding: 20px 22px 22px;
}

.asi-label {
	display: block;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--asi-text-soft);
	margin-bottom: 8px;
}

.asi-input {
	width: 100%;
	padding: 12px 14px;
	font-size: 15px;
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	font-variant-numeric: tabular-nums;
	border: none;
	background: #ffffff;
	border-radius: 10px;
	color: var(--asi-navy);
	transition: box-shadow 0.15s ease;
}

.asi-input::placeholder {
	color: #9aa4b5;
}

.asi-input:focus {
	outline: none;
	box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.45);
}

.asi-field-hint {
	margin: 8px 0 0;
	font-size: 12px;
	color: var(--asi-text-soft);
	line-height: 1.5;
}

.asi-example-note {
	margin: 6px 0 0;
	font-size: 11.5px;
	font-style: italic;
	color: var(--asi-teal);
}

.asi-button-row {
	display: flex;
	gap: 10px;
	margin-top: 16px;
}

.asi-btn {
	flex: 1;
	padding: 12px 18px;
	font-size: 14px;
	font-weight: 700;
	font-family: inherit;
	border: none;
	border-radius: 10px;
	cursor: pointer;
	transition: background 0.15s ease, transform 0.05s ease;
}

.asi-btn-primary {
	background: var(--asi-teal);
	color: #06231f;
}

.asi-btn-primary:hover {
	background: var(--asi-teal-deep);
}

.asi-btn-ghost {
	background: var(--asi-panel);
	color: #ffffff;
	border: 1px solid var(--asi-border);
}

.asi-btn-ghost:hover {
	background: var(--asi-panel-hover);
}

.asi-btn:active {
	transform: translateY(1px);
}

.asi-btn:focus-visible {
	outline: 2px solid var(--asi-teal);
	outline-offset: 2px;
}

.asi-error {
	min-height: 16px;
	margin: 12px 0 0;
	font-size: 13px;
	font-weight: 600;
	color: #ff9d8a;
}

/* Results */
.asi-results:not(.has-result) {
	display: none;
}

.asi-answer-box {
	text-align: center;
	margin-top: 22px;
	padding: 16px;
	background: var(--asi-panel);
	border: 1px solid var(--asi-border);
	border-radius: 12px;
}

.asi-answer-label {
	display: block;
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--asi-text-soft);
	margin-bottom: 8px;
}

.asi-answer-value {
	display: block;
	font-size: 28px;
	font-weight: 800;
	font-variant-numeric: tabular-nums;
	letter-spacing: -0.02em;
	color: var(--asi-teal);
}

/* Solution */
.asi-solution {
	margin-top: 22px;
}

.asi-section-title {
	margin: 0 0 14px;
	font-size: 13px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--asi-text-soft);
}

.asi-step {
	margin-bottom: 14px;
}

.asi-step:last-child {
	margin-bottom: 0;
}

.asi-step p {
	margin: 0 0 6px;
	font-size: 13px;
	color: var(--asi-text-soft);
	line-height: 1.5;
}

.asi-formula {
	font-size: 15px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	color: #ffffff !important;
	background: var(--asi-panel);
	border: 1px solid var(--asi-border);
	padding: 8px 12px;
	border-radius: 8px;
	display: inline-block;
	word-break: break-word;
}

.asi-running-table {
	background: var(--asi-panel);
	border: 1px solid var(--asi-border);
	border-radius: 10px;
	overflow: hidden;
	font-size: 13px;
}

.asi-running-head {
	display: flex;
	justify-content: space-between;
	padding: 6px 14px;
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--asi-text-soft);
	border-bottom: 1px solid var(--asi-border);
}

.asi-running-row {
	display: flex;
	justify-content: space-between;
	padding: 7px 14px;
	font-variant-numeric: tabular-nums;
	border-bottom: 1px dashed var(--asi-border);
}

.asi-running-row:last-child {
	border-bottom: none;
}

.asi-running-term {
	color: #ffffff;
	font-weight: 600;
}

.asi-running-value {
	color: var(--asi-teal);
	font-weight: 700;
}

@media (prefers-reduced-motion: reduce) {
	.asi-btn {
		transition: none;
	}
}
