/**
 * SmartTools — Frontend Styles
 * UPI QR Generator — clean reference-matching UI
 * @package SmartTools
 */

/* ── Reset scope ─────────────────────────────────────────────────────────── */
.st-widget *, .st-widget *::before, .st-widget *::after { box-sizing: border-box; }

/* ── Widget root / CSS tokens ────────────────────────────────────────────── */
.st-widget {
	--st-primary:      #1a1a2e;
	--st-border:       #e2e8f0;
	--st-border-focus: #a5b4fc;
	--st-label:        #374151;
	--st-placeholder:  #9ca3af;
	--st-bg:           #ffffff;
	--st-text:         #111827;
	--st-text-muted:   #6b7280;
	--st-radius:       8px;
	--st-font:         -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

	font-family: var(--st-font);
	color: var(--st-text);
	width: 100%;
	max-width: 980px;
	margin: 0 auto;
}

/* ── Grid ────────────────────────────────────────────────────────────────── */
.st-upi-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 40px;
	align-items: start;
}

@media (max-width: 740px) {
	.st-upi-grid { grid-template-columns: 1fr; gap: 28px; }

	/* QR column hidden by default on mobile — revealed by JS after generation */
	.st-qr-col {
		display: none;
	}
	.st-qr-col.st-qr-visible {
		display: flex;
		animation: st-qr-reveal .35s ease both;
	}
}

