.ha-body-container {
	background: #d8e6f4;
	/* color: white; */
	min-height: 100vh;
	padding: 1rem;
	line-height: 1.5;
	padding-top: 36px;
	padding-bottom: 36px;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

input[type="number"] {
	-moz-appearance: textfield;
}

.calculator-container {
	max-width: 1170px;
	margin: 0 auto;
}

/* Header */
.calculator-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 1rem;
	margin-bottom: 1.5rem;
}

.header-brand {
	display: flex;
	align-items: center;
	gap: 0.75rem;
}

.brand-icon {
	padding: .625rem;
	border-radius: .75rem;
	background: #3c82f6;
	box-shadow: 0 10px 15px -3px rgba(16, 185, 129, .25);
	display: flex;
	align-items: center;
	justify-content: center;
}

.brand-icon svg {
	width: 30px;
	height: 30px;
	stroke: white;
}

.brand-text h1 {
	font-size: clamp(1rem, 4vw, 2rem);
	font-weight: 700;
}

.brand-text h1 .highlight {
	background: #3c82f6;
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
}

.brand-text p {
	font-size: 0.75rem;
	color: #94a3b8;
}

.header-actions {
	display: flex;
	gap: 0.5rem;
}

.glossary-btn {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.5rem 0.75rem;
	border-radius: 0.75rem;
	border: 1px solid #334155;
	font-size: 0.875rem;
	cursor: pointer;
	transition: all 0.2s;
	padding-left: 20px;
	padding-right: 20px;
}

.glossary-btn .ha-blk-wht-frst,
.glossary-btn .ha-blk-wht-scnd {
	display: flex;
	align-items: center;
	gap: 8px;
}

.glossary-btn svg {
	width: 16px;
	height: 16px;
}

/* Main Grid */
.calculator-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 1.5rem;
}

@media (min-width: 1024px) {
	.calculator-grid {
		grid-template-columns: 1fr 1fr;
	}
}

/* Section Cards */
.section {
	border-radius: 1.25rem;
	border: 1px solid;
	overflow: hidden;
	backdrop-filter: blur(8px);
}

.section.blue {
	background: #fff;
	border-color: rgba(59, 130, 246, 0.25);
	margin-bottom: 1rem;
}

.section.slate {
	background: #fff;
	border-color: rgba(71, 85, 105, 0.5);
}

.section-header {
	width: 100%;
	padding: 1rem 1.25rem;
	display: flex;
	align-items: center;
	justify-content: space-between;
	background: transparent;
	border: none;
	cursor: pointer;
	transition: background 0.2s;
}

.section-header:hover {
	background: rgba(255, 255, 255, 0.03);
}

.section-header-left {
	display: flex;
	align-items: center;
	gap: 0.75rem;
}

.section-icon {
	padding: 0.5rem;
	border-radius: 0.5rem;
	display: flex;
	align-items: center;
	justify-content: center;
}

.section-icon svg {
	width: 18px;
	height: 18px;
}

.section.blue .section-icon {
	background: rgba(59, 130, 246, 0.2);
	color: #60a5fa;
}

.section.slate .section-icon {
	background: rgba(148, 163, 184, 0.2);
	color: #94a3b8;
}

.section-icon svg {
	stroke: currentColor;
}

.section-title {
	font-weight: 600;
	/* color: white; */
}

.section-chevron {
	color: #94a3b8;
	transition: transform 0.3s;
}

.section-chevron svg {
	width: 20px;
	height: 20px;
	stroke: currentColor;
}

.section.collapsed .section-chevron {
	transform: rotate(-90deg);
}

