/**
 * Slope Calculator — sn-ci-calc layout extensions.
 */

.sn-slope-calc__mode-tab {
	border: none;
	cursor: pointer;
	font: inherit;
}

@media (min-width: 1024px) {
	.sn-slope-calc .sn-ci-calc__results {
		align-self: stretch;
		overflow: visible;
	}

	.sn-slope-calc .sn-ci-calc__inputs {
		align-self: flex-start;
	}
}

.sn-slope-calc__panel-title {
	margin: 0 0 0.875rem;
	font-family: var(--font-heading, Sora, sans-serif);
	font-size: 1rem;
	font-weight: 600;
	color: #1e293b;
}

.sn-slope-calc__coord-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.75rem 1rem;
}

@media (min-width: 480px) {
	.sn-slope-calc__coord-grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

.sn-slope-calc__coord-field {
	display: flex;
	flex-direction: column;
	gap: 0.375rem;
	min-width: 0;
}

.sn-slope-calc__coord-label {
	font-size: 0.875rem;
	font-weight: 600;
	color: #334155;
}

.sn-slope-calc__coord-label sub {
	font-size: 0.72em;
}

.sn-slope-calc__input-group {
	width: 100%;
	min-width: 0;
}

.sn-slope-calc__input-group--invalid {
	border-color: #dc2626;
	box-shadow: inset 0 0 0 1px #dc2626;
}

.sn-slope-calc__input-group--invalid:focus-within {
	border-color: #dc2626;
	outline-color: #fecaca;
}

.sn-slope-calc__coord-input {
	text-align: center;
	min-width: 0;
}

.sn-slope-calc__mode-panel .sn-ci-calc__label {
	width: auto;
	min-width: 6.75rem;
	max-width: 42%;
	flex-shrink: 0;
}

.sn-slope-calc__or-divider {
	margin: -0.375rem 0 0.75rem;
	font-size: 0.8125rem;
	font-weight: 700;
	text-align: center;
	color: #64748b;
	letter-spacing: 0.04em;
}

.sn-slope-calc__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.625rem;
	align-items: center;
}

.sn-slope-calc__actions .sn-calc-btn--clear {
	min-height: 2.75rem;
	padding: 0.5rem 1.125rem;
}

.sn-slope-calc__placeholder {
	margin: 0 0 1rem;
	padding: 1rem 1.125rem;
	border-radius: 8px;
	background: #f1f5f9;
	border: 1px dashed #cbd5e1;
	color: #475569;
	font-size: 0.9375rem;
	line-height: 1.5;
}

.sn-slope-calc__chart-wrap {
	margin-bottom: 1rem;
}

.sn-slope-calc__chart {
	width: 100%;
	max-width: 100%;
}

.sn-slope-calc__chart-svg {
	display: block;
	width: 100%;
	height: auto;
}

.sn-slope-calc__chart-bg {
	fill: #f8fafc;
}

.sn-slope-calc__chart-grid line {
	stroke: #e2e8f0;
	stroke-width: 1;
}

.sn-slope-calc__chart-axis {
	stroke: #334155;
	stroke-width: 2;
	fill: none;
}

.sn-slope-calc__chart-axis-label {
	font-size: 12px;
	fill: #334155;
	font-family: var(--font-sans, Inter, system-ui, sans-serif);
}

.sn-slope-calc__chart-segment {
	stroke: #dc2626;
	stroke-width: 3;
	fill: none;
}

.sn-slope-calc__chart-ref {
	stroke: #64748b;
	stroke-width: 1.5;
	stroke-dasharray: 3 3;
	fill: none;
	opacity: 0.85;
}

.sn-slope-calc__chart-dx {
	stroke: #2b7ddb;
	stroke-width: 2;
	stroke-dasharray: 6 4;
	fill: none;
}

.sn-slope-calc__chart-dy {
	stroke: #16a34a;
	stroke-width: 2;
	stroke-dasharray: 6 4;
	fill: none;
}

.sn-slope-calc__chart-angle {
	stroke: #f5c518;
	stroke-width: 2.5;
}

.sn-slope-calc__chart-point--p1 {
	fill: #dc2626;
}

.sn-slope-calc__chart-point--p2 {
	fill: #2b7ddb;
}

.sn-slope-calc__chart-label {
	font-size: 13px;
	font-weight: 600;
	font-family: var(--font-sans, Inter, system-ui, sans-serif);
}

.sn-slope-calc__chart-label--d {
	fill: #dc2626;
}

.sn-slope-calc__chart-label--dx {
	fill: #2b7ddb;
}

.sn-slope-calc__chart-label--dy {
	fill: #16a34a;
}

.sn-slope-calc__chart-label--theta {
	fill: #b45309;
	font-size: 14px;
}

.sn-slope-calc__chart-coord {
	font-size: 11px;
	fill: #475569;
	font-family: var(--font-sans, Inter, system-ui, sans-serif);
}

.sn-slope-calc__report {
	margin-top: 0.25rem;
}

.sn-slope-calc__report-inner {
	font-size: 0.875rem;
	line-height: 1.55;
	color: #334155;
}

.sn-slope-calc__report-mode {
	margin: 0 0 0.75rem;
	font-weight: 600;
	color: #475569;
}

.sn-slope-calc__report-subheading {
	margin: 1rem 0 0.5rem;
	font-family: var(--font-heading, Sora, sans-serif);
	font-size: 0.9375rem;
	font-weight: 600;
	color: #1e293b;
}

.sn-slope-calc__report-line {
	margin: 0 0 0.5rem;
}

.sn-slope-calc__report-frac {
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.sn-slope-calc__report-equation {
	margin: 0 0 0.375rem;
	padding: 0.5rem 0.75rem;
	border-radius: 6px;
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	font-size: 0.8125rem;
	word-break: break-word;
}

.sn-slope-calc__report-equation--inline {
	margin-top: 0.25rem;
	margin-bottom: 0.375rem;
}

.sn-slope-calc__report-line--equation-label {
	margin-top: 0.625rem;
	font-weight: 600;
	color: #1e293b;
}

.sn-slope-calc__report-or-divider {
	margin: 1rem 0;
	font-size: 0.9375rem;
	font-weight: 700;
	text-align: center;
	color: #1e293b;
	letter-spacing: 0.04em;
}

.sn-slope-calc__scenario {
	margin-bottom: 0.5rem;
	padding: 0.75rem 0.875rem;
	border-radius: 8px;
	background: #f8fafc;
	border: 1px solid #e2e8f0;
}

.sn-slope-calc__scenario-chart {
	margin-top: 0.625rem;
}

.sn-slope-calc__chart-svg--compact {
	max-height: 220px;
	border-radius: 8px;
}

.sn-slope-calc__report-or {
	margin: 0.25rem 0;
	font-size: 0.8125rem;
	font-weight: 600;
	color: #64748b;
}

.sn-slope-calc__report-intercepts {
	margin: 0.5rem 0 0.75rem;
	padding-left: 1.25rem;
}

.sn-slope-calc__report-intercepts li {
	margin-bottom: 0.25rem;
}

.sn-slope-calc__report-points {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem 1.25rem;
	margin: 0.75rem 0 0;
	padding-top: 0.75rem;
	border-top: 1px solid #e2e8f0;
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	font-size: 0.8125rem;
	color: #475569;
}

.sn-slope-diagram {
	margin: 1.25rem auto;
	max-width: 420px;
}

.sn-slope-diagram__svg {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 8px;
	box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}
