/* ==========================================================================
   Student area: log in / sign up, account, find tutors, tutor profile, my lessons, books.
   Loaded only on pages using the page-app or page-auth template (see functions.php).
   ========================================================================== */

.app-main { background: var(--bg); min-height: calc(100vh - var(--header-h)); }
.app-page { max-width: var(--wrap); margin-inline: auto; padding: clamp(24px, 4vw, 40px) var(--gutter) clamp(56px, 8vw, 96px); }
.app-head { margin-bottom: clamp(18px, 3vw, 28px); }
.app-head h1 { margin: 0; font-size: clamp(1.55rem, 2.6vw, 2.05rem); font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.app-head p { margin: .35rem 0 0; color: var(--muted); }
.app-head--row { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem 2rem; flex-wrap: wrap; }
html[dir="rtl"] .app-head h1 { letter-spacing: 0; line-height: 1.4; }
.t-muted { color: var(--muted); font-size: .92rem; }
.t-center { text-align: center; }
.t-link { font-weight: 700; color: var(--brand); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: .2em; margin-inline-start: .8rem; }
.empty { color: var(--muted); padding: 1.4rem; border: 1px dashed var(--line-strong); border-radius: var(--r-md); background: var(--surface); }
.empty a { color: var(--brand); font-weight: 700; }
.crumbs { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; font-size: .88rem; color: var(--muted); margin-bottom: 1.2rem; }
.crumbs a { color: var(--brand); font-weight: 600; }
.crumbs [aria-current] { color: var(--ink); font-weight: 600; }

.card-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: clamp(18px, 2.2vw, 24px); box-shadow: var(--shadow-sm); }
.card-box + .card-box { margin-top: 1rem; }
.card-box--navy { background: linear-gradient(160deg, var(--brand), var(--brand-700)); border-color: transparent; color: #fff; }
.card-box--navy .side-title { color: #fff; }
.card-box--navy p { color: rgba(255, 255, 255, .85); }
.side-title { margin: 0 0 .9rem; font-size: 1rem; font-weight: 800; letter-spacing: -.01em; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.side-title .t-muted { font-weight: 600; font-size: .82rem; }
.stat-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; margin: 0; }
.stat-tiles div { display: flex; flex-direction: column-reverse; align-items: center; padding: .8rem .4rem; border-radius: var(--r-sm); background: var(--brand-050); text-align: center; }
.stat-tiles dd { margin: 0; font-size: 1.5rem; font-weight: 800; color: var(--brand); }
.stat-tiles dt { font-size: .76rem; font-weight: 600; color: var(--muted); }
.quote { margin: 0 0 .6rem; padding: .9rem 1rem; border-inline-start: 3px solid var(--accent); background: var(--brand-050); border-radius: var(--r-sm); font-size: .95rem; }

.seg { display: inline-flex; gap: 2px; padding: 4px; background: var(--brand-100); border-radius: var(--r-pill); }
.seg a { padding: .5rem 1rem; border-radius: var(--r-pill); font-weight: 700; font-size: .9rem; color: var(--brand); }
.seg a[aria-current] { background: var(--brand); color: #fff; }

.form-msg { margin: 0 0 1rem; }
.inline-form { margin: 0; display: inline; }

/* ---------- app header ---------- */
.app-nav .wp-block-navigation__container { gap: .25rem; }
.app-nav .wp-block-navigation-item__content { padding: .5rem .75rem !important; border-radius: var(--r-sm); font-weight: 600; font-size: .95rem; color: var(--ink); }
.app-nav .wp-block-navigation-item__content:hover { background: var(--brand-050); color: var(--brand); }
.app-nav .current-menu-item > .wp-block-navigation-item__content { color: var(--brand); box-shadow: inset 0 -2px 0 var(--accent); border-radius: 0; }
.app-header .nav__actions .lang-toggle { margin-inline-start: 0; }
@media (max-width: 768px) {
	/* backdrop-filter would make the header the containing block of the fixed tab bar */
	.app-header { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--surface); }
	.app-nav {
		position: fixed; inset-inline: 0; bottom: 0; z-index: 66; margin: 0; padding: .4rem .5rem calc(.4rem + env(safe-area-inset-bottom));
		background: rgba(255, 255, 255, .97); border-top: 1px solid var(--line); box-shadow: 0 -6px 22px rgba(16, 26, 49, .08);
	}
	.app-nav .wp-block-navigation__container { width: 100%; justify-content: space-around; flex-wrap: nowrap; }
	.app-nav .wp-block-navigation-item__content { font-size: .82rem; padding: .55rem .6rem !important; }
	.app-main { padding-bottom: 64px; }
}

/* ---------- log in / sign up ---------- */
.auth-main { min-height: 100vh; background: var(--surface); }
.auth { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 100vh; }
.auth__art { position: relative; overflow: hidden; background: #F3EBDD; }
.auth__art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.auth__panel { display: flex; flex-direction: column; padding: 20px clamp(20px, 4vw, 48px) 24px; }
.auth__top { display: flex; justify-content: flex-end; align-items: center; gap: .8rem; }
.auth__tabs { display: inline-flex; padding: 3px; gap: 2px; background: var(--brand-100); border-radius: var(--r-pill); }
.auth__tabs a { padding: .4rem .9rem; border-radius: var(--r-pill); font-weight: 700; font-size: .85rem; color: var(--brand); }
.auth__tabs a[aria-current] { background: var(--brand); color: #fff; }
.auth__box { width: 100%; max-width: 420px; margin: auto; padding-block: 32px; }
.auth__logo img { height: 30px; width: auto; display: block; margin-bottom: 1.6rem; }
.auth__title { margin: 0; font-size: clamp(1.7rem, 2.6vw, 2.1rem); font-weight: 800; letter-spacing: -.02em; }
html[dir="rtl"] .auth__title { letter-spacing: 0; }
.auth__lead { margin: .3rem 0 1.4rem; color: var(--muted); }
.auth__form { gap: 1rem; }
.auth__form .field input { padding: .8rem 1rem; border-radius: 12px; }
.password { position: relative; }
.password input { padding-inline-end: 4.5rem !important; }
.password__toggle { position: absolute; inset-inline-end: .5rem; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--muted); font: inherit; font-size: .85rem; font-weight: 700; cursor: pointer; padding: .4rem .5rem; }
.auth__row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; font-size: .9rem; }
.auth__row a { color: var(--brand); font-weight: 700; }
.check { display: inline-flex; align-items: center; gap: .45rem; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }
.chips-field { border: 0; margin: 0; padding: 0; }
.chips-field legend { font-weight: 700; font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: .6rem; }
html[dir="rtl"] .chips-field legend { letter-spacing: 0; font-size: .88rem; }
.chips-choice { display: flex; flex-wrap: wrap; gap: .5rem; }
.chips-choice label { position: relative; cursor: pointer; }
.chips-choice input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.chips-choice span { display: inline-block; padding: .45rem .9rem; border-radius: var(--r-pill); border: 1.5px solid var(--line-strong); font-weight: 600; font-size: .88rem; color: var(--ink); background: var(--surface); }
.chips-choice input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }
.chips-choice input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.auth__terms { margin: 0; font-size: .82rem; color: var(--muted); text-align: center; }
.auth__terms a { color: var(--brand); font-weight: 700; }
.auth__alt { margin: 1.3rem 0 0; text-align: center; color: var(--muted); }
.auth__alt a { color: var(--brand); font-weight: 800; }
.auth__foot { margin: 0; text-align: center; font-size: .78rem; color: var(--muted); }
@media (max-width: 900px) {
	.auth { grid-template-columns: 1fr; }
	.auth__art { display: none; }
}

/* ---------- account settings ---------- */
.account__grid { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: clamp(16px, 3vw, 32px); align-items: start; }
.account__tabs { display: grid; gap: .3rem; position: sticky; top: calc(var(--header-h) + 16px); }
.account__tabs a { padding: .7rem .9rem; border-radius: var(--r-sm); font-weight: 600; font-size: .94rem; color: var(--ink); }
.account__tabs a:hover { background: var(--brand-050); }
.account__tabs a.is-active { background: var(--brand); color: #fff; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: clamp(18px, 2.4vw, 28px); box-shadow: var(--shadow-sm); }
.panel + .panel { margin-top: 1rem; }
.js [data-tabs] .panel:not(.is-active) { display: none; }
.panel h2 { margin: 0; font-size: 1.1rem; font-weight: 800; }
.panel__lead { margin: .3rem 0 1.2rem; color: var(--muted); font-size: .92rem; }
.panel__sep { margin-top: 2rem !important; padding-top: 1.6rem; border-top: 1px solid var(--line); }
.panel .field small { color: var(--muted); font-size: .82rem; }
.panel .field input[readonly] { background: var(--brand-050); color: var(--muted); }
.account__me { margin-bottom: 1.2rem; }
.danger { margin-top: 2rem; padding: 1.2rem; border: 1px solid #F4C7C3; border-radius: var(--r-md); background: #FFF8F7; }
.danger summary { list-style: none; display: inline-flex; padding: .65rem 1.05rem; }
.danger summary::-webkit-details-marker { display: none; }
.danger details[open] summary { margin-bottom: 1rem; }
.plan { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .8rem; margin: 1rem 0; padding: 1.1rem 1.2rem; border-radius: var(--r-md); background: var(--brand-050); }
.plan__price { font-size: 2rem; font-weight: 800; color: var(--brand); }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: start; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: .6rem .5rem; border-bottom: 1px solid var(--line); }
html[dir="rtl"] .table th { letter-spacing: 0; }
.table td { padding: .8rem .5rem; border-bottom: 1px solid var(--line); }
@media (max-width: 860px) {
	.account__grid { grid-template-columns: 1fr; }
	.account__tabs { position: static; display: flex; overflow-x: auto; gap: .3rem; }
	.account__tabs a { white-space: nowrap; }
}

/* ---------- find tutors ---------- */
.directory .app-head .is-style-ticks { margin: 0; }
.filters { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.4rem; }
.filters__chips { display: flex; flex-wrap: wrap; gap: .45rem; }
.filters__chips a { padding: .45rem .9rem; border-radius: var(--r-pill); border: 1px solid var(--line-strong); background: var(--surface); font-weight: 600; font-size: .88rem; color: var(--ink); }
.filters__chips a:hover { border-color: var(--brand); }
.filters__chips a[aria-current] { background: var(--brand); border-color: var(--brand); color: #fff; }
.filters__search { display: flex; gap: .5rem; flex: 1 1 280px; max-width: 420px; }
.filters__search input { flex: 1; min-width: 0; padding: .65rem 1rem; border: 1.5px solid var(--line-strong); border-radius: var(--r-pill); font: inherit; background: var(--surface); }
.filters__search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(227, 167, 43, .18); }

.t-list { display: grid; gap: 1rem; }
.t-card {
	position: relative; display: grid; grid-template-columns: 180px minmax(0, 1fr) 210px; gap: clamp(14px, 2vw, 24px);
	padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
	transition: box-shadow .18s ease, border-color .18s ease;
}
.t-card:hover { box-shadow: var(--shadow-md); }
.t-card.is-top { border: 2px solid var(--brand); }
.t-card__ribbon { position: absolute; top: 0; inset-inline-start: 24px; transform: translateY(-50%); padding: .25rem .7rem; border-radius: var(--r-pill); background: var(--accent); color: #3a2600; font-size: .74rem; font-weight: 800; z-index: 1; }
.t-card__media { position: relative; display: grid; place-items: center; aspect-ratio: 1; border-radius: var(--r-md); overflow: hidden; background: radial-gradient(120% 85% at 50% 118%, rgba(227, 167, 43, .42), rgba(227, 167, 43, 0) 62%), linear-gradient(180deg, var(--brand-700), var(--brand)); }
.t-card__dialect { position: absolute; top: .6rem; inset-inline-start: .6rem; padding: .22rem .6rem; border-radius: var(--r-pill); background: rgba(11, 18, 40, .55); color: #fff; font-size: .72rem; font-weight: 700; }
.tutor-letter { font-weight: 800; font-size: 3.6rem; color: var(--accent-100); letter-spacing: -.03em; text-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
html[dir="rtl"] .tutor-letter { font-family: var(--font-ar); letter-spacing: 0; }
.tutor-photo { width: 100%; height: 100%; object-fit: cover; }
.t-card__body > * { margin: 0; }
.t-card__name { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; font-size: 1.25rem; font-weight: 800; letter-spacing: -.02em; }
.t-card__name a:hover { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; }
.t-card__headline { margin-top: .25rem !important; color: var(--muted); font-size: .92rem; }
.t-card__speaks { margin-top: .45rem !important; font-size: .88rem; }
.t-card__body .ap-chips { margin-top: .7rem; }
.t-card__bio { margin-top: .7rem !important; color: var(--muted); font-size: .93rem; }
.t-card__side { display: flex; flex-direction: column; gap: .45rem; padding-inline-start: clamp(14px, 2vw, 22px); border-inline-start: 1px solid var(--line); }
.t-card__side p { margin: 0; }
.t-card__lessons { color: var(--muted); font-size: .86rem; }
.t-card__price b { font-size: 1.6rem; font-weight: 800; }
.t-card__price span { color: var(--muted); font-size: .85rem; }
.t-card__side .btn { width: 100%; }
.rating b { font-size: 1.1rem; }
.rating span:last-child { color: var(--muted); font-size: .86rem; }
.ap-chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.ap-chips li { display: inline-flex; align-items: center; min-height: 28px; padding: 2px 11px; border-radius: var(--r-pill); background: var(--brand-050); border: 1px solid var(--line); font-size: .8rem; font-weight: 600; color: var(--brand); }
.ap-chips--lg li { min-height: 36px; padding: 4px 14px; font-size: .88rem; background: var(--surface); }
.ap-badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: var(--r-pill); background: var(--accent-100); color: var(--brand-700); font-size: .74rem; font-weight: 800; white-space: nowrap; letter-spacing: 0; }
@media (max-width: 900px) {
	.t-card { grid-template-columns: 120px minmax(0, 1fr); }
	.t-card__side { grid-column: 1 / -1; padding: 1rem 0 0; border: 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1fr; align-items: center; }
	.tutor-letter { font-size: 2.6rem; }
}
@media (max-width: 480px) {
	.t-card { grid-template-columns: 84px minmax(0, 1fr); padding: 12px; }
	.t-card__side { grid-template-columns: 1fr; }
}

/* ---------- tutor profile ---------- */
.tutor-page__grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: clamp(18px, 3vw, 32px); align-items: start; }
.tutor-page__side { position: sticky; top: calc(var(--header-h) + 16px); display: grid; gap: 1rem; }
.t-hero { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 1.4rem; align-items: center; margin-bottom: 1.4rem; }
.t-hero__media { display: grid; place-items: center; aspect-ratio: 1; border-radius: 50%; overflow: hidden; background: radial-gradient(120% 85% at 50% 118%, rgba(227, 167, 43, .5), rgba(227, 167, 43, 0) 62%), linear-gradient(180deg, var(--brand-700), var(--brand)); }
.t-hero__media .tutor-letter { font-size: 2.8rem; }
.t-hero__name { margin: 0; font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 800; letter-spacing: -.02em; }
.t-hero p { margin: .25rem 0 0; }
.t-hero__stats { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; margin: .5rem 0 .8rem !important; font-size: .92rem; }
.t-section { margin-top: 1.2rem; padding: clamp(18px, 2.4vw, 26px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.t-section h2 { margin: 0 0 .9rem; font-size: 1.2rem; font-weight: 800; letter-spacing: -.01em; }
.t-prose p { margin: 0 0 1em; color: var(--ink); }
.t-prose p:last-child { margin-bottom: 0; }
.t-rows { margin: 0; display: grid; }
.t-rows div { display: grid; grid-template-columns: minmax(110px, 1fr) 2fr; gap: 1rem; padding: .75rem 0; border-top: 1px solid var(--line); }
.t-rows div:first-child { border-top: 0; }
.t-rows dt { font-weight: 700; }
.t-rows dd { margin: 0; color: var(--muted); }
.t-rows--resume dd b { display: block; color: var(--ink); }
.t-rows--resume dd span { font-size: .9rem; }
.t-score { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin: 0 0 1rem; }
.t-score b { font-size: 2.2rem; font-weight: 800; }
.t-reviews { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.t-reviews li { display: flex; gap: .8rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.t-reviews li:first-child { padding-top: 0; border-top: 0; }
.t-reviews p { margin: .3rem 0 0; }
.t-acc { border-top: 1px solid var(--line); padding: .9rem 0; }
.t-acc summary { cursor: pointer; font-weight: 700; }
.t-acc p { margin: .6rem 0 0; color: var(--muted); }
.t-card-side { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 20px; box-shadow: var(--shadow-sm); display: grid; gap: .9rem; }
.t-card-side h2 { margin: 0; font-size: 1rem; font-weight: 800; }
.t-figures { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0; text-align: center; }
.t-figures div { display: flex; flex-direction: column-reverse; }
.t-figures dd { margin: 0; font-size: 1.35rem; font-weight: 800; }
.t-figures dt { font-size: .76rem; color: var(--muted); font-weight: 600; }
.t-video iframe { width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: var(--r-sm); }
.booking { border: 2px solid var(--brand); scroll-margin-top: calc(var(--header-h) + 16px); }
.booking__form { margin-top: 1rem; }
@media (max-width: 960px) {
	.tutor-page__grid { grid-template-columns: minmax(0, 1fr); }
	.tutor-page__side { position: static; order: -1; }
}
@media (max-width: 520px) { .t-hero { grid-template-columns: 80px minmax(0, 1fr); gap: 1rem; } .t-hero__media .tutor-letter { font-size: 2rem; } }

/* ---------- my lessons ---------- */
.lessons__grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: clamp(16px, 2.6vw, 28px); align-items: start; }
.lessons__side { display: grid; gap: 1rem; }
.lessons__side .card-box + .card-box { margin-top: 0; }
.empty-box { text-align: center; padding: clamp(28px, 5vw, 48px); }
.empty-box h2 { margin: 0 0 .4rem; font-size: 1.3rem; }
.empty-box p { color: var(--muted); margin: 0 0 1.2rem; }
.next-lesson__top { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-bottom: 1.1rem; }
.next-lesson__top .pill:last-child { margin-inline-start: auto; }
.next-lesson__who { display: flex; gap: 1rem; align-items: center; }
.next-lesson__who h2 { margin: 0; font-size: 1.3rem; font-weight: 800; }
.next-lesson__who p { margin: .15rem 0 0; }
.next-lesson__time { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; font-weight: 600; }
.next-lesson__topic { margin-top: 1.1rem; padding: 1rem 1.1rem; border-radius: var(--r-sm); background: #FFF8E8; border: 1px solid var(--accent-100); }
.next-lesson__topic span { font-size: .74rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #7A520B; }
html[dir="rtl"] .next-lesson__topic span { letter-spacing: 0; }
.next-lesson__topic p { margin: .3rem 0 0; font-weight: 700; }
.next-lesson__actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-top: 1.2rem; }
.lesson-list { margin-top: 1.4rem; }
.lesson-list h2 { margin: 0 0 .7rem; font-size: 1.05rem; font-weight: 800; }
.lesson-row { display: flex; align-items: center; gap: .9rem; padding: .9rem 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.lesson-row + .lesson-row { margin-top: .6rem; }
.lesson-row__body { flex: 1; min-width: 0; }
.lesson-row__body p { margin: .2rem 0 0; }
.lesson-row__notes { font-size: .92rem; color: var(--ink); }
@media (max-width: 960px) { .lessons__grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) { .lesson-row { flex-wrap: wrap; } .lesson-row__body { flex-basis: calc(100% - 60px); } }

/* ---------- books ---------- */
.reader__grid { display: grid; grid-template-columns: 220px minmax(0, 1fr) 300px; gap: clamp(16px, 2.4vw, 24px); align-items: start; }
.reader__grid--book { grid-template-columns: minmax(0, 1fr) 320px; }
.reader__main > * + * { margin-top: 1rem; }
.reader__side { display: grid; gap: 1rem; }
.reader__side .card-box + .card-box { margin-top: 0; }
.filter-label { margin: 1rem 0 .4rem; font-size: .74rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
html[dir="rtl"] .filter-label { letter-spacing: 0; font-size: .85rem; }
.filter-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .15rem; }
.filter-list a { display: block; padding: .45rem .6rem; border-radius: var(--r-sm); font-weight: 600; font-size: .92rem; }
.filter-list a:hover { background: var(--brand-050); }
.filter-list a[aria-current] { background: var(--brand); color: #fff; }
.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1rem; }
.book-card { display: grid; gap: .35rem; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); transition: box-shadow .18s ease, transform .18s ease; }
.book-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.book-cover { display: block; width: 100%; height: auto; aspect-ratio: 200 / 286; object-fit: cover; border-radius: 6px; box-shadow: 0 14px 28px -10px rgba(20, 30, 60, .35); }
.book-cover--blank { display: grid; place-items: center; padding: 1rem; text-align: center; font-weight: 800; color: #fff; background: linear-gradient(160deg, var(--brand-600), var(--brand-700)); }
.continue { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 1rem; align-items: center; }
.continue > span { display: grid; gap: .35rem; justify-items: start; }
.book-hero { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: clamp(16px, 3vw, 28px); align-items: start; }
.book-hero h1 { margin: 0; font-size: clamp(1.5rem, 2.6vw, 2rem); font-weight: 800; letter-spacing: -.02em; }
.book-hero p { margin: .4rem 0 1rem; }
.book-hero .progress { margin-bottom: 1.2rem; }
.progress { display: grid; gap: .35rem; width: 100%; }
.progress__label { display: flex; justify-content: space-between; font-size: .85rem; color: var(--muted); }
.progress__bar { display: block; height: 8px; border-radius: 99px; background: var(--brand-100); overflow: hidden; }
.progress__bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent-600), var(--accent)); }
.chapter-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.chapter-list a { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: .9rem; align-items: center; padding: .75rem .8rem; border-radius: var(--r-sm); border: 1px solid var(--line); }
.chapter-list a:hover { border-color: var(--brand); }
.chapter-list__num { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--brand-050); color: var(--brand); font-weight: 800; }
.chapter-list .is-done .chapter-list__num { background: #E7F7EE; color: #145C34; }
.chapter-list .is-next a { border-color: var(--accent); background: #FFF8E8; }
.chapter-list .is-next .chapter-list__num { background: var(--accent); color: #3a2600; }
.chapter-list__title { font-weight: 700; }
.chapter-list__title span { color: var(--muted); font-weight: 600; margin-inline-start: .4rem; font-family: var(--font-ar); }
.chapter h1 { margin: .6rem 0 .3rem; font-size: clamp(1.5rem, 2.6vw, 2rem); font-weight: 800; }
.chapter h1 span { font-family: var(--font-ar); color: var(--accent-600); }
.chapter__audio { width: 100%; margin: 1rem 0; }
.chapter__text { margin-top: 1rem; }
.vocab { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.vocab li { display: grid; grid-template-columns: minmax(80px, 1fr) minmax(80px, 1fr) minmax(0, 1.4fr) auto; gap: .8rem; align-items: center; padding: .7rem .8rem; border-radius: var(--r-sm); background: var(--brand-050); }
.vocab form { margin: 0; }
.vocab__ar { font-family: var(--font-ar); font-weight: 700; font-size: 1.15rem; color: var(--brand); }
.vocab__ex { font-family: var(--font-ar); color: var(--muted); }
.word-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.word-list li { display: flex; justify-content: space-between; gap: .8rem; padding: .5rem .7rem; border-radius: var(--r-sm); background: var(--brand-050); font-size: .9rem; }
.word-list [lang="ar"] { font-family: var(--font-ar); font-weight: 700; color: var(--brand); }
.chapter__nav { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; justify-content: space-between; }
.chapter__nav form { margin: 0; margin-inline-start: auto; }
@media (max-width: 1100px) {
	.reader__grid { grid-template-columns: minmax(0, 1fr) 300px; }
	.reader__filters { grid-column: 1 / -1; }
	.reader__filters .filter-list { display: flex; flex-wrap: wrap; gap: .3rem; }
}
@media (max-width: 860px) {
	.reader__grid, .reader__grid--book { grid-template-columns: 1fr; }
	.book-hero { grid-template-columns: 110px minmax(0, 1fr); }
	.vocab li { grid-template-columns: 1fr 1fr; }
	.vocab__ex { grid-column: 1 / -1; }
}

/* ==========================================================================
   Tutor area: setup wizard, dashboard, calendar, lessons, earnings, messages
   ========================================================================== */
.tutor-badge { margin: 0 0 0 -.4rem !important; padding: .15rem .5rem; border-radius: 6px; background: var(--brand-100); color: var(--brand); font-size: .66rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
html[dir="rtl"] .tutor-badge { margin: 0 -.4rem 0 0 !important; letter-spacing: 0; font-size: .74rem; }
.balance-pill { display: inline-flex; align-items: center; padding: .4rem .8rem; border-radius: var(--r-pill); border: 1px solid var(--line-strong); font-weight: 800; font-size: .88rem; color: var(--brand); background: var(--surface); }
.balance-pill:hover { border-color: var(--brand); }
.tutor-header .app-nav .wp-block-navigation-item__content { font-size: .9rem; padding: .5rem .55rem !important; }
@media (max-width: 768px) {
	.tutor-header .app-nav .wp-block-navigation__container { overflow-x: auto; justify-content: flex-start; scrollbar-width: none; }
	.tutor-header .app-nav .wp-block-navigation-item__content { font-size: .78rem; white-space: nowrap; }
	.tutor-badge, .balance-pill { display: none; }
}

/* setup wizard */
.setup { min-height: 100vh; background: var(--bg); padding-bottom: 64px; }
.setup__top { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 16px var(--gutter); background: var(--surface); border-bottom: 1px solid var(--line); }
.setup__logo { height: 30px; width: auto; display: block; }
.setup__actions { display: flex; align-items: center; gap: .8rem; }
.stepper { list-style: none; display: flex; gap: .3rem; margin: 24px auto; padding: 0 var(--gutter); max-width: 980px; overflow-x: auto; scrollbar-width: none; }
.stepper li { flex: 1; min-width: 74px; }
.stepper a { display: grid; justify-items: center; gap: .35rem; text-align: center; color: var(--muted); font-size: .76rem; font-weight: 600; }
.stepper__num { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--surface); font-weight: 800; color: var(--muted); }
.stepper .is-done .stepper__num { background: var(--brand); border-color: var(--brand); color: #fff; }
.stepper .is-current .stepper__num { background: var(--accent); border-color: var(--accent); color: #3a2600; }
.stepper .is-current a { color: var(--ink); }
.setup__card { max-width: 760px; margin: 0 auto; padding: clamp(22px, 4vw, 40px); }
.setup__card h1 { margin: .2rem 0 0; font-size: clamp(1.5rem, 2.6vw, 1.9rem); font-weight: 800; }
.setup__nav { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: 1.4rem; padding-top: 1.2rem; border-top: 1px solid var(--line); }
.setup__nav .btn--navy, .setup__nav .btn--primary { margin-inline-start: auto; }
.review-block { padding: 1rem 0; border-top: 1px solid var(--line); }
.review-block h2 { display: flex; justify-content: space-between; margin: 0 0 .4rem; font-size: 1rem; }
.review-block h2 a { font-size: .88rem; color: var(--brand); }
.photo-field { display: flex; gap: 1.2rem; align-items: center; }
.photo-field__preview img, .photo-field__preview .avatar { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; }
.field small, .form small { color: var(--muted); font-size: .82rem; }
.char-count { display: block; text-align: end; }
.qual-row { display: grid; grid-template-columns: 130px 1fr 1fr; gap: .5rem; margin-bottom: .5rem; }
.qual-row input { width: 100%; padding: .7rem .9rem; border: 1.5px solid var(--line-strong); border-radius: 12px; font: inherit; background: var(--surface); }
.video-preview video, .video-preview iframe { width: 100%; aspect-ratio: 16 / 9; height: auto; border-radius: var(--r-md); background: #000; }
.sticky-save { position: sticky; bottom: 12px; z-index: 5; display: flex; justify-content: flex-end; margin-top: 1rem; }
.sticky-save .btn { box-shadow: var(--shadow-lg); }
@media (max-width: 768px) {
	/* above the tab bar, on the side away from the chat bubble */
	.sticky-save { bottom: calc(76px + env(safe-area-inset-bottom)); justify-content: flex-start; }
}
@media (max-width: 640px) { .qual-row { grid-template-columns: 1fr; } .stepper__label { display: none; } }

/* availability grid */
.avail { margin: .4rem 0 1rem; overflow-x: auto; }
.avail__grid { display: grid; grid-template-columns: 54px repeat(7, minmax(44px, 1fr)); gap: 3px; min-width: 420px; }
.avail__day { text-align: center; font-size: .78rem; font-weight: 700; color: var(--muted); padding-bottom: .3rem; }
.avail__hour { font-size: .7rem; color: var(--muted); text-align: end; padding-inline-end: .4rem; line-height: 24px; }
.avail__cell { position: relative; display: grid; place-items: center; height: 24px; border-radius: 5px; background: var(--brand-050); border: 1px solid var(--line); cursor: pointer; font-size: .62rem; font-weight: 800; }
.avail__cell input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.avail__cell:has(input:checked) { background: #CFEFDD; border-color: #7CCB9F; }
.avail__cell:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 1px; }
.avail__cell.is-booked { background: var(--accent-100); border-color: var(--accent); color: #7A520B; cursor: default; }
.avail__legend { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .6rem; font-size: .82rem; color: var(--muted); margin: 0 0 .6rem; }
.avail__key { display: inline-block; width: 14px; height: 14px; border-radius: 4px; background: var(--brand-050); border: 1px solid var(--line); vertical-align: middle; }
.avail__key.is-on { background: #CFEFDD; border-color: #7CCB9F; }
.avail__key.is-booked { background: var(--accent-100); border-color: var(--accent); }

/* dashboard */
.hero-lesson { display: flex; justify-content: space-between; gap: 1rem; align-items: center; flex-wrap: wrap; padding: clamp(20px, 3vw, 28px); border-radius: var(--r-lg); color: #fff; background: radial-gradient(90% 140% at 88% 8%, rgba(227, 167, 43, .24), transparent 55%), linear-gradient(150deg, var(--brand), var(--brand-700)); box-shadow: var(--shadow-md); margin-bottom: 1rem; }
.hero-lesson h2 { margin: .3rem 0; color: #fff; font-size: 1.4rem; }
.hero-lesson p { margin: 0 0 1rem; color: rgba(255, 255, 255, .82); }
.hero-lesson__label { font-size: .74rem !important; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; margin: 0 !important; }
.hero-lesson__label span { color: #4ADE80; }
.hero-lesson__count b { font-size: 1.6rem; }
.todo { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.todo li { display: flex; justify-content: space-between; align-items: center; gap: .8rem; padding: .7rem .8rem; border-radius: var(--r-sm); background: var(--brand-050); font-size: .9rem; }
.todo a { font-weight: 800; color: var(--brand); white-space: nowrap; }
.quick { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.quick a { display: grid; padding: .7rem .8rem; border-radius: var(--r-sm); border: 1px solid var(--line); }
.quick a:hover { border-color: var(--brand); }
.quick span { font-size: .82rem; color: var(--muted); }
.stat-tiles--4 { grid-template-columns: repeat(4, 1fr); margin-bottom: 1rem; }
@media (max-width: 640px) { .stat-tiles--4 { grid-template-columns: 1fr 1fr; } }
.money-list { display: grid; gap: .6rem; margin: 0; }
.money-list div { display: flex; justify-content: space-between; align-items: baseline; padding-bottom: .6rem; border-bottom: 1px solid var(--line); }
.money-list div:last-child { border-bottom: 0; padding-bottom: 0; }
.money-list dt { color: var(--muted); font-weight: 600; }
.money-list dd { margin: 0; font-size: 1.3rem; font-weight: 800; }
.lesson-row--tutor { flex-wrap: wrap; }
.lesson-row__actions { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.complete-form { flex-basis: 100%; margin-top: .4rem; padding-top: .8rem; border-top: 1px dashed var(--line-strong); }
.complete-form summary { cursor: pointer; font-weight: 700; color: var(--brand); margin-bottom: .6rem; }

/* booking slot picker (tutor profile) */
.slots { border: 0; padding: 0; margin: 0; min-width: 0; }
.slots legend { font-weight: 700; margin-bottom: .6rem; }
.slots__days { display: flex; gap: .6rem; overflow-x: auto; padding-bottom: .4rem; }
.slots__day { flex: 0 0 96px; display: grid; gap: .35rem; align-content: start; }
.slots__label { margin: 0; font-size: .8rem; font-weight: 800; text-align: center; color: var(--muted); }
.slots__time { position: relative; }
.slots__time input { position: absolute; opacity: 0; inset: 0; }
.slots__time span { display: block; padding: .45rem .3rem; text-align: center; border-radius: var(--r-sm); border: 1.5px solid var(--line-strong); font-weight: 700; font-size: .88rem; cursor: pointer; }
.slots__time input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }
.slots__time input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }

/* messages */
.chat { display: grid; grid-template-columns: 300px minmax(0, 1fr); height: min(70vh, 680px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; box-shadow: var(--shadow-sm); }
.chat__list { border-inline-end: 1px solid var(--line); overflow-y: auto; }
.chat__list ul { list-style: none; margin: 0; padding: .4rem; }
.chat__empty { padding: 1rem; color: var(--muted); }
.chat__item { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: .7rem; align-items: center; width: 100%; padding: .6rem; border: 0; background: none; border-radius: var(--r-sm); cursor: pointer; text-align: start; font: inherit; color: inherit; }
.chat__item:hover { background: var(--brand-050); }
.chat__item.is-active { background: var(--brand-100); }
.chat__meta { display: grid; min-width: 0; }
.chat__last { color: var(--muted); font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat__time { font-size: .74rem; color: var(--muted); }
.chat__item.is-unread b::after { content: ""; display: inline-block; width: 8px; height: 8px; margin-inline-start: .4rem; border-radius: 50%; background: var(--accent); }
.chat__thread { display: flex; flex-direction: column; min-height: 0; }
.chat__head { display: flex; align-items: center; gap: .8rem; padding: .9rem 1rem; border-bottom: 1px solid var(--line); }
.chat__back { display: none; border: 0; background: none; color: var(--brand); font: inherit; font-weight: 700; cursor: pointer; }
.chat__log { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .6rem; background: var(--bg); }
.chat__msg { max-width: 72%; align-self: flex-start; }
.chat__msg p { margin: 0; padding: .65rem .9rem; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); white-space: pre-wrap; unicode-bidi: plaintext; }
.chat__msg time { display: block; font-size: .72rem; color: var(--muted); margin-top: .2rem; }
.chat__msg.is-mine { align-self: flex-end; }
.chat__msg.is-mine p { background: var(--brand); border-color: var(--brand); color: #fff; }
.chat__msg.is-mine time { text-align: end; }
.chat__form { display: flex; gap: .5rem; padding: .7rem; border-top: 1px solid var(--line); }
.chat__form textarea { flex: 1; resize: none; padding: .7rem 1rem; border: 1.5px solid var(--line-strong); border-radius: 14px; font: inherit; max-height: 140px; }
.chat__form textarea:focus { outline: none; border-color: var(--accent); }
@media (max-width: 760px) {
	.chat { grid-template-columns: 1fr; height: calc(100vh - 220px); }
	.chat__thread { display: none; }
	.chat.is-open .chat__list { display: none; }
	.chat.is-open .chat__thread { display: flex; }
	.chat__back { display: inline-block; }
}
