/* =========================================================
   Real Estate IRR Calculator
   Scoped under .reic-app so it survives any theme.
   Aesthetic: a quiet "deal terminal" — cool light workspace,
   slate ink, one teal accent reserved for the IRR, all figures
   set in tabular monospace so the numbers read like a real model.
   ========================================================= */

.reic-app {
	--ink: #16202b;
	--ink-soft: #5a6675;
	--ink-faint: #8b97a4;
	--ground: #eef2f6;
	--card: #ffffff;
	--line: #dce3ea;
	--line-soft: #e9eef3;
	--accent: #0e7c6b;
	--accent-deep: #0b6557;
	--accent-wash: #e4f1ee;
	--neg: #b4422e;

	--mono: ui-monospace, "SF Mono", "JetBrains Mono", "Roboto Mono", Menlo, Consolas, monospace;
	--sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

	box-sizing: border-box;
	font-family: var(--sans);
	color: var(--ink);
	background: var(--ground);
	padding: clamp(18px, 3vw, 34px);
	border-radius: 14px;
	line-height: 1.45;
	max-width: 1080px;
	margin: 0 auto;
	-webkit-font-smoothing: antialiased;
}

.reic-app *,
.reic-app *::before,
.reic-app *::after {
	box-sizing: border-box;
}

.reic-hidden {
	display: none !important;
}

/* ---------- masthead ---------- */

.reic-masthead {
	margin-bottom: clamp(18px, 2.4vw, 28px);
}

.reic-eyebrow {
	display: inline-block;
	font-family: var(--mono);
	font-size: 11px;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--accent-deep);
	margin-bottom: 8px;
}

.reic-title {
	font-size: clamp(22px, 3.4vw, 32px);
	font-weight: 700;
	letter-spacing: -0.02em;
	line-height: 1.05;
	margin: 0 0 6px;
	color: var(--ink);
}

.reic-lede {
	margin: 0;
	color: var(--ink-soft);
	font-size: 14px;
	max-width: 52ch;
}

/* ---------- layout ---------- */

.reic-grid {
	display: grid;
	grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
	gap: clamp(16px, 2vw, 26px);
	align-items: start;
}

/* ---------- deal sheet (inputs) ---------- */

.reic-sheet {
	display: flex;
	flex-direction: column;
	gap: 14px;
	margin: 0;
}

.reic-section {
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: 11px;
	padding: 16px 18px 18px;
	margin: 0;
}

.reic-section legend {
	display: flex;
	align-items: center;
	gap: 9px;
	float: none;
	width: 100%;
	padding: 0 0 12px;
	margin: 0;
	font-size: 14px;
	font-weight: 650;
	letter-spacing: -0.01em;
	color: var(--ink);
}

.reic-num {
	font-family: var(--mono);
	font-size: 11px;
	font-weight: 600;
	color: var(--accent-deep);
	background: var(--accent-wash);
	border-radius: 5px;
	padding: 3px 6px;
	letter-spacing: 0.04em;
}

.reic-field {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	padding: 7px 0;
	border-top: 1px solid var(--line-soft);
}

.reic-section legend + .reic-field {
	border-top: none;
	padding-top: 0;
}

.reic-field > span {
	font-size: 13.5px;
	color: var(--ink-soft);
	flex: 1 1 auto;
}

.reic-field > span em {
	font-style: normal;
	color: var(--ink-faint);
	font-size: 12px;
}

.reic-inputwrap {
	position: relative;
	flex: 0 0 132px;
	width: 132px;
}

.reic-inputwrap input {
	font-family: var(--mono);
	font-variant-numeric: tabular-nums;
	font-size: 14px;
	text-align: right;
	width: 100%;
	padding: 8px 10px;
	color: var(--ink);
	background: #fbfcfd;
	border: 1px solid var(--line);
	border-radius: 7px;
	transition: border-color 0.12s ease, box-shadow 0.12s ease;
	-moz-appearance: textfield;
	appearance: textfield;
}

.reic-inputwrap input::-webkit-outer-spin-button,
.reic-inputwrap input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.reic-inputwrap.has-pre input {
	padding-left: 24px;
}

.reic-inputwrap.has-post input {
	padding-right: 34px;
}

.reic-inputwrap input:focus {
	outline: none;
	border-color: var(--accent);
	box-shadow: 0 0 0 3px rgba(14, 124, 107, 0.16);
	background: #fff;
}

.reic-adorn {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	font-family: var(--mono);
	font-size: 12px;
	color: var(--ink-faint);
	pointer-events: none;
}

.reic-adorn-pre {
	left: 10px;
}

.reic-adorn-post {
	right: 10px;
}

.reic-select {
	font-family: var(--sans);
	font-size: 13.5px;
	flex: 0 0 132px;
	width: 132px;
	padding: 8px 10px;
	color: var(--ink);
	background: #fbfcfd;
	border: 1px solid var(--line);
	border-radius: 7px;
}

