:root {
	--matharm-primary: #075985;
	--matharm-primary-dark: #0c4a6e;
	--matharm-surface: #ffffff;
	--matharm-border: #cbd5e1;
	--matharm-muted: #475569;
}

html {
	scroll-behavior: smooth;
}

body {
	background: #f1f5f9;
	color: #0f172a;
	display: flex;
	font-family: Arial, sans-serif;
	min-height: 100vh;
	flex-direction: column;
}

.matharm-navbar {
	background: var(--matharm-primary);
}

.matharm-navbar .navbar-brand,
.matharm-navbar .nav-link {
	color: #ffffff;
}

.matharm-navbar .nav-link:hover,
.matharm-navbar .nav-link:focus-visible {
	background: rgba(255, 255, 255, 0.14);
	color: #ffffff;
}

.matharm-skip-link {
	background: #ffffff;
	color: #000000;
	left: 0.75rem;
	padding: 0.75rem 1rem;
	position: fixed;
	top: -5rem;
	z-index: 1100;
}

.matharm-skip-link:focus {
	top: 0.75rem;
}

.matharm-main {
	flex: 1;
	padding-bottom: 2.5rem;
	padding-top: 1.5rem;
}

.matharm-card {
	background: var(--matharm-surface);
	border: 1px solid var(--matharm-border);
	border-radius: 0.75rem;
	box-shadow: 0 0.25rem 1rem rgba(15, 23, 42, 0.07);
	padding: clamp(1rem, 3vw, 2rem);
}

.matharm-card textarea,
.matharm-card input[type="text"] {
	font-family: Consolas, "Courier New", monospace;
	font-size: 1rem;
	max-width: 100%;
	width: 100%;
}

.matharm-card form table,
.matharm-card form tbody,
.matharm-card form tr,
.matharm-card form th,
.matharm-card form td {
	display: block;
	width: 100%;
}

.matharm-card form th {
	margin-bottom: 0.35rem;
	text-align: left;
}

.matharm-grid {
	display: grid;
	gap: 1.25rem;
	grid-template-columns: minmax(0, 1fr);
}

.matharm-output {
	background: #f8fafc;
	border: 1px solid var(--matharm-border);
	border-radius: 0.5rem;
	min-height: 3rem;
	overflow-wrap: anywhere;
	padding: 1rem;
}

.matharm-result {
	font-size: clamp(1.25rem, 4vw, 1.75rem);
	font-weight: 700;
}

.matharm-code {
	background: #0f172a;
	color: #f8fafc;
	max-height: 20rem;
	overflow: auto;
	padding: 1rem;
	white-space: pre-wrap;
	word-break: break-word;
}

.matharm-status {
	color: var(--matharm-muted);
	min-height: 1.5rem;
}

.matharm-footer {
	background: #e2e8f0;
	padding: 1.25rem 0;
}

.matharm-card :focus-visible,
.matharm-navbar :focus-visible,
.matharm-footer :focus-visible {
	outline: 3px solid #f59e0b;
	outline-offset: 3px;
}

@media (min-width: 992px) {
	.matharm-grid--two-columns {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	}
}

@media (max-width: 575.98px) {
	.matharm-main {
		padding-left: 0.75rem;
		padding-right: 0.75rem;
	}

	.matharm-card {
		border-radius: 0.5rem;
		padding: 1rem;
	}

	.matharm-card .btn {
		width: 100%;
	}
}
