/**
 * Smart Mortgage Calculator — front-end styles.
 *
 * Everything is scoped under .happs-smc and resets inherited theme styles for
 * the web components it uses (inputs, selects, buttons, links, tables) so the
 * host theme cannot override the calculator's look.
 */

.happs-smc {
	--happs-smc-primary: #5b5bd6;
	--happs-smc-accent: #1e2a5a;
	--happs-smc-text: #1f2933;
	--happs-smc-bg: #ffffff;
	--happs-smc-btn-text: #ffffff;
	--happs-smc-radius: 16px;
	--happs-smc-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	--happs-smc-muted: #6b7280;
	--happs-smc-line: #e8eaf0;
	--happs-smc-soft: #f4f6fb;

	all: initial;
	display: block;
	box-sizing: border-box;
	font-family: var(--happs-smc-font);
	color: var(--happs-smc-text);
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
	width: 100%;
	max-width: 1080px;
	margin: 0 auto;
	overflow-wrap: break-word;
}
.happs-smc *, .happs-smc *::before, .happs-smc *::after { box-sizing: border-box; min-width: 0; max-width: 100%; }
.happs-smc h2, .happs-smc h3, .happs-smc p, .happs-smc table, .happs-smc td, .happs-smc th, .happs-smc label, .happs-smc ul, .happs-smc ol {
	margin: 0; padding: 0; font-family: inherit; color: inherit; background: none; border: 0;
}

/* ---- layout ----
 * Breakpoints are driven by CONTAINER width (not the viewport) so the calculator
 * adapts to the space it's actually placed in — full-width pages, narrow
 * sidebars, columns, etc. The container contexts live on .happs-smc-mount and
 * .happs-smc-results (NOT on .happs-smc itself, so the fixed lead-modal / toast
 * appended to the root still position against the viewport). */
.happs-smc-mount { container-type: inline-size; container-name: happsslc; }
.happs-smc-results { container-type: inline-size; container-name: happsslcr; }

.happs-smc-grid-main {
	display: grid;
	grid-template-columns: minmax(0, 1fr);   /* single column by default */
	gap: 22px;
	align-items: start;
}
@container happsslc (min-width: 760px) {
	.happs-smc-grid-main { grid-template-columns: minmax(0, 360px) minmax(0, 1fr); }
}
.happs-smc-card-ui {
	background: var(--happs-smc-bg);
	border: 1px solid var(--happs-smc-line);
	border-radius: var(--happs-smc-radius);
	padding: 22px;
	box-shadow: 0 6px 24px rgba(20, 28, 60, .06);
}
.happs-smc[data-layout="flat"] .happs-smc-card-ui { box-shadow: none; }

.happs-smc-panel-title {
	font-size: 16px; font-weight: 700; margin-bottom: 16px !important;
	display: inline-flex; align-items: center; gap: 8px;
}
.happs-smc-results { display: flex; flex-direction: column; gap: 16px; }
.happs-smc-results .happs-smc-card-ui { padding: 18px 20px; }

/* ---- input rows ---- */
.happs-smc-row { margin-bottom: 24px; }
.happs-smc-row.happs-smc-hidden { display: none; }
.happs-smc-row-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.happs-smc-row-label { font-size: 13.5px; font-weight: 600; color: var(--happs-smc-text); display: inline-flex; align-items: center; gap: 6px; }
.happs-smc-info {
	display: inline-flex; align-items: center; justify-content: center;
	width: 15px; height: 15px; border-radius: 50%; background: var(--happs-smc-soft);
	color: var(--happs-smc-muted); font-size: 10px; font-weight: 700; cursor: help;
}
.happs-smc-row-value { display: inline-flex; align-items: center; gap: 6px;
	border: 1px solid var(--happs-smc-line); border-radius: 10px; padding: 6px 10px; background: var(--happs-smc-bg); }
.happs-smc-unit { font-size: 12px; font-weight: 700; color: var(--happs-smc-muted); }
.happs-smc-val-input {
	border: 0 !important; outline: 0 !important; background: transparent !important;
	font: 600 15px/1.2 var(--happs-smc-font) !important; color: var(--happs-smc-text) !important;
	width: 92px; text-align: right; padding: 0 !important; box-shadow: none !important; margin: 0 !important;
}
.happs-smc-val-input-sm { width: 46px; }
.happs-smc-mini-select {
	border: 0 !important; background: transparent !important; font: 600 13px/1 var(--happs-smc-font) !important;
	color: var(--happs-smc-text) !important; cursor: pointer; padding: 0 2px !important; outline: 0 !important;
	-webkit-appearance: menulist; appearance: menulist;
}