.reic-select:focus {
	outline: none;
	border-color: var(--accent);
	box-shadow: 0 0 0 3px rgba(14, 124, 107, 0.16);
}

/* ---------- results ---------- */

.reic-results {
	position: sticky;
	top: 18px;
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.reic-metrics {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
}

.reic-metric {
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: 11px;
	padding: 14px 16px;
	display: flex;
	flex-direction: column;
	gap: 3px;
}

.reic-metric.is-hero {
	grid-column: 1 / -1;
	background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
	border-color: var(--accent-deep);
	padding: 20px;
}

.reic-metric-label {
	font-family: var(--mono);
	font-size: 10.5px;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--ink-faint);
}

.reic-metric.is-hero .reic-metric-label {
	color: rgba(255, 255, 255, 0.78);
}

.reic-metric-value {
	font-family: var(--mono);
	font-variant-numeric: tabular-nums;
	font-size: 22px;
	font-weight: 600;
	letter-spacing: -0.01em;
	color: var(--ink);
}

.reic-metric.is-hero .reic-metric-value {
	font-size: clamp(34px, 6vw, 46px);
	color: #fff;
	line-height: 1;
	margin: 2px 0;
}

.reic-metric-sub {
	font-size: 11.5px;
	color: var(--ink-faint);
}

.reic-metric.is-hero .reic-metric-sub {
	color: rgba(255, 255, 255, 0.8);
}

/* ---------- panels ---------- */

.reic-panel {
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: 11px;
	padding: 16px 18px;
}

.reic-panel-title {
	font-size: 13px;
	font-weight: 650;
	letter-spacing: 0.01em;
	margin: 0 0 12px;
	color: var(--ink);
}

.reic-deflist {
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 7px;
}

.reic-deflist > div {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 12px;
}

.reic-deflist dt {
	font-size: 13px;
	color: var(--ink-soft);
	margin: 0;
}

.reic-deflist dd {
	margin: 0;
	font-family: var(--mono);
	font-variant-numeric: tabular-nums;
	font-size: 13.5px;
	color: var(--ink);
}

.reic-deflist dd em {
	font-style: normal;
	color: var(--ink-faint);
	font-size: 12px;
}

.reic-def-strong {
	border-top: 1px solid var(--line);
	padding-top: 8px;
	margin-top: 2px;
}

.reic-def-strong dt {
	font-weight: 650;
	color: var(--ink);
}

.reic-def-strong dd {
	font-weight: 700;
	color: var(--accent-deep);
}

/* ---------- chart ---------- */

.reic-chart {
	width: 100%;
	height: auto;
	display: block;
}

.reic-axis {
	stroke: var(--line);
	stroke-width: 1;
}

.reic-bar-pos {
	fill: var(--accent);
}

.reic-bar-neg {
	fill: var(--neg);
}

.reic-bar-lbl {
	fill: var(--ink-faint);
	font-family: var(--mono);
	font-size: 7px;
}

.reic-chart-note {
	margin: 8px 0 0;
	font-size: 11.5px;
	color: var(--ink-faint);
}

/* ---------- schedule table ---------- */

.reic-tablewrap {
	overflow-x: auto;
}

.reic-table {
	width: 100%;
	border-collapse: collapse;
	font-family: var(--mono);
	font-variant-numeric: tabular-nums;
	font-size: 12.5px;
}

.reic-table th {
	text-align: right;
	font-weight: 600;
	color: var(--ink-faint);
	text-transform: uppercase;
	font-size: 10px;
	letter-spacing: 0.06em;
	padding: 0 0 8px;
	border-bottom: 1px solid var(--line);
}

.reic-table th:first-child,
.reic-table td:first-child {
	text-align: left;
	color: var(--ink-soft);
}

.reic-table td {
	text-align: right;
	padding: 7px 0;
	border-bottom: 1px solid var(--line-soft);
	color: var(--ink);
}

.reic-table tr:last-child td {
	border-bottom: none;
}

.reic-table td.reic-neg {
	color: var(--neg);
}

/* ---------- footer ---------- */

.reic-disclaimer {
	margin: 18px 0 0;
	font-size: 11.5px;
	color: var(--ink-faint);
	text-align: center;
}

/* ---------- responsive ---------- */

@media (max-width: 880px) {
	.reic-grid {
		grid-template-columns: 1fr;
	}
	.reic-results {
		position: static;
	}
}

@media (max-width: 420px) {
	.reic-metrics {
		grid-template-columns: 1fr;
	}
	.reic-field {
		flex-wrap: wrap;
	}
	.reic-inputwrap,
	.reic-select {
		flex-basis: 120px;
		width: 120px;
	}
}

/* ---------- accessibility ---------- */

@media (prefers-reduced-motion: reduce) {
	.reic-inputwrap input {
		transition: none;
	}
}
