/* Shared calculator shell */
.nd-calc {
	margin: 0 0 1.5rem;
	padding: 1.35rem 1.4rem 1.25rem;
	border: 1px solid #e2e4e6;
	border-radius: 6px;
	background: #fff;
	box-shadow: 0 1px 0 rgba(0, 0, 0, 0.03);
	max-width: 36rem;
}

.nd-calc__head {
	margin: 0 0 1.1rem;
}

.nd-calc__eyebrow {
	margin: 0 0 0.25rem;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: #003954;
}

.nd-calc__title {
	margin: 0 0 0.4rem;
	font-size: 1.2rem;
	font-weight: 700;
	line-height: 1.25;
	color: #1a1a1a;
}

.nd-calc__lead {
	margin: 0;
	font-size: 0.92rem;
	line-height: 1.5;
	color: #5c5c5c;
}

.nd-calc__grid {
	display: grid;
	gap: 0.85rem 1rem;
}

.nd-calc__grid--2 {
	grid-template-columns: 1fr;
}

.nd-calc__grid--3,
.nd-calc__grid--4 {
	grid-template-columns: 1fr;
}

@media (min-width: 520px) {
	.nd-calc__grid--2 {
		grid-template-columns: 1fr 1fr;
	}
	.nd-calc__grid--3,
	.nd-calc__grid--4 {
		grid-template-columns: 1fr 1fr;
	}
	.nd-calc__field--wide {
		grid-column: 1 / -1;
	}
}

@media (min-width: 720px) {
	.nd-calc__grid--3 {
		grid-template-columns: 1fr 1fr 1fr;
	}
}

@media (min-width: 900px) {
	.nd-calc__grid--4 {
		grid-template-columns: 1fr 1fr 1fr 1fr;
	}
}

/* Horn calculator needs room for four inputs + figure */
.nd-hornborr.nd-calc {
	max-width: 56rem;
}

.nd-calc__hint {
	display: block;
	margin-top: 0.35rem;
	font-size: 0.78rem;
	line-height: 1.4;
	color: #5c5c5c;
}

.nd-calc__mode {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	margin: 0.85rem 0 0.5rem;
}

/* display:flex above must not win over the HTML hidden attribute */
.nd-calc__mode[hidden],
[data-nd-horn-hole-mode-wrap][hidden] {
	display: none !important;
}

.nd-calc__error {
	margin: 0.75rem 0;
	padding: 0.7rem 0.85rem;
	font-size: 0.9rem;
	line-height: 1.45;
	color: #7a1f1f;
	background: #fdecea;
	border: 1px solid #f0c4c0;
	border-radius: 4px;
}

.nd-calc__result-value--sm {
	font-size: 1.35rem;
}

.nd-hornborr__solution {
	margin-top: 0.85rem;
	padding-top: 0.75rem;
	border-top: 1px solid #e8e8e8;
}

.nd-hornborr__suggest {
	margin: 0.75rem 0 0;
	font-size: 0.9rem;
	font-weight: 600;
	color: #003954;
	line-height: 1.4;
}

.nd-hornborr__suggest-link {
	margin: 0.35rem 0 0;
	font-size: 0.88rem;
}

.nd-hornborr__suggest-link a {
	color: #003954;
	text-decoration: underline;
}

.nd-calc__assumptions {
	margin: 0.5rem 0 0;
	padding-left: 1.15rem;
	font-size: 0.88rem;
	line-height: 1.5;
	color: #5c5c5c;
}

.nd-calc__assumptions li {
	margin: 0.3rem 0;
}

.nd-calc__field label {
	display: block;
	font-size: 0.78rem;
	font-weight: 600;
	letter-spacing: 0.02em;
	color: #5c5c5c;
	margin: 0 0 0.35rem;
}