/* ---- range slider ---- */
.happs-smc-slider {
	-webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 6px;
	background: var(--happs-smc-soft); outline: none; margin: 4px 0 8px; cursor: pointer; padding: 0;
}
.happs-smc-slider::-webkit-slider-thumb {
	-webkit-appearance: none; appearance: none; width: 18px; height: 18px; border-radius: 50%;
	background: var(--happs-smc-primary); border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.25); cursor: pointer;
}
.happs-smc-slider::-moz-range-thumb {
	width: 16px; height: 16px; border-radius: 50%; background: var(--happs-smc-primary);
	border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.25); cursor: pointer;
}
.happs-smc-slider:disabled { opacity: .55; cursor: not-allowed; }
.happs-smc-scale { display: flex; justify-content: space-between; font-size: 11px; color: var(--happs-smc-muted); }

.happs-smc-row.is-locked .happs-smc-row-value { background: var(--happs-smc-soft); opacity: .85; }

/* ---- select ---- */
.happs-smc-select {
	width: 100%; border: 1px solid var(--happs-smc-line); border-radius: 10px; padding: 11px 12px;
	font: 600 14px/1.2 var(--happs-smc-font); color: var(--happs-smc-text); background: var(--happs-smc-bg);
	cursor: pointer; outline: none; -webkit-appearance: menulist; appearance: menulist;
}
.happs-smc-select:focus { border-color: var(--happs-smc-primary); }

