/*!
 * iKral FX Calculator v1.1.0 — styles (no external resources; Vazirmatn bundled under SIL OFL 1.1)
 */

/* ---------- Font (local files) ---------- */
@font-face { font-family: 'IKFC Vazirmatn'; src: url('../fonts/Vazirmatn-Light.woff2') format('woff2'); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: 'IKFC Vazirmatn'; src: url('../fonts/Vazirmatn-Regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'IKFC Vazirmatn'; src: url('../fonts/Vazirmatn-Medium.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'IKFC Vazirmatn'; src: url('../fonts/Vazirmatn-SemiBold.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'IKFC Vazirmatn'; src: url('../fonts/Vazirmatn-Bold.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'IKFC Vazirmatn'; src: url('../fonts/Vazirmatn-ExtraBold.woff2') format('woff2'); font-weight: 800; font-style: normal; font-display: swap; }

/* ---------- Tokens ---------- */
.ikfc {
	--ikfc-accent: #f68420;
	--ikfc-accent-2: #ffb04d;
	--ikfc-radius: 18px;
	--ikfc-max: 1120px;

	/* Accent shades that keep white text / accent text at WCAG AA contrast */
	--ikfc-accent-strong: color-mix(in srgb, var(--ikfc-accent) 72%, #000);
	--ikfc-accent-deep: color-mix(in srgb, var(--ikfc-accent) 64%, #000);
	--ikfc-accent-text: color-mix(in srgb, var(--ikfc-accent) 70%, #000);

	--ikfc-bg: #ffffff;
	--ikfc-surface: #f6f7f9;
	--ikfc-surface-2: #eef0f4;
	--ikfc-border: #e3e6ec;
	--ikfc-border-strong: #c9cfd9;
	--ikfc-text: #0f172a;
	--ikfc-text-2: #334155;
	--ikfc-muted: #5b6678;
	--ikfc-pos: #0a7d45;
	--ikfc-neg: #c9353b;
	--ikfc-pos-solid: #0a7d45;
	--ikfc-neg-solid: #c4323a;
	--ikfc-pos-bg: rgba(10, 125, 69, .1);
	--ikfc-neg-bg: rgba(201, 53, 59, .1);
	--ikfc-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 12px 32px -12px rgba(15, 23, 42, .14);
	--ikfc-soft: color-mix(in srgb, var(--ikfc-accent) 11%, transparent);
	--ikfc-ring: color-mix(in srgb, var(--ikfc-accent) 40%, transparent);
	--ikfc-font: 'IKFC Vazirmatn', Tahoma, 'Segoe UI', sans-serif;
	--ikfc-r-sm: calc(var(--ikfc-radius) * .62);
}
.ikfc[data-theme="dark"] {
	--ikfc-bg: #0d121c;
	--ikfc-surface: #141b27;
	--ikfc-surface-2: #1b2433;
	--ikfc-border: #232e40;
	--ikfc-border-strong: #34445e;
	--ikfc-text: #e8ecf3;
	--ikfc-text-2: #c3cbd8;
	--ikfc-muted: #93a0b4;
	--ikfc-pos: #3ddc86;
	--ikfc-neg: #ff7b80;
	--ikfc-pos-bg: rgba(61, 220, 134, .12);
	--ikfc-neg-bg: rgba(255, 123, 128, .12);
	--ikfc-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 18px 40px -16px rgba(0, 0, 0, .6);
	--ikfc-soft: color-mix(in srgb, var(--ikfc-accent) 16%, transparent);
	--ikfc-accent-text: color-mix(in srgb, var(--ikfc-accent) 80%, #fff);
}
@media (prefers-color-scheme: dark) {
	.ikfc[data-theme="auto"] {
		--ikfc-bg: #0d121c;
		--ikfc-surface: #141b27;
		--ikfc-surface-2: #1b2433;
		--ikfc-border: #232e40;
		--ikfc-border-strong: #34445e;
		--ikfc-text: #e8ecf3;
		--ikfc-text-2: #c3cbd8;
		--ikfc-muted: #93a0b4;
		--ikfc-pos: #3ddc86;
		--ikfc-neg: #ff7b80;
		--ikfc-pos-bg: rgba(61, 220, 134, .12);
		--ikfc-neg-bg: rgba(255, 123, 128, .12);
		--ikfc-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 18px 40px -16px rgba(0, 0, 0, .6);
		--ikfc-soft: color-mix(in srgb, var(--ikfc-accent) 16%, transparent);
		--ikfc-accent-text: color-mix(in srgb, var(--ikfc-accent) 80%, #fff);
	}
}
.ikfc.ikfc-font-inherit { --ikfc-font: inherit; }

/* ---------- Scoped reset (protects against theme styles) ---------- */
.ikfc, .ikfc *, .ikfc *::before, .ikfc *::after { box-sizing: border-box; }
.ikfc {
	direction: rtl;
	text-align: right;
	font-family: var(--ikfc-font);
	font-size: 15px;
	line-height: 1.6;
	color: var(--ikfc-text);
	width: 100%;
	max-width: var(--ikfc-max);
	margin: 0 auto 1.5em;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}
.ikfc h2, .ikfc h3, .ikfc p, .ikfc dl, .ikfc dt, .ikfc dd, .ikfc ul, .ikfc li, .ikfc table, .ikfc form, .ikfc header, .ikfc footer, .ikfc nav, .ikfc aside, .ikfc details, .ikfc summary, .ikfc section {
	margin: 0; padding: 0; border: 0; background: none; font-family: inherit; letter-spacing: normal; text-transform: none; list-style: none;
}
.ikfc button, .ikfc input, .ikfc select {
	font-family: inherit; font-size: inherit; line-height: normal; letter-spacing: normal; text-transform: none;
	margin: 0; min-height: 0; min-width: 0; width: auto; box-shadow: none; text-shadow: none; outline: none;
	-webkit-appearance: none; -moz-appearance: none; appearance: none;
}
.ikfc button { cursor: pointer; background: none; border: 0; padding: 0; color: inherit; border-radius: 0; text-decoration: none; }
.ikfc button:disabled { cursor: not-allowed; opacity: .45; }
.ikfc a { color: var(--ikfc-accent-text); text-decoration: none; }
.ikfc a:hover { text-decoration: underline; }
.ikfc svg { display: inline-block; vertical-align: middle; flex: none; max-width: none; }
.ikfc .ikfc-ic { width: auto; height: auto; }
.ikfc :focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ikfc-ring); }
.ikfc summary { outline: none; }
.ikfc summary:focus-visible { box-shadow: inset 0 0 0 2px var(--ikfc-ring); border-radius: inherit; }
.ikfc .ikfc-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* ---------- Card ---------- */
.ikfc-card {
	container-type: inline-size;
	container-name: ikfc;
	background: var(--ikfc-bg);
	border: 1px solid var(--ikfc-border);
	border-radius: var(--ikfc-radius);
	box-shadow: var(--ikfc-shadow);
	overflow: hidden;
	position: relative;
}
.ikfc-no-shadow .ikfc-card { box-shadow: none; }
.ikfc-card::before {
	content: "";
	position: absolute; inset: 0 0 auto 0; height: 4px; z-index: 1;
	background: linear-gradient(90deg, var(--ikfc-accent-2), var(--ikfc-accent));
}

/* ---------- Header ---------- */
.ikfc .ikfc-head {
	display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
	padding: 26px 28px 18px;
	background: radial-gradient(120% 140% at 100% 0%, var(--ikfc-soft), transparent 60%), var(--ikfc-bg);
}
.ikfc .ikfc-title { font-size: 1.55em; font-weight: 800; line-height: 1.35; color: var(--ikfc-text); }
.ikfc .ikfc-sub { margin-top: 4px; color: var(--ikfc-muted); font-size: .95em; }
.ikfc-stamp {
	display: inline-flex; align-items: center; gap: 6px;
	padding: 6px 12px; border-radius: 999px;
	background: var(--ikfc-surface); border: 1px solid var(--ikfc-border);
	color: var(--ikfc-muted); font-size: .8em; white-space: nowrap;
}

/* ---------- Ticker ---------- */
.ikfc-ticker {
	display: flex; gap: 8px; overflow-x: auto; padding: 4px 28px 16px;
	scrollbar-width: thin; scroll-snap-type: x proximity;
}
.ikfc-ticker::-webkit-scrollbar { height: 4px; }
.ikfc-ticker::-webkit-scrollbar-thumb { background: var(--ikfc-border-strong); border-radius: 4px; }
/* Edge fade only on the side(s) where content is hidden (set by JS) */
.ikfc .ikfc-fade {
	--ikfc-fs: 0px; --ikfc-fe: 0px;
	-webkit-mask-image: linear-gradient(to left, transparent 0, #000 var(--ikfc-fs), #000 calc(100% - var(--ikfc-fe)), transparent 100%);
	mask-image: linear-gradient(to left, transparent 0, #000 var(--ikfc-fs), #000 calc(100% - var(--ikfc-fe)), transparent 100%);
}
.ikfc .ikfc-fade.has-start { --ikfc-fs: 40px; }
.ikfc .ikfc-fade.has-end { --ikfc-fe: 40px; }
.ikfc .ikfc-chip {
	scroll-snap-align: start;
	display: grid; grid-template-columns: auto auto; grid-template-rows: auto auto; column-gap: 12px; row-gap: 0;
	align-items: center; text-align: right;
	flex: none; padding: 8px 14px; min-width: 132px; height: auto;
	background: var(--ikfc-surface); border: 1px solid var(--ikfc-border); border-radius: var(--ikfc-r-sm);
	color: var(--ikfc-text); transition: border-color .2s, background .2s, transform .2s, opacity .2s;
}
.ikfc .ikfc-chip:hover { border-color: var(--ikfc-border-strong); transform: translateY(-1px); }
.ikfc .ikfc-chip.is-active { border-color: var(--ikfc-accent); background: var(--ikfc-soft); }
.ikfc .ikfc-chip.is-muted { opacity: .55; }
.ikfc-chip-code { grid-column: 1; grid-row: 1; font-weight: 800; font-size: .86em; letter-spacing: .02em; text-align: right; }
.ikfc-chip-name { grid-column: 1; grid-row: 2; font-size: .74em; color: var(--ikfc-muted); white-space: nowrap; }
.ikfc-chip-price { grid-column: 2; grid-row: 1 / span 2; justify-self: end; font-weight: 700; font-size: .92em; color: var(--ikfc-text-2); white-space: nowrap; }
.ikfc .ikfc-chip.is-active .ikfc-chip-price { color: var(--ikfc-accent-text); }

/* ---------- Tool navigation: tabs (wide) / select (narrow) ---------- */
.ikfc .ikfc-tabs {
	display: flex; gap: 6px; overflow-x: auto;
	padding: 10px 28px; border-top: 1px solid var(--ikfc-border); border-bottom: 1px solid var(--ikfc-border);
	background: var(--ikfc-surface);
	scrollbar-width: none;
}
.ikfc .ikfc-tabs::-webkit-scrollbar { display: none; }
.ikfc .ikfc-tab {
	display: inline-flex; align-items: center; gap: 7px; flex: none;
	padding: 9px 14px; border-radius: 999px;
	color: var(--ikfc-text-2); font-weight: 600; font-size: .9em; white-space: nowrap;
	border: 1px solid transparent; transition: color .2s, background .2s, border-color .2s;
}
.ikfc .ikfc-tab span { overflow: hidden; text-overflow: ellipsis; }
.ikfc .ikfc-tab:hover { color: var(--ikfc-text); background: var(--ikfc-bg); }
.ikfc .ikfc-tab.is-active {
	color: #fff; background: linear-gradient(135deg, var(--ikfc-accent-strong), var(--ikfc-accent-deep));
	box-shadow: 0 6px 16px -8px var(--ikfc-accent);
}
@container ikfc (min-width: 1000px) {
	.ikfc .ikfc-tabs { display: grid; grid-template-columns: repeat(var(--ikfc-tabcols, 6), minmax(0, 1fr)); overflow: visible; -webkit-mask-image: none; mask-image: none; }
	.ikfc .ikfc-tab { justify-content: center; min-width: 0; }
}

.ikfc .ikfc-picker { display: none; padding: 12px 18px; border-top: 1px solid var(--ikfc-border); border-bottom: 1px solid var(--ikfc-border); background: var(--ikfc-surface); }
.ikfc .ikfc-picker .ikfc-label { display: block; margin-bottom: 6px; }
.ikfc .ikfc-select-tool { font-weight: 700; }
.ikfc.ikfc-layout-compact .ikfc-tabs { display: none; }
.ikfc.ikfc-layout-compact .ikfc-picker { display: block; }
@container ikfc (max-width: 559px) {
	.ikfc.ikfc-layout-auto .ikfc-tabs { display: none; }
	.ikfc.ikfc-layout-auto .ikfc-picker { display: block; }
}

/* ---------- Body ---------- */
.ikfc-body { display: grid; grid-template-columns: 1fr; gap: 22px; padding: 24px 28px 28px; align-items: start; }
@container ikfc (min-width: 760px) {
	.ikfc-body { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 28px; }
	.ikfc .ikfc-result { position: sticky; top: 16px; }
}
.ikfc-body.ikfc-anim .ikfc-form, .ikfc-body.ikfc-anim .ikfc-result { animation: ikfc-in .32s cubic-bezier(.2, .7, .2, 1) both; }
.ikfc-body.ikfc-anim .ikfc-result { animation-delay: .05s; }
@keyframes ikfc-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Form ---------- */
.ikfc-grid { display: grid; grid-template-columns: 1fr; gap: 14px 16px; }
@container ikfc (min-width: 440px) {
	.ikfc-grid { grid-template-columns: 1fr 1fr; }
	.ikfc-full { grid-column: 1 / -1; }
}
.ikfc-ctx > .ikfc-field:only-child { grid-column: 1 / -1; }
.ikfc-ctx > .ikfc-field:nth-child(3):last-child { grid-column: 1 / -1; }
.ikfc-ctx { padding-bottom: 14px; margin-bottom: 4px; border-bottom: 1px dashed var(--ikfc-border); }
.ikfc-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; position: relative; }
.ikfc-labelrow { display: flex; align-items: center; gap: 6px; min-height: 22px; }
.ikfc .ikfc-label { font-size: .84em; font-weight: 600; color: var(--ikfc-text-2); }
.ikfc-hint { font-size: .74em; color: var(--ikfc-muted); line-height: 1.5; }

.ikfc-inwrap, .ikfc-selwrap { position: relative; display: block; }
.ikfc .ikfc-input, .ikfc .ikfc-select {
	display: block; width: 100%; height: 46px;
	padding: 0 14px; border-radius: var(--ikfc-r-sm);
	background: var(--ikfc-surface); color: var(--ikfc-text);
	border: 1px solid var(--ikfc-border);
	font-size: 1em; font-weight: 600;
	transition: border-color .2s, box-shadow .2s, background .2s;
}
.ikfc .ikfc-input { text-align: right; padding-left: 64px; }
.ikfc .ikfc-input::placeholder { color: var(--ikfc-muted); opacity: .8; }
.ikfc .ikfc-select { padding-left: 38px; cursor: pointer; font-weight: 500; direction: rtl; text-align: right; }
.ikfc .ikfc-select option, .ikfc .ikfc-select optgroup { background: var(--ikfc-bg); color: var(--ikfc-text); }
.ikfc-selwrap::after {
	content: ""; position: absolute; left: 15px; top: 50%; width: 8px; height: 8px; margin-top: -6px;
	border-left: 2px solid var(--ikfc-muted); border-bottom: 2px solid var(--ikfc-muted);
	transform: rotate(-45deg); pointer-events: none;
}
.ikfc .ikfc-input:hover, .ikfc .ikfc-select:hover { border-color: var(--ikfc-border-strong); }
.ikfc .ikfc-input:focus, .ikfc .ikfc-select:focus {
	border-color: var(--ikfc-accent); background: var(--ikfc-bg); box-shadow: 0 0 0 3px var(--ikfc-ring);
}
.ikfc .ikfc-select-sym { font-weight: 700; }
.ikfc-suffix {
	position: absolute; left: 6px; top: 6px; bottom: 6px;
	display: inline-flex; align-items: center; justify-content: center;
	min-width: 48px; padding: 0 9px; border-radius: calc(var(--ikfc-r-sm) - 4px);
	background: var(--ikfc-surface-2); color: var(--ikfc-muted);
	font-size: .78em; font-weight: 700; pointer-events: none; white-space: nowrap;
}

.ikfc-specs {
	display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 2px 0 14px;
	font-size: .78em; color: var(--ikfc-muted);
}
.ikfc-specs span { display: inline-flex; gap: 4px; align-items: center; }
.ikfc-specs b { color: var(--ikfc-text-2); font-weight: 700; }
.ikfc .ikfc-specs-link { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; }

/* Glossary "?" tips */
.ikfc .ikfc-tip {
	position: relative; display: inline-flex; align-items: center; justify-content: center; flex: none;
	width: 18px; height: 18px; border-radius: 50%;
	font-size: 11px; font-weight: 800; line-height: 1;
	color: var(--ikfc-accent-text); background: var(--ikfc-soft); border: 1px solid color-mix(in srgb, var(--ikfc-accent) 35%, transparent);
	transition: background .2s, color .2s;
}
.ikfc .ikfc-tip:hover, .ikfc .ikfc-tip[aria-expanded="true"] { background: var(--ikfc-accent-strong); color: #fff; border-color: transparent; }
.ikfc .ikfc-tip::before { content: ""; position: absolute; inset: -12px; } /* 42px touch target */
.ikfc .ikfc-pop {
	position: absolute; z-index: 20; padding: 14px 16px; border-radius: var(--ikfc-r-sm);
	background: var(--ikfc-bg); color: var(--ikfc-text); border: 1px solid var(--ikfc-border);
	box-shadow: 0 18px 40px -14px rgba(15, 23, 42, .35); font-size: .86em; line-height: 1.8;
	animation: ikfc-in .18s ease both;
}
.ikfc .ikfc-pop[hidden] { display: none; }
.ikfc .ikfc-pop-title { display: block; margin-bottom: 4px; font-weight: 800; color: var(--ikfc-accent-text); }
.ikfc .ikfc-pop p { color: var(--ikfc-text-2); }
.ikfc .ikfc-pop a { display: inline-block; margin-top: 6px; font-weight: 700; }

/* Segmented control */
.ikfc-seg {
	display: grid; grid-auto-columns: 1fr; grid-auto-flow: column; gap: 4px; padding: 4px;
	background: var(--ikfc-surface); border: 1px solid var(--ikfc-border); border-radius: var(--ikfc-r-sm);
}
.ikfc .ikfc-seg-btn {
	height: 36px; padding: 0 6px; border-radius: calc(var(--ikfc-r-sm) - 4px);
	font-weight: 700; font-size: .9em; color: var(--ikfc-text-2);
	transition: background .2s, color .2s, box-shadow .2s;
}
.ikfc .ikfc-seg-btn:hover { color: var(--ikfc-text); }
.ikfc .ikfc-seg-btn.is-on { background: var(--ikfc-bg); color: var(--ikfc-accent-text); box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 0 0 1px var(--ikfc-border); }
.ikfc .ikfc-seg-btn.ikfc-seg-buy.is-on { background: var(--ikfc-pos-solid); color: #fff; box-shadow: none; }
.ikfc .ikfc-seg-btn.ikfc-seg-sell.is-on { background: var(--ikfc-neg-solid); color: #fff; box-shadow: none; }

/* Entries (average price tool) */
.ikfc-entries { display: flex; flex-direction: column; gap: 8px; }
.ikfc-entry { display: grid; grid-template-columns: 28px minmax(0, 1.4fr) minmax(0, 1fr) 40px; gap: 8px; align-items: center; }
.ikfc-entry-head { font-size: .76em; color: var(--ikfc-muted); font-weight: 600; }
.ikfc-entry-n { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: var(--ikfc-soft); color: var(--ikfc-accent-text); font-weight: 800; font-size: .82em; }
.ikfc .ikfc-entry .ikfc-input { padding-left: 14px; height: 42px; }
.ikfc .ikfc-icon-btn {
	width: 40px; height: 40px; border-radius: calc(var(--ikfc-r-sm) - 2px);
	display: inline-flex; align-items: center; justify-content: center;
	color: var(--ikfc-muted); border: 1px solid var(--ikfc-border); background: var(--ikfc-bg);
}
.ikfc .ikfc-icon-btn:hover:not(:disabled) { color: var(--ikfc-neg); border-color: var(--ikfc-neg); }

/* Swap button (converter) */
.ikfc .ikfc-swap {
	position: absolute; z-index: 2;
	width: 36px; height: 36px; border-radius: 50%;
	display: inline-flex; align-items: center; justify-content: center;
	background: var(--ikfc-bg); color: var(--ikfc-accent-text); border: 1px solid var(--ikfc-border);
	box-shadow: 0 4px 10px -4px rgba(0,0,0,.2);
	transition: transform .25s, border-color .2s;
	top: -29px; left: 50%; margin-left: -18px;
}
.ikfc .ikfc-swap:hover { transform: rotate(180deg); border-color: var(--ikfc-accent); }
.ikfc .ikfc-grid-swap { row-gap: 26px; }
@container ikfc (min-width: 440px) {
	.ikfc .ikfc-grid-swap { column-gap: 56px; row-gap: 14px; }
	.ikfc .ikfc-swap { top: 34px; left: auto; margin-left: 0; right: -46px; }
}

/* Actions */
.ikfc-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.ikfc .ikfc-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 7px;
	height: 42px; padding: 0 16px; border-radius: var(--ikfc-r-sm);
	font-weight: 700; font-size: .9em; transition: background .2s, color .2s, border-color .2s, transform .15s;
}
.ikfc .ikfc-btn:active { transform: scale(.98); }
.ikfc .ikfc-btn-primary { flex: 1; color: #fff; background: linear-gradient(135deg, var(--ikfc-accent-strong), var(--ikfc-accent-deep)); }
.ikfc .ikfc-btn-primary:hover { filter: brightness(1.08); }
.ikfc .ikfc-btn-ghost { color: var(--ikfc-text-2); border: 1px solid var(--ikfc-border); background: transparent; }
.ikfc .ikfc-btn-ghost:hover { color: var(--ikfc-text); border-color: var(--ikfc-border-strong); }
.ikfc .ikfc-btn-sm { height: 36px; padding: 0 12px; margin-top: 8px; align-self: flex-start; font-size: .84em; }
.ikfc .ikfc-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--ikfc-accent-strong); color: #fff; font-size: .78em; font-weight: 800; }

/* History panel */
.ikfc .ikfc-hist { margin-top: 12px; padding: 14px; border-radius: var(--ikfc-r-sm); background: var(--ikfc-surface); border: 1px solid var(--ikfc-border); animation: ikfc-in .2s ease both; }
.ikfc .ikfc-hist[hidden] { display: none; }
.ikfc-hist-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; font-size: .9em; }
.ikfc .ikfc-link-btn { display: inline-flex; align-items: center; gap: 4px; color: var(--ikfc-neg); font-size: .82em; font-weight: 700; padding: 4px 6px; border-radius: 6px; }
.ikfc .ikfc-link-btn:hover { background: var(--ikfc-neg-bg); }
.ikfc-hist-empty { color: var(--ikfc-muted); font-size: .85em; line-height: 1.8; }
.ikfc .ikfc-hist-list { display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow-y: auto; }
.ikfc .ikfc-hist-item {
	display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; gap: 2px 12px; width: 100%; text-align: right;
	padding: 10px 12px; border-radius: calc(var(--ikfc-r-sm) - 2px); background: var(--ikfc-bg); border: 1px solid var(--ikfc-border);
	transition: border-color .2s;
}
.ikfc .ikfc-hist-item:hover { border-color: var(--ikfc-accent); }
.ikfc-hist-tool { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: .86em; }
.ikfc-hist-tool .ikfc-ic { color: var(--ikfc-accent-text); }
.ikfc-hist-tool i { font-style: normal; color: var(--ikfc-muted); font-size: .9em; }
.ikfc-hist-main { grid-column: 1; font-size: .8em; color: var(--ikfc-text-2); }
.ikfc-hist-time { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-size: .74em; color: var(--ikfc-muted); white-space: nowrap; }

/* ---------- Result panel ---------- */
.ikfc .ikfc-result {
	container-type: inline-size; container-name: ikfcres;
	background: var(--ikfc-surface); border: 1px solid var(--ikfc-border);
	border-radius: var(--ikfc-radius); padding: 18px; min-width: 0;
}
.ikfc-res-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.ikfc-res-tool { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: .85em; color: var(--ikfc-text-2); }
.ikfc-res-tool .ikfc-ic { color: var(--ikfc-accent-text); }
.ikfc-res-sym { font-size: .75em; font-weight: 800; padding: 3px 10px; border-radius: 999px; background: var(--ikfc-soft); color: var(--ikfc-accent-text); letter-spacing: .03em; }

.ikfc-res-main {
	position: relative; overflow: hidden;
	padding: 18px 18px 20px; border-radius: var(--ikfc-r-sm);
	color: #fff;
	background: linear-gradient(135deg, var(--ikfc-accent-strong) 0%, var(--ikfc-accent-deep) 100%);
	box-shadow: 0 10px 22px -16px var(--ikfc-accent);
}
.ikfc-res-main::after {
	content: ""; position: absolute; width: 160px; height: 160px; left: -50px; top: -70px; border-radius: 50%;
	background: rgba(255, 255, 255, .12); pointer-events: none;
}
.ikfc-res-main.is-pos { background: linear-gradient(135deg, #0a7d45, #086a3a); box-shadow: 0 10px 22px -16px #0a7d45; }
.ikfc-res-main.is-neg { background: linear-gradient(135deg, #c4323a, #a82a31); box-shadow: 0 10px 22px -16px #c4323a; }
.ikfc-res-label { display: block; font-size: .86em; font-weight: 500; position: relative; z-index: 1; }
.ikfc-res-value {
	display: block; margin-top: 4px; font-size: 1.95em; font-weight: 800; line-height: 1.3;
	position: relative; z-index: 1; word-break: break-word;
}
.ikfc-res-value .ikfc-ccy { font-size: .5em; font-weight: 600; opacity: .9; }
.ikfc-res-toman { display: block; position: relative; z-index: 1; margin-top: 4px; font-size: .86em; font-weight: 600; }
.ikfc-n { unicode-bidi: isolate; direction: ltr; display: inline-block; }
.ikfc-ccy { color: inherit; opacity: .8; font-weight: 600; font-size: .85em; }
.ikfc-dim { color: var(--ikfc-muted); font-size: .85em; font-weight: 500; }
.ikfc-n, .ikfc-ccy { white-space: nowrap; }
.ikfc-pct { margin-right: 1px; }

.ikfc .ikfc-rows { margin-top: 12px; }
.ikfc-row {
	display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
	padding: 10px 2px; border-bottom: 1px solid var(--ikfc-border);
}
.ikfc-row:last-child { border-bottom: 0; }
.ikfc .ikfc-row dt { flex: 1 1 auto; min-width: 0; color: var(--ikfc-muted); font-size: .86em; font-weight: 500; }
.ikfc .ikfc-row dd { flex: 0 1 auto; font-weight: 700; color: var(--ikfc-text); text-align: left; }

.ikfc-res-error, .ikfc-note { padding: 12px 14px; border-radius: var(--ikfc-r-sm); font-size: .88em; line-height: 1.7; }
.ikfc-res-error { background: var(--ikfc-neg-bg); color: var(--ikfc-neg); font-weight: 600; }
.ikfc-note { margin-top: 12px; background: var(--ikfc-soft); color: var(--ikfc-text-2); border-right: 3px solid var(--ikfc-accent); }
.ikfc-res-empty { text-align: center; color: var(--ikfc-muted); padding: 30px 10px; }
.ikfc-res-empty .ikfc-ic { color: var(--ikfc-accent-text); opacity: .6; margin-bottom: 8px; }

/* Result actions */
.ikfc-res-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(58px, 1fr)); gap: 6px; margin-top: 14px; }
.ikfc .ikfc-act {
	display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
	min-height: 58px; padding: 8px 4px; border-radius: var(--ikfc-r-sm);
	background: var(--ikfc-bg); border: 1px solid var(--ikfc-border); color: var(--ikfc-text-2);
	font-size: .78em; font-weight: 700; transition: border-color .2s, color .2s, background .2s;
}
.ikfc .ikfc-act:hover { border-color: var(--ikfc-accent); color: var(--ikfc-accent-text); }
.ikfc .ikfc-act.is-on { background: var(--ikfc-soft); border-color: var(--ikfc-accent); color: var(--ikfc-accent-text); }

/* Formula */
.ikfc .ikfc-formula { margin-top: 12px; border: 1px dashed var(--ikfc-border-strong); border-radius: var(--ikfc-r-sm); background: var(--ikfc-bg); }
.ikfc .ikfc-formula summary {
	display: flex; align-items: center; gap: 6px; padding: 10px 12px; cursor: pointer; list-style: none;
	font-size: .84em; font-weight: 700; color: var(--ikfc-text-2);
}
.ikfc .ikfc-formula summary::-webkit-details-marker { display: none; }
.ikfc .ikfc-formula summary::after { content: "+"; margin-right: auto; font-weight: 800; color: var(--ikfc-accent-text); }
.ikfc .ikfc-formula[open] summary::after { content: "−"; }
.ikfc .ikfc-formula summary .ikfc-ic { color: var(--ikfc-accent-text); }
.ikfc .ikfc-formula ul { padding: 0 14px 12px; display: flex; flex-direction: column; gap: 6px; }
.ikfc .ikfc-formula li { position: relative; padding-right: 14px; font-size: .82em; line-height: 1.9; color: var(--ikfc-text-2); }
.ikfc .ikfc-formula li::before { content: ""; position: absolute; right: 0; top: .8em; width: 6px; height: 6px; border-radius: 50%; background: var(--ikfc-accent); }

/* Compare */
.ikfc-cmp { margin-top: 12px; padding: 12px; border-radius: var(--ikfc-r-sm); background: var(--ikfc-bg); border: 1px solid var(--ikfc-accent); }
.ikfc-cmp-head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; font-size: .84em; font-weight: 800; color: var(--ikfc-accent-text); }
.ikfc-cmp-scroll { overflow-x: auto; }
.ikfc .ikfc-cmp-table { font-size: .8em; }
.ikfc .ikfc-cmp-table th[scope="row"] { font-weight: 500; color: var(--ikfc-muted); background: none; }
.ikfc .ikfc-cmp-table td { text-align: left; white-space: nowrap; }
.ikfc .ikfc-cmp-table td:last-child { font-weight: 800; }
.ikfc .ikfc-cmp-table tr.ikfc-diff td:last-child { color: var(--ikfc-accent-text); }
.ikfc-cmp-hint { margin-top: 8px; font-size: .74em; color: var(--ikfc-muted); }

.ikfc-extra { margin-top: 14px; }

/* Pivot ladder */
.ikfc-ladder { display: flex; flex-direction: column; gap: 6px; }
.ikfc-ladder-row {
	display: grid; grid-template-columns: 46px 1fr auto; align-items: center; gap: 10px;
	padding: 9px 12px; border-radius: calc(var(--ikfc-r-sm) - 2px); background: var(--ikfc-bg); border: 1px solid var(--ikfc-border);
}
.ikfc-ladder-k { font-weight: 800; font-size: .8em; text-align: center; padding: 3px 0; border-radius: 6px; }
.ikfc-ladder-name { font-size: .85em; color: var(--ikfc-muted); }
.ikfc-ladder-v { font-weight: 700; }
.ikfc-l-r .ikfc-ladder-k { background: var(--ikfc-neg-bg); color: var(--ikfc-neg); }
.ikfc-l-s .ikfc-ladder-k { background: var(--ikfc-pos-bg); color: var(--ikfc-pos); }
.ikfc-l-p { border-color: var(--ikfc-accent); background: var(--ikfc-soft); }
.ikfc-l-p .ikfc-ladder-k { background: var(--ikfc-accent-strong); color: #fff; }
.ikfc-l-p .ikfc-ladder-name { color: var(--ikfc-text); font-weight: 700; }

/* Tables */
.ikfc-tables { display: grid; gap: 12px; grid-template-columns: 1fr; }
@container ikfcres (min-width: 560px) { .ikfc-tables { grid-template-columns: 1fr 1fr; } }
.ikfc .ikfc-table {
	width: 100%; border-collapse: separate; border-spacing: 0; font-size: .88em;
	background: var(--ikfc-bg); border: 1px solid var(--ikfc-border); border-radius: calc(var(--ikfc-r-sm) - 2px); overflow: hidden;
}
.ikfc .ikfc-table th, .ikfc .ikfc-table td { padding: 8px 12px; text-align: right; border: 0; border-bottom: 1px solid var(--ikfc-border); background: none; color: var(--ikfc-text); }
.ikfc .ikfc-table td:last-child, .ikfc .ikfc-table thead th:last-child { text-align: left; font-weight: 700; }
.ikfc .ikfc-table thead th { background: var(--ikfc-surface-2); color: var(--ikfc-muted); font-weight: 600; font-size: .92em; }
.ikfc .ikfc-table tr:last-child td, .ikfc .ikfc-table tr:last-child th { border-bottom: 0; }
.ikfc .ikfc-table tr.ikfc-gold td { background: var(--ikfc-soft); color: var(--ikfc-accent-text); font-weight: 800; }

/* Risk/Reward bar */
.ikfc-rrbar { padding: 6px 2px 2px; }
.ikfc-rrbar-track { position: relative; display: flex; height: 12px; border-radius: 999px; background: var(--ikfc-surface-2); }
.ikfc-rrbar-track > span:first-child { border-radius: 999px 0 0 999px; }
.ikfc-rrbar-track > span:nth-child(2) { border-radius: 0 999px 999px 0; }
.ikfc-rr-loss { background: linear-gradient(90deg, var(--ikfc-neg), color-mix(in srgb, var(--ikfc-neg) 60%, #fff)); }
.ikfc-rr-gain { background: linear-gradient(90deg, color-mix(in srgb, var(--ikfc-pos) 60%, #fff), var(--ikfc-pos)); }
.ikfc-rrbar-sell .ikfc-rr-loss { background: linear-gradient(90deg, color-mix(in srgb, var(--ikfc-neg) 60%, #fff), var(--ikfc-neg)); }
.ikfc-rrbar-sell .ikfc-rr-gain { background: linear-gradient(90deg, var(--ikfc-pos), color-mix(in srgb, var(--ikfc-pos) 60%, #fff)); }
.ikfc .ikfc-rr-mark {
	position: absolute; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%;
	background: var(--ikfc-bg); border: 4px solid var(--ikfc-accent); box-shadow: 0 2px 6px rgba(0,0,0,.18);
}
.ikfc-rrbar-labels { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; margin-top: 10px; font-size: .74em; color: var(--ikfc-muted); }
.ikfc-rrbar-labels span { display: flex; flex-direction: column; line-height: 1.5; }
.ikfc-rrbar-labels span:first-child { align-items: flex-start; text-align: left; }
.ikfc-rrbar-labels span:nth-child(2) { align-items: center; text-align: center; }
.ikfc-rrbar-labels span:last-child { align-items: flex-end; text-align: right; }
.ikfc-rrbar-labels b { color: var(--ikfc-text); font-weight: 700; font-size: 1.12em; white-space: nowrap; }
.ikfc .ikfc-rrbar-labels em { font-style: normal; font-weight: 600; }
.ikfc-rrbar-labels .ikfc-rr-entry b { color: var(--ikfc-accent-text); }
.ikfc-rrbar-labels .is-loss { color: var(--ikfc-neg); }
.ikfc-rrbar-labels .is-gain { color: var(--ikfc-pos); }

/* Chart */
.ikfc-chart { background: var(--ikfc-bg); border: 1px solid var(--ikfc-border); border-radius: calc(var(--ikfc-r-sm) - 2px); padding: 12px; }
.ikfc-chart-cap { font-size: .8em; color: var(--ikfc-muted); margin-bottom: 6px; font-weight: 600; }
.ikfc-chart svg { width: 100%; height: 150px; display: block; }
.ikfc-chart rect { transition: opacity .2s; }
.ikfc-chart rect:hover { opacity: .75; }
.ikfc-chart-base { stroke: var(--ikfc-muted); stroke-dasharray: 4 4; stroke-width: 1; opacity: .6; vector-effect: non-scaling-stroke; }

/* Toast */
.ikfc .ikfc-toast {
	position: absolute; left: 50%; bottom: 18px; z-index: 30; transform: translate(-50%, 16px);
	padding: 10px 18px; border-radius: 999px; background: #0f172a; color: #fff;
	font-size: .86em; font-weight: 600; white-space: nowrap; pointer-events: none;
	opacity: 0; transition: opacity .2s, transform .2s; box-shadow: 0 10px 24px -8px rgba(0,0,0,.4);
}
.ikfc .ikfc-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.ikfc[data-theme="dark"] .ikfc-toast { background: #e8ecf3; color: #0d121c; }

/* ---------- Footer ---------- */
.ikfc .ikfc-foot {
	padding: 14px 28px; border-top: 1px solid var(--ikfc-border); background: var(--ikfc-surface);
	color: var(--ikfc-muted); font-size: .8em; text-align: center; line-height: 1.8;
}
.ikfc .ikfc-empty, .ikfc .ikfc-noscript { padding: 28px; text-align: center; color: var(--ikfc-muted); }

/* ---------- FAQ (server-rendered, crawlable) ---------- */
.ikfc .ikfc-faq { margin-top: 18px; padding: 20px 22px 14px; border-radius: var(--ikfc-radius); background: var(--ikfc-bg); border: 1px solid var(--ikfc-border); color: var(--ikfc-text); }
.ikfc .ikfc-faq-title { font-size: 1.15em; font-weight: 800; margin-bottom: 10px; color: var(--ikfc-text); }
.ikfc .ikfc-faq-item { border: 1px solid var(--ikfc-border); border-radius: var(--ikfc-r-sm); background: var(--ikfc-surface); margin-bottom: 8px; overflow: hidden; }
.ikfc .ikfc-faq-item summary {
	display: flex; align-items: center; gap: 10px; padding: 14px 16px; cursor: pointer; list-style: none;
	font-weight: 700; font-size: .95em; color: var(--ikfc-text);
}
.ikfc .ikfc-faq-item summary::-webkit-details-marker { display: none; }
.ikfc .ikfc-faq-item summary::after { content: "+"; margin-right: auto; font-size: 1.2em; color: var(--ikfc-accent-text); }
.ikfc .ikfc-faq-item[open] summary::after { content: "−"; }
.ikfc .ikfc-faq-item[open] summary { border-bottom: 1px solid var(--ikfc-border); }
.ikfc .ikfc-faq-a { padding: 12px 16px 14px; color: var(--ikfc-text-2); font-size: .9em; line-height: 1.9; }
.ikfc .ikfc-faq-a p { margin: 0; }

/* ---------- Compact (narrow containers, sidebars) ---------- */
@container ikfc (max-width: 520px) {
	.ikfc .ikfc-head { padding: 20px 18px 14px; }
	.ikfc .ikfc-title { font-size: 1.25em; }
	.ikfc-ticker { padding: 2px 18px 14px; }
	.ikfc .ikfc-tabs { padding: 8px 14px; }
	.ikfc-body { padding: 18px; }
	.ikfc .ikfc-foot { padding: 12px 18px; }
	.ikfc-res-value { font-size: 1.6em; }
	.ikfc .ikfc-result { padding: 14px; }
}

/* ---------- Loading skeleton ---------- */
.ikfc-skeleton { padding: 24px; border: 1px solid var(--ikfc-border); border-radius: var(--ikfc-radius); background: var(--ikfc-bg); }
.ikfc-ready .ikfc-skeleton { display: none; }
.ikfc-sk { border-radius: 10px; background: linear-gradient(90deg, var(--ikfc-surface) 25%, var(--ikfc-surface-2) 50%, var(--ikfc-surface) 75%); background-size: 200% 100%; animation: ikfc-sh 1.4s infinite linear; }
.ikfc-sk-title { height: 28px; width: 45%; margin-bottom: 18px; }
.ikfc-sk-tabs { height: 42px; margin-bottom: 18px; }
.ikfc-sk-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 18px; }
.ikfc-sk-box { height: 260px; }
@keyframes ikfc-sh { to { background-position: -200% 0; } }

@media (prefers-reduced-motion: reduce) {
	.ikfc *, .ikfc *::before, .ikfc *::after { transition: none !important; animation: none !important; }
}
@media (forced-colors: active) {
	.ikfc .ikfc-tab.is-active, .ikfc .ikfc-seg-btn.is-on, .ikfc .ikfc-chip.is-active { outline: 2px solid CanvasText; }
}
@media print {
	.ikfc-tabs, .ikfc-picker, .ikfc-ticker, .ikfc-actions, .ikfc-res-actions, .ikfc-hist, .ikfc-toast { display: none !important; }
	.ikfc-card { box-shadow: none; }
}