.nd-calc__field input:not([type="range"]),
.nd-calc__field select,
.nd-calc__select {
	width: 100%;
	padding: 0.55rem 0.7rem;
	border: 1px solid #c8c8c8;
	border-radius: 4px;
	font-size: 1rem;
	line-height: 1.3;
	background: #fafafa;
	color: #1a1a1a;
	transition: border-color 0.15s ease, background 0.15s ease;
}

.nd-calc__field input:not([type="range"]):focus,
.nd-calc__field select:focus,
.nd-calc__select:focus {
	outline: 2px solid #003954;
	outline-offset: 1px;
	border-color: #003954;
	background: #fff;
}

/* Open fields: no card/box chrome around slider groups */
.nd-calc__field--open {
	padding: 0;
	margin: 0;
	background: transparent;
	border: none;
	box-shadow: none;
	border-radius: 0;
}

.nd-calc__grid--inputs {
	gap: 1.15rem 1.35rem;
	padding: 0.15rem 0 0.35rem;
	background: transparent;
	border: none;
}

.nd-calc__flange {
	display: grid;
	gap: 0.4rem;
}

.nd-calc__flange-custom[hidden] {
	display: none !important;
}

/* Range sliders under number inputs — no border/box */
.nd-calc__slider {
	-webkit-appearance: none;
	appearance: none;
	display: block;
	width: 100%;
	height: 1.4rem;
	margin: 0.45rem 0 0.1rem;
	padding: 0;
	border: none !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	outline: none;
	background: transparent !important;
	cursor: pointer;
	/* filled track via --nd-slider-pct (0–100) */
	--nd-slider-pct: 0%;
}

.nd-calc__slider:focus {
	outline: none;
}

.nd-calc__slider:focus-visible {
	outline: 2px solid #003954;
	outline-offset: 3px;
	border-radius: 999px;
}

.nd-calc__slider::-webkit-slider-runnable-track {
	height: 6px;
	border-radius: 999px;
	background: linear-gradient(
		to right,
		#003954 0%,
		#003954 var(--nd-slider-pct),
		#d8dce0 var(--nd-slider-pct),
		#d8dce0 100%
	);
}

.nd-calc__slider::-moz-range-track {
	height: 6px;
	border-radius: 999px;
	background: #d8dce0;
	border: none;
}

.nd-calc__slider::-moz-range-progress {
	height: 6px;
	border-radius: 999px;
	background: #003954;
}

.nd-calc__slider::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 18px;
	height: 18px;
	margin-top: -6px;
	border-radius: 50%;
	background: #003954;
	border: 2px solid #fff;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.22);
	transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.nd-calc__slider::-moz-range-thumb {
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #003954;
	border: 2px solid #fff;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.22);
	transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.nd-calc__slider:hover::-webkit-slider-thumb,
.nd-calc__slider:active::-webkit-slider-thumb {
	transform: scale(1.08);
	box-shadow: 0 2px 8px rgba(0, 57, 84, 0.35);
}

.nd-calc__slider:hover::-moz-range-thumb,
.nd-calc__slider:active::-moz-range-thumb {
	transform: scale(1.08);
	box-shadow: 0 2px 8px rgba(0, 57, 84, 0.35);
}

.nd-calc__slider-ends {
	display: flex;
	justify-content: space-between;
	margin: 0 0 0.15rem;
	font-size: 0.68rem;
	font-variant-numeric: tabular-nums;
	color: #8a8a8a;
	letter-spacing: 0.01em;
}

.nd-calc__tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	margin: 0 0 1rem;
}

