.ham-calculator {
	--ham-accent: #1d4ed8;
	--ham-accent-dark: #1e3a8a;
	--ham-accent-soft: #eff6ff;
	--ham-ink: #172033;
	--ham-muted: #64748b;
	--ham-border: #dbe3ef;
	font-family: Vazirmatn, IRANSans, Tahoma, sans-serif;
	max-width: 1180px;
	margin: 28px auto;
	color: var(--ham-ink);
	line-height: 1.75;
}

.ham-calculator *, .ham-calculator *::before, .ham-calculator *::after { box-sizing: border-box; }
.ham-calculator button, .ham-calculator input, .ham-calculator select { font: inherit; }
.ham-calculator [hidden] { display: none !important; }

.ham-hero {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 24px;
	padding: clamp(25px, 4vw, 45px);
	border-radius: 28px;
	background: radial-gradient(circle at 12% 12%, rgba(255,255,255,.12), transparent 30%), linear-gradient(135deg, #172554, #1d4ed8 62%, #3b82f6);
	color: #fff;
	box-shadow: 0 22px 58px rgba(30, 58, 138, .2);
	overflow: hidden;
}

.ham-eyebrow { display: inline-flex; padding: 4px 12px; border-radius: 999px; border: 1px solid rgba(255,255,255,.3); background: rgba(255,255,255,.09); font-size: 13px; }
.ham-hero h2 { margin: 11px 0 5px; color: #fff; font-size: clamp(24px, 3.3vw, 38px); line-height: 1.45; }
.ham-hero p { margin: 0; color: rgba(255,255,255,.84); max-width: 710px; }
.ham-hero-mark { flex: 0 0 105px; width: 105px; height: 105px; display: grid; place-content: center; text-align: center; border-radius: 29px; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.12); transform: rotate(-3deg); }
.ham-hero-mark span { font-size: 32px; font-weight: 900; line-height: 1.2; }
.ham-hero-mark small { font-size: 12px; letter-spacing: 3px; opacity: .75; }

.ham-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(330px, .78fr); gap: 22px; align-items: start; margin-top: 22px; }
.ham-form { display: grid; gap: 16px; }
.ham-card, .ham-result { border: 1px solid var(--ham-border); border-radius: 22px; background: #fff; box-shadow: 0 9px 28px rgba(15,23,42,.05); }
.ham-card { padding: clamp(18px, 2.5vw, 28px); }
.ham-section-title { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 20px; }
.ham-section-title > span { flex: 0 0 34px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; background: var(--ham-accent-soft); color: var(--ham-accent); font-weight: 900; }
.ham-section-title h3 { margin: 0; color: var(--ham-ink); font-size: 18px; }
.ham-section-title p { margin: 1px 0 0; color: var(--ham-muted); font-size: 13px; }

.ham-grid { display: grid; gap: 16px; }
.ham-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ham-grid-3 { grid-template-columns: 1fr 1.2fr .65fr; }
.ham-field { display: grid; gap: 7px; min-width: 0; color: var(--ham-ink); font-size: 14px; font-weight: 700; }
.ham-field small { color: var(--ham-muted); font-size: 12px; font-weight: 400; }
.ham-field > input, .ham-field > select, .ham-money, .ham-suffix { width: 100%; min-height: 48px; border: 1px solid #cbd5e1; border-radius: 12px; background: #fff; outline: none; transition: border-color .18s, box-shadow .18s; }
.ham-field > input, .ham-field > select { padding: 10px 13px; color: var(--ham-ink); }
.ham-field > input:focus, .ham-field > select:focus, .ham-money:focus-within, .ham-suffix:focus-within { border-color: var(--ham-accent); box-shadow: 0 0 0 3px rgba(29,78,216,.12); }
.ham-money, .ham-suffix { display: flex; align-items: center; overflow: hidden; }
.ham-money input, .ham-suffix input { width: 100%; min-width: 0; min-height: 46px; padding: 10px 13px; border: 0; outline: 0; box-shadow: none !important; color: var(--ham-ink); background: transparent; }
.ham-money b, .ham-suffix b { flex: 0 0 auto; padding: 0 12px; color: var(--ham-muted); font-size: 12px; }

.ham-methods { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 20px 0 0; padding: 0; border: 0; }
.ham-methods legend { float: none; width: 100%; margin: 0 0 8px; padding: 0; color: var(--ham-muted); font-size: 13px; font-weight: 700; }
.ham-methods label { position: relative; cursor: pointer; }
.ham-methods input { position: absolute; opacity: 0; pointer-events: none; }
.ham-methods label > span { min-height: 82px; display: grid; align-content: center; gap: 2px; padding: 13px 15px; border: 1px solid var(--ham-border); border-radius: 14px; transition: border-color .18s, background .18s, box-shadow .18s; }
.ham-methods label b { color: var(--ham-ink); font-size: 14px; }
.ham-methods label small { color: var(--ham-muted); font-size: 12px; }
.ham-methods input:checked + span { border-color: #93c5fd; background: var(--ham-accent-soft); box-shadow: inset 0 0 0 1px #93c5fd; }

.ham-info, .ham-warning-soft { padding: 11px 14px; margin-top: 16px; border-radius: 12px; font-size: 12px; }
.ham-info { background: #f8fafc; border: 1px solid #e2e8f0; color: #475569; }
.ham-warning-soft { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.ham-details { padding: 0; overflow: hidden; }
.ham-details summary { list-style: none; display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; cursor: pointer; }
.ham-details summary::-webkit-details-marker { display: none; }
.ham-details summary::after { content: "+"; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: var(--ham-accent-soft); color: var(--ham-accent); font-size: 20px; }
.ham-details[open] summary::after { content: "−"; }
.ham-details summary > span { display: grid; }
.ham-details summary small { color: var(--ham-muted); font-size: 12px; }
.ham-checks { display: grid; gap: 2px; padding: 14px 18px 20px; border-top: 1px solid var(--ham-border); }
.ham-checks label { display: flex; gap: 10px; align-items: flex-start; padding: 9px 8px; border-radius: 10px; cursor: pointer; font-size: 13px; }
.ham-checks label:hover { background: #f8fafc; }
.ham-checks input { flex: 0 0 auto; width: 18px; height: 18px; margin-top: 3px; accent-color: var(--ham-accent); }

.ham-form-actions, .ham-result-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.ham-form-actions { padding: 4px; }
.ham-button { appearance: none; min-height: 46px; padding: 9px 18px; border: 1px solid transparent; border-radius: 12px; cursor: pointer; font-weight: 800; transition: transform .15s, background .15s; }
.ham-button:hover { transform: translateY(-1px); }
.ham-button:disabled { opacity: .55; cursor: wait; transform: none; }
.ham-button-primary { background: var(--ham-accent); color: #fff; box-shadow: 0 9px 20px rgba(29,78,216,.17); }
.ham-button-primary:hover { background: var(--ham-accent-dark); }
.ham-button-secondary { background: var(--ham-accent-soft); color: var(--ham-accent-dark); border-color: #bfdbfe; }
.ham-button-ghost { background: #fff; color: #475569; border-color: #d6deea; }

.ham-result { position: sticky; top: 24px; min-height: 360px; overflow: hidden; }
.ham-result-empty { min-height: 358px; display: grid; place-content: center; text-align: center; padding: 28px; }
.ham-result-empty > div { width: 62px; height: 62px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: 20px; background: var(--ham-accent-soft); color: var(--ham-accent); font-size: 34px; }
.ham-result-empty h3 { margin: 0 0 4px; font-size: 17px; }
.ham-result-empty p { margin: 0; color: var(--ham-muted); font-size: 13px; }
.ham-result-content { padding: 26px; border-top: 5px solid var(--ham-accent); }
.ham-result-label { display: block; color: var(--ham-muted); font-size: 13px; }
.ham-result-value { display: flex; gap: 7px; align-items: baseline; padding-bottom: 18px; border-bottom: 1px solid var(--ham-border); }
.ham-result-value strong { color: var(--ham-accent-dark); font-size: clamp(27px, 4vw, 39px); line-height: 1.45; letter-spacing: -.5px; }
.ham-result-value span { color: var(--ham-muted); font-size: 13px; }
.ham-result-rows { display: grid; gap: 9px; padding: 17px 0; }
.ham-result-rows > div, .ham-breakdown-list > div { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; font-size: 12px; }
.ham-result-rows span, .ham-breakdown-list span { color: var(--ham-muted); }
.ham-result-rows b, .ham-breakdown-list b { text-align: left; }
.ham-breakdown, .ham-qualitative, .ham-warnings { padding: 13px 15px; margin-bottom: 12px; border-radius: 13px; font-size: 12px; }
.ham-breakdown { background: #f8fafc; border: 1px solid #e2e8f0; }
.ham-breakdown h4, .ham-qualitative h4 { margin: 0 0 6px; font-size: 13px; }
.ham-breakdown-list { display: grid; gap: 4px; }
.ham-qualitative { background: #eefdf5; border: 1px solid #bbf7d0; color: #166534; }
.ham-qualitative ul { margin: 0; padding-right: 17px; }
.ham-warnings { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.ham-warnings p { margin: 0 0 5px; }
.ham-warnings p:last-child { margin-bottom: 0; }
.ham-result-actions .ham-button { flex: 1 1 auto; padding-inline: 11px; font-size: 12px; }
.ham-status { min-height: 22px; margin-top: 9px; color: var(--ham-accent-dark); font-size: 12px; }
.ham-disclaimer { margin: 16px 4px 0; color: var(--ham-muted); font-size: 12px; text-align: center; }
.ham-dependency-error { padding: 15px 18px; border: 1px solid #fecaca; border-radius: 12px; background: #fef2f2; color: #991b1b; }

@media (max-width: 860px) {
	.ham-layout { grid-template-columns: 1fr; }
	.ham-result { position: static; min-height: 0; }
	.ham-result-empty { min-height: 230px; }
	.ham-grid-3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 580px) {
	.ham-calculator { margin: 16px auto; }
	.ham-hero { border-radius: 20px; }
	.ham-hero-mark { display: none; }
	.ham-grid-2, .ham-grid-3, .ham-methods { grid-template-columns: 1fr; }
	.ham-card { border-radius: 17px; }
	.ham-form-actions .ham-button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
	.ham-calculator *, .ham-calculator *::before, .ham-calculator *::after { scroll-behavior: auto !important; transition: none !important; }
}