.section-content {
	padding: 0 1.25rem 1.25rem;
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.section.collapsed .section-content {
	display: none;
}

/* Input Fields */
.input-group {
	display: flex;
	flex-direction: column;
	gap: 0.375rem;
}

.input-label {
	display: flex;
	align-items: center;
	gap: 0.375rem;
	font-size: 0.875rem;
	font-weight: 500;
	/* color: #cbd5e1; */
}

.tooltip-trigger {
	color: #94a3b8;
	cursor: help;
	position: relative;
	display: inline-flex;
}

.tooltip-trigger:hover {
	color: #60a5fa;
}

.tooltip-trigger svg {
	width: 14px;
	height: 14px;
	stroke: currentColor;
}

.tooltip-content {
	position: absolute;
	bottom: 100%;
	left: 50%;
	transform: translateX(-50%);
	margin-bottom: 0.5rem;
	padding: 0.75rem;
	background: #1e293b;
	border: 1px solid #334155;
	border-radius: 0.5rem;
	font-size: 0.75rem;
	font-weight: 400;
	color: white;
	width: 280px;
	line-height: 1.5;
	box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
	z-index: 100;
	display: none;
}

.tooltip-trigger:hover .tooltip-content {
	display: block;
}

.tooltip-content::after {
	content: '';
	position: absolute;
	top: 100%;
	left: 50%;
	transform: translateX(-50%);
	border: 6px solid transparent;
	border-top-color: #1e293b;
}

.input-wrapper {
	position: relative;
}

.input-prefix,
.input-suffix {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	color: #94a3b8;
	font-size: 0.875rem;
	pointer-events: none;
}

.input-prefix {
	left: 0.75rem;
}

.input-suffix {
	right: 0.75rem;
}

.input-field {
	width: 100%;
	padding: 0.75rem 1rem;
	/* background: rgba(30, 41, 59, 0.5); */
	border: 1px solid rgba(71, 85, 105, 0.5);
	border-radius: 0.75rem;
	/* color: white; */
	font-size: 1rem;
	transition: all 0.2s;
}

.input-field:focus {
	outline: none;
	border-color: #3b82f6;
	box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.input-field.has-prefix {
	padding-left: 2rem;
}

.input-field.has-suffix {
	padding-right: 3rem;
}

.input-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.75rem;
}

/* Slider Input */
.slider-group {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.slider-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.slider-value {
	font-size: 0.875rem;
	font-weight: 600;
	color: #60a5fa;
}

.slider-input {
	width: 100%;
	height: 8px;
	background: #334155;
	border-radius: 9999px;
	appearance: none;
	cursor: pointer;
}

.slider-input::-webkit-slider-thumb {
	appearance: none;
	width: 20px;
	height: 20px;
	background: #3b82f6;
	border-radius: 50%;
	cursor: pointer;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.slider-input::-moz-range-thumb {
	width: 20px;
	height: 20px;
	background: #3b82f6;
	border-radius: 50%;
	cursor: pointer;
	border: none;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.slider-range {
	display: flex;
	justify-content: space-between;
	font-size: 0.75rem;
	color: #64748b;
}

/* Toggle Switch */
.toggle-group {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0.75rem;
	/* background: rgba(30, 41, 59, 0.5); */
	border: 1px solid rgba(71, 85, 105, 0.5);
	border-radius: 0.75rem;
}

.toggle-label {
	display: flex;
	align-items: center;
	gap: 0.375rem;
	font-size: 0.875rem;
	font-weight: 500;
	color: #7d848d;
}

.toggle-switch {
	position: relative;
	width: 48px;
	height: 26px;
	background: #334155;
	border-radius: 9999px;
	cursor: pointer;
	transition: background 0.3s;
}

.toggle-switch.active {
	background: #3b82f6;
}

.toggle-switch::after {
	content: '';
	position: absolute;
	top: 3px;
	left: 3px;
	width: 20px;
	height: 20px;
	background: white;
	border-radius: 50%;
	transition: transform 0.3s;
}

.toggle-switch.active::after {
	transform: translateX(22px);
}

/* Select Dropdown */
.select-field {
	width: 100%;
	padding: 0.75rem 1rem;
	/* background: rgba(30, 41, 59, 0.5); */
	border: 1px solid rgba(71, 85, 105, 0.5);
	border-radius: 0.75rem;
	/* color: white; */
	font-size: 1rem;
	cursor: pointer;
	transition: all 0.2s;
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 0.75rem center;
	padding-right: 2.5rem;
}

.select-field:focus {
	outline: none;
	border-color: #3b82f6;
	box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.select-field option {
	background: #1e293b;
	color: white;
}

/* Summary Box */
.summary-box {
	/* background: rgba(30, 41, 59, 0.5); */
	border: 1px solid rgba(71, 85, 105, 0.5);
	border-radius: 0.75rem;
	padding: 0.75rem;
}

.summary-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: 0.875rem;
}

.summary-row+.summary-row {
	margin-top: 0.5rem;
}

.summary-label {
	color: #94a3b8;
}

.summary-value {
	/* color: white; */
	font-weight: 500;
}

.summary-value.blue {
	color: #60a5fa;
	font-weight: 600;
}

/* DSCR Result Hero */
.dscr-hero {
	border-radius: 1.5rem;
	padding: 1.5rem;
	text-align: center;
	position: relative;
	overflow: hidden;
	margin-bottom: 1rem;
}

.dscr-hero.excellent {
	background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(5, 150, 105, 0.1) 100%);
	border: 2px solid rgba(16, 185, 129, 0.4);
}

.dscr-hero.good {
	background: #fff;
	border: 2px solid rgba(59, 130, 246, 0.4);
}

.dscr-hero.fair {
	background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(217, 119, 6, 0.1) 100%);
	border: 2px solid rgba(245, 158, 11, 0.4);
}

.dscr-hero.poor {
	background: linear-gradient(135deg, rgba(244, 63, 94, 0.15) 0%, rgba(225, 29, 72, 0.1) 100%);
	border: 2px solid rgba(244, 63, 94, 0.4);
}

.dscr-badge {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.375rem 0.75rem;
	border-radius: 9999px;
	font-size: 0.75rem;
	font-weight: 600;
	margin-bottom: 0.75rem;
}

.dscr-hero.excellent .dscr-badge {
	background: rgba(16, 185, 129, 0.2);
	color: #34d399;
}

.dscr-hero.good .dscr-badge {
	background: rgba(59, 130, 246, 0.2);
	color: #60a5fa;
}

.dscr-hero.fair .dscr-badge {
	background: rgba(245, 158, 11, 0.2);
	color: #fbbf24;
}

.dscr-hero.poor .dscr-badge {
	background: rgba(244, 63, 94, 0.2);
	color: #fb7185;
}

.dscr-label {
	font-size: 0.875rem;
	color: #94a3b8;
	margin-bottom: 0.25rem;
}

.dscr-value {
	font-size: 4rem;
	font-weight: 800;
	line-height: 1;
	margin-bottom: 0.5rem;
}

.dscr-hero.excellent .dscr-value {
	color: #34d399;
}

.dscr-hero.good .dscr-value {
	color: #60a5fa;
}

.dscr-hero.fair .dscr-value {
	color: #fbbf24;
}

.dscr-hero.poor .dscr-value {
	color: #fb7185;
}

.dscr-formula {
	font-size: 0.875rem;
	color: #90b9ea;
}

.dscr-formula span {
	font-weight: 600;
}

/* DSCR Scale */
.dscr-scale {
	margin-top: 1.5rem;
	padding-top: 1.5rem;
	border-top: 1px solid rgba(71, 85, 105, 0.5);
}

.scale-bar {
	height: 12px;
	background: linear-gradient(90deg,
			#f43f5e 0%,
			#f43f5e 25%,
			#f59e0b 25%,
			#f59e0b 50%,
			#3b82f6 50%,
			#3b82f6 75%,
			#10b981 75%,
			#10b981 100%);
	border-radius: 9999px;
	position: relative;
	margin-bottom: 0.5rem;
}

.scale-marker {
	position: absolute;
	top: -4px;
	width: 20px;
	height: 20px;
	background: white;
	border: 3px solid #0f172a;
	border-radius: 50%;
	transform: translateX(-50%);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
	transition: left 0.3s ease;
}

.scale-labels {
	display: flex;
	justify-content: space-between;
	font-size: 0.625rem;
	color: #94a3b8;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

/* PITIA Breakdown */
.pitia-breakdown {
	margin-top: 1rem;
}

.pitia-title {
	font-size: 0.75rem;
	font-weight: 600;
	color: #94a3b8;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	margin-bottom: 0.75rem;
}

.pitia-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 0.5rem;
}

@media (min-width: 480px) {
	.pitia-grid {
		grid-template-columns: repeat(5, 1fr);
	}
}

.pitia-item {
	/* background: rgba(30, 41, 59, 0.5); */
	border: 1px solid rgba(71, 85, 105, 0.3);
	border-radius: 0.5rem;
	padding: 0.5rem;
	text-align: center;
}

.pitia-item-label {
	font-size: 0.625rem;
	color: #64748b;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.pitia-item-value {
	font-size: 0.875rem;
	font-weight: 600;
	/* color: white; */
}

.pitia-item.total {
	/* background: rgba(59, 130, 246, 0.15); */
	border-color: rgba(59, 130, 246, 0.3);
}

.pitia-item.total .pitia-item-value {
	color: #60a5fa;
}

/* Qualification Cards */
.qual-section {
	margin-top: 1.5rem;
}

.qual-title {
	font-size: 1rem;
	font-weight: 700;
	/* color: white; */
	margin-bottom: 1rem;
}

.qual-cards {
	display: grid;
	grid-template-columns: 1fr;
	gap: 0.75rem;
}

@media (min-width: 480px) {
	.qual-cards {
		grid-template-columns: repeat(2, 1fr);
	}
}

.qual-card {
	/* background: rgba(30, 41, 59, 0.5); */
	border: 1px solid rgba(71, 85, 105, 0.3);
	border-radius: 0.75rem;
	padding: 0.75rem;
}

.qual-card-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 0.5rem;
}

.qual-card-label {
	font-size: 0.75rem;
	color: #94a3b8;
}

.qual-card-badge {
	font-size: 0.625rem;
	font-weight: 600;
	padding: 0.125rem 0.5rem;
	border-radius: 9999px;
}

.qual-card-badge.pass {
	background: rgba(16, 185, 129, 0.2);
	color: #34d399;
}

.qual-card-badge.warn {
	background: rgba(245, 158, 11, 0.2);
	color: #fbbf24;
}

.qual-card-badge.fail {
	background: rgba(244, 63, 94, 0.2);
	color: #fb7185;
}

.qual-card-value {
	font-size: 1.25rem;
	font-weight: 700;
	/* color: white; */
}

.qual-card-desc {
	font-size: 0.75rem;
	color: #64748b;
	margin-top: 0.25rem;
}

/* Metrics Grid */
.metrics-section {
	margin-top: 1.5rem;
}

.metrics-title {
	font-size: 1rem;
	font-weight: 700;
	/* color: white; */
	margin-bottom: 1rem;
}

.metrics-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 0.75rem;
}

@media (min-width: 480px) {
	.metrics-grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

.metric-card {
	/* background: rgba(30, 41, 59, 0.5); */
	border: 1px solid rgba(71, 85, 105, 0.3);
	border-radius: 0.75rem;
	padding: 0.75rem;
}

.metric-card-label {
	font-size: 0.75rem;
	color: #94a3b8;
	margin-bottom: 0.25rem;
	display: flex;
	align-items: center;
	gap: 0.25rem;
}

.metric-card-value {
	font-size: 1.125rem;
	font-weight: 700;
	/* color: white; */
}

.metric-card-value.positive {
	color: #34d399;
}

.metric-card-value.negative {
	color: #fb7185;
}

/* Scenario Calculator */
.scenario-section {
	margin-top: 1.5rem;
	padding-top: 1.5rem;
	border-top: 1px solid rgba(71, 85, 105, 0.5);
}

.scenario-title {
	font-size: 1rem;
	font-weight: 700;
	/* color: white; */
	margin-bottom: 0.5rem;
}

.scenario-desc {
	font-size: 0.875rem;
	color: #94a3b8;
	margin-bottom: 1rem;
}

.scenario-cards {
	display: grid;
	grid-template-columns: 1fr;
	gap: 0.75rem;
}

@media (min-width: 600px) {
	.scenario-cards {
		grid-template-columns: repeat(3, 1fr);
	}
}

.scenario-card {
	/* background: rgba(30, 41, 59, 0.5); */
	border: 1px solid rgba(71, 85, 105, 0.3);
	border-radius: 0.75rem;
	padding: 1rem;
	text-align: center;
}

.scenario-card-dscr {
	font-size: 0.75rem;
	color: #94a3b8;
	margin-bottom: 0.25rem;
}

.scenario-card-target {
	font-size: 1.5rem;
	font-weight: 800;
	color: #60a5fa;
	margin-bottom: 0.75rem;
}

.scenario-card-result {
	font-size: 0.875rem;
	color: #a9bed8;
}

.scenario-card-result strong {
	color: #34d399;
	font-weight: 700;
}

/* CTA Section */
.cta-section {
	background: linear-gradient(90deg, #2563eb, #1d4ed8);
	border-radius: 1.5rem;
	padding: 1.5rem;
	text-align: center;
	margin-top: 1.5rem;
}

.cta-section h3 {
	font-size: 1.25rem;
	font-weight: 700;
	color: white;
	margin-bottom: 0.5rem;
}

.cta-section p {
	color: var(--blue-200);
	font-size: 0.875rem;
	margin-bottom: 1rem;
}

.cta-button {
	display: inline-block;
	padding: 0.75rem 1.5rem;
	background: white;
	color: #1d4ed8;
	font-weight: 600;
	border-radius: 0.75rem;
	text-decoration: none;
	transition: all 0.2s;
}

.cta-button:hover {
	background: var(--blue-50);
	transform: translateY(-1px);
}

/* Glossary Modal */
.modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.7);
	backdrop-filter: blur(4px);
	z-index: 1000;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 1rem;
}

.modal-overlay.open {
	display: flex;
}

.modal-content {
	background: #fff;
	border: 1px solid #334155;
	border-radius: 1.5rem;
	max-width: 650px;
	width: 100%;
	max-height: 85vh;
	overflow: hidden;
	box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.modal-header {
	position: sticky;
	top: 0;
	background: #fff;
	border-bottom: 1px solid #334155;
	padding: 1rem 1.5rem;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.modal-header h2 {
	font-size: 1.25rem;
	font-weight: 700;
	display: flex;
	align-items: center;
	gap: 0.5rem;
	color: #000;
}

.modal-close {
	padding: 0.5rem;
	border-radius: 0.75rem;
	background: transparent;
	border: none;
	color: #94a3b8;
	cursor: pointer;
	transition: all 0.2s;
}

.modal-close:hover {
	background: #1e293b;
	color: white;
}

.modal-close svg {
	width: 20px;
	height: 20px;
	stroke: currentColor;
}

.modal-body {
	overflow-y: auto;
	max-height: calc(85vh - 70px);
	padding: 1.5rem;
}

.glossary-term {
	background: #d8e6f4;
	border: 1px solid rgba(71, 85, 105, 0.5);
	border-radius: 0.75rem;
	padding: 1rem;
	margin-bottom: 1rem;
}

.glossary-term h3 {
	font-weight: 600;
	color: #000;
	margin-bottom: 0.5rem;
}

.glossary-term p {
	font-size: 0.875rem;
	color: #72767a;
	line-height: 1.6;
	margin-bottom: 0.5rem;
}

.glossary-formula {
	display: flex;
	align-items: flex-start;
	gap: 0.5rem;
	padding-top: 0.5rem;
}

.glossary-formula span {
	font-size: 0.75rem;
	color: #38414e;
	flex-shrink: 0;
}

.glossary-formula code {
	font-size: 0.75rem;
	background: #3c82f6;
	padding: 0.25rem 0.5rem;
	border-radius: 0.25rem;
	color: #ffffff;
}

/* Lender Requirements Info */
.lender-info {
	background: rgba(59, 130, 246, 0.1);
	border: 1px solid rgba(59, 130, 246, 0.3);
	border-radius: 1rem;
	padding: 1rem;
	margin-top: 1rem;
}

.lender-info-header {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin-bottom: 0.75rem;
}

.lender-info-header svg {
	width: 18px;
	height: 18px;
	stroke: #60a5fa;
}

.lender-info-header span {
	font-weight: 600;
	color: #60a5fa;
}

.lender-requirements {
	display: grid;
	grid-template-columns: 1fr;
	gap: 0.5rem;
}

@media (min-width: 480px) {
	.lender-requirements {
		grid-template-columns: repeat(2, 1fr);
	}
}

.lender-req-item {
	display: flex;
	justify-content: space-between;
	font-size: 0.875rem;
}

.lender-req-item span:first-child {
	color: #94a3b8;
}

.lender-req-item span:last-child {
	/* color: white; */
	font-weight: 500;
}

@media (max-width: 480px) {
	.ha-body-container {
		padding-top: 70px;
	}
}