/*!
 * iKral Forex Glossary — front-end styles
 * Everything is scoped under .ikfx-glossary so the theme is never affected (and vice versa).
 */

@font-face { font-family: "IKFX Vazirmatn"; src: url("../fonts/vazirmatn-regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "IKFX Vazirmatn"; src: url("../fonts/vazirmatn-medium.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "IKFX Vazirmatn"; src: url("../fonts/vazirmatn-semibold.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "IKFX Vazirmatn"; src: url("../fonts/vazirmatn-bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "IKFX Vazirmatn"; src: url("../fonts/vazirmatn-extrabold.woff2") format("woff2"); font-weight: 800; font-style: normal; font-display: swap; }

/* ---------- Tokens ---------- */
.ikfx-glossary {
	--ikfx-accent: #f68420;
	--ikfx-accent-rgb: 246, 132, 32;
	--ikfx-accent-2: #ffb347;
	--ikfx-heading: var(--ikfx-l-heading, #1f2937);
	--ikfx-text: var(--ikfx-l-text, #4b5563);
	--ikfx-card: var(--ikfx-l-card, #ffffff);
	--ikfx-item: var(--ikfx-l-item, #f8fafc);
	--ikfx-muted: #8a94a6;
	--ikfx-line: #e7ebf1;
	--ikfx-chip: #f1f4f8;
	--ikfx-chip-text: #556070;
	--ikfx-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 18px 40px -16px rgba(16, 24, 40, .16);
	--ikfx-soft: rgba(var(--ikfx-accent-rgb), .1);
	--ikfx-tip-bg: linear-gradient(135deg, rgba(var(--ikfx-accent-rgb), .11), rgba(var(--ikfx-accent-rgb), .04));
	--ikfx-toast: #111827;
	--ikfx-pad: 28px;
	--ikfx-gap: 10px;
	--ikfx-indent: 72px;
	--ikfx-ease: cubic-bezier(.4, 0, .2, 1);
}

.ikfx-glossary.ikfx-theme-dark {
	--ikfx-heading: #f1f5f9;
	--ikfx-text: #c3cddb;
	--ikfx-card: #111827;
	--ikfx-item: #172133;
	--ikfx-muted: #8b97ab;
	--ikfx-line: #253046;
	--ikfx-chip: #1d2738;
	--ikfx-chip-text: #c3cddb;
	--ikfx-shadow: 0 24px 48px -18px rgba(0, 0, 0, .6);
	--ikfx-soft: rgba(var(--ikfx-accent-rgb), .16);
	--ikfx-tip-bg: linear-gradient(135deg, rgba(var(--ikfx-accent-rgb), .12), rgba(255, 255, 255, .02));
	--ikfx-toast: #f1f5f9;
}
@media (prefers-color-scheme: dark) {
	.ikfx-glossary.ikfx-theme-auto {
		--ikfx-heading: #f1f5f9;
		--ikfx-text: #c3cddb;
		--ikfx-card: #111827;
		--ikfx-item: #172133;
		--ikfx-muted: #8b97ab;
		--ikfx-line: #253046;
		--ikfx-chip: #1d2738;
		--ikfx-chip-text: #c3cddb;
		--ikfx-shadow: 0 24px 48px -18px rgba(0, 0, 0, .6);
		--ikfx-soft: rgba(var(--ikfx-accent-rgb), .16);
		--ikfx-tip-bg: linear-gradient(135deg, rgba(var(--ikfx-accent-rgb), .12), rgba(255, 255, 255, .02));
		--ikfx-toast: #f1f5f9;
	}
}

/* ---------- Isolation / reset ---------- */
.ikfx-glossary,
.ikfx-glossary *,
.ikfx-glossary *::before,
.ikfx-glossary *::after { box-sizing: border-box; }

.ikfx-glossary {
	container-type: inline-size;
	direction: rtl;
	text-align: right;
	width: 100%;
	max-width: var(--ikfx-maxw, 900px);
	margin: 24px auto;
	font-family: "IKFX Vazirmatn", Vazirmatn, Tahoma, "Segoe UI", sans-serif;
	font-size: var(--ikfx-fs, 15px);
	font-weight: 400;
	line-height: 1.8;
	color: var(--ikfx-text);
	letter-spacing: normal;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}
.ikfx-glossary.ikfx-font-inherit { font-family: inherit; }
.ikfx-glossary [hidden] { display: none !important; }

/*
 * Resets are written as `.ikfx-glossary :is(el, .ikfx-r)` so they weigh (0,2,0): heavier than the
 * usual theme selectors (`button:hover`, `.entry-content p`, `svg`, `*:focus` …) yet equal to the
 * component rules below, which come later in this file and therefore win.
 */
.ikfx-glossary :is(h2, h3, p, .ikfx-r) {
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	box-shadow: none;
	text-transform: none;
	letter-spacing: normal;
	font-family: inherit;
	font-size: inherit;
	font-weight: inherit;
	line-height: inherit;
	color: inherit;
}
.ikfx-glossary :is(h2, h3)::before,
.ikfx-glossary :is(h2, h3)::after { content: none !important; display: none !important; }

.ikfx-glossary :is(button, .ikfx-r) {
	all: unset;
	box-sizing: border-box;
	cursor: pointer;
	font-family: inherit;
	color: inherit;
	-webkit-tap-highlight-color: transparent;
}
.ikfx-glossary :is(button, .ikfx-r):disabled { cursor: default; }
.ikfx-glossary :focus:not(:focus-visible) { outline: none; }
.ikfx-glossary :is(button, a):focus-visible {
	outline: 2px solid var(--ikfx-accent);
	outline-offset: 2px;
}
.ikfx-glossary :is(svg, .ikfx-r) {
	display: block;
	flex: none;
	width: 1em;
	height: 1em;
	max-width: none;
	margin: 0;
	fill: none;
	stroke: currentColor;
	vertical-align: middle;
}
.ikfx-glossary :is(a, .ikfx-r) { text-decoration: none; box-shadow: none; }
.ikfx-glossary :is(mark, .ikfx-r) {
	padding: 0 2px;
	border-radius: 4px;
	font-weight: inherit;
	color: inherit;
	background: rgba(var(--ikfx-accent-rgb), .22);
}

/* ---------- Card ---------- */
.ikfx-card {
	position: relative;
	padding: var(--ikfx-pad);
	background-color: var(--ikfx-card);
	background-image: radial-gradient(520px 180px at 100% 0, rgba(var(--ikfx-accent-rgb), .07), transparent 70%);
	border: 1px solid var(--ikfx-line);
	border-radius: var(--ikfx-radius, 16px);
	box-shadow: var(--ikfx-shadow);
	overflow: hidden;
	overflow: clip; /* clip (not hidden) keeps position: sticky working inside */
}
.ikfx-card::before {
	content: "";
	position: absolute;
	inset: 0 0 auto 0;
	height: 4px;
	background: linear-gradient(90deg, var(--ikfx-accent-2), var(--ikfx-accent));
}
.ikfx-no-shadow .ikfx-card { box-shadow: none; }
.ikfx-no-topbar .ikfx-card::before { display: none; }

/* ---------- Header ---------- */
.ikfx-header {
	display: flex;
	align-items: center;
	gap: 14px;
}
.ikfx-head-icon {
	display: grid;
	place-items: center;
	flex: none;
	width: 50px;
	height: 50px;
	border-radius: 15px;
	color: #fff;
	font-size: 24px;
	background: linear-gradient(135deg, var(--ikfx-accent-2), var(--ikfx-accent));
	box-shadow: 0 10px 22px -8px rgba(var(--ikfx-accent-rgb), .7);
}
.ikfx-head-text { flex: 1; min-width: 0; }
.ikfx-glossary .ikfx-title {
	font-size: 1.55em;
	font-weight: 800;
	line-height: 1.45;
	color: var(--ikfx-heading);
}
.ikfx-glossary .ikfx-subtitle {
	margin-top: 2px;
	font-size: .9em;
	color: var(--ikfx-muted);
	line-height: 1.7;
}
.ikfx-head-side { display: flex; align-items: center; gap: 8px; flex: none; }
.ikfx-glossary .ikfx-icon-btn {
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	border-radius: 12px;
	font-size: 19px;
	color: var(--ikfx-muted);
	background: var(--ikfx-chip);
	border: 1px solid var(--ikfx-line);
	transition: color .2s, background .2s, border-color .2s, transform .2s;
}
.ikfx-glossary .ikfx-icon-btn:hover { color: var(--ikfx-accent); border-color: rgba(var(--ikfx-accent-rgb), .45); transform: translateY(-1px); }
.ikfx-theme-toggle .ikfx-i-sun { display: none; }
.ikfx-theme-toggle.is-dark .ikfx-i-sun { display: block; }
.ikfx-theme-toggle.is-dark .ikfx-i-moon { display: none; }
.ikfx-total {
	display: flex;
	flex-direction: column;
	align-items: center;
	flex: none;
	padding: 6px 16px;
	border-radius: 14px;
	background: var(--ikfx-soft);
	line-height: 1.4;
}
.ikfx-total b { font-size: 1.35em; font-weight: 800; color: var(--ikfx-accent); }
.ikfx-total span { font-size: .75em; color: var(--ikfx-muted); }

/* ---------- Alphabet ---------- */
.ikfx-alpha {
	margin-top: 22px;
	padding: 14px;
	background: var(--ikfx-item);
	border: 1px solid var(--ikfx-line);
	border-radius: calc(var(--ikfx-radius, 16px) - 4px);
}
.ikfx-seg {
	display: inline-flex;
	gap: 3px;
	padding: 3px;
	margin-bottom: 12px;
	background: var(--ikfx-card);
	border: 1px solid var(--ikfx-line);
	border-radius: 11px;
}
.ikfx-glossary .ikfx-seg-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 64px;
	padding: 4px 16px;
	line-height: 1.7;
	border-radius: 8px;
	font-size: .84em;
	font-weight: 700;
	color: var(--ikfx-muted);
	transition: background .2s, color .2s;
}
.ikfx-glossary .ikfx-seg-btn:hover { color: var(--ikfx-heading); }
.ikfx-glossary .ikfx-seg-btn.is-active {
	background: var(--ikfx-accent);
	color: #fff;
	box-shadow: 0 4px 10px -3px rgba(var(--ikfx-accent-rgb), .6);
}
.ikfx-alpha-label {
	display: block;
	text-align: center;
	margin-bottom: 8px;
	font-size: .78em;
	font-weight: 700;
	color: var(--ikfx-muted);
}
.ikfx-filters-side .ikfx-alpha-groups {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
}
.ikfx-filters-side .ikfx-alpha-groups > .ikfx-alpha-group + .ikfx-alpha-group {
	border-right: 1px solid var(--ikfx-line);
	padding-right: 16px;
}
.ikfx-alpha { text-align: center; }
/* Equal-size keys, centred rows: both alphabets line up the same way and short last rows look intentional. */
.ikfx-letters {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 6px;
}
.ikfx-glossary .ikfx-letter {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: var(--ikfx-cell, 36px);
	height: var(--ikfx-cell, 36px);
	padding: 0;
	border-radius: 9px;
	background: var(--ikfx-card);
	border: 1px solid var(--ikfx-line);
	font-size: .86em;
	font-weight: 700;
	line-height: 1;
	color: var(--ikfx-chip-text);
	transition: transform .15s var(--ikfx-ease), background .2s, color .2s, border-color .2s, box-shadow .2s;
}
.ikfx-glossary .ikfx-letter--all { width: auto; min-width: calc(var(--ikfx-cell, 36px) * 1.6); padding: 0 12px; }
.ikfx-glossary .ikfx-letter:hover:not(:disabled):not(.is-active) {
	border-color: var(--ikfx-accent);
	color: var(--ikfx-accent);
	transform: translateY(-1px);
}
.ikfx-glossary .ikfx-letter.is-active {
	background: var(--ikfx-accent);
	border-color: var(--ikfx-accent);
	color: #fff;
	box-shadow: 0 6px 14px -5px rgba(var(--ikfx-accent-rgb), .7);
}
.ikfx-glossary .ikfx-letter:disabled { opacity: .35; }

/* ---------- Search ---------- */
.ikfx-search { position: relative; margin-top: 16px; }
.ikfx-glossary .ikfx-search-input {
	display: block;
	width: 100%;
	height: 52px;
	margin: 0;
	padding: 0 48px;
	font: inherit;
	font-size: 1em;
	color: var(--ikfx-heading);
	background: var(--ikfx-card);
	border: 1.5px solid var(--ikfx-line);
	border-radius: 14px;
	box-shadow: none;
	outline: none;
	-webkit-appearance: none;
	appearance: none;
	transition: border-color .2s, box-shadow .2s;
}
.ikfx-glossary .ikfx-search-input::placeholder { color: var(--ikfx-muted); opacity: 1; }
.ikfx-glossary .ikfx-search-input::-webkit-search-cancel-button,
.ikfx-glossary .ikfx-search-input::-webkit-search-decoration { -webkit-appearance: none; display: none; }
.ikfx-glossary .ikfx-search-input:focus {
	border-color: var(--ikfx-accent);
	box-shadow: 0 0 0 4px rgba(var(--ikfx-accent-rgb), .14);
}
.ikfx-search-icon {
	position: absolute;
	top: 50%;
	right: 17px;
	transform: translateY(-50%);
	font-size: 20px;
	color: var(--ikfx-muted);
	pointer-events: none;
}
.ikfx-search:focus-within .ikfx-search-icon { color: var(--ikfx-accent); }
.ikfx-kbd {
	position: absolute;
	top: 50%;
	left: 14px;
	transform: translateY(-50%);
	min-width: 24px;
	height: 24px;
	padding: 0 6px;
	display: grid;
	place-items: center;
	font: 600 12px/1 ui-monospace, Consolas, monospace;
	color: var(--ikfx-muted);
	background: var(--ikfx-chip);
	border: 1px solid var(--ikfx-line);
	border-bottom-width: 2px;
	border-radius: 6px;
	pointer-events: none;
}
.ikfx-search.has-value .ikfx-kbd,
.ikfx-search:focus-within .ikfx-kbd { display: none; }
.ikfx-glossary .ikfx-search-clear {
	position: absolute;
	top: 50%;
	left: 12px;
	transform: translateY(-50%);
	width: 30px;
	height: 30px;
	border-radius: 50%;
	display: grid;
	place-items: center;
	font-size: 16px;
	color: var(--ikfx-muted);
	background: var(--ikfx-chip);
	transition: background .2s, color .2s;
}
.ikfx-glossary .ikfx-search-clear:hover { background: var(--ikfx-accent); color: #fff; }

/* ---------- Categories ---------- */
.ikfx-cats {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 14px;
}
.ikfx-glossary .ikfx-cat {
	--c: var(--ikfx-accent);
	--c-rgb: var(--ikfx-accent-rgb);
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 6px 12px;
	border-radius: 999px;
	font-size: .82em;
	font-weight: 600;
	line-height: 1.5;
	color: var(--ikfx-chip-text);
	background: var(--ikfx-chip);
	border: 1px solid transparent;
	transition: background .2s, color .2s, border-color .2s;
}
.ikfx-glossary .ikfx-cat:hover { border-color: rgba(var(--c-rgb), .45); }
.ikfx-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; }
.ikfx-cat-count {
	min-width: 22px;
	padding: 0 6px;
	border-radius: 999px;
	font-size: .85em;
	text-align: center;
	background: rgba(127, 127, 127, .14);
}
.ikfx-glossary .ikfx-cat.is-active {
	color: var(--c);
	background: rgba(var(--c-rgb), .12);
	border-color: rgba(var(--c-rgb), .5);
}
.ikfx-glossary .ikfx-cat.is-active .ikfx-cat-count { background: var(--c); color: #fff; }

/* ---------- Status bar ---------- */
.ikfx-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin: 20px 0 10px;
}
.ikfx-glossary .ikfx-status { font-size: .82em; color: var(--ikfx-muted); }
.ikfx-tools { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.ikfx-glossary .ikfx-tool {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 32px;
	padding: 0 10px;
	border-radius: 9px;
	font-size: .82em;
	font-weight: 600;
	line-height: 1;
	color: var(--ikfx-accent);
	transition: background .2s, color .2s;
}
.ikfx-glossary .ikfx-tool:hover { background: var(--ikfx-soft); }
.ikfx-view-toggle {
	display: inline-flex;
	gap: 2px;
	padding: 2px;
	margin-right: 4px;
	border-radius: 10px;
	background: var(--ikfx-chip);
	border: 1px solid var(--ikfx-line);
}
.ikfx-glossary .ikfx-view-btn {
	display: grid;
	place-items: center;
	width: 30px;
	height: 28px;
	border-radius: 8px;
	font-size: 15px;
	color: var(--ikfx-muted);
	transition: background .2s, color .2s;
}
.ikfx-glossary .ikfx-view-btn.is-active { background: var(--ikfx-card); color: var(--ikfx-accent); box-shadow: 0 1px 3px rgba(16, 24, 40, .12); }

/* ---------- Items ---------- */
.ikfx-list {
	display: flex;
	flex-direction: column;
	gap: var(--ikfx-gap);
}
.ikfx-glossary .ikfx-item {
	--c: var(--ikfx-accent);
	--c-rgb: var(--ikfx-accent-rgb);
	position: relative;
	margin: 0;
	padding: 0;
	background: var(--ikfx-item);
	border: 1px solid var(--ikfx-line);
	border-radius: calc(var(--ikfx-radius, 16px) - 4px);
	overflow: hidden;
	scroll-margin-top: 90px;
	transition: border-color .25s, box-shadow .25s, background .25s;
}
.ikfx-item::before {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	right: 0;
	width: 3px;
	background: linear-gradient(180deg, var(--ikfx-accent-2), var(--ikfx-accent));
	transform: scaleY(0);
	transition: transform .35s var(--ikfx-ease);
}
.ikfx-item:hover { border-color: rgba(var(--ikfx-accent-rgb), .35); }
.ikfx-item.is-open {
	background: var(--ikfx-card);
	border-color: rgba(var(--ikfx-accent-rgb), .45);
	box-shadow: 0 14px 28px -18px rgba(var(--ikfx-accent-rgb), .55);
}
.ikfx-item.is-open::before { transform: scaleY(1); }
.ikfx-item.is-hidden,
.ikfx-item.is-filtered { display: none; }
.ikfx-item.is-flash { animation: ikfx-flash 1.6s var(--ikfx-ease); }
@keyframes ikfx-flash {
	0%, 100% { box-shadow: 0 0 0 0 rgba(var(--ikfx-accent-rgb), 0); }
	30% { box-shadow: 0 0 0 6px rgba(var(--ikfx-accent-rgb), .25); }
}

.ikfx-glossary .ikfx-item-head { font-size: 1em; font-weight: 400; line-height: inherit; }
.ikfx-glossary .ikfx-toggle {
	display: flex;
	align-items: center;
	gap: 14px;
	width: 100%;
	padding: 14px 18px;
	text-align: right;
	border-radius: calc(var(--ikfx-radius, 16px) - 5px);
}
.ikfx-glossary .ikfx-toggle:focus-visible { outline-offset: -3px; }
.ikfx-avatar {
	display: grid;
	place-items: center;
	flex: none;
	width: 40px;
	height: 40px;
	border-radius: 11px;
	font-size: 1.05em;
	font-weight: 800;
	line-height: 1;
	color: var(--c);
	background: rgba(var(--c-rgb), .12);
	transition: background .25s, color .25s;
}
.ikfx-item.is-open .ikfx-avatar {
	background: rgba(var(--c-rgb), .16);
	box-shadow: inset 0 0 0 1.5px rgba(var(--c-rgb), .5);
}
.ikfx-names {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	flex: 1;
	min-width: 0;
	gap: 1px;
}
.ikfx-name-main {
	max-width: 100%;
	font-size: 1.07em;
	font-weight: 700;
	line-height: 1.55;
	color: var(--ikfx-heading);
	transition: color .2s;
	overflow-wrap: anywhere;
}
.ikfx-name-sub {
	max-width: 100%;
	font-size: .86em;
	line-height: 1.6;
	color: var(--ikfx-muted);
	overflow-wrap: anywhere;
}
.ikfx-name-main.ikfx-en,
.ikfx-name-sub.ikfx-en { unicode-bidi: isolate; }
.ikfx-toggle:hover .ikfx-name-main,
.ikfx-item.is-open .ikfx-name-main { color: var(--ikfx-accent); }
.ikfx-badge {
	flex: none;
	padding: 2px 10px;
	border-radius: 999px;
	font-size: .72em;
	font-weight: 600;
	line-height: 1.8;
	white-space: nowrap;
	color: var(--c);
	background: rgba(var(--c-rgb), .1);
}
.ikfx-chevron {
	display: grid;
	place-items: center;
	flex: none;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	font-size: 18px;
	color: var(--ikfx-accent);
	background: var(--ikfx-soft);
	transition: transform .35s var(--ikfx-ease), background .25s, color .25s;
}
.ikfx-item.is-open .ikfx-chevron {
	transform: rotate(180deg);
	background: var(--ikfx-accent);
	color: #fff;
}

/* Panel: grid-rows trick = smooth height animation with no JS measuring */
.ikfx-panel {
	display: grid;
	grid-template-rows: 0fr;
	transition: grid-template-rows .35s var(--ikfx-ease);
}
.ikfx-item.is-open > .ikfx-panel { grid-template-rows: 1fr; }
.ikfx-panel-inner {
	min-height: 0;
	overflow: hidden;
	visibility: hidden;
	transition: visibility 0s linear .35s;
}
.ikfx-item.is-open .ikfx-panel-inner {
	visibility: visible;
	transition-delay: 0s;
}
.ikfx-panel-inner > * { margin-right: var(--ikfx-indent); margin-left: 18px; }
.ikfx-panel-inner::after { content: ""; display: block; height: 16px; }

.ikfx-def {
	padding-top: 12px;
	border-top: 1px dashed var(--ikfx-line);
	font-size: .97em;
	line-height: 2;
	text-align: start;
	text-wrap: pretty;
	color: var(--ikfx-text);
}
.ikfx-glossary .ikfx-def p { margin: 0 0 .5em; }
.ikfx-glossary .ikfx-def p:last-child { margin-bottom: 0; }
.ikfx-glossary .ikfx-def a { color: var(--ikfx-accent); text-decoration: underline; text-underline-offset: 3px; }

.ikfx-tip {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	margin-top: 12px;
	padding: 12px 14px;
	border-radius: 12px;
	font-size: .92em;
	line-height: 1.95;
	text-align: start;
	text-wrap: pretty;
	color: var(--ikfx-heading);
	background: var(--ikfx-tip-bg);
	border: 1px solid rgba(var(--ikfx-accent-rgb), .22);
}
.ikfx-tip-icon {
	display: grid;
	place-items: center;
	flex: none;
	width: 32px;
	height: 32px;
	margin-top: 2px;
	border-radius: 9px;
	font-size: 17px;
	color: #fff;
	background: linear-gradient(135deg, var(--ikfx-accent-2), var(--ikfx-accent));
}
.ikfx-tip-body { flex: 1; min-width: 0; }
.ikfx-tip-label { color: var(--ikfx-accent); font-weight: 800; }
.ikfx-tip-label::after { content: ":"; }

.ikfx-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 12px;
}
.ikfx-glossary .ikfx-action {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 5px 11px;
	border-radius: 8px;
	font-size: .8em;
	font-weight: 600;
	line-height: 1.6;
	color: var(--ikfx-muted);
	border: 1px solid var(--ikfx-line);
	background: transparent;
	transition: color .2s, border-color .2s, background .2s;
}
.ikfx-glossary .ikfx-action:hover { color: var(--ikfx-accent); border-color: rgba(var(--ikfx-accent-rgb), .5); background: var(--ikfx-soft); }
.ikfx-glossary .ikfx-action.is-done { color: #16a34a; border-color: rgba(22, 163, 74, .4); }

/* ---------- Empty / more / toast ---------- */
.ikfx-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	padding: 36px 16px 20px;
	text-align: center;
	color: var(--ikfx-muted);
}
.ikfx-empty-icon {
	display: grid;
	place-items: center;
	width: 64px;
	height: 64px;
	border-radius: 50%;
	font-size: 30px;
	color: var(--ikfx-accent);
	background: var(--ikfx-soft);
}
.ikfx-glossary .ikfx-reset {
	display: inline-block;
	padding: 6px 16px;
	border-radius: 999px;
	font-size: .85em;
	font-weight: 700;
	color: var(--ikfx-accent);
	border: 1.5px solid var(--ikfx-accent);
}
.ikfx-glossary .ikfx-reset:hover { background: var(--ikfx-accent); color: #fff; }

.ikfx-more-wrap { display: flex; justify-content: center; margin-top: 20px; }
.ikfx-glossary .ikfx-more {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 10px 14px 10px 22px;
	border-radius: 999px;
	font-weight: 700;
	font-size: .95em;
	color: var(--ikfx-accent);
	border: 1.5px solid var(--ikfx-accent);
	background: var(--ikfx-card);
	transition: background .2s, color .2s, transform .2s, box-shadow .2s;
}
.ikfx-glossary .ikfx-more:hover {
	background: var(--ikfx-accent);
	color: #fff;
	transform: translateY(-1px);
	box-shadow: 0 10px 22px -10px rgba(var(--ikfx-accent-rgb), .8);
}
.ikfx-more-count {
	padding: 1px 10px;
	border-radius: 999px;
	font-size: .8em;
	font-weight: 600;
	background: var(--ikfx-soft);
}
.ikfx-more:hover .ikfx-more-count { background: rgba(255, 255, 255, .22); }

.ikfx-toast {
	position: fixed;
	z-index: 99999;
	bottom: 24px;
	left: 50%;
	transform: translate(-50%, 16px);
	padding: 10px 18px;
	border-radius: 12px;
	font: 600 14px/1.7 "IKFX Vazirmatn", Vazirmatn, Tahoma, sans-serif;
	direction: rtl;
	color: #fff;
	background: #111827;
	box-shadow: 0 16px 32px -12px rgba(0, 0, 0, .45);
	opacity: 0;
	pointer-events: none;
	transition: opacity .25s, transform .25s var(--ikfx-ease);
}
.ikfx-toast.is-show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Term of the day ---------- */
.ikfx-glossary .ikfx-totd {
	--c: var(--ikfx-accent);
	--c-rgb: var(--ikfx-accent-rgb);
	position: relative;
	display: grid;
	grid-template-columns: auto 1fr auto;
	align-items: center;
	gap: 6px 14px;
	margin-top: 20px;
	padding: 14px 16px;
	border-radius: calc(var(--ikfx-radius, 16px) - 4px);
	color: var(--ikfx-text);
	background: linear-gradient(135deg, rgba(var(--ikfx-accent-rgb), .12), rgba(var(--ikfx-accent-rgb), .03));
	border: 1px solid rgba(var(--ikfx-accent-rgb), .25);
	overflow: hidden;
	transition: transform .2s, box-shadow .2s;
}
.ikfx-glossary .ikfx-totd:hover { transform: translateY(-2px); box-shadow: 0 14px 28px -18px rgba(var(--ikfx-accent-rgb), .8); }
.ikfx-totd-label {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	grid-row: span 2;
	align-self: start;
	padding: 6px 10px;
	border-radius: 10px;
	font-size: .78em;
	font-weight: 800;
	color: #fff;
	background: linear-gradient(135deg, var(--ikfx-accent-2), var(--ikfx-accent));
	white-space: nowrap;
}
.ikfx-totd-name { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; min-width: 0; }
.ikfx-totd-name b { font-size: 1.08em; font-weight: 800; color: var(--ikfx-heading); }
.ikfx-totd-name small { font-size: .85em; color: var(--ikfx-muted); }
.ikfx-totd-text { grid-column: 2; font-size: .88em; line-height: 1.9; color: var(--ikfx-text); }
.ikfx-totd-go {
	grid-column: 3;
	grid-row: 1 / span 2;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: .82em;
	font-weight: 800;
	color: var(--ikfx-accent);
	white-space: nowrap;
}
.ikfx-totd-standalone { margin: 16px 0; }
.ikfx-glossary .ikfx-totd--card { margin: 0; grid-template-columns: 1fr; padding: 18px; background-color: var(--ikfx-card); }
.ikfx-totd--card .ikfx-totd-label { justify-self: start; grid-row: auto; }
.ikfx-totd--card .ikfx-totd-text,
.ikfx-totd--card .ikfx-totd-go { grid-column: 1; grid-row: auto; }
.ikfx-totd--card .ikfx-level { justify-self: start; }

/* ---------- Sticky search + autocomplete ---------- */
.ikfx-sticky-sentinel { height: 1px; margin-top: 15px; }
.ikfx-search-wrap { position: relative; z-index: 6; }
.ikfx-search-wrap > .ikfx-search { margin-top: 0; }
.ikfx-search-wrap.ikfx-sticky {
	position: sticky;
	top: calc(var(--ikfx-sticky-top, 0px) + 10px);
	margin: 0 calc(var(--ikfx-pad) * -1);
	padding: 0 var(--ikfx-pad);
}
/* The stuck background is a pseudo-element, so sticking never changes the layout height. */
.ikfx-search-wrap.ikfx-sticky::before {
	content: "";
	position: absolute;
	inset: -10px 0;
	z-index: -1;
	background: var(--ikfx-card);
	box-shadow: 0 12px 24px -16px rgba(16, 24, 40, .35);
	opacity: 0;
	transition: opacity .2s;
	pointer-events: none;
}
.ikfx-search-wrap.ikfx-sticky.is-stuck::before { opacity: 1; }
.ikfx-ac {
	position: absolute;
	top: calc(100% + 6px);
	right: var(--ikfx-pad);
	left: var(--ikfx-pad);
	z-index: 20;
	max-height: 340px;
	margin: 0;
	padding: 6px;
	overflow-y: auto;
	list-style: none;
	background: var(--ikfx-card);
	border: 1px solid var(--ikfx-line);
	border-radius: 14px;
	box-shadow: 0 22px 44px -18px rgba(16, 24, 40, .35);
}
.ikfx-search-wrap:not(.ikfx-sticky) .ikfx-ac { right: 0; left: 0; }
.ikfx-glossary .ikfx-ac-item {
	--c: var(--ikfx-accent);
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	padding: 8px 10px;
	border-radius: 10px;
	cursor: pointer;
	list-style: none;
}
.ikfx-glossary .ikfx-ac-item:hover,
.ikfx-glossary .ikfx-ac-item.is-active { background: var(--ikfx-soft); }
.ikfx-ac-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--c); }
.ikfx-ac-names { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.5; }
.ikfx-ac-names b { font-weight: 700; color: var(--ikfx-heading); text-align: right; }
.ikfx-ac-names small { font-size: .8em; color: var(--ikfx-muted); text-align: right; }
.ikfx-ac-cat { flex: none; font-size: .72em; color: var(--ikfx-muted); }

/* ---------- Popular strip ---------- */
.ikfx-popular { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; font-size: .84em; }
.ikfx-popular-label { display: inline-flex; align-items: center; gap: 4px; font-weight: 800; color: #ea580c; }
.ikfx-glossary .ikfx-popular a {
	padding: 3px 10px;
	border-radius: 999px;
	color: var(--ikfx-chip-text);
	background: var(--ikfx-chip);
	transition: color .2s, background .2s;
}
.ikfx-glossary .ikfx-popular a:hover { color: var(--ikfx-accent); background: var(--ikfx-soft); }

/* ---------- Category icons ---------- */
.ikfx-cat-icon { display: inline-grid; place-items: center; flex: none; font-size: 1.05em; color: var(--c, var(--ikfx-accent)); }
.ikfx-badge .ikfx-cat-icon { font-size: .95em; }
.ikfx-badge { display: inline-flex; align-items: center; gap: 4px; }
.ikfx-badge .ikfx-dot { display: none; }

/* ---------- Level + bookmark filters ---------- */
.ikfx-filters2 { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; }
.ikfx-levels { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ikfx-levels-label { display: inline-flex; align-items: center; gap: 4px; font-size: .8em; font-weight: 700; color: var(--ikfx-muted); }
.ikfx-glossary .ikfx-lv,
.ikfx-glossary .ikfx-bm-filter {
	--lv: var(--ikfx-accent);
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 4px 11px;
	border-radius: 999px;
	font-size: .8em;
	font-weight: 600;
	line-height: 1.6;
	color: var(--ikfx-chip-text);
	background: transparent;
	border: 1px solid var(--ikfx-line);
	transition: background .2s, color .2s, border-color .2s;
}
.ikfx-lv i { width: 7px; height: 7px; border-radius: 50%; background: var(--lv); }
.ikfx-lv span { color: var(--ikfx-muted); font-size: .9em; }
.ikfx-glossary .ikfx-lv--beginner { --lv: #16a34a; }
.ikfx-glossary .ikfx-lv--intermediate { --lv: #d97706; }
.ikfx-glossary .ikfx-lv--advanced { --lv: #dc2626; }
.ikfx-glossary .ikfx-lv:hover,
.ikfx-glossary .ikfx-bm-filter:hover { border-color: var(--lv); }
.ikfx-glossary .ikfx-lv.is-active { color: #fff; background: var(--lv); border-color: var(--lv); }
.ikfx-glossary .ikfx-lv.is-active span { color: rgba(255, 255, 255, .85); }
.ikfx-glossary .ikfx-bm-filter { --lv: #eab308; }
.ikfx-bm-filter svg { color: #eab308; }
.ikfx-bm-count { min-width: 20px; padding: 0 6px; border-radius: 999px; text-align: center; font-weight: 700; background: var(--ikfx-chip); }
.ikfx-glossary .ikfx-bm-filter.is-active { color: #713f12; background: #fef3c7; border-color: #eab308; }
.ikfx-glossary .ikfx-bm-filter.is-active svg { fill: #eab308; }

/* ---------- Item header extras: level badge, bookmark star ---------- */
.ikfx-head-meta { display: flex; align-items: center; gap: 6px; flex: none; }
.ikfx-level {
	--lv: #64748b;
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 1px 9px;
	border-radius: 999px;
	font-size: .7em;
	font-weight: 700;
	line-height: 1.9;
	white-space: nowrap;
	color: var(--lv);
	background: rgba(100, 116, 139, .12);
}
.ikfx-level i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.ikfx-level--beginner { --lv: #16a34a; background: rgba(22, 163, 74, .12); }
.ikfx-level--intermediate { --lv: #d97706; background: rgba(217, 119, 6, .12); }
.ikfx-level--advanced { --lv: #dc2626; background: rgba(220, 38, 38, .11); }
.ikfx-star-mark { display: none; color: #eab308; font-size: 16px; }
.ikfx-glossary .ikfx-star-mark svg { fill: #eab308; }
.ikfx-item.is-starred .ikfx-star-mark { display: grid; }
.ikfx-glossary .ikfx-bookmark[aria-pressed="true"] { color: #a16207; border-color: #eab308; background: #fef9c3; }
.ikfx-glossary .ikfx-bookmark[aria-pressed="true"] svg { fill: #eab308; color: #eab308; }

/* ---------- Panel extras: image, example, formula, related, auto-links ---------- */
.ikfx-figure { margin: 0; padding-top: 12px; border-top: 1px dashed var(--ikfx-line); }
.ikfx-figure + .ikfx-def { border-top: 0; }
.ikfx-glossary .ikfx-zoom { display: block; width: 100%; cursor: zoom-in; border-radius: 12px; overflow: hidden; background: var(--ikfx-chip); }
.ikfx-glossary .ikfx-img { display: block; width: 100%; height: auto; max-height: 340px; object-fit: contain; margin: 0 auto; }
.ikfx-figure figcaption { margin-top: 6px; font-size: .8em; color: var(--ikfx-muted); text-align: center; }
.ikfx-example {
	margin-top: 12px;
	padding: 12px 14px;
	border-radius: 12px;
	background: var(--ikfx-chip);
	border: 1px solid var(--ikfx-line);
}
.ikfx-example-head { display: flex; align-items: center; gap: 6px; font-size: .82em; font-weight: 800; color: var(--ikfx-heading); }
.ikfx-example-head svg { color: #0ea5e9; }
.ikfx-glossary .ikfx-example-text { margin-top: 4px; font-size: .93em; line-height: 1.95; color: var(--ikfx-text); }
.ikfx-formula {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-top: 8px;
	padding: 8px 12px;
	border-radius: 10px;
	direction: ltr;
	text-align: left;
	background: var(--ikfx-card);
	border: 1px solid var(--ikfx-line);
	overflow-x: auto;
}
.ikfx-example-text + .ikfx-formula { margin-top: 10px; }
.ikfx-example > .ikfx-formula:first-child { margin-top: 0; }
.ikfx-formula-icon { color: #8b5cf6; font-size: 16px; }
.ikfx-glossary .ikfx-formula code {
	padding: 0;
	font: 600 .9em/1.6 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
	color: var(--ikfx-heading);
	background: none;
	white-space: nowrap;
}
.ikfx-related { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; font-size: .84em; }
.ikfx-related-label { font-weight: 800; color: var(--ikfx-muted); }
.ikfx-glossary .ikfx-rel {
	padding: 3px 10px;
	border-radius: 999px;
	color: var(--ikfx-accent);
	background: var(--ikfx-soft);
	border: 1px solid transparent;
	transition: border-color .2s, background .2s;
}
.ikfx-glossary .ikfx-rel:hover { border-color: rgba(var(--ikfx-accent-rgb), .5); background: transparent; }
.ikfx-glossary .ikfx-def a.ikfx-autolink {
	color: inherit;
	text-decoration: underline dotted;
	text-decoration-color: var(--ikfx-accent);
	text-decoration-thickness: 2px;
	text-underline-offset: 4px;
}
.ikfx-glossary .ikfx-def a.ikfx-autolink:hover { color: var(--ikfx-accent); }

/* ---------- Did you mean ---------- */
.ikfx-suggest { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; font-size: .9em; }
.ikfx-suggest > span { color: var(--ikfx-heading); font-weight: 700; }
.ikfx-glossary .ikfx-suggest-btn {
	display: inline-flex;
	align-items: baseline;
	gap: 6px;
	padding: 4px 12px;
	border-radius: 999px;
	font-weight: 700;
	color: var(--ikfx-accent);
	background: var(--ikfx-soft);
}
.ikfx-suggest-btn small { font-weight: 400; color: var(--ikfx-muted); }
.ikfx-glossary .ikfx-suggest-btn:hover { background: var(--ikfx-accent); color: #fff; }
.ikfx-glossary .ikfx-suggest-btn:hover small { color: rgba(255, 255, 255, .85); }

/* ---------- Grid view ---------- */
.ikfx-list.ikfx-view-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	align-items: start;
}
.ikfx-view-grid .ikfx-item.is-open { grid-column: 1 / -1; }
.ikfx-view-grid .ikfx-item:not(.is-open) .ikfx-badge { display: none; }
.ikfx-view-grid .ikfx-item:not(.is-open) .ikfx-toggle { min-height: 84px; }

/* ---------- Lazy loading ---------- */
.ikfx-lazy-note { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 10px; font-size: .8em; color: var(--ikfx-muted); }
.ikfx-spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--ikfx-line); border-top-color: var(--ikfx-accent); animation: ikfx-spin .8s linear infinite; }
@keyframes ikfx-spin { to { transform: rotate(360deg); } }

/* ---------- Back to top ---------- */
.ikfx-glossary .ikfx-to-top {
	position: fixed;
	z-index: 9990;
	bottom: 24px;
	left: 24px;
	display: grid;
	place-items: center;
	width: 46px;
	height: 46px;
	border-radius: 14px;
	font-size: 22px;
	color: #fff;
	background: linear-gradient(135deg, var(--ikfx-accent-2), var(--ikfx-accent));
	box-shadow: 0 12px 26px -10px rgba(var(--ikfx-accent-rgb), .8);
	animation: ikfx-pop .25s var(--ikfx-ease);
}
.ikfx-glossary .ikfx-to-top:hover { transform: translateY(-2px); }
@keyframes ikfx-pop { from { opacity: 0; transform: translateY(10px); } }

/* ---------- Lightbox ---------- */
.ikfx-lightbox {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: none;
	place-items: center;
	padding: 24px;
	background: rgba(15, 23, 42, .85);
	cursor: zoom-out;
}
.ikfx-lightbox.is-open { display: grid; }
.ikfx-lightbox img { max-width: 100%; max-height: 90vh; border-radius: 12px; background: #fff; box-shadow: 0 30px 60px rgba(0, 0, 0, .5); }
.ikfx-lightbox-close {
	position: absolute;
	top: 16px;
	left: 16px;
	width: 42px;
	height: 42px;
	border: 0;
	border-radius: 50%;
	font-size: 26px;
	line-height: 1;
	color: #fff;
	background: rgba(255, 255, 255, .15);
	cursor: pointer;
}

/* ---------- Quiz (modal + standalone) ---------- */
html.ikfx-lock { overflow: hidden; }
.ikfx-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: grid;
	place-items: center;
	padding: 16px;
	background: rgba(15, 23, 42, .6);
	-webkit-backdrop-filter: blur(3px);
	backdrop-filter: blur(3px);
	opacity: 0;
	transition: opacity .2s;
}
.ikfx-modal.is-open { opacity: 1; }
.ikfx-modal-box {
	position: relative;
	width: min(620px, 100%);
	max-height: calc(100vh - 32px);
	overflow-y: auto;
	padding: 26px 24px 22px;
	border-radius: var(--ikfx-radius, 16px);
	background: var(--ikfx-card);
	box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .5);
	transform: translateY(12px) scale(.98);
	transition: transform .25s var(--ikfx-ease);
}
.ikfx-modal.is-open .ikfx-modal-box { transform: none; }
.ikfx-glossary .ikfx-modal-close {
	position: absolute;
	top: 12px;
	left: 12px;
	display: grid;
	place-items: center;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	font-size: 22px;
	line-height: 1;
	color: var(--ikfx-muted);
	background: var(--ikfx-chip);
}
.ikfx-glossary .ikfx-modal-close:hover { color: var(--ikfx-heading); }
.ikfx-quiz { display: flex; flex-direction: column; gap: 12px; }
.ikfx-quiz-top { display: flex; justify-content: space-between; gap: 10px; padding-left: 40px; font-size: .84em; font-weight: 700; color: var(--ikfx-muted); }
.ikfx-quiz-standalone .ikfx-quiz-top { padding-left: 0; }
.ikfx-quiz-score { color: var(--ikfx-accent); }
.ikfx-quiz-progress { height: 6px; border-radius: 999px; background: var(--ikfx-chip); overflow: hidden; }
.ikfx-quiz-progress i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--ikfx-accent-2), var(--ikfx-accent)); transition: width .4s var(--ikfx-ease); }
.ikfx-glossary .ikfx-quiz-kind { margin-top: 4px; font-size: .9em; font-weight: 700; color: var(--ikfx-muted); }
.ikfx-quiz-term { padding: 10px; border-radius: 12px; font-size: 1.5em; font-weight: 800; text-align: center; color: var(--ikfx-heading); background: var(--ikfx-item); }
.ikfx-glossary .ikfx-quiz-def { padding: 12px 14px; border-radius: 12px; line-height: 2; color: var(--ikfx-heading); background: var(--ikfx-item); border-right: 3px solid var(--ikfx-accent); }
.ikfx-quiz-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ikfx-glossary .ikfx-quiz-opt {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 12px;
	border-radius: 12px;
	font-weight: 600;
	line-height: 1.6;
	color: var(--ikfx-heading);
	background: var(--ikfx-card);
	border: 1.5px solid var(--ikfx-line);
	transition: border-color .2s, background .2s, transform .15s;
}
.ikfx-glossary .ikfx-quiz-opt:hover:not(:disabled) { border-color: var(--ikfx-accent); transform: translateY(-1px); }
.ikfx-quiz-key {
	display: grid;
	place-items: center;
	flex: none;
	width: 26px;
	height: 26px;
	border-radius: 8px;
	font-size: .85em;
	color: var(--ikfx-muted);
	background: var(--ikfx-chip);
}
.ikfx-glossary .ikfx-quiz-opt.is-right { border-color: #16a34a; background: #f0fdf4; color: #14532d; }
.ikfx-glossary .ikfx-quiz-opt.is-right .ikfx-quiz-key { background: #16a34a; color: #fff; }
.ikfx-glossary .ikfx-quiz-opt.is-wrong { border-color: #dc2626; background: #fef2f2; color: #7f1d1d; }
.ikfx-glossary .ikfx-quiz-opt.is-wrong .ikfx-quiz-key { background: #dc2626; color: #fff; }
.ikfx-glossary .ikfx-quiz-opt:disabled { cursor: default; }
.ikfx-quiz-feedback:empty { display: none; }
.ikfx-quiz-feedback { padding: 12px 14px; border-radius: 12px; font-size: .9em; line-height: 1.95; animation: ikfx-pop .25s var(--ikfx-ease); }
.ikfx-quiz-feedback.is-right { background: rgba(22, 163, 74, .08); border: 1px solid rgba(22, 163, 74, .3); }
.ikfx-quiz-feedback.is-wrong { background: rgba(220, 38, 38, .07); border: 1px solid rgba(220, 38, 38, .25); }
.ikfx-quiz-feedback.is-right strong { color: #16a34a; }
.ikfx-quiz-feedback.is-wrong strong { color: #dc2626; }
.ikfx-glossary .ikfx-quiz-feedback p { margin-top: 4px; color: var(--ikfx-text); }
.ikfx-glossary .ikfx-quiz-tip { color: var(--ikfx-heading); }
.ikfx-quiz-actions { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 10px; }
.ikfx-glossary .ikfx-quiz-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin-right: auto;
	padding: 9px 22px;
	border-radius: 12px;
	font-weight: 800;
	color: #fff;
	background: linear-gradient(135deg, var(--ikfx-accent-2), var(--ikfx-accent));
	box-shadow: 0 10px 22px -10px rgba(var(--ikfx-accent-rgb), .8);
	transition: transform .2s;
}
.ikfx-glossary .ikfx-quiz-btn:hover { transform: translateY(-1px); }
.ikfx-glossary .ikfx-quiz-link { font-size: .9em; font-weight: 700; color: var(--ikfx-accent); }
.ikfx-quiz--intro,
.ikfx-quiz--result { align-items: center; text-align: center; padding: 8px 0; }
.ikfx-glossary .ikfx-quiz--intro .ikfx-quiz-btn,
.ikfx-glossary .ikfx-quiz--result .ikfx-quiz-btn { margin: 4px auto 0; }
.ikfx-quiz-badge { padding: 3px 12px; border-radius: 999px; font-size: .8em; font-weight: 800; color: var(--ikfx-accent); background: var(--ikfx-soft); }
.ikfx-glossary .ikfx-quiz-title { font-size: 1.35em; font-weight: 800; color: var(--ikfx-heading); }
.ikfx-glossary .ikfx-quiz-sub { color: var(--ikfx-muted); font-size: .92em; }
.ikfx-glossary .ikfx-quiz-msg { font-weight: 700; color: var(--ikfx-heading); }
.ikfx-glossary .ikfx-quiz-ring { width: 130px; height: 130px; transform: rotate(-90deg); }
.ikfx-quiz-ring circle { fill: none; stroke-width: 10; }
.ikfx-quiz-ring .bg { stroke: var(--ikfx-chip); }
.ikfx-quiz-ring .fg { stroke: var(--ikfx-accent); stroke-linecap: round; transition: stroke-dashoffset 1s var(--ikfx-ease); }
.ikfx-quiz-pct { margin-top: -96px; margin-bottom: 46px; font-size: 1.7em; font-weight: 800; color: var(--ikfx-heading); }
.ikfx-quiz-review { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; padding: 12px; border-radius: 12px; background: var(--ikfx-item); font-size: .88em; }
.ikfx-quiz-review b { width: 100%; color: var(--ikfx-heading); }
.ikfx-glossary .ikfx-quiz-review .ikfx-quiz-link { padding: 3px 10px; border-radius: 999px; background: var(--ikfx-soft); }
.ikfx-quiz-review small { color: var(--ikfx-muted); font-weight: 400; }
.ikfx-quiz-standalone { margin: 24px auto; }
.ikfx-quiz-loading { text-align: center; color: var(--ikfx-muted); }

/* Dark-mode state colours */
.ikfx-theme-dark .ikfx-quiz-opt.is-right { background: rgba(22, 163, 74, .15) !important; color: #bbf7d0 !important; }
.ikfx-theme-dark .ikfx-quiz-opt.is-wrong { background: rgba(220, 38, 38, .15) !important; color: #fecaca !important; }
.ikfx-theme-dark .ikfx-bm-filter.is-active,
.ikfx-theme-dark .ikfx-bookmark[aria-pressed="true"] { background: rgba(234, 179, 8, .15) !important; color: #fde68a !important; }
@media (prefers-color-scheme: dark) {
	.ikfx-theme-auto .ikfx-quiz-opt.is-right { background: rgba(22, 163, 74, .15) !important; color: #bbf7d0 !important; }
	.ikfx-theme-auto .ikfx-quiz-opt.is-wrong { background: rgba(220, 38, 38, .15) !important; color: #fecaca !important; }
	.ikfx-theme-auto .ikfx-bm-filter.is-active,
	.ikfx-theme-auto .ikfx-bookmark[aria-pressed="true"] { background: rgba(234, 179, 8, .15) !important; color: #fde68a !important; }
}

/* ---------- Density ---------- */
.ikfx-density-compact { --ikfx-pad: 18px; --ikfx-gap: 7px; --ikfx-indent: 58px; }
.ikfx-density-compact .ikfx-toggle { padding: 10px 14px; gap: 12px; }
.ikfx-density-compact .ikfx-avatar { width: 32px; height: 32px; border-radius: 9px; font-size: .95em; }
.ikfx-density-compact .ikfx-name-main { font-size: 1em; }
.ikfx-density-compact .ikfx-chevron { width: 28px; height: 28px; font-size: 16px; }
.ikfx-density-compact .ikfx-glossary .ikfx-search-input,
.ikfx-glossary.ikfx-density-compact .ikfx-search-input { height: 44px; border-radius: 12px; }
.ikfx-glossary.ikfx-density-compact .ikfx-card { --ikfx-cell: 30px; }
.ikfx-density-compact .ikfx-head-icon { width: 42px; height: 42px; font-size: 20px; border-radius: 12px; }
.ikfx-density-compact .ikfx-alpha { margin-top: 16px; }

/* ---------- Responsive (container-based: works in sidebars too) ---------- */
@container (max-width: 640px) {
	.ikfx-card { padding: 18px; }
	.ikfx-glossary .ikfx-title { font-size: 1.25em; }
	.ikfx-head-icon { width: 42px; height: 42px; font-size: 20px; border-radius: 12px; }
	.ikfx-filters-side .ikfx-alpha-groups { grid-template-columns: 1fr; }
	.ikfx-filters-side .ikfx-alpha-groups > .ikfx-alpha-group + .ikfx-alpha-group { border-right: 0; padding-right: 0; border-top: 1px solid var(--ikfx-line); padding-top: 12px; }
	.ikfx-badge { display: none; }
	.ikfx-glossary .ikfx-toggle { padding: 12px 14px; gap: 12px; }
	.ikfx-avatar { width: 34px; height: 34px; }
	.ikfx-panel-inner > * { margin-right: 14px; margin-left: 14px; }
	.ikfx-card { --ikfx-cell: 34px; }
	.ikfx-list.ikfx-view-grid { display: flex; }
	.ikfx-view-toggle { display: none; }
	.ikfx-glossary .ikfx-totd { grid-template-columns: 1fr; }
	.ikfx-totd-label { grid-row: auto; justify-self: start; }
	.ikfx-totd-text, .ikfx-totd-go { grid-column: 1; grid-row: auto; }
	.ikfx-quiz-options { grid-template-columns: 1fr; }
	.ikfx-glossary .ikfx-to-top { bottom: 16px; left: 16px; width: 42px; height: 42px; }
	.ikfx-alpha { margin-top: 18px; }
}
@container (max-width: 420px) {
	.ikfx-header { flex-wrap: wrap; }
	.ikfx-subtitle { display: none; }
	.ikfx-total { flex-direction: row; gap: 6px; padding: 4px 12px; }
	.ikfx-total b { font-size: 1em; }
	.ikfx-alpha { padding: 10px; }
	.ikfx-kbd { display: none; }
	.ikfx-card { --ikfx-cell: 32px; }
	.ikfx-seg { display: flex; }
	.ikfx-glossary .ikfx-seg-btn { flex: 1; }
	/* Category chips become a swipeable row; the fade hints that more chips follow. */
	.ikfx-cats {
		flex-wrap: nowrap;
		overflow-x: auto;
		margin-left: calc(var(--ikfx-pad) * -1);
		padding: 2px 0 6px 28px;
		scrollbar-width: none;
		-webkit-mask-image: linear-gradient(to left, #000 calc(100% - 36px), transparent);
		mask-image: linear-gradient(to left, #000 calc(100% - 36px), transparent);
	}
	.ikfx-cats::-webkit-scrollbar { display: none; }
	.ikfx-glossary .ikfx-cat { flex: none; }
	.ikfx-glossary .ikfx-search-input { height: 48px; padding-left: 14px; padding-right: 44px; font-size: .93em; }
	.ikfx-search.has-value .ikfx-search-input { padding-left: 48px; }
	.ikfx-tip { display: block; padding: 10px 12px; }
	.ikfx-tip-icon { float: right; width: 26px; height: 26px; margin: 1px 0 2px 10px; font-size: 14px; border-radius: 8px; }
	.ikfx-tip::after { content: ""; display: table; clear: both; }
	.ikfx-head-side { order: 3; width: 100%; justify-content: space-between; }
	.ikfx-bar { flex-direction: column; align-items: stretch; gap: 6px; }
	.ikfx-tools { justify-content: flex-start; }
	.ikfx-glossary .ikfx-tool span { display: none; }
	.ikfx-glossary .ikfx-tool.ikfx-quiz-open span { display: inline; }
	.ikfx-filters2 { align-items: flex-start; }
	.ikfx-levels-label { display: none; }
	.ikfx-lv span { display: none; }
	.ikfx-levels { flex-wrap: nowrap; gap: 4px; }
	.ikfx-glossary .ikfx-lv { padding: 4px 9px; }
	.ikfx-head-meta .ikfx-level { display: none; }
	.ikfx-quiz-term { font-size: 1.25em; }
}

/* ---------- Single term page ---------- */
.ikfx-single { margin: 0 0 24px; }
.ikfx-single .ikfx-card > * + * { margin-top: 14px; }
.ikfx-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .82em; color: var(--ikfx-muted); }
.ikfx-glossary .ikfx-crumbs a { color: var(--ikfx-accent); font-weight: 600; }
.ikfx-single-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.ikfx-single-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.ikfx-single-badges .ikfx-badge { display: inline-flex; }
.ikfx-single-fa {
	padding: 4px 14px;
	border-radius: 999px;
	font-size: 1.1em;
	font-weight: 800;
	color: var(--ikfx-accent);
	background: var(--ikfx-soft);
}
.ikfx-single .ikfx-def { border-top: 0; padding-top: 0; }
.ikfx-single .ikfx-related .ikfx-rel small { color: var(--ikfx-muted); font-weight: 400; }
.ikfx-glossary .ikfx-back-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--ikfx-accent); }

/* ---------- Motion & print ---------- */
@media (prefers-reduced-motion: reduce) {
	.ikfx-glossary *, .ikfx-glossary *::before { transition: none !important; animation: none !important; }
}
@media print {
	.ikfx-alpha, .ikfx-search-wrap, .ikfx-cats, .ikfx-filters2, .ikfx-popular, .ikfx-totd, .ikfx-bar, .ikfx-more-wrap, .ikfx-actions, .ikfx-chevron, .ikfx-toast, .ikfx-to-top, .ikfx-theme-toggle { display: none !important; }
	.ikfx-item.is-hidden { display: block !important; }
	.ikfx-panel { grid-template-rows: 1fr !important; }
	.ikfx-panel-inner { visibility: visible !important; }
	.ikfx-card { box-shadow: none; }
	.ikfx-item { break-inside: avoid; }
}
