/* ==================================================================
 * فهمني app shell — account control, bottom tab bar, sheets, فهيم chat,
 * install prompt, course bar, and phone/tablet polish.
 * Phones and tablets (≤1024px) get the app layout; desktop keeps the site layout.
 * ================================================================== */
:root {
	--fh-tabbar-h: 64px;
	--fh-safe-b: env(safe-area-inset-bottom, 0px);
	--fh-safe-t: env(safe-area-inset-top, 0px);
	--fh-ink: #22124f;
	--fh-line: rgba(106, 61, 232, .12);
	--fh-shadow-lg: 0 30px 70px -24px rgba(34, 18, 79, .45);
	--fh-ease: cubic-bezier(.2, .8, .2, 1);
}

html { -webkit-tap-highlight-color: transparent; }
html.fh-lock, html.fh-lock body { overflow: hidden; }
.fh-app [hidden] { display: none !important; }

/* ------------------------------------------------------------------ buttons */
.fh-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 48px;
	padding: 0 22px !important;
	border: 0 !important;
	border-radius: 999px !important;
	font: 700 16px/1 var(--fh-font-body) !important;
	text-decoration: none !important;
	cursor: pointer;
	transition: transform .2s var(--fh-ease), box-shadow .2s ease, background-color .2s ease, opacity .2s ease !important;
	box-shadow: none;
}
.fh-btn--primary { background: linear-gradient(135deg, #7c4dff, var(--fh-primary)) !important; color: #fff !important; box-shadow: 0 12px 26px -12px rgba(106, 61, 232, .8) !important; }
.fh-btn--primary:hover { transform: translateY(-2px); color: #fff !important; }
.fh-btn--soft { background: var(--fh-soft) !important; color: var(--fh-primary) !important; }
.fh-btn--sm { min-height: 38px; padding: 0 16px !important; font-size: 14px !important; }
.fh-btn--block { width: 100%; }
.fh-btn:disabled { opacity: .6; cursor: progress; transform: none; }
.fh-link { padding: 0 !important; border: 0 !important; background: none !important; color: var(--fh-primary) !important; font: inherit !important; font-weight: 700 !important; cursor: pointer; box-shadow: none !important; text-decoration: underline; text-underline-offset: 3px; }

/* ------------------------------------------------------------------ header account control */
.top-bar-user-links { display: none !important; }

.fh-acct {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: 44px;
	margin-inline-start: 12px;
	padding: 0 16px 0 18px !important;
	border: 1.5px solid var(--fh-line) !important;
	border-radius: 999px !important;
	background: #fff !important;
	color: var(--fh-ink) !important;
	font: 700 15px/1 var(--fh-font-body) !important;
	cursor: pointer;
	white-space: nowrap;
	box-shadow: 0 6px 18px -12px rgba(34, 18, 79, .4) !important;
	transition: border-color .2s ease, background-color .2s ease, transform .2s var(--fh-ease) !important;
}
.fh-acct:hover, .fh-acct:focus-visible { border-color: rgba(106, 61, 232, .45) !important; background: var(--fh-soft) !important; transform: translateY(-1px); }
.fh-acct svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.fh-acct--guest svg { color: var(--fh-primary); }
.fh-acct--user { padding: 0 6px 0 12px !important; }
.fh-acct__name { max-width: 110px; overflow: hidden; text-overflow: ellipsis; }
.fh-acct__chev { width: 16px !important; height: 16px !important; opacity: .55; transition: transform .2s ease; }
.fh-acct[aria-expanded="true"] .fh-acct__chev { transform: rotate(180deg); }

.fh-avatar { display: inline-grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 50%; overflow: hidden; }
.fh-avatar--lg { width: 46px; height: 46px; font-size: 20px; }
.fh-avatar__img { width: 100%; height: 100%; object-fit: cover; }
.fh-avatar__ini {
	display: grid;
	place-items: center;
	width: 100%;
	height: 100%;
	background: linear-gradient(135deg, hsl(var(--h) 80% 62%), hsl(calc(var(--h) + 40) 75% 52%));
	color: #fff;
	font: 700 1em/1 var(--fh-font-heading);
}
.fh-acct-wrap { position: relative; }
.fh-acct-menu {
	position: absolute;
	top: calc(100% + 10px);
	inset-inline-end: 0;
	z-index: 100000;
	width: 270px;
	padding: 8px;
	border: 1px solid var(--fh-line);
	border-radius: 20px;
	background: #fff;
	box-shadow: var(--fh-shadow-lg);
	animation: fh-pop .22s var(--fh-ease);
	transform-origin: top left;
}
.fh-acct-menu__head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; padding: 10px 10px 14px; border-bottom: 1px solid var(--fh-line); }
.fh-acct-menu__head b { display: block; color: var(--fh-ink); font-size: 15px; line-height: 1.4; }
.fh-acct-menu__head small { display: block; max-width: 170px; overflow: hidden; color: var(--fh-muted); font-size: 12px; text-overflow: ellipsis; direction: ltr; text-align: end; }
.fh-acct-menu a, .fh-acct-menu button {
	display: flex;
	width: 100%;
	align-items: center;
	gap: 10px;
	padding: 11px 12px !important;
	border: 0 !important;
	border-radius: 12px !important;
	background: none !important;
	color: var(--fh-ink) !important;
	font: 500 15px/1.3 var(--fh-font-body) !important;
	text-align: start;
	text-decoration: none !important;
	cursor: pointer;
	box-shadow: none !important;
}
.fh-acct-menu a:hover, .fh-acct-menu a:focus-visible, .fh-acct-menu button:hover { background: var(--fh-soft) !important; color: var(--fh-primary) !important; transform: none; }
.fh-acct-menu .is-out { margin-top: 4px; border-top: 1px solid var(--fh-line) !important; border-radius: 0 0 12px 12px !important; color: #d6455d !important; }

/* Desktop header: the menu stays on one line; the search box gives up width first. */
@media (min-width: 1025px) {
	.page-header .header-right-inner-content { flex-wrap: nowrap; }
	#page-navigation { flex: none; }
	#page-navigation .menu__container { flex-wrap: nowrap; }
	#page-navigation .menu__container > li { flex: none; }
	#page-navigation .menu__container > li > a { white-space: nowrap; }
	.page-header .header-search-form { flex: 1 1 auto; min-width: 120px; }
}
@media (min-width: 1025px) and (max-width: 1499px) {
	.desktop-menu .menu--primary > ul > li > a { padding-inline: 10px !important; }
}

/* Desktop header is tight: avatar only until there is room for the name. */
@media (min-width: 1025px) and (max-width: 1599px) {
	.fh-acct { margin-inline-start: 8px; }
	.fh-acct--user { padding: 0 4px 0 8px !important; }
	.fh-acct--user .fh-acct__name { display: none; }
	.fh-acct--guest { padding: 0 14px !important; }
}

@keyframes fh-pop { from { opacity: 0; transform: translateY(-6px) scale(.97); } }

/* ------------------------------------------------------------------ sheets (account, install how-to) */
.fh-sheet { position: fixed; inset: 0; z-index: 100010; display: grid; place-items: center; padding: 20px; }
.fh-sheet__scrim { position: absolute; inset: 0; background: rgba(23, 12, 56, .5); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); opacity: 0; transition: opacity .28s ease; }
.fh-sheet__panel {
	position: relative;
	width: min(460px, 100%);
	max-height: calc(100dvh - 40px);
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 28px 26px 24px;
	border-radius: 28px;
	background: #fff;
	box-shadow: var(--fh-shadow-lg);
	opacity: 0;
	transform: translateY(18px) scale(.98);
	transition: transform .3s var(--fh-ease), opacity .25s ease;
	outline: none;
	font-family: var(--fh-font-body);
}
.fh-sheet.is-open .fh-sheet__scrim { opacity: 1; }
.fh-sheet.is-open .fh-sheet__panel { opacity: 1; transform: none; }
.fh-sheet__grab { display: none; }
.fh-sheet__x {
	position: absolute;
	top: 14px;
	inset-inline-end: 14px;
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 50% !important;
	background: var(--fh-soft) !important;
	color: var(--fh-primary) !important;
	font-size: 22px !important;
	line-height: 1;
	cursor: pointer;
	box-shadow: none !important;
}

.fh-auth__head { display: flex; align-items: center; gap: 14px; margin: 0 0 18px; padding-inline-end: 36px; }
.fh-auth__fahim { width: 64px; height: 64px; flex: none; }
.fh-auth__head h2 { margin: 0 0 2px; color: var(--fh-ink); font-size: 23px; line-height: 1.35; }
.fh-auth__head p { margin: 0; color: var(--fh-muted); font-size: 14.5px; line-height: 1.6; }

.fh-seg { position: relative; display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 18px; padding: 5px; border-radius: 999px; background: var(--fh-soft); }
.fh-seg button {
	position: relative;
	z-index: 1;
	height: 42px;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 999px !important;
	background: none !important;
	color: var(--fh-muted) !important;
	font: 700 15px/1 var(--fh-font-body) !important;
	cursor: pointer;
	box-shadow: none !important;
	transition: color .2s ease !important;
}
.fh-seg button[aria-selected="true"] { color: var(--fh-primary) !important; transform: none; }
.fh-seg__thumb { position: absolute; top: 5px; bottom: 5px; inset-inline-start: 5px; width: calc(50% - 5px); border-radius: 999px; background: #fff; box-shadow: 0 4px 14px -6px rgba(34, 18, 79, .35); transition: inset-inline-start .3s var(--fh-ease); }
[data-tab="register"] .fh-seg__thumb { inset-inline-start: 50%; }

.fh-form { display: grid; gap: 14px; }
.fh-form.is-busy { pointer-events: none; }
.fh-form.is-busy [type=submit] { opacity: .7; }
.fh-field { display: grid; gap: 6px; margin: 0; padding: 0; border: 0; min-width: 0; }
.fh-field > span, .fh-field legend { color: var(--fh-ink); font-size: 14px; font-weight: 700; padding: 0; }
.fh-field small { color: var(--fh-muted); font-weight: 400; }
.fh-field input[type=text], .fh-field input[type=email], .fh-field input[type=password], .fh-field input[type=date] {
	width: 100%;
	height: 50px;
	margin: 0;
	padding: 0 16px !important;
	border: 1.5px solid #e4ddf7 !important;
	border-radius: 14px !important;
	background: #fbfaff !important;
	color: var(--fh-ink) !important;
	font: 500 16px/1 var(--fh-font-body) !important; /* 16px: no iOS zoom on focus */
	box-shadow: none !important;
	transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}
.fh-field input:focus { border-color: var(--fh-primary) !important; background: #fff !important; box-shadow: 0 0 0 4px rgba(106, 61, 232, .14) !important; outline: none; }
.fh-field input[aria-invalid="true"] { border-color: #e0526b !important; box-shadow: 0 0 0 4px rgba(224, 82, 107, .12) !important; }
.fh-field input::placeholder { color: #a9a3c2; }
.fh-pass, .fh-pass.password-input { position: relative !important; display: block !important; }
/* WooCommerce wraps every password field and adds its own toggle; the sheet has one already. */
.fh-pass .show-password-input { display: none !important; }
.fh-pass input { padding-inline-end: 50px !important; }
.fh-sheet .fh-pass .fh-pass__eye { position: absolute !important; top: 50% !important; inset-inline-end: 6px !important; left: auto; display: grid; place-items: center; width: 40px !important; height: 40px !important; min-width: 0 !important; min-height: 0 !important; margin: 0 !important; padding: 0 !important; border: 0 !important; border-radius: 50% !important; background: transparent !important; color: inherit !important; font-size: 18px !important; line-height: 1 !important; transform: translateY(-50%) !important; cursor: pointer; box-shadow: none !important; }
.fh-sheet .fh-pass .fh-pass__eye:hover { background: var(--fh-soft) !important; }
[dir="rtl"] .fh-sheet .fh-pass .fh-pass__eye { left: 6px !important; right: auto !important; }
.fh-form__grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 12px; align-items: end; }
.fh-gender { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fh-gender legend { grid-column: 1 / -1; margin-bottom: 6px; }
.fh-gender label { margin: 0; cursor: pointer; }
.fh-gender input { position: absolute; opacity: 0; pointer-events: none; }
.fh-gender span { display: grid; place-items: center; height: 50px; border: 1.5px solid #e4ddf7; border-radius: 14px; background: #fbfaff; color: var(--fh-ink); font-size: 15px; font-weight: 700; transition: all .2s ease; }
.fh-gender input:checked + span { border-color: var(--fh-primary); background: var(--fh-soft); color: var(--fh-primary); box-shadow: 0 0 0 3px rgba(106, 61, 232, .12); }
.fh-gender input:focus-visible + span { outline: 3px solid rgba(106, 61, 232, .4); outline-offset: 2px; }
.fh-form__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 14px; }
.fh-form__row a { color: var(--fh-primary); font-weight: 700; }
.fh-check { display: flex; align-items: flex-start; gap: 8px; margin: 0; color: var(--fh-ink); font-size: 14px; line-height: 1.6; cursor: pointer; }
.fh-check input { width: 18px; height: 18px; margin: 3px 0 0; flex: none; accent-color: var(--fh-primary); }
.fh-check--consent { padding: 12px; border-radius: 14px; background: #fffaeb; font-size: 13.5px; }
.fh-check--consent a { color: var(--fh-primary); font-weight: 700; }
.fh-form__msg { min-height: 0; margin: 0; color: #c93a54; font-size: 14px; font-weight: 700; line-height: 1.6; }
.fh-form__msg:empty { display: none; }
.fh-form__msg.is-ok { color: #0f8f7f; }
.fh-form__alt, .fh-form__note { margin: 0; color: var(--fh-muted); font-size: 13.5px; text-align: center; line-height: 1.6; }

.fh-ios { text-align: center; }
.fh-ios > img { display: block; margin: 0 auto 10px; border-radius: 18px; box-shadow: 0 12px 30px -12px rgba(106, 61, 232, .6); }
.fh-ios h2 { margin: 0 0 14px; color: var(--fh-ink); font-size: 22px; }
.fh-ios ol { display: grid; gap: 10px; margin: 0 0 18px; padding: 0; list-style: none; text-align: start; }
.fh-ios li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--fh-soft); color: var(--fh-ink); font-size: 15px; line-height: 1.6; }
.fh-ios li > span { display: grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: 50%; background: var(--fh-primary); color: #fff; font-weight: 700; }
.fh-ios__other { margin: 0 0 18px; padding: 14px; border-radius: 16px; background: var(--fh-soft); color: var(--fh-ink); line-height: 1.8; }

/* ------------------------------------------------------------------ فهيم launcher (desktop) */
.fh-launch { position: fixed; inset-inline-start: 22px; bottom: 22px; z-index: 9990; font-family: var(--fh-font-body); }
.fh-launch__btn {
	position: relative;
	width: 72px;
	height: 72px;
	padding: 4px !important;
	border: 0 !important;
	border-radius: 50% !important;
	background: radial-gradient(circle at 50% 40%, #fff 0 55%, #f1eaff 100%) !important;
	box-shadow: 0 14px 32px -12px rgba(34, 18, 79, .55), 0 0 0 4px rgba(255, 197, 49, .6) !important;
	cursor: pointer;
	transition: transform .25s var(--fh-bounce) !important;
}
.fh-launch__btn:hover { transform: translateY(-4px) rotate(-6deg) !important; }
.fh-launch__btn:focus-visible { outline: 3px solid var(--fh-primary); outline-offset: 4px; }
.fh-launch__fahim { width: 100%; height: 100%; }
.fh-launch__ping { position: absolute; top: 4px; inset-inline-end: 4px; width: 14px; height: 14px; border: 3px solid #fff; border-radius: 50%; background: #22c55e; }
.fh-chat-on .fh-launch__btn { transform: scale(.92); box-shadow: 0 0 0 4px var(--fh-primary) !important; }
.fh-launch__nudge {
	position: absolute;
	bottom: 88px;
	inset-inline-start: 0;
	width: max-content;
	max-width: min(300px, calc(100vw - 40px));
	padding: 13px 40px 13px 16px;
	padding-inline: 16px 40px;
	border: 2px solid #efe8ff;
	border-radius: 20px;
	border-end-start-radius: 6px;
	background: #fff;
	color: var(--fh-ink);
	font-size: 15px;
	font-weight: 500;
	line-height: 1.7;
	box-shadow: 0 20px 44px -16px rgba(34, 18, 79, .45);
	cursor: pointer;
	opacity: 0;
	transform: translateY(8px) scale(.94);
	transform-origin: bottom right;
	transition: opacity .25s ease, transform .3s var(--fh-bounce);
}
.fh-launch__nudge.is-in { opacity: 1; transform: none; }
.fh-launch__nudge button { position: absolute; top: 8px; inset-inline-end: 8px; width: 24px; height: 24px; padding: 0 !important; border: 0 !important; border-radius: 50% !important; background: var(--fh-soft) !important; color: var(--fh-primary) !important; font-size: 16px !important; line-height: 1; cursor: pointer; box-shadow: none !important; }

/* ------------------------------------------------------------------ chat panel */
.fh-chat { position: fixed; inset: 0; z-index: 100005; pointer-events: none; font-family: var(--fh-font-body); }
.fh-chat__scrim { display: none; }
.fh-chat__panel {
	position: absolute;
	inset-inline-start: 22px;
	bottom: 108px;
	display: flex;
	flex-direction: column;
	width: 410px;
	height: min(680px, calc(100vh - 140px));
	overflow: hidden;
	border-radius: 28px;
	background: #faf8ff;
	box-shadow: 0 40px 90px -30px rgba(34, 18, 79, .6), 0 0 0 1px rgba(106, 61, 232, .1);
	pointer-events: auto;
	opacity: 0;
	transform: translateY(20px) scale(.96);
	transform-origin: bottom right;
	transition: opacity .25s ease, transform .32s var(--fh-ease);
}
.fh-chat.is-open .fh-chat__panel { opacity: 1; transform: none; }

.fh-chat__head {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 14px 14px 14px 12px;
	background: radial-gradient(circle at 90% -40%, #9a74ff 0, transparent 60%), linear-gradient(135deg, #7c4dff, var(--fh-primary) 60%, #5126c9);
	color: #fff;
}
.fh-chat__back { display: none; }
.fh-chat__avatar { display: grid; place-items: center; width: 46px; height: 46px; flex: none; padding: 3px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px rgba(255, 197, 49, .7); }
.fh-chat__fahim { width: 100%; height: 100%; }
.fh-chat__who { flex: 1; min-width: 0; line-height: 1.3; }
.fh-chat__who b { display: block; font: 700 19px/1.2 var(--fh-font-heading); }
.fh-chat__who small { display: flex; align-items: center; gap: 6px; opacity: .9; font-size: 12.5px; }
.fh-dot { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 3px rgba(74, 222, 128, .25); }
.fh-chat__tool {
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	flex: none;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 50% !important;
	background: rgba(255, 255, 255, .16) !important;
	color: #fff !important;
	font-size: 16px !important;
	line-height: 1;
	cursor: pointer;
	box-shadow: none !important;
}
.fh-chat__tool:hover { background: rgba(255, 255, 255, .28) !important; transform: none; }
.fh-chat__tool svg, .fh-chat__back svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.fh-chat__x { font-size: 22px !important; }
.fh-chat__tool .fh-sound__on, .fh-chat__tool.is-on .fh-sound__off { display: none; }
.fh-chat__tool.is-on .fh-sound__on { display: inline; }

.fh-chat__log { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 18px 14px 8px; scroll-behavior: smooth; }
.fh-msg { display: flex; flex-direction: column; align-items: flex-start; margin-bottom: 12px; }
.fh-msg--user { align-items: flex-end; }
.fh-msg.is-new { animation: fh-msg-in .35s var(--fh-ease); }
.fh-msg__bubble {
	max-width: 88%;
	padding: 11px 15px;
	border-radius: 20px;
	border-start-start-radius: 6px;
	background: #fff;
	color: var(--fh-ink);
	font-size: 15px;
	line-height: 1.75;
	box-shadow: 0 4px 14px -8px rgba(34, 18, 79, .3);
	overflow-wrap: anywhere;
}
.fh-msg--user .fh-msg__bubble { border-radius: 20px; border-start-end-radius: 6px; background: linear-gradient(135deg, #7c4dff, var(--fh-primary)); color: #fff; }
.fh-msg--typing .fh-msg__bubble { display: flex; gap: 5px; padding: 15px 18px; }
.fh-msg--typing i { width: 8px; height: 8px; border-radius: 50%; background: #b9a6f5; animation: fh-typing 1.1s infinite ease-in-out; }
.fh-msg--typing i:nth-child(2) { animation-delay: .15s; }
.fh-msg--typing i:nth-child(3) { animation-delay: .3s; }
@keyframes fh-typing { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-6px); opacity: 1; } }
@keyframes fh-msg-in { from { opacity: 0; transform: translateY(10px); } }

.fh-msg__cards { display: flex; gap: 10px; width: calc(100% + 28px); margin: 10px -14px 0; padding: 2px 14px 8px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.fh-msg__cards::-webkit-scrollbar { display: none; }
.fh-cc {
	display: flex;
	flex-direction: column;
	width: 196px;
	flex: none;
	overflow: hidden;
	border-radius: 18px;
	background: #fff;
	color: var(--fh-ink) !important;
	text-decoration: none !important;
	box-shadow: 0 8px 22px -14px rgba(34, 18, 79, .5);
	scroll-snap-align: start;
	transition: transform .2s var(--fh-ease);
}
.fh-cc:hover { transform: translateY(-3px); }
.fh-cc__img { position: relative; display: block; aspect-ratio: 16 / 9; background: color-mix(in srgb, var(--c) 18%, #fff); }
.fh-cc__img img { width: 100%; height: 100%; object-fit: cover; border-radius: 0 !important; }
.fh-cc__img em { position: absolute; top: 8px; inset-inline-start: 8px; padding: 2px 9px; border-radius: 999px; background: #fff; color: #0f8f7f; font-size: 11.5px; font-style: normal; font-weight: 700; }
.fh-cc__body { display: grid; gap: 3px; padding: 10px 12px 12px; }
.fh-cc__body small { color: var(--c); font-size: 12px; font-weight: 700; }
.fh-cc__body b { display: -webkit-box; overflow: hidden; font: 700 14.5px/1.45 var(--fh-font-heading); -webkit-line-clamp: 2; -webkit-box-orient: vertical; min-height: 2.9em; }
.fh-cc__meta { color: var(--fh-muted); font-size: 12px; }
.fh-cc__go { justify-self: start; margin-top: 4px; padding: 4px 12px; border-radius: 999px; background: var(--fh-soft); color: var(--fh-primary); font-size: 13px; font-weight: 700; }
.fh-cc__prog { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.fh-cc__prog i { position: relative; flex: 1; height: 7px; overflow: hidden; border-radius: 9px; background: #eee8ff; }
.fh-cc__prog i::after { content: ""; position: absolute; inset: 0; inset-inline-end: auto; width: calc(var(--p) * 1%); border-radius: inherit; background: linear-gradient(90deg, var(--fh-teal), var(--fh-primary)); }
.fh-cc__prog small { color: var(--fh-primary) !important; }
.fh-msg__acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

.fh-chat__chips { display: flex; gap: 8px; padding: 6px 14px 8px; overflow-x: auto; scrollbar-width: none; }
.fh-chat__chips::-webkit-scrollbar { display: none; }
.fh-chip-btn {
	flex: none;
	padding: 8px 14px !important;
	border: 1.5px solid rgba(106, 61, 232, .25) !important;
	border-radius: 999px !important;
	background: #fff !important;
	color: var(--fh-primary) !important;
	font: 700 13.5px/1.2 var(--fh-font-body) !important;
	white-space: nowrap;
	cursor: pointer;
	box-shadow: none !important;
}
.fh-chip-btn:hover { background: var(--fh-soft) !important; transform: none; }

.fh-chat__compose { display: flex; align-items: flex-end; gap: 8px; margin: 0 12px; padding: 6px; border: 1.5px solid #e6dffa; border-radius: 26px; background: #fff; transition: border-color .2s ease, box-shadow .2s ease; }
.fh-chat__compose:focus-within { border-color: var(--fh-primary); box-shadow: 0 0 0 4px rgba(106, 61, 232, .12); }
.fh-chat__compose textarea {
	flex: 1;
	min-height: 42px;
	max-height: 120px;
	margin: 0;
	padding: 10px 12px !important;
	border: 0 !important;
	border-radius: 0 !important;
	background: none !important;
	color: var(--fh-ink);
	font: 500 16px/1.5 var(--fh-font-body) !important;
	resize: none;
	box-shadow: none !important;
	outline: none;
}
.fh-chat__send {
	display: grid;
	place-items: center;
	width: 42px;
	height: 42px;
	flex: none;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 50% !important;
	background: linear-gradient(135deg, #7c4dff, var(--fh-primary)) !important;
	color: #fff !important;
	cursor: pointer;
}
.fh-chat__send svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linejoin: round; transform: scaleX(-1); }
[dir="ltr"] .fh-chat__send svg { transform: none; }
.fh-chat__foot { margin: 0; padding: 8px 14px 12px; color: #8f89aa; font-size: 11.5px; text-align: center; line-height: 1.5; }

/* ------------------------------------------------------------------ install bar, course bar, tab bar (hidden on desktop) */
.fh-tabbar, .fh-coursebar, .fh-installbar { display: none; }

/* ==================================================================
 * Phones and tablets: app layout
 * ================================================================== */
@media (max-width: 1024px) {
	body.fh-app {
		padding-bottom: calc(var(--fh-tabbar-h) + var(--fh-safe-b));
		overscroll-behavior-y: none;
	}
	body.single-courses.fh-app { padding-bottom: calc(var(--fh-tabbar-h) + var(--fh-safe-b) + 74px); }

	/* Header: compact app bar. */
	.page-header-inner { padding-top: var(--fh-safe-t); }
	.page-header .header-wrap { min-height: 64px; }
	.page-header .header-right .header-content-inner { gap: 4px; padding-inline-end: 8px; }
	.fh-acct { height: 40px; margin-inline-start: 6px; padding: 0 14px !important; font-size: 14px !important; }
	.fh-acct--user { width: 44px; height: 44px; padding: 4px !important; justify-content: center; border-radius: 50% !important; }
	.fh-acct--user .fh-acct__name, .fh-acct--user .fh-acct__chev { display: none; }
	.fh-acct--user .fh-avatar { width: 34px; height: 34px; }
	.page-top-bar { display: none !important; }

	/* Bottom tab bar. */
	.fh-tabbar {
		position: fixed;
		inset-inline: 0;
		bottom: 0;
		z-index: 9995;
		display: grid;
		grid-template-columns: repeat(5, 1fr);
		height: calc(var(--fh-tabbar-h) + var(--fh-safe-b));
		padding: 0 6px var(--fh-safe-b);
		border-top: 1px solid var(--fh-line);
		background: rgba(255, 255, 255, .92);
		backdrop-filter: saturate(1.6) blur(18px);
		-webkit-backdrop-filter: saturate(1.6) blur(18px);
		box-shadow: 0 -10px 30px -18px rgba(34, 18, 79, .3);
		transition: transform .25s var(--fh-ease);
		font-family: var(--fh-font-body);
		user-select: none;
		-webkit-user-select: none;
	}
	.fh-typing .fh-tabbar, .fh-kb .fh-tabbar { transform: translateY(110%); }
	.fh-nav-tab {
		position: relative;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		gap: 3px;
		min-width: 0;
		padding: 6px 0 !important;
		border: 0 !important;
		border-radius: 0 !important;
		background: none !important;
		color: #8a84a6 !important;
		font: 700 11.5px/1.1 var(--fh-font-body) !important;
		text-decoration: none !important;
		cursor: pointer;
		box-shadow: none !important;
		transition: color .2s ease !important;
	}
	.fh-nav-tab:hover { transform: none !important; color: var(--fh-primary) !important; }
	.fh-nav-tab > svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; transition: transform .25s var(--fh-bounce); }
	.fh-nav-tab.is-active { color: var(--fh-primary) !important; }
	.fh-nav-tab.is-active > svg { transform: translateY(-1px) scale(1.06); fill: rgba(106, 61, 232, .12); }
	.fh-nav-tab.is-active::before { content: ""; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 0 0 4px 4px; background: var(--fh-primary); }
	.fh-nav-tab:active > svg { transform: scale(.88); }
	.fh-nav-tab--fahim { justify-content: flex-end; padding-bottom: 7px !important; color: var(--fh-primary) !important; }
	.fh-nav-tab__bubble {
		position: absolute;
		top: -26px;
		display: grid;
		place-items: center;
		width: 56px;
		height: 56px;
		padding: 4px;
		border-radius: 50%;
		background: radial-gradient(circle at 50% 40%, #fff 0 55%, #f1eaff 100%);
		box-shadow: 0 10px 24px -8px rgba(106, 61, 232, .6), 0 0 0 4px #fff, 0 0 0 7px rgba(255, 197, 49, .75);
		transition: transform .25s var(--fh-bounce);
	}
	.fh-nav-tab__fahim { width: 100%; height: 100%; }
	.fh-nav-tab--fahim:active .fh-nav-tab__bubble { transform: scale(.92); }
	.fh-chat-on .fh-nav-tab__bubble { box-shadow: 0 10px 24px -8px rgba(106, 61, 232, .6), 0 0 0 4px #fff, 0 0 0 7px var(--fh-primary); }

	/* Launcher: the tab bar carries فهيم; the nudge floats above it. */
	.fh-launch { inset-inline: 0; bottom: calc(var(--fh-tabbar-h) + var(--fh-safe-b) + 22px); display: flex; justify-content: center; pointer-events: none; }
	.fh-launch__btn { display: none !important; }
	.fh-launch__nudge { position: relative; bottom: auto; inset-inline-start: auto; pointer-events: auto; border-radius: 20px; transform-origin: bottom center; }
	.fh-launch__nudge::after { content: ""; position: absolute; bottom: -9px; left: 50%; width: 16px; height: 16px; margin-left: -8px; border: 2px solid #efe8ff; border-top: 0; border-left: 0; background: #fff; transform: rotate(45deg); }
	.single-courses .fh-launch { bottom: calc(var(--fh-tabbar-h) + var(--fh-safe-b) + 92px); }

	/* Chat: full screen. */
	.fh-chat__panel {
		inset: 0;
		width: 100%;
		height: var(--fh-vvh, 100dvh);
		border-radius: 0;
		transform: translateY(100%);
		opacity: 1;
		transition: transform .34s var(--fh-ease);
	}
	.fh-chat.is-open .fh-chat__panel { transform: none; }
	.fh-chat__head { padding: calc(10px + var(--fh-safe-t)) 10px 12px; }
	.fh-chat__back {
		display: grid;
		place-items: center;
		width: 38px;
		height: 38px;
		flex: none;
		padding: 0 !important;
		border: 0 !important;
		border-radius: 50% !important;
		background: rgba(255, 255, 255, .16) !important;
		color: #fff !important;
		box-shadow: none !important;
	}
	[dir="ltr"] .fh-chat__back svg { transform: scaleX(-1); }
	.fh-chat__x { display: none !important; }
	.fh-chat__foot { padding-bottom: calc(10px + var(--fh-safe-b)); }
	.fh-kb .fh-chat__foot { display: none; }
	.fh-msg__bubble { max-width: 90%; }

	/* Sheets: bottom sheets. */
	.fh-sheet { align-items: end; padding: 0; }
	.fh-sheet__panel {
		width: 100%;
		max-height: 94dvh;
		padding: 12px 20px calc(20px + var(--fh-safe-b));
		border-radius: 28px 28px 0 0;
		opacity: 1;
		transform: translateY(100%);
		transition: transform .34s var(--fh-ease);
	}
	.fh-sheet.is-open .fh-sheet__panel { transform: none; }
	.fh-sheet__grab { display: block; width: 44px; height: 5px; margin: 0 auto 14px; border-radius: 9px; background: #ddd5f5; }
	.fh-sheet__x { top: 16px; }
	.fh-auth__fahim { width: 52px; height: 52px; }
	.fh-auth__head h2 { font-size: 20px; }

	/* Install banner. */
	.fh-installbar {
		position: fixed;
		inset-inline: 10px;
		bottom: calc(var(--fh-tabbar-h) + var(--fh-safe-b) + 10px);
		z-index: 9996;
		display: flex;
		align-items: center;
		gap: 12px;
		padding: 10px 10px 10px 12px;
		border-radius: 20px;
		background: var(--fh-ink);
		color: #fff;
		box-shadow: 0 20px 40px -16px rgba(34, 18, 79, .7);
		font-family: var(--fh-font-body);
		opacity: 0;
		transform: translateY(20px);
		transition: opacity .3s ease, transform .35s var(--fh-ease);
	}
	.fh-installbar.is-in { opacity: 1; transform: none; }
	.fh-installbar img { border-radius: 12px; flex: none; }
	.fh-installbar div { flex: 1; min-width: 0; line-height: 1.35; }
	.fh-installbar b { display: block; font-size: 15px; }
	.fh-installbar small { display: block; overflow: hidden; opacity: .75; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
	.fh-installbar .fh-btn { background: var(--fh-secondary) !important; color: var(--fh-ink) !important; box-shadow: none !important; }
	.fh-installbar__x { width: 30px; height: 30px; flex: none; padding: 0 !important; border: 0 !important; border-radius: 50% !important; background: rgba(255, 255, 255, .12) !important; color: #fff !important; font-size: 18px !important; line-height: 1; box-shadow: none !important; }
	.single-courses .fh-installbar { bottom: calc(var(--fh-tabbar-h) + var(--fh-safe-b) + 84px); }

	/* Course page: sticky start bar above the tab bar. */
	.fh-coursebar {
		position: fixed;
		inset-inline: 0;
		bottom: calc(var(--fh-tabbar-h) + var(--fh-safe-b));
		z-index: 9994;
		display: flex;
		align-items: center;
		gap: 12px;
		padding: 10px 16px;
		border-top: 1px solid var(--fh-line);
		background: rgba(255, 255, 255, .96);
		backdrop-filter: blur(14px);
		-webkit-backdrop-filter: blur(14px);
		font-family: var(--fh-font-body);
		transform: translateY(calc(100% + var(--fh-tabbar-h)));
		transition: transform .3s var(--fh-ease);
	}
	.fh-coursebar.is-in { transform: none; }
	.fh-typing .fh-coursebar { transform: translateY(calc(100% + var(--fh-tabbar-h))); }
	.fh-coursebar__info { flex: 1; min-width: 0; line-height: 1.35; }
	.fh-coursebar__info b { display: block; overflow: hidden; color: var(--fh-ink); font: 700 15px/1.4 var(--fh-font-heading); text-overflow: ellipsis; white-space: nowrap; }
	.fh-coursebar__info small { color: #0f8f7f; font-size: 12.5px; font-weight: 700; }
	.fh-coursebar .fh-btn { flex: none; min-height: 46px; }

	/* The tab bar and the home/courses pages carry search; keep the header to logo, menu and account. */
	.page-header .header-search-form, .page-header .header-category-menu { display: none !important; }

	/* Theme extras that would collide with the app chrome. */
	.page-scroll-up { bottom: calc(var(--fh-tabbar-h) + var(--fh-safe-b) + 16px) !important; display: none !important; }
	.page-mobile-main-menu > .inner { padding-top: var(--fh-safe-t); padding-bottom: calc(var(--fh-tabbar-h) + var(--fh-safe-b)); }

	/* Content polish: comfortable gutters, no sideways scroll, app-like cards. */
	html, body { overflow-x: clip; }
	.container, .elementor-section.elementor-section-boxed > .elementor-container { padding-inline: 16px; }
	img, video, iframe { max-width: 100%; }
	table { display: block; max-width: 100%; overflow-x: auto; }
	.page-title-bar .heading { font-size: clamp(24px, 6vw, 34px) !important; }
	.page-title-bar-inner { padding-block: 26px !important; }
	.edumall-course .course-wrapper, .tutor-course-card { border-radius: 20px; }

	/* Tutor: course page, dashboard and learning area. */
	.tutor-course-details-page, .tutor-single-course-sidebar { padding-inline: 0; }
	.tutor-dashboard .tutor-dashboard-left-menu { border-radius: 20px; }
	.tutor-dashboard-content { padding-inline: 0 !important; }
	.tutor-frontend-dashboard-header { gap: 16px; }
	.tutor-dashboard .tutor-row > [class*="tutor-col"] { padding-inline: 8px; }
	.tutor-course-single-content-wrapper .tutor-course-topic-single-header { padding-top: var(--fh-safe-t); }
	.tutor-modal-window, .tutor-modal-content { border-radius: 24px; }
}

@media (max-width: 767px) {
	.page-header .header-wrap { min-height: 58px; }
	.fh-acct--guest span { display: none; }
	.fh-acct--guest { width: 42px; height: 42px; padding: 0 !important; justify-content: center; border-radius: 50% !important; }
	.fh-acct--guest svg { width: 22px; height: 22px; }
	.fh-form__grid { grid-template-columns: 1fr; }
	.fh-cc { width: 172px; }
}

/* Standalone (installed) app: no browser-y bits. */
.fh-standalone body { user-select: none; -webkit-user-select: none; }
.fh-standalone input, .fh-standalone textarea, .fh-standalone .fh-msg__bubble, .fh-standalone .entry-content, .fh-standalone .tutor-course-details-content { user-select: text; -webkit-user-select: text; }
.fh-standalone .page-top-bar { display: none !important; }

@media (prefers-reduced-motion: reduce) {
	.fh-sheet__panel, .fh-chat__panel, .fh-tabbar, .fh-coursebar, .fh-installbar, .fh-launch__nudge { transition: none !important; }
	.fh-msg.is-new { animation: none; }
}

@media print {
	.fh-tabbar, .fh-launch, .fh-chat, .fh-coursebar, .fh-installbar, .fh-sheet { display: none !important; }
	body.fh-app { padding: 0 !important; }
}