@keyframes st-qr-reveal {
	from { opacity: 0; transform: translateY(14px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* ── Form Column ─────────────────────────────────────────────────────────── */
.st-form-col { display: flex; flex-direction: column; }

/* ── Fields ──────────────────────────────────────────────────────────────── */
.st-field { display: flex; flex-direction: column; margin-bottom: 18px; }

.st-field label {
	font-size: 13px;
	font-weight: 600;
	color: var(--st-label);
	margin-bottom: 6px;
	line-height: 1.4;
}

/* ── Input ───────────────────────────────────────────────────────────────── */
.st-input {
	width: 100%;
	height: 44px;
	padding: 0 14px;
	font-size: 14px;
	font-family: var(--st-font);
	color: var(--st-text);
	background: #fff;
	border: 1.5px solid var(--st-border);
	border-radius: var(--st-radius);
	outline: none;
	transition: border-color .15s, box-shadow .15s;
	-webkit-appearance: none;
	appearance: none;
}
.st-input::placeholder { color: var(--st-placeholder); font-size: 13px; }
.st-input:focus {
	border-color: var(--st-border-focus);
	box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}
.st-input[type="number"]::-webkit-outer-spin-button,
.st-input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; }
.st-input[type="number"] { -moz-appearance: textfield; }
.st-input.st-input-error { border-color: #f87171; }

/* ── Select ──────────────────────────────────────────────────────────────── */
.st-select-wrap { position: relative; }
.st-select {
	width: 100%; height: 44px;
	padding: 0 40px 0 14px;
	font-size: 14px; font-family: var(--st-font); color: var(--st-text);
	background: #fff;
	border: 1.5px solid var(--st-border); border-radius: var(--st-radius);
	outline: none; cursor: pointer;
	-webkit-appearance: none; appearance: none;
	transition: border-color .15s, box-shadow .15s;
}
.st-select:focus {
	border-color: var(--st-border-focus);
	box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}
.st-chevron {
	position: absolute; right: 13px; top: 50%;
	transform: translateY(-50%);
	width: 16px; height: 16px;
	color: var(--st-text-muted); pointer-events: none;
}

/* ── Amount field ────────────────────────────────────────────────────────── */
.st-amount-wrap {
	display: flex;
	align-items: center;
	border: 1px solid var(--st-border, #d1d5db);
	border-radius: 8px;
	background: #fff;
	overflow: hidden;
	transition: border-color .15s;
}
.st-amount-wrap:focus-within {
	border-color: #2563EB;
	box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
/* Override default border on the inner input so the wrap handles it */
.st-amount-wrap .st-input-amount {
	border: none !important;
	box-shadow: none !important;
	border-radius: 0 !important;
	outline: none !important;
	width: 0 !important;       /* flex:1 sizes it; 100% would ignore the ₹ sibling */
	padding-left: 2px !important;  /* neutralise the 14px left-pad from .st-input */
}
.st-amount-prefix {
	flex-shrink: 0;
	padding: 0 6px 0 14px;
	font-size: 15px;
	font-weight: 600;
	color: #6b7280;
	pointer-events: none;
	line-height: 1;
	user-select: none;
}
.st-input-amount {
	flex: 1;
	padding-left: 2px;
	min-width: 0;
}

/* ── Error messages ──────────────────────────────────────────────────────── */
.st-error { font-size: 12px; color: #ef4444; margin-top: 5px; display: none; }
.st-error:not(:empty) { display: block; }

/* ── Utility ─────────────────────────────────────────────────────────────── */
.st-hidden { display: none !important; }

/* ── UPI Form Card ───────────────────────────────────────────────────────── */
.st-upi-form-card {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 16px;
	padding: 24px;
	box-shadow: 0 2px 12px rgba(0,0,0,.06);
}

/* ── PA Type Tabs ────────────────────────────────────────────────────────── */
.st-upi-tabs {
	display: flex;
	border-bottom: 2px solid #e5e7eb;
	margin-bottom: 20px;
}
.st-upi-tab {
	flex: 1;
	padding: 10px 0;
	background: none;
	border: none;
	border-bottom: 2px solid transparent;
	margin-bottom: -2px;
	font-size: 14px;
	font-weight: 600;
	color: #6b7280;
	cursor: pointer;
	font-family: var(--st-font, system-ui);
	transition: color .15s, border-color .15s;
}
.st-upi-tab.active {
	color: #2563EB;
	border-bottom-color: #2563EB;
}
.st-upi-tab:hover:not(.active) { color: #374151; }

/* ── Form two-column row ─────────────────────────────────────────────────── */
.st-form-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 14px;
}
@media (max-width: 500px) {
	.st-form-row { grid-template-columns: 1fr; }
}

/* ── Generate button ─────────────────────────────────────────────────────── */
.st-btn-generate {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	margin-top: 6px;
	padding: 14px;
	background: #2563EB;
	color: #fff;
	border: none;
	border-radius: 10px;
	font-size: 15px;
	font-weight: 700;
	font-family: var(--st-font, system-ui);
	cursor: pointer;
	transition: background .15s, transform .1s;
}
.st-btn-generate:hover  { background: #1d4ed8; }
.st-btn-generate:active { transform: scale(.99); }

/* ── Result section ──────────────────────────────────────────────────────── */
.st-upi-result {
	margin-top: 20px;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 16px;
	padding: 24px;
	box-shadow: 0 2px 12px rgba(0,0,0,.06);
	animation: st-result-in .3s ease;
}
@keyframes st-result-in {
	from { opacity: 0; transform: translateY(10px); }
	to   { opacity: 1; transform: translateY(0); }
}
.st-result-grid {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 24px;
	align-items: start;
}
@media (max-width: 500px) {
	.st-result-grid { grid-template-columns: 1fr; }
}

/* QR image column */
.st-result-qr-col {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
}
.st-result-qr-img img {
	border-radius: 10px;
	border: 1px solid #e5e7eb;
	display: block;
}
.st-result-scan-text {
	font-size: 11px;
	color: #9ca3af;
	text-align: center;
	margin: 0;
}

/* Info column */
.st-result-info-col {
	display: flex;
	flex-direction: column;
	gap: 12px;
}
.st-result-name-card {
	background: #eff6ff;
	border-radius: 10px;
	padding: 12px 14px;
}
.st-result-name {
	font-size: 16px;
	font-weight: 700;
	color: #1d4ed8;
}
.st-result-pa {
	font-size: 12px;
	color: #2563EB;
	margin-top: 2px;
}
.st-result-amount {
	display: inline-flex;
	align-items: center;
	background: #dcfce7;
	color: #16a34a;
	font-size: 20px;
	font-weight: 700;
	padding: 6px 14px;
	border-radius: 8px;
	min-height: 38px;
}
.st-result-amount:empty { display: none; }

/* Shareable link box */
.st-result-link-box {
	background: #f9fafb;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	padding: 10px 12px;
}
.st-result-link-label {
	font-size: 11px;
	font-weight: 600;
	color: #6b7280;
	letter-spacing: .04em;
	margin: 0 0 6px;
}
.st-result-link-row {
	display: flex;
	align-items: center;
	gap: 8px;
}
.st-result-link-text {
	flex: 1;
	font-size: 11px;
	color: #2563EB;
	word-break: break-all;
	overflow: hidden;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}
.st-copy-link-btn {
	flex-shrink: 0;
	padding: 5px 12px;
	background: #fff;
	border: 1.5px solid #d1d5db;
	border-radius: 6px;
	font-size: 12px;
	font-weight: 600;
	color: #374151;
	cursor: pointer;
	font-family: var(--st-font, system-ui);
	transition: border-color .15s, background .15s;
}
.st-copy-link-btn:hover { border-color: #2563EB; color: #2563EB; }
.st-copy-link-btn.copied { border-color: #16a34a; color: #16a34a; background: #f0fdf4; }

/* Result action buttons */
.st-result-actions {
	display: flex;
	gap: 8px;
}
.st-result-actions .st-btn-primary,
.st-result-actions .st-btn-secondary {
	flex: 1;
	padding: 10px 8px;
	font-size: 13px;
}

/* Privacy notice */
.st-privacy-notice {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin-top: 20px;
	padding: 12px 14px;
	background: #f0fdf4;
	border: 1px solid #bbf7d0;
	border-radius: 10px;
	font-size: 12.5px;
	color: #166534;
	line-height: 1.5;
}

/* ── UPI App Picker Modal ────────────────────────────────────────────────── */
.st-upi-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: flex-end;
	justify-content: center;
}
.st-upi-modal[hidden] { display: none; }
.st-upi-modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0,0,0,.45);
	animation: st-fade-in .2s ease;
}
.st-upi-modal-sheet {
	position: relative;
	width: 100%;
	max-width: 480px;
	background: #fff;
	border-radius: 20px 20px 0 0;
	padding: 20px 20px 32px;
	animation: st-slide-up .25s ease;
	box-shadow: 0 -4px 24px rgba(0,0,0,.12);
}
@keyframes st-fade-in  { from { opacity: 0; } to { opacity: 1; } }
@keyframes st-slide-up { from { transform: translateY(60px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.st-upi-modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 20px;
}
.st-upi-modal-header span {
	font-size: 15px;
	font-weight: 600;
	color: #111827;
}
.st-upi-modal-close {
	background: #f3f4f6;
	border: none;
	border-radius: 50%;
	width: 30px;
	height: 30px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	color: #6b7280;
	padding: 0;
}
.st-upi-modal-close:hover { background: #e5e7eb; color: #111; }

.st-upi-modal-apps {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 12px;
	margin-bottom: 16px;
}
.st-upi-app-btn {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	background: #f9fafb;
	border: 1.5px solid #e5e7eb;
	border-radius: 14px;
	padding: 14px 8px 12px;
	cursor: pointer;
	transition: border-color .15s, background .15s;
	font-family: var(--st-font, system-ui);
}
.st-upi-app-btn:hover {
	border-color: #2563EB;
	background: #eff6ff;
}
.st-upi-app-btn img {
	width: 44px;
	height: 44px;
	border-radius: 10px;
	object-fit: contain;
}
.st-upi-app-btn span {
	font-size: 12px;
	font-weight: 500;
	color: #374151;
	text-align: center;
	line-height: 1.3;
}
.st-upi-any-btn {
	width: 100%;
	padding: 13px;
	background: #f3f4f6;
	border: 1.5px solid #e5e7eb;
	border-radius: 10px;
	font-size: 13px;
	font-weight: 500;
	color: #374151;
	cursor: pointer;
	font-family: var(--st-font, system-ui);
	transition: background .15s;
}
.st-upi-any-btn:hover { background: #e5e7eb; }

/* ── Action Buttons ──────────────────────────────────────────────────────── */
.st-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }

.st-btn-primary, .st-btn-secondary {
	display: flex; align-items: center; justify-content: center;
	gap: 8px; width: 100%;
	font-family: var(--st-font); font-size: 14px; font-weight: 600;
	border-radius: var(--st-radius);
	cursor: pointer; transition: all .15s;
	border: none; outline: none; letter-spacing: .01em;
}

.st-btn-primary {
	height: 48px;
	background: var(--st-primary);
	color: #fff;
	padding: 0 20px;
}
.st-btn-primary:hover:not(:disabled) { background: #2d2d4e; }
.st-btn-primary:active:not(:disabled) { transform: scale(.99); }
.st-btn-primary:disabled { opacity: .45; cursor: not-allowed; }

.st-btn-secondary {
	background: transparent;
	color: var(--st-text);
	border: 1.5px solid var(--st-border);
	min-height: 50px; padding: 10px 20px;
	flex-direction: row; gap: 8px;
	align-items: center;
}
.st-btn-secondary:hover:not(:disabled) { border-color: #9ca3af; background: #f9fafb; }
.st-btn-secondary:disabled { opacity: .45; cursor: not-allowed; }
.st-btn-secondary .st-btn-text { display: flex; flex-direction: column; gap: 2px; text-align: left; }
.st-btn-secondary small { font-size: 11px; font-weight: 400; color: var(--st-text-muted); }

/* ── QR Column & Card ────────────────────────────────────────────────────── */
.st-qr-col {
	display: flex;
	justify-content: center;
}

.st-qr-card {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 16px;
	overflow: hidden;
	width: 100%;
	max-width: 320px;
	box-shadow: 0 4px 24px rgba(0,0,0,.08);
	display: flex;
	flex-direction: column;
}

@media (max-width: 740px) {
	.st-qr-card { max-width: 100%; }
}

/* Card header — light background strip for merchant name */
.st-qr-header {
	background: #f3f4f8;
	padding: 20px 24px 18px;
	text-align: center;
	border-bottom: 1px solid #e8eaf0;
}

.st-qr-name {
	font-size: 18px;
	font-weight: 800;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: #1a1a2e;
	word-break: break-word;
	line-height: 1.3;
}

/* Card body — QR code */
.st-qr-body {
	padding: 24px;
	display: flex;
	justify-content: center;
	background: #fff;
}

.st-qr-output {
	width: 240px;
	height: 240px;
	display: flex;
	align-items: center;
	justify-content: center;
	position: relative;
}

.st-qr-placeholder { opacity: .45; }

#st-qr-canvas-wrap img {
	width: 240px;
	height: 240px;
	display: block;
	image-rendering: pixelated;
}

/* Card footer — text, logos, apps */
.st-qr-footer {
	padding: 0 20px 20px;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 10px;
}

.st-qr-pa {
	font-size: 12.5px;
	color: var(--st-text-muted);
	word-break: break-all;
	margin: 0;
}

.st-qr-scan-text {
	font-size: 13px;
	color: var(--st-text-muted);
	margin: 0;
	line-height: 1.5;
}

/* ── Combined payment logos (BHIM, UPI, GPay, PhonePe, Paytm, Amazon Pay) ── */
.st-all-logos {
	display: block;
	width: 100%;
	max-width: 260px;
	height: auto;
	object-fit: contain;
	margin: 0 auto;
}

/* ── Branding ────────────────────────────────────────────────────────────── */
.st-qr-branding {
	font-size: 10.5px;
	color: #9ca3af;
	margin: 0;
	line-height: 1.5;
}
.st-qr-branding strong { font-weight: 600; color: var(--st-text-muted); }

/* ═══════════════════════════════════════════════════════════════════════════
   vCard QR Generator — additional styles
   ═══════════════════════════════════════════════════════════════════════════ */

/* Two-column field row (First/Last, Phone/Mobile, Title/Org) */
.st-field-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}
@media (max-width: 480px) {
	.st-field-row { grid-template-columns: 1fr; }
}

/* Required star */
.st-req { color: #ef4444; font-size: 11px; }

/* Card header subtitle (Job Title · Company) */
.st-vc-subtitle {
	font-size: 12px;
	color: #6b7280;
	margin-top: 4px;
	min-height: 16px;
}

/* Contact detail lines in card footer */
.st-vc-details {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	width: 100%;
}

.st-vc-detail {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 11.5px;
	color: #374151;
	max-width: 260px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.st-vc-detail svg {
	flex-shrink: 0;
	color: var(--st-text-muted);
}

/* ═══════════════════════════════════════════════════════════════════════════
   WhatsApp Tools — additional styles
   ═══════════════════════════════════════════════════════════════════════════ */

/* Phone input row: country dropdown + number */
.st-wa-phone-wrap {
	display: flex;
	gap: 10px;
}
.st-wa-country-wrap {
	flex: 0 0 180px;
}
.st-wa-country-select {
	font-size: 13px;
}
.st-wa-phone-input {
	flex: 1;
}
@media (max-width: 480px) {
	.st-wa-phone-wrap { flex-direction: column; }
	.st-wa-country-wrap { flex: none; }
	.st-wa-phone-input { flex: none; width: 100%; height: 44px; }
}

/* Textarea */
.st-textarea {
	height: auto;
	padding: 10px 14px;
	resize: vertical;
	line-height: 1.5;
}

/* Optional label hint */
.st-optional {
	font-weight: 400;
	color: var(--st-text-muted);
	font-size: 12px;
}

/* Generated link box */
.st-wa-link-box {
	margin-top: 20px;
	background: #f9fafb;
	border: 1.5px solid var(--st-border);
	border-radius: var(--st-radius);
	padding: 14px 16px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.st-wa-link-label {
	font-size: 12px;
	font-weight: 600;
	color: var(--st-label);
}
.st-wa-link-row {
	display: flex;
	gap: 8px;
}
.st-wa-link-input {
	flex: 1;
	font-size: 12.5px;
	color: var(--st-text-muted);
	background: #fff;
	cursor: text;
}
.st-btn-copy {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 0 14px;
	height: 44px;
	font-size: 13px;
	font-weight: 600;
	font-family: var(--st-font);
	background: #fff;
	border: 1.5px solid var(--st-border);
	border-radius: var(--st-radius);
	cursor: pointer;
	white-space: nowrap;
	transition: all .15s;
	flex-shrink: 0;
}
.st-btn-copy:hover { border-color: #9ca3af; background: #f3f4f6; }

.st-wa-open-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	font-weight: 600;
	color: #25D366;
	text-decoration: none;
}
.st-wa-open-link:hover { text-decoration: underline; }

/* Form heading (left column) — mirrors card header for alignment */
.st-wa-form-header {
	display: flex;
	align-items: center;
	gap: 14px;
	background: #f3f4f8;
	border: 1px solid #e8eaf0;
	border-radius: var(--st-radius);
	padding: 18px 20px;
	margin-bottom: 20px;
}
.st-wa-form-logo {
	width: 48px;
	height: 48px;
	flex-shrink: 0;
}
.st-wa-form-title {
	font-size: 14px;
	font-weight: 700;
	color: var(--st-text);
	line-height: 1.3;
}
.st-wa-form-sub {
	font-size: 12px;
	color: var(--st-text-muted);
	margin-top: 2px;
}

/* WhatsApp card logo */
.st-wa-card-logo {
	width: 52px;
	height: 52px;
	margin-bottom: 4px;
}

/* WhatsApp card header */
.st-wa-header {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   EMI Calculator — Redesigned
   ═══════════════════════════════════════════════════════════════════════════ */

/* Per loan-type color theming — applied via data-type on widget root */
.st-emi { --emi-color: #1a1a2e; --emi-light: #e5e7eb; --emi-grad: linear-gradient(135deg, #1a1a2e, #374151); }
.st-emi[data-type="home"]      { --emi-color: #2563EB; --emi-light: #dbeafe; --emi-grad: linear-gradient(135deg, #1d4ed8, #60a5fa); }
.st-emi[data-type="car"]       { --emi-color: #ea580c; --emi-light: #ffedd5; --emi-grad: linear-gradient(135deg, #c2410c, #f97316); }
.st-emi[data-type="personal"]  { --emi-color: #7c3aed; --emi-light: #ede9fe; --emi-grad: linear-gradient(135deg, #5b21b6, #8b5cf6); }
.st-emi[data-type="education"] { --emi-color: #059669; --emi-light: #d1fae5; --emi-grad: linear-gradient(135deg, #047857, #10b981); }
.st-emi[data-type="business"]  { --emi-color: #b45309; --emi-light: #fef3c7; --emi-grad: linear-gradient(135deg, #92400e, #d97706); }
.st-emi[data-type="bike"]      { --emi-color: #dc2626; --emi-light: #fee2e2; --emi-grad: linear-gradient(135deg, #991b1b, #ef4444); }

/* ── Loan type tab bar ─────────────────────────────────────────────────────── */
.st-emi-type-bar {
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
	margin-bottom: 24px;
	padding: 5px;
	background: #f3f4f6;
	border-radius: 14px;
}
.st-emi-type {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 8px 14px;
	font-size: 13px;
	font-weight: 600;
	font-family: var(--st-font);
	color: #6b7280;
	background: transparent;
	border: none;
	border-radius: 10px;
	cursor: pointer;
	transition: all .2s;
	white-space: nowrap;
	flex: 1;
}
.st-emi-type:hover { background: rgba(255,255,255,.7); color: var(--st-text); }
.st-emi-type.active {
	background: #fff;
	color: var(--emi-color);
	box-shadow: 0 2px 10px rgba(0,0,0,.1);
}
.st-emi-type-icon { font-size: 16px; line-height: 1; }
@media (max-width: 700px) {
	.st-emi-type-bar { padding: 4px; gap: 3px; }
	.st-emi-type { padding: 8px 10px; flex: 0 1 auto; }
	.st-emi-type-label { display: none; }
	.st-emi-type-icon { font-size: 20px; }
}

/* ── Two-column grid ─────────────────────────────────────────────────────── */
.st-emi-grid {
	display: grid;
	grid-template-columns: 1.1fr 0.9fr;
	gap: 28px;
	align-items: stretch;
}
@media (max-width: 740px) {
	.st-emi-grid { grid-template-columns: 1fr; gap: 20px; align-items: start; }
}

/* Results column — flex so card fills full height */
.st-emi-results {
	display: flex;
	flex-direction: column;
}

/* ── Inputs card ─────────────────────────────────────────────────────────── */
.st-emi-inputs {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 16px;
	padding: 24px;
	box-shadow: 0 1px 8px rgba(0,0,0,.04);
}

/* ── Fields ──────────────────────────────────────────────────────────────── */
.st-emi-field { margin-bottom: 22px; }
.st-emi-field:last-child { margin-bottom: 0; }
.st-emi-field-top {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 14px;
	gap: 12px;
}
.st-emi-label {
	font-size: 13px;
	font-weight: 600;
	color: var(--st-label);
	white-space: nowrap;
}

/* Input wrapper with focus border */
.st-emi-input-wrap {
	display: flex;
	align-items: center;
	gap: 4px;
	flex-shrink: 0;
	background: #f9fafb;
	border: 1.5px solid var(--st-border);
	border-radius: var(--st-radius);
	padding: 0 10px;
	height: 38px;
	transition: border-color .15s, box-shadow .15s;
}
.st-emi-input-wrap:focus-within {
	border-color: var(--emi-color);
	box-shadow: 0 0 0 3px rgba(37,99,235,.12);
	background: #fff;
}
.st-emi-prefix, .st-emi-suffix {
	font-size: 13px;
	font-weight: 700;
	color: var(--st-text-muted);
	white-space: nowrap;
	flex-shrink: 0;
}
.st-emi-number {
	width: 88px;
	height: 34px;
	padding: 0 4px;
	font-size: 14px;
	font-weight: 700;
	text-align: right;
	border: none;
	background: transparent;
	outline: none;
	color: var(--st-text);
	font-family: var(--st-font);
}
.st-emi-number::-webkit-outer-spin-button,
.st-emi-number::-webkit-inner-spin-button { -webkit-appearance: none; }
.st-emi-number { -moz-appearance: textfield; }

/* ── Tenure unit toggle ──────────────────────────────────────────────────── */
.st-emi-unit-toggle {
	display: flex;
	background: #f3f4f6;
	border-radius: 6px;
	overflow: hidden;
	padding: 2px;
	gap: 2px;
}
.st-emi-unit {
	padding: 0 10px;
	height: 28px;
	font-size: 12px;
	font-weight: 600;
	font-family: var(--st-font);
	background: transparent;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	color: var(--st-text-muted);
	transition: all .15s;
}
.st-emi-unit.active {
	background: #fff;
	color: var(--emi-color);
	box-shadow: 0 1px 4px rgba(0,0,0,.1);
}

/* ── Range slider ────────────────────────────────────────────────────────── */
.st-emi-slider {
	-webkit-appearance: none;
	appearance: none;
	width: 100%;
	height: 6px;
	border-radius: 4px;
	background: linear-gradient(to right, var(--emi-color, #2563EB) var(--fill, 0%), #e5e7eb var(--fill, 0%));
	outline: none;
	cursor: pointer;
	transition: background .05s;
}
/* WebKit track (Chrome/Safari) */
.st-emi-slider::-webkit-slider-runnable-track {
	-webkit-appearance: none;
	height: 6px;
	border-radius: 4px;
	background: transparent;
}
/* Firefox track */
.st-emi-slider::-moz-range-track {
	height: 6px;
	border-radius: 4px;
	background: #e5e7eb;
}
.st-emi-slider::-moz-range-progress {
	height: 6px;
	border-radius: 4px 0 0 4px;
	background: var(--emi-color, #2563EB);
}
/* Thumb — Chrome/Safari */
.st-emi-slider::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: #fff;
	border: 2.5px solid var(--emi-color, #2563EB);
	box-shadow: 0 2px 8px rgba(0,0,0,.18);
	cursor: pointer;
	margin-top: -7px;
	transition: transform .12s, box-shadow .15s;
}
.st-emi-slider::-webkit-slider-thumb:hover {
	transform: scale(1.18);
	box-shadow: 0 3px 14px rgba(0,0,0,.24);
}
/* Thumb — Firefox */
.st-emi-slider::-moz-range-thumb {
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: #fff;
	border: 2.5px solid var(--emi-color, #2563EB);
	box-shadow: 0 2px 8px rgba(0,0,0,.18);
	cursor: pointer;
}
.st-emi-slider-labels {
	display: flex;
	justify-content: space-between;
	margin-top: 7px;
	font-size: 11px;
	color: var(--st-text-muted);
}

/* ── Result card ─────────────────────────────────────────────────────────── */
.st-emi-result-card {
	background: #fff;
	border-radius: 20px;
	overflow: hidden;
	box-shadow: 0 8px 32px rgba(0,0,0,.1);
	border: none;
	flex: 1;
	display: flex;
	flex-direction: column;
}
.st-emi-result-header {
	background: var(--emi-grad);
	padding: 28px 24px 22px;
	text-align: center;
	color: #fff;
	position: relative;
	overflow: hidden;
}
/* Decorative circles in result header */
.st-emi-result-header::before {
	content: '';
	position: absolute;
	top: -40px; right: -40px;
	width: 130px; height: 130px;
	border-radius: 50%;
	background: rgba(255,255,255,.08);
	pointer-events: none;
}
.st-emi-result-header::after {
	content: '';
	position: absolute;
	bottom: -35px; left: -25px;
	width: 100px; height: 100px;
	border-radius: 50%;
	background: rgba(255,255,255,.06);
	pointer-events: none;
}
.st-emi-result-label {
	font-size: 11px;
	font-weight: 600;
	opacity: .85;
	margin: 0 0 8px;
	text-transform: uppercase;
	letter-spacing: .1em;
	position: relative; z-index: 1;
}
.st-emi-result-amount {
	font-size: 42px;
	font-weight: 800;
	margin: 0;
	letter-spacing: -.02em;
	line-height: 1;
	position: relative; z-index: 1;
}
.st-emi-result-sub {
	font-size: 12px;
	opacity: .7;
	margin: 8px 0 0;
	position: relative; z-index: 1;
}

/* ── Donut chart ─────────────────────────────────────────────────────────── */
.st-emi-chart-wrap {
	position: relative;
	display: flex;
	justify-content: center;
	align-items: center;
	padding: 24px 0 8px;
}
.st-emi-chart-center {
	position: absolute;
	display: flex;
	flex-direction: column;
	align-items: center;
	pointer-events: none;
}
.st-emi-chart-pct {
	font-size: 22px;
	font-weight: 800;
	color: var(--st-text);
	line-height: 1;
}
.st-emi-chart-center small {
	font-size: 10px;
	font-weight: 600;
	color: var(--st-text-muted);
	text-transform: uppercase;
	letter-spacing: .05em;
	margin-top: 3px;
}

/* ── Breakdown rows ──────────────────────────────────────────────────────── */
.st-emi-breakdown {
	padding: 4px 20px 20px;
	display: flex;
	flex-direction: column;
	flex: 1;
	justify-content: flex-end;
}
.st-emi-break-row {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 13px;
	color: var(--st-text);
	padding: 9px 0;
	border-bottom: 1px dashed #f0f0f0;
}
.st-emi-break-row:last-child { border-bottom: none; }
.st-emi-break-row span:nth-child(2) { flex: 1; color: #6b7280; font-size: 12.5px; }
.st-emi-break-row strong { font-weight: 700; font-size: 13.5px; }
.st-emi-break-total {
	border-bottom: none !important;
	border-top: 2px solid #f3f4f6 !important;
	padding-top: 10px;
	margin-top: 2px;
}
.st-emi-break-total span:nth-child(2) { color: var(--st-text); font-weight: 600; font-size: 13px !important; }
.st-emi-break-total strong { font-size: 15px; }
.st-emi-dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	flex-shrink: 0;
}
.st-emi-dot-principal { background: var(--emi-color); }

/* ── Loan Repayment Schedule section ─────────────────────────────────────── */
.st-emi-amort {
	margin-top: 28px;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 16px;
	overflow: hidden;
}
.st-emi-amort-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
	padding: 16px 20px;
	border-bottom: 1px solid transparent;
	transition: border-color .2s;
}
.st-emi-amort-bar.is-open { border-bottom-color: #e5e7eb; }
.st-emi-amort-btn {
	min-height: 40px;
	padding: 0 18px !important;
	font-size: 13px !important;
	border-color: var(--emi-color) !important;
	color: var(--emi-color) !important;
	background: var(--emi-light) !important;
}
.st-emi-amort-btn:hover {
	background: var(--emi-color) !important;
	color: #fff !important;
}
.st-emi-amort-actions {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}
.st-emi-view-toggle {
	display: flex;
	background: #f3f4f6;
	border-radius: 8px;
	overflow: hidden;
	padding: 3px;
	gap: 2px;
	border: none;
}
.st-emi-view {
	padding: 0 14px;
	height: 34px;
	font-size: 12px;
	font-weight: 600;
	font-family: var(--st-font);
	background: transparent;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	color: var(--st-text-muted);
	transition: all .15s;
}
.st-emi-view.active {
	background: #fff;
	color: var(--emi-color);
	box-shadow: 0 1px 4px rgba(0,0,0,.1);
}
.st-emi-csv-btn {
	min-height: 40px;
	padding: 0 14px !important;
	font-size: 13px !important;
}

/* ── Amortization table ──────────────────────────────────────────────────── */
.st-emi-table-scroll { overflow-x: auto; }
.st-emi-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 13px;
}
.st-emi-table th {
	background: #f9fafb;
	padding: 11px 16px;
	text-align: left;
	font-weight: 600;
	color: var(--st-label);
	border-bottom: 2px solid #e5e7eb;
	white-space: nowrap;
}
.st-emi-table td {
	padding: 10px 16px;
	border-bottom: 1px solid #f3f4f6;
	color: var(--st-text);
	white-space: nowrap;
}
.st-emi-table tr:last-child td { border-bottom: none; }
.st-emi-table tr:hover td { background: #fafafa; }
.st-emi-td-principal { color: var(--emi-color) !important; font-weight: 600; }
.st-emi-td-interest  { color: #f59e0b !important; font-weight: 600; }

/* ── EMI Mobile Responsive ───────────────────────────────────────────────── */
@media (max-width: 480px) {

	/* Tab bar — horizontal scroll so all 6 icons fit */
	.st-emi-type-bar {
		overflow-x: auto;
		flex-wrap: nowrap;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
		border-radius: 12px;
		padding: 4px;
		gap: 2px;
	}
	.st-emi-type-bar::-webkit-scrollbar { display: none; }
	.st-emi-type { flex: 0 0 auto; padding: 8px 12px; border-radius: 8px; }
	.st-emi-type-icon { font-size: 18px; }

	/* Inputs card — tighter padding */
	.st-emi-inputs { padding: 16px; }

	/* Field top row — stack label above input */
	.st-emi-field-top {
		flex-direction: column;
		align-items: flex-start;
		gap: 8px;
		margin-bottom: 10px;
	}
	.st-emi-input-wrap {
		width: 100%;
		height: 42px;
	}
	.st-emi-number {
		flex: 1;
		width: auto;
		font-size: 15px;
	}
	.st-emi-unit-toggle { margin-left: auto; }

	/* Result card — smaller text */
	.st-emi-result-header { padding: 20px 16px 16px; }
	.st-emi-result-amount { font-size: 32px; }
	.st-emi-breakdown { padding: 4px 14px 16px; }
	.st-emi-break-row { font-size: 12.5px; gap: 8px; }
	.st-emi-break-row strong { font-size: 13px; }
	.st-emi-break-total strong { font-size: 14px; }

	/* Repayment schedule bar — stack buttons */
	.st-emi-amort-bar { flex-direction: column; align-items: stretch; gap: 10px; padding: 14px 14px; }
	.st-emi-amort-btn { width: 100%; justify-content: center; }
	.st-emi-amort-actions { flex-wrap: wrap; gap: 8px; }
	.st-emi-csv-btn { flex: 1; justify-content: center; }

	/* Table — tighter cells */
	.st-emi-table th,
	.st-emi-table td { padding: 8px 10px; font-size: 12px; }
}

/* Download button inside vCard card, below QR image */
.st-vc-download-wrap {
	padding: 0 24px 16px;
}
.st-vc-download {
	width: 100%;
	height: 44px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   HOME LOAN CALCULATOR  (.st-hl)
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── CSS custom properties ── */
.st-hl {
	--hl-color:   #2563EB;
	--hl-light:   #dbeafe;
	--hl-grad:    linear-gradient( 135deg, #1d4ed8, #60a5fa );
	/* alias so shared .st-emi-slider picks up the right colour */
	--emi-color:  #2563EB;
	--emi-light:  #dbeafe;
}

/* ── Widget wrapper ── */
.st-hl {
	background: #f9fafb;
	border: 1px solid #e5e7eb;
	border-radius: 20px;
	padding: 28px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	max-width: 900px;
	margin: 0 auto;
}

/* ── Hero ── */
.st-hl-hero {
	display: flex;
	align-items: center;
	gap: 16px;
	margin-bottom: 24px;
}
.st-hl-hero-icon {
	font-size: 36px;
	line-height: 1;
	background: var(--hl-light);
	width: 60px;
	height: 60px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}
.st-hl-hero-title {
	margin: 0 0 4px;
	font-size: 22px;
	font-weight: 700;
	color: #111827;
	line-height: 1.2;
}
.st-hl-hero-sub {
	margin: 0;
	font-size: 13px;
	color: #6b7280;
}
.st-hl-hero-sub strong {
	color: var(--hl-color);
}

/* ── Mode toggle bar ── */
.st-hl-mode-bar {
	display: flex;
	gap: 0;
	margin-bottom: 20px;
	background: #e5e7eb;
	padding: 4px;
	border-radius: 12px;
	border: 1px solid #d1d5db;
}
.st-hl-mode {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	padding: 10px 16px;
	border: 1px solid transparent;
	border-radius: 9px;
	font-size: 13.5px;
	font-weight: 500;
	color: #4b5563;
	background: transparent;
	cursor: pointer;
	transition: all 0.18s;
	white-space: nowrap;
	line-height: 1;
}
.st-hl-mode:hover {
	color: #111827;
	background: rgba(255,255,255,0.6);
	border-color: #d1d5db;
}
.st-hl-mode.active {
	background: #fff;
	color: var(--hl-color);
	border-color: #bfdbfe;
	box-shadow: 0 1px 6px rgba(37,99,235,0.13), 0 1px 2px rgba(0,0,0,0.08);
	font-weight: 600;
}
.st-hl-mode svg {
	opacity: 0.7;
	flex-shrink: 0;
}
.st-hl-mode.active svg {
	opacity: 1;
	color: var(--hl-color);
}

/* ── Main grid ── */
.st-hl-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px;
	align-items: stretch;
}

/* ── Inputs card ── */
.st-hl-inputs {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 16px;
	padding: 24px;
	display: flex;
	flex-direction: column;
	gap: 0;
}

/* ── Panel (mode A / B) ── */
.st-hl-panel {
	margin-bottom: 0;
}

/* ── Derived amount display (property mode) ── */
.st-hl-derived-wrap {
	background: var(--hl-light);
	border-radius: 10px;
	padding: 12px 16px;
	margin: 8px 0 20px;
	display: flex;
	flex-direction: column;
	gap: 6px;
}
.st-hl-derived-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	font-size: 13px;
	color: #374151;
}
.st-hl-derived-loan {
	font-size: 14px;
	border-top: 1px solid rgba(37,99,235,0.15);
	padding-top: 6px;
	margin-top: 2px;
}
.st-hl-derived-loan strong {
	color: var(--hl-color);
	font-size: 15px;
}

/* ── Results column ── */
.st-hl-results {
	display: flex;
	flex-direction: column;
}
.st-hl-result-card {
	flex: 1;
	display: flex;
	flex-direction: column;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 16px;
	overflow: hidden;
}

/* Result header reuses .st-emi-result-header but with home loan gradient */
.st-hl .st-emi-result-header {
	background: var(--hl-grad);
}

/* Principal dot colour */
.st-hl .st-emi-dot-principal {
	background: var(--hl-color);
}

/* Repayment schedule reuses .st-emi-amort */
.st-hl .st-emi-amort {
	margin-top: 20px;
}

/* ── Utility ── */
.st-hidden { display: none !important; }

/* ── Responsive ── */
@media ( max-width: 680px ) {
	.st-hl { padding: 16px; }
	.st-hl-grid { grid-template-columns: 1fr; }
	.st-hl-hero-title { font-size: 18px; }
	.st-hl-mode { font-size: 12.5px; padding: 8px 10px; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   PDF DOWNLOAD BUTTON  (.st-pdf-btn)
   Sits at the bottom of the result card in both EMI and Home Loan calculators
   ═══════════════════════════════════════════════════════════════════════════ */

.st-pdf-btn-wrap {
	padding: 14px 18px 18px;
	border-top: 1px solid #f3f4f6;
}

.st-pdf-btn {
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 11px 16px;
	border: 1.5px solid var(--emi-color, #2563EB);
	border-radius: 10px;
	background: transparent;
	color: var(--emi-color, #2563EB);
	font-size: 13.5px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.18s, color 0.18s, box-shadow 0.18s;
	letter-spacing: 0.01em;
}

.st-pdf-btn:hover {
	background: var(--emi-color, #2563EB);
	color: #fff;
	box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
}

.st-pdf-btn:hover svg {
	stroke: #fff;
}

.st-pdf-btn svg {
	flex-shrink: 0;
	stroke: var(--emi-color, #2563EB);
	transition: stroke 0.18s;
}

/* Home loan variant — uses its own colour var */
.st-hl .st-pdf-btn {
	border-color: var(--hl-color, #2563EB);
	color: var(--hl-color, #2563EB);
}
.st-hl .st-pdf-btn:hover {
	background: var(--hl-color, #2563EB);
	box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
}
.st-hl .st-pdf-btn svg {
	stroke: var(--hl-color, #2563EB);
}
.st-hl .st-pdf-btn:hover svg {
	stroke: #fff;
}
