:root {
	--khc-primary: #087a55;
	--khc-primary-dark: #056344;
	--khc-primary-soft: #edfbf5;
	--khc-border: #d9e7e1;
	--khc-text: #282828;
	--khc-muted: #64748b;
	--khc-surface: #ffffff;
	--khc-bg: #f7faf9;
	--khc-danger: #9f1239;
}

.khc-archive,
.khc-detail,
.khc-invite {
	box-sizing: border-box;
	color: var(--khc-text);
	font-family: Vazir, Tahoma, sans-serif;
	direction: rtl;
}

.khc-archive *,
.khc-detail *,
.khc-invite * { box-sizing: border-box; }

.khc-icon { display: inline-block; flex: 0 0 auto; vertical-align: middle; }

.khc-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	min-height: 42px;
	padding: 8px 16px;
	border: 1px solid transparent;
	border-radius: 8px;
	font: inherit;
	font-weight: 700;
	line-height: 1.5;
	text-decoration: none !important;
	cursor: pointer;
	transition: background-color .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}

.khc-button:hover { transform: translateY(-1px); }
.khc-button:focus-visible { outline: 3px solid rgba(8,122,85,.25); outline-offset: 2px; }
.khc-button:disabled { opacity: .48; cursor: not-allowed; transform: none; }
.khc-button--primary { background: var(--khc-primary); color: #fff !important; }
.khc-button--primary:hover { background: var(--khc-primary-dark); }
.khc-button--secondary { background: #fff; border-color: var(--khc-border); color: var(--khc-primary-dark) !important; }
.khc-button--secondary:hover { border-color: var(--khc-primary); background: var(--khc-primary-soft); }
.khc-button--danger { background: #fff; border-color: #fecdd3; color: var(--khc-danger) !important; }
.khc-button--danger:hover { background: #fff1f2; }

.khc-invite {
	display: flex;
	align-items: flex-start;
	gap: 18px;
	padding: 22px;
	border: 1px solid #a6dbc8;
	border-radius: 14px;
	background: linear-gradient(135deg, var(--khc-primary-soft), #fff 72%);
	box-shadow: 0 8px 24px rgba(5,99,68,.08);
}

.khc-invite__icon {
	display: grid;
	place-items: center;
	width: 50px;
	height: 50px;
	border-radius: 12px;
	background: var(--khc-primary);
	color: #fff;
}

.khc-invite__icon .khc-icon { width: 25px; height: 25px; }
.khc-invite__content { flex: 1; min-width: 0; }
.khc-invite h3 { margin: 0 0 7px; color: var(--khc-primary-dark); font-size: 21px; }
.khc-invite p { margin: 0 0 12px; color: #334155; line-height: 1.9; }
.khc-invite ul { display: flex; flex-wrap: wrap; gap: 7px 20px; margin: 0 0 16px; padding: 0; list-style: none; }
.khc-invite li::before { content: "✓"; margin-left: 6px; color: var(--khc-primary); font-weight: 900; }
.khc-invite small { display: block; margin-top: 10px; color: var(--khc-muted); line-height: 1.8; }
.khc-invite--compact { padding: 16px; }
.khc-invite--compact .khc-invite__icon { width: 42px; height: 42px; }
.khc-invite--signed { align-items: center; justify-content: space-between; }

.khc-archive__header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 20px;
	margin-bottom: 22px;
}

.khc-archive__header h2,
.khc-detail h2 { margin: 0 0 7px; color: #232323; font-size: 25px; }
.khc-archive__header p,
.khc-detail__header p { margin: 0; color: var(--khc-muted); line-height: 1.85; }
.khc-count,
.khc-badge { display: inline-flex; padding: 5px 10px; border-radius: 999px; background: var(--khc-primary-soft); color: var(--khc-primary-dark); font-size: 12px; font-weight: 800; white-space: nowrap; }

.khc-records { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.khc-record {
	position: relative;
	padding: 18px;
	border: 1px solid var(--khc-border);
	border-radius: 12px;
	background: var(--khc-surface);
	box-shadow: 0 4px 16px rgba(15,23,42,.045);
	cursor: pointer;
	transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.khc-record:hover { border-color: var(--khc-primary); box-shadow: 0 8px 24px rgba(15,23,42,.09); transform: translateY(-2px); }
.khc-record__link { display: block; color: inherit !important; text-decoration: none !important; }
.khc-record__link:focus-visible { border-radius: 8px; outline: 3px solid rgba(8,122,85,.25); outline-offset: 5px; }
.khc-record__meta { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 8px; color: var(--khc-muted); font-size: 12px; }
.khc-record__meta span { color: var(--khc-primary-dark); font-weight: 700; }
.khc-record h3 { margin: 0 0 7px; font-size: 17px; line-height: 1.75; }
.khc-record h3 { color: #232323; }
.khc-record p { margin: 0 0 12px; color: var(--khc-muted); font-size: 13px; line-height: 1.8; }
.khc-record__result { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 12px 0; padding: 10px 12px; border-radius: 8px; background: var(--khc-primary-soft); }
.khc-record__result small { color: var(--khc-muted); }
.khc-record__result strong { color: var(--khc-primary-dark); font-size: 16px; }
.khc-record__open { display: inline-flex; align-items: center; gap: 4px; color: var(--khc-primary); font-size: 13px; font-weight: 800; }
.khc-record__open .khc-icon { width: 16px; height: 16px; }

.khc-empty { padding: 38px 20px; border: 1px dashed var(--khc-border); border-radius: 12px; background: var(--khc-bg); text-align: center; }
.khc-empty > .khc-icon { width: 38px; height: 38px; color: var(--khc-primary); }
.khc-empty h3 { margin: 12px 0 6px; font-size: 18px; }
.khc-empty p { margin: 0; color: var(--khc-muted); }

.khc-pagination { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin-top: 22px; }
.khc-pagination .page-numbers { display: grid; place-items: center; min-width: 38px; min-height: 38px; padding: 5px 10px; border: 1px solid var(--khc-border); border-radius: 7px; background: #fff; color: #334155; text-decoration: none; }
.khc-pagination .current { background: var(--khc-primary); border-color: var(--khc-primary); color: #fff; }

.khc-notice { margin: 0 0 15px; padding: 11px 13px; border-radius: 8px; border: 1px solid; }
.khc-notice--success { background: var(--khc-primary-soft); border-color: #a6dbc8; color: var(--khc-primary-dark); }
.khc-notice--error { background: #fff1f2; border-color: #fecdd3; color: var(--khc-danger); }

.khc-support-message {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	box-sizing: border-box;
	width: 100%;
	margin: 16px 0 0;
	padding: 12px 14px;
	border: 1px solid #cfe4dc;
	border-radius: 10px;
	background: #f5faf8;
	color: #40534d;
	font-family: Vazir, Tahoma, sans-serif;
	font-size: 12.5px;
	line-height: 1.9;
	direction: rtl;
	text-align: right;
}
.khc-support-message__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 22px;
	width: 22px;
	height: 22px;
	margin-top: 2px;
	border-radius: 50%;
	background: var(--khc-primary-soft);
	color: var(--khc-primary-dark);
	font-family: Tahoma, Arial, sans-serif;
	font-size: 12px;
	font-weight: 900;
}
.khc-support-message p { margin: 0; }

.khc-detail,
.khc-detail { padding: 2px; }
.khc-detail__top { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 18px; }
.khc-back { display: inline-flex; align-items: center; gap: 5px; color: var(--khc-primary); font-weight: 700; text-decoration: none; }
.khc-back .khc-icon { width: 17px; height: 17px; }
.khc-output-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.khc-output-actions .khc-button { min-height: 38px; padding: 6px 11px; font-size: 12px; }
.khc-detail__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 20px; border: 1px solid var(--khc-border); border-radius: 12px; background: #fff; }
.khc-detail__header .khc-badge { margin-bottom: 10px; }
.khc-detail__header time { color: var(--khc-muted); font-size: 12px; white-space: nowrap; }
.khc-primary-result { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin: 14px 0; padding: 16px 18px; border: 1px solid #a6dbc8; border-radius: 11px; background: var(--khc-primary-soft); }
.khc-primary-result small { color: #475569; }
.khc-primary-result strong { color: var(--khc-primary-dark); font-size: 21px; }
.khc-detail-group { margin-top: 14px; padding: 18px; border: 1px solid var(--khc-border); border-radius: 11px; background: #fff; }
.khc-detail-group h3 { margin: 0 0 12px; font-size: 16px; color: #232323; }
.khc-detail-group dl { margin: 0; }
.khc-detail-group dl > div { display: grid; grid-template-columns: minmax(150px, .8fr) minmax(0, 1.2fr); gap: 15px; padding: 10px 0; border-bottom: 1px solid #edf2ef; }
.khc-detail-group dl > div:last-child { border-bottom: 0; }
.khc-detail-group dt { color: var(--khc-muted); }
.khc-detail-group dd { margin: 0; color: #232323; font-weight: 700; overflow-wrap: anywhere; }
.khc-detail__footer { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--khc-border); }
.khc-print-brand, .khc-print-brand-footer { display: none; }
.khc-version { display: flex; flex-wrap: wrap; gap: 7px 16px; color: var(--khc-muted); font-size: 11px; }
.khc-detail__actions { display: flex; flex-wrap: wrap; gap: 7px; }
.khc-delete-form { margin: 0; }

@media (max-width: 700px) {
	.khc-records { grid-template-columns: 1fr; }
	.khc-archive__header,
	.khc-detail__top,
	.khc-detail__header,
	.khc-detail__footer { align-items: stretch; flex-direction: column; }
	.khc-count { align-self: flex-start; }
	.khc-invite { flex-direction: column; }
	.khc-invite ul { display: block; }
	.khc-invite li + li { margin-top: 7px; }
	.khc-invite .khc-button { width: 100%; }
	.khc-primary-result { align-items: flex-start; flex-direction: column; }
	.khc-detail-group dl > div { grid-template-columns: 1fr; gap: 5px; }
	.khc-output-actions,
	.khc-detail__actions { width: 100%; }
	.khc-output-actions .khc-button,
	.khc-detail__actions .khc-button,
	.khc-delete-form { flex: 1; }
	.khc-delete-form .khc-button { width: 100%; }
}


/* -------------------------------------------------------------------------
 * Hesabgah shared report design system (1.3+)
 * ---------------------------------------------------------------------- */
.khc-print-only { display: none; }

.khc-report {
	--khc-accent: var(--khc-primary, #087a55);
	--khc-accent-dark: var(--khc-primary-dark, #056344);
	--khc-accent-soft: var(--khc-primary-soft, #edfbf5);
	--khc-accent-border: var(--khc-border, #b8ddd0);
	box-sizing: border-box;
	width: 100%;
	color: #1f2937;
	background: #fff;
	font-family: Vazir, Tahoma, Arial, sans-serif;
	direction: rtl;
	text-align: right;
}
.khc-report *, .khc-report *::before, .khc-report *::after { box-sizing: border-box; }

.khc-report__header {
	padding-bottom: 13px;
	border-bottom: 3px solid var(--khc-accent);
}
.khc-report__brandbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 12px; padding: 12px 15px; border: 1px solid var(--khc-accent-border); border-radius: 10px; background: var(--khc-accent-soft); }
.khc-report__brandline { display: flex; align-items: baseline; min-width: 0; gap: 10px; color: var(--khc-accent-dark); line-height: 1.55; }
.khc-report__brand-name { flex: 0 0 auto; font-size: 18px; font-weight: 900; }
.khc-report__brand-tagline { min-width: 0; color: #365e50; font-size: 12px; font-weight: 800; }
.khc-report__contact { display: flex; align-items: center; flex: 0 0 auto; gap: 9px; color: #283d37; font-size: 13px; font-weight: 900; white-space: nowrap; }
.khc-report__contact i { color: var(--khc-accent); font-style: normal; }
.khc-report__contact a { color: #334155 !important; text-decoration: none !important; }
.khc-report__contact bdi, .khc-report__contact a { direction: ltr; unicode-bidi: isolate; }
.khc-report__titlebar { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 22px; }
.khc-report__heading { min-width: 0; }
.khc-report__brand-label { display: inline-flex; margin: 0 0 6px; padding: 3px 9px; border-radius: 999px; background: var(--khc-accent-soft); color: var(--khc-accent-dark); font-size: 10px; font-weight: 900; line-height: 1.55; }
.khc-report__heading h1,
.khc-report__heading > strong { margin: 0; color: var(--khc-accent-dark); font-size: 23px; font-weight: 900; line-height: 1.55; }
.khc-report__date { color: #64748b; font-size: 11px; text-align: left; white-space: nowrap; }
.khc-report__date strong { color: #334155; font-weight: 700; }

.khc-report__content { margin-top: 15px; }
.khc-report__summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; margin: 14px 0; }
.khc-report__summary-card { min-width: 0; padding: 12px 13px; border: 1px solid #dce5e1; border-radius: 10px; background: #fff; }
.khc-report__summary-card.is-emphasis { border-color: var(--khc-accent-border); background: var(--khc-accent-soft); }
.khc-report__summary-card span { display: block; margin-bottom: 5px; color: #64748b; font-size: 10.5px; }
.khc-report__summary-card strong { display: block; color: #253238; font-size: 17px; font-weight: 900; line-height: 1.55; overflow-wrap: anywhere; }
.khc-report__summary-card.is-emphasis strong { color: var(--khc-accent-dark); }
.khc-report__summary-card small { display: block; margin-top: 2px; color: #64748b; font-size: 9.5px; }

.khc-report__section { margin-top: 13px; overflow: hidden; border: 1px solid #dce5e1; border-radius: 10px; background: #fff; }
.khc-report__section > h2,
.khc-report__section > h3 { margin: 0; padding: 10px 13px; background: var(--khc-accent-soft); color: var(--khc-accent-dark); font-size: 14px; font-weight: 900; line-height: 1.7; }
.khc-report__section-body { padding: 12px 13px; }
.khc-report__section--compact .khc-report__section-body { padding: 8px 11px; }

.khc-report__kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; margin: 0; }
.khc-report__kv > div { display: grid; grid-template-columns: minmax(110px, .9fr) minmax(0, 1.1fr); gap: 10px; padding: 7px 0; border-bottom: 1px dashed #e5ebe8; }
.khc-report__kv dt { color: #64748b; }
.khc-report__kv dd { margin: 0; color: #253238; font-weight: 800; overflow-wrap: anywhere; }

.khc-report__table-wrap { width: 100%; overflow-x: auto; }
.khc-report__table { width: 100%; border-collapse: collapse; border-spacing: 0; color: #263238; font-size: 11px; }
.khc-report__table caption { padding: 0 0 8px; color: #475569; font-size: 11px; font-weight: 800; text-align: right; }
.khc-report__table th, .khc-report__table td { padding: 7px 8px; border: 1px solid #dce5e1; vertical-align: middle; text-align: right; }
.khc-report__table th { background: #f4f8f6; color: #334155; font-weight: 900; }
.khc-report__table tbody tr:nth-child(even) td { background: #fbfcfc; }
.khc-report__table.khc-payslip-table th:nth-child(2),
.khc-report__table.khc-payslip-table th:nth-child(4),
.khc-report__table.khc-payslip-table td:nth-child(2),
.khc-report__table.khc-payslip-table td:nth-child(4) { text-align: left; white-space: nowrap; }
.khc-report__table.khc-payslip-table tbody tr:last-child td { background: var(--khc-accent-soft); color: var(--khc-accent-dark); font-weight: 900; }

.khc-report__notice { margin-top: 12px; padding: 10px 12px; border: 1px solid #d9e3df; border-radius: 9px; background: #f8faf9; color: #475569; font-size: 10.5px; line-height: 1.9; }
.khc-report__notice--warning { border-color: #f5dc88; background: #fffbee; color: #6b5714; }
.khc-report__notice--success { border-color: var(--khc-accent-border); background: var(--khc-accent-soft); color: var(--khc-accent-dark); }

.khc-report__footer { margin-top: 15px; padding-top: 9px; border-top: 1px solid #cbd5e1; color: #64748b; font-size: 9.5px; }
.khc-report__footer-brand { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 4px 18px; }
.khc-report__footer-brand strong { color: var(--khc-accent-dark); }
.khc-report__footer-tagline { color: #475569; font-weight: 800; }
.khc-report__footer-brand span[dir="ltr"], .khc-report__footer-brand bdi { direction: ltr; unicode-bidi: isolate; }
.khc-report__footer p { margin: 5px 0 0; text-align: center; line-height: 1.75; }

/* Bring archived calculations into the same print language without changing their screen UI. */
.khc-report .khc-primary-result { border-color: var(--khc-accent-border); background: var(--khc-accent-soft); }
.khc-report .khc-primary-result strong { color: var(--khc-accent-dark); }

@media (max-width: 700px) {
	.khc-report__brandbar { gap: 10px; padding: 8px 9px; }
	.khc-report__brandline { align-items: flex-start; flex-direction: column; gap: 0; }
	.khc-report__brand-name { font-size: 14px; }
	.khc-report__brand-tagline, .khc-report__contact { font-size: 9px; }
	.khc-report__titlebar { gap: 10px; }
	.khc-report__summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.khc-report__kv { grid-template-columns: 1fr; }
}

@page {
	size: A4 portrait;
	margin: 12mm;
}

@media print {
	html, body { background: #fff !important; }
	body.khc-printing { margin: 0 !important; padding: 0 !important; }
	body.khc-printing > :not(.is-print-target) { display: none !important; }
	body.khc-printing .is-print-target {
		display: block !important;
		position: static !important;
		width: auto !important;
		max-width: none !important;
		min-height: 0 !important;
		margin: 0 !important;
		padding: 0 !important;
		border: 0 !important;
		box-shadow: none !important;
		background: #fff !important;
		color: #1f2937 !important;
		-webkit-print-color-adjust: exact;
		print-color-adjust: exact;
	}
	body.khc-printing .khc-print-only { display: block !important; }
	body.khc-printing .khc-detail__top,
	body.khc-printing .khc-detail__header,
	body.khc-printing .khc-detail__footer,
	body.khc-printing .khc-detail__actions,
	body.khc-printing .khc-output-actions,
	body.khc-printing .khc-report__screen-only { display: none !important; }

	/* Backward compatibility for calculator PDFs built against core 1.2. */
	body.khc-printing .khc-print-brand { display: flex !important; align-items: center; justify-content: flex-start; flex-wrap: wrap; gap: 3mm 7mm; margin-bottom: 5mm; padding-bottom: 3mm; border-bottom: 2px solid var(--khc-accent); direction: rtl; }
	body.khc-printing .khc-print-brand strong { margin-left: auto; color: var(--khc-accent-dark); font-size: 16pt; }
	body.khc-printing .khc-print-brand span { color: #334155; font-size: 11pt; }
	body.khc-printing .khc-print-brand-footer { display: flex !important; justify-content: center; flex-wrap: wrap; gap: 2mm 6mm; margin-top: 5mm; padding-top: 3mm; border-top: 1px solid #cbd5e1; color: #475569; font-size: 10pt; text-align: center; direction: rtl; }

	body.khc-printing .khc-report { font-size: 10pt; }
	body.khc-printing .khc-report__header { padding-bottom: 3mm; break-inside: avoid; }
	body.khc-printing .khc-report__brandbar { gap: 6mm; margin-bottom: 2.8mm; padding: 3mm 3.5mm; border-radius: 2mm; }
	body.khc-printing .khc-report__brand-name { font-size: 13pt; }
	body.khc-printing .khc-report__brand-tagline { font-size: 9.2pt; }
	body.khc-printing .khc-report__contact { font-size: 10pt; }
	body.khc-printing .khc-report__titlebar { gap: 8mm; }
	body.khc-printing .khc-report__heading h1,
.khc-report__heading > strong { font-size: 16pt; }
	body.khc-printing .khc-report__date { font-size: 8.5pt; }
	body.khc-printing .khc-report__content { margin-top: 4mm; }
	body.khc-printing .khc-report__summary { gap: 2.2mm; margin: 3.5mm 0; }
	body.khc-printing .khc-report__summary-card { padding: 3mm; border-radius: 2.5mm; break-inside: avoid; }
	body.khc-printing .khc-report__summary-card span { font-size: 8pt; }
	body.khc-printing .khc-report__summary-card strong { font-size: 12pt; }
	body.khc-printing .khc-report__summary-card small { font-size: 7.5pt; }
	body.khc-printing .khc-report__section,
	body.khc-printing .khc-detail-group,
	body.khc-printing .khc-primary-result,
	body.khc-printing .khc-report__notice { box-shadow: none !important; break-inside: avoid; }
	body.khc-printing .khc-report__section { margin-top: 3mm; border-radius: 2.5mm; }
	body.khc-printing .khc-report__section > h2,
.khc-report__section > h3 { padding: 2.2mm 3mm; font-size: 10pt; }
	body.khc-printing .khc-report__section-body { padding: 2.6mm 3mm; }
	body.khc-printing .khc-report__table-wrap { overflow: visible; }
	body.khc-printing .khc-report__table { font-size: 8.5pt; }
	body.khc-printing .khc-report__table thead { display: table-header-group; }
	body.khc-printing .khc-report__table tfoot { display: table-footer-group; }
	body.khc-printing .khc-report__table tr { break-inside: avoid; }
	body.khc-printing .khc-report__table th,
	body.khc-printing .khc-report__table td { padding: 1.8mm 2mm; }
	body.khc-printing .khc-report__footer { margin-top: 4mm; padding-top: 2.5mm; font-size: 7.5pt; break-inside: avoid; }

	/* Standardized archive details. */
	body.khc-printing .khc-detail.khc-report > .khc-primary-result { margin: 3.5mm 0; padding: 3mm 3.5mm; border-radius: 2.5mm; break-inside: avoid; }
	body.khc-printing .khc-detail.khc-report > .khc-primary-result strong { font-size: 13pt; }
	body.khc-printing .khc-detail.khc-report > .khc-detail-group { margin-top: 3mm; padding: 0; overflow: hidden; border-color: #dce5e1; border-radius: 2.5mm; }
	body.khc-printing .khc-detail.khc-report > .khc-detail-group h3 { margin: 0; padding: 2.2mm 3mm; background: var(--khc-accent-soft); color: var(--khc-accent-dark); font-size: 10pt; }
	body.khc-printing .khc-detail.khc-report > .khc-detail-group dl { padding: 1.2mm 3mm 2mm; }
	body.khc-printing .khc-detail.khc-report > .khc-detail-group dl > div { padding: 1.8mm 0; border-bottom: 1px dashed #e5ebe8; }
	body.khc-printing .khc-detail.khc-report > .khc-detail-group dt,
	body.khc-printing .khc-detail.khc-report > .khc-detail-group dd { font-size: 8.5pt; }

	a[href]::after { content: none !important; }
}

/* -------------------------------------------------------------------------
 * Public financial tools directory (1.4+)
 * ---------------------------------------------------------------------- */
.khc-tools {
	box-sizing: border-box;
	width: 100%;
	color: var(--khc-text);
	font-family: Vazir, Tahoma, sans-serif;
	direction: rtl;
	text-align: right;
}
.khc-tools *, .khc-tools *::before, .khc-tools *::after { box-sizing: border-box; }

.khc-tools__header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 28px;
	margin-bottom: 24px;
	padding: 24px 26px;
	border: 1px solid #dce8e3;
	border-radius: 18px;
	background: linear-gradient(135deg, #f3faf7 0%, #ffffff 72%);
}
.khc-tools__heading { min-width: 0; }
.khc-tools__eyebrow {
	display: block;
	margin-bottom: 7px;
	color: var(--khc-primary);
	font-size: 12px;
	font-weight: 900;
	letter-spacing: -.1px;
}
.khc-tools__header h2,
.khc-tools__resources-header h3 {
	margin: 0;
	color: #1f2937;
	font-weight: 900;
	line-height: 1.6;
}
.khc-tools__header h2 { font-size: clamp(23px, 3vw, 31px); }
.khc-tools__header p {
	max-width: 760px;
	margin: 8px 0 0;
	color: #64748b;
	font-size: 14px;
	line-height: 1.95;
}
.khc-tools__count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 36px;
	padding: 6px 12px;
	border: 1px solid #b8ddd0;
	border-radius: 999px;
	background: #fff;
	color: var(--khc-primary-dark);
	font-size: 12px;
	font-weight: 800;
	white-space: nowrap;
}

.khc-tools__grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 15px;
}
.khc-tool-card {
	--khc-tool-accent: #087a55;
	--khc-tool-accent-dark: #056344;
	--khc-tool-accent-soft: #edfbf5;
	--khc-tool-accent-border: #b8ddd0;
	position: relative;
	min-width: 0;
	overflow: hidden;
	border: 1px solid #dde7e3;
	border-radius: 15px;
	background: #fff;
	box-shadow: 0 7px 24px rgba(15, 23, 42, .035);
	transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.khc-tool-card::before {
	content: "";
	position: absolute;
	inset: 0 0 auto;
	height: 3px;
	background: var(--khc-tool-accent);
}
.khc-tool-card--linked:hover {
	transform: translateY(-3px);
	border-color: var(--khc-tool-accent-border);
	box-shadow: 0 13px 30px rgba(15, 23, 42, .07);
}
.khc-tool-card__link {
	display: flex;
	min-height: 100%;
	padding: 19px;
	color: inherit !important;
	text-decoration: none !important;
	flex-direction: column;
}
.khc-tool-card--unavailable { padding: 19px; opacity: .8; }
.khc-tool-card__link:focus-visible {
	outline: 3px solid var(--khc-tool-accent-border);
	outline-offset: -3px;
}
.khc-tool-card__top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 15px;
}
.khc-tool-card__icon {
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	border: 1px solid var(--khc-tool-accent-border);
	border-radius: 12px;
	background: var(--khc-tool-accent-soft);
	color: var(--khc-tool-accent-dark);
}
.khc-tool-card__icon .khc-icon { width: 23px; height: 23px; }
.khc-tool-card__category {
	padding: 4px 9px;
	border-radius: 999px;
	background: #f8fafc;
	color: #64748b;
	font-size: 10.5px;
	font-weight: 800;
}
.khc-tool-card h3 {
	margin: 0 0 7px;
	color: #202a31;
	font-size: 17px;
	font-weight: 900;
	line-height: 1.75;
}
.khc-tool-card p {
	margin: 0 0 17px;
	color: #64748b;
	font-size: 12.5px;
	line-height: 1.95;
}
.khc-tool-card__footer {
	display: flex;
	align-items: center;
	gap: 5px;
	margin-top: auto;
	padding-top: 13px;
	border-top: 1px solid #edf2f0;
	color: var(--khc-tool-accent-dark);
	font-size: 12px;
	font-weight: 900;
}
.khc-tool-card__footer .khc-icon { width: 15px; height: 15px; }

.khc-tools__empty {
	display: flex;
	align-items: center;
	gap: 13px;
	padding: 19px;
	border: 1px dashed #cbdad4;
	border-radius: 14px;
	background: #fafcfb;
}
.khc-tools__empty > .khc-icon { width: 30px; height: 30px; color: var(--khc-primary); }
.khc-tools__empty strong, .khc-tools__empty span { display: block; }
.khc-tools__empty strong { color: #334155; }
.khc-tools__empty span { margin-top: 3px; color: #64748b; font-size: 12px; line-height: 1.8; }

.khc-tools__resources {
	margin-top: 30px;
	padding-top: 25px;
	border-top: 1px solid #e2e8e5;
}
.khc-tools__resources-header {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 24px;
	margin-bottom: 14px;
}
.khc-tools__resources-header h3 { font-size: 20px; }
.khc-tools__resources-header > p {
	max-width: 520px;
	margin: 0;
	color: #64748b;
	font-size: 11.5px;
	line-height: 1.85;
}
.khc-tools__resource-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 13px;
}
.khc-resource-card {
	min-width: 0;
	border: 1px solid #dce6e2;
	border-radius: 14px;
	background: #fbfdfc;
	transition: border-color .18s ease, background-color .18s ease, transform .18s ease;
}
.khc-resource-card:hover { transform: translateY(-2px); border-color: #b8d9cc; background: #fff; }
.khc-resource-card__link {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	align-items: center;
	gap: 14px;
	min-height: 128px;
	padding: 17px 18px;
	color: inherit !important;
	text-decoration: none !important;
}
.khc-resource-card__link:focus-visible { outline: 3px solid rgba(8,122,85,.2); outline-offset: 2px; }
.khc-resource-card__icon {
	display: grid;
	place-items: center;
	width: 47px;
	height: 47px;
	border-radius: 13px;
	background: var(--khc-primary-soft);
	color: var(--khc-primary-dark);
}
.khc-resource-card__type { display: block; margin-bottom: 3px; color: var(--khc-primary); font-size: 10px; font-weight: 900; }
.khc-resource-card h4 { margin: 0; color: #263238; font-size: 15px; font-weight: 900; line-height: 1.7; }
.khc-resource-card p { margin: 4px 0 0; color: #64748b; font-size: 11.5px; line-height: 1.85; }
.khc-resource-card__action { display: inline-flex; align-items: center; gap: 4px; color: var(--khc-primary-dark); font-size: 11.5px; font-weight: 900; white-space: nowrap; }
.khc-resource-card__action .khc-icon { width: 15px; height: 15px; }

@media (max-width: 980px) {
	.khc-tools__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.khc-tools__resources-header { align-items: flex-start; flex-direction: column; gap: 6px; }
}
@media (max-width: 640px) {
	.khc-tools__header { padding: 19px; flex-direction: column; gap: 14px; }
	.khc-tools__count { align-self: flex-start; }
	.khc-tools__grid,
	.khc-tools__resource-grid { grid-template-columns: 1fr; }
	.khc-tool-card__link, .khc-tool-card--unavailable { padding: 17px; }
	.khc-resource-card__link { grid-template-columns: auto minmax(0, 1fr); min-height: 0; }
	.khc-resource-card__action { grid-column: 2; }
}

/* -------------------------------------------------------------------------
 * Configurable homepage calculator showcase (1.6+)
 * ---------------------------------------------------------------------- */
.khc-home-tools {
	position: relative;
	isolation: isolate;
	box-sizing: border-box;
	width: 100%;
	padding: clamp(20px, 3.2vw, 38px);
	overflow: hidden;
	border: 1px solid #d9e7e1;
	border-radius: 26px;
	background:
		radial-gradient(circle at 8% 8%, rgba(8,122,85,.10), transparent 30%),
		linear-gradient(145deg, #f4faf7 0%, #ffffff 55%, #f8fbfa 100%);
	color: var(--khc-text);
	font-family: Vazir, Tahoma, sans-serif;
	direction: rtl;
	text-align: right;
}
.khc-home-tools::before {
	content: "";
	position: absolute;
	z-index: -1;
	inset: auto auto -100px -80px;
	width: 240px;
	height: 240px;
	border: 40px solid rgba(8,122,85,.035);
	border-radius: 50%;
}
.khc-home-tools *, .khc-home-tools *::before, .khc-home-tools *::after { box-sizing: border-box; }
.khc-home-tools__header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 28px;
	margin-bottom: 24px;
}
.khc-home-tools__heading { min-width: 0; }
.khc-home-tools__eyebrow {
	display: block;
	margin-bottom: 6px;
	color: var(--khc-primary);
	font-size: 12px;
	font-weight: 900;
}
.khc-home-tools__header h2 {
	margin: 0;
	color: #1f2937;
	font-size: clamp(23px, 3vw, 32px);
	font-weight: 900;
	line-height: 1.55;
}
.khc-home-tools__header p {
	max-width: 760px;
	margin: 7px 0 0;
	color: #64748b;
	font-size: 14px;
	line-height: 1.95;
}
.khc-home-tools__badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 36px;
	padding: 6px 12px;
	border: 1px solid #b8ddd0;
	border-radius: 999px;
	background: rgba(255,255,255,.9);
	color: var(--khc-primary-dark);
	font-size: 11.5px;
	font-weight: 900;
	white-space: nowrap;
}
.khc-home-tools__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
	gap: 14px;
}
.khc-home-tool {
	--khc-tool-accent: #087a55;
	--khc-tool-accent-dark: #056344;
	--khc-tool-accent-soft: #edfbf5;
	--khc-tool-accent-border: #b8ddd0;
	position: relative;
	min-width: 0;
	overflow: hidden;
	border: 1px solid #dfe8e4;
	border-radius: 18px;
	background: rgba(255,255,255,.94);
	box-shadow: 0 7px 22px rgba(15,23,42,.045);
	transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.khc-home-tool::before {
	content: "";
	position: absolute;
	inset: 0 0 auto;
	height: 4px;
	background: var(--khc-tool-accent);
}
.khc-home-tool:hover {
	transform: translateY(-4px);
	border-color: var(--khc-tool-accent-border);
	box-shadow: 0 14px 30px rgba(15,23,42,.09);
}
.khc-home-tool__link {
	display: flex;
	min-height: 235px;
	height: 100%;
	padding: 20px 18px 17px;
	color: inherit !important;
	text-decoration: none !important;
	flex-direction: column;
}
.khc-home-tool__link:focus-visible {
	outline: 3px solid var(--khc-tool-accent-border);
	outline-offset: -4px;
}
.khc-home-tool__top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-bottom: 15px;
}
.khc-home-tool__icon {
	display: grid;
	place-items: center;
	width: 48px;
	height: 48px;
	border: 1px solid var(--khc-tool-accent-border);
	border-radius: 14px;
	background: var(--khc-tool-accent-soft);
	color: var(--khc-tool-accent-dark);
}
.khc-home-tool__icon .khc-icon { width: 24px; height: 24px; }
.khc-home-tool__category {
	max-width: 125px;
	overflow: hidden;
	color: var(--khc-tool-accent-dark);
	font-size: 10px;
	font-weight: 900;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.khc-home-tool h3 {
	margin: 0;
	color: #1f2937;
	font-size: 16px;
	font-weight: 900;
	line-height: 1.75;
}
.khc-home-tool p {
	display: -webkit-box;
	margin: 7px 0 14px;
	overflow: hidden;
	color: #64748b;
	font-size: 11.5px;
	line-height: 1.9;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
}
.khc-home-tool__action {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	margin-top: auto;
	padding-top: 13px;
	border-top: 1px solid #edf2f0;
	color: var(--khc-tool-accent-dark);
	font-size: 12px;
	font-weight: 900;
}
.khc-home-tool__action .khc-icon { width: 15px; height: 15px; }
.khc-home-tools__footer { display: flex; justify-content: center; margin-top: 22px; }
.khc-home-tools__all {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	min-height: 46px;
	padding: 9px 19px;
	border: 1px solid var(--khc-primary);
	border-radius: 12px;
	background: var(--khc-primary);
	color: #fff !important;
	font-size: 13px;
	font-weight: 900;
	text-decoration: none !important;
	transition: transform .18s ease, background-color .18s ease, box-shadow .18s ease;
}
.khc-home-tools__all:hover { transform: translateY(-2px); background: var(--khc-primary-dark); box-shadow: 0 8px 20px rgba(5,99,68,.18); }
.khc-home-tools__all:focus-visible { outline: 3px solid rgba(8,122,85,.24); outline-offset: 3px; }
.khc-home-tools__all .khc-icon { width: 16px; height: 16px; }

@media (max-width: 700px) {
	.khc-home-tools { padding: 20px 16px; border-radius: 20px; }
	.khc-home-tools__header { flex-direction: column; gap: 12px; margin-bottom: 18px; }
	.khc-home-tools__badge { align-self: flex-start; }
	.khc-home-tools__grid { grid-template-columns: 1fr; }
	.khc-home-tool__link { min-height: 0; padding: 18px 16px 15px; }
	.khc-home-tools__all { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
	.khc-tool-card,
	.khc-resource-card,
	.khc-home-tool,
	.khc-home-tools__all { transition: none; }
}
