.bond-calc-app {
	--bond-blue: #2563eb;
	--bond-indigo: #2f5fe0;
	--bond-green: #16a34a;
	--bond-orange: #ea580c;
	--bond-purple: #9333ea;
	--bond-red: #dc2626;
	--bond-dark: #1f2328;
	--bond-gray: #6b7280;
	--bond-border: #e5e7eb;
	--bond-bg: #f7f7f8;
	--bond-card-bg: #ffffff;

	background: var(--bond-bg);
	border-radius: 12px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: var(--bond-dark);
	box-sizing: border-box;
}
.bond-calc-app *,
.bond-calc-app *::before,
.bond-calc-app *::after {
	box-sizing: border-box;
}

/* Header */
.bond-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 20px;
	flex-wrap: wrap;
}
.bond-header-left { display: flex; gap: 14px; align-items: flex-start; }
.bond-header-icon {
	background: var(--bond-indigo);
	color: #fff;
	width: 44px;
	height: 44px;
	min-width: 44px;
	border-radius: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
}
.bond-title { font-size: 22px; font-weight: 700; margin: 0 0 4px; line-height: 1.25; }
.bond-subtitle { font-size: 13.5px; color: var(--bond-gray); margin: 0; }
.bond-header-actions { display: flex; gap: 10px; }