.nd-calc__tab {
	appearance: none;
	border: 1px solid #d0d0d0;
	background: #f4f4f4;
	color: #333;
	font-size: 0.88rem;
	font-weight: 600;
	padding: 0.45rem 0.85rem;
	border-radius: 999px;
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.nd-calc__tab:hover,
.nd-calc__tab:focus-visible {
	border-color: #003954;
	color: #003954;
}

.nd-calc__tab.is-active {
	background: #003954;
	border-color: #003954;
	color: #fff;
}

.nd-calc__result {
	margin-top: 1.15rem;
	padding: 0.95rem 1.05rem;
	background: #f7f8f9;
	border-radius: 4px;
	border-left: 3px solid #003954;
}

.nd-calc__result-label {
	margin: 0 0 0.2rem;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: #5c5c5c;
}

.nd-calc__result-value {
	margin: 0;
	font-size: 1.75rem;
	font-weight: 700;
	line-height: 1.15;
	color: #1a1a1a;
	font-variant-numeric: tabular-nums;
}

.nd-calc__unit {
	font-size: 0.95rem;
	font-weight: 600;
	color: #5c5c5c;
}

.nd-calc__result-meta {
	margin: 0.4rem 0 0;
	font-size: 0.88rem;
	line-height: 1.45;
	color: #5c5c5c;
}

.nd-calc__details {
	margin: 0.9rem 0 0;
	font-size: 0.88rem;
	color: #5c5c5c;
}

.nd-calc__details summary {
	cursor: pointer;
	font-weight: 600;
	color: #003954;
}

.nd-calc__details p {
	margin: 0.5rem 0 0;
	line-height: 1.55;
}

.nd-calc__note {
	margin: 0.9rem 0 0;
	font-size: 0.85rem;
	line-height: 1.5;
	color: #5c5c5c;
}

.nd-calc__note a {
	color: #003954;
	font-weight: 600;
	white-space: nowrap;
}

.nd-calc__links {
	margin: 0.65rem 0 0;
	font-size: 0.88rem;
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem 0.5rem;
	align-items: center;
}

.nd-calc__links a {
	color: #003954;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.nd-calc__links span {
	color: #b0b0b0;
}

/* Corner drill visual + dimension list */
.nd-hornborr__dims {
	list-style: none;
	margin: 0.55rem 0 0;
	padding: 0;
	font-size: 0.9rem;
	line-height: 1.45;
	color: #333;
}

.nd-hornborr__dims li {
	margin: 0.15rem 0;
}

.nd-hornborr__insight {
	margin: 0.75rem 0 0;
	padding: 0.55rem 0.7rem;
	font-size: 0.82rem;
	line-height: 1.45;
	color: #003954;
	background: rgba(0, 57, 84, 0.06);
	border-radius: 4px;
}

.nd-hornborr__visual {
	margin-top: 1.15rem;
	padding: 1rem 0.75rem 0.65rem;
	background: linear-gradient(180deg, #f8f9fa 0%, #f0f1f2 100%);
	border: 1px solid #e2e4e6;
	border-radius: 8px;
	text-align: center;
}

.nd-hornborr__svg {
	display: block;
	margin: 0 auto;
	width: 100%;
	max-width: 520px;
	height: auto;
}

.nd-hornborr__split {
	display: grid;
	gap: 1.25rem;
	margin-top: 0.25rem;
	align-items: start;
}

@media (min-width: 820px) {
	.nd-hornborr__split {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
		gap: 1.5rem;
	}
}

.nd-hornborr__col--result .nd-calc__result {
	margin-top: 0;
	height: 100%;
}

.nd-hornborr__L-note {
	margin: 0.35rem 0 0;
	font-size: 0.82rem;
	line-height: 1.45;
	color: #5c5c5c;
}

.nd-hornborr__col--visual .nd-hornborr__visual {
	margin-top: 0;
	height: 100%;
}

.nd-hornborr__wall {
	fill: #e6e8eb;
	stroke: #cfd2d6;
	stroke-width: 1;
}

.nd-hornborr__opening {
	fill: #ffffff;
	stroke: #1a1a1a;
	stroke-width: 2;
}

.nd-hornborr__corner-mark {
	stroke: #003954;
	stroke-linecap: square;
}

.nd-hornborr__hole {
	fill: rgba(0, 57, 84, 0.1);
	stroke: #003954;
	stroke-width: 2;
	stroke-dasharray: 7 5;
}

.nd-hornborr__hole--b {
	stroke: #0d6b5c;
	fill: rgba(13, 107, 92, 0.1);
}

.nd-hornborr__cut-front {
	stroke: #1a1a1a;
	stroke-width: 2;
	stroke-linecap: square;
}

.nd-hornborr__cut-end {
	stroke: #c45c26;
	stroke-width: 2.5;
	stroke-linecap: square;
}

.nd-hornborr__tangent {
	fill: #c45c26;
	stroke: #fff;
	stroke-width: 1;
}

.nd-hornborr__dim,
.nd-hornborr__tick {
	stroke: #5c5c5c;
	stroke-width: 1.75;
	stroke-linecap: square;
}

.nd-hornborr__center-dot {
	fill: #003954;
	stroke: #fff;
	stroke-width: 1.5;
}

.nd-hornborr__dim-text {
	fill: #1a1a1a;
	font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
	font-size: 12.5px;
	font-weight: 600;
}

.nd-hornborr__caption {
	fill: #5c5c5c;
	font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
	font-size: 12px;
}

/* Cross-links between calculators */
.nd-calc__xlinks {
	display: flex;
	flex-wrap: wrap;
	gap: 0.45rem 0.75rem;
	margin: 0.85rem 0 0;
	align-items: center;
}

.nd-calc__xlink {
	appearance: none;
	border: 0;
	background: none;
	padding: 0;
	font: inherit;
	font-size: 0.88rem;
	font-weight: 600;
	color: #003954;
	text-decoration: underline;
	text-underline-offset: 2px;
	cursor: pointer;
}

.nd-calc__xlink--primary {
	display: inline-block;
	padding: 0.4rem 0.75rem;
	border-radius: 4px;
	background: #003954;
	color: #fff;
	text-decoration: none;
}

.nd-calc__xlink--primary:hover,
.nd-calc__xlink--primary:focus-visible {
	background: #002a3d;
	color: #fff;
}

.nd-calc__mode--primary {
	margin-top: 0;
	margin-bottom: 0.35rem;
}

.nd-calc__mode-hint {
	margin: 0 0 0.85rem;
	font-size: 0.82rem;
	line-height: 1.45;
	color: #5c5c5c;
}

.nd-calc__mode-list {
	margin: 0 0 1rem;
	padding: 0.55rem 0.75rem 0.55rem 1.2rem;
	font-size: 0.82rem;
	line-height: 1.45;
	color: #5c5c5c;
	background: #f7f8f9;
	border-radius: 4px;
	list-style: disc;
}

.nd-calc__mode-list li {
	margin: 0.25rem 0;
}

.nd-calc__mode-list strong {
	color: #1a1a1a;
}

.nd-hornborr__center {
	margin: 0.55rem 0 0;
	font-size: 0.9rem;
	line-height: 1.45;
	font-weight: 600;
	color: #1a1a1a;
}

/* Homepage promo styles live in frontend.css (always enqueued). */

.nd-calc__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
	margin-top: 0.45rem;
}

.nd-calc__chip {
	appearance: none;
	border: 1px solid #d0d0d0;
	background: #f7f7f7;
	color: #333;
	font-size: 0.78rem;
	font-weight: 600;
	padding: 0.28rem 0.55rem;
	border-radius: 999px;
	cursor: pointer;
}

.nd-calc__chip.is-active,
.nd-calc__chip:hover {
	border-color: #003954;
	color: #003954;
	background: rgba(0, 57, 84, 0.06);
}

.nd-calc__result-meta--soft {
	font-style: italic;
	color: #6a6a6a;
}

.nd-hornborr__dual {
	margin: 0.55rem 0 0;
	padding: 0.5rem 0.65rem;
	font-size: 0.88rem;
	line-height: 1.45;
	font-weight: 600;
	color: #003954;
	background: rgba(0, 57, 84, 0.06);
	border-radius: 4px;
}

.nd-hornborr__overcut-note {
	margin: 0.5rem 0 0;
	font-size: 0.82rem;
	line-height: 1.45;
	color: #5c5c5c;
}

.nd-blockvikt__grade {
	margin: 0.65rem 0 0;
	padding: 0.55rem 0.7rem;
	font-size: 0.88rem;
	line-height: 1.45;
	color: #003954;
	background: rgba(0, 57, 84, 0.07);
	border-left: 3px solid #003954;
	border-radius: 0 4px 4px 0;
}

.nd-blockvikt__size-note {
	margin: 0.45rem 0 0;
	font-size: 0.82rem;
	line-height: 1.45;
	color: #5c5c5c;
}

.nd-blockvikt__split {
	margin-top: 0.75rem;
	padding-top: 0.65rem;
	border-top: 1px solid #e8e8e8;
}

.nd-somborr.nd-calc,
.nd-skardjup.nd-calc,
.nd-blockvikt.nd-calc {
	max-width: 56rem;
}

.nd-somborr__split {
	display: grid;
	gap: 1.25rem;
	margin-top: 0.5rem;
	align-items: start;
}

@media (min-width: 820px) {
	.nd-somborr__split {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
		gap: 1.5rem;
	}
}

.nd-somborr__stats {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.75rem 1rem;
	margin-bottom: 0.65rem;
}

.nd-somborr__h {
	margin: 0.35rem 0 0.5rem;
	font-size: 0.92rem;
	line-height: 1.4;
	color: #1a1a1a;
}

.nd-somborr__mitt {
	margin: 0.65rem 0 0;
	padding: 0.55rem 0.7rem;
	font-size: 0.9rem;
	line-height: 1.45;
	color: #003954;
	background: rgba(0, 57, 84, 0.07);
	border-left: 3px solid #003954;
	border-radius: 0 4px 4px 0;
}

.nd-somborr__split-note {
	margin: 0.45rem 0 0;
	padding: 0.55rem 0.7rem;
	font-size: 0.9rem;
	line-height: 1.45;
	color: #0d6b5c;
	background: rgba(13, 107, 92, 0.08);
	border-left: 3px solid #0d6b5c;
	border-radius: 0 4px 4px 0;
}

.nd-somborr__hole--split {
	stroke: #0d6b5c;
	fill: rgba(13, 107, 92, 0.14);
	stroke-dasharray: 4 3;
}

.nd-somborr__visual {
	margin-top: 0;
}

.nd-somborr__hole {
	fill: rgba(0, 57, 84, 0.12);
	stroke: #003954;
	stroke-width: 1.25;
}

.nd-somborr__h-mark {
	stroke: #c45c26;
	stroke-width: 2;
	stroke-linecap: square;
}

.nd-somborr__opening {
	fill: #fff;
	stroke: #1a1a1a;
	stroke-width: 2;
}

/* Hub: all calculators */
.nd-calc-hub {
	margin: 1.25rem 0 2rem;
}

.nd-calc-hub__nav {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0 0 1.15rem;
	padding: 0.35rem;
	background: #f0f1f2;
	border-radius: 8px;
}

.nd-calc-hub__btn {
	appearance: none;
	flex: 1 1 auto;
	min-width: 5.5rem;
	border: none;
	background: transparent;
	color: #333;
	font-size: 0.82rem;
	font-weight: 600;
	line-height: 1.25;
	padding: 0.55rem 0.65rem;
	border-radius: 6px;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.nd-calc-hub__btn:hover,
.nd-calc-hub__btn:focus-visible {
	background: rgba(255, 255, 255, 0.7);
	color: #003954;
}

.nd-calc-hub__btn.is-active {
	background: #fff;
	color: #003954;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.nd-calc-hub__panel {
	display: none;
}

.nd-calc-hub__panel.is-active {
	display: block;
}

.nd-calc-hub__panel[hidden] {
	display: none !important;
}

.nd-calc-hub .nd-calc {
	max-width: none;
	margin-bottom: 0;
}

/* Legacy class alias */
.nd-karnvikt {
	/* kept for old markup; styles via .nd-calc */
}