/* ---- buttons ---- */
.happs-smc-btn-calc {
	display: block; width: 100%; margin-top: 8px;
	background: var(--happs-smc-primary);
	background: linear-gradient(135deg, var(--happs-smc-primary), color-mix(in srgb, var(--happs-smc-primary) 70%, #8b5cf6));
	color: var(--happs-smc-btn-text); border: 0; border-radius: 12px; padding: 14px 18px;
	font: 700 15px/1 var(--happs-smc-font); cursor: pointer; transition: transform .08s ease, box-shadow .2s ease;
	box-shadow: 0 8px 20px color-mix(in srgb, var(--happs-smc-primary) 35%, transparent);
}
.happs-smc-btn-calc:hover { transform: translateY(-1px); }
.happs-smc-btn-calc:active { transform: translateY(0); }

.happs-smc-fineprint { margin-top: 16px !important; font-size: 11px; color: var(--happs-smc-muted); line-height: 1.5; }

/* ---- hero / monthly payment ----
 * Centered + stacked by default (narrow); switches to a row when the results
 * container is wide enough (see container query below). */
.happs-smc-hero {
	background: var(--happs-smc-accent);
	background: linear-gradient(135deg, var(--happs-smc-accent), color-mix(in srgb, var(--happs-smc-accent) 75%, #3b4ea0));
	color: #fff; border-radius: var(--happs-smc-radius); padding: 26px;
	display: flex; align-items: center; justify-content: center; text-align: center; gap: 20px; flex-wrap: wrap;
}
@container happsslcr (min-width: 440px) {
	.happs-smc-hero { justify-content: space-between; text-align: left; }
}
.happs-smc-hero-main { min-width: 0; }
.happs-smc-hero-label { font-size: 13px; opacity: .8; margin-bottom: 6px; }
.happs-smc-hero-amount { font-size: 46px; font-weight: 800; letter-spacing: -1.5px; line-height: 1.02; }
.happs-smc-hero-sub { font-size: 12px; opacity: .7; margin-top: 6px; }
.happs-smc-hero-donut { text-align: center; min-width: 190px; position: relative; }
.happs-smc-gauge-chart { width: 210px; height: 124px; margin: 0 auto; }
.happs-smc-donut-label { text-align: center; margin-top: -44px; color: #fff; }
.happs-smc-donut-cap { font-size: 12px; opacity: .8; }
.happs-smc-donut-amt { font-size: 19px; font-weight: 800; margin-top: 1px; }

/* ---- summary ----
 * Single column by default; two columns only when the results container is wide
 * enough to avoid the overlap seen in sidebar layouts. */
.happs-smc-summary-body { display: grid; grid-template-columns: 1fr; gap: 0 30px; }
@container happsslcr (min-width: 470px) {
	.happs-smc-summary-body { grid-template-columns: 1fr 1fr; }
}
.happs-smc-kv { width: 100%; border-collapse: collapse; }
.happs-smc-kv td { padding: 9px 2px; border-bottom: 1px solid var(--happs-smc-line); font-size: 13px; }
.happs-smc-kv tr:last-child td { border-bottom: 0; }
.happs-smc-kv td:first-child { color: var(--happs-smc-muted); white-space: nowrap; }
.happs-smc-kv td:last-child { text-align: right; font-weight: 700; padding-left: 10px; }
.happs-smc-kv td.is-accent { color: var(--happs-smc-primary); }

/* ---- amortization ---- */
.happs-smc-amort-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.happs-smc-amort-head .happs-smc-panel-title { margin-bottom: 0 !important; }
.happs-smc-seg { display: inline-flex; background: var(--happs-smc-soft); border-radius: 999px; padding: 3px; flex: none; }
.happs-smc-seg-btn {
	border: 0; background: transparent; cursor: pointer; padding: 6px 14px; border-radius: 999px;
	font: 600 12.5px/1 var(--happs-smc-font); color: var(--happs-smc-muted); transition: background .15s ease, color .15s ease;
}
.happs-smc-seg-btn.is-on { background: var(--happs-smc-bg); color: var(--happs-smc-primary); box-shadow: 0 1px 3px rgba(20,28,60,.12); }
.happs-smc-line-chart { width: 100%; height: 210px; margin-bottom: 12px; }
.happs-smc-scroll { max-height: 280px; overflow: auto; border-radius: 10px; border: 1px solid var(--happs-smc-line); -webkit-overflow-scrolling: touch; }
.happs-smc-amort-tb { max-width: none; min-width: 100%; }
.happs-smc-amort-tb { width: 100%; border-collapse: collapse; font-size: 12.5px; text-align: right; }
.happs-smc-amort-tb th {
	position: sticky; top: 0; background: var(--happs-smc-accent); color: #fff; padding: 10px 8px;
	font-weight: 600; text-align: right; white-space: nowrap;
}
.happs-smc-amort-tb th:first-child, .happs-smc-amort-tb td:first-child { text-align: center; }
.happs-smc-amort-tb td { padding: 9px 8px; border-bottom: 1px solid var(--happs-smc-line); white-space: nowrap; }
.happs-smc-amort-tb tbody tr:nth-child(even) { background: var(--happs-smc-soft); }

/* ---- actions ---- */
.happs-smc-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.happs-smc-btn-action {
	flex: 1 1 auto; min-width: 120px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	background: var(--happs-smc-bg); color: var(--happs-smc-text);
	border: 1px solid var(--happs-smc-line); border-radius: 10px; padding: 11px 14px;
	font: 600 13.5px/1 var(--happs-smc-font); cursor: pointer; transition: border-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.happs-smc-btn-action:hover { border-color: var(--happs-smc-primary); color: var(--happs-smc-primary); box-shadow: 0 4px 12px rgba(20,28,60,.08); }
.happs-smc-btn-action:disabled { cursor: default; opacity: .75; }
.happs-smc-ic { width: 17px; height: 17px; flex: none; }

/* ---- spinner ---- */
.happs-smc-spin {
	display: inline-block; width: 15px; height: 15px; border: 2px solid currentColor;
	border-top-color: transparent; border-radius: 50%; vertical-align: middle;
	animation: happs-smc-rot .6s linear infinite;
}
.happs-smc-btn-calc.is-loading, .happs-smc-btn-action.is-loading { pointer-events: none; }
@keyframes happs-smc-rot { to { transform: rotate(360deg); } }

/* ---- lead modal ---- */
.happs-smc-overlay {
	position: fixed; inset: 0; background: rgba(17, 24, 39, .55); z-index: 99999;
	display: flex; align-items: center; justify-content: center; padding: 18px;
}
.happs-smc-modal {
	background: #fff; color: var(--happs-smc-text); border-radius: 16px; width: 100%; max-width: 420px;
	padding: 26px; box-shadow: 0 24px 60px rgba(0,0,0,.35);
}
.happs-smc-modal-title { font-size: 19px; font-weight: 800; margin-bottom: 6px !important; }
.happs-smc-modal-intro { color: var(--happs-smc-muted); font-size: 13.5px; margin-bottom: 16px !important; }
.happs-smc-lead-form { display: flex; flex-direction: column; gap: 12px; }
.happs-smc-lead-field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; }
.happs-smc-lead-field input {
	border: 1px solid var(--happs-smc-line); border-radius: 10px; padding: 11px 12px;
	font: 400 14px/1.2 var(--happs-smc-font); color: var(--happs-smc-text); background: #fff; outline: none;
}
.happs-smc-lead-field input:focus { border-color: var(--happs-smc-primary); }
.happs-smc-lead-msg { color: #dc2626; font-size: 12.5px; min-height: 16px; margin: 0 !important; font-weight: 600; }
.happs-smc-link-skip {
	background: none; border: 0; color: var(--happs-smc-muted); font: 600 13px var(--happs-smc-font);
	cursor: pointer; text-decoration: underline; padding: 4px;
}

/* ---- toast ---- */
.happs-smc-toast {
	position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px);
	background: #111827; color: #fff; padding: 11px 18px; border-radius: 10px; font-size: 13px; font-weight: 600;
	z-index: 100000; opacity: 0; transition: opacity .25s ease, transform .25s ease; box-shadow: 0 12px 30px rgba(0,0,0,.3);
}
.happs-smc-toast.is-in { opacity: 1; transform: translate(-50%, 0); }

/* ---- branding + tamper ---- */
.happs-smc-branding { text-align: center; font-size: 12px; color: var(--happs-smc-muted); margin-top: 16px !important; }
.happs-smc-branding a { color: var(--happs-smc-primary); text-decoration: none; }
.happs-smc-tamper {
	padding: 40px 24px; text-align: center; color: #b91c1c; font-weight: 700; font-size: 15px;
	background: #fef2f2; border: 1px solid #fecaca; border-radius: var(--happs-smc-radius);
}

/* ---- loading ---- */
.happs-smc.is-loading .happs-smc-hero-amount { opacity: .45; }

/* ---- responsive ---- */
.happs-smc-hero-donut { min-width: 0; }
.happs-smc-amort-head { flex-wrap: wrap; }

/* Compact cosmetics when the calculator itself is narrow (container-based). */
@container happsslc (max-width: 480px) {
	.happs-smc-card-ui { padding: 16px; }
	.happs-smc-hero { padding: 20px; }
	.happs-smc-hero-amount { font-size: 34px; }
	.happs-smc-gauge-chart { width: 190px; }
}
.happs-smc-actions .happs-smc-btn-action { min-width: 120px; }
@container happsslcr (max-width: 360px) {
	.happs-smc-actions .happs-smc-btn-action { min-width: calc(50% - 5px); }
}

/* Fallback for browsers without container-query support: use the viewport. */
@supports not (container-type: inline-size) {
	@media (min-width: 900px) {
		.happs-smc-grid-main { grid-template-columns: minmax(0, 360px) minmax(0, 1fr); }
		.happs-smc-summary-body { grid-template-columns: 1fr 1fr; }
		.happs-smc-hero { justify-content: space-between; text-align: left; }
	}
	@media (max-width: 460px) {
		.happs-smc-card-ui { padding: 16px; }
		.happs-smc-hero-amount { font-size: 34px; }
		.happs-smc-gauge-chart { width: 190px; }
	}
}

/* =====================================================================
 * THEME ISOLATION
 * Aggressive themes (Astra, etc.) style `.entry-content input/select/button`
 * (specificity 0,1,1), which overrides our single-class rules. Every rule
 * below is prefixed with the `.happs-smc` root (0,2,x) and forces the key
 * properties so the calculator keeps its own look inside any theme.
 * ===================================================================== */
.happs-smc input,
.happs-smc select,
.happs-smc textarea,
.happs-smc button {
	font-family: var(--happs-smc-font) !important;
	letter-spacing: normal !important;
	text-transform: none !important;
	line-height: normal !important;
	margin: 0 !important;
	min-height: 0 !important;
	height: auto !important;
	box-shadow: none !important;
	text-shadow: none !important;
	outline: none;
	background-image: none;
}

/* Value inputs (amount / rate / term number) */
.happs-smc .happs-smc-val-input {
	width: 92px !important;
	max-width: 92px !important;
	min-width: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	background: transparent !important;
	padding: 0 !important;
	font-size: 15px !important;
	font-weight: 600 !important;
	text-align: right !important;
	color: var(--happs-smc-text) !important;
}
.happs-smc .happs-smc-val-input-sm { width: 46px !important; max-width: 46px !important; }
.happs-smc .happs-smc-unit { white-space: nowrap !important; }
.happs-smc .happs-smc-row-label { flex: 1 1 auto; min-width: 0; }
.happs-smc .happs-smc-row-value { flex: 0 0 auto; }

/* Selects — appearance reset + our own caret so theme arrows can't double up */
.happs-smc .happs-smc-select,
.happs-smc .happs-smc-mini-select {
	-webkit-appearance: none !important;
	-moz-appearance: none !important;
	appearance: none !important;
	color: var(--happs-smc-text) !important;
	font-weight: 600 !important;
	cursor: pointer;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") !important;
	background-repeat: no-repeat !important;
}
.happs-smc .happs-smc-select {
	width: 100% !important;
	max-width: 100% !important;
	border: 1px solid var(--happs-smc-line) !important;
	border-radius: 10px !important;
	padding: 11px 36px 11px 12px !important;
	background-color: var(--happs-smc-bg) !important;
	background-position: right 12px center !important;
	background-size: 15px 15px !important;
	font-size: 14px !important;
}
.happs-smc .happs-smc-mini-select {
	width: auto !important;
	border: 0 !important;
	background-color: transparent !important;
	padding: 0 18px 0 2px !important;
	background-position: right 2px center !important;
	background-size: 13px 13px !important;
	font-size: 13px !important;
}

/* Range slider — keep our flat track + round thumb (JS paints the fill inline) */
.happs-smc input[type="range"].happs-smc-slider {
	-webkit-appearance: none !important;
	appearance: none !important;
	width: 100% !important;
	max-width: 100% !important;
	height: 6px !important;
	border: 0 !important;
	border-radius: 6px !important;
	padding: 0 !important;
	margin: 4px 0 8px !important;
	background: var(--happs-smc-soft);
	accent-color: var(--happs-smc-primary);
}
.happs-smc input[type="range"].happs-smc-slider::-webkit-slider-runnable-track {
	background: transparent !important; height: 6px; border: 0;
}
.happs-smc input[type="range"].happs-smc-slider::-webkit-slider-thumb {
	-webkit-appearance: none !important; appearance: none !important;
	width: 18px !important; height: 18px !important; margin-top: -6px;
	border-radius: 50% !important; background: var(--happs-smc-primary) !important;
	border: 3px solid #fff !important; box-shadow: 0 1px 4px rgba(0,0,0,.25) !important; cursor: pointer;
}
.happs-smc input[type="range"].happs-smc-slider::-moz-range-track { background: transparent !important; height: 6px; border: 0; }
.happs-smc input[type="range"].happs-smc-slider::-moz-range-thumb {
	width: 16px !important; height: 16px !important; border-radius: 50% !important;
	background: var(--happs-smc-primary) !important; border: 3px solid #fff !important;
	box-shadow: 0 1px 4px rgba(0,0,0,.25) !important; cursor: pointer;
}

/* Buttons — re-assert our gradients / borders / hover so theme can't restyle */
.happs-smc .happs-smc-btn-calc {
	width: 100% !important;
	border: 0 !important;
	border-radius: 12px !important;
	padding: 14px 18px !important;
	font-size: 15px !important;
	font-weight: 700 !important;
	text-transform: none !important;
	color: var(--happs-smc-btn-text) !important;
	cursor: pointer;
	background: var(--happs-smc-primary) !important;
	background: linear-gradient(135deg, var(--happs-smc-primary), color-mix(in srgb, var(--happs-smc-primary) 70%, #8b5cf6)) !important;
}
.happs-smc .happs-smc-btn-calc:hover { color: var(--happs-smc-btn-text) !important; transform: translateY(-1px); }
.happs-smc .happs-smc-btn-action {
	border: 1px solid var(--happs-smc-line) !important;
	border-radius: 10px !important;
	padding: 11px 14px !important;
	font-size: 13.5px !important;
	font-weight: 600 !important;
	text-transform: none !important;
	background: var(--happs-smc-bg) !important;
	color: var(--happs-smc-text) !important;
	cursor: pointer;
}
.happs-smc .happs-smc-btn-action:hover {
	background: var(--happs-smc-bg) !important;
	color: var(--happs-smc-primary) !important;
	border-color: var(--happs-smc-primary) !important;
}
.happs-smc .happs-smc-seg-btn { border: 0 !important; cursor: pointer; }
.happs-smc .happs-smc-seg-btn.is-on { background: var(--happs-smc-bg) !important; color: var(--happs-smc-primary) !important; }

/* Lead-form fields + skip link */
.happs-smc .happs-smc-lead-field input {
	width: 100% !important;
	border: 1px solid var(--happs-smc-line) !important;
	border-radius: 10px !important;
	padding: 11px 12px !important;
	font-size: 14px !important;
	font-weight: 400 !important;
	background: #fff !important;
	color: var(--happs-smc-text) !important;
}
.happs-smc .happs-smc-link-skip { border: 0 !important; background: none !important; cursor: pointer; }

/* Tables — themes love to restyle td/th/tr (padding, borders, striping). Force ours. */
.happs-smc .happs-smc-kv,
.happs-smc .happs-smc-amort-tb {
	width: 100% !important; border-collapse: collapse !important; background: transparent !important; margin: 0 !important;
}
.happs-smc .happs-smc-kv td {
	padding: 9px 2px !important; border: 0 !important; border-bottom: 1px solid var(--happs-smc-line) !important;
	background: transparent !important; font-size: 13px !important; vertical-align: middle; color: var(--happs-smc-text);
}
.happs-smc .happs-smc-kv td:first-child { color: var(--happs-smc-muted) !important; text-align: left !important; font-weight: 400 !important; }
.happs-smc .happs-smc-kv td:last-child { text-align: right !important; font-weight: 700 !important; }
.happs-smc .happs-smc-kv td.is-accent { color: var(--happs-smc-primary) !important; }
.happs-smc .happs-smc-amort-tb th {
	background: var(--happs-smc-accent) !important; color: #fff !important; padding: 10px 8px !important;
	border: 0 !important; text-align: right !important; font-weight: 600 !important; white-space: nowrap;
}
.happs-smc .happs-smc-amort-tb td {
	padding: 9px 8px !important; border: 0 !important; border-bottom: 1px solid var(--happs-smc-line) !important;
	text-align: right !important; background: transparent !important; color: var(--happs-smc-text) !important; white-space: nowrap;
}
.happs-smc .happs-smc-amort-tb th:first-child,
.happs-smc .happs-smc-amort-tb td:first-child { text-align: center !important; }
.happs-smc .happs-smc-amort-tb tbody tr { background: transparent !important; }
.happs-smc .happs-smc-amort-tb tbody tr:nth-child(even) td { background: var(--happs-smc-soft) !important; }

/* Links inside the widget shouldn't inherit theme underlines/colours */
.happs-smc .happs-smc-branding a { text-decoration: none !important; color: var(--happs-smc-primary) !important; }

/* =====================================================================
 * MORTGAGE RESULTS (headline outputs, stacked chart, summary strip,
 * expandable amortization). Uses the same palette / card language as the
 * reference design; only the result layout follows the product mockup.
 * ===================================================================== */

/* ---- headline outputs (Down payment / Monthly / Fees / Total) ---- */
.happs-smc-out-list {
	background: var(--happs-smc-bg);
	border: 1px solid var(--happs-smc-line);
	border-radius: var(--happs-smc-radius);
	padding: 20px 22px;
	box-shadow: 0 6px 24px rgba(20, 28, 60, .06);
	display: flex; flex-direction: column; gap: 4px;
}
.happs-smc[data-layout="flat"] .happs-smc-out-list { box-shadow: none; }
.happs-smc-out-row { padding: 12px 0; border-bottom: 1px solid var(--happs-smc-line); }
.happs-smc-out-row:last-child { border-bottom: 0; }
.happs-smc-out-label { font-size: 13px; color: var(--happs-smc-muted); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.happs-smc-out-amount { font-size: 24px; font-weight: 800; letter-spacing: -.5px; margin-top: 3px; color: var(--happs-smc-text); }
.happs-smc-out-row.is-hero {
	background: var(--happs-smc-accent);
	background: linear-gradient(135deg, var(--happs-smc-accent), color-mix(in srgb, var(--happs-smc-accent) 75%, #3b4ea0));
	color: #fff; border-radius: 12px; padding: 16px 18px; margin: 6px 0; border-bottom: 0;
}
.happs-smc-out-row.is-hero .happs-smc-out-label { color: rgba(255,255,255,.82); }
.happs-smc-out-row.is-hero .happs-smc-out-amount { color: #fff; font-size: 34px; }
.happs-smc-out-row.is-hero .happs-smc-info { background: rgba(255,255,255,.22); color: #fff; }

/* ---- stacked amortization column chart ---- */
.happs-smc-chart-card { padding: 16px 14px !important; }
.happs-smc-col-chart { width: 100%; height: 300px; }

/* ---- "hide / show schedule" toggle ---- */
.happs-smc-sched-toggle-wrap { text-align: center; }
.happs-smc-btn-sched {
	display: inline-flex; align-items: center; gap: 8px;
	background: var(--happs-smc-primary);
	background: linear-gradient(135deg, var(--happs-smc-primary), color-mix(in srgb, var(--happs-smc-primary) 70%, #8b5cf6));
	color: var(--happs-smc-btn-text); border: 0; border-radius: 10px; padding: 11px 20px;
	font: 700 13.5px/1 var(--happs-smc-font); cursor: pointer;
}
.happs-smc-chev { transition: transform .2s ease; display: inline-block; }
.happs-smc-btn-sched.is-collapsed .happs-smc-chev { transform: rotate(90deg); }

/* ---- summary strip (Loan amount / Total interest / Total cost / Payoff) ---- */
.happs-smc-strip {
	display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px;
	background: var(--happs-smc-line); border: 1px solid var(--happs-smc-line);
	border-radius: 12px; overflow: hidden; margin-bottom: 16px;
}
@container happsslcr (min-width: 560px) {
	.happs-smc-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.happs-smc-strip-cell { background: var(--happs-smc-soft); padding: 12px 14px; display: flex; flex-direction: column; gap: 3px; }
.happs-smc-strip-lbl { font-size: 11.5px; color: var(--happs-smc-muted); font-weight: 600; }
.happs-smc-strip-val { font-size: 15px; font-weight: 800; color: var(--happs-smc-text); }

/* ---- amortization rows ---- */
.happs-smc-amort-tb tr.is-year td { font-weight: inherit; }
.happs-smc-amort-tb tr.is-month td { color: var(--happs-smc-muted); }
.happs-smc-amort-tb tr.happs-smc-hidden { display: none; }
.happs-smc-yr-toggle {
	border: 0; background: transparent; cursor: pointer; font: 700 12.5px/1 var(--happs-smc-font);
	color: var(--happs-smc-primary); display: inline-flex; align-items: center; gap: 6px; padding: 0;
}
.happs-smc-pm {
	display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px;
	border-radius: 4px; background: var(--happs-smc-primary); color: #fff; font-size: 13px; line-height: 1; flex: none;
}

/* Theme-isolation for the new tables / buttons */
.happs-smc .happs-smc-strip-cell { background: var(--happs-smc-soft) !important; }
.happs-smc .happs-smc-yr-toggle { border: 0 !important; background: transparent !important; color: var(--happs-smc-primary) !important; cursor: pointer; }
.happs-smc .happs-smc-btn-sched { border: 0 !important; color: var(--happs-smc-btn-text) !important; cursor: pointer; }
.happs-smc .happs-smc-amort-tb tr.is-year td:first-child,
.happs-smc .happs-smc-amort-tb tr.is-month td:first-child { text-align: left !important; }
.happs-smc.is-loading .happs-smc-out-amount { opacity: .45; }

/* ---- styled hover/focus tooltip (appended to <body>, so unscoped) ---- */
.happs-smc-tip {
	position: absolute; z-index: 100001; max-width: 240px;
	background: #111827; color: #fff;
	font: 500 12px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	padding: 8px 11px; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.28);
	transform: translate(-50%, -100%); pointer-events: none; text-align: center;
}
.happs-smc-tip.is-below { transform: translate(-50%, 0); }
.happs-smc-tip::after {
	content: ""; position: absolute; left: 50%; top: 100%; transform: translateX(-50%);
	border: 5px solid transparent; border-top-color: #111827;
}
.happs-smc-tip.is-below::after { top: auto; bottom: 100%; border-top-color: transparent; border-bottom-color: #111827; }
.happs-smc .happs-smc-info { cursor: help; }
.happs-smc .happs-smc-info:focus { outline: 2px solid var(--happs-smc-primary); outline-offset: 1px; }

/* ---- mobile: keep the calculator off the screen edges ---- */
@media (max-width: 640px) {
	.happs-smc { padding-left: 14px; padding-right: 14px; }
}