/* Buttons */
.bond-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	font-size: 14px;
	font-weight: 600;
	padding: 10px 18px;
	border-radius: 8px;
	border: 1px solid transparent;
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease, opacity .15s ease;
	white-space: nowrap;
	color: var(--bond-dark);
}
.bond-btn-ghost { background: #fff; color: var(--bond-dark) !important; border-color: var(--bond-border); }
.bond-btn-ghost:hover { background: #f3f4f6; }
.bond-btn-primary { background: var(--bond-blue); color: #fff !important; }
.bond-btn-primary:hover { background: #1d4ed8; }
.bond-btn-outline { background: #fff; border-color: var(--bond-border); color: var(--bond-dark) !important; }
.bond-btn-outline:hover { background: #f3f4f6; }
.bond-btn-block { width: 100%; }
.bond-btn-report {
	background: #fff;
	color: var(--bond-gray) !important;
	border: 1px solid var(--bond-border);
	text-decoration: none;
}
.bond-btn-report:hover { background: #f9f4f0; color: var(--bond-orange) !important; border-color: var(--bond-orange); }
/* The theme applies its own dark background to buttons on :active/:focus,
   independent of our styles, which collides with our default dark text and
   makes the label unreadable at the moment of clicking. Force light text
   for that state so it stays legible either way. */
.bond-btn-ghost:active, .bond-btn-ghost:focus,
.bond-btn-outline:active, .bond-btn-outline:focus {
	color: #fff !important;
}

/* Grid layout */
.bond-grid {
	display: grid;
	grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
	gap: 20px;
	align-items: start;
}
@media (max-width: 900px) {
	.bond-grid { grid-template-columns: minmax(0, 1fr); }
}
.bond-col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

/* Card */
.bond-card {
	background: var(--bond-card-bg);
	border: 1px solid var(--bond-border);
	border-radius: 12px;
	padding: 22px;
	min-width: 0;
}
.bond-card-title {
	font-size: 16px;
	font-weight: 700;
	margin: 0 0 16px;
	display: flex;
	align-items: center;
	gap: 6px;
}
.bond-card-header-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 6px;
}
.bond-card-header-row .bond-card-title { margin-bottom: 0; }
.bond-help {
	width: 16px;
	height: 16px;
	font-size: 11px;
	border-radius: 50%;
	border: 1px solid var(--bond-blue);
	color: var(--bond-blue);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: help;
	font-weight: 700;
}

/* Fields */
.bond-field { margin-bottom: 16px; }
.bond-field label {
	display: block;
	font-size: 13.5px;
	font-weight: 600;
	margin-bottom: 6px;
	color: var(--bond-dark);
}
.bond-field input[type="number"],
.bond-field input[type="date"],
.bond-field select {
	width: 100%;
	padding: 10px 12px;
	border-radius: 8px;
	border: 1px solid var(--bond-border);
	font-size: 14px;
	background: #fff;
	color: var(--bond-dark);
}
.bond-field input:focus, .bond-field select:focus {
	outline: none;
	border-color: var(--bond-blue);
	box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}

.bond-input-suffix-wrap { position: relative; display: flex; align-items: center; }
.bond-input-suffix-wrap input { padding-right: 34px; }
.bond-input-suffix-wrap .bond-suffix {
	position: absolute;
	right: 12px;
	color: var(--bond-gray);
	font-size: 13px;
	pointer-events: none;
}
/* Native number-input spin arrows collide with our percent suffix label. */
.bond-input-suffix-wrap input[type="number"]::-webkit-outer-spin-button,
.bond-input-suffix-wrap input[type="number"]::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}
.bond-input-suffix-wrap input[type="number"] {
	-moz-appearance: textfield;
	appearance: textfield;
}

.bond-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.bond-error { color: var(--bond-red); font-size: 13px; margin-top: 12px; }
.bond-error[hidden] { display: none; }

/* Formula card */
.bond-formula-toggle,
.bond-calc-app button.bond-formula-toggle {
	width: 100%;
	background: transparent !important;
	border: none;
	display: flex;
	align-items: center;
	justify-content: space-between;
	cursor: pointer;
	padding: 0;
	color: var(--bond-dark) !important;
}
.bond-formula-toggle .bond-card-title,
.bond-formula-toggle .bond-chevron {
	color: var(--bond-dark) !important;
}
.bond-formula-toggle .bond-card-title { margin-bottom: 0; }
.bond-chevron {
	color: var(--bond-gray) !important;
	transition: transform .2s ease;
	font-size: 12px;
}
.bond-chevron.bond-collapsed { transform: rotate(180deg); }
.bond-formula-body { margin-top: 16px; }
.bond-formula-body[hidden] { display: none; }
.bond-formula-intro { font-size: 13.5px; color: var(--bond-gray); margin: 0 0 14px; }
.bond-formula-katex {
	background: #f6f6f7;
	border-radius: 8px;
	padding: 16px;
	margin-bottom: 14px;
	overflow-x: auto;
	text-align: center;
}
.bond-formula-legend { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.bond-formula-legend li { font-size: 13px; color: var(--bond-dark); }
.bond-formula-legend strong { color: var(--bond-indigo); font-style: italic; }
.bond-formula-note { font-size: 12px; color: var(--bond-gray); margin: 0; line-height: 1.5; }

/* Results */
.bond-results-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 12px;
}
.bond-result-item {
	border: 1px solid var(--bond-border);
	border-radius: 10px;
	padding: 16px 14px;
	text-align: center;
}
.bond-result-icon { font-size: 20px; display: block; margin-bottom: 8px; }
.bond-result-label { font-size: 12px; color: var(--bond-gray); margin: 0 0 6px; font-weight: 600; }
.bond-result-value { font-size: 20px; font-weight: 700; margin: 0 0 4px; }
.bond-result-value-sm { font-size: 15px; }
.bond-result-value .bond-unit { font-size: 12px; font-weight: 500; color: var(--bond-gray); }
.bond-result-sub { font-size: 11.5px; color: var(--bond-gray); margin: 0; }
.bond-color-blue { color: var(--bond-blue); }
.bond-color-green { color: var(--bond-green); }
.bond-color-purple { color: var(--bond-purple); }
.bond-color-orange { color: var(--bond-orange); }

/* Table */
.bond-table-wrap { position: relative; min-height: 200px; overflow-x: auto; }
.bond-table { width: 100%; border-collapse: collapse; font-size: 13px; white-space: nowrap; }
.bond-table thead th {
	text-align: left;
	padding: 10px 12px;
	background: #f6f6f7;
	color: #55585d;
	font-weight: 600;
	border-bottom: 1px solid var(--bond-border);
}
.bond-table tbody td, .bond-table tfoot td {
	padding: 10px 12px;
	border-bottom: 1px solid var(--bond-border);
}
.bond-table tfoot td { font-weight: 700; border-bottom: none; border-top: 2px solid var(--bond-border); color: var(--bond-blue); }
.bond-table-wrap.has-data .bond-schedule-empty { display: none; }
.bond-table-wrap:not(.has-data) #bond-schedule-table { display: none; }

.bond-schedule-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 50px 20px;
	color: var(--bond-gray);
}
.bond-schedule-empty-icon { font-size: 26px; margin-bottom: 10px; opacity: .6; }
.bond-schedule-empty-title { font-weight: 600; color: var(--bond-dark); margin: 0 0 4px; }
.bond-schedule-empty-sub { font-size: 13px; margin: 0; }
.bond-hint { font-size: 12px; color: var(--bond-gray); margin: 14px 0 0; }

/* Additional Information */
.bond-info-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 24px;
}
@media (max-width: 640px) {
	.bond-info-grid { grid-template-columns: 1fr; gap: 4px; }
}
.bond-info-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 10px 0;
	border-bottom: 1px solid var(--bond-border);
	font-size: 13.5px;
}
.bond-info-row:last-child { border-bottom: none; }
.bond-info-label { color: var(--bond-gray); }
.bond-info-value { font-weight: 600; color: var(--bond-dark); }

.bond-footnote { text-align: center; font-size: 12.5px; color: var(--bond-gray); margin-top: 24px; }
.bond-report-wrap { display: flex; justify-content: center; margin-top: 16px; }

/* Responsive */
@media (max-width: 640px) {
	.bond-header { flex-direction: column; }
	.bond-header-actions { width: 100%; }
	.bond-header-actions .bond-btn { flex: 1; }
	.bond-card-header-row { flex-direction: column; align-items: flex-start; }
	.bond-results-grid { grid-template-columns: repeat(2, 1fr); }
	.bond-table { font-size: 12px; }
	.bond-table thead th, .bond-table tbody td { padding: 8px 6px; }
}
