/* Thinkera Academy lessons: course home and lesson page. Logical properties throughout, so RTL and LTR both work. */
.tk-learn {
    --tk-royal: #113972;
    --tk-royal-600: #1B4A8F;
    --tk-azure: #2F5795;
    --tk-teal: #426EB5;
    --tk-teal-700: #2F5795;
    --tk-navy: #0A1628;
    --tk-ink: #0F1B2D;
    --tk-muted: #52627A;
    --tk-line: #DDE3EC;
    --tk-pale: #EEF3FA;
    --tk-radius: 16px;
    color: var(--tk-ink);
    letter-spacing: 0;
}
/* Latin lesson names and summaries in an Arabic page keep their own reading order. */
.tk-learn :is(h2, h3, p, .tk-card-title, .tk-card-summary, .tk-side-title, .tk-cta-title, .tk-item-title, .tk-lesson-summary, .tk-hero-summary) { unicode-bidi: plaintext; }
.tk-learn .tk-icon { flex: none; vertical-align: middle; }
.tk-eyebrow { color: var(--tk-muted); font-weight: 600; margin: 0 0 .5rem; }
.tk-h2 { font-size: 1.35rem; font-weight: 700; margin: 2rem 0 1rem; }
.tk-empty { color: var(--tk-muted); padding: 1.25rem; border: 1px dashed var(--tk-line); border-radius: var(--tk-radius); }

.tk-badge {
    display: inline-flex; align-items: center; gap: .25rem;
    font-size: .8125rem; font-weight: 600; line-height: 1; padding: .35rem .6rem; border-radius: 999px;
}
.tk-badge-free { background: #E9F6EF; color: #1E7F4F; }
.tk-badge-paid { background: var(--tk-pale); color: var(--tk-royal); }
.tk-badge-lock { background: #F1F3F6; color: var(--tk-muted); }
.tk-badge-done { background: var(--tk-royal); color: #fff; }

/* ------------------------------------------------------------------ course home */
.tk-hero {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2rem; align-items: center;
    padding: 2rem; border-radius: 22px; color: #D7E3F5;
    background: radial-gradient(circle at 90% 0%, rgba(10, 191, 163, .22), transparent 50%), var(--tk-navy);
}
.tk-hero .tk-eyebrow { color: #A9BEDB; }
.tk-hero-summary { color: #D7E3F5; max-inline-size: 60ch; }
.tk-hero-summary p:last-child { margin-bottom: 0; }
.tk-hero-summary a { color: #fff; }
.tk-progress { display: flex; align-items: center; gap: 1rem; margin-top: 1.5rem; }
.tk-progress-bar { flex: 1; max-inline-size: 360px; block-size: 10px; border-radius: 999px; background: rgba(255, 255, 255, .14); overflow: hidden; }
.tk-progress-bar span { display: block; block-size: 100%; background: var(--tk-teal); border-radius: inherit; }
.tk-progress-label { color: #fff; font-weight: 600; }
.tk-hero-cta { display: flex; flex-direction: column; align-items: stretch; gap: .5rem; min-inline-size: 240px; }
.tk-cta-kicker { font-size: .8rem; color: #A9BEDB; }
.tk-cta-title { color: #fff; font-weight: 700; margin-bottom: .5rem; }
.tk-hero .btn-primary { background: #fff; border-color: #fff; color: var(--tk-royal); font-weight: 700; }
.tk-hero .btn-primary:hover, .tk-hero .btn-primary:focus { background: var(--tk-pale); border-color: var(--tk-pale); color: var(--tk-royal); }
.tk-hero .btn-secondary { background: transparent; border-color: rgba(255, 255, 255, .35); color: #fff; }
.tk-hero .btn-secondary:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.tk-hero :focus-visible { outline-color: #fff; }

.tk-unlock-banner {
    display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
    margin: 1.5rem 0 0; padding: 1rem 1.25rem; border-radius: var(--tk-radius);
    background: var(--tk-pale); border: 1px solid #C9D6EA; color: var(--tk-royal);
}
.tk-unlock-banner p { flex: 1; min-inline-size: 16rem; margin: 0; font-weight: 600; }

.tk-lessons { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.tk-card-link {
    display: flex; gap: 1rem; block-size: 100%; padding: 1.25rem; border-radius: var(--tk-radius);
    background: #fff; border: 1px solid var(--tk-line); color: inherit; text-decoration: none;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.tk-card-link:hover { border-color: #AFC2DE; box-shadow: 0 8px 24px rgba(15, 27, 45, .08); color: inherit; text-decoration: none; }
.tk-card.is-next .tk-card-link { border-color: var(--tk-royal); box-shadow: 0 0 0 1px var(--tk-royal); }
.tk-card-num {
    flex: none; inline-size: 44px; block-size: 44px; border-radius: 12px; display: grid; place-items: center;
    font-weight: 700; font-size: 1.1rem; background: var(--tk-pale); color: var(--tk-royal);
}
.tk-card.is-done .tk-card-num { background: var(--tk-royal); color: #fff; }
.tk-card.is-locked .tk-card-num { background: #F1F3F6; color: var(--tk-muted); }
.tk-card-body { display: flex; flex-direction: column; gap: .5rem; min-inline-size: 0; flex: 1; }
.tk-card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; color: var(--tk-muted); font-size: .85rem; font-weight: 600; }
.tk-card-title { font-size: 1.1rem; font-weight: 700; margin: 0; line-height: 1.45; }
.tk-card-summary { color: var(--tk-muted); font-size: .92rem; }
.tk-card-steps { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: auto; padding-top: .25rem; }
.tk-pip { display: inline-flex; align-items: center; gap: .35rem; font-size: .82rem; color: var(--tk-muted); padding: .3rem .6rem; border-radius: 999px; border: 1px solid var(--tk-line); }
.tk-pip.is-done { color: var(--tk-royal); border-color: #B7C8E2; background: var(--tk-pale); }
.tk-pip.is-locked { color: #8A97AA; border-style: dashed; }
.tk-card-progress { display: block; block-size: 4px; border-radius: 999px; background: var(--tk-pale); overflow: hidden; }
.tk-card-progress span { display: block; block-size: 100%; background: var(--tk-teal); }

/* ------------------------------------------------------------------ lesson page */
.tk-lessonpage { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 2rem; align-items: start; }
.tk-side { position: sticky; inset-block-start: 5rem; }
.tk-back { display: inline-block; font-weight: 600; margin-bottom: 1rem; }
.tk-side-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .25rem; }
.tk-side-list a {
    display: flex; align-items: center; gap: .6rem; padding: .55rem .7rem; border-radius: 12px;
    color: var(--tk-ink); text-decoration: none; font-size: .92rem;
}
.tk-side-list a:hover { background: var(--tk-pale); color: var(--tk-ink); }
.tk-side-list a.is-current { background: var(--tk-royal); color: #fff; }
.tk-side-list a.is-locked { color: var(--tk-muted); }
.tk-side-num { flex: none; inline-size: 28px; block-size: 28px; border-radius: 8px; display: grid; place-items: center; font-weight: 700; font-size: .85rem; background: var(--tk-pale); color: var(--tk-royal); }
.tk-side-list a.is-current .tk-side-num { background: rgba(255, 255, 255, .16); color: #fff; }
.tk-side-title { flex: 1; min-inline-size: 0; line-height: 1.4; }
.tk-side-state { flex: none; font-weight: 700; color: var(--tk-teal-700); }
.tk-side-list a.is-current .tk-side-state { color: #fff; }

.tk-lesson-summary { color: var(--tk-muted); max-inline-size: 70ch; }

.tk-stepper ol { list-style: none; margin: 1.25rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; counter-reset: none; }
.tk-step-link {
    display: flex; align-items: center; gap: .75rem; block-size: 100%; padding: .9rem 1rem; border-radius: var(--tk-radius);
    border: 1px solid var(--tk-line); background: #fff; color: var(--tk-ink); text-decoration: none;
}
.tk-step-link:hover { border-color: #AFC2DE; color: var(--tk-ink); text-decoration: none; }
.tk-step-link.is-active { border-color: var(--tk-royal); box-shadow: 0 0 0 1px var(--tk-royal); background: var(--tk-pale); }
.tk-step-link.is-empty { opacity: .55; }
.tk-step-dot {
    flex: none; inline-size: 34px; block-size: 34px; border-radius: 50%; display: grid; place-items: center;
    font-weight: 700; border: 2px solid var(--tk-line); color: var(--tk-muted); background: #fff;
}
.tk-step-link.is-active .tk-step-dot { border-color: var(--tk-royal); color: var(--tk-royal); }
.tk-step-link.is-done .tk-step-dot { border-color: var(--tk-royal); background: var(--tk-royal); color: #fff; }
.tk-step-text { display: flex; flex-direction: column; min-inline-size: 0; }
.tk-step-label { display: inline-flex; align-items: center; gap: .4rem; font-weight: 700; }
.tk-step-label .tk-icon { color: var(--tk-azure); }
.tk-step-sub { font-size: .8rem; color: var(--tk-muted); min-block-size: 1.2em; }

.tk-item { background: #fff; border: 1px solid var(--tk-line); border-radius: var(--tk-radius); padding: 1.25rem; margin-bottom: 1rem; }
.tk-item-head { display: flex; align-items: center; gap: .75rem; margin-bottom: 1rem; flex-wrap: wrap; }
.tk-item-icon { inline-size: 36px; block-size: 36px; padding: 6px; border-radius: 10px; background: var(--tk-pale); }
.tk-item-titles { flex: 1; min-inline-size: 12rem; }
.tk-item-type { display: block; font-size: .78rem; color: var(--tk-muted); font-weight: 600; }
.tk-item-title { font-size: 1.1rem; font-weight: 700; margin: 0; }
.tk-item-badges { display: flex; gap: .4rem; flex-wrap: wrap; }
.tk-item-body > .no-overflow > :last-child { margin-bottom: 0; }
.tk-item .filter-tkvideo { margin-top: 0 !important; }
.tk-pdf { border-radius: 12px; overflow: hidden; border: 1px solid var(--tk-line); }
.tk-pdf-open { margin-top: .75rem; }
.tk-pdf iframe { display: block; inline-size: 100%; block-size: min(78vh, 900px); border: 0; }
.tk-video { display: block; inline-size: 100%; border-radius: 12px; background: var(--tk-navy); }
.tk-quiz-facts { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; margin: 0 0 1rem; padding: 0; color: var(--tk-muted); }
.tk-quiz-facts strong { color: var(--tk-ink); }
.tk-item.is-locked { background: #FAFBFD; }
.tk-lock { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; padding: 1rem; border-radius: 12px; border: 1px dashed #C3CDDC; color: var(--tk-muted); }
.tk-lock-text { flex: 1; min-inline-size: 14rem; }
.tk-lock .tk-icon-lock { color: var(--tk-royal); }

.tk-pager { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-top: 1.5rem; flex-wrap: wrap; }
.tk-pager .btn-primary { margin-inline-start: auto; }

/* ------------------------------------------------------------------ unlock and manage pages */
.tk-unlock { max-inline-size: 760px; margin-inline: auto; }
.tk-unlock-hero { padding: 2rem; border-radius: 22px; color: #D7E3F5; background: radial-gradient(circle at 90% 0%, rgba(10, 191, 163, .22), transparent 50%), var(--tk-navy); }
.tk-unlock-hero h2 { color: #fff; font-weight: 700; margin: 0 0 .5rem; }
.tk-unlock-hero p { margin: 0; }
.tk-unlock-list { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; padding: 0; margin: 1.5rem 0; }
.tk-unlock-list li { display: flex; flex-direction: column; gap: .25rem; padding: 1rem; border-radius: var(--tk-radius); border: 1px solid var(--tk-line); background: #fff; }
.tk-unlock-list strong { font-size: 1.75rem; color: var(--tk-royal); line-height: 1.1; }
.tk-unlock-list span { display: inline-flex; align-items: center; gap: .4rem; color: var(--tk-muted); }
.tk-pay { padding: 1.25rem; border-radius: var(--tk-radius); border: 1px solid var(--tk-line); background: #fff; }

.tk-manage-lesson { margin-bottom: 1.5rem; border: 1px solid var(--tk-line); border-radius: var(--tk-radius); overflow: hidden; background: #fff; }
.tk-manage-lesson > header { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; padding: .9rem 1.1rem; background: var(--tk-pale); }
.tk-manage-lesson > header h3 { flex: 1; margin: 0; font-size: 1.05rem; font-weight: 700; }
.tk-manage-lesson table { margin: 0; }
.tk-manage-lesson td, .tk-manage-lesson th { vertical-align: middle; }
.tk-manage-lesson .form-select { min-inline-size: 10rem; }

@media (max-width: 991.98px) {
    .tk-lessonpage { grid-template-columns: minmax(0, 1fr); }
    .tk-side { position: static; order: 2; }
    .tk-hero { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 575.98px) {
    .tk-hero, .tk-unlock-hero { padding: 1.25rem; }
    .tk-stepper ol { grid-template-columns: minmax(0, 1fr); }
    .tk-unlock-list { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
    .tk-card-link { transition: none; }
}

/* ======================================================================================================
   The student app: lesson page (.tkl) and course home (.tkc). Mobile first; logical properties only.
   ====================================================================================================== */
.tkl, .tkc { --ink: #0F1B2D; --muted: #5B6B82; --line: #E3E9F2; --tint: #E9EFF9; --royal: #113972; --royal-600: #17488E;
    --azure: #8FB3E6; --good: #1E7F4F; --good-bg: #E9F6EF; color: var(--ink); }
.tkl :is(h1, h2, p, a, span), .tkc :is(h1, h2, p, a, span) { unicode-bidi: plaintext; }
.tkl .tk-icon, .tkc .tk-icon { flex: none; }
.tkl-arrow::before { content: "\2190"; }
[dir="ltr"] .tkl-arrow::before { content: "\2192"; }
.tk-btn-lg { min-height: 52px; padding: 0 1.6rem; border-radius: 999px; font-size: 1.02rem; }
.tk-badge-next { background: #E9EFF9; color: #113972; }
.tk-badge-done { background: #E9F6EF; color: #1E7F4F; }

/* ---------- lesson page ---------- */
.tkl-head { margin-bottom: 1rem; }
.tkl-back { display: inline-flex; align-items: center; gap: .4rem; min-height: 40px; color: var(--muted); font-weight: 600; text-decoration: none; }
.tkl-back .tkl-arrow::before { content: "\2192"; }
[dir="ltr"] .tkl-back .tkl-arrow::before { content: "\2190"; }
.tkl-back:hover { color: var(--royal); text-decoration: none; }
.tkl-pos { margin: .25rem 0 0; color: var(--muted); font-size: .9rem; font-weight: 600; }
.tkl-title { margin: .15rem 0 0; font-size: 1.45rem; line-height: 1.4; font-weight: 700; }
@media (min-width: 768px) { .tkl-title { font-size: 1.9rem; } }

.tkl-steps {
    position: sticky; top: 64px; z-index: 20; display: grid; grid-template-columns: repeat(3, 1fr); gap: .35rem;
    margin: 0 -1rem 1.25rem; padding: .5rem 1rem; background: rgba(243, 246, 251, .96); backdrop-filter: blur(8px);
}
@media (min-width: 768px) { .tkl-steps { margin-inline: 0; padding: .35rem; border-radius: 18px; background: #fff; border: 1px solid var(--line); } }
.tkl-step {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .2rem;
    min-height: 58px; padding: .45rem .25rem; border-radius: 14px; background: #fff; border: 1px solid var(--line);
    color: var(--muted); font-weight: 700; font-size: .875rem; text-align: center; text-decoration: none;
}
@media (min-width: 768px) { .tkl-step { flex-direction: row; gap: .5rem; min-height: 48px; border: 0; font-size: .95rem; } }
.tkl-step:hover { color: var(--royal); text-decoration: none; }
.tkl-step.is-active { background: var(--royal); border-color: var(--royal); color: #fff; box-shadow: 0 6px 16px rgba(17, 57, 114, .25); }
.tkl-step.is-empty { opacity: .45; }
.tkl-step-check {
    position: absolute; inset-block-start: 4px; inset-inline-end: 6px; display: grid; place-items: center;
    width: 18px; height: 18px; border-radius: 50%; background: var(--good); color: #fff; font-size: .7rem;
}
.tkl-step.is-active .tkl-step-check { background: #fff; color: var(--good); }
@media (min-width: 768px) { .tkl-step-check { position: static; } }
.tkl-step-lock { position: absolute; inset-block-start: 4px; inset-inline-end: 6px; opacity: .6; }
.tkl-step-lock svg { width: 14px; height: 14px; }

.tkl-grid { display: grid; gap: 1.5rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 992px) { .tkl-grid { grid-template-columns: minmax(0, 1fr) 300px; align-items: start; } }
.tkl-main { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }

.tkl-item { background: #fff; border: 1px solid var(--line); border-radius: 22px; overflow: hidden;
    box-shadow: 0 1px 2px rgba(15, 27, 45, .04), 0 8px 24px rgba(15, 27, 45, .05); }
.tkl-item-title { margin: 0; font-size: 1.12rem; font-weight: 700; line-height: 1.5; }
.tkl-under { padding: 1rem 1.25rem 0; }
.tkl-badges { display: flex; flex-wrap: wrap; gap: .4rem; padding: .75rem 1.25rem 1.1rem; }
.tkl-badges:empty { display: none; }

.tkl-player { position: relative; aspect-ratio: 16 / 9; background: #0A1628; }
.tkl-player iframe, .tkl-player video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* practice levels: a segmented switch above the practice card; the bars (1, 2 or 3 filled) say the level without colour */
.tkl-levels {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: .3rem; margin-bottom: 1rem; padding: .3rem;
    background: var(--tint); border-radius: 16px; scroll-margin-top: 140px;
}
.tkl-level {
    position: relative; display: flex; align-items: center; justify-content: center; gap: .55rem; min-height: 56px;
    padding: .4rem .5rem; border: 1.5px solid transparent; border-radius: 12px; color: var(--muted); text-decoration: none;
}
.tkl-level:hover { color: var(--royal); background: rgba(255, 255, 255, .6); text-decoration: none; }
.tkl-level:focus-visible { outline: 3px solid var(--azure); outline-offset: 1px; }
.tkl-level.is-active { background: #fff; border-color: var(--royal); color: var(--royal); box-shadow: 0 4px 12px rgba(17, 57, 114, .12); }
.tkl-level-text { display: flex; flex-direction: column; line-height: 1.25; text-align: start; }
.tkl-level-text strong { font-size: .95rem; font-weight: 700; }
.tkl-level-text small { font-size: .8125rem; font-weight: 600; opacity: .8; }
.tkl-level-bars { display: inline-flex; align-items: flex-end; gap: 2px; block-size: 16px; flex: none; }
.tkl-level-bars i { display: block; inline-size: 4px; border-radius: 2px; background: currentColor; opacity: .25; }
.tkl-level-bars i:nth-child(1) { block-size: 6px; }
.tkl-level-bars i:nth-child(2) { block-size: 11px; }
.tkl-level-bars i:nth-child(3) { block-size: 16px; }
.tkl-level-1 .tkl-level-bars i:nth-child(-n+1), .tkl-level-2 .tkl-level-bars i:nth-child(-n+2),
.tkl-level-3 .tkl-level-bars i { opacity: 1; }
.tkl-level-check {
    position: absolute; inset-block-start: 4px; inset-inline-end: 6px; display: grid; place-items: center;
    width: 18px; height: 18px; border-radius: 50%; background: var(--good); color: #fff; font-size: .7rem;
}
.tkl-level-lock { position: absolute; inset-block-start: 4px; inset-inline-end: 6px; opacity: .6; }
.tkl-level-lock svg { width: 14px; height: 14px; }
@media (max-width: 420px) {
    .tkl-level { flex-direction: column; gap: .25rem; min-height: 64px; }
    .tkl-level-text { text-align: center; }
}

.tkl-practice { padding: 1.25rem; display: flex; flex-direction: column; gap: 1.1rem; }
@media (min-width: 768px) { .tkl-practice { padding: 1.75rem; } }
.tkl-practice-top { display: flex; gap: 1rem; align-items: center; }
.tkl-practice-text p { margin: .25rem 0 .5rem; color: var(--muted); }
.tkl-practice-icon { display: grid; place-items: center; flex: none; width: 76px; height: 76px; border-radius: 22px; background: var(--tint); color: var(--royal); }
.tkl-practice-icon svg { width: 36px; height: 36px; }
.tkl-ring {
    flex: none; width: 86px; height: 86px; border-radius: 50%; display: grid; place-content: center; text-align: center;
    background: radial-gradient(closest-side, #fff 76%, transparent 77% 100%), conic-gradient(var(--royal) calc(var(--p) * 1%), var(--tint) 0);
}
.tkl-ring strong { font-size: 1.3rem; line-height: 1; color: var(--royal); }
.tkl-ring small { font-size: .7rem; color: var(--muted); font-weight: 600; }
.tkl-facts { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0; padding: 0; list-style: none; }
.tkl-facts li { padding: .3rem .7rem; border-radius: 999px; background: #F3F6FB; color: var(--muted); font-size: .82rem; font-weight: 600; }
.tkl-practice-actions { display: flex; flex-direction: column; gap: .6rem; }
@media (min-width: 576px) { .tkl-practice-actions { flex-direction: row; } }

.tkl-doc { padding: 1.25rem; display: flex; flex-direction: column; gap: 1rem; }
.tkl-doc-head { display: flex; gap: .9rem; align-items: center; }
.tkl-doc-head p { margin: .2rem 0 0; color: var(--muted); }
.tkl-doc-icon { display: grid; place-items: center; flex: none; width: 56px; height: 64px; border-radius: 12px; background: #FBECEA; color: #B3372F; font-weight: 800; font-size: .85rem; }
.tkl-doc-frame { display: none; width: 100%; height: 70vh; border: 1px solid var(--line); border-radius: 14px; }
@media (min-width: 992px) { .tkl-doc-frame { display: block; } .tkl-doc .tk-btn { align-self: flex-start; } }

.tkl-body { padding: 1.25rem; }
.tkl-card-row { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between; padding: 1.25rem; }

.tkl-lock, .tkl-unlock { display: flex; flex-direction: column; align-items: center; gap: .6rem; padding: 1.75rem 1.25rem; text-align: center; }
.tkl-unlock { background: #fff; border: 1px dashed #C9D3E3; border-radius: 22px; margin-top: 1rem; }
.tkl-unlock p { margin: 0; color: var(--muted, #5B6B82); max-width: 46ch; }
.tkl-lock-icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: #E9EFF9; color: #113972; }
.tkl-lock-text { color: var(--muted); }

.tkl-empty { display: flex; flex-direction: column; align-items: center; gap: .5rem; padding: 2rem 1rem; text-align: center;
    color: var(--muted); background: #fff; border: 1px dashed #C9D3E3; border-radius: 22px; }
.tkl-empty-icon svg { width: 36px; height: 36px; }

.tkl-pager { display: flex; flex-direction: column; gap: .5rem; margin-top: .25rem; }
@media (min-width: 576px) { .tkl-pager { flex-direction: row-reverse; justify-content: space-between; align-items: center; } }
.tkl-next { justify-content: center; }

.tkl-side { background: #fff; border: 1px solid var(--line); border-radius: 22px; padding: 1rem; }
@media (min-width: 992px) { .tkl-side { position: sticky; top: 88px; } }
.tkl-side-title { margin: 0 0 .6rem; font-size: .95rem; font-weight: 700; color: var(--muted); }
.tkl-side-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .25rem; }
.tkl-side-list a { display: flex; align-items: center; gap: .65rem; min-height: 48px; padding: .45rem .55rem; border-radius: 12px; color: var(--ink); text-decoration: none; }
.tkl-side-list a:hover { background: #F3F6FB; text-decoration: none; }
.tkl-side-list a.is-current { background: var(--tint); color: var(--royal); font-weight: 700; }
.tkl-side-list a.is-locked { color: var(--muted); }
.tkl-side-num { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 50%; background: #F3F6FB; font-weight: 700; font-size: .85rem; }
.tkl-side-list a.is-done .tkl-side-num { background: var(--good-bg); color: var(--good); }
.tkl-side-list a.is-current .tkl-side-num { background: var(--royal); color: #fff; }
.tkl-side-name { flex: 1; line-height: 1.45; font-size: .92rem; }
.tkl-side-lock svg { width: 16px; height: 16px; opacity: .6; }

/* ---------- course home ---------- */
.tkc-hero {
    position: relative; overflow: hidden; display: flex; flex-direction: column; gap: .6rem;
    padding: 1.5rem 1.25rem; border-radius: 26px; color: #fff;
    background: radial-gradient(circle at 100% 0%, rgba(143, 179, 230, .32), transparent 55%), linear-gradient(135deg, #113972, #0C2B58);
}
@media (min-width: 768px) { .tkc-hero { padding: 2.25rem 2.25rem 2rem; } }
.tkc-kicker { margin: 0; color: #BFD3F0; font-weight: 600; font-size: .9rem; }
.tkc-title { margin: 0; color: #fff; font-size: 1.6rem; line-height: 1.35; font-weight: 700; }
@media (min-width: 768px) { .tkc-title { font-size: 2.2rem; } }
.tkc-summary { color: #D7E3F5; max-width: 60ch; }
.tkc-summary p { margin: 0; }
.tkc-progress { display: flex; align-items: center; gap: .75rem; margin-top: .25rem; }
.tkc-bar { display: block; flex: 1; height: 8px; border-radius: 999px; background: rgba(255, 255, 255, .2); overflow: hidden; }
.tkc-bar > span { display: block; height: 100%; min-width: 4px; border-radius: inherit; background: var(--azure); }
.tkc-progress-label { font-weight: 700; font-size: .9rem; white-space: nowrap; }
.tkc-cta {
    display: flex; flex-direction: column; gap: .15rem; margin-top: .5rem; padding: 1rem 1.1rem; border-radius: 18px;
    background: #fff; color: var(--ink); text-decoration: none;
}
.tkc-cta:hover { text-decoration: none; color: var(--ink); box-shadow: 0 10px 24px rgba(0, 0, 0, .18); }
.tkc-cta-kicker { color: var(--muted); font-size: .875rem; font-weight: 600; }
.tkc-cta-title { font-size: 1.05rem; line-height: 1.5; }
.tkc-cta-go { display: inline-flex; align-items: center; gap: .4rem; margin-top: .4rem; color: var(--royal); font-weight: 700; }
.tkc-manage { align-self: flex-start; }
.tkc-h2 { margin: 1.75rem 0 .85rem; font-size: 1.3rem; font-weight: 700; }
.tkc-lessons { list-style: none; margin: 0; padding: 0; display: grid; gap: .85rem; grid-template-columns: 1fr; }
@media (min-width: 768px) { .tkc-lessons { grid-template-columns: repeat(2, 1fr); } }
.tkc-lesson {
    display: flex; gap: .9rem; height: 100%; padding: 1.1rem; border-radius: 22px; background: #fff; border: 1px solid var(--line);
    color: var(--ink); text-decoration: none; transition: border-color .15s ease, box-shadow .15s ease;
}
.tkc-lesson:hover { color: var(--ink); text-decoration: none; border-color: #C9D3E3; box-shadow: 0 8px 24px rgba(15, 27, 45, .06); }
.tkc-lesson.is-next { border: 2px solid var(--royal); }
.tkc-lesson.is-locked { background: #FAFBFD; }
.tkc-num { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 14px; background: var(--tint); color: var(--royal); font-weight: 800; }
.tkc-lesson.is-done .tkc-num { background: var(--good-bg); color: var(--good); }
.tkc-lesson-body { display: flex; flex-direction: column; gap: .45rem; min-width: 0; flex: 1; }
.tkc-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; color: var(--muted); font-size: .82rem; font-weight: 600; }
.tkc-lesson-title { font-size: 1.05rem; font-weight: 700; line-height: 1.5; }
.tkc-lesson-summary { color: var(--muted); font-size: .92rem; line-height: 1.6; }
.tkc-pips { display: flex; flex-wrap: wrap; gap: .35rem; }
.tkc-pip { display: inline-flex; align-items: center; gap: .3rem; padding: .3rem .65rem; border-radius: 999px; background: #F3F6FB; color: var(--muted); font-size: .8125rem; font-weight: 600; }
.tkc-pip svg { width: 16px; height: 16px; }
.tkc-pip.is-done { background: var(--good-bg); color: var(--good); }
.tkc-bar-sm { flex: none; height: 6px; background: #EEF2F8; }
.tkc-bar-sm > span { background: var(--royal); }

/* In an Arabic page an English title keeps its own letter order (plaintext) but lines up with the Arabic around it. */
[dir="rtl"] :is(.tkl-title, .tkl-item-title, .tkl-side-name, .tkc-title, .tkc-lesson-title, .tkc-cta-title) { text-align: right; }
[dir="ltr"] :is(.tkl-title, .tkl-item-title, .tkl-side-name, .tkc-title, .tkc-lesson-title, .tkc-cta-title) { text-align: left; }

/* «عندي سؤال», the instructor's inbox, and «من أسئلة الطلبة» */
.tkq-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .9rem; margin-top: .75rem; }
.tkq-actions .tk-btn { display: inline-flex; align-items: center; gap: .45rem; min-height: 44px; }
.tkq-mine { color: var(--muted, #5B6B82); font-weight: 600; text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.tkq-mine:hover { color: var(--royal, #113972); }
.tkq-badge { display: inline-grid; place-items: center; min-width: 1.4rem; height: 1.4rem; padding-inline: .35rem;
    border-radius: 999px; background: #B3372F; color: #fff; font-size: .75rem; font-weight: 700; }
.tkq-faq { margin-top: 2rem; }
.tkq-faq-lead { color: var(--muted, #5B6B82); margin: -.25rem 0 1rem; }
.tkq-faq-item { background: #fff; border: 1px solid var(--line, #E3E9F2); border-radius: 16px; margin-bottom: .6rem; }
.tkq-faq-item summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; align-items: center;
    justify-content: space-between; gap: .4rem .75rem; padding: .9rem 1.1rem; min-height: 56px; font-weight: 700; }
.tkq-faq-item summary::-webkit-details-marker { display: none; }
.tkq-faq-item summary::after { content: "+"; font-size: 1.3rem; color: var(--royal, #113972); line-height: 1; }
.tkq-faq-item[open] summary::after { content: "–"; }
.tkq-faq-q { flex: 1 1 16rem; }
.tkq-faq-lesson { font-size: .8rem; font-weight: 600; color: var(--muted, #5B6B82); background: #F3F6FB; padding: .15rem .55rem; border-radius: 999px; }
.tkq-faq-a { padding: 0 1.1rem 1rem; color: var(--ink, #0F1B2D); line-height: 1.8; white-space: pre-line; }

/* the live sessions on the course home */
.tkc-live { margin: 1.5rem 0 .5rem; display: flex; flex-direction: column; gap: .75rem; }
.tkc-live-head { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; }
.tkc-live-head .tkc-h2 { margin: 0; }
.tkc-live-head a { font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; }
.tkc-live-none { margin: 0; color: #52627A; }
.tkc-live-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.tkc-live-actions:empty { display: none; }

/* the recorded sessions on the course home */
.tkc-rec-title { margin: .75rem 0 0; font-size: 1rem; font-weight: 700; }
.tkc-recs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.tkc-rec {
    display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .5rem .9rem; align-items: center;
    padding: .75rem .9rem; border: 1px solid #E3E9F2; border-radius: 16px; background: #fff;
}
.tkc-rec-date {
    inline-size: 52px; block-size: 56px; border-radius: 12px; display: flex; flex-direction: column; align-items: center;
    justify-content: center; background: #FBF1DE; color: #8A5A10; font-size: .75rem; font-weight: 600; line-height: 1.15;
}
.tkc-rec-date b { font-size: 1.25rem; }
.tkc-rec-body { min-width: 0; display: flex; flex-direction: column; }
.tkc-rec-name { font-weight: 700; color: #0F1B2D; text-decoration: none; line-height: 1.45; }
.tkc-rec-name:hover { color: #113972; text-decoration: underline; }
.tkc-rec-meta { color: #52627A; font-size: .88rem; }
.tkc-rec-play { grid-column: 1 / -1; display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 44px; }
@media (min-width: 640px) {
    .tkc-rec { grid-template-columns: auto minmax(0, 1fr) auto; }
    .tkc-rec-play { grid-column: auto; }
}
