/* Ghalamoom design system — GENERATED bundle. Link dist/tokens.css first, then this file. */

/* ===== foundations.css ===== */
/* ==========================================================================
   Ghalamoom DS — foundations
   Reset, base typography, focus, icons, layout (container + bento grid), utilities.
   Uses semantic tokens only (dist/tokens.css must be loaded first).
   ========================================================================== */

/* ---------- user settings (set on <html> by ghalamoom.js) ----------
   data-theme="light|dark" → the RESOLVED theme (ADR 0028; set before first paint by js/theme-boot.js, kept in sync by
                           core.js). Light = semantic remap in tokens.css; media canvases stay dark (token "islands").
   data-contrast="high"  → high-contrast token overrides (in tokens.css)
   data-motion="reduce"  → no transitions/animations
   --gh-scale            → text size (0.875 – 1.25); rem-based type scales, layout does not */
:root{ --gh-scale:1; color-scheme:dark; }
:root[data-motion="reduce"] *{transition:none!important;animation:none!important;scroll-behavior:auto!important}
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important;scroll-behavior:auto!important}}

/* ---------- reset ---------- */
*,*::before,*::after{box-sizing:border-box}
html{font-size:calc(100% * var(--gh-scale));-webkit-text-size-adjust:100%;scroll-behavior:smooth;scroll-padding-top:calc(var(--gh-layout-header-height) + 20px)}
body{margin:0;background:var(--gh-color-bg-canvas);color:var(--gh-color-text-primary);font-family:var(--gh-font-family-base);
  font-size:var(--gh-type-body-size);line-height:var(--gh-type-body-line-height);font-weight:var(--gh-type-body-weight);
  -webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;overflow-x:hidden}
h1,h2,h3,h4,h5,h6,p,ol,ul,dl,dd,figure,blockquote{margin:0}
h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}
ol,ul{padding:0;list-style:none}
a{color:inherit;text-decoration:none}
button,input,select,textarea{font:inherit;color:inherit;letter-spacing:inherit}
button{cursor:pointer;background:none;border:0;padding:0}
button:disabled,[aria-disabled="true"]{cursor:not-allowed}
img,svg,video,canvas{display:block;max-width:100%}
table{border-collapse:collapse}
[hidden]{display:none!important}
::selection{background:var(--gh-color-selection-bg);color:var(--gh-color-selection-text)}
html{scrollbar-color:var(--gh-color-scrollbar-thumb) var(--gh-color-scrollbar-track)}

/* ---------- focus ---------- */
:focus{outline:none}
:focus-visible{outline:var(--gh-focus-width) solid var(--gh-color-focus-ring);outline-offset:var(--gh-focus-offset);border-radius:var(--gh-radius-control)}

/* ---------- icons (24×24 sprite, stroke) ---------- */
.gh-icon{width:var(--gh-icon-md);height:var(--gh-icon-md);fill:none;stroke:currentColor;stroke-width:var(--gh-icon-stroke);stroke-linecap:round;stroke-linejoin:round;flex:none}
.gh-icon--sm{width:var(--gh-icon-sm);height:var(--gh-icon-sm)}
.gh-icon--lg{width:var(--gh-icon-lg);height:var(--gh-icon-lg)}
/* RTL: the sprite's directional icons (i-arrow = «جلو/بعدی», i-arrow-r, i-chev, i-chev-l) are already drawn for RTL.
   Use .gh-icon--mirror only when an icon must point the other way (e.g. inside an LTR island like the video scrubber).
   Never mirror media, clocks, checks, search or brand marks. */
[dir="rtl"] .gh-icon--mirror{transform:scaleX(-1)}

/* ---------- typography helpers ---------- */
.gh-eyebrow{display:inline-flex;align-items:center;gap:var(--gh-ref-space-200);font-size:var(--gh-type-label-sm-size);font-weight:var(--gh-ref-font-weight-medium);color:var(--gh-color-text-secondary)}
.gh-eyebrow::before{content:"";width:6px;height:6px;border-radius:2px;background:var(--gh-color-accent-ink)}
.gh-text-secondary{color:var(--gh-color-text-secondary)}
.gh-text-tertiary{color:var(--gh-color-text-tertiary)}
.gh-text-accent{color:var(--gh-color-accent-ink)}
/* a link inside running text needs more than colour (WCAG 1.4.1, axe link-in-text-block): a quiet underline */
a.gh-text-accent{text-decoration:underline;text-decoration-color:var(--gh-color-accent-border);text-decoration-thickness:1px;text-underline-offset:.3em}
a.gh-text-accent:hover{text-decoration-color:currentColor}
.gh-dim{color:var(--gh-color-text-tertiary);font-weight:var(--gh-ref-font-weight-light)}
.gh-figure{font-weight:var(--gh-ref-font-weight-thin);line-height:1.1}
/* Lahzeh FaNum widens Persian digits under tabular-nums, so it is not used; align columns with fixed-width cells instead. */
.gh-num{white-space:nowrap}
.gh-prose{max-width:68ch;line-height:var(--gh-ref-font-line-height-relaxed)}
.gh-prose p+p{margin-top:1em}

/* Separator — Lahzeh's «۰» looks like «·», so a thin rule is used. NEVER type «·» in content. */
.gh-sep{display:inline-block;width:1px;height:.85em;background:currentColor;opacity:.35;vertical-align:-.1em;margin-inline:.55em}

/* Latin / code / URLs inside Persian text */
.gh-ltr{direction:ltr;unicode-bidi:isolate;font-family:var(--gh-font-family-latin)}

/* ---------- layout ---------- */
.gh-container{max-width:var(--gh-layout-content-max);margin-inline:auto;padding-inline:var(--gh-layout-gutter)}
.gh-section{padding-block:var(--gh-layout-section) 0}
.gh-bento{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:var(--gh-layout-gap)}
.gh-span-2{grid-column:span 2}.gh-span-3{grid-column:span 3}.gh-span-4{grid-column:span 4}.gh-span-5{grid-column:span 5}
.gh-span-6{grid-column:span 6}.gh-span-7{grid-column:span 7}.gh-span-8{grid-column:span 8}.gh-span-9{grid-column:span 9}
.gh-span-12{grid-column:1/-1}.gh-row-2{grid-row:span 2}
.gh-stack{display:flex;flex-direction:column;gap:var(--gh-stack-gap,var(--gh-ref-space-300))}
.gh-cluster{display:flex;flex-wrap:wrap;align-items:center;gap:var(--gh-cluster-gap,var(--gh-ref-space-200))}
.gh-cluster>*,.gh-stack>*{min-width:0}
.gh-push{margin-inline-start:auto}

@media (max-width:1180px){
  .gh-span-3,.gh-span-4,.gh-span-5{grid-column:span 6}
  .gh-span-7,.gh-span-8,.gh-span-9{grid-column:1/-1}
}
@media (max-width:860px){
  .gh-container{padding-inline:var(--gh-layout-gutter-mobile)}
  .gh-section{padding-block:var(--gh-ref-space-1200) 0}
  .gh-bento>[class*="gh-span-"]{grid-column:1/-1}
  .gh-row-2{grid-row:auto}
}

/* ---------- utilities ---------- */
.gh-sr-only{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0;padding:0;margin:-1px}
.gh-skip-link{position:absolute;inset-inline-start:var(--gh-ref-space-400);top:-60px;z-index:var(--gh-ref-z-toast);background:var(--gh-color-accent-default);color:var(--gh-color-accent-on);padding:var(--gh-ref-space-200) var(--gh-ref-space-400);border-radius:var(--gh-radius-pill);font-weight:var(--gh-ref-font-weight-semibold)}
.gh-skip-link:focus{top:var(--gh-ref-space-300)}
.gh-truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
.gh-hide-mobile{}
@media (max-width:860px){.gh-hide-mobile{display:none!important}}
/* keyboard-only hints («Space», ⌘K, «?» shortcuts): hidden on devices whose only pointer is touch, at any width */
.gh-hide-touch{}
@media (hover:none) and (pointer:coarse){.gh-hide-touch{display:none!important}}
@media (min-width:861px){.gh-show-mobile{display:none!important}}

/* ---------- theme switch icon (ADR 0028): [data-gh-theme-toggle] holds a sun and a moon; it shows the theme it switches TO ---------- */
.gh-theme-icon--dark{display:none}
:root[data-theme="light"] .gh-theme-icon--dark{display:block}
:root[data-theme="light"] .gh-theme-icon--light{display:none}


/* ===== components/a11y-settings.css ===== */
/* ==========================================================================
   Accessibility settings — text size / high contrast / reduce motion. Lives in a gh-popover (header,
   topbar, focus bar) and on the settings page. Wired by core.js: [data-gh-setting="scale|contrast|motion"]
   (scale = .gh-stepper holding [data-gh-step] buttons + an editable spinbutton input; contrast/motion = .gh-switch, role=switch).
   Consolidates .pop .row / .stepper / data-fs / data-contrast / data-motion (13 pages).
   ========================================================================== */
.gh-a11y-settings{display:grid}
.gh-a11y-settings__row{display:flex;align-items:center;justify-content:space-between;gap:var(--gh-ref-space-300);min-height:48px;padding-block:var(--gh-ref-space-200);font-size:var(--gh-type-label-size);color:var(--gh-color-text-secondary)}
.gh-a11y-settings__row+.gh-a11y-settings__row{border-block-start:1px solid var(--gh-color-border-subtle)}
.gh-a11y-settings__label{display:flex;align-items:center;gap:var(--gh-ref-space-200);min-width:0}
.gh-a11y-settings__label>.gh-icon{color:var(--gh-color-text-tertiary)}
/* text size = gh-stepper (stepper.css) with data-gh-setting="scale"; switches = gh-switch (switch.css) */
.gh-a11y-settings__note{margin-top:var(--gh-ref-space-200);font-size:var(--gh-type-caption-size);color:var(--gh-color-text-tertiary)}


/* ===== components/accordion-meta.css ===== */
/* ==========================================================================
   gh-accordion__share — meta slot with a mini composition bar in the accordion trigger (Group C, v0.2 C8)
   Kept apart from accordion.css (group B owns the accordion). Consolidates course .co-chbar (lesson time share per chapter).
   Markup inside .gh-accordion__end: «۵۷ دقیقه» + <span class="gh-accordion__share" aria-hidden="true"> + gh-stackbar--mini.
   The bar's length = this chapter's share of the longest chapter (--gh-stackbar-w), its parts = lesson kinds
   (free preview = you/accent, exercise = strong, lesson = mark). The trigger text already says the numbers,
   so the bar is decorative (aria-hidden); the legend sits once under the accordion. Hidden on phones.
   ========================================================================== */
.gh-accordion__end:has(.gh-accordion__share){display:inline-flex;align-items:center;gap:var(--gh-ref-space-300)}
.gh-accordion__share{display:inline-flex;align-items:center;inline-size:7.5rem;flex:none}
.gh-accordion__share>.gh-stackbar--mini{--gh-stackbar-h:.375rem}
@media (max-width:860px){.gh-accordion__share{display:none}}


/* ===== components/accordion.css ===== */
/* ==========================================================================
   Accordion — heading > button[aria-expanded][aria-controls] + region (data-gh-accordion).
   Consolidates .acc/.acc-h/.acc-p (checkout, course, courses), .acc-h/.acc-b (assignment),
   curriculum chapters (.cur .acc-h .no) and lesson outline chapters (.och).
   ========================================================================== */
.gh-accordion{display:grid}
.gh-accordion__item{border-block-start:1px solid var(--gh-color-border-subtle)}
.gh-accordion--flush>.gh-accordion__item:first-child{border-block-start:0}
.gh-accordion__heading{margin:0;font:inherit}
.gh-accordion__trigger{display:flex;align-items:center;gap:var(--gh-ref-space-300);width:100%;min-height:48px;padding:var(--gh-ref-space-400) var(--gh-ref-space-100);
  text-align:start;font-size:var(--gh-type-body-size);font-weight:var(--gh-ref-font-weight-semibold);line-height:var(--gh-type-label-line-height);color:var(--gh-color-text-primary);border-radius:var(--gh-radius-control)}
.gh-accordion__trigger:hover .gh-accordion__chevron{color:var(--gh-color-text-primary)}
/* leading number / icon (curriculum chapter) — lights up when open */
.gh-accordion__lead{display:grid;place-items:center;width:34px;height:34px;flex:none;border-radius:10px;background:var(--gh-color-surface-3);color:var(--gh-color-text-secondary);font-size:var(--gh-type-label-size);font-weight:var(--gh-ref-font-weight-bold)}
.gh-accordion__trigger[aria-expanded="true"] .gh-accordion__lead{background:var(--gh-color-accent-default);color:var(--gh-color-accent-on)}
.gh-accordion__title{flex:1;min-width:0}
.gh-accordion__meta{display:block;margin-top:2px;font-size:var(--gh-type-label-sm-size);font-weight:var(--gh-ref-font-weight-regular);color:var(--gh-color-text-tertiary)}
.gh-accordion__end{flex:none;font-size:var(--gh-type-label-sm-size);font-weight:var(--gh-ref-font-weight-regular);color:var(--gh-color-text-tertiary);white-space:nowrap}
.gh-accordion__chevron{flex:none;color:var(--gh-color-text-tertiary);transition:transform var(--gh-motion-duration-base) var(--gh-motion-ease)}
.gh-accordion__trigger[aria-expanded="true"] .gh-accordion__chevron{transform:rotate(180deg)}
.gh-accordion__panel{padding:0 var(--gh-ref-space-100) var(--gh-ref-space-400);color:var(--gh-color-text-secondary);font-size:var(--gh-type-body-sm-size);line-height:var(--gh-type-body-sm-line-height)}
/* compact (side panels, outline) */
.gh-accordion--sm .gh-accordion__trigger{padding:var(--gh-ref-space-250) var(--gh-ref-space-200);font-size:var(--gh-type-label-size);font-weight:var(--gh-ref-font-weight-bold);border-radius:var(--gh-radius-inner)}
.gh-accordion--sm .gh-accordion__trigger:hover{background:var(--gh-color-surface-2)}
.gh-accordion--sm .gh-accordion__panel{padding:2px 0 var(--gh-ref-space-200)}


/* ===== components/action-bar.css ===== */
/* ==========================================================================
   Sticky action bar — the page's primary action pinned to the bottom on phones.
   Consolidates .actbar (checkout, course, review) and .mbar (lesson, quiz, assignment).
   Hidden above 860px unless --always (then sticky inside its scroll container).
   ========================================================================== */
.gh-action-bar{display:none}
.gh-action-bar__summary{min-width:0;line-height:var(--gh-type-label-line-height)}
.gh-action-bar__value{display:block;font-size:var(--gh-type-body-lg-size);font-weight:var(--gh-ref-font-weight-bold);white-space:nowrap}
.gh-action-bar__meta{display:block;font-size:var(--gh-type-caption-size);color:var(--gh-color-text-tertiary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.gh-action-bar__end{margin-inline-start:auto;display:flex;gap:var(--gh-ref-space-200);flex:none}
.gh-action-bar__grow{flex:1}
/* the bar never overflows a narrow phone: buttons may shrink (their label ellipsises) instead of pushing past the gutter */
.gh-action-bar>*{min-width:0}
.gh-action-bar>.gh-btn{flex-shrink:1}
.gh-action-bar>.gh-btn>span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.gh-action-bar--always{display:flex;position:sticky;bottom:0}
.gh-action-bar--always,.gh-action-bar{align-items:center;gap:var(--gh-ref-space-300);
  padding:var(--gh-ref-space-250) var(--gh-ref-space-400) calc(var(--gh-ref-space-250) + env(safe-area-inset-bottom));
  background:var(--gh-color-bg-header);-webkit-backdrop-filter:blur(14px);backdrop-filter:blur(14px);border-block-start:1px solid var(--gh-color-border-subtle)}
@media (max-width:860px){
  .gh-action-bar{display:flex;position:fixed;inset-inline:0;bottom:0;z-index:var(--gh-ref-z-fixed)}
  body:has(.gh-action-bar:not(.gh-action-bar--always):not(.gh-action-bar--responsive)){padding-block-end:calc(76px + env(safe-area-inset-bottom))}
}

/* --responsive (v0.2, gap B8): an ordinary row at the end of a form on desktop (hairline above, no glass),
   the pinned bar on phones. Body clearance only while the bar is actually shown (not inside a [hidden] view). */
@media (min-width:861px){
  .gh-action-bar--responsive{display:flex;margin-block-start:var(--gh-ref-space-300);padding:var(--gh-ref-space-400) 0 0;
    background:none;-webkit-backdrop-filter:none;backdrop-filter:none}
}
@media (max-width:860px){
  .gh-action-bar--responsive{margin:0}
  body:has(.gh-action-bar--responsive:not([hidden]):not([hidden] *)){padding-block-end:calc(76px + env(safe-area-inset-bottom))}
}

/* above the mobile app tabbar (pages with both, e.g. assignment — ADR 0015) */
@media (max-width:860px){
  .gh-action-bar--above-tabbar{bottom:var(--gh-layout-tabbar-height)}
  body:has(.gh-action-bar--above-tabbar){padding-block-end:calc(76px + var(--gh-layout-tabbar-height) + env(safe-area-inset-bottom))}
}


/* ===== components/activity-timeline.css ===== */
/* ==========================================================================
   gh-activity — event log / progress timeline (Group C)
   Consolidates: assignment .atl (+ .atl.h horizontal), profile .tl-v (dotted done/current/next), dashboard .nlist rhythm.
   Item states: .is-done (check), aria-current="step" (accent), .is-ai (assistant event, violet + sparkle icon),
   .is-next (dashed, future), .is-warning (late; icon + words). Vertical by default; --horizontal from 861px.
   ========================================================================== */
.gh-activity{display:grid;position:relative}
.gh-activity__item{display:grid;grid-template-columns:1.75rem minmax(0,1fr);gap:var(--gh-ref-space-250);position:relative;padding-block-end:var(--gh-ref-space-400)}
.gh-activity__item::before{content:"";position:absolute;top:1.75rem;bottom:var(--gh-ref-space-100);inset-inline-start:calc(.875rem - 1px);inline-size:2px;border-radius:1px;background:var(--gh-color-border-default)}
.gh-activity__item:last-child{padding-block-end:0}
.gh-activity__item:last-child::before{display:none}
.gh-activity__dot{position:relative;z-index:1;inline-size:1.75rem;block-size:1.75rem;border-radius:50%;display:grid;place-items:center;background:var(--gh-color-surface-3);color:var(--gh-color-text-secondary)}
.gh-activity__dot .gh-icon{inline-size:.875rem;block-size:.875rem}
.gh-activity__item.is-done .gh-activity__dot{background:var(--gh-color-status-success-soft);color:var(--gh-color-status-success)}
.gh-activity__item[aria-current] .gh-activity__dot{background:var(--gh-color-accent-default);color:var(--gh-color-accent-on)}
.gh-activity__item.is-ai .gh-activity__dot{background:var(--gh-color-ai-soft);color:var(--gh-color-ai-default)}
.gh-activity__item.is-warning .gh-activity__dot{background:var(--gh-color-status-warning-soft);color:var(--gh-color-status-warning)}
.gh-activity__item.is-next .gh-activity__dot{background:none;border:1.5px dashed var(--gh-color-border-strong);color:var(--gh-color-text-tertiary)}
.gh-activity__item.is-next::before{background:none;border-inline-start:2px dashed var(--gh-color-border-default)}
.gh-activity__title{display:block;font-size:var(--gh-type-label-size);font-weight:var(--gh-ref-font-weight-semibold);line-height:1.5;padding-block-start:.2rem}
.gh-activity__item.is-next .gh-activity__title{color:var(--gh-color-text-secondary);font-weight:var(--gh-ref-font-weight-medium)}
.gh-activity__meta{display:flex;align-items:center;flex-wrap:wrap;font-size:var(--gh-type-caption-size);color:var(--gh-color-text-tertiary);line-height:1.6}
.gh-activity__score{font-size:var(--gh-type-caption-size);font-weight:var(--gh-ref-font-weight-bold);color:var(--gh-color-text-primary);background:var(--gh-color-surface-3);padding-inline:var(--gh-ref-space-150);border-radius:var(--gh-radius-pill);margin-inline-start:var(--gh-ref-space-150)}
.gh-activity__body{grid-column:2;font-size:var(--gh-type-label-sm-size);color:var(--gh-color-text-secondary);line-height:var(--gh-type-body-sm-line-height)}
/* compact: small dots, for side panels and profile («مسیر من») */
.gh-activity--compact .gh-activity__item{grid-template-columns:.875rem minmax(0,1fr);padding-block-end:var(--gh-ref-space-300)}
.gh-activity--compact .gh-activity__dot{inline-size:.875rem;block-size:.875rem;margin-block-start:.35rem;background:var(--gh-color-surface-4);box-shadow:0 0 0 2px var(--gh-color-surface-1)}
.gh-activity--compact .gh-activity__dot .gh-icon{display:none}
.gh-activity--compact .gh-activity__item::before{top:1.5rem;inset-inline-start:calc(.4375rem - 1px)}
.gh-activity--compact .gh-activity__item.is-done .gh-activity__dot{background:var(--gh-color-text-tertiary)}
.gh-activity--compact .gh-activity__item.is-next .gh-activity__dot{background:var(--gh-color-surface-1)}
@media (min-width:861px){
  .gh-activity--horizontal{grid-template-columns:repeat(auto-fit,minmax(0,1fr));gap:var(--gh-ref-space-300)}
  .gh-activity--horizontal .gh-activity__item{grid-template-columns:1fr;gap:var(--gh-ref-space-250);padding-block-end:0}
  .gh-activity--horizontal .gh-activity__item::before{top:calc(.875rem - 1px);bottom:auto;block-size:2px;inline-size:auto;inset-inline-start:2.25rem;inset-inline-end:calc(-1 * var(--gh-ref-space-200))}
  .gh-activity--horizontal .gh-activity__item.is-next::before{border-inline-start:0;border-block-start:2px dashed var(--gh-color-border-default)}
  .gh-activity--horizontal .gh-activity__body{grid-column:1}
}


/* ===== components/ai.css ===== */
/* ==========================================================================
   gh-ai — «دستیار قلم»: AI card, AI thread, AI draft, sources (Group C)
   Consolidates: dashboard .ai .msg + .src + .drill + .ask, lesson .ai-chips/.ai-th/.ai-q/.ai-a/.ai-in/.ai-note/.dots3,
   review .aid (draft that must be reviewed), assignment .drill-run.
   Violet = assistant only, always with the name «دستیار قلم» and the sparkle icon (never colour alone).
   Every answer cites sources (lesson + timestamp, pin, rubric). A draft cannot be used until a human edits it.
   ========================================================================== */
.gh-ai{display:flex;flex-direction:column;gap:var(--gh-ref-space-300);min-width:0}
.gh-ai__badge{display:inline-flex;align-items:center;gap:var(--gh-ref-space-150);font-size:var(--gh-type-label-sm-size);font-weight:var(--gh-ref-font-weight-bold);color:var(--gh-color-ai-default)}
.gh-ai__badge .gh-icon{inline-size:1rem;block-size:1rem}
.gh-ai__msg{padding:var(--gh-ref-space-300) var(--gh-ref-space-400);border-radius:var(--gh-radius-inner);background:var(--gh-color-surface-2);border:1px solid var(--gh-color-border-subtle);
  border-inline-start:2px solid var(--gh-color-ai-border);font-size:var(--gh-type-body-sm-size);line-height:var(--gh-type-body-sm-line-height);color:var(--gh-color-text-secondary)}
.gh-ai__msg b{color:var(--gh-color-text-primary);font-weight:var(--gh-ref-font-weight-semibold)}
.gh-ai__msg p+p,.gh-ai__msg p+.gh-sources{margin-block-start:var(--gh-ref-space-200)}
.gh-ai__note{display:flex;gap:var(--gh-ref-space-150);align-items:center;font-size:var(--gh-type-caption-size);color:var(--gh-color-text-tertiary)}
.gh-ai__prompts{display:flex;gap:var(--gh-ref-space-150);flex-wrap:wrap}
/* ask field */
.gh-ai__ask{display:flex;align-items:center;gap:var(--gh-ref-space-150);padding:var(--gh-ref-space-100);border-radius:var(--gh-radius-pill);border:1px solid var(--gh-color-border-default);background:var(--gh-color-surface-2)}
.gh-ai__ask:focus-within{border-color:var(--gh-color-ai-border)}
.gh-ai__ask input{flex:1;min-width:0;background:none;border:0;block-size:2.25rem;padding-inline:var(--gh-ref-space-300);font-size:var(--gh-type-label-size)}
.gh-ai__ask input:focus-visible{outline:none}
.gh-ai__ask input::placeholder{color:var(--gh-color-text-tertiary)}
.gh-ai__send{inline-size:2.25rem;block-size:2.25rem;border-radius:50%;display:grid;place-items:center;flex:none;background:var(--gh-color-ai-soft);color:var(--gh-color-ai-default)}
.gh-ai__send:hover{background:var(--gh-color-ai-border);color:var(--gh-color-text-primary)}

/* card: the assistant as a tile-level block */
.gh-ai-card{padding:var(--gh-tile-padding);border-radius:var(--gh-radius-tile);background:var(--gh-color-surface-1);border:1px solid var(--gh-color-border-subtle);
  background-image:linear-gradient(to bottom,var(--gh-color-ai-soft),transparent 6rem)}

/* thread: user question bubble ↔ assistant answer */
.gh-ai__thread{display:grid;gap:var(--gh-ref-space-250);max-block-size:var(--gh-ai-thread-h,26rem);overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:var(--gh-color-surface-4) transparent}
.gh-ai__q{justify-self:start;max-inline-size:88%;padding:var(--gh-ref-space-200) var(--gh-ref-space-300);border-radius:14px 14px 14px 4px;background:var(--gh-color-surface-3);font-size:var(--gh-type-body-sm-size);line-height:var(--gh-type-body-sm-line-height)}
[dir="rtl"] .gh-ai__q{border-radius:14px 14px 4px 14px}
.gh-ai__typing{display:inline-flex;gap:4px;vertical-align:middle}
.gh-ai__typing i{inline-size:6px;block-size:6px;border-radius:50%;background:var(--gh-color-ai-default);animation:gh-ai-dot 1s infinite}
.gh-ai__typing i:nth-child(2){animation-delay:.2s}.gh-ai__typing i:nth-child(3){animation-delay:.4s}
@keyframes gh-ai-dot{50%{opacity:.25}}

/* sources: lesson + timestamp, pin, rubric criterion */
.gh-sources{display:grid;gap:var(--gh-ref-space-150)}
.gh-sources__label{font-size:var(--gh-type-caption-size);color:var(--gh-color-text-tertiary)}
.gh-sources a,.gh-sources button{display:flex;align-items:center;gap:var(--gh-ref-space-250);inline-size:100%;text-align:start;padding:var(--gh-ref-space-200) var(--gh-ref-space-250);border-radius:var(--gh-ref-radius-sm);
  border:1px solid var(--gh-color-border-subtle);background:var(--gh-color-surface-1);font-size:var(--gh-type-label-sm-size);color:var(--gh-color-text-secondary)}
.gh-sources a:hover,.gh-sources button:hover{background:var(--gh-color-surface-3);color:var(--gh-color-text-primary)}
.gh-sources .gh-icon{color:var(--gh-color-text-tertiary)}
.gh-sources .gh-timestamp,.gh-sources .gh-pin-badge{margin-inline-start:auto}

/* steps the assistant suggests (numbered, checkable) */
.gh-ai__steps{display:grid;gap:var(--gh-ref-space-150);counter-reset:gh-ai}
.gh-ai__steps li{display:flex;gap:var(--gh-ref-space-250);align-items:flex-start;padding:var(--gh-ref-space-200) var(--gh-ref-space-250);border-radius:var(--gh-ref-radius-sm);background:var(--gh-color-surface-2);
  font-size:var(--gh-type-label-sm-size);line-height:1.7;counter-increment:gh-ai}
.gh-ai__steps li::before{content:counter(gh-ai,persian);inline-size:1.25rem;block-size:1.25rem;flex:none;border-radius:6px;display:grid;place-items:center;margin-block-start:2px;
  background:var(--gh-color-surface-4);color:var(--gh-color-text-primary);font-size:var(--gh-type-caption-size);font-weight:var(--gh-ref-font-weight-extrabold)}
.gh-ai__steps li small{margin-inline-start:auto;color:var(--gh-color-text-tertiary);white-space:nowrap}

/* draft: suggestion an instructor must edit before it can be used */
.gh-ai-draft{display:flex;flex-direction:column;gap:var(--gh-ref-space-200);padding:var(--gh-ref-space-300) var(--gh-ref-space-400);border-radius:var(--gh-radius-inner);
  border:1px dashed var(--gh-color-ai-border);background:var(--gh-color-ai-soft);font-size:var(--gh-type-body-sm-size);line-height:var(--gh-type-body-sm-line-height)}
.gh-ai-draft__head{display:flex;align-items:center;gap:var(--gh-ref-space-200);flex-wrap:wrap}
.gh-ai-draft__state{display:inline-flex;align-items:center;gap:var(--gh-ref-space-100);block-size:1.375rem;padding-inline:var(--gh-ref-space-200);border-radius:var(--gh-radius-pill);
  font-size:var(--gh-type-caption-size);font-weight:var(--gh-ref-font-weight-semibold);background:var(--gh-color-surface-3);color:var(--gh-color-text-secondary);margin-inline-start:auto}
.gh-ai-draft__text{inline-size:100%;min-block-size:6.5rem;resize:vertical;padding:var(--gh-ref-space-250) var(--gh-ref-space-300);border-radius:var(--gh-ref-radius-sm);border:1px solid var(--gh-color-border-default);
  background:var(--gh-color-surface-1);color:var(--gh-color-text-primary);font-size:var(--gh-type-body-sm-size);line-height:var(--gh-type-body-sm-line-height)}
.gh-ai-draft__text:focus-visible{outline:none;border-color:var(--gh-color-accent-border);box-shadow:0 0 0 1px var(--gh-color-accent-border)}
.gh-ai-draft__actions{display:flex;gap:var(--gh-ref-space-150);flex-wrap:wrap;align-items:center}
.gh-ai-draft__hint{font-size:var(--gh-type-caption-size);color:var(--gh-color-text-secondary);margin-inline-start:auto}
.gh-ai-draft.is-edited{border-style:solid;background:var(--gh-color-surface-2)}
.gh-ai-draft.is-edited .gh-ai-draft__state{background:var(--gh-color-accent-soft);color:var(--gh-color-accent-ink)}
.gh-ai-draft.is-used{opacity:.6}
.gh-ai-draft.is-used .gh-ai-draft__text,.gh-ai-draft.is-used .gh-ai-draft__actions{display:none}


/* ===== components/anchor-nav.css ===== */
/* ==========================================================================
   Anchor nav — sticky in-page section links with scroll-spy (data-gh-anchor-nav).
   Consolidates .anchors (course). Active link: aria-current="true".
   ========================================================================== */
.gh-anchor-nav{--gh-anchor-nav-top:calc(var(--gh-layout-header-height) + var(--gh-ref-space-200));
  position:sticky;top:var(--gh-anchor-nav-top);z-index:calc(var(--gh-ref-z-sticky) - 1);
  display:flex;gap:2px;padding:var(--gh-ref-space-150);border-radius:var(--gh-radius-pill);
  background:var(--gh-color-bg-header);-webkit-backdrop-filter:blur(14px);backdrop-filter:blur(14px);border:1px solid var(--gh-color-border-subtle);
  overflow-x:auto;scrollbar-width:none;overscroll-behavior-x:contain;min-width:0}
.gh-anchor-nav::-webkit-scrollbar{display:none}
.gh-anchor-nav__link{flex:none;display:inline-flex;align-items:center;gap:var(--gh-ref-space-150);height:36px;padding-inline:var(--gh-ref-space-400);border-radius:var(--gh-radius-pill);
  font-size:var(--gh-type-label-size);font-weight:var(--gh-ref-font-weight-medium);color:var(--gh-color-text-secondary);white-space:nowrap;
  transition:background-color var(--gh-motion-duration-fast) var(--gh-motion-ease),color var(--gh-motion-duration-fast) var(--gh-motion-ease)}
.gh-anchor-nav__link:hover{color:var(--gh-color-text-primary);background:var(--gh-color-surface-2)}
.gh-anchor-nav__link[aria-current="true"]{background:var(--gh-color-surface-inverse);color:var(--gh-color-text-inverse)}
.gh-anchor-nav__link:focus-visible{border-radius:var(--gh-radius-pill);outline-offset:-2px}
/* sections reached from the nav clear the header + nav */
/* html already has scroll-padding-top = header + 20px; the margin only adds room for the sticky anchor bar itself */
.gh-anchor-target{scroll-margin-top:var(--gh-ref-space-1600)}

/* ---- v0.3 (gap B3): --vertical = table-of-contents rail for long reads (article) ----
   Wide screens (>1100px): a sticky column of links beside the text, active link = lime inline-start rule + surface.
   The scroll-spy line moves to ~30% of the viewport (reading position) instead of «nav bottom + 24px»; the rail scrolls
   on its own when it is taller than the viewport (nav.scrollBy, never scrollIntoView).
   ≤1100px the same markup becomes the standard horizontal sticky bar (a rail does not fit next to the text). */
.gh-anchor-nav__label{display:none}
@media (min-width:1101px){
  .gh-anchor-nav--vertical{--gh-anchor-nav-top:calc(var(--gh-layout-header-height) + var(--gh-ref-space-600));
    flex-direction:column;align-items:stretch;gap:var(--gh-ref-space-50);padding:0;border:0;border-radius:0;background:none;-webkit-backdrop-filter:none;backdrop-filter:none;
    overflow-x:visible;overflow-y:auto;overscroll-behavior-y:contain;max-block-size:calc(100dvh - var(--gh-anchor-nav-top) - var(--gh-ref-space-600))}
  .gh-anchor-nav--vertical .gh-anchor-nav__label{display:block;flex:none;padding-inline:var(--gh-ref-space-300);margin-block-end:var(--gh-ref-space-200);font-size:var(--gh-type-caption-size);color:var(--gh-color-text-tertiary)}
  .gh-anchor-nav--vertical .gh-anchor-nav__link{height:auto;min-block-size:2.5rem;padding:var(--gh-ref-space-200) var(--gh-ref-space-300);white-space:normal;line-height:var(--gh-ref-font-line-height-normal);
    border-radius:var(--gh-radius-control);border-inline-start:2px solid var(--gh-color-border-subtle)}
  .gh-anchor-nav--vertical .gh-anchor-nav__link[aria-current="true"]{background:var(--gh-color-surface-2);color:var(--gh-color-text-primary);border-inline-start-color:var(--gh-color-accent-ink)}
  .gh-anchor-nav--vertical .gh-anchor-nav__link:focus-visible{border-radius:var(--gh-radius-control)}
}


/* ===== components/app-shell.css ===== */
/* ==========================================================================
   App shell — sidebar navigation + main column with a sticky topbar; mobile tabbar.
   Consolidates .app-shell/.side/.it/.cnt/.grp/.me/.main/.topbar/.tabbar (dashboard, assignment,
   instructor, review, settings) and the role switch (instructor, review → gh-menu in the sidebar).
   ≤1100px: sidebar becomes an off-canvas drawer (data-gh-sidebar-toggle), tabbar appears.
   ========================================================================== */
.gh-app-shell{--gh-app-shell-height:100dvh;display:grid;grid-template-columns:var(--gh-layout-sidebar-width) minmax(0,1fr);min-height:var(--gh-app-shell-height)}

/* ---------- sidebar ---------- */
.gh-sidebar{position:sticky;top:0;height:var(--gh-app-shell-height);overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:var(--gh-color-surface-4) transparent;
  display:flex;flex-direction:column;gap:var(--gh-ref-space-100);padding:var(--gh-ref-space-500) var(--gh-ref-space-300);
  background:var(--gh-color-bg-canvas);border-inline-end:1px solid var(--gh-color-border-subtle)}
.gh-sidebar__brand{padding:var(--gh-ref-space-100) var(--gh-ref-space-200) var(--gh-ref-space-400)}
.gh-sidebar__group{padding:var(--gh-ref-space-500) var(--gh-ref-space-300) var(--gh-ref-space-150);font-size:var(--gh-type-caption-size);color:var(--gh-color-text-tertiary)}
.gh-sidebar__list{display:grid;gap:2px}
.gh-sidebar .gh-sidebar__close{display:none}  /* beats .gh-icon-btn (bundled later) */
.gh-sidebar__scrim{display:none}

.gh-nav-item{display:flex;align-items:center;gap:var(--gh-ref-space-300);min-height:40px;padding:var(--gh-ref-space-200) var(--gh-ref-space-300);border-radius:var(--gh-radius-inner);
  font-size:var(--gh-type-label-size);font-weight:var(--gh-ref-font-weight-medium);color:var(--gh-color-text-secondary);min-width:0;
  transition:background-color var(--gh-motion-duration-fast) var(--gh-motion-ease),color var(--gh-motion-duration-fast) var(--gh-motion-ease)}
.gh-nav-item:hover{background:var(--gh-color-surface-1);color:var(--gh-color-text-primary)}
.gh-nav-item[aria-current="page"]{background:var(--gh-color-surface-2);color:var(--gh-color-text-primary)}
.gh-nav-item[aria-current="page"]>.gh-icon{color:var(--gh-color-accent-ink)}
.gh-nav-item:focus-visible{border-radius:var(--gh-radius-inner)}
.gh-nav-item__label{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
/* course / saved item thumbnail instead of an icon */
.gh-nav-item__thumb{width:22px;height:22px;border-radius:6px;overflow:hidden;flex:none;background:var(--gh-color-surface-media)}
.gh-nav-item__thumb>*{width:100%;height:100%;object-fit:cover}
.gh-nav-item>.gh-badge{margin-inline-start:auto;flex:none}  /* counts use gh-badge (tag.css) */

/* «me» card pinned to the bottom of the sidebar */
.gh-me-card{margin-top:auto;display:flex;align-items:center;gap:var(--gh-ref-space-250);padding:var(--gh-ref-space-300);border-radius:var(--gh-radius-inner);
  background:var(--gh-color-surface-1);border:1px solid var(--gh-color-border-subtle);font-size:var(--gh-type-label-size);line-height:var(--gh-type-label-line-height);min-width:0}
.gh-me-card__text{flex:1;min-width:0}
.gh-me-card__name{display:block;font-weight:var(--gh-ref-font-weight-semibold);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.gh-me-card__meta{display:block;margin-top:2px;font-size:var(--gh-type-caption-size);color:var(--gh-color-text-tertiary)}
a.gh-me-card:hover,button.gh-me-card:hover{border-color:var(--gh-color-border-strong)}
button.gh-me-card{width:100%;text-align:start}
.gh-me-card__chev{flex:none;color:var(--gh-color-text-tertiary);transition:transform var(--gh-motion-duration-base) var(--gh-motion-ease)}
.gh-me-card[aria-expanded="true"] .gh-me-card__chev{transform:rotate(180deg)}

/* sidebar slots (v0.2, gap B6): a menu-button me-card needs a positioned wrapper (gh-popover-anchor) for its menu.
   __foot = pinned to the bottom (account menu); __head = under the brand (role switch). The slot owns the spacing,
   so the card inside drops its own margin-top:auto. */
.gh-sidebar__head,.gh-sidebar__foot{display:flex;flex-direction:column;gap:var(--gh-ref-space-150);min-width:0;flex:none}
.gh-sidebar__head{margin-block-end:var(--gh-ref-space-200)}
.gh-sidebar__foot{margin-block-start:auto;padding-block-start:var(--gh-ref-space-300)}
.gh-sidebar__head>.gh-popover-anchor,.gh-sidebar__foot>.gh-popover-anchor{display:flex}
.gh-sidebar__head .gh-me-card,.gh-sidebar__foot .gh-me-card{margin:0}

/* ---------- main column + topbar ---------- */
.gh-app-main{--gh-app-gutter:var(--gh-ref-space-700);min-width:0;padding:0 var(--gh-app-gutter) var(--gh-ref-space-1800)}
.gh-topbar{position:sticky;top:0;z-index:var(--gh-ref-z-sticky);display:flex;align-items:center;gap:var(--gh-ref-space-250);height:var(--gh-layout-header-height);
  margin-inline:calc(var(--gh-app-gutter) * -1);padding-inline:var(--gh-app-gutter);
  background:var(--gh-color-bg-header);-webkit-backdrop-filter:blur(14px);backdrop-filter:blur(14px);border-block-end:1px solid var(--gh-color-border-subtle)}
.gh-topbar .gh-topbar__menu{display:none}
.gh-topbar__title{font-weight:var(--gh-ref-font-weight-bold);min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.gh-topbar__end{margin-inline-start:auto;display:flex;align-items:center;gap:var(--gh-ref-space-150);min-width:0}

/* ---------- mobile tabbar ---------- */
.gh-tabbar{display:none}

@media (max-width:1100px){
  .gh-app-shell{grid-template-columns:minmax(0,1fr)}
  .gh-sidebar{position:fixed;inset-block:0;inset-inline-start:0;z-index:var(--gh-ref-z-overlay);width:min(300px,86vw);height:auto;
    visibility:hidden;transform:translateX(-100%);background:var(--gh-color-surface-1);
    transition:transform var(--gh-motion-duration-slow) var(--gh-motion-ease),visibility 0s linear var(--gh-motion-duration-slow)}
  [dir="rtl"] .gh-sidebar{transform:translateX(100%)}
  .gh-sidebar.is-open{visibility:visible;transform:none;box-shadow:var(--gh-shadow-overlay-lg);transition:transform var(--gh-motion-duration-slow) var(--gh-motion-ease)}
  .gh-sidebar .gh-sidebar__close{display:inline-grid;position:absolute;top:var(--gh-ref-space-400);inset-inline-end:var(--gh-ref-space-300)}
  .gh-sidebar__scrim{display:block;position:fixed;inset:0;z-index:calc(var(--gh-ref-z-overlay) - 1);background:var(--gh-color-bg-scrim)}
  .gh-topbar .gh-topbar__menu{display:inline-grid}
  .gh-app-main{padding-bottom:calc(var(--gh-layout-tabbar-height) + var(--gh-ref-space-1200))}

  .gh-tabbar{position:fixed;inset-inline:0;bottom:0;z-index:var(--gh-ref-z-fixed);display:flex;justify-content:space-around;
    padding:var(--gh-ref-space-150) var(--gh-ref-space-150) calc(var(--gh-ref-space-150) + env(safe-area-inset-bottom));
    background:var(--gh-color-bg-header);-webkit-backdrop-filter:blur(14px);backdrop-filter:blur(14px);border-block-start:1px solid var(--gh-color-border-subtle)}
}
.gh-tabbar__item{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;min-width:56px;min-height:48px;padding:var(--gh-ref-space-100) var(--gh-ref-space-200);
  border-radius:var(--gh-radius-inner);font-size:.6875rem;font-weight:var(--gh-ref-font-weight-medium);color:var(--gh-color-text-tertiary);white-space:nowrap}
.gh-tabbar__item:hover{color:var(--gh-color-text-primary)}
.gh-tabbar__item[aria-current="page"]{color:var(--gh-color-accent-ink)}
.gh-tabbar__count{position:absolute;top:0;inset-inline-end:var(--gh-ref-space-150);display:grid;place-items:center;min-width:16px;height:16px;padding-inline:3px;border-radius:var(--gh-radius-pill);
  background:var(--gh-color-accent-default);color:var(--gh-color-accent-on);font-size:.625rem;font-weight:var(--gh-ref-font-weight-extrabold);line-height:1}
@media (max-width:860px){
  .gh-app-main{--gh-app-gutter:var(--gh-ref-space-400)}
  .gh-topbar{height:60px}
}


/* ===== components/artwork-card.css ===== */
/* ==========================================================================
   gh-artwork — artwork card + gh-masonry gallery (Group C)
   Consolidates: profile .masonry + .pw/.pw-btn/.pw-badges/figcaption (+ .priv), home .gal .work (+ r2–r4 spans),
   dashboard .port .grid, course .gal, assignment .sugg .art.
   The artwork is a button (opens the project); caption shows on hover/focus, always on touch.
   Aspect via --gh-ar (e.g. 4/5). Private = .is-private (dimmed + dashed outline + lock badge with words).
   ========================================================================== */
.gh-masonry{columns:var(--gh-masonry-cols,4) var(--gh-masonry-min,9rem);column-gap:var(--gh-layout-gap)}
.gh-masonry>.gh-artwork{break-inside:avoid;margin-block-end:var(--gh-layout-gap)}
.gh-artwork{position:relative;display:block;margin:0;border-radius:var(--gh-radius-inner);overflow:hidden;background:var(--gh-color-surface-media)}
.gh-artwork__open{display:block;inline-size:100%;aspect-ratio:var(--gh-ar,1);padding:0;border-radius:inherit}
.gh-artwork__open>svg,.gh-artwork__open>img{inline-size:100%;block-size:100%;object-fit:cover;transition:transform var(--gh-ref-duration-slower) var(--gh-motion-ease)}
.gh-artwork__open:focus-visible{outline-offset:-3px;border-radius:var(--gh-radius-inner)}
.gh-artwork:hover .gh-artwork__open>svg,.gh-artwork:hover .gh-artwork__open>img{transform:scale(1.03)}
.gh-artwork__badges{position:absolute;top:var(--gh-ref-space-250);inset-inline-start:var(--gh-ref-space-250);display:flex;gap:var(--gh-ref-space-150);flex-wrap:wrap;pointer-events:none}
.gh-artwork__badge{display:inline-flex;align-items:center;gap:var(--gh-ref-space-100);block-size:1.5rem;padding-inline:var(--gh-ref-space-200);border-radius:var(--gh-radius-pill);
  background:var(--gh-color-bg-header);color:var(--gh-color-text-primary);font-size:var(--gh-type-caption-size);font-weight:var(--gh-ref-font-weight-semibold);-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px)}
.gh-artwork__badge .gh-icon{inline-size:.85rem;block-size:.85rem}
.gh-artwork__badge--accent{background:var(--gh-color-accent-default);color:var(--gh-color-accent-on)}
.gh-artwork__caption{position:absolute;inset-inline:var(--gh-ref-space-200);bottom:var(--gh-ref-space-200);display:flex;align-items:center;gap:var(--gh-ref-space-250);
  padding:var(--gh-ref-space-200) var(--gh-ref-space-300);border-radius:var(--gh-ref-radius-md);background:var(--gh-color-bg-header);-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);
  font-size:var(--gh-type-label-sm-size);line-height:1.5;color:var(--gh-color-text-primary);pointer-events:none;
  opacity:0;transform:translateY(6px);transition:opacity var(--gh-motion-duration-base),transform var(--gh-motion-duration-base)}
.gh-artwork:hover .gh-artwork__caption,.gh-artwork:focus-within .gh-artwork__caption,.gh-artwork--caption .gh-artwork__caption{opacity:1;transform:none}
@media (hover:none){.gh-artwork__caption{opacity:1;transform:none}}
.gh-artwork__title{flex:1;min-width:0}
.gh-artwork__title b{display:block;font-weight:var(--gh-ref-font-weight-semibold);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.gh-artwork__title small{display:block;font-size:var(--gh-type-caption-size);color:var(--gh-color-text-secondary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.gh-artwork__kudos{display:inline-flex;align-items:center;gap:var(--gh-ref-space-100);font-size:var(--gh-type-caption-size);color:var(--gh-color-text-secondary);flex:none}
.gh-artwork.is-private .gh-artwork__open{opacity:.5}
.gh-artwork.is-private{outline:1px dashed var(--gh-color-border-strong);outline-offset:-1px}
/* grid spans for bento galleries (home): rows of --gh-artwork-row height */
.gh-artwork-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,10rem),1fr));grid-auto-rows:var(--gh-artwork-row,8.25rem);gap:var(--gh-layout-gap)}
.gh-artwork-grid>.gh-artwork .gh-artwork__open{aspect-ratio:auto;block-size:100%}
.gh-artwork--r2{grid-row:span 2}.gh-artwork--r3{grid-row:span 3}


/* ===== components/avatar.css ===== */
/* ==========================================================================
   Avatar — image or initials; sizes xs/sm/md(default 28)/lg/xl; group with overlap + «+n».
   Consolidates .av (12 pages, sized with inline styles), .avs (home, course, dashboard), .av-xl + .av-edit (profile).
   Colour: neutral by default; --accent is «you» (the signed-in learner). Custom: style="--gh-avatar-bg:…".
   Pixel avatar (--pix + --tone-1…8): the fallback for a person without a photo — a mirrored 5×5 pixel mark (inline SVG,
   fill currentColor) generated from the user id by the theme (inc/avatar.php) and the app (utils/pixelAvatar.ts); colours
   are the --gh-color-avatar-tone-* tokens. An uploaded photo always wins.
   ========================================================================== */
.gh-avatar{--gh-avatar-size:28px;--gh-avatar-bg:var(--gh-color-surface-4);--gh-avatar-fg:var(--gh-color-text-primary);
  position:relative;display:inline-grid;place-items:center;flex:none;width:var(--gh-avatar-size);height:var(--gh-avatar-size);border-radius:50%;
  background:var(--gh-avatar-bg);color:var(--gh-avatar-fg);font-size:.72rem;font-weight:var(--gh-ref-font-weight-extrabold);line-height:1;user-select:none}
.gh-avatar>img,.gh-avatar>svg{width:100%;height:100%;border-radius:inherit;object-fit:cover}
.gh-avatar--xs{--gh-avatar-size:22px;font-size:.625rem}
.gh-avatar--sm{--gh-avatar-size:32px;font-size:.78rem}
.gh-avatar--md{--gh-avatar-size:36px;font-size:.86rem}
.gh-avatar--lg{--gh-avatar-size:48px;font-size:1.1rem}
.gh-avatar--xl{--gh-avatar-size:120px;font-size:3.1rem;border:6px solid var(--gh-color-surface-1)}
.gh-avatar--accent{--gh-avatar-bg:var(--gh-color-accent-default);--gh-avatar-fg:var(--gh-color-accent-on)}
.gh-avatar--ai{--gh-avatar-bg:var(--gh-color-ai-soft);--gh-avatar-fg:var(--gh-color-ai-default)}
.gh-avatar--pix{--gh-avatar-bg:var(--gh-color-avatar-tone-1-bg);--gh-avatar-fg:var(--gh-color-avatar-tone-1-fg);overflow:hidden}
.gh-avatar--pix>svg{display:block}
.gh-avatar--tone-2{--gh-avatar-bg:var(--gh-color-avatar-tone-2-bg);--gh-avatar-fg:var(--gh-color-avatar-tone-2-fg)}
.gh-avatar--tone-3{--gh-avatar-bg:var(--gh-color-avatar-tone-3-bg);--gh-avatar-fg:var(--gh-color-avatar-tone-3-fg)}
.gh-avatar--tone-4{--gh-avatar-bg:var(--gh-color-avatar-tone-4-bg);--gh-avatar-fg:var(--gh-color-avatar-tone-4-fg)}
.gh-avatar--tone-5{--gh-avatar-bg:var(--gh-color-avatar-tone-5-bg);--gh-avatar-fg:var(--gh-color-avatar-tone-5-fg)}
.gh-avatar--tone-6{--gh-avatar-bg:var(--gh-color-avatar-tone-6-bg);--gh-avatar-fg:var(--gh-color-avatar-tone-6-fg)}
.gh-avatar--tone-7{--gh-avatar-bg:var(--gh-color-avatar-tone-7-bg);--gh-avatar-fg:var(--gh-color-avatar-tone-7-fg)}
.gh-avatar--tone-8{--gh-avatar-bg:var(--gh-color-avatar-tone-8-bg);--gh-avatar-fg:var(--gh-color-avatar-tone-8-fg)}
.gh-avatar--square{border-radius:var(--gh-radius-control)}
/* presence / status dot */
.gh-avatar__status{position:absolute;bottom:0;inset-inline-end:0;width:28%;height:28%;min-width:8px;min-height:8px;border-radius:50%;background:var(--gh-color-status-success);border:2px solid var(--gh-color-surface-1)}
/* owner edit button on the xl avatar */
.gh-avatar__edit{position:absolute;bottom:2px;inset-inline-start:2px;display:grid;place-items:center;width:34px;height:34px;border-radius:50%;
  background:var(--gh-color-surface-3);color:var(--gh-color-text-primary);border:3px solid var(--gh-color-surface-1)}
.gh-avatar__edit:hover{background:var(--gh-color-surface-4)}
.gh-avatar__edit:focus-visible{border-radius:50%}

.gh-avatar-group{display:inline-flex;align-items:center;--gh-avatar-ring:var(--gh-color-surface-1)}
.gh-avatar-group>.gh-avatar{box-shadow:0 0 0 2px var(--gh-avatar-ring);margin-inline-start:-8px}
.gh-avatar-group>.gh-avatar:first-child{margin-inline-start:0}
.gh-avatar-group__more{--gh-avatar-bg:var(--gh-color-surface-3);--gh-avatar-fg:var(--gh-color-text-secondary);font-weight:var(--gh-ref-font-weight-bold)}
.gh-avatar-group__label{margin-inline-start:var(--gh-ref-space-200);font-size:var(--gh-type-label-sm-size);color:var(--gh-color-text-tertiary)}


/* ===== components/breadcrumb.css ===== */
/* ==========================================================================
   Breadcrumb — path to the current page; last item aria-current="page".
   Consolidates .crumbs (assignment, checkout, course, courses). Chevron is drawn in CSS and follows dir.
   ========================================================================== */
.gh-breadcrumb{padding-block:var(--gh-ref-space-500) var(--gh-ref-space-300);font-size:var(--gh-type-label-sm-size);line-height:var(--gh-type-label-sm-line-height);color:var(--gh-color-text-tertiary)}
.gh-breadcrumb__list{display:flex;align-items:center;flex-wrap:wrap;gap:var(--gh-ref-space-100)}
.gh-breadcrumb__item{display:inline-flex;align-items:center;gap:var(--gh-ref-space-100);min-width:0}
.gh-breadcrumb__item+.gh-breadcrumb__item::before{content:"";flex:none;width:.4em;height:.4em;margin-inline:.3em;border-block-start:1.5px solid currentColor;border-inline-end:1.5px solid currentColor;transform:rotate(45deg);opacity:.7}
[dir="rtl"] .gh-breadcrumb__item+.gh-breadcrumb__item::before{transform:rotate(-45deg)}
.gh-breadcrumb__link{display:inline-flex;align-items:center;gap:var(--gh-ref-space-150);padding:2px var(--gh-ref-space-150);border-radius:6px;color:var(--gh-color-text-secondary)}
.gh-breadcrumb__link:hover{color:var(--gh-color-text-primary);background:var(--gh-color-surface-2)}
.gh-breadcrumb__link .gh-icon{width:14px;height:14px}
.gh-breadcrumb__item[aria-current="page"],.gh-breadcrumb__current{padding-inline:var(--gh-ref-space-150);color:var(--gh-color-text-primary);font-weight:var(--gh-ref-font-weight-medium);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@media (max-width:560px){
  /* long trails keep the first and the last two items */
  .gh-breadcrumb__item:not(:first-child):not(:nth-last-child(-n+2)){display:none}
}


/* ===== components/bulkbar.css ===== */
/* ==========================================================================
   Bulk bar — selection toolbar for tables / lists (v0.3, gap B1). data-gh-bulkbar.
   Takes the place of the filter row while something is selected (same height → no layout jump):
   count (+ optional note), bulk actions, «clear selection» at the end. Announced through a status region (JS).
   Consolidates .sd-bulk (students). Hidden = [hidden]; the replaced row gets [hidden] from JS.
   On phones it sticks under the site header so the actions stay reachable while scrolling a long list.
   ========================================================================== */
.gh-bulkbar{display:flex;flex-wrap:wrap;align-items:center;gap:var(--gh-ref-space-200);min-block-size:2.25rem;
  padding:var(--gh-ref-space-150) var(--gh-ref-space-200);border-radius:var(--gh-radius-inner);background:var(--gh-color-surface-3);border:1px solid transparent}
.gh-bulkbar[hidden]{display:none}
.gh-bulkbar__count{display:block;padding-inline-end:var(--gh-ref-space-200);font-size:var(--gh-type-label-sm-size);line-height:var(--gh-ref-font-line-height-snug);color:var(--gh-color-text-secondary)}
.gh-bulkbar__count b{color:var(--gh-color-text-primary);font-weight:var(--gh-ref-font-weight-bold)}
.gh-bulkbar__note{display:block;font-size:var(--gh-type-caption-size);color:var(--gh-color-text-tertiary)}
.gh-bulkbar__note:empty{display:none}
.gh-bulkbar__actions{display:flex;flex-wrap:wrap;align-items:center;gap:var(--gh-ref-space-200)}
.gh-bulkbar__clear{margin-inline-start:auto}

@media (max-width:860px){
  .gh-bulkbar{position:sticky;top:var(--gh-layout-header-height);z-index:calc(var(--gh-ref-z-sticky) - 1);border-color:var(--gh-color-border-default)}
  .gh-bulkbar__clear .gh-kbd{display:none}
}


/* ===== components/button.css ===== */
/* ==========================================================================
   @component button — gh-btn
   Consolidates: base .btn (.p/.s/.g/.sm/.lg/.block), auth/profile/settings .btn.d(.solid),
   composer .btn.sm overrides, evr .btn[aria-pressed]. One API, states by attributes.
   Variants: --primary (ONE per view) · --secondary · --ghost · --danger (soft) · --danger-solid (final confirm)
   Sizes: --sm (34) · md (44, default) · --lg (52). Shape: --icon (square / circle), --block (full width).
   States: :disabled / [aria-disabled="true"], [aria-busy="true"] (spinner, label kept for AT), [aria-pressed="true"].
   ========================================================================== */
.gh-btn{
  --_bg:transparent; --_fg:var(--gh-color-text-primary); --_bd:transparent;
  --_bg-hover:var(--gh-color-surface-3); --_h:var(--gh-button-height-md); --_px:var(--gh-ref-space-500);
  position:relative;display:inline-flex;align-items:center;justify-content:center;gap:var(--gh-ref-space-200);
  min-block-size:var(--_h);padding-inline:var(--_px);padding-block:0;border-radius:var(--gh-button-radius);
  background:var(--_bg);color:var(--_fg);border:1px solid var(--_bd);
  font-family:inherit;font-size:var(--gh-ref-font-size-300);font-weight:var(--gh-ref-font-weight-semibold);line-height:1.2;
  white-space:nowrap;text-decoration:none;cursor:pointer;user-select:none;-webkit-tap-highlight-color:transparent;
  transition:background-color var(--gh-motion-duration-base) var(--gh-motion-ease),border-color var(--gh-motion-duration-base) var(--gh-motion-ease),color var(--gh-motion-duration-base) var(--gh-motion-ease),transform var(--gh-motion-duration-fast) var(--gh-motion-ease)}
.gh-btn:hover{background:var(--_bg-hover)}
.gh-btn:active{transform:translateY(1px)}
.gh-btn:focus-visible{border-radius:var(--gh-button-radius)}
.gh-btn .gh-icon{margin-inline:-2px}

/* variants */
.gh-btn--primary{--_bg:var(--gh-color-accent-default);--_fg:var(--gh-color-accent-on);--_bg-hover:var(--gh-color-accent-hover)}
.gh-btn--secondary{--_bg:var(--gh-color-surface-2);--_bd:var(--gh-color-border-default);--_bg-hover:var(--gh-color-surface-3)}
.gh-btn--ghost{--_fg:var(--gh-color-text-secondary);--_bg-hover:var(--gh-color-surface-2)}
.gh-btn--ghost:hover{color:var(--gh-color-text-primary)}
.gh-btn--danger{--_bg:var(--gh-color-status-danger-soft);--_fg:var(--gh-color-status-danger);--_bd:var(--gh-color-status-danger-border);
  --_bg-hover:color-mix(in srgb,var(--gh-color-status-danger) 18%,transparent)}
.gh-btn--danger-solid{--_bg:var(--gh-color-status-danger);--_fg:var(--gh-color-status-on-solid);--_bd:var(--gh-color-status-danger);
  --_bg-hover:var(--gh-color-status-danger-hover)}
/* pressed toggle (e.g. «مفید بود», «ذخیره») */
.gh-btn[aria-pressed="true"]{--_bg:var(--gh-color-accent-soft);--_fg:var(--gh-color-accent-ink);--_bd:var(--gh-color-accent-border);--_bg-hover:var(--gh-color-accent-soft)}

/* sizes */
.gh-btn--sm{--_h:var(--gh-button-height-sm);--_px:var(--gh-ref-space-400);font-size:var(--gh-ref-font-size-100);font-weight:var(--gh-ref-font-weight-medium);gap:var(--gh-ref-space-150)}
.gh-btn--lg{--_h:var(--gh-button-height-lg);--_px:var(--gh-ref-space-700);font-size:var(--gh-ref-font-size-400)}

/* shape */
.gh-btn--block{display:flex;inline-size:100%}
.gh-btn--icon{--_px:0;inline-size:var(--_h);flex:none}
.gh-btn--icon .gh-icon{margin-inline:0}

/* states */
.gh-btn:disabled,.gh-btn[aria-disabled="true"]{
  --_bg:var(--gh-color-surface-2);--_fg:var(--gh-color-text-disabled);--_bd:var(--gh-color-border-subtle);--_bg-hover:var(--gh-color-surface-2);
  cursor:not-allowed;transform:none}
.gh-btn--ghost:disabled,.gh-btn--ghost[aria-disabled="true"]{--_bg:transparent;--_bd:transparent;--_bg-hover:transparent}
/* loading: label stays in the DOM (screen readers), visually replaced by a spinner in the variant's ink colour */
.gh-btn[aria-busy="true"]{color:transparent;pointer-events:none;cursor:progress}
.gh-btn[aria-busy="true"]>*{visibility:hidden}
.gh-btn[aria-busy="true"]::after{content:"";position:absolute;inset:0;margin:auto;inline-size:1.1em;block-size:1.1em;border-radius:50%;
  border:2px solid var(--_fg);border-block-start-color:transparent;animation:gh-btn-spin .7s linear infinite}
@keyframes gh-btn-spin{to{transform:rotate(1turn)}}

/* touch: small buttons keep their look but get a 44px hit area */
@media (pointer:coarse){
  .gh-btn--sm::before{content:"";position:absolute;inset:min(0px,calc((100% - var(--gh-ref-size-touch-min)) / 2))}
}

/* group of buttons (actions row) */
.gh-btn-row{display:flex;flex-wrap:wrap;align-items:center;gap:var(--gh-ref-space-200)}
.gh-btn-row--end{justify-content:flex-end}
@media (max-width:560px){.gh-btn-row--stack{flex-direction:column-reverse;align-items:stretch}.gh-btn-row--stack>.gh-btn{inline-size:100%}}


/* ===== components/callout.css ===== */
/* ==========================================================================
   Callout / banner — inline message with icon. Tones: neutral, info, success, warning, danger, ai, accent.
   Consolidates .callout (checkout, course, courses), .banner (instructor, review), quiz .fbk frame,
   .today / trust notes. Status = colour + icon + words (never colour alone).
   Banner = page/tile-level variant (title + actions + dismiss).
   ========================================================================== */
.gh-callout{--gh-callout-tone:var(--gh-color-text-secondary);
  display:flex;align-items:flex-start;gap:var(--gh-ref-space-250);padding:var(--gh-ref-space-300) var(--gh-ref-space-400);
  border-radius:var(--gh-radius-inner);background:var(--gh-color-surface-2);border:1px solid var(--gh-color-border-subtle);
  font-size:var(--gh-type-body-sm-size);line-height:var(--gh-type-body-sm-line-height);color:var(--gh-color-text-secondary)}
.gh-callout>.gh-icon{margin-top:3px;color:var(--gh-callout-tone)}
.gh-callout b,.gh-callout strong{color:var(--gh-color-text-primary);font-weight:var(--gh-ref-font-weight-semibold)}
.gh-callout__body{flex:1;min-width:0}
.gh-callout__title{display:block;color:var(--gh-color-text-primary);font-weight:var(--gh-ref-font-weight-bold)}
.gh-callout__actions{display:flex;flex-wrap:wrap;gap:var(--gh-ref-space-200);margin-top:var(--gh-ref-space-200)}
.gh-callout__link{color:var(--gh-color-text-primary);font-weight:var(--gh-ref-font-weight-semibold);text-decoration:underline;text-underline-offset:3px;text-decoration-color:var(--gh-color-border-strong)}
.gh-callout__close{display:grid;place-items:center;width:32px;height:32px;margin:-6px;margin-inline-start:auto;flex:none;border-radius:50%;color:var(--gh-color-text-tertiary)}
.gh-callout__close:hover{background:var(--gh-color-surface-3);color:var(--gh-color-text-primary)}
.gh-callout__close:focus-visible{border-radius:50%}
/* solid icon badge (quiz feedback, success hero) */
.gh-callout__badge{display:grid;place-items:center;width:36px;height:36px;flex:none;border-radius:11px;background:var(--gh-callout-tone);color:var(--gh-color-accent-on)}

.gh-callout--info{--gh-callout-tone:var(--gh-color-status-info);background:var(--gh-color-status-info-soft);border-color:var(--gh-color-status-info-border)}
.gh-callout--success{--gh-callout-tone:var(--gh-color-status-success);background:var(--gh-color-status-success-soft);border-color:var(--gh-color-status-success-border)}
.gh-callout--warning{--gh-callout-tone:var(--gh-color-status-warning);background:var(--gh-color-status-warning-soft);border-color:var(--gh-color-status-warning-border)}
.gh-callout--danger{--gh-callout-tone:var(--gh-color-status-danger);background:var(--gh-color-status-danger-soft);border-color:var(--gh-color-status-danger-border)}
.gh-callout--ai{--gh-callout-tone:var(--gh-color-ai-default);background:var(--gh-color-ai-soft);border-color:var(--gh-color-ai-border)}
.gh-callout--accent{--gh-callout-tone:var(--gh-color-accent-ink);background:var(--gh-color-accent-soft);border-color:var(--gh-color-accent-border)}
/* page / tile-level banner */
.gh-callout--banner{align-items:center;gap:var(--gh-ref-space-300);padding:var(--gh-ref-space-300) var(--gh-ref-space-400) var(--gh-ref-space-300) var(--gh-ref-space-500);color:var(--gh-color-text-primary)}
.gh-callout--banner>.gh-icon{margin-top:0}
.gh-callout--banner .gh-callout__body{display:flex;align-items:center;flex-wrap:wrap;gap:var(--gh-ref-space-100) var(--gh-ref-space-300)}
.gh-callout--banner .gh-callout__actions{margin-top:0;margin-inline-start:auto}
@media (max-width:560px){.gh-callout--banner{align-items:flex-start}.gh-callout--banner .gh-callout__actions{margin-inline-start:0}}


/* ===== components/certificate-card.css ===== */
/* ==========================================================================
   gh-certificate — certificate card + public verification (Group C)
   Consolidates: profile .cert-card/.cc-art/.cc-grade/.cc-code/.cc-acts/.cc-res (+ .prog in-progress),
   dashboard .cert .c-card/.seal/.link, home .verify input/.res.
   Verification code is Latin (isolated LTR, Latin digits). Result: .gh-certificate__result--ok / --fail (icon + words).
   ========================================================================== */
.gh-certificate{display:flex;flex-direction:column;gap:var(--gh-ref-space-200);min-width:0;padding:var(--gh-ref-space-400);border-radius:var(--gh-radius-tile);
  background:var(--gh-color-surface-1);border:1px solid var(--gh-color-border-subtle)}
.gh-certificate__art{position:relative;block-size:7rem;border-radius:var(--gh-ref-radius-md);overflow:hidden;background:var(--gh-color-surface-media);margin-block-end:var(--gh-ref-space-100)}
.gh-certificate__art>svg{inline-size:100%;block-size:100%}
.gh-certificate__art>.gh-tag,.gh-certificate__art>[class*="gh-tag"]{position:absolute;top:var(--gh-ref-space-250);inset-inline-start:var(--gh-ref-space-250)}
.gh-certificate__seal{position:absolute;top:var(--gh-ref-space-250);inset-inline-end:var(--gh-ref-space-250);inline-size:2.5rem;block-size:2.5rem;border-radius:50%;display:grid;place-items:center;
  background:var(--gh-color-bg-header);color:var(--gh-color-accent-ink);border:1.5px dashed var(--gh-color-accent-border)}
.gh-certificate__title{font-size:var(--gh-ref-font-size-500);font-weight:var(--gh-ref-font-weight-extrabold);line-height:1.5}
.gh-certificate__meta{display:flex;align-items:center;flex-wrap:wrap;font-size:var(--gh-type-caption-size);color:var(--gh-color-text-tertiary)}
.gh-certificate__grade{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:var(--gh-ref-space-250);align-items:center;font-size:var(--gh-type-caption-size);color:var(--gh-color-text-tertiary)}
.gh-certificate__grade b{font-size:var(--gh-type-label-size);color:var(--gh-color-text-primary);font-weight:var(--gh-ref-font-weight-semibold)}
.gh-certificate__code{display:flex;align-items:center;gap:var(--gh-ref-space-200);padding:var(--gh-ref-space-100) var(--gh-ref-space-100) var(--gh-ref-space-100) var(--gh-ref-space-300);border-radius:var(--gh-radius-pill);
  border:1px solid var(--gh-color-border-default);font-size:var(--gh-type-caption-size);color:var(--gh-color-text-secondary);min-width:0}
.gh-certificate__code code{flex:1;min-width:0;font-family:var(--gh-font-family-latin);direction:ltr;text-align:start;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.gh-certificate__actions{display:flex;gap:var(--gh-ref-space-150);margin-block-start:auto;padding-block-start:var(--gh-ref-space-200);flex-wrap:wrap}
.gh-certificate__actions>*{flex:1}
.gh-certificate--pending{border-style:dashed;border-color:var(--gh-color-border-default)}
.gh-certificate--pending .gh-certificate__art{filter:grayscale(1);opacity:.55}
/* verification form + result */
.gh-certificate-verify{display:grid;gap:var(--gh-ref-space-250)}
.gh-certificate-verify__row{display:flex;gap:var(--gh-ref-space-200)}
.gh-certificate-verify__input{flex:1;min-width:0;block-size:2.75rem;padding-inline:var(--gh-ref-space-400);border-radius:var(--gh-radius-pill);background:var(--gh-color-surface-2);border:1px solid var(--gh-color-border-default);
  font-family:var(--gh-font-family-latin);direction:ltr;font-size:var(--gh-type-label-size)}
.gh-certificate-verify__input::placeholder{color:var(--gh-color-text-tertiary)}
.gh-certificate-verify__input:focus-visible{border-radius:var(--gh-radius-pill)}
.gh-certificate__result{display:flex;gap:var(--gh-ref-space-200);align-items:flex-start;padding:var(--gh-ref-space-250) var(--gh-ref-space-300);border-radius:var(--gh-ref-radius-md);
  font-size:var(--gh-type-label-sm-size);line-height:1.7;color:var(--gh-color-text-secondary);border:1px solid var(--gh-color-border-subtle);background:var(--gh-color-surface-2)}
.gh-certificate__result .gh-icon{margin-block-start:.2em}
.gh-certificate__result b{color:var(--gh-color-text-primary)}
.gh-certificate__result--ok{background:var(--gh-color-status-success-soft)}
.gh-certificate__result--ok .gh-icon{color:var(--gh-color-status-success)}
.gh-certificate__result--fail{background:var(--gh-color-status-danger-soft)}
.gh-certificate__result--fail .gh-icon{color:var(--gh-color-status-danger)}
/* v0.3 C4 — verify hook states (GH.certificateVerify): loading (spinner, neutral), revoked (danger: icon + word — the
   certificate exists but is void), error (neutral: says nothing about validity, offers retry). The region carries
   data-state="loading|valid|notfound|revoked|error" and aria-busy while loading. */
.gh-certificate__result--loading{align-items:center}
.gh-certificate__result--revoked{background:var(--gh-color-status-danger-soft)}
.gh-certificate__result--revoked .gh-icon{color:var(--gh-color-status-danger)}
.gh-certificate__result--error .gh-icon{color:var(--gh-color-text-tertiary)}
.gh-certificate__result--error .gh-btn{margin-inline-start:var(--gh-ref-space-200);vertical-align:middle}
.gh-certificate__result [data-focus]:focus{outline:none}
.gh-certificate__result [data-focus]:focus-visible{outline:var(--gh-focus-width) solid var(--gh-color-focus-ring);outline-offset:2px}


/* ===== components/chart.css ===== */
/* ==========================================================================
   gh-chart — data-viz frame + marks (Group C)
   Consolidates: dashboard .chart/.legend/.heat/.tl/.spark/.kudos, instructor .fun/.rb/.wk/.days14,
   course .rdist, assignment .rub (result bars), dashboard .skills/.sk, checkout .sbars, settings .inst-chart,
   auth .wk (day bars), profile .fb-nums .pbar.
   Colour rules (SYSTEM_SPEC §4): accent = you / now / the one mark the takeaway names; past & other marks
   are neutral; comparison = neutral tick or dash; violet never; status colours never as a series.
   Time runs right → left (reading direction) — DOM order oldest → newest inside an RTL flow.
   ========================================================================== */

/* chart-local aliases of the data tokens */
.gh-chart,.gh-legend,.gh-bars,.gh-barlist,.gh-heatmap,.gh-sparkline,.gh-schedule,.gh-daystrip,.gh-deadline{
  --gh-chart-you:var(--gh-color-data-you);
  --gh-chart-mark:var(--gh-color-data-mark);
  --gh-chart-track:var(--gh-color-data-track);
  --gh-chart-compare:var(--gh-color-data-compare);
  --gh-chart-goal:var(--gh-color-data-goal);
  --gh-chart-grid:var(--gh-color-data-grid);
  --gh-chart-ring:var(--gh-color-surface-1);
}

/* ---------- frame: title + takeaway + actions, plot, legend, data table ---------- */
.gh-chart{display:flex;flex-direction:column;gap:var(--gh-ref-space-400);min-width:0;margin:0}
.gh-chart__head{display:flex;align-items:flex-start;gap:var(--gh-ref-space-300);flex-wrap:wrap}
.gh-chart__head>div:first-child{flex:1 1 16rem;min-width:0}
.gh-chart__title{font-size:var(--gh-type-heading-4-size);font-weight:var(--gh-type-heading-4-weight);line-height:var(--gh-type-heading-4-line-height)}
.gh-chart__takeaway{font-size:var(--gh-type-body-sm-size);line-height:var(--gh-type-body-sm-line-height);color:var(--gh-color-text-secondary);margin-block-start:var(--gh-ref-space-100)}
.gh-chart__takeaway b{color:var(--gh-color-text-primary);font-weight:var(--gh-ref-font-weight-semibold)}
.gh-chart__actions{display:flex;align-items:center;gap:var(--gh-ref-space-200);flex-wrap:wrap}
.gh-chart__note{font-size:var(--gh-type-caption-size);color:var(--gh-color-text-tertiary)}
.gh-chart__data{font-size:var(--gh-type-caption-size);color:var(--gh-color-text-tertiary)}
.gh-chart__data>summary{cursor:pointer;inline-size:max-content;border-radius:var(--gh-radius-control);padding-block:var(--gh-ref-space-100);
  display:flex;align-items:center;gap:var(--gh-ref-space-150);list-style:none}
.gh-chart__data>summary::-webkit-details-marker{display:none}
/* DS chevron instead of the browser's triangle (which points the wrong way in RTL) */
.gh-chart__data>summary::after{content:"";inline-size:.4em;block-size:.4em;margin-block-start:-.25em;border-inline-end:1.5px solid currentColor;border-block-end:1.5px solid currentColor;
  rotate:45deg;transition:rotate var(--gh-motion-duration-fast) var(--gh-motion-ease)}
.gh-chart__data[open]>summary::after{rotate:225deg;margin-block:.25em 0}
.gh-chart__data>summary:dir(rtl)::after{rotate:-45deg}
.gh-chart__data[open]>summary:dir(rtl)::after{rotate:-225deg}
.gh-chart__data>summary:hover{color:var(--gh-color-text-primary)}
.gh-chart__table{inline-size:100%;margin-block-start:var(--gh-ref-space-200);font-size:var(--gh-type-label-sm-size)}
.gh-chart__table th,.gh-chart__table td{text-align:start;padding:var(--gh-ref-space-150) var(--gh-ref-space-200);border-block-end:1px solid var(--gh-color-border-subtle)}
.gh-chart__table th{color:var(--gh-color-text-tertiary);font-weight:var(--gh-ref-font-weight-medium)}
.gh-chart__table td{color:var(--gh-color-text-secondary)}

/* loading / empty / error — the frame keeps its height so the page does not jump */
.gh-chart__state{display:grid;place-items:center;gap:var(--gh-ref-space-200);min-block-size:var(--gh-chart-min-h,10rem);padding:var(--gh-ref-space-600);text-align:center;
  border:1px dashed var(--gh-color-border-default);border-radius:var(--gh-radius-inner);color:var(--gh-color-text-secondary);font-size:var(--gh-type-body-sm-size)}
.gh-chart__state .gh-icon{color:var(--gh-color-text-tertiary)}
.gh-chart__state b{display:block;color:var(--gh-color-text-primary);font-weight:var(--gh-ref-font-weight-semibold)}
.gh-chart[aria-busy="true"] .gh-chart__plot{position:relative;min-block-size:var(--gh-chart-min-h,10rem)}
.gh-chart[aria-busy="true"] .gh-chart__plot>*{visibility:hidden}
.gh-chart[aria-busy="true"] .gh-chart__plot::after{content:"";position:absolute;inset:0;border-radius:var(--gh-radius-inner);background:var(--gh-color-surface-2);animation:gh-chart-pulse 1.4s var(--gh-motion-ease) infinite}
.gh-chart[aria-busy="true"] .gh-chart__takeaway{color:transparent;background:var(--gh-color-surface-2);border-radius:var(--gh-radius-kbd);inline-size:60%}
@keyframes gh-chart-pulse{50%{opacity:.55}}

/* ---------- legend (always for ≥ 2 encodings; swatch carries identity, text stays in text colour) ---------- */
.gh-legend{display:flex;flex-wrap:wrap;gap:var(--gh-ref-space-200) var(--gh-ref-space-400);font-size:var(--gh-type-caption-size);color:var(--gh-color-text-tertiary)}
.gh-legend>*{display:inline-flex;align-items:center;gap:var(--gh-ref-space-150)}
.gh-legend__key{inline-size:10px;block-size:10px;border-radius:3px;background:var(--gh-chart-mark);flex:none}
.gh-legend__key--you{background:var(--gh-chart-you)}
.gh-legend__key--track{background:var(--gh-chart-track)}
.gh-legend__key--goal{inline-size:16px;block-size:0;border-radius:0;background:none;border-block-start:2px dashed var(--gh-chart-goal)}
.gh-legend__key--compare{inline-size:2px;block-size:12px;border-radius:1px;background:var(--gh-chart-compare)}
.gh-legend__key--future{background:none;border:1px dashed var(--gh-color-border-strong)}
.gh-legend__key--heat-0{background:var(--gh-color-data-heat-0)}.gh-legend__key--heat-1{background:var(--gh-color-data-heat-1)}
.gh-legend__key--heat-2{background:var(--gh-color-data-heat-2)}.gh-legend__key--heat-3{background:var(--gh-color-data-heat-3)}
.gh-legend__key--heat-4{background:var(--gh-color-data-heat-4)}

/* ---------- column chart with goal line (gh-bars) ----------
   <div class="gh-bars" style="--gh-goal:62"> plot (columns are buttons with data-gh-tip) + axis row.
   Each bar: style="--gh-value:0–100" (% of the scale max). Goal label lives in the inline-end gutter. */
.gh-bars{--gh-bars-h:11rem;--gh-bars-gutter:5.5rem;display:grid;gap:var(--gh-ref-space-200);min-width:0}
.gh-bars>*{min-width:0} /* grid items: the plot's min-content (bar widths + gutter) must not push the goal label out of the tile on a phone */
.gh-bars__plot{position:relative;display:flex;align-items:stretch;gap:var(--gh-ref-space-50);block-size:var(--gh-bars-h);
  padding-inline-end:var(--gh-bars-gutter);padding-block-start:var(--gh-ref-space-500);border-block-end:1px solid var(--gh-color-border-default)}
/* one recessive gridline at half the scale */
.gh-bars__plot::before{content:"";position:absolute;inset-inline-start:0;inset-inline-end:var(--gh-bars-gutter);bottom:calc((100% - var(--gh-ref-space-500)) / 2);border-block-start:1px solid var(--gh-chart-grid);pointer-events:none}
.gh-bars__col{flex:1 1 0;min-width:0;position:relative;display:flex;flex-direction:column;justify-content:flex-end;align-items:center;border-radius:var(--gh-radius-control);padding:0}
.gh-bars__col:hover{background:var(--gh-color-surface-2)}
.gh-bars__col:focus-visible{outline-offset:0}
.gh-bars__bar{display:block;inline-size:min(100%,1.5rem);block-size:max(2px,calc(var(--gh-value,0) * 1%));background:var(--gh-chart-mark);
  border-start-start-radius:4px;border-start-end-radius:4px;transition:block-size var(--gh-motion-duration-slow) var(--gh-motion-ease),background-color var(--gh-motion-duration-fast)}
.gh-bars--wide .gh-bars__bar{inline-size:min(100%,2.75rem)}
.gh-bars__col[aria-current] .gh-bars__bar,.gh-bars__col.is-highlight .gh-bars__bar{background:var(--gh-chart-you)}
.gh-bars__col:hover .gh-bars__bar{filter:brightness(1.25)}
.gh-bars__value{position:absolute;inset-inline:0;bottom:calc(var(--gh-value,0) * 1% + var(--gh-ref-space-100));text-align:center;font-size:var(--gh-type-caption-size);font-weight:var(--gh-ref-font-weight-semibold);color:var(--gh-color-text-primary);white-space:nowrap;pointer-events:none}
/* the outermost columns anchor their value to the plot side, so a long value («۱ ساعت و ۱۰ دقیقه») grows inward, not out of the tile */
.gh-bars__col:nth-child(1 of .gh-bars__col) .gh-bars__value{inset-inline-end:auto;text-align:start}
.gh-bars__col:nth-last-child(1 of .gh-bars__col) .gh-bars__value{inset-inline-start:auto;text-align:end}
.gh-bars__value--muted{color:var(--gh-color-text-tertiary);font-weight:var(--gh-ref-font-weight-regular)}
.gh-bars__goal{position:absolute;inset-inline:0;bottom:calc(var(--gh-goal) * (100% - var(--gh-ref-space-500)) / 100);border-block-start:2px dashed var(--gh-chart-goal);pointer-events:none;opacity:.8}
.gh-bars__goal-label{position:absolute;inset-inline-end:0;bottom:var(--gh-ref-space-100);inline-size:calc(var(--gh-bars-gutter) - var(--gh-ref-space-200));
  font-size:var(--gh-type-caption-size);line-height:1.35;color:var(--gh-color-text-secondary);text-align:end}
.gh-bars__goal-label b{display:block;color:var(--gh-color-text-primary);font-weight:var(--gh-ref-font-weight-semibold)}
.gh-bars__axis{display:flex;gap:var(--gh-ref-space-50);padding-inline-end:var(--gh-bars-gutter)}
.gh-bars__axis>span{flex:1 1 0;min-width:0;text-align:center;font-size:var(--gh-type-caption-size);color:var(--gh-color-text-tertiary);white-space:nowrap;overflow:visible}
/* axis labels are short by contract («ش ۲۳», «هفتهٔ ۳»): a label a few px wider than its narrow column spills into the column gap instead of becoming «ش …» */
.gh-bars__axis>[aria-current]{color:var(--gh-color-text-primary);font-weight:var(--gh-ref-font-weight-bold)}
/* per-bar comparison tick (v0.2 C6): previous period, neutral, ringed so it reads over or above the bar */
.gh-bars__tick{position:absolute;z-index:1;inset-inline:0;bottom:calc(var(--gh-compare,0) * 1%);inline-size:min(100%,2rem);block-size:2px;margin-inline:auto;margin-block-end:-1px;border-radius:1px;
  background:var(--gh-chart-compare);box-shadow:0 0 0 2px var(--gh-chart-ring);pointer-events:none}
.gh-bars--wide .gh-bars__tick{inline-size:min(100%,3.25rem)}
.gh-legend__key--compare-h{inline-size:12px;block-size:2px;border-radius:1px;background:var(--gh-chart-compare)}
.gh-bars--compact{--gh-bars-h:5.5rem;--gh-bars-gutter:0px}
.gh-bars--compact .gh-bars__plot{padding-block-start:var(--gh-ref-space-200)}
@media (max-width:560px){.gh-bars{--gh-bars-gutter:4rem}}
/* v0.3 C3 — per-item highlight (items[].highlight → .is-highlight, accent + direct label), neutral hatch pattern
   (items[].pattern:"hatch" → .gh-bars__col--hatch; the ONE highlighted column stays solid accent) and labelled bands above
   the columns (d.bands → .gh-bars__bands; a grid with the same column count and gap as the plot, so bands align exactly). */
.gh-bars__col--hatch:not(.is-highlight):not([aria-current]) .gh-bars__bar{background:repeating-linear-gradient(135deg,var(--gh-chart-mark) 0 3px,var(--gh-chart-ring) 3px 5px)}
.gh-legend__key--hatch{background:repeating-linear-gradient(135deg,var(--gh-chart-mark) 0 2px,var(--gh-chart-ring) 2px 4px)}
.gh-bars__bands{display:grid;grid-template-columns:repeat(var(--gh-bars-n,1),minmax(0,1fr));column-gap:var(--gh-ref-space-50);padding-inline-end:var(--gh-bars-gutter);margin-block-end:calc(var(--gh-ref-space-200) * -1)}
.gh-bars__band{min-width:0;padding-block-start:var(--gh-ref-space-150);margin-inline-end:var(--gh-ref-space-100);border-block-start:1px solid var(--gh-color-border-default);
  font-size:var(--gh-type-caption-size);color:var(--gh-color-text-tertiary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.gh-bars__band:last-child{margin-inline-end:0}
.gh-bars__band-s{display:none}
@media (max-width:860px){.gh-bars__band-l{display:none}.gh-bars__band-s{display:inline}}
@media (forced-colors:active){.gh-bars__col--hatch .gh-bars__bar{background:repeating-linear-gradient(135deg,CanvasText 0 3px,Canvas 3px 5px)}}

/* ---------- bar list: bullet bars, rating distribution, funnel, rubric result (gh-barlist) ----------
   Row = name | track (fill + optional compare tick) | value (+delta). --gh-value / --gh-compare are 0–100. */
.gh-barlist{display:grid;gap:var(--gh-ref-space-300);--gh-barlist-name:6.5rem;--gh-barlist-val:5rem;--gh-barlist-h:10px}
.gh-barlist__row{display:grid;grid-template-columns:var(--gh-barlist-name) minmax(0,1fr) var(--gh-barlist-val);align-items:center;gap:var(--gh-ref-space-100) var(--gh-ref-space-300);
  font-size:var(--gh-type-label-size);color:var(--gh-color-text-secondary);text-align:start;inline-size:100%;position:relative;border-radius:var(--gh-radius-control)}
button.gh-barlist__row,.gh-barlist__row[tabindex]{padding:var(--gh-ref-space-100) var(--gh-ref-space-200);margin-inline:calc(-1 * var(--gh-ref-space-200));inline-size:calc(100% + 2 * var(--gh-ref-space-200))}
button.gh-barlist__row:hover,.gh-barlist__row[tabindex]:hover{background:var(--gh-color-surface-2);color:var(--gh-color-text-primary)}
button.gh-barlist__row[aria-pressed="true"]{background:var(--gh-color-surface-3);color:var(--gh-color-text-primary)}
.gh-barlist__name{min-width:0;line-height:var(--gh-ref-font-line-height-snug)}
.gh-barlist__name small{display:block;font-size:var(--gh-type-caption-size);color:var(--gh-color-text-tertiary)}
.gh-barlist__track{position:relative;block-size:var(--gh-barlist-h);border-radius:calc(var(--gh-barlist-h) / 2);background:var(--gh-chart-track)}
.gh-barlist__fill{position:absolute;inset-block:0;inset-inline-start:0;inline-size:calc(var(--gh-value,0) * 1%);border-radius:inherit;background:var(--gh-chart-mark);transition:inline-size var(--gh-motion-duration-slow) var(--gh-motion-ease)}
.gh-barlist__row.is-highlight .gh-barlist__fill,.gh-barlist__row[aria-pressed="true"] .gh-barlist__fill,.gh-barlist__row[aria-current] .gh-barlist__fill{background:var(--gh-chart-you)}
.gh-barlist__row.is-highlight .gh-barlist__name{color:var(--gh-color-text-primary);font-weight:var(--gh-ref-font-weight-semibold)}
/* comparison (last month, cohort, previous version): neutral tick with a surface ring */
.gh-barlist__tick{position:absolute;inset-block:-4px;inset-inline-start:calc(var(--gh-compare) * 1%);inline-size:2px;margin-inline-start:-1px;border-radius:1px;background:var(--gh-chart-compare);box-shadow:0 0 0 2px var(--gh-chart-ring)}
.gh-barlist__value{display:flex;align-items:baseline;justify-content:flex-end;gap:var(--gh-ref-space-150);white-space:nowrap;color:var(--gh-color-text-tertiary);font-size:var(--gh-type-caption-size)}
.gh-barlist__value b{font-size:var(--gh-type-body-size);font-weight:var(--gh-ref-font-weight-semibold);color:var(--gh-color-text-primary)}
.gh-barlist__note{grid-column:2/-1;display:flex;gap:var(--gh-ref-space-200);align-items:flex-start;font-size:var(--gh-type-label-sm-size);line-height:var(--gh-type-body-sm-line-height);color:var(--gh-color-text-secondary)}
.gh-barlist__scale{display:grid;grid-template-columns:var(--gh-barlist-name) minmax(0,1fr) var(--gh-barlist-val);gap:var(--gh-ref-space-300);font-size:var(--gh-type-caption-size);color:var(--gh-color-text-tertiary)}
.gh-barlist__scale>div{display:flex;justify-content:space-between}
/* funnel: thicker rows, drop between stages annotated inside the track's free end */
.gh-barlist--funnel{--gh-barlist-h:1.375rem;--gh-barlist-name:7.5rem;--gh-barlist-val:6rem;gap:var(--gh-ref-space-150)}
.gh-barlist--funnel .gh-barlist__track{border-radius:5px;background:var(--gh-color-surface-2);container-type:inline-size}
/* a track too short for the label hides it (aria-hidden; the drop is also in the data table / tooltip) */
@container (max-width:8rem){.gh-barlist__track .gh-barlist__drop{display:none}}
/* the label never leaves the track (§4b.1): near a full bar it is clamped to the track's end, over the fill, on its own
   surface pill so it stays readable on the bar */
.gh-barlist__drop{position:absolute;inset-block:0;inset-inline-start:min(calc(var(--gh-value,0) * 1% + var(--gh-ref-space-200)),calc(100% - 5rem));display:flex;align-items:center;gap:var(--gh-ref-space-100);
  font-size:var(--gh-type-caption-size);color:var(--gh-color-text-tertiary);white-space:nowrap;pointer-events:none}
.gh-barlist__drop>bdi{padding-inline:var(--gh-ref-space-100);border-radius:var(--gh-radius-pill);background:var(--gh-color-surface-2);line-height:1.4}
.gh-barlist__row.is-highlight .gh-barlist__drop{color:var(--gh-color-text-primary);font-weight:var(--gh-ref-font-weight-semibold)}
/* rating distribution: short label column (★ ۵) */
.gh-barlist--rating{--gh-barlist-name:3.25rem;--gh-barlist-val:5.25rem;gap:var(--gh-ref-space-100)}
.gh-barlist--rating .gh-icon{display:inline-block;vertical-align:-.1em;margin-inline-end:var(--gh-ref-space-100);inline-size:.8rem;block-size:.8rem;fill:currentColor;stroke:none}
@media (max-width:560px){
  .gh-barlist{--gh-barlist-name:5.25rem;--gh-barlist-val:4.25rem}
  .gh-barlist--funnel{--gh-barlist-name:5.5rem;--gh-barlist-val:4.5rem}
  .gh-barlist--rating{--gh-barlist-name:3rem}
}

/* ---------- heatmap: 12 weeks × 7 days (gh-heatmap) — columns = weeks, newest at inline-end ---------- */
.gh-heatmap{display:grid;grid-template-columns:auto minmax(0,1fr);gap:var(--gh-ref-space-100) var(--gh-ref-space-200);--gh-heatmap-weeks:12}
.gh-heatmap__days{display:grid;grid-template-rows:repeat(7,1fr);gap:var(--gh-ref-space-100);font-size:var(--gh-type-caption-size);color:var(--gh-color-text-tertiary);line-height:1}
.gh-heatmap__days span{display:flex;align-items:center}
.gh-heatmap__cells{display:grid;grid-template-columns:repeat(var(--gh-heatmap-weeks),minmax(0,1fr));grid-template-rows:repeat(7,auto);grid-auto-flow:column;gap:var(--gh-ref-space-100)}
.gh-heatmap__cell{aspect-ratio:1;min-width:0;max-inline-size:1.75rem;border-radius:4px;background:var(--gh-color-data-heat-0);padding:0}
.gh-heatmap__cell[data-level="1"]{background:var(--gh-color-data-heat-1)}
.gh-heatmap__cell[data-level="2"]{background:var(--gh-color-data-heat-2)}
.gh-heatmap__cell[data-level="3"]{background:var(--gh-color-data-heat-3)}
.gh-heatmap__cell[data-level="4"]{background:var(--gh-color-data-heat-4)}
.gh-heatmap__cell[aria-disabled="true"]{background:none;border:1px dashed var(--gh-color-border-default);cursor:default}
.gh-heatmap__cell[aria-current]{box-shadow:0 0 0 2px var(--gh-chart-ring),0 0 0 3px var(--gh-color-text-primary)}
.gh-heatmap__cell:hover:not([aria-disabled="true"]){box-shadow:0 0 0 2px var(--gh-chart-ring),0 0 0 3px var(--gh-color-text-secondary)}
.gh-heatmap__axis{grid-column:2;display:flex;justify-content:space-between;font-size:var(--gh-type-caption-size);color:var(--gh-color-text-tertiary)}
.gh-heatmap__scale{display:flex;align-items:center;gap:var(--gh-ref-space-100);font-size:var(--gh-type-caption-size);color:var(--gh-color-text-tertiary)}
.gh-heatmap__scale .gh-legend__key{inline-size:12px;block-size:12px}

/* ---------- sparkline (SVG, drawn by GH.chart.sparkline) — de-emphasised line, current point in accent ---------- */
.gh-sparkline{display:block;inline-size:100%;block-size:var(--gh-sparkline-h,2.25rem);overflow:visible}
.gh-sparkline__area{fill:var(--gh-chart-you);opacity:.1;stroke:none}
.gh-sparkline__line{fill:none;stroke:var(--gh-chart-mark);stroke-width:2;stroke-linecap:round;stroke-linejoin:round;vector-effect:non-scaling-stroke}
.gh-sparkline__end{position:absolute;inline-size:8px;block-size:8px;border-radius:50%;background:var(--gh-color-data-you);box-shadow:0 0 0 2px var(--gh-color-surface-1);pointer-events:none}
.gh-sparkline__hit{fill:transparent}
.gh-sparkline__hit:focus-visible{outline:none;fill:var(--gh-color-border-subtle)}
.gh-sparkline--bars{display:flex;align-items:flex-end;gap:var(--gh-ref-space-50)}
.gh-sparkline--bars>i{flex:1;min-width:0;block-size:max(2px,calc(var(--gh-value,0) * 1%));border-start-start-radius:2px;border-start-end-radius:2px;background:var(--gh-chart-mark)}
.gh-sparkline--bars>i[aria-current]{background:var(--gh-chart-you)}

/* ---------- instalment schedule (gh-schedule): equal segments, paid / due next / future ---------- */
.gh-schedule{display:grid;grid-template-columns:repeat(var(--gh-schedule-n,3),minmax(0,1fr));gap:var(--gh-ref-space-50) var(--gh-ref-space-50)}
.gh-schedule__item{display:flex;flex-direction:column;gap:var(--gh-ref-space-50);min-width:0;padding:0;text-align:start;border-radius:var(--gh-radius-control)}
.gh-schedule__bar{block-size:12px;background:var(--gh-chart-track);margin-block-end:var(--gh-ref-space-200)}
.gh-schedule__item:first-child .gh-schedule__bar{border-start-start-radius:6px;border-end-start-radius:6px}
.gh-schedule__item:last-child .gh-schedule__bar{border-start-end-radius:6px;border-end-end-radius:6px}
.gh-schedule__item.is-paid .gh-schedule__bar{background:var(--gh-chart-mark)}
.gh-schedule__item[aria-current] .gh-schedule__bar{background:var(--gh-chart-you)}
.gh-schedule__amount{font-size:var(--gh-type-body-lg-size);font-weight:var(--gh-ref-font-weight-light);line-height:1.4;white-space:nowrap;color:var(--gh-color-text-primary)}
.gh-schedule__amount small{font-size:var(--gh-type-caption-size);color:var(--gh-color-text-tertiary);font-weight:var(--gh-ref-font-weight-regular)}
.gh-schedule__item.is-paid .gh-schedule__amount{color:var(--gh-color-text-secondary)}
.gh-schedule__date{font-size:var(--gh-type-caption-size);color:var(--gh-color-text-tertiary);line-height:1.5}
.gh-schedule__item[aria-current] .gh-schedule__date{color:var(--gh-color-text-primary);font-weight:var(--gh-ref-font-weight-semibold)}
@media (max-width:560px){.gh-schedule__amount{font-size:var(--gh-type-label-size)}}

/* ---------- day-strip: last N days as cells (activity), newest at inline-end ---------- */
.gh-daystrip{display:flex;gap:var(--gh-ref-space-50);align-items:center}
.gh-daystrip>i{inline-size:var(--gh-daystrip-w,6px);block-size:var(--gh-daystrip-h,12px);border-radius:2px;background:var(--gh-chart-track);flex:none}
.gh-daystrip>i.is-on{background:var(--gh-chart-mark)}
.gh-daystrip>i[aria-current]{background:var(--gh-chart-you)}
.gh-daystrip--lg{--gh-daystrip-w:auto;--gh-daystrip-h:28px}
.gh-daystrip--lg>i{flex:1;border-radius:4px}

/* ---------- deadline timeline: day axis + events (gh-deadline) — today at inline-start ---------- */
.gh-deadline{position:relative;block-size:3.5rem;margin-inline:var(--gh-ref-space-300);container-type:inline-size}
.gh-deadline__base{position:absolute;inset-inline:0;top:2.5rem;block-size:2px;border-radius:1px;background:var(--gh-chart-track)}
.gh-deadline__past{position:absolute;inset-inline-start:0;top:2.5rem;block-size:2px;inline-size:calc(var(--gh-value,0) * 1%);background:var(--gh-chart-mark)}
.gh-deadline__tick{position:absolute;top:0;inset-inline-start:calc(var(--gh-pos) * 1%);inline-size:3rem;margin-inline-start:-1.5rem;display:flex;flex-direction:column;align-items:center;gap:2px;
  font-size:var(--gh-type-caption-size);color:var(--gh-color-text-tertiary);line-height:1.3;pointer-events:none}
.gh-deadline__tick b{font-size:var(--gh-type-label-sm-size);color:var(--gh-color-text-secondary);font-weight:var(--gh-ref-font-weight-semibold);padding-inline:var(--gh-ref-space-100);border-radius:var(--gh-radius-kbd)}
.gh-deadline__tick b{white-space:nowrap}
.gh-deadline__tick[aria-current] b{background:var(--gh-color-surface-inverse);color:var(--gh-color-text-inverse)}
/* today sits at the track's start: its chip («۲۶ آبان») starts there instead of hanging half outside the card */
.gh-deadline__tick[aria-current]{inline-size:auto;margin-inline-start:0;align-items:flex-start}
/* narrow cards: the tick right after today would collide with today's longer chip */
@container (max-width:34rem){.gh-deadline__tick--near{display:none}}
/* events: shape + label carry the kind, not colour — due = filled accent dot, live = ring, other = neutral dot */
.gh-deadline__event{position:absolute;top:calc(2.5rem - 7px);inset-inline-start:calc(var(--gh-pos) * 1%);inline-size:16px;block-size:16px;margin-inline-start:-8px;border-radius:50%;
  background:var(--gh-color-text-secondary);box-shadow:0 0 0 3px var(--gh-chart-ring);padding:0}
.gh-deadline__event::before{content:"";position:absolute;inset:-12px}
.gh-deadline__event--due{background:var(--gh-chart-you)}
.gh-deadline__event--live{background:var(--gh-chart-ring);border:3px solid var(--gh-color-text-primary)}

/* phones: schedule amounts stack instead of colliding */
@media (max-width:560px){.gh-schedule__amount{font-size:var(--gh-type-label-size);white-space:normal}}


/* ===== components/checkbox.css ===== */
/* ==========================================================================
   @component checkbox + radio — gh-checkbox · gh-radio (native inputs) · gh-check (label row)
   Consolidates: auth/profile/settings .cbx (native 22px), checkout/course/courses .cbx (hidden input + .box span),
   instructor/review .chk (::after tick), assignment .cklist (bordered rows), settings .cb-cell (matrix).
   Decision: ONE native-input implementation (keeps form semantics, indeterminate, :disabled, validation) — no fake boxes.
   Tick/dot are masks coloured by tokens. Locked = checked + disabled.
   Row: <label class="gh-check"><input class="gh-checkbox" type="checkbox"><span class="gh-check__text">…
          <small class="gh-check__desc">…</small></span><span class="gh-check__count">۱۲</span></label>
   Modifiers: gh-check--card (bordered, self-check lists).
   ========================================================================== */
.gh-checkbox,.gh-radio{--_s:20px;position:relative;appearance:none;-webkit-appearance:none;flex:none;margin:0;inline-size:var(--_s);block-size:var(--_s);
  display:inline-grid;place-items:center;border:1.5px solid var(--gh-color-border-strong);background:var(--gh-color-surface-1);cursor:pointer;vertical-align:middle;
  transition:background-color var(--gh-motion-duration-fast) var(--gh-motion-ease),border-color var(--gh-motion-duration-fast) var(--gh-motion-ease)}
.gh-checkbox{border-radius:6px}
.gh-radio{border-radius:50%}
.gh-checkbox:hover,.gh-radio:hover{border-color:var(--gh-color-text-tertiary)}
.gh-checkbox:focus-visible{border-radius:6px}
.gh-radio:focus-visible{border-radius:50%}
.gh-checkbox::before{content:"";inline-size:14px;block-size:14px;background:var(--gh-color-accent-on);transform:scale(0);
  -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center/contain no-repeat;
  mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center/contain no-repeat;
  transition:transform var(--gh-motion-duration-fast) var(--gh-motion-ease)}
.gh-radio::before{content:"";inline-size:8px;block-size:8px;border-radius:50%;background:var(--gh-color-accent-on);transform:scale(0);transition:transform var(--gh-motion-duration-fast) var(--gh-motion-ease)}
.gh-checkbox:checked,.gh-checkbox:indeterminate,.gh-radio:checked{background:var(--gh-color-accent-default);border-color:var(--gh-color-accent-default)}
.gh-checkbox:checked::before,.gh-radio:checked::before{transform:scale(1)}
.gh-checkbox:indeterminate::before{transform:scale(1);block-size:2.5px;inline-size:10px;border-radius:2px;-webkit-mask:none;mask:none}
.gh-checkbox[aria-invalid="true"],.gh-radio[aria-invalid="true"]{border-color:var(--gh-color-status-danger)}
.gh-checkbox:disabled,.gh-radio:disabled{cursor:not-allowed;opacity:.45}
/* locked (checked + disabled): neutral, still readable */
.gh-checkbox:disabled:checked,.gh-radio:disabled:checked{opacity:1;background:var(--gh-color-surface-4);border-color:var(--gh-color-surface-4)}
.gh-checkbox:disabled:checked::before,.gh-radio:disabled:checked::before{background:var(--gh-color-text-secondary)}
.gh-checkbox--lg,.gh-radio--lg{--_s:22px}

/* label row */
.gh-check{position:relative;display:flex;align-items:flex-start;gap:var(--gh-ref-space-250);min-block-size:36px;padding:var(--gh-ref-space-150) var(--gh-ref-space-200);
  border-radius:var(--gh-ref-space-250);font-size:var(--gh-type-label-size);line-height:1.6;color:var(--gh-color-text-secondary);cursor:pointer}
.gh-check>.gh-checkbox,.gh-check>.gh-radio{margin-block-start:2px}
.gh-check:hover{background:var(--gh-color-surface-2);color:var(--gh-color-text-primary)}
.gh-check:has(:checked){color:var(--gh-color-text-primary)}
.gh-check__text{flex:1;min-inline-size:0;display:flex;flex-direction:column;align-items:flex-start}
.gh-check__desc{font-size:var(--gh-type-caption-size);color:var(--gh-color-text-tertiary);line-height:1.6}
.gh-check__count{margin-inline-start:auto;flex:none;font-size:var(--gh-type-caption-size);color:var(--gh-color-text-tertiary)}
.gh-check:has(:disabled){cursor:not-allowed;color:var(--gh-color-text-disabled);background:transparent}
.gh-check:has(:disabled:checked){color:var(--gh-color-text-secondary)}
.gh-check--card{padding:var(--gh-ref-space-250) var(--gh-ref-space-300);border-radius:var(--gh-ref-space-300);background:var(--gh-color-surface-2);border:1px solid var(--gh-color-border-subtle)}
.gh-check--card:hover{background:var(--gh-color-surface-2);border-color:var(--gh-color-border-strong)}
.gh-check--card:has(:checked){border-color:var(--gh-color-accent-border)}
.gh-check-list{display:grid;gap:var(--gh-ref-space-150)}
@media (pointer:coarse){.gh-check{min-block-size:var(--gh-ref-size-touch-min);align-items:center}.gh-check>.gh-checkbox,.gh-check>.gh-radio{margin-block-start:0}}
/* touch: a bare checkbox / radio (table rows, matrices) gets a 44px hit area; ::before is the tick, ::after is free */
@media (pointer:coarse){.gh-checkbox::after,.gh-radio::after{content:"";position:absolute;inset:calc((var(--_s) - var(--gh-ref-size-touch-min)) / 2)}}


/* ===== components/chip.css ===== */
/* ==========================================================================
   @component chip — gh-chip (filter toggle · count · removable · link)
   Consolidates: base .chip (+ b count, [aria-pressed]), courses .xchip (removable), .popq/.qa-filter chip
   size overrides, auth .days-row square chips, courses .pseg (pressed grid), lesson .vote.
   Filter chip  = <button aria-pressed> (data-gh-toggle); a filter that is a link = <a aria-current="page"> when shown. Removable chip = <button data-gh-removable aria-label="حذف فیلتر: …">.
   Current chip = <button|a aria-current="true|step|location"> — «where you are now» (playing chapter, active section);
   accent outline, not a filled state, so it never reads as a pressed filter (v0.2, gap A1).
   Sizes: --sm (28) · md (32). Shape: --square (one glyph: days of week).
   ========================================================================== */
.gh-chip-group{display:flex;flex-wrap:wrap;align-items:center;gap:var(--gh-ref-space-150)}

.gh-chip{position:relative;display:inline-flex;align-items:center;justify-content:center;gap:var(--gh-ref-space-150);
  block-size:var(--gh-chip-height);padding-inline:var(--gh-ref-space-300);border-radius:var(--gh-radius-pill);
  border:1px solid var(--gh-color-border-default);background:transparent;color:var(--gh-color-text-secondary);
  font-family:inherit;font-size:var(--gh-ref-font-size-100);font-weight:var(--gh-ref-font-weight-medium);line-height:1;white-space:nowrap;
  text-decoration:none;cursor:pointer;-webkit-tap-highlight-color:transparent;
  transition:background-color var(--gh-motion-duration-base) var(--gh-motion-ease),border-color var(--gh-motion-duration-base) var(--gh-motion-ease),color var(--gh-motion-duration-base) var(--gh-motion-ease)}
.gh-chip:hover{color:var(--gh-color-text-primary);border-color:var(--gh-color-border-strong)}
.gh-chip:focus-visible{border-radius:var(--gh-radius-pill)}
.gh-chip .gh-icon{inline-size:var(--gh-icon-sm);block-size:var(--gh-icon-sm)}
.gh-chip--sm{block-size:28px;padding-inline:var(--gh-ref-space-250);font-size:var(--gh-ref-font-size-75)}
.gh-chip--square{inline-size:var(--gh-chip-height);padding:0}
.gh-chip--sm.gh-chip--square{inline-size:28px}

/* count inside a chip */
.gh-chip__count{min-inline-size:20px;block-size:20px;padding-inline:5px;border-radius:var(--gh-radius-pill);background:var(--gh-color-surface-3);
  color:var(--gh-color-text-secondary);font-size:var(--gh-ref-font-size-50);font-weight:var(--gh-ref-font-weight-semibold);display:inline-grid;place-items:center;margin-inline-end:-5px}

/* selected (filter on) — inverse surface, the strongest neutral; lime stays for primary action */
.gh-chip[aria-pressed="true"],.gh-chip[aria-checked="true"]{background:var(--gh-color-surface-inverse);border-color:var(--gh-color-surface-inverse);color:var(--gh-color-text-inverse)}
.gh-chip[aria-pressed="true"] .gh-chip__count,.gh-chip[aria-checked="true"] .gh-chip__count{background:var(--gh-color-text-inverse);color:var(--gh-color-surface-inverse)}

/* current (playing chapter / active section) — accent hairline + primary text; __meta (timestamp) turns accent.
   Distinct from aria-pressed: a filter is something you switched on, «current» is where you are. */
.gh-chip[aria-current]:not([aria-current="false"]){border-color:var(--gh-color-accent-border);color:var(--gh-color-text-primary)}
.gh-chip[aria-current]:not([aria-current="false"]):hover{border-color:var(--gh-color-accent-ink)}
.gh-chip[aria-current]:not([aria-current="false"]) .gh-chip__meta{color:var(--gh-color-accent-ink)}

/* filter LINK (each filter is its own URL, e.g. /fonts/?script=fa): the shown filter is <a aria-current="page">, never
   aria-pressed (not allowed on links, axe aria-allowed-attr). Same look as a pressed filter button. */
a.gh-chip[aria-current="page"]:not([aria-pressed]){background:var(--gh-color-surface-inverse);border-color:var(--gh-color-surface-inverse);color:var(--gh-color-text-inverse)}
a.gh-chip[aria-current="page"]:not([aria-pressed]) .gh-chip__count{background:var(--gh-color-text-inverse);color:var(--gh-color-surface-inverse)}

/* removable (active filter) */
.gh-chip--removable{background:var(--gh-color-surface-3);color:var(--gh-color-text-primary);padding-inline:var(--gh-ref-space-300) var(--gh-ref-space-100)}
.gh-chip__meta{color:var(--gh-color-text-tertiary);font-weight:var(--gh-ref-font-weight-regular)}
.gh-chip__x{inline-size:22px;block-size:22px;border-radius:50%;display:grid;place-items:center;color:var(--gh-color-text-secondary);flex:none}
.gh-chip--removable:hover .gh-chip__x{background:var(--gh-color-surface-4);color:var(--gh-color-text-primary)}

.gh-chip:disabled,.gh-chip[aria-disabled="true"]{color:var(--gh-color-text-disabled);border-color:var(--gh-color-border-subtle);background:transparent;cursor:not-allowed}

@media (pointer:coarse){
  .gh-chip::before{content:"";position:absolute;inset:min(0px,calc((100% - var(--gh-ref-size-touch-min)) / 2))}
}


/* ===== components/choice-card.css ===== */
/* ==========================================================================
   @component choice-card — gh-choice (large selectable option) + gh-choice-group (grid)
   Consolidates: settings .rcard (radio-card, native input + :has), auth .opt/.hrs (choice-tile, aria-pressed/aria-checked),
   home .opt (finder), quiz .ch / .tf / .opts .opt (image, true-false, text options with result states).
   Two markups, one look:
     form  → <label class="gh-choice"><input class="gh-sr-only" type="radio|checkbox" name>…</label>
     quiz  → <button class="gh-choice" role="radio" aria-checked="false">…</button> inside data-gh-choice-group (roving + arrows)
   Elements: __media (image/artwork, square) · __icon · __key (letter/number) · __body > __title + __desc · __figure (big thin
   number, choice-tile) · __indicator (radio dot / check box) · __result (correct/incorrect pill).
   Layouts: default stacked card · --row (horizontal text option) · --tile (big figure).
   Result states (after answer submitted): is-correct · is-incorrect · is-dimmed (+ disabled on all options).
   ========================================================================== */
.gh-choice-group{--_cols:3;display:grid;grid-template-columns:repeat(var(--_cols),minmax(0,1fr));gap:var(--gh-layout-gap)}
.gh-choice-group--cols-1{--_cols:1;gap:var(--gh-ref-space-200)}
.gh-choice-group--cols-2{--_cols:2}
.gh-choice-group--cols-4{--_cols:4}
@media (max-width:860px){.gh-choice-group--cols-4{--_cols:2}.gh-choice-group{--_cols:2}.gh-choice-group--cols-1{--_cols:1}}
@media (max-width:420px){.gh-choice-group:not(.gh-choice-group--cols-4):not(.gh-choice-group--cols-2){--_cols:1}}

.gh-choice{--_bd:var(--gh-color-border-subtle);--_bg:var(--gh-color-surface-2);--_mark:var(--gh-color-accent-ink);
  position:relative;display:flex;flex-direction:column;gap:var(--gh-ref-space-250);min-inline-size:0;inline-size:100%;
  padding:var(--gh-ref-space-400);border-radius:var(--gh-radius-inner);background:var(--_bg);border:1.5px solid var(--_bd);
  color:var(--gh-color-text-primary);font:inherit;text-align:start;cursor:pointer;-webkit-tap-highlight-color:transparent;
  transition:border-color var(--gh-motion-duration-base) var(--gh-motion-ease),background-color var(--gh-motion-duration-base) var(--gh-motion-ease)}
.gh-choice:hover{--_bd:var(--gh-color-border-strong);--_bg:var(--gh-color-surface-3)}
.gh-choice:focus-visible{border-radius:var(--gh-radius-inner)}
.gh-choice:has(input:focus-visible){outline:var(--gh-focus-width) solid var(--gh-color-focus-ring);outline-offset:var(--gh-focus-offset)}

.gh-choice__media{display:block;aspect-ratio:1;border-radius:var(--gh-ref-space-250);overflow:hidden;background:var(--gh-color-surface-media);margin:calc(var(--gh-ref-space-150) * -1);margin-block-end:0}
.gh-choice__media>img,.gh-choice__media>svg{inline-size:100%;block-size:100%;object-fit:cover}
.gh-choice__head{display:flex;align-items:flex-start;gap:var(--gh-ref-space-300);min-inline-size:0}
.gh-choice__icon{inline-size:36px;block-size:36px;border-radius:var(--gh-ref-space-250);background:var(--gh-color-surface-3);color:var(--gh-color-text-secondary);display:grid;place-items:center;flex:none}
.gh-choice__key{min-inline-size:26px;block-size:26px;padding-inline:var(--gh-ref-space-100);box-sizing:border-box;border-radius:7px;background:var(--gh-color-surface-3);color:var(--gh-color-text-secondary);display:grid;place-items:center;flex:none;
  font-size:var(--gh-ref-font-size-75);font-weight:var(--gh-ref-font-weight-bold)}
.gh-choice__body{flex:1;min-inline-size:0;display:flex;flex-direction:column}
.gh-choice__title{font-size:var(--gh-ref-font-size-300);font-weight:var(--gh-ref-font-weight-bold);line-height:1.55}
.gh-choice__desc{font-size:var(--gh-type-caption-size);color:var(--gh-color-text-tertiary);line-height:1.65}
.gh-choice:has(input:checked) .gh-choice__desc,.gh-choice[aria-checked="true"] .gh-choice__desc{color:var(--gh-color-text-secondary)} /* on the accent tint tertiary drops below 4.5:1 */
.gh-choice__figure{font-size:var(--gh-type-figure-md-size);font-weight:var(--gh-ref-font-weight-thin);line-height:1.1}
.gh-choice__indicator{flex:none;inline-size:20px;block-size:20px;margin-inline-start:auto;border-radius:50%;border:1.5px solid var(--gh-color-border-strong);display:grid;place-items:center;
  transition:border-color var(--gh-motion-duration-fast) var(--gh-motion-ease),background-color var(--gh-motion-duration-fast) var(--gh-motion-ease)}
.gh-choice__indicator::after{content:"";inline-size:8px;block-size:8px;border-radius:50%;background:var(--gh-color-accent-on);transform:scale(0);transition:transform var(--gh-motion-duration-fast) var(--gh-motion-ease)}
.gh-choice:has(input[type="checkbox"]) .gh-choice__indicator,.gh-choice[role="checkbox"] .gh-choice__indicator{border-radius:6px}
.gh-choice__result{position:absolute;inset-block-start:var(--gh-ref-space-300);inset-inline-end:var(--gh-ref-space-300);display:none;align-items:center;gap:4px;block-size:24px;padding-inline:var(--gh-ref-space-250);
  border-radius:var(--gh-radius-pill);background:var(--_mark);color:var(--gh-color-accent-on);font-size:var(--gh-ref-font-size-75);font-weight:var(--gh-ref-font-weight-bold)}

/* selected */
.gh-choice[aria-checked="true"],.gh-choice[aria-pressed="true"],.gh-choice:has(input:checked){--_bd:var(--gh-color-accent-border);--_bg:var(--gh-color-accent-soft)}
.gh-choice[aria-checked="true"] .gh-choice__indicator,.gh-choice[aria-pressed="true"] .gh-choice__indicator,.gh-choice:has(input:checked) .gh-choice__indicator{background:var(--_mark);border-color:var(--_mark)}
.gh-choice[aria-checked="true"] .gh-choice__indicator::after,.gh-choice[aria-pressed="true"] .gh-choice__indicator::after,.gh-choice:has(input:checked) .gh-choice__indicator::after{transform:scale(1)}
.gh-choice[aria-checked="true"] :is(.gh-choice__icon,.gh-choice__key),.gh-choice[aria-pressed="true"] :is(.gh-choice__icon,.gh-choice__key),.gh-choice:has(input:checked) :is(.gh-choice__icon,.gh-choice__key){background:var(--_mark);color:var(--gh-color-accent-on)}
.gh-choice[aria-checked="true"] .gh-choice__figure,.gh-choice:has(input:checked) .gh-choice__figure{color:var(--gh-color-accent-ink)}

/* result states (quiz) — colour + icon + word */
.gh-choice.is-correct{--_mark:var(--gh-color-status-success);--_bd:var(--gh-color-status-success);--_bg:var(--gh-color-status-success-soft)}
.gh-choice.is-incorrect{--_mark:var(--gh-color-status-danger);--_bd:var(--gh-color-status-danger);--_bg:var(--gh-color-status-danger-soft)}
.gh-choice.is-correct .gh-choice__result,.gh-choice.is-incorrect .gh-choice__result{display:inline-flex}
.gh-choice.is-correct :is(.gh-choice__key,.gh-choice__icon),.gh-choice.is-incorrect :is(.gh-choice__key,.gh-choice__icon){background:var(--_mark);color:var(--gh-color-accent-on)}
.gh-choice.is-dimmed{opacity:.55}

/* disabled (unavailable plan / locked after answer) */
.gh-choice:disabled,.gh-choice[aria-disabled="true"],.gh-choice:has(input:disabled){cursor:not-allowed}
.gh-choice:disabled:hover,.gh-choice[aria-disabled="true"]:hover{--_bd:var(--gh-color-border-subtle);--_bg:var(--gh-color-surface-2)}
.gh-choice:has(input:disabled):not(:has(input:checked)),.gh-choice[aria-disabled="true"]{opacity:.5}
.gh-choice.is-correct:disabled:hover,.gh-choice.is-incorrect:disabled:hover{--_bd:var(--_mark)}
.gh-choice.is-correct:disabled:hover{--_bg:var(--gh-color-status-success-soft)}
.gh-choice.is-incorrect:disabled:hover{--_bg:var(--gh-color-status-danger-soft)}

/* layouts */
.gh-choice--row{flex-direction:row;align-items:center;gap:var(--gh-ref-space-300);padding:var(--gh-ref-space-300) var(--gh-ref-space-400)}
.gh-choice--row .gh-choice__result{position:static;margin-inline-start:auto}
.gh-choice--row .gh-choice__result~.gh-choice__indicator{display:none}
.gh-choice--tile{gap:2px;padding:var(--gh-ref-space-400) var(--gh-ref-space-400) var(--gh-ref-space-300)}
.gh-choice--tile .gh-choice__title{font-size:var(--gh-ref-font-size-100);font-weight:var(--gh-ref-font-weight-medium);color:var(--gh-color-text-secondary)}
.gh-choice--media{padding:var(--gh-ref-space-250)}
.gh-choice--media .gh-choice__media{margin:0}
.gh-choice--media .gh-choice__head{padding-inline:var(--gh-ref-space-100);align-items:center}
.gh-choice--media .gh-choice__title{font-size:var(--gh-ref-font-size-100);font-weight:var(--gh-ref-font-weight-medium);color:var(--gh-color-text-secondary)}
.gh-choice--media .gh-choice__result{inset-block-start:var(--gh-ref-space-400);inset-inline-end:var(--gh-ref-space-400)}


/* ===== components/command-palette.css ===== */
/* ==========================================================================
   Command palette (⌘K / Ctrl+K) — search + commands, grouped results, scopes, arrow keys, Enter.
   Consolidates .cmdk/.cmdk-box/.cmdk-in/.cmdk-scopes/.cmdk-list/.cmdk-g/.cmdk-i/.cmdk-foot/.cmdk-empty (all 13 pages).
   ARIA: dialog(aria-modal) > input[role=combobox][aria-controls][aria-activedescendant] + [role=listbox]
   > [role=group] > [role=option][aria-selected]. Behaviour: data-gh-cmdk.
   ========================================================================== */
.gh-cmdk{position:fixed;inset:0;z-index:var(--gh-ref-z-overlay);display:flex;align-items:flex-start;justify-content:center;padding:12vh var(--gh-ref-space-400) var(--gh-ref-space-400);
  background:var(--gh-color-bg-scrim);animation:gh-cmdk-fade var(--gh-motion-duration-base) var(--gh-motion-ease)}
.gh-cmdk__dialog{display:flex;flex-direction:column;width:min(640px,100%);max-height:100%;overflow:hidden;
  background:var(--gh-color-surface-2);border:1px solid var(--gh-color-border-default);border-radius:var(--gh-radius-panel);box-shadow:var(--gh-shadow-overlay-lg);
  animation:gh-cmdk-in var(--gh-motion-duration-slow) var(--gh-motion-ease)}
.gh-cmdk__search{display:flex;align-items:center;gap:var(--gh-ref-space-300);padding:var(--gh-ref-space-400) var(--gh-ref-space-500);border-block-end:1px solid var(--gh-color-border-subtle);color:var(--gh-color-text-tertiary);flex:none}
.gh-cmdk__input{flex:1;min-width:0;height:28px;background:none;border:0;font-size:var(--gh-type-body-lg-size);color:var(--gh-color-text-primary)}
.gh-cmdk__input::placeholder{color:var(--gh-color-text-tertiary)}
.gh-cmdk__input:focus-visible{outline:none} /* the whole search row is the focus context; active option is announced */
.gh-cmdk__scopes{display:flex;flex-wrap:wrap;gap:var(--gh-ref-space-150);padding:var(--gh-ref-space-300) var(--gh-ref-space-500) 0;flex:none}
.gh-cmdk__scope{display:inline-flex;align-items:center;height:30px;padding-inline:var(--gh-ref-space-300);border-radius:var(--gh-radius-pill);border:1px solid var(--gh-color-border-default);
  font-size:var(--gh-type-label-sm-size);font-weight:var(--gh-ref-font-weight-medium);color:var(--gh-color-text-secondary)}
.gh-cmdk__scope:hover{color:var(--gh-color-text-primary);border-color:var(--gh-color-border-strong)}
.gh-cmdk__scope[aria-pressed="true"]{background:var(--gh-color-surface-inverse);border-color:var(--gh-color-surface-inverse);color:var(--gh-color-text-inverse)}
.gh-cmdk__scope:focus-visible{border-radius:var(--gh-radius-pill)}
.gh-cmdk__list{flex:1;min-height:0;max-height:min(54vh,440px);overflow:auto;overscroll-behavior:contain;padding:var(--gh-ref-space-200)}
.gh-cmdk__group-label{padding:var(--gh-ref-space-300) var(--gh-ref-space-250) var(--gh-ref-space-150);font-size:var(--gh-type-caption-size);font-weight:var(--gh-ref-font-weight-semibold);color:var(--gh-color-text-tertiary)}
.gh-cmdk__item{display:flex;align-items:center;gap:var(--gh-ref-space-300);min-height:48px;padding:var(--gh-ref-space-200) var(--gh-ref-space-250);border-radius:var(--gh-ref-space-300);
  font-size:var(--gh-type-label-size);line-height:var(--gh-type-label-line-height);color:var(--gh-color-text-primary);cursor:pointer}
.gh-cmdk__item[aria-selected="true"]{background:var(--gh-color-surface-3)}
.gh-cmdk__item-icon{display:grid;place-items:center;width:32px;height:32px;flex:none;overflow:hidden;border-radius:9px;background:var(--gh-color-surface-3);color:var(--gh-color-text-secondary)}
.gh-cmdk__item-icon>svg:not(.gh-icon),.gh-cmdk__item-icon>img{width:100%;height:100%;object-fit:cover}
.gh-cmdk__item[aria-selected="true"] .gh-cmdk__item-icon{background:var(--gh-color-accent-default);color:var(--gh-color-accent-on)}
.gh-cmdk__item-text{flex:1;min-width:0}
.gh-cmdk__item-meta{display:block;font-size:var(--gh-type-caption-size);color:var(--gh-color-text-tertiary)}
.gh-cmdk__item-end{margin-inline-start:auto;flex:none;display:flex;gap:var(--gh-ref-space-100);direction:ltr}
.gh-cmdk__item mark{background:none;color:var(--gh-color-accent-ink)}
.gh-cmdk__empty{padding:var(--gh-ref-space-700);text-align:center;font-size:var(--gh-type-label-size);color:var(--gh-color-text-tertiary)}
.gh-cmdk__foot{display:flex;flex-wrap:wrap;gap:var(--gh-ref-space-400);padding:var(--gh-ref-space-250) var(--gh-ref-space-500);border-block-start:1px solid var(--gh-color-border-subtle);font-size:var(--gh-type-caption-size);color:var(--gh-color-text-tertiary);flex:none}
.gh-cmdk__foot>span{display:inline-flex;align-items:center;gap:var(--gh-ref-space-150)}
@keyframes gh-cmdk-fade{from{opacity:0}}
@keyframes gh-cmdk-in{from{opacity:0;transform:translateY(-8px) scale(.98)}}
@media (max-width:560px){
  .gh-cmdk{padding:var(--gh-ref-space-200)}
  .gh-cmdk__list{max-height:none}
  .gh-cmdk__dialog{height:100%}
  .gh-cmdk__foot{display:none}
}


/* ===== components/comment-thread.css ===== */
/* ==========================================================================
   gh-thread — numbered, resolvable comment thread with replies (Group C)
   Consolidates: assignment .thread/.reps/.rep/.reply (+ .gen general note), review .alist (anno-list),
   profile .cm-list (public comments, unnumbered).
   Selected (linked pin selected) = aria-current="true"; resolved = .is-resolved (resolve button aria-pressed).
   ========================================================================== */
.gh-threads{display:flex;flex-direction:column;gap:var(--gh-ref-space-200);min-width:0}
.gh-thread{display:flex;flex-direction:column;gap:var(--gh-ref-space-150);padding:var(--gh-ref-space-300);border-radius:var(--gh-ref-radius-md);border:1px solid var(--gh-color-border-subtle);
  background:var(--gh-color-surface-1);transition:border-color var(--gh-motion-duration-base),background-color var(--gh-motion-duration-base)}
.gh-thread[aria-current="true"]{border-color:var(--gh-color-accent-border);background:var(--gh-color-surface-2)}
.gh-thread__head{display:flex;align-items:center;gap:var(--gh-ref-space-200);font-size:var(--gh-type-caption-size);color:var(--gh-color-text-tertiary);min-width:0}
.gh-thread__head b{color:var(--gh-color-text-primary);font-weight:var(--gh-ref-font-weight-semibold);font-size:var(--gh-type-label-sm-size)}
.gh-thread__head>:last-child:not(:first-child){margin-inline-start:auto}
.gh-thread__body{font-size:var(--gh-type-body-sm-size);line-height:var(--gh-type-body-sm-line-height);color:var(--gh-color-text-primary)}
.gh-thread.is-resolved .gh-thread__body{color:var(--gh-color-text-secondary)}
.gh-thread.is-resolved .gh-pin-badge{background:var(--gh-color-surface-4);color:var(--gh-color-text-primary)}
.gh-thread__replies{display:grid;gap:var(--gh-ref-space-150);padding-inline-start:var(--gh-ref-space-300);border-inline-start:2px solid var(--gh-color-border-default)}
.gh-thread__reply{font-size:var(--gh-type-label-sm-size);line-height:var(--gh-type-body-sm-line-height);color:var(--gh-color-text-secondary)}
.gh-thread__reply small{display:block;font-size:var(--gh-type-caption-size);color:var(--gh-color-text-tertiary)}
.gh-thread__reply small b{color:var(--gh-color-text-secondary);font-weight:var(--gh-ref-font-weight-semibold)}
.gh-thread__actions{display:flex;gap:var(--gh-ref-space-150);flex-wrap:wrap;align-items:center}
/* the inline reply box is its own framed box: space-200 from the action chips above it (§4b.5: two kinds stacked) */
.gh-thread>.gh-thread__actions+.gh-composer{margin-block-start:var(--gh-ref-space-50)}
.gh-thread__resolve[aria-pressed="true"]{color:var(--gh-color-status-success)}
.gh-thread[hidden]{display:none}
/* general (unnumbered) instructor summary at the top of a thread list */
.gh-thread--summary{background:var(--gh-color-surface-2);border-color:transparent}
.gh-thread--summary .gh-thread__body{color:var(--gh-color-text-secondary)}
/* compact list row (instructor tool: comment list linked to marks) */
.gh-thread--compact{flex-direction:row;align-items:flex-start;gap:var(--gh-ref-space-250);padding:var(--gh-ref-space-200) var(--gh-ref-space-250);cursor:pointer}
.gh-thread--compact .gh-thread__body{flex:1;min-width:0;font-size:var(--gh-type-label-sm-size)}
.gh-thread--compact:hover{border-color:var(--gh-color-border-strong)}


/* ===== components/count.css ===== */
/* ==========================================================================
   gh-count — «n of m» as squares (Group C, v0.2 C4)
   Consolidates: home .hm-dots (courses in a path, recommended row in accent), courses .cs-path__crs (courses of a path,
   the ones on this page highlighted). One cell per unit; counts up to ~12 (more → a number or gh-progress).
   Cells: plain = track (not counted), .is-on = counted (neutral mark), .is-hi = highlighted subset (accent, «you / this page»).
   gh-count--accent paints every .is-on cell as highlighted (a whole row the takeaway names).
   The element is role="img" with one summary label («۴ از ۶ دوره»), or aria-hidden next to a visible number.
   JS: GH.count(el, {n, of, hi:[indexes], label}) or GH.count.html(...) for templates; [data-gh-count="n/of"] auto-renders.
   ========================================================================== */
.gh-count{--gh-count-cell:.75rem;--gh-count-gap:3px;display:inline-flex;align-items:center;gap:var(--gh-count-gap);flex:none;vertical-align:middle}
.gh-count>i{display:block;flex:none;inline-size:var(--gh-count-cell);block-size:var(--gh-count-cell);border-radius:3px;background:var(--gh-color-data-track)}
.gh-count>i.is-on{background:var(--gh-color-data-mark)}
.gh-count>i.is-hi,.gh-count--accent>i.is-on{background:var(--gh-color-data-you)}
.gh-count--sm{--gh-count-cell:.5rem;--gh-count-gap:2px}
.gh-count--sm>i{border-radius:2px}
/* line: cells stretch to fill the row (a thin segmented strip under a card title) */
.gh-count--line{display:flex;inline-size:100%}
.gh-count--line>i{flex:1 1 0;min-inline-size:0;inline-size:auto;block-size:5px;border-radius:2px}
.gh-count--line>i.is-on{background:var(--gh-color-data-mark-strong)}
.gh-count--line>i.is-hi,.gh-count--line.gh-count--accent>i.is-on{background:var(--gh-color-data-you)}
@media (forced-colors:active){.gh-count>i{border:1px solid CanvasText}.gh-count>i.is-on,.gh-count>i.is-hi{background:CanvasText}}


/* ===== components/course-card.css ===== */
/* ==========================================================================
   gh-course-card — course in a grid or list, with quick preview (Group C)
   Consolidates: base .card (+ .feat cover/ply), courses .cgrid .card (+ list view, .qp quick preview, skeleton),
   course .related .card, dashboard .reco rows (→ gh-course-card--row).
   The title link is stretched over the card (one tab stop); the save toggle and preview actions sit above it.
   ========================================================================== */
.gh-course-card{position:relative;display:flex;flex-direction:column;min-width:0;background:var(--gh-color-surface-1);border:1px solid var(--gh-color-border-subtle);
  border-radius:var(--gh-radius-tile);transition:border-color var(--gh-motion-duration-base) var(--gh-motion-ease)}
.gh-course-card:hover{border-color:var(--gh-color-border-strong)}
.gh-course-card:has(.gh-course-card__link:focus-visible){outline:var(--gh-focus-width) solid var(--gh-color-focus-ring);outline-offset:var(--gh-focus-offset)}
.gh-course-card__cover{position:relative;aspect-ratio:16/10;overflow:hidden;background:var(--gh-color-surface-media);
  border-start-start-radius:calc(var(--gh-radius-tile) - 1px);border-start-end-radius:calc(var(--gh-radius-tile) - 1px)}
.gh-course-card__cover>svg,.gh-course-card__cover>img{inline-size:100%;block-size:100%;object-fit:cover;transition:transform var(--gh-ref-duration-slower) var(--gh-motion-ease)}
.gh-course-card:hover .gh-course-card__cover>svg,.gh-course-card:hover .gh-course-card__cover>img{transform:scale(1.03)}
.gh-course-card__badges{position:absolute;top:var(--gh-ref-space-300);inset-inline-start:var(--gh-ref-space-300);display:flex;gap:var(--gh-ref-space-100);flex-wrap:wrap;pointer-events:none}
.gh-course-card__duration{position:absolute;bottom:var(--gh-ref-space-250);inset-inline-end:var(--gh-ref-space-250);font-size:var(--gh-type-caption-size);font-weight:var(--gh-ref-font-weight-medium);
  background:var(--gh-color-bg-header);color:var(--gh-color-text-primary);padding-inline:var(--gh-ref-space-200);border-radius:var(--gh-radius-pill);line-height:1.8}
.gh-course-card__save{position:absolute;z-index:2;top:var(--gh-ref-space-250);inset-inline-end:var(--gh-ref-space-250);inline-size:2.25rem;block-size:2.25rem;border-radius:50%;display:grid;place-items:center;
  background:var(--gh-color-bg-header);color:var(--gh-color-text-primary)}
.gh-course-card__save:hover{background:var(--gh-color-surface-3)}
.gh-course-card__save[aria-pressed="true"]{background:var(--gh-color-accent-default);color:var(--gh-color-accent-on)}
.gh-course-card__save[aria-pressed="true"] .gh-icon{fill:currentColor}
.gh-course-card__play{position:absolute;inset:0;margin:auto;inline-size:4rem;block-size:4rem;border-radius:50%;display:grid;place-items:center;background:var(--gh-color-accent-default);color:var(--gh-color-accent-on);pointer-events:none}
.gh-course-card__body{display:flex;flex-direction:column;gap:var(--gh-ref-space-200);flex:1;padding:var(--gh-ref-space-400) var(--gh-ref-space-500) var(--gh-ref-space-500)}
.gh-course-card__meta{display:flex;align-items:center;flex-wrap:wrap;gap:var(--gh-ref-space-100);font-size:var(--gh-type-caption-size);color:var(--gh-color-text-tertiary);line-height:var(--gh-type-caption-line-height)}
.gh-course-card__meta .gh-icon{inline-size:.9rem;block-size:.9rem}
.gh-course-card__meta .gh-icon--star{fill:currentColor;stroke:none;color:var(--gh-color-text-primary)}
.gh-course-card__meta b{color:var(--gh-color-text-primary);font-weight:var(--gh-ref-font-weight-semibold)}
.gh-course-card__title{font-size:var(--gh-ref-font-size-500);font-weight:var(--gh-ref-font-weight-bold);line-height:1.5}
.gh-course-card__link::after{content:"";position:absolute;inset:0;z-index:1;border-radius:var(--gh-radius-tile)}
.gh-course-card__link:focus-visible{outline:none}
.gh-course-card__desc{display:none;font-size:var(--gh-type-body-sm-size);color:var(--gh-color-text-secondary);line-height:var(--gh-type-body-sm-line-height);max-inline-size:62ch}
.gh-course-card__by{display:flex;align-items:center;gap:var(--gh-ref-space-200);font-size:var(--gh-type-label-sm-size);color:var(--gh-color-text-secondary)}
/* the instructor byline as a link to the instructor page: above the card-wide title link (z-index 1) */
.gh-course-card__by-link{position:relative;z-index:2;display:inline-flex;align-items:center;gap:var(--gh-ref-space-200);min-block-size:1.75rem;border-radius:var(--gh-radius-control);color:inherit}
.gh-course-card__by-link:hover{color:var(--gh-color-text-primary);text-decoration:underline;text-underline-offset:.2em}
/* level: the standalone gh-level (level.css, group A) — v0.2 replaced the card's own __level bars */
.gh-course-card__meta>.gh-level{margin-inline-end:var(--gh-ref-space-100)}
/* gh-lint-ignore: §4b.2 gap to the price line = .gh-course-card__body gap (space-200), the auto margin only adds */
.gh-course-card__price{margin-block-start:auto;padding-block-start:var(--gh-ref-space-300);border-block-start:1px solid var(--gh-color-border-subtle);display:flex;align-items:center;justify-content:space-between;gap:var(--gh-ref-space-200);
  font-size:var(--gh-type-caption-size);color:var(--gh-color-text-tertiary)}
.gh-course-card .gh-progress{margin-block-start:var(--gh-ref-space-100)}

/* list variant: cover beside the body, description visible */
.gh-course-card--list{flex-direction:row}
.gh-course-card--list .gh-course-card__cover{inline-size:min(40%,19rem);flex:none;aspect-ratio:auto;min-block-size:12rem;
  border-start-end-radius:0;border-end-start-radius:calc(var(--gh-radius-tile) - 1px)}
.gh-course-card--list .gh-course-card__body{padding:var(--gh-ref-space-500) var(--gh-ref-space-600)}
.gh-course-card--list .gh-course-card__title{font-size:var(--gh-type-heading-3-size)}
.gh-course-card--list .gh-course-card__desc{display:block}
.gh-course-card--list .gh-course-card__peek{display:none!important}
@media (max-width:560px){
  .gh-course-card--list{flex-direction:column}
  .gh-course-card--list .gh-course-card__cover{inline-size:auto;min-block-size:0;aspect-ratio:16/10;border-start-end-radius:calc(var(--gh-radius-tile) - 1px);border-end-start-radius:0}
  .gh-course-card--list .gh-course-card__body{padding:var(--gh-ref-space-400) var(--gh-ref-space-500) var(--gh-ref-space-500)}
}

/* compact row (recommendations, «درس بعدی») */
.gh-course-card--row{flex-direction:row;align-items:center;gap:var(--gh-ref-space-300);padding:var(--gh-ref-space-200);border-radius:var(--gh-radius-inner)}
.gh-course-card--row .gh-course-card__cover{inline-size:3.5rem;block-size:3.5rem;aspect-ratio:1;flex:none;border-radius:var(--gh-ref-radius-sm)}
.gh-course-card--row .gh-course-card__body{padding:0;gap:0}
.gh-course-card--row .gh-course-card__title{font-size:var(--gh-type-label-size)}
.gh-course-card--row .gh-course-card__link::after{border-radius:var(--gh-radius-inner)}

/* loading */
.gh-course-card[aria-busy="true"]{pointer-events:none}
.gh-course-card[aria-busy="true"] .gh-course-card__cover>*{visibility:hidden}
.gh-course-card[aria-busy="true"] .gh-course-card__body>*{color:transparent;border-color:transparent}
.gh-course-card[aria-busy="true"] .gh-course-card__body>* *{visibility:hidden}
.gh-course-card[aria-busy="true"] .gh-course-card__cover,.gh-course-card[aria-busy="true"] .gh-course-card__body>*{background:var(--gh-color-surface-2);border-radius:var(--gh-radius-kbd);animation:gh-chart-pulse 1.4s var(--gh-motion-ease) infinite}
.gh-course-card[aria-busy="true"] .gh-course-card__body>*{min-block-size:.8rem}

/* quick preview — hover (after a delay) or focus inside the card; desktop pointer only. Flip with .is-flip */
.gh-course-card__peek{position:absolute;z-index:8;top:var(--gh-ref-space-500);inset-inline-start:calc(100% + var(--gh-ref-space-300));inline-size:20rem;max-inline-size:calc(100vw - 2rem);
  padding:var(--gh-ref-space-500);border-radius:var(--gh-radius-inner);background:var(--gh-color-surface-2);border:1px solid var(--gh-color-border-default);box-shadow:var(--gh-shadow-overlay-sm);
  display:none;flex-direction:column;gap:var(--gh-ref-space-200);font-size:var(--gh-type-body-sm-size);color:var(--gh-color-text-secondary);line-height:var(--gh-type-body-sm-line-height)}
.gh-course-card.is-flip .gh-course-card__peek{inset-inline-start:auto;inset-inline-end:calc(100% + var(--gh-ref-space-300))}
.gh-course-card__peek h4{font-size:var(--gh-type-heading-4-size);font-weight:var(--gh-ref-font-weight-bold);color:var(--gh-color-text-primary);line-height:1.5}
.gh-course-card__peek ul{display:grid;gap:var(--gh-ref-space-100)}
.gh-course-card__peek li{display:flex;gap:var(--gh-ref-space-200);align-items:flex-start}
.gh-course-card__peek li .gh-icon{color:var(--gh-color-accent-ink);margin-block-start:.3em}
.gh-course-card__peek-actions{display:flex;gap:var(--gh-ref-space-200);margin-block-start:var(--gh-ref-space-200)}
.gh-course-card__peek-actions>*{flex:1}
@media (hover:hover) and (min-width:861px){
  .gh-course-card:hover,.gh-course-card:focus-within,.gh-course-card.is-peek{z-index:5}
  .gh-course-card:hover .gh-course-card__peek,.gh-course-card:focus-within .gh-course-card__peek,.gh-course-card.is-peek .gh-course-card__peek{display:flex;animation:gh-peek-in var(--gh-motion-duration-base) var(--gh-ref-duration-slower) both}
  .gh-course-card.is-peek .gh-course-card__peek{animation-delay:0s}
}
@keyframes gh-peek-in{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}


/* ===== components/data-table.css ===== */
/* ==========================================================================
   Data table — hairline table; responsive: --stack turns rows into label/value cards ≤860px
   (each td carries data-label). Wide tables without --stack scroll inside .gh-table-wrap.
   Consolidates .tbl / .tbl.inv (settings: sessions, invoices) and the compare table pattern.
   ========================================================================== */
.gh-table-wrap{max-width:100%;overflow-x:auto;overscroll-behavior-x:contain}
.gh-table-wrap:focus-visible{outline-offset:-2px;border-radius:var(--gh-radius-inner)}
.gh-table{width:100%;border-collapse:collapse;font-size:var(--gh-type-body-sm-size);line-height:var(--gh-type-label-line-height);--gh-table-edge:var(--gh-tile-padding)}
.gh-table caption{padding-block-end:var(--gh-ref-space-200);text-align:start;font-weight:var(--gh-ref-font-weight-bold);font-size:var(--gh-type-label-size);color:var(--gh-color-text-primary)}
.gh-table th,.gh-table td{padding:var(--gh-ref-space-300) var(--gh-ref-space-400);border-block-end:1px solid var(--gh-color-border-subtle);text-align:start;vertical-align:middle}
.gh-table th{padding-block:var(--gh-ref-space-250);font-size:var(--gh-type-caption-size);font-weight:var(--gh-ref-font-weight-medium);color:var(--gh-color-text-tertiary);white-space:nowrap}
.gh-table td{color:var(--gh-color-text-secondary)}
.gh-table tr>:first-child{padding-inline-start:var(--gh-table-edge)}
.gh-table tr>:last-child{padding-inline-end:var(--gh-table-edge)}
.gh-table tbody tr:last-child>*{border-block-end:0}
.gh-table tbody tr:hover{background:var(--gh-color-surface-2)}
.gh-table--inset{--gh-table-edge:var(--gh-ref-space-200)}  /* table not edge-to-edge in a flush tile */
.gh-table--compact td{padding-block:var(--gh-ref-space-200)}
.gh-table__primary{color:var(--gh-color-text-primary);font-weight:var(--gh-ref-font-weight-semibold)}
.gh-table__num{color:var(--gh-color-text-primary);font-weight:var(--gh-ref-font-weight-semibold);white-space:nowrap}  /* no tabular-nums: Lahzeh FaNum spaces Persian digits apart */
.gh-table__code{direction:ltr;unicode-bidi:isolate;font-family:var(--gh-font-family-latin);color:var(--gh-color-text-primary);font-weight:var(--gh-ref-font-weight-medium)}
.gh-table__action{width:1%;text-align:end;white-space:nowrap}
.gh-table th[aria-sort]{cursor:default}
.gh-table__sort{display:inline-flex;align-items:center;gap:var(--gh-ref-space-100);color:inherit;font:inherit;border-radius:var(--gh-radius-control)}
.gh-table__sort:hover{color:var(--gh-color-text-primary)}
.gh-table th[aria-sort="ascending"] .gh-table__sort,.gh-table th[aria-sort="descending"] .gh-table__sort{color:var(--gh-color-text-primary)}
.gh-table th[aria-sort="descending"] .gh-table__sort .gh-icon{transform:rotate(180deg)}

/* ---- v0.3 (gap B2): table in a scrolling pane, keyboard-driven rows, selection, row as link ----
   --sticky     thead stays at the top of its scroll container (gh-tile--pane body); background = tile surface.
   tr[aria-current="true"]   active row (J/K / ↑↓): the same inline lime bar as gh-queue-row[aria-current].
   tr[aria-selected="true"]  selected row (bulk selection; the row checkbox carries the state for AT).
   __link       the row's primary link/button; its ::after stretches over the whole row (other controls stay above it). */
.gh-table--sticky thead th{position:sticky;top:0;z-index:2;background:var(--gh-table-head-bg,var(--gh-color-surface-1));box-shadow:inset 0 -1px 0 var(--gh-color-border-subtle)}
.gh-table tbody tr[aria-selected="true"]{background:var(--gh-color-surface-2)}
.gh-table tbody tr[aria-current="true"]>:first-child{box-shadow:inset calc(var(--gh-ref-space-50) * -1) 0 0 var(--gh-color-accent-ink)}
.gh-table tbody tr[tabindex]:focus-visible{outline:var(--gh-focus-width) solid var(--gh-color-focus-ring);outline-offset:-2px}
.gh-table tbody tr:has(.gh-table__link){position:relative}
.gh-table__link{color:inherit;font:inherit;text-align:start;border-radius:var(--gh-radius-control)}
.gh-table__link::after{content:"";position:absolute;inset:0;z-index:0}
.gh-table__link:focus-visible{outline:0}
.gh-table__link:focus-visible::after{outline:var(--gh-focus-width) solid var(--gh-color-focus-ring);outline-offset:-2px}
.gh-table tbody tr:has(.gh-table__link) :is(a,button,input,select,label,[tabindex]):not(.gh-table__link){position:relative;z-index:1}
.gh-table tbody tr:has(.gh-table__link):hover{cursor:pointer}

@media (max-width:860px){
  .gh-table--stack thead{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
  .gh-table--stack,.gh-table--stack tbody,.gh-table--stack tr{display:block}
  .gh-table--stack tr{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:var(--gh-ref-space-200) var(--gh-ref-space-300);padding:var(--gh-ref-space-300) var(--gh-table-edge);border-block-start:1px solid var(--gh-color-border-subtle)}
  .gh-table--stack tbody tr:first-child{border-block-start:0}
  .gh-table--stack tr>*{display:block;padding:0!important;border:0;min-width:0}
  .gh-table--stack td::before{content:attr(data-label);display:block;font-size:var(--gh-type-caption-size);color:var(--gh-color-text-tertiary)}
  .gh-table--stack :is(td,th).gh-table__primary{grid-column:1/-1;order:-1}
  .gh-table--stack td.gh-table__primary::before,.gh-table--stack td.gh-table__action::before{display:none}
  .gh-table--stack td.gh-table__action{width:auto;text-align:start;align-self:center}
  .gh-table--stack tbody tr:hover{background:none}
  .gh-table--stack tbody tr[aria-selected="true"]{background:var(--gh-color-surface-2)}
  .gh-table--stack.gh-table--sticky thead th{position:static}
  .gh-table--stack tbody tr[aria-current="true"]{box-shadow:inset calc(var(--gh-ref-space-50) * -1) 0 0 var(--gh-color-accent-ink)}
  .gh-table--stack tbody tr[aria-current="true"]>:first-child{box-shadow:none}
}
/* touch: the sort button keeps its look; only its hit area grows to 44px (no layout or spacing change) */
@media (pointer:coarse){.gh-table__sort{position:relative}.gh-table__sort::before{content:"";position:absolute;inset:min(0px,calc((100% - var(--gh-ref-size-touch-min)) / 2))}}


/* ===== components/datepicker.css ===== */
/* ==========================================================================
   @component datepicker — gh-datepicker (Solar Hijri date + Tehran time field with a month calendar) — v0.3
   OWNER RULE (1405-08-26): dates are شمسی and times are Asia/Tehran whatever the device is — so no native
   <input type=date|datetime-local|time> anywhere (they follow the device calendar, zone and digits).
   Markup (the app's <JalaliDateInput> renders exactly this; behaviour lives there, not in the GH runtime):
   <div class="gh-datepicker">
     <div class="gh-input-group gh-datepicker__date">
       <input class="gh-input-group__control" id="…" inputmode="numeric" placeholder="۱۴۰۵/۰۸/۲۶" aria-describedby="…">
       <button class="gh-icon-btn gh-icon-btn--sm" type="button" aria-haspopup="dialog" aria-expanded="false"
               aria-label="انتخاب از تقویم"><svg class="gh-icon"><use href="#i-cal"/></svg></button></div>
     <span class="gh-datepicker__time" role="group" aria-label="ساعت (به وقت تهران)">
       <span class="gh-select gh-select--sm"><select aria-label="ساعت">…</select></span><span aria-hidden="true">:</span>
       <span class="gh-select gh-select--sm"><select aria-label="دقیقه">…</select></span></span>
     <span class="gh-datepicker__zone">به وقت تهران</span>
     <div class="gh-popover gh-popover--start gh-datepicker__panel" role="dialog" aria-modal="true" aria-label="تقویم" hidden>
       <div class="gh-datepicker__head">
         <button class="gh-icon-btn gh-icon-btn--sm gh-datepicker__prev" aria-label="ماه قبل"><svg …#i-chev-l/></button>
         <span class="gh-datepicker__title" id="…" aria-live="polite">آبان ۱۴۰۵</span>
         <button class="gh-icon-btn gh-icon-btn--sm" aria-label="ماه بعد"><svg …#i-chev-l/></button></div>
       <table class="gh-datepicker__grid" role="grid" aria-labelledby="…">
         <thead><tr><th scope="col" abbr="شنبه">ش</th>… (Saturday first) …</tr></thead>
         <tbody><tr><td></td>…<td role="gridcell" aria-selected="false"><button class="gh-datepicker__day" type="button"
                 tabindex="-1" aria-current="date" aria-label="شنبه ۲۴ آبان ۱۴۰۵">۲۴</button></td>…</tr></tbody></table>
       <div class="gh-datepicker__foot"><button class="gh-btn gh-btn--ghost gh-btn--sm">امروز</button>…</div></div>
   </div>
   Modes: date + time (above); date only (no __time); time only (no __date, no panel).
   States: td[aria-selected="true"] = picked day (inverse fill, like a selected datestrip day); [aria-current="date"]
   = today in Tehran (accent hairline + bold — never colour alone; «امروز» is in its aria-label) ;
   [aria-disabled="true"] = out of range; the text control takes aria-invalid like any gh-input.
   Keyboard (grid, RTL): ←/→ = next / previous day (reading direction), ↑/↓ = ±7 days, Home/End = Saturday / Friday
   of the week, PageUp/PageDown = ±1 month, Shift+PageUp/PageDown = ±1 year, Enter/Space = pick, Esc = close and
   return focus to the calendar button. The text control accepts «۱۴۰۵/۸/۲۶» (Persian or Latin digits, / - .).
   ========================================================================== */
.gh-datepicker{position:relative;display:flex;flex-wrap:wrap;align-items:center;gap:var(--gh-ref-space-200);min-inline-size:0}
.gh-datepicker__date{flex:1 1 11rem;inline-size:auto}
.gh-datepicker__date .gh-icon-btn{margin-inline-end:var(--gh-ref-space-100)}
/* time reads «۱۸:۳۰» left-to-right like a clock */
.gh-datepicker__time{display:inline-flex;align-items:center;gap:var(--gh-ref-space-100);direction:ltr;color:var(--gh-color-text-secondary)}
.gh-datepicker__time .gh-select{inline-size:auto}
.gh-datepicker__time .gh-select>select{min-inline-size:4.25rem}
.gh-datepicker__zone{font-size:var(--gh-type-caption-size);color:var(--gh-color-text-tertiary);white-space:nowrap}

/* calendar panel (a gh-popover; the page or component owns [hidden]) */
.gh-datepicker__panel{inline-size:20rem;max-inline-size:calc(100vw - 2 * var(--gh-ref-space-400));padding:var(--gh-ref-space-300)}
.gh-datepicker__head{display:flex;align-items:center;justify-content:space-between;gap:var(--gh-ref-space-200);margin-block-end:var(--gh-ref-space-200)}
.gh-datepicker__title{font-size:var(--gh-type-label-size);font-weight:var(--gh-ref-font-weight-bold);color:var(--gh-color-text-primary)}
/* i-chev-l points to the next month in RTL; the previous-month button mirrors it */
.gh-datepicker__prev .gh-icon{transform:scaleX(-1)}
.gh-datepicker__grid{inline-size:100%;border-collapse:collapse;table-layout:fixed}
.gh-datepicker__grid th{padding-block:0 var(--gh-ref-space-100);font-size:var(--gh-type-caption-size);font-weight:var(--gh-ref-font-weight-medium);color:var(--gh-color-text-tertiary);text-align:center}
.gh-datepicker__grid td{padding:1px;text-align:center}
.gh-datepicker__day{display:grid;place-items:center;inline-size:100%;min-block-size:2.5rem;padding:0;margin:0;
  border:1px solid transparent;border-radius:var(--gh-radius-inner);background:transparent;color:var(--gh-color-text-primary);
  font-family:inherit;font-size:var(--gh-type-label-sm-size);cursor:pointer;-webkit-tap-highlight-color:transparent;
  transition:background-color var(--gh-motion-duration-base) var(--gh-motion-ease),border-color var(--gh-motion-duration-base) var(--gh-motion-ease)}
.gh-datepicker__day:hover{background:var(--gh-color-surface-3)}
.gh-datepicker__day:focus-visible{border-radius:var(--gh-radius-inner)}
.gh-datepicker__day[aria-current="date"]{border-color:var(--gh-color-accent-border);font-weight:var(--gh-ref-font-weight-bold)}
.gh-datepicker__grid td[aria-selected="true"] .gh-datepicker__day{background:var(--gh-color-surface-inverse);border-color:var(--gh-color-surface-inverse);color:var(--gh-color-text-inverse)}
.gh-datepicker__day[aria-disabled="true"]{color:var(--gh-color-text-disabled);background:transparent;cursor:not-allowed}
.gh-datepicker__foot{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:var(--gh-ref-space-200);margin-block-start:var(--gh-ref-space-200);
  padding-block-start:var(--gh-ref-space-200);border-block-start:1px solid var(--gh-color-border-subtle)}
.gh-datepicker__foot .gh-datepicker__zone{margin-inline-end:auto}


/* ===== components/datestrip.css ===== */
/* ==========================================================================
   @component datestrip — gh-datestrip (pick ONE day from a horizontal run of days) — v0.3, gap A1
   Replaces: live .lv-days / .lv-day (gh-chip stretched into a column + event dot + today hairline).
   Markup:
   <div class="gh-datestrip" role="radiogroup" aria-label="روز" data-gh-datestrip>
     <button class="gh-datestrip__item gh-datestrip__item--all" type="button" role="radio" aria-checked="true" data-value="all">همهٔ روزها</button>
     <button class="gh-datestrip__item gh-datestrip__item--event" type="button" role="radio" aria-checked="false"
             aria-current="date" data-value="1405-08-23" aria-label="امروز، شنبه ۲۳ آبان، ۱ جلسه">
       <span class="gh-datestrip__weekday">امروز</span><span class="gh-datestrip__date">۲۳</span></button>
     <button class="gh-datestrip__item" … aria-disabled="true">…</button>                 (day that cannot be picked)
   </div>
   States: aria-checked="true" = selected (inverse fill, like a pressed chip) · aria-current="date" = today (accent
   hairline; «امروز» as the weekday text — never colour alone) · --event = has events (dot under the date; the count
   is in aria-label) · aria-disabled="true" · hover · focus-visible ring.
   Layout: one row, scrolls horizontally inside itself (overscroll contained, snap to items, thin scrollbar); the
   selected / focused day is kept visible with GH.reveal (never scrollIntoView).
   JS (actions.js «datestrip»): radio pattern with roving tabindex — ←/→ follow the reading direction (RTL: ← = next
   day), Home/End, PageUp/PageDown = ±7 days; selection follows focus; click; emits gh:change {value, item} on the
   root. Items may be re-rendered by the page (observed); setting aria-checked from the page re-syncs tabindex.
   ========================================================================== */
.gh-datestrip{display:flex;gap:var(--gh-ref-space-150);min-inline-size:0;overflow-x:auto;overflow-y:hidden;overscroll-behavior-inline:contain;
  scroll-snap-type:inline proximity;scroll-padding-inline:var(--gh-ref-space-100);scrollbar-width:thin;scrollbar-color:var(--gh-color-surface-4) transparent;
  padding-block:var(--gh-ref-space-50) var(--gh-ref-space-200);padding-inline:var(--gh-ref-space-50)}
.gh-datestrip__item{position:relative;flex:none;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:0;
  min-inline-size:3rem;min-block-size:var(--gh-ref-size-touch-min);padding:var(--gh-ref-space-150) var(--gh-ref-space-200) var(--gh-ref-space-200);
  border:1px solid var(--gh-color-border-default);border-radius:var(--gh-radius-inner);background:transparent;
  color:var(--gh-color-text-secondary);font-family:inherit;line-height:1.3;white-space:nowrap;cursor:pointer;scroll-snap-align:start;
  -webkit-tap-highlight-color:transparent;
  transition:background-color var(--gh-motion-duration-base) var(--gh-motion-ease),border-color var(--gh-motion-duration-base) var(--gh-motion-ease),color var(--gh-motion-duration-base) var(--gh-motion-ease)}
.gh-datestrip__item:hover{border-color:var(--gh-color-border-strong);color:var(--gh-color-text-primary)}
.gh-datestrip__item:focus-visible{border-radius:var(--gh-radius-inner)}
.gh-datestrip__weekday{font-size:var(--gh-type-caption-size);color:var(--gh-color-text-tertiary)}
.gh-datestrip__date{font-size:var(--gh-type-label-size);font-weight:var(--gh-ref-font-weight-bold);color:var(--gh-color-text-primary)}
/* event dot (reserved on every item so all items share one height) */
.gh-datestrip__item::after{content:"";inline-size:.3125rem;block-size:.3125rem;margin-block-start:var(--gh-ref-space-50);border-radius:50%;background:transparent}
.gh-datestrip__item--event::after{background:var(--gh-color-accent-ink)}
/* «all days» / text-only item */
.gh-datestrip__item--all{padding-inline:var(--gh-ref-space-300);font-size:var(--gh-type-label-sm-size);font-weight:var(--gh-ref-font-weight-medium)}
.gh-datestrip__item--all::after{display:none}

/* today */
.gh-datestrip__item[aria-current="date"]{border-color:var(--gh-color-accent-border)}
.gh-datestrip__item[aria-current="date"] .gh-datestrip__weekday{color:var(--gh-color-text-primary);font-weight:var(--gh-ref-font-weight-semibold)}
/* selected — inverse surface, the strongest neutral (lime stays for primary action) */
.gh-datestrip__item[aria-checked="true"]{background:var(--gh-color-surface-inverse);border-color:var(--gh-color-surface-inverse);color:var(--gh-color-text-inverse)}
.gh-datestrip__item[aria-checked="true"] :is(.gh-datestrip__weekday,.gh-datestrip__date){color:inherit}
.gh-datestrip__item--event[aria-checked="true"]::after{background:currentColor}
/* disabled */
.gh-datestrip__item[aria-disabled="true"]{border-style:dashed;border-color:var(--gh-color-border-subtle);background:transparent;cursor:not-allowed}
.gh-datestrip__item[aria-disabled="true"] :is(.gh-datestrip__weekday,.gh-datestrip__date){color:var(--gh-color-text-disabled)}


/* ===== components/description-list.css ===== */
/* ==========================================================================
   Description list (dl) — label/value pairs. Three layouts, one markup (dl > div > dt + dd):
     default  rows with hairlines (profile «درباره», course facts)
     --grid   cells with label above value (checkout receipt, KPI-like facts)
     --sum    justified rows + total (cart summary, plan, instalments)
   Consolidates .facts (profile, course), .receipt, .rows/.tot (checkout, lesson), .plan-l (settings), .sumry.
   ========================================================================== */
.gh-dl{display:grid;margin:0;font-size:var(--gh-type-body-sm-size);line-height:var(--gh-type-label-line-height)}
.gh-dl>div{display:grid;grid-template-columns:minmax(96px,30%) minmax(0,1fr);align-items:baseline;gap:var(--gh-ref-space-300);padding-block:var(--gh-ref-space-300);border-block-start:1px solid var(--gh-color-border-subtle)}
.gh-dl dt{color:var(--gh-color-text-tertiary)}
.gh-dl dd{margin:0;min-width:0;color:var(--gh-color-text-primary);overflow-wrap:anywhere}
.gh-dl__ltr{direction:ltr;unicode-bidi:isolate;text-align:end;font-family:var(--gh-font-family-latin)}  /* Latin font keeps ASCII digits (FaNum would turn 58213 into ۵۸۲۱۳) */
[dir="rtl"] .gh-dl__ltr{text-align:end}

/* --grid: label over value, n columns of cells */
.gh-dl--grid{grid-template-columns:repeat(var(--gh-dl-cols,3),minmax(0,1fr));border:1px solid var(--gh-color-border-subtle);border-radius:var(--gh-radius-inner);overflow:hidden}
.gh-dl--grid>div{display:block;padding:var(--gh-ref-space-300) var(--gh-ref-space-400);border:0;box-shadow:inset 0 -1px 0 var(--gh-color-border-subtle),inset -1px 0 0 var(--gh-color-border-subtle)}
[dir="rtl"] .gh-dl--grid>div{box-shadow:inset 0 -1px 0 var(--gh-color-border-subtle),inset 1px 0 0 var(--gh-color-border-subtle)}
.gh-dl--grid dt{font-size:var(--gh-type-caption-size)}
.gh-dl--grid dd{margin-top:2px;font-size:var(--gh-type-body-size);font-weight:var(--gh-ref-font-weight-semibold)}
.gh-dl--grid dd.gh-dl__figure{font-size:var(--gh-type-figure-md-size);font-weight:var(--gh-ref-font-weight-thin);line-height:var(--gh-type-figure-md-line-height)}

/* --sum: label … value, with discount + total rows */
.gh-dl--sum{gap:var(--gh-ref-space-200);color:var(--gh-color-text-secondary)}
.gh-dl--sum>div{display:flex;justify-content:space-between;gap:var(--gh-ref-space-300);padding:0;border:0}
.gh-dl--sum dt{color:inherit;flex:1 1 auto;min-width:0}
.gh-dl--sum dd{flex:none;white-space:nowrap;text-align:end}
.gh-dl__row--discount dd{color:var(--gh-color-status-success)}
.gh-dl--sum .gh-dl__row--total{margin-top:var(--gh-ref-space-100);padding-top:var(--gh-ref-space-250);border-block-start:1px solid var(--gh-color-border-subtle);font-weight:var(--gh-ref-font-weight-semibold);color:var(--gh-color-text-primary)}

@media (max-width:560px){
  .gh-dl:not(.gh-dl--grid):not(.gh-dl--sum)>div{grid-template-columns:minmax(0,1fr);gap:2px}
  .gh-dl--grid{--gh-dl-cols:2}
}


/* ===== components/disclosure.css ===== */
/* ==========================================================================
   Disclosure — a block that is static on wide screens and collapses to a one-line bar below a breakpoint.
   v0.2 (gap B4). Replaces .ck-sum__toggle/__body/__head (checkout order summary).
   Markup (usually on a tile):
     <section class="gh-tile gh-disclosure" data-gh-disclosure="(max-width:1100px)">
       <button class="gh-disclosure__toggle" type="button" aria-expanded="false" aria-controls="b">
         icon + label <b class="gh-disclosure__value">…</b> <svg class="gh-icon gh-disclosure__chev">…</svg></button>
       <div class="gh-disclosure__body" id="b"> <header class="gh-tile__head gh-disclosure__head">…</header> … </div>
     </section>
   JS (structure.js) adds .is-collapsible while the media query matches (no ARIA state exists for «this
   can collapse»); open/closed lives in aria-expanded + [hidden] on the body. Without JS = always static.
   ========================================================================== */
.gh-disclosure__toggle{display:none}
.gh-disclosure.is-collapsible{padding:0}
.gh-disclosure.is-collapsible>.gh-disclosure__toggle{display:flex;align-items:center;gap:var(--gh-ref-space-200);inline-size:100%;min-block-size:var(--gh-ref-size-touch-min);
  padding:var(--gh-ref-space-300) var(--gh-ref-space-400);border-radius:inherit;text-align:start;
  font-weight:var(--gh-ref-font-weight-bold);color:var(--gh-color-text-primary)}
.gh-disclosure__toggle:hover{background:var(--gh-color-surface-3)}
.gh-disclosure__toggle:focus-visible{border-radius:inherit}
.gh-disclosure__value{margin-inline-start:auto;font-weight:var(--gh-ref-font-weight-bold);white-space:nowrap}
.gh-disclosure__chev{flex:none;transition:transform var(--gh-motion-duration-base) var(--gh-motion-ease)}
.gh-disclosure__toggle[aria-expanded="true"] .gh-disclosure__chev{transform:rotate(180deg)}
.gh-disclosure.is-collapsible>.gh-disclosure__body{padding:0 var(--gh-ref-space-400) var(--gh-ref-space-400)}
/* the static heading is replaced by the toggle while collapsible (it still labels the region) */
.gh-disclosure.is-collapsible .gh-disclosure__head{display:none}


/* ===== components/divider.css ===== */
/* ==========================================================================
   Divider — hairline (horizontal / vertical) and labelled divider («یا»).
   Consolidates .or (auth), .vr (learn-bar), .sep-v (filters), hr inside menus/panels.
   (Inline text separator stays .gh-sep in foundations — never «·».)
   ========================================================================== */
.gh-divider{height:0;margin-block:var(--gh-ref-space-400);border:0;border-block-start:1px solid var(--gh-color-border-subtle)}
.gh-divider--strong{border-block-start-color:var(--gh-color-border-default)}
.gh-divider--flush{margin-block:0}
.gh-divider--vertical{display:inline-block;align-self:center;width:0;height:22px;margin-block:0;margin-inline:var(--gh-ref-space-100);border-block-start:0;border-inline-start:1px solid var(--gh-color-border-default)}
.gh-divider--label{display:flex;align-items:center;gap:var(--gh-ref-space-300);height:auto;border:0;font-size:var(--gh-type-caption-size);color:var(--gh-color-text-tertiary)}
.gh-divider--label::before,.gh-divider--label::after{content:"";flex:1;height:1px;background:var(--gh-color-border-default)}


/* ===== components/dropzone.css ===== */
/* ==========================================================================
   @component dropzone — gh-dropzone (drag & drop + native file picker)
   Source: assignment .drop (+ .over), instructor/quiz upload targets. The native <input type="file"> covers the zone,
   so click, keyboard (Space/Enter) and screen readers work without JS; JS adds drag states and the file list.
   Markup: <label class="gh-dropzone" data-gh-dropzone data-gh-list="#files" data-max-mb="20">
             <input type="file" class="gh-dropzone__input" multiple accept="image/*,.pdf" aria-describedby="dz-hint">
             <span class="gh-dropzone__icon">…i-upload</span>
             <span class="gh-dropzone__title">فایل را اینجا رها کن یا <span class="gh-dropzone__browse">انتخاب کن</span></span>
             <span class="gh-dropzone__hint" id="dz-hint">…</span></label>
   States: :hover · .is-dragover · :focus-within ring · [aria-invalid="true"] on the input (rejected) · :disabled input.
   Size: --compact (one-line, inside forms / cards).
   ========================================================================== */
.gh-dropzone{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--gh-ref-space-150);text-align:center;
  padding:var(--gh-ref-space-700) var(--gh-ref-space-500);border-radius:var(--gh-radius-inner);border:1.5px dashed var(--gh-color-border-strong);background:var(--gh-color-surface-1);
  cursor:pointer;transition:border-color var(--gh-motion-duration-base) var(--gh-motion-ease),background-color var(--gh-motion-duration-base) var(--gh-motion-ease)}
.gh-dropzone:hover{border-color:var(--gh-color-text-tertiary);background:var(--gh-color-surface-2)}
.gh-dropzone:focus-within{outline:var(--gh-focus-width) solid var(--gh-color-focus-ring);outline-offset:var(--gh-focus-offset)}
.gh-dropzone__input{position:absolute;inset:0;inline-size:100%;block-size:100%;opacity:0;cursor:pointer}
.gh-dropzone__input::-webkit-file-upload-button{cursor:pointer}
.gh-dropzone__icon{inline-size:52px;block-size:52px;border-radius:16px;background:var(--gh-color-surface-3);color:var(--gh-color-text-secondary);display:grid;place-items:center;margin-block-end:var(--gh-ref-space-100);
  transition:background-color var(--gh-motion-duration-base) var(--gh-motion-ease),color var(--gh-motion-duration-base) var(--gh-motion-ease)}
.gh-dropzone__title{font-size:var(--gh-ref-font-size-400);font-weight:var(--gh-ref-font-weight-bold);line-height:1.6}
.gh-dropzone__browse{color:var(--gh-color-accent-ink)}
.gh-dropzone__hint{font-size:var(--gh-type-caption-size);color:var(--gh-color-text-tertiary);line-height:1.6}
.gh-dropzone__error{font-size:var(--gh-ref-font-size-75);font-weight:var(--gh-ref-font-weight-medium);color:var(--gh-color-status-danger)}
.gh-dropzone__error:empty{display:none}

.gh-dropzone.is-dragover{border-color:var(--gh-color-accent-ink);border-style:solid;background:var(--gh-color-accent-soft)}
.gh-dropzone.is-dragover .gh-dropzone__icon{background:var(--gh-color-accent-default);color:var(--gh-color-accent-on)}
.gh-dropzone:has(.gh-dropzone__input[aria-invalid="true"]){border-color:var(--gh-color-status-danger);background:var(--gh-color-status-danger-soft)}
.gh-dropzone:has(.gh-dropzone__input:disabled){opacity:.5;cursor:not-allowed}
.gh-dropzone:has(.gh-dropzone__input:disabled) .gh-dropzone__input{cursor:not-allowed}

.gh-dropzone--compact{flex-direction:row;justify-content:flex-start;text-align:start;gap:var(--gh-ref-space-300);padding:var(--gh-ref-space-300) var(--gh-ref-space-400)}
.gh-dropzone--compact .gh-dropzone__icon{inline-size:40px;block-size:40px;border-radius:12px;margin:0;flex:none}
.gh-dropzone--compact .gh-dropzone__title{font-size:var(--gh-ref-font-size-200)}
.gh-dropzone__text{display:flex;flex-direction:column;min-inline-size:0}


/* ===== components/empty-state.css ===== */
/* ==========================================================================
   Empty state — icon (or illustration) + title + one line + recovery actions (+ suggestions).
   Consolidates .empty-s (auth/profile/settings, lesson, assignment), .empty-st (instructor, review),
   .empty-state (courses, with illustration + alternatives).
   ========================================================================== */
.gh-empty{display:flex;flex-direction:column;align-items:center;gap:var(--gh-ref-space-200);padding:var(--gh-ref-space-1200) var(--gh-ref-space-600);text-align:center;color:var(--gh-color-text-secondary)}
.gh-empty__icon{display:grid;place-items:center;width:56px;height:56px;margin-bottom:var(--gh-ref-space-150);border-radius:var(--gh-radius-inner);
  background:var(--gh-color-surface-2);border:1px dashed var(--gh-color-border-strong);color:var(--gh-color-text-tertiary)}
.gh-empty__icon--accent{border-style:solid;border-color:var(--gh-color-border-subtle);color:var(--gh-color-accent-ink)}
.gh-empty__art{width:180px;max-width:100%;height:120px;margin-bottom:var(--gh-ref-space-300)}
.gh-empty__title{font-size:var(--gh-type-body-lg-size);font-weight:var(--gh-ref-font-weight-bold);line-height:var(--gh-type-heading-4-line-height);color:var(--gh-color-text-primary)}
.gh-empty__text{max-width:44ch;font-size:var(--gh-type-body-sm-size);line-height:var(--gh-type-body-sm-line-height)}
.gh-empty__actions{display:flex;flex-wrap:wrap;justify-content:center;gap:var(--gh-ref-space-200);margin-top:var(--gh-ref-space-300)}
.gh-empty__alt{width:min(520px,100%);margin-top:var(--gh-ref-space-600);padding-top:var(--gh-ref-space-400);border-block-start:1px solid var(--gh-color-border-subtle)}
.gh-empty__alt-label{margin-bottom:var(--gh-ref-space-200);font-size:var(--gh-type-caption-size);color:var(--gh-color-text-tertiary)}
.gh-empty__alt-row{display:flex;flex-wrap:wrap;justify-content:center;gap:var(--gh-ref-space-150)}
/* inside panels / lists */
.gh-empty--sm{padding:var(--gh-ref-space-700) var(--gh-ref-space-400);gap:var(--gh-ref-space-150)}
.gh-empty--sm .gh-empty__icon{width:48px;height:48px}
.gh-empty--sm .gh-empty__title{font-size:var(--gh-type-body-size)}
/* page-level (no results in the catalogue) */
.gh-empty--lg .gh-empty__title{font-size:var(--gh-type-heading-2-size);font-weight:var(--gh-ref-font-weight-extrabold)}
.gh-empty--lg .gh-empty__text{font-size:var(--gh-type-body-size);line-height:var(--gh-type-body-line-height)}


/* ===== components/feedback-canvas.css ===== */
/* ==========================================================================
   gh-canvas — instructor feedback on artwork: numbered pins, box & arrow marks, compare slider (Group C)
   Consolidates: assignment .canvas .pin .area, course .fbw .pinm, review .abox + .stage + .cv-hint,
   base .vcmp (home, assignment, profile .pm-stage), review .vthumbs.
   Coordinates are artwork percentages (--gh-x, --gh-y from the left/top of the image), so the stage is LTR:
   artwork is never mirrored. Pin: aria-pressed = selected, .is-resolved = thread resolved.
   ========================================================================== */
.gh-canvas{display:flex;flex-direction:column;gap:var(--gh-ref-space-250);min-width:0}
.gh-canvas__stage{position:relative;direction:ltr;aspect-ratio:var(--gh-ar,1);overflow:hidden;border-radius:var(--gh-radius-inner);background:var(--gh-color-surface-media)}
.gh-canvas__stage>svg:first-child,.gh-canvas__stage>img:first-child{inline-size:100%;block-size:100%;object-fit:contain}
.gh-canvas.is-adding .gh-canvas__stage{cursor:crosshair}
.gh-canvas.is-hidden-marks :is(.gh-pin,.gh-mark){display:none}
.gh-canvas__hint{position:absolute;z-index:4;bottom:var(--gh-ref-space-300);inset-inline:0;margin-inline:auto;inline-size:max-content;max-inline-size:90%;direction:rtl;
  display:flex;gap:var(--gh-ref-space-150);align-items:center;padding:var(--gh-ref-space-100) var(--gh-ref-space-300);border-radius:var(--gh-radius-pill);
  background:var(--gh-color-bg-header);border:1px solid var(--gh-color-border-default);font-size:var(--gh-type-caption-size);color:var(--gh-color-text-secondary);pointer-events:none}
.gh-canvas__tools{display:flex;align-items:center;gap:var(--gh-ref-space-200);flex-wrap:wrap}
.gh-canvas__tools>.gh-push,.gh-canvas__tools>:last-child:not(:first-child){margin-inline-start:auto}

/* numbered pin */
.gh-pin{position:absolute;z-index:2;top:calc(var(--gh-y) * 1%);inset-inline-start:calc(var(--gh-x) * 1%);inline-size:1.875rem;block-size:1.875rem;margin-block-start:-.9375rem;margin-inline-start:-.9375rem;
  border-radius:50%;display:grid;place-items:center;padding:0;background:var(--gh-color-feedback-pin);color:var(--gh-color-feedback-on-pin);
  font-size:var(--gh-type-label-sm-size);font-weight:var(--gh-ref-font-weight-extrabold);line-height:1;border:2.5px solid var(--gh-color-text-primary);box-shadow:var(--gh-shadow-overlay-sm);
  transition:transform var(--gh-motion-duration-base) var(--gh-motion-ease)}
.gh-pin::before{content:"";position:absolute;inset:-7px;border-radius:50%}
.gh-pin:hover{transform:scale(1.12)}
.gh-pin.is-resolved{background:var(--gh-color-feedback-pin-resolved);color:var(--gh-color-text-primary)}
.gh-pin[aria-pressed="true"]{outline:3px solid var(--gh-color-focus-ring);outline-offset:2px;border-radius:50%;z-index:3}
.gh-pin:focus-visible{border-radius:50%}
.gh-pin--sm{inline-size:1.5rem;block-size:1.5rem;margin-block-start:-.75rem;margin-inline-start:-.75rem;font-size:var(--gh-type-caption-size);border-width:2px}
/* static number badge (thread head, lists) — same visual, no position */
.gh-pin-badge{inline-size:1.5rem;block-size:1.5rem;flex:none;border-radius:50%;display:inline-grid;place-items:center;background:var(--gh-color-feedback-pin);color:var(--gh-color-feedback-on-pin);
  font-size:var(--gh-type-caption-size);font-weight:var(--gh-ref-font-weight-extrabold);line-height:1}
.gh-pin-badge.is-resolved{background:var(--gh-color-feedback-pin-resolved);color:var(--gh-color-text-primary)}

/* marks: box (rect), area (ellipse), arrow (svg line) */
.gh-mark{position:absolute;z-index:1;pointer-events:none;top:calc(var(--gh-y) * 1%);inset-inline-start:calc(var(--gh-x) * 1%);inline-size:calc(var(--gh-w) * 1%);block-size:calc(var(--gh-h) * 1%);
  border:2px solid var(--gh-color-feedback-pin);border-radius:4px;transition:border-color var(--gh-motion-duration-base),opacity var(--gh-motion-duration-base)}
.gh-mark--area{border-style:dashed;border-radius:50%}
.gh-mark.is-selected{border-color:var(--gh-color-accent-ink);box-shadow:0 0 0 2px var(--gh-color-bg-canvas)}
.gh-mark.is-resolved{border-color:var(--gh-color-text-tertiary)}
.gh-mark.is-draft{border-style:dashed}
.gh-mark--arrow{inset:0;inline-size:100%;block-size:100%;border:0;border-radius:0;overflow:visible}
.gh-mark--arrow line,.gh-mark--arrow path{stroke:var(--gh-color-feedback-pin);stroke-width:3;stroke-linecap:round;fill:none;vector-effect:non-scaling-stroke}
.gh-mark--arrow .gh-mark__head{fill:var(--gh-color-feedback-pin);stroke:none}
.gh-mark--arrow.is-selected line,.gh-mark--arrow.is-selected path{stroke:var(--gh-color-accent-ink)}
.gh-mark--arrow.is-selected .gh-mark__head{fill:var(--gh-color-accent-ink)}

/* drawing tools (v0.2 C7): [data-gh-canvas-tool="cursor|pin|box|arrow"] buttons (aria-pressed) switch data-tool on the canvas.
   Drafts (pointer drag or keyboard) are .is-draft until committed; the stage keeps focus while a keyboard draft is moved. */
.gh-mark--arrow.is-draft line{stroke-dasharray:6 5}
.gh-mark.is-draft{border-color:var(--gh-color-accent-ink)}
.gh-mark--arrow.is-draft line,.gh-mark--arrow.is-draft path{stroke:var(--gh-color-accent-ink)}
.gh-mark--arrow.is-draft .gh-mark__head{fill:var(--gh-color-accent-ink)}
.gh-canvas[data-tool="cursor"] .gh-canvas__stage{cursor:default}
.gh-canvas.is-adding .gh-canvas__stage{touch-action:none}
.gh-canvas__stage:focus-visible{outline-offset:calc(-1 * var(--gh-focus-width))}

/* compare slider (v1 / v2): native range on top for keyboard + pointer */
.gh-compare{--gh-split:50%;position:relative;direction:ltr;aspect-ratio:var(--gh-ar,1);overflow:hidden;border-radius:var(--gh-radius-inner);background:var(--gh-color-surface-media);user-select:none;-webkit-user-select:none}
.gh-compare__layer{position:absolute;inset:0}
.gh-compare__layer>svg,.gh-compare__layer>img{inline-size:100%;block-size:100%;object-fit:cover}
.gh-compare__layer--after{clip-path:inset(0 calc(100% - var(--gh-split)) 0 0)}
.gh-compare__handle{position:absolute;top:0;bottom:0;inset-inline-start:var(--gh-split);inline-size:2px;margin-inline-start:-1px;background:var(--gh-color-accent-default);pointer-events:none}
.gh-compare__handle::after{content:"";position:absolute;top:50%;inset-inline-start:50%;inline-size:2rem;block-size:2rem;margin:-1rem 0 0 -1rem;border-radius:50%;background:var(--gh-color-accent-default);box-shadow:0 0 0 3px var(--gh-color-bg-canvas)}
.gh-compare__grip{position:absolute;z-index:1;top:50%;inset-inline-start:var(--gh-split);inline-size:1.125rem;block-size:1.125rem;margin:-.5625rem 0 0 -.5625rem;color:var(--gh-color-accent-on);pointer-events:none}
.gh-compare__label{position:absolute;z-index:1;top:var(--gh-ref-space-250);padding:var(--gh-ref-space-50) var(--gh-ref-space-250);border-radius:var(--gh-radius-pill);background:var(--gh-color-bg-header);
  font-size:var(--gh-type-caption-size);font-weight:var(--gh-ref-font-weight-bold);color:var(--gh-color-text-primary);pointer-events:none;unicode-bidi:isolate}
.gh-compare__label--after{inset-inline-start:var(--gh-ref-space-250)}
.gh-compare__label--before{inset-inline-end:var(--gh-ref-space-250)}
.gh-compare__input{position:absolute;inset:0;inline-size:100%;block-size:100%;margin:0;opacity:0;cursor:ew-resize}
.gh-compare:has(.gh-compare__input:focus-visible){outline:var(--gh-focus-width) solid var(--gh-color-focus-ring);outline-offset:var(--gh-focus-offset)}
.gh-compare .gh-pin,.gh-compare .gh-mark{opacity:.35;pointer-events:none}

/* version thumbnails (v1 / v2 / v3) */
.gh-versions{display:flex;gap:var(--gh-ref-space-150)}
.gh-versions>button{position:relative;inline-size:2.75rem;block-size:2.75rem;border-radius:var(--gh-ref-radius-sm);overflow:hidden;border:2px solid transparent;padding:0;background:var(--gh-color-surface-media)}
.gh-versions>button svg{inline-size:100%;block-size:100%}
.gh-versions>button span{position:absolute;bottom:2px;inset-inline-start:2px;font-size:var(--gh-ref-font-size-50);font-weight:var(--gh-ref-font-weight-extrabold);background:var(--gh-color-bg-header);color:var(--gh-color-text-primary);border-radius:4px;padding-inline:4px;line-height:1.5}
.gh-versions>button[aria-pressed="true"]{border-color:var(--gh-color-accent-ink)}


/* ===== components/field.css ===== */
/* ==========================================================================
   @component field — gh-field (label · optional mark · control · help · error/success message · counter)
   Consolidates: auth/profile/settings .fld (.lb/.help/.msg, .is-err/.is-ok), checkout/course/courses .field (.hint,
   .is-disabled), assignment .note-field (label + counter), lesson/quiz/instructor/review textarea fields.
   Validation is driven by the CONTROL: aria-invalid="true" + aria-describedby="<message id>". The field reacts with :has().
   Success: add .is-valid to the field (no ARIA equivalent). Disabled: the control's :disabled.
   Markup:
   <div class="gh-field">
     <label class="gh-field__label" for="x">نام <span class="gh-field__optional">(اختیاری)</span>
       <span class="gh-field__aside" id="x-count">۰ / ۲۰۰</span></label>
     <input class="gh-input" id="x" aria-describedby="x-help x-msg">
     <p class="gh-field__help" id="x-help">…</p>
     <p class="gh-field__message" id="x-msg" role="alert"><svg class="gh-icon gh-icon--sm">…</svg>…</p>
   </div>
   ========================================================================== */
.gh-field{display:flex;flex-direction:column;gap:var(--gh-ref-space-150);min-inline-size:0;border:0;margin:0;padding:0}
.gh-field__label{display:flex;align-items:center;flex-wrap:wrap;gap:var(--gh-ref-space-150);font-size:var(--gh-ref-font-size-200);font-weight:var(--gh-ref-font-weight-semibold);
  line-height:1.5;color:var(--gh-color-text-primary);padding:0}
.gh-field__optional{font-weight:var(--gh-ref-font-weight-regular);font-size:var(--gh-type-caption-size);color:var(--gh-color-text-tertiary)}
.gh-field__aside{margin-inline-start:auto;font-weight:var(--gh-ref-font-weight-regular);font-size:var(--gh-type-caption-size);color:var(--gh-color-text-tertiary)}
.gh-field__aside a{color:var(--gh-color-text-secondary);text-decoration:underline;text-underline-offset:3px}
.gh-field__help{font-size:var(--gh-type-caption-size);line-height:1.65;color:var(--gh-color-text-tertiary)}
.gh-field__message{display:flex;align-items:flex-start;gap:var(--gh-ref-space-150);font-size:var(--gh-ref-font-size-75);font-weight:var(--gh-ref-font-weight-medium);line-height:1.6;color:var(--gh-color-status-danger)}
.gh-field__message:empty{display:none}
.gh-field__message .gh-icon{margin-block-start:2px}
.gh-field.is-valid .gh-field__message{color:var(--gh-color-status-success)}
.gh-field__counter{white-space:nowrap}
.gh-field__counter.is-near{color:var(--gh-color-status-warning)}
.gh-field__counter.is-over{color:var(--gh-color-status-danger);font-weight:var(--gh-ref-font-weight-semibold)}
/* disabled field: label dims with the control */
/* greyed only when the field is really inactive: a disabled helper inside an active field (date picker, sku row) keeps the label readable */
.gh-field:has(:disabled:not(button)):not(:has(:is(input,select,textarea):enabled:not([type="hidden"]))) .gh-field__label{color:var(--gh-color-text-disabled)}
/* grouping rows of fields */
.gh-field-row{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,200px),1fr));gap:var(--gh-ref-space-400)}
.gh-form{display:flex;flex-direction:column;gap:var(--gh-ref-space-500)}
legend.gh-field__label{margin-block-end:var(--gh-ref-space-150)}


/* ===== components/file-row.css ===== */
/* ==========================================================================
   @component file-row — gh-file-row (download / upload item: type · name · meta · progress · actions)
   Consolidates: lesson .frow (+ .ft type badge, .fi, .bar, .dl) and assignment .frow (.thumb, .err, .ok, .pct, .acts).
   Decision: the type badge is neutral (per-type hues were raw hex and read as status) — the extension is the label.
   Markup: <li class="gh-file-row" [aria-busy="true"|.is-error|.is-done]>
             <span class="gh-file-row__type">PDF</span> | <span class="gh-file-row__thumb"><img alt=""></span>
             <div class="gh-file-row__body"><b class="gh-file-row__name">…</b><span class="gh-file-row__meta">۲٫۴ مگابایت</span>
               <div class="gh-file-row__bar" role="progressbar" aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" aria-label="…"><i style="--value:40%"></i></div></div>
             <div class="gh-file-row__actions">…icon-buttons…</div></li>
   States: aria-busy="true" (uploading — bar visible) · .is-error (message + retry) · .is-done (success check).
   Whole row as a link / button (resources, «open lesson», «download brief») — v0.2, gap A7:
     <li><a class="gh-file-row" href="…"> | <button class="gh-file-row" type="button"> … </a></li>
   The row takes the full width, keeps start alignment, gets a hover border + focus ring; __type may hold an icon
   instead of an extension; __actions holds a decorative icon only (no nested buttons inside a link/button row).
   ========================================================================== */
.gh-file-list{display:grid;gap:var(--gh-ref-space-200)}
.gh-file-row{position:relative;display:flex;align-items:center;gap:var(--gh-ref-space-300);min-inline-size:0;padding:var(--gh-ref-space-250);
  border-radius:var(--gh-ref-space-300);border:1px solid var(--gh-color-border-subtle);background:transparent;
  transition:background-color var(--gh-motion-duration-base) var(--gh-motion-ease),border-color var(--gh-motion-duration-base) var(--gh-motion-ease)}
.gh-file-row:hover{background:var(--gh-color-surface-2)}
.gh-file-row__type{position:relative;inline-size:40px;block-size:44px;flex:none;border-radius:9px;background:var(--gh-color-surface-3);display:grid;place-items:center;overflow:hidden;
  font-family:var(--gh-font-family-latin);font-size:var(--gh-ref-font-size-50);font-weight:var(--gh-ref-font-weight-extrabold);color:var(--gh-color-text-secondary);direction:ltr;text-transform:uppercase}
.gh-file-row__type::before{content:"";position:absolute;inset-block-start:0;inset-inline-end:0;inline-size:10px;block-size:10px;border-end-start-radius:4px;background:var(--gh-color-surface-4)}
.gh-file-row__thumb{inline-size:44px;block-size:44px;flex:none;border-radius:9px;overflow:hidden;background:var(--gh-color-surface-media)}
.gh-file-row__thumb>img,.gh-file-row__thumb>svg{inline-size:100%;block-size:100%;object-fit:cover}
.gh-file-row__body{flex:1;min-inline-size:0;display:flex;flex-direction:column}
.gh-file-row__name{font-size:var(--gh-ref-font-size-200);font-weight:var(--gh-ref-font-weight-semibold);line-height:1.5;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;unicode-bidi:plaintext;text-align:start}
.gh-file-row__meta{display:flex;align-items:center;flex-wrap:wrap;font-size:var(--gh-type-caption-size);color:var(--gh-color-text-tertiary);line-height:1.6}
.gh-file-row__bar{display:none;block-size:4px;margin-block-start:var(--gh-ref-space-150);border-radius:var(--gh-radius-pill);background:var(--gh-color-surface-4);overflow:hidden}
.gh-file-row__bar>i{display:block;block-size:100%;inline-size:var(--value,0%);background:var(--gh-color-data-you);border-radius:inherit;transition:inline-size var(--gh-motion-duration-slow) var(--gh-motion-ease)}
.gh-file-row__actions{display:flex;align-items:center;gap:var(--gh-ref-space-100);flex:none}
.gh-file-row__pct{min-inline-size:36px;text-align:center;font-size:var(--gh-type-caption-size);color:var(--gh-color-text-secondary)}
.gh-file-row__status{display:none;color:var(--gh-color-status-success)}

/* row as link / button */
a.gh-file-row,button.gh-file-row{inline-size:100%;margin:0;font:inherit;color:inherit;text-align:start;text-decoration:none;cursor:pointer;-webkit-tap-highlight-color:transparent}
a.gh-file-row:hover,button.gh-file-row:hover{border-color:var(--gh-color-border-strong)}
a.gh-file-row:focus-visible,button.gh-file-row:focus-visible{border-radius:var(--gh-ref-space-300)}
:is(a,button).gh-file-row .gh-file-row__actions{color:var(--gh-color-text-tertiary)}
:is(a,button).gh-file-row:hover .gh-file-row__actions{color:var(--gh-color-text-primary)}
.gh-file-row__type>.gh-icon{color:var(--gh-color-text-secondary)}

.gh-file-row[aria-busy="true"] .gh-file-row__bar{display:block}
.gh-file-row.is-error{border-color:var(--gh-color-status-danger-border);background:var(--gh-color-status-danger-soft)}
.gh-file-row.is-error .gh-file-row__meta{color:var(--gh-color-status-danger)}
.gh-file-row.is-done .gh-file-row__status{display:inline-flex}


/* ===== components/focus-bar.css ===== */
/* ==========================================================================
   Focus bar — slim top bar for focused learning screens (lesson, quiz).
   Consolidates the two identical .lbar copies (lesson.css, quiz.css): mark, course + progress,
   centre slot (prev/next or step-dots + timer), end tools.
   ========================================================================== */
.gh-focus-bar{position:sticky;top:0;z-index:var(--gh-ref-z-sticky);display:flex;align-items:center;gap:var(--gh-ref-space-250);height:var(--gh-layout-focusbar-height);padding-inline:var(--gh-ref-space-500);
  background:var(--gh-color-bg-header);-webkit-backdrop-filter:blur(14px);backdrop-filter:blur(14px);border-block-end:1px solid var(--gh-color-border-subtle)}
.gh-focus-bar__context{display:flex;flex-direction:column;min-width:0;line-height:var(--gh-type-label-line-height)}
.gh-focus-bar__title{font-size:var(--gh-type-label-size);font-weight:var(--gh-ref-font-weight-semibold);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border-radius:var(--gh-radius-control)}
a.gh-focus-bar__title:hover{color:var(--gh-color-accent-ink)}
.gh-focus-bar__progress{display:flex;align-items:center;gap:var(--gh-ref-space-200);overflow:hidden;font-size:var(--gh-type-caption-size);color:var(--gh-color-text-tertiary);white-space:nowrap}
/* course progress = gh-progress gh-progress--sm (progress.css), fixed width here */
.gh-focus-bar__progress>.gh-progress{width:120px;min-width:0;flex:none}
.gh-focus-bar__center{margin-inline:auto;display:flex;align-items:center;gap:var(--gh-ref-space-150);min-width:0}
.gh-focus-bar__end{display:flex;align-items:center;gap:var(--gh-ref-space-150);flex:none}
.gh-focus-bar__divider{width:1px;height:22px;margin-inline:2px;background:var(--gh-color-border-default);flex:none}
@media (max-width:860px){
  .gh-focus-bar{height:56px;gap:var(--gh-ref-space-100);padding-inline:var(--gh-ref-space-200) var(--gh-ref-space-300)}
  .gh-focus-bar>.gh-wordmark,.gh-focus-bar__divider{display:none}
  .gh-focus-bar__context{flex:1}
  .gh-focus-bar__progress>.gh-progress{width:64px}
  .gh-focus-bar__center{margin-inline:0}
}


/* ===== components/highlight.css ===== */
/* ==========================================================================
   @component highlight — <mark class="gh-highlight"> (search match in results) + GH.highlight() — v0.3, gap A4
   Replaces: magazine .mg-hl; the combobox's bare <mark>. (Named gh-highlight, not gh-mark: .gh-mark is the
   feedback-canvas box/arrow mark, absolutely positioned — group C.)
   Markup (always produced by JS, never typed by hand):
     el.innerHTML = GH.highlight(text, query)         → escaped text with <mark class="gh-highlight">…</mark> per match
     GH.match(text, query)                            → true when every word of the query is in the text
     GH.normalize(s)                                  → the folded string both use
   Persian folding (both sides): ي/ى → ی · ك → ک · ة/ۀ → ه · أ/إ/ٱ → ا · ؤ → و · ZWNJ/ZWJ → space · runs of spaces → one ·
   ۰–۹ / ٠–٩ → 0–9 · harakat + tatweel removed · lower case. The mark wraps the ORIGINAL characters (with their
   diacritics), so «ي» in the query marks «ی» in the text and vice versa.
   Look: in body text → soft accent fill + primary text (reads on every surface, colour is not the only cue: the fill
   shape marks the span); inside a listbox / menu row → accent text, no fill (the active row already has a fill).
   Screen readers: <mark> is announced as «highlighted» by some readers; the result COUNT is the main feedback
   (announce it in a polite live region on the page).
   ========================================================================== */
.gh-highlight{padding-inline:.0625rem;border-radius:var(--gh-radius-kbd);background:var(--gh-color-accent-soft);color:var(--gh-color-text-primary);
  -webkit-box-decoration-break:clone;box-decoration-break:clone}
:is(.gh-option,.gh-search__option,.gh-menu__item,.gh-cmdk__item) :is(.gh-highlight,mark){padding:0;background:none;color:var(--gh-color-accent-ink);font-weight:var(--gh-ref-font-weight-bold)}
@media (forced-colors:active){.gh-highlight{background:Mark;color:MarkText}}


/* ===== components/icon-button.css ===== */
/* ==========================================================================
   @component icon-button — gh-icon-btn (+ badge)
   Consolidates: base .ibtn (+ .dot), quiz/lesson .ibtn[aria-pressed], cv-bar/note .ibtn size overrides,
   video .vb buttons. Always needs aria-label (and usually data-gh-tip for a visible name).
   Sizes: --sm (30) · md (36, default) · --lg (44). Variants: --filled (surface + hairline), --round (circle).
   States: :hover, [aria-pressed="true"], [aria-expanded="true"], :disabled.
   Badge: .gh-icon-btn__badge (count) / .gh-icon-btn__badge--dot (unread dot).
   ========================================================================== */
.gh-icon-btn{--_s:36px;position:relative;display:inline-grid;place-items:center;flex:none;inline-size:var(--_s);block-size:var(--_s);padding:0;
  border-radius:var(--gh-radius-control);border:1px solid transparent;background:transparent;color:var(--gh-color-text-secondary);cursor:pointer;
  -webkit-tap-highlight-color:transparent;
  transition:background-color var(--gh-motion-duration-base) var(--gh-motion-ease),color var(--gh-motion-duration-base) var(--gh-motion-ease)}
.gh-icon-btn:hover{background:var(--gh-color-surface-2);color:var(--gh-color-text-primary)}
.gh-icon-btn:focus-visible{border-radius:var(--gh-radius-control)}
.gh-icon-btn--sm{--_s:30px}
.gh-icon-btn--lg{--_s:var(--gh-ref-size-control-md)}
.gh-icon-btn--filled{background:var(--gh-color-surface-2);border-color:var(--gh-color-border-default);color:var(--gh-color-text-primary)}
.gh-icon-btn--filled:hover{background:var(--gh-color-surface-3)}
.gh-icon-btn--round,.gh-icon-btn--round:focus-visible{border-radius:var(--gh-radius-pill)}
.gh-icon-btn[aria-pressed="true"]{background:var(--gh-color-accent-soft);color:var(--gh-color-accent-ink)}
.gh-icon-btn[aria-expanded="true"]{background:var(--gh-color-surface-3);color:var(--gh-color-text-primary)}
.gh-icon-btn:disabled,.gh-icon-btn[aria-disabled="true"]{color:var(--gh-color-text-disabled);background:transparent;cursor:not-allowed}

.gh-icon-btn__badge{position:absolute;inset-block-start:-3px;inset-inline-end:-3px;min-inline-size:16px;block-size:16px;padding-inline:3px;
  border-radius:var(--gh-radius-pill);background:var(--gh-color-accent-default);color:var(--gh-color-accent-on);
  font-size:var(--gh-ref-font-size-50);font-weight:var(--gh-ref-font-weight-extrabold);line-height:1;display:grid;place-items:center;
  box-shadow:0 0 0 2px var(--gh-color-bg-canvas);pointer-events:none}
.gh-icon-btn__badge--dot{min-inline-size:8px;block-size:8px;padding:0;inset-block-start:5px;inset-inline-end:5px}

@media (pointer:coarse){
  .gh-icon-btn::before{content:"";position:absolute;inset:min(0px,calc((100% - var(--gh-ref-size-touch-min)) / 2))}
}


/* ===== components/input.css ===== */
/* ==========================================================================
   @component input · input-group · textarea — gh-input · gh-input-group · gh-textarea
   Consolidates: auth/profile/settings .inp (48px) + .inp-g (prefix/suffix), checkout/course/courses .input (46px) + .ifx (icon),
   lesson/quiz .fld + .fld-s (search pill), instructor/review .fld (.pill, [aria-invalid]) + .fld-wrap, home .coupon / .news /
   .verify inputs, review .composer textarea. Heights unified on the control scale: --sm 36 · md 44 · --lg 52.
   Focus: border turns accent + field ring (--gh-color-focus-field; light: no ring, a soft --gh-color-focus-field-halo) on :focus-visible. Invalid: aria-invalid="true". Valid: .is-valid (or inside
   .gh-field.is-valid). Answer result (quiz, after «check»): .is-correct / .is-incorrect — a graded answer, not a format
   error, so never aria-invalid; the control is usually locked (readonly/disabled) and keeps full opacity. Latin values (email, phone, code, URL): add dir="ltr" to the input — never a class.
   ========================================================================== */
.gh-input,.gh-textarea{--_h:var(--gh-input-height);--_bd:var(--gh-color-border-default);
  display:block;inline-size:100%;min-inline-size:0;block-size:var(--_h);padding-inline:var(--gh-ref-space-400);margin:0;
  border-radius:var(--gh-input-radius);background:var(--gh-input-bg);border:1px solid var(--_bd);color:var(--gh-color-text-primary);
  font-family:inherit;font-size:var(--gh-ref-font-size-300);line-height:1.5;
  transition:border-color var(--gh-motion-duration-base) var(--gh-motion-ease),background-color var(--gh-motion-duration-base) var(--gh-motion-ease)}
.gh-input::placeholder,.gh-textarea::placeholder{color:var(--gh-color-text-tertiary);opacity:1}
.gh-input:hover,.gh-textarea:hover{--_bd:var(--gh-color-border-strong)}
.gh-input:focus,.gh-textarea:focus{--_bd:var(--gh-color-accent-ink);background:var(--gh-color-surface-1)}
.gh-input:focus-visible,.gh-textarea:focus-visible{border-radius:var(--gh-input-radius);outline-offset:1px;outline-color:var(--gh-color-focus-field);box-shadow:0 0 0 3px var(--gh-color-focus-field-halo)}
.gh-input[aria-invalid="true"],.gh-textarea[aria-invalid="true"]{--_bd:var(--gh-color-status-danger)}
.gh-input.is-valid,.gh-textarea.is-valid,.gh-field.is-valid .gh-input,.gh-field.is-valid .gh-textarea{--_bd:var(--gh-color-status-success-border)}
.gh-input:disabled,.gh-textarea:disabled{opacity:.5;cursor:not-allowed}
.gh-input:read-only:not([type="file"],.is-correct,.is-incorrect),.gh-textarea:read-only:not(.is-correct,.is-incorrect){background:var(--gh-color-surface-1);border-style:dashed}
.gh-input--sm{--_h:36px;padding-inline:var(--gh-ref-space-300);font-size:var(--gh-ref-font-size-200)}
.gh-input--lg{--_h:var(--gh-ref-size-control-lg);font-size:var(--gh-ref-font-size-400)}
.gh-input--pill,.gh-input--pill:focus-visible{border-radius:var(--gh-radius-pill)}
.gh-input[type="search"]::-webkit-search-cancel-button{-webkit-appearance:none}

/* answer result states (gap A2): colour + soft fill here, icon + words in the feedback message (aria-describedby) */
.gh-input:is(.is-correct,.is-incorrect),.gh-textarea:is(.is-correct,.is-incorrect),.gh-input-group:is(.is-correct,.is-incorrect){border-width:1.5px;border-style:solid;opacity:1;cursor:default}
.gh-input.is-correct,.gh-textarea.is-correct,.gh-input-group.is-correct{--_bd:var(--gh-color-status-success);background:var(--gh-color-status-success-soft)}
.gh-input.is-incorrect,.gh-textarea.is-incorrect,.gh-input-group.is-incorrect{--_bd:var(--gh-color-status-danger);background:var(--gh-color-status-danger-soft)}
.gh-input-group:is(.is-correct,.is-incorrect):has(.gh-input-group__control:disabled){opacity:1}

/* textarea */
.gh-textarea{block-size:auto;min-block-size:104px;padding-block:var(--gh-ref-space-250);line-height:1.8;resize:vertical;field-sizing:content;max-block-size:60vh}
.gh-textarea--sm{min-block-size:64px;font-size:var(--gh-ref-font-size-200)}

/* input-group: icon / prefix / suffix / inline action share one bordered box */
.gh-input-group{--_h:var(--gh-input-height);--_bd:var(--gh-color-border-default);position:relative;display:flex;align-items:center;min-inline-size:0;inline-size:100%;
  block-size:var(--_h);--_inset:var(--gh-ref-space-100);--_btn-h:calc(var(--_h) - 2px - 2 * var(--_inset));border-radius:var(--gh-input-radius);background:var(--gh-input-bg);border:1px solid var(--_bd);
  transition:border-color var(--gh-motion-duration-base) var(--gh-motion-ease),background-color var(--gh-motion-duration-base) var(--gh-motion-ease)}
.gh-input-group:hover{--_bd:var(--gh-color-border-strong)}
.gh-input-group:focus-within{--_bd:var(--gh-color-accent-ink);background:var(--gh-color-surface-1)}
.gh-input-group:has(.gh-input-group__control:focus-visible){outline:var(--gh-focus-width) solid var(--gh-color-focus-field);outline-offset:1px;box-shadow:0 0 0 3px var(--gh-color-focus-field-halo)}
.gh-input-group:has([aria-invalid="true"]){--_bd:var(--gh-color-status-danger)}
.gh-input-group.is-valid,.gh-field.is-valid .gh-input-group{--_bd:var(--gh-color-status-success-border)}
.gh-input-group:has(.gh-input-group__control:disabled){opacity:.5}
.gh-input-group--sm{--_h:36px;--_inset:var(--gh-ref-space-50)}
.gh-input-group--lg{--_h:var(--gh-ref-size-control-lg)}
.gh-input-group--pill{border-radius:var(--gh-radius-pill)}

.gh-input-group__control{flex:1;min-inline-size:0;block-size:100%;margin:0;padding-inline:var(--gh-ref-space-400);background:none;border:0;border-radius:inherit;
  color:var(--gh-color-text-primary);font-family:inherit;font-size:var(--gh-ref-font-size-300)}
.gh-input-group__control:focus-visible{outline:none}
.gh-input-group__control::placeholder{color:var(--gh-color-text-tertiary);opacity:1}
.gh-input-group--sm .gh-input-group__control{padding-inline:var(--gh-ref-space-300);font-size:var(--gh-ref-font-size-200)}
.gh-input-group__icon{flex:none;margin-inline-start:var(--gh-ref-space-300);color:var(--gh-color-text-tertiary);pointer-events:none}
.gh-input-group__icon+.gh-input-group__control{padding-inline-start:var(--gh-ref-space-200)}
.gh-input-group__addon{flex:none;display:flex;align-items:center;gap:var(--gh-ref-space-150);block-size:100%;padding-inline:var(--gh-ref-space-400);
  color:var(--gh-color-text-secondary);font-size:var(--gh-ref-font-size-200);font-weight:var(--gh-ref-font-weight-medium);white-space:nowrap}
.gh-input-group__addon:first-child{border-inline-end:1px solid var(--gh-color-border-subtle)}
.gh-input-group__addon:last-child{border-inline-start:1px solid var(--gh-color-border-subtle);color:var(--gh-color-text-tertiary)}
.gh-input-group__addon--plain:first-child,.gh-input-group__addon--plain:last-child{border:0;padding-inline:var(--gh-ref-space-300)}
/* inline action: icon-button (clear / reveal) or a small button (apply code) sitting inside the box.
   Equal insets (SYSTEM_SPEC §4b.3): the action is as tall as the box minus its border and one --_inset on each side, and
   sits --_inset from the inline end, so top = bottom = end on every size and shape (pill included). Button size
   modifiers (--sm) keep their type and padding but never their height here. */
.gh-input-group>.gh-icon-btn{--_s:var(--_btn-h);margin-inline-end:var(--_inset)}
.gh-input-group>.gh-btn,.gh-input-group>.gh-btn--sm,.gh-input-group>.gh-btn--lg{--_h:var(--_btn-h);block-size:var(--_btn-h);margin-inline-end:var(--_inset)}

/* .gh-ltr on the control itself (codes, URLs, card-free numbers): font:inherit above would otherwise win */
.gh-input.gh-ltr,.gh-input-group__control.gh-ltr,.gh-textarea.gh-ltr{font-family:var(--gh-font-family-latin)}


/* ===== components/kbd.css ===== */
/* ==========================================================================
   @component kbd — gh-kbd (keyboard key) + gh-kbd-group (combination, always LTR)
   Consolidates: base kbd, .search-btn .k, .cmdk-i .end, review .tools button kbd, composer .k.
   Use <kbd class="gh-kbd">. Inside a pressed/inverse control use --inherit (takes the parent's colour).
   ========================================================================== */
.gh-kbd{display:inline-grid;place-items:center;flex:none;min-inline-size:20px;block-size:20px;padding-inline:5px;
  border-radius:var(--gh-radius-kbd);border:1px solid var(--gh-color-border-default);border-block-end-width:2px;
  background:var(--gh-color-surface-1);color:var(--gh-color-text-secondary);
  font-family:var(--gh-font-family-base);font-size:var(--gh-ref-font-size-50);font-weight:var(--gh-ref-font-weight-semibold);line-height:1;
  white-space:nowrap;vertical-align:middle}
.gh-kbd--sm{min-inline-size:16px;block-size:16px;padding-inline:3px;border-block-end-width:1px;font-size:var(--gh-ref-font-size-50)}
.gh-kbd--inherit{background:transparent;color:inherit;border-color:currentColor;opacity:.6}
.gh-kbd-group{display:inline-flex;align-items:center;gap:3px;direction:ltr;unicode-bidi:isolate;vertical-align:middle}


/* ===== components/lesson-row.css ===== */
/* ==========================================================================
   gh-lesson-row + gh-outline — lessons in a curriculum / course outline (Group C)
   Consolidates: course .les li (curriculum list: exercise / free preview), lesson .och + .ol a (outline accordion:
   done / now / kind), course .cur-leg (legend).
   States: done = .is-done, current = aria-current="page", locked = aria-disabled="true",
   kind = --exercise / --quiz (dashed status ring), free preview = --free (accent status icon + tag button).
   ========================================================================== */
.gh-lesson-list{display:grid;gap:var(--gh-ref-space-50)}
/* ONE row (owner 1405-08-26): status icon at inline-start, title in the middle (wraps inside its own column), trailing
   tag / duration at inline-end, all centred on the block axis — a grid «auto 1fr auto…», so the duration never drops
   under the title. Columns follow the markup: the leading status (or thumbnail) is the auto column, the title the 1fr
   column, anything after it (tag, action, time) the next auto columns. A row that starts with its title has no lead column. */
.gh-lesson-row{display:grid;grid-template-columns:auto minmax(0,1fr);grid-auto-columns:auto;grid-auto-flow:column;align-items:center;column-gap:var(--gh-ref-space-300);min-block-size:var(--gh-ref-size-touch-min);padding:var(--gh-ref-space-150) var(--gh-ref-space-250);
  border-radius:var(--gh-ref-radius-sm);font-size:var(--gh-type-label-size);color:var(--gh-color-text-secondary);line-height:var(--gh-ref-font-line-height-normal);text-align:start;inline-size:100%}
a.gh-lesson-row:hover,button.gh-lesson-row:hover{background:var(--gh-color-surface-2);color:var(--gh-color-text-primary)}
.gh-lesson-row__status{inline-size:1.5rem;block-size:1.5rem;border-radius:50%;flex:none;display:grid;place-items:center;border:1.5px solid var(--gh-color-border-strong);color:var(--gh-color-text-tertiary)}
.gh-lesson-row__status .gh-icon{inline-size:.8rem;block-size:.8rem;stroke-width:2}
.gh-lesson-row__title{min-width:0;overflow-wrap:break-word}
.gh-lesson-row:has(>.gh-lesson-row__title:first-child){grid-template-columns:minmax(0,1fr)}
.gh-lesson-row__title small{display:block;font-size:var(--gh-type-caption-size);color:var(--gh-color-text-tertiary)}
.gh-lesson-row__time{font-size:var(--gh-type-caption-size);color:var(--gh-color-text-tertiary);white-space:nowrap;min-inline-size:3rem;text-align:end}
.gh-lesson-row__action{position:relative;z-index:1}

.gh-lesson-row.is-done .gh-lesson-row__status{background:var(--gh-color-surface-4);border-color:var(--gh-color-surface-4);color:var(--gh-color-text-secondary)}
.gh-lesson-row[aria-current]{background:var(--gh-color-surface-3);color:var(--gh-color-text-primary);font-weight:var(--gh-ref-font-weight-medium)}
.gh-lesson-row[aria-current] .gh-lesson-row__status{background:var(--gh-color-accent-default);border-color:var(--gh-color-accent-default);color:var(--gh-color-accent-on)}
.gh-lesson-row--exercise .gh-lesson-row__status,.gh-lesson-row--quiz .gh-lesson-row__status{border-style:dashed;border-radius:var(--gh-ref-radius-sm)}
.gh-lesson-row--exercise:not(.is-done):not([aria-current]) .gh-lesson-row__status{color:var(--gh-color-text-primary)}
.gh-lesson-row--free .gh-lesson-row__status{background:var(--gh-color-accent-soft);border-color:var(--gh-color-accent-border);color:var(--gh-color-accent-ink)}
.gh-lesson-row[aria-disabled="true"]{color:var(--gh-color-text-tertiary);cursor:not-allowed}
.gh-lesson-row[aria-disabled="true"]:hover{background:none;color:var(--gh-color-text-tertiary)}
.gh-lesson-row[aria-disabled="true"] .gh-lesson-row__status{border-style:solid;border-color:var(--gh-color-border-default)}

/* outline: chapter header (disclosure) + lesson list */
.gh-outline{display:grid}
.gh-outline__chapter+.gh-outline__chapter{border-block-start:1px solid var(--gh-color-border-subtle)}
.gh-outline__head{display:flex;align-items:center;gap:var(--gh-ref-space-250);inline-size:100%;padding:var(--gh-ref-space-250) var(--gh-ref-space-200);border-radius:var(--gh-radius-inner);text-align:start}
.gh-outline__head:hover{background:var(--gh-color-surface-2)}
.gh-outline__name{flex:1;min-width:0}
.gh-outline__name b{display:block;font-size:var(--gh-type-label-size);font-weight:var(--gh-ref-font-weight-bold);line-height:1.5}
.gh-outline__name small{font-size:var(--gh-type-caption-size);color:var(--gh-color-text-tertiary)}
.gh-outline__head .gh-progress{inline-size:3.25rem;flex:none}
.gh-outline__chev{color:var(--gh-color-text-tertiary);transition:transform var(--gh-motion-duration-base) var(--gh-motion-ease)}
.gh-outline__head[aria-expanded="true"] .gh-outline__chev{transform:rotate(180deg)}
.gh-outline__lessons{padding-block:var(--gh-ref-space-50) var(--gh-ref-space-200)}
.gh-outline--indented .gh-outline__lessons{padding-inline-start:var(--gh-ref-space-1000)}


/* ===== components/level.css ===== */
/* ==========================================================================
   @component level — gh-level (course difficulty as three bars: ۱ مقدماتی · ۲ متوسط · ۳ پیشرفته) — v0.2, gap A8
   Replaces the course-card level element reused outside the card (courses filter rows, auth onboarding option icon).
   Markup: <span class="gh-level gh-level--2" role="img" aria-label="سطح: متوسط"><i></i><i></i><i></i></span>
           — or aria-hidden="true" when the level word is printed next to it (card meta, filter label, choice title).
   Modifiers: --1 · --2 · --3 (bars on) · --lg (option icon, 36px box). Colour = currentColor (on) and 28% of it (off),
   so it follows its context: secondary text in meta rows, ink on a selected lime choice icon. Never colour alone:
   the count of bars is the signal, the word is the label.
   ========================================================================== */
.gh-level{display:inline-flex;align-items:center;gap:2px;flex:none;vertical-align:middle;color:var(--gh-color-text-secondary)}
.gh-level>i{inline-size:10px;block-size:6px;border-radius:2px;background:color-mix(in srgb,currentColor 28%,transparent)}
.gh-level--1>i:nth-child(-n+1),.gh-level--2>i:nth-child(-n+2),.gh-level--3>i{background:currentColor}
.gh-level--lg{gap:3px}
.gh-level--lg>i{inline-size:12px;block-size:8px;border-radius:2.5px}
/* inside a choice icon box the box sets the colour (secondary → ink when selected) */
.gh-choice__icon>.gh-level{color:inherit}


/* ===== components/list.css ===== */
/* ==========================================================================
   List — static content lists with a mark at the start of each item. v0.2 (gap B5).
     --steps  ol: big numbered badge + bold title + description (how it works)   ← .co-steps (course)
     --ticks  ul: accent tick + short line (deliverables, what you get)           ← .ls-ticks (lesson)
     --tips   ol: small neutral number + one line (tips, checklists to read)      ← .as-tips (assignment)
     --never  ul: neutral ✕ (i-x) + short line: «not included / never» (v0.3, B5)  ← .vf-never (verify)
   Numbers come from a CSS counter (Persian digits) — markup carries no numbers, screen readers read
   the native ol position. Not interactive: a list to tick off is gh-check-list (checkbox.css);
   assistant-only steps stay gh-ai__steps (violet = AI).
   Item content may be any inline markup: the mark is positioned, not a flex sibling.
   ========================================================================== */
.gh-list{--gh-list-mark:1.375rem;--gh-list-gap:var(--gh-ref-space-200);
  display:grid;gap:var(--gh-ref-space-150);margin:0;padding:0;list-style:none;counter-reset:gh-list;
  font-size:var(--gh-type-label-sm-size);line-height:var(--gh-type-body-sm-line-height);color:var(--gh-color-text-secondary)}
.gh-list>li{position:relative;min-width:0;min-block-size:var(--gh-list-mark);padding-inline-start:calc(var(--gh-list-mark) + var(--gh-list-gap));counter-increment:gh-list}
.gh-list b,.gh-list strong{color:var(--gh-color-text-primary);font-weight:var(--gh-ref-font-weight-semibold)}

/* numbered marks (steps, tips) */
.gh-list--steps>li::before,.gh-list--tips>li::before{content:counter(gh-list,persian);position:absolute;inset-block-start:0;inset-inline-start:0;
  display:grid;place-items:center;inline-size:var(--gh-list-mark);block-size:var(--gh-list-mark);border-radius:var(--gh-radius-control);
  background:var(--gh-color-surface-3);color:var(--gh-color-text-primary);font-size:var(--gh-type-caption-size);font-weight:var(--gh-ref-font-weight-semibold);line-height:1}
/* tips: one short line, number centred on it */
.gh-list--tips>li{display:flex;align-items:center}

/* steps: bigger badge, bold title on its own line, quieter description */
.gh-list--steps{--gh-list-mark:2.125rem;--gh-list-gap:var(--gh-ref-space-300);gap:var(--gh-ref-space-400);color:var(--gh-color-text-tertiary)}
.gh-list--steps>li::before{border-radius:var(--gh-radius-control);color:var(--gh-color-text-secondary);font-size:var(--gh-type-label-size);font-weight:var(--gh-ref-font-weight-bold)}
.gh-list__title{display:block;font-size:var(--gh-type-label-size);line-height:var(--gh-type-label-line-height);padding-block:var(--gh-ref-space-50) var(--gh-ref-space-100)}

/* ticks: accent check icon, centred on the first line */
.gh-list--ticks{--gh-list-mark:var(--gh-icon-sm)}
.gh-list__icon{position:absolute;inset-inline-start:0;inset-block-start:calc((1em * var(--gh-type-body-sm-line-height) - var(--gh-icon-sm)) / 2);color:var(--gh-color-accent-ink)}

/* never / not included (v0.3, gap B5): same anatomy as --ticks, neutral ✕ — an exclusion is information, not an error
   (never danger red, never lime). Pair it with a --ticks list under a visible heading («نشان می‌دهیم / هرگز…»). */
.gh-list--never{--gh-list-mark:var(--gh-icon-sm)}
.gh-list--never .gh-list__icon{color:var(--gh-color-text-tertiary)}


/* ===== components/listbox.css ===== */
/* ==========================================================================
   @component listbox · option — gh-listbox · gh-option (one look for every list of choosable rows) — v0.2, gap A5
   Replaces: review .rv-snip / .rv-snip__o (snippet picker in a popover). The row is gh-option (option.css), the same
   row as the combobox (gh-option--lg) and gh-menu__item (menu items: role=menuitem, not options).
   Markup:
   <input class="gh-input gh-input--sm" role="combobox" aria-expanded="true" aria-controls="L" aria-autocomplete="list">   (optional filter)
   <ul class="gh-listbox" id="L" role="listbox" aria-label="…" data-gh-listbox [data-gh-autoselect] [tabindex="0" when there is no input]>
     <li class="gh-listbox__group" role="presentation">…</li>                          (optional heading)
     <li class="gh-option" role="option" id="…" data-value="…">
       <span class="gh-option__icon">…</span>
       <span class="gh-option__text">Title<span class="gh-option__desc">…</span></span>
       <span class="gh-option__end">…</span></li>
     <li class="gh-listbox__empty" role="presentation">…</li></ul>
   States: aria-selected="true" = active option (keyboard / pointer) · aria-disabled="true" · hidden.
   JS (actions.js «listbox»): ↑/↓ wrap, Home/End (when the listbox has focus), Enter / click → gh:select {value, option};
   aria-activedescendant on the controlling input; GH.reveal keeps the active row visible (never scrollIntoView);
   options may be re-rendered by the page (observed) — data-gh-autoselect makes the first one active.
   ========================================================================== */
.gh-listbox{display:grid;gap:2px;margin:0;padding:0;list-style:none;max-block-size:var(--gh-listbox-max-height,14rem);overflow:auto;overscroll-behavior:contain;
  scrollbar-width:thin;scrollbar-color:var(--gh-color-surface-4) transparent}
.gh-listbox:focus-visible{border-radius:var(--gh-radius-control)}
.gh-listbox__group{padding:var(--gh-ref-space-200) var(--gh-ref-space-250) var(--gh-ref-space-50);font-size:var(--gh-type-caption-size);font-weight:var(--gh-ref-font-weight-semibold);color:var(--gh-color-text-tertiary)}
.gh-listbox__empty{display:flex;align-items:center;gap:var(--gh-ref-space-150);padding:var(--gh-ref-space-200) var(--gh-ref-space-250);font-size:var(--gh-type-caption-size);color:var(--gh-color-text-tertiary)}

/* rows: gh-option lives in option.css (v0.3, gap A3 — shared with gh-search and gh-menu) */


/* ===== components/menu.css ===== */
/* ==========================================================================
   Menu — menu-button pattern: button[aria-haspopup=menu][aria-expanded] + [role=menu] (data-gh-menu).
   Items: menuitem / menuitemradio (aria-checked) / menuitemcheckbox. Arrow keys, Home/End, type-ahead, Esc.
   Consolidates .menu/.mi (video speed/quality/subtitles), .role-pop (role switch), row «more» actions.
   ========================================================================== */
.gh-menu{position:absolute;top:calc(100% + var(--gh-ref-space-200));inset-inline-end:0;z-index:var(--gh-ref-z-popover);
  min-width:208px;max-width:calc(100vw - 2 * var(--gh-ref-space-400));padding:var(--gh-ref-space-150);
  background:var(--gh-color-surface-2);border:1px solid var(--gh-color-border-default);border-radius:var(--gh-radius-inner);box-shadow:var(--gh-shadow-overlay-sm);
  text-align:start;animation:gh-menu-in var(--gh-motion-duration-base) var(--gh-motion-ease)}
.gh-menu--start{inset-inline:0 auto}
.gh-menu--up{top:auto;bottom:calc(100% + var(--gh-ref-space-200))}
.gh-menu__label{padding:var(--gh-ref-space-150) var(--gh-ref-space-250) var(--gh-ref-space-100);font-size:var(--gh-type-caption-size);font-weight:var(--gh-ref-font-weight-semibold);color:var(--gh-color-text-tertiary)}
/* v0.3 (gap A3): the row look and states of gh-menu__item (layout, hover, focus, disabled, danger) and its
   __text / __desc / __hint parts come from option.css (gh-option); this file keeps only the menu container,
   group label, check mark and separator. */
/* check mark for menuitemradio / menuitemcheckbox: visible only when aria-checked=true */
.gh-menu__check{flex:none;width:16px;height:16px;color:var(--gh-color-accent-ink);visibility:hidden}
.gh-menu__item[aria-checked="true"]{color:var(--gh-color-text-primary)}
.gh-menu__item[aria-checked="true"] .gh-menu__check{visibility:visible}
.gh-menu__sep{height:0;margin:var(--gh-ref-space-150) var(--gh-ref-space-100);border:0;border-block-start:1px solid var(--gh-color-border-subtle)}
@keyframes gh-menu-in{from{opacity:0;transform:translateY(-4px)}}


/* ===== components/message.css ===== */
/* ==========================================================================
   Message — chat bubbles for direct messages and channels (v0.3, gap B6). Consolidates .ms-msg / .ms-bubble (messages).
     .gh-message-log                  the scrolling column (page sets role="log" aria-live="polite" + a label)
     .gh-message                      one message: bubble + meta (time, delivery state); --own = mine (inline-end, lime-soft)
     .gh-message--system              centred one-line notice («رضا کیانی گفت‌وگو را سنجاق کرد»)
     .gh-message--new                 just arrived (stronger border; page removes it after a moment)
     .gh-message__bubble / __from / __media / __attachment / __link / __meta / __state(--sending|--sent|--read|--failed)
     .gh-message__typing              three dots inside a bubble (static under reduced motion)
   Day divider = gh-divider gh-divider--label (role="separator") inside the log.
   Delivery state has no ARIA attribute → modifier class; icons: sending i-clock, sent i-check, read i-read, failed i-alert.
   Bubble corners: the corner next to the speaker is small (inline-start for others, inline-end for own — RTL-aware).
   ========================================================================== */
.gh-message-log{display:flex;flex-direction:column;gap:var(--gh-ref-space-300);padding:var(--gh-ref-space-500)}
.gh-message-log:focus-visible{outline-offset:-3px}
.gh-message-log>.gh-divider--label{margin-block:var(--gh-ref-space-200)}

.gh-message{display:flex;flex-direction:column;align-items:flex-start;gap:var(--gh-ref-space-100);max-inline-size:min(34rem,86%)}
.gh-message--own{align-self:flex-end;align-items:flex-end}
.gh-message__bubble{display:grid;gap:var(--gh-ref-space-200);min-inline-size:0;padding:var(--gh-ref-space-250) var(--gh-ref-space-400);
  border-radius:var(--gh-radius-inner);border-start-start-radius:var(--gh-ref-radius-xs);background:var(--gh-color-surface-3);border:1px solid var(--gh-color-border-subtle);
  font-size:var(--gh-type-body-sm-size);line-height:var(--gh-ref-font-line-height-relaxed);color:var(--gh-color-text-primary);white-space:pre-line;overflow-wrap:anywhere}
.gh-message--own .gh-message__bubble{background:var(--gh-color-accent-soft);border-color:var(--gh-color-accent-border);border-start-start-radius:var(--gh-radius-inner);border-start-end-radius:var(--gh-ref-radius-xs)}
.gh-message--new .gh-message__bubble{border-color:var(--gh-color-border-strong)}
.gh-message__from{font-size:var(--gh-type-caption-size);font-weight:var(--gh-ref-font-weight-bold);color:var(--gh-color-text-secondary)}

/* meta: time (LTR digits isolated by the page with bdi) + delivery state */
.gh-message__meta{display:inline-flex;align-items:center;flex-wrap:wrap;gap:var(--gh-ref-space-200);font-size:var(--gh-type-caption-size);color:var(--gh-color-text-tertiary)}
.gh-message__state{display:inline-flex;align-items:center;gap:var(--gh-ref-space-100)}
.gh-message__state .gh-icon{inline-size:.875rem;block-size:.875rem}
.gh-message__state--read{color:var(--gh-color-text-secondary)}
.gh-message__state--failed{color:var(--gh-color-status-danger)}

/* system line */
.gh-message--system{align-self:center;flex-direction:row;align-items:center;justify-content:center;gap:var(--gh-ref-space-150);max-inline-size:100%;
  font-size:var(--gh-type-caption-size);color:var(--gh-color-text-tertiary);text-align:center}

/* attachments: image thumbnail; file / artwork card (link) with a thumb or the i-attach icon */
.gh-message__media{display:block;inline-size:min(14rem,100%);aspect-ratio:1;border-radius:var(--gh-ref-radius-md);overflow:hidden;background:var(--gh-color-surface-media);object-fit:cover}
.gh-message__media>svg{display:block;inline-size:100%;block-size:100%}
a.gh-message__media:focus-visible{outline-offset:2px}
.gh-message__attachment{display:flex;align-items:center;gap:var(--gh-ref-space-300);padding:var(--gh-ref-space-200);border-radius:var(--gh-radius-inner);background:var(--gh-color-surface-2);border:1px solid var(--gh-color-border-subtle);
  color:var(--gh-color-text-primary);white-space:normal;transition:border-color var(--gh-motion-duration-fast) var(--gh-motion-ease)}
a.gh-message__attachment:hover{border-color:var(--gh-color-border-strong)}
.gh-message__thumb{flex:none;display:grid;place-items:center;inline-size:3.5rem;block-size:3.5rem;border-radius:var(--gh-ref-radius-sm);overflow:hidden;background:var(--gh-color-surface-media);color:var(--gh-color-text-secondary)}
.gh-message__thumb>svg:not(.gh-icon){display:block;inline-size:100%;block-size:100%}
.gh-message__file{flex:1;min-inline-size:0;display:flex;flex-direction:column;align-items:flex-start;gap:var(--gh-ref-space-50);font-size:var(--gh-type-label-sm-size);line-height:var(--gh-ref-font-line-height-snug)}
.gh-message__file b{font-weight:var(--gh-ref-font-weight-semibold)}
.gh-message__file small{font-size:var(--gh-type-caption-size);color:var(--gh-color-text-tertiary)}
.gh-message__link{display:inline-flex;align-items:center;gap:var(--gh-ref-space-100);justify-self:start;font-size:var(--gh-type-label-sm-size);font-weight:var(--gh-ref-font-weight-semibold);color:var(--gh-color-text-primary);text-decoration:underline;text-underline-offset:3px;white-space:normal}

/* typing indicator */
.gh-message__typing{display:flex;gap:var(--gh-ref-space-100);padding-block:var(--gh-ref-space-300)}
.gh-message__typing>i{inline-size:.4rem;block-size:.4rem;border-radius:50%;background:var(--gh-color-text-tertiary);animation:gh-typing 1.2s infinite var(--gh-motion-ease)}
.gh-message__typing>i:nth-child(2){animation-delay:.15s}
.gh-message__typing>i:nth-child(3){animation-delay:.3s}
@keyframes gh-typing{0%,60%,100%{opacity:.35;transform:none}30%{opacity:1;transform:translateY(-3px)}}
/* reduced motion: foundations stops every animation; the dots stay visible at full strength */
:root[data-motion="reduce"] .gh-message__typing>i{opacity:1}
@media (prefers-reduced-motion:reduce){.gh-message__typing>i{opacity:1}}

@media (max-width:860px){
  .gh-message-log{padding:var(--gh-ref-space-300)}
  .gh-message{max-inline-size:90%}
}


/* ===== components/modal.css ===== */
/* ==========================================================================
   Modal dialog (+ confirm / alertdialog). Centred over the scrim on desktop, bottom sheet ≤860px.
   Consolidates 6 copies: .modal/.modal-box/.modal-hd/.modal-bd/.modal-ft/.modal-x/.grab (auth, profile,
   settings, lesson, assignment, checkout, course) and .dlg/.dlg-box/.dlg-acts (instructor, review, settings).
   Markup: .gh-modal[hidden] (scrim) > .gh-modal__dialog[role=dialog][aria-modal=true][aria-labelledby].
   Behaviour (data-gh-open / data-gh-close, GH.modal): focus in + trapped, Esc, scrim click, focus returns.
   ========================================================================== */
.gh-modal{position:fixed;inset:0;z-index:var(--gh-ref-z-overlay);display:flex;align-items:center;justify-content:center;padding:var(--gh-ref-space-600);
  background:var(--gh-color-bg-scrim);animation:gh-fade-in var(--gh-motion-duration-base) var(--gh-motion-ease)}
.gh-modal__dialog{position:relative;display:flex;flex-direction:column;width:min(560px,100%);max-height:calc(100dvh - 2 * var(--gh-ref-space-600));
  background:var(--gh-color-surface-1);border:1px solid var(--gh-color-border-default);border-radius:var(--gh-radius-tile);box-shadow:var(--gh-shadow-overlay-lg);
  overflow:hidden;animation:gh-modal-in var(--gh-motion-duration-slow) var(--gh-motion-ease)}
.gh-modal--sm .gh-modal__dialog{width:min(440px,100%)}
.gh-modal--lg .gh-modal__dialog{width:min(720px,100%)}
.gh-modal--xl .gh-modal__dialog{width:min(980px,100%)}
.gh-modal__grab{display:none}
.gh-modal__head{display:flex;align-items:flex-start;gap:var(--gh-ref-space-300);padding:var(--gh-ref-space-600) var(--gh-ref-space-600) 0;flex:none}
.gh-modal__heading{flex:1;min-width:0}
.gh-modal__title{font-size:var(--gh-type-heading-3-size);font-weight:var(--gh-ref-font-weight-extrabold);line-height:var(--gh-type-heading-3-line-height)}
.gh-modal__title:focus{outline:none}
.gh-modal__desc{margin-top:var(--gh-ref-space-100);font-size:var(--gh-type-body-sm-size);line-height:var(--gh-type-body-sm-line-height);color:var(--gh-color-text-secondary)}
.gh-modal__close{display:grid;place-items:center;width:38px;height:38px;flex:none;margin-block-start:-6px;margin-inline-end:-6px;border-radius:50%;
  background:var(--gh-color-surface-2);border:1px solid var(--gh-color-border-default);color:var(--gh-color-text-primary)}
.gh-modal__close:hover{background:var(--gh-color-surface-3)}
.gh-modal__close:focus-visible{border-radius:50%}
.gh-modal__body{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;padding:var(--gh-ref-space-500) var(--gh-ref-space-600);color:var(--gh-color-text-secondary)}
.gh-modal__foot{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:var(--gh-ref-space-200);padding:var(--gh-ref-space-400) var(--gh-ref-space-600) var(--gh-ref-space-600);flex:none}
/* keyboard hint / secondary note at the start of the action row */
.gh-modal__hint{margin-inline-end:auto;display:flex;align-items:center;gap:var(--gh-ref-space-100);font-size:var(--gh-type-caption-size);color:var(--gh-color-text-tertiary)}
/* confirm dialogs: status icon above the title */
.gh-modal__icon{display:grid;place-items:center;width:44px;height:44px;margin-bottom:var(--gh-ref-space-300);border-radius:50%;background:var(--gh-color-surface-3);color:var(--gh-color-text-secondary)}
.gh-modal__icon--danger{background:var(--gh-color-status-danger-soft);color:var(--gh-color-status-danger)}
.gh-modal__icon--warning{background:var(--gh-color-status-warning-soft);color:var(--gh-color-status-warning)}
.gh-modal__icon--success{background:var(--gh-color-status-success-soft);color:var(--gh-color-status-success)}
.gh-modal__icon--ai{background:var(--gh-color-ai-soft);color:var(--gh-color-ai-default)}
/* long content (shortcuts, previews): hairlines between head / body / foot */
.gh-modal--divided .gh-modal__head{padding-block-end:var(--gh-ref-space-400);border-block-end:1px solid var(--gh-color-border-subtle);align-items:center}
.gh-modal--divided .gh-modal__close{margin-block-start:0}
.gh-modal--divided .gh-modal__foot{padding-block-start:var(--gh-ref-space-400);border-block-start:1px solid var(--gh-color-border-subtle)}
/* media preview: flush body on the media surface */
.gh-modal__body--media{padding:0;background:var(--gh-color-surface-media)}

@keyframes gh-fade-in{from{opacity:0}}
@keyframes gh-modal-in{from{opacity:0;transform:translateY(12px) scale(.98)}}
@keyframes gh-sheet-in{from{transform:translateY(40px);opacity:0}}

@media (max-width:860px){
  .gh-modal:not(.gh-modal--center){align-items:flex-end;padding:0}
  .gh-modal:not(.gh-modal--center) .gh-modal__dialog{width:100%;max-height:92dvh;border-radius:var(--gh-radius-tile) var(--gh-radius-tile) 0 0;border-block-end:0;animation-name:gh-sheet-in}
  .gh-modal:not(.gh-modal--center) .gh-modal__grab{display:block;flex:none;width:40px;height:4px;margin:var(--gh-ref-space-250) auto 0;border-radius:2px;background:var(--gh-color-border-strong)}
  .gh-modal__head{padding:var(--gh-ref-space-500) var(--gh-ref-space-500) 0}
  .gh-modal__body{padding:var(--gh-ref-space-400) var(--gh-ref-space-500)}
  .gh-modal__foot{padding:var(--gh-ref-space-300) var(--gh-ref-space-500) calc(var(--gh-ref-space-500) + env(safe-area-inset-bottom))}
  .gh-modal__foot>.gh-btn,.gh-modal__foot>button,.gh-modal__foot>a{flex:1}
  .gh-modal__hint{display:none}
  .gh-modal--center{padding:var(--gh-ref-space-400)}
}


/* ===== components/newsletter.css ===== */
/* ==========================================================================
   @component newsletter — gh-newsletter (newsletter sign-up band) — v0.3, gap B8 (1405-08-25)
   One shared sign-up block for every public page (magazine, archives, portfolio, home). Consolidates magazine
   .mg-news/__text/__form/__title and home .hm-news (they were page CSS, so pages whose bundle missed them showed a
   raw block: ticks on their own lines, an italic phrase, a bare label).
   Markup (band, on a raised tile; topic chips 1405-08-26):
   <section class="gh-tile gh-tile--raise gh-newsletter" aria-labelledby="newsT" data-shabtab-news-band>
     <div class="gh-newsletter__text">
       <span class="gh-eyebrow">خبرنامه</span>
       <h2 class="gh-newsletter__title" id="newsT">مطلب‌های تازه و خبر دوره‌ها، <em>در ایمیلت</em></h2>
       <div class="gh-newsletter__topics">
         <div class="gh-chip-group" role="group" aria-label="موضوع‌های خبرنامه" aria-describedby="newsTopics">
           <button class="gh-chip gh-newsletter__topic" type="button" aria-pressed="true" data-news-topic="magazine">
             <svg class="gh-icon gh-icon--sm gh-newsletter__on">check</svg><svg class="gh-icon gh-icon--sm gh-newsletter__off">plus</svg>مطلب‌های تازهٔ مجله</button>
           <button … data-news-topic="courses">…خبر دوره‌ها و تخفیف‌ها</button>
         </div>
         <p class="gh-field__message" id="newsTopics" role="alert"></p>   (at least one topic stays on: page script)
       </div>
       <p class="gh-newsletter__assure"><svg class="gh-icon gh-icon--sm">check</svg>لغو عضویت با یک کلیک</p>
     </div>
     <form class="gh-field gh-newsletter__form" novalidate>
       <label class="gh-field__label" for="newsMail">ایمیل</label>
       <div class="gh-input-group gh-input-group--pill gh-input-group--lg" dir="ltr"><input class="gh-input-group__control" …><button class="gh-btn gh-btn--primary gh-btn--sm">عضویت</button></div>
       <p class="gh-field__help" role="status">…</p>
     </form>
   </section>
   Topics are toggle chips (button aria-pressed, all on by default), side by side, wrapping on a narrow band; switched
   off they show «+» instead of the tick. The reassurance line is not a choice. Submit sends topics[] with the email.
   --compact: the <form> itself (home final tile, sidebars): title = label size, sm chips under it, the reassurance in
   the help line. <em> = the one accent phrase (no italics), kept on one line. Status after submit: the help line turns
   into gh-field__message (error) or a gh-callout--success replaces the form (page script).
   Spacing: a band after any block (a list's pager, a grid, a section) starts space-1000 below it (§4b.5); it never
   sits on the block above.
   ========================================================================== */
/* doubled class: wins over .gh-tile (tile.css comes later in the bundle) without !important */
.gh-newsletter.gh-newsletter{display:flex;flex-direction:row;align-items:center;gap:var(--gh-ref-space-1000);padding:var(--gh-ref-space-1000)}
.gh-newsletter__text{display:flex;flex-direction:column;gap:var(--gh-ref-space-400);flex:1;min-width:0}
.gh-newsletter__title{margin:0;font-size:var(--gh-type-heading-2-size);font-weight:var(--gh-ref-font-weight-extrabold);line-height:var(--gh-type-heading-2-line-height);color:var(--gh-color-text-primary);text-wrap:balance}
.gh-newsletter__title em{font-style:normal;color:var(--gh-color-accent-ink);white-space:nowrap}
/* topics: toggle chips side by side (wrap on narrow) + the inline «at least one» message; reassurance line under them */
.gh-newsletter__topics{display:grid;gap:var(--gh-ref-space-150)}
.gh-newsletter__topic[aria-pressed="true"] .gh-newsletter__off,.gh-newsletter__topic:not([aria-pressed="true"]) .gh-newsletter__on{display:none}
.gh-newsletter__assure{display:flex;align-items:center;gap:var(--gh-ref-space-150);margin:0;font-size:var(--gh-type-label-sm-size);line-height:var(--gh-type-label-sm-line-height);color:var(--gh-color-text-secondary)}
.gh-newsletter__assure .gh-icon{flex:none;color:var(--gh-color-accent-ink)}
/* a band never touches the block above it (owner 1405-08-26: the showcase pager sat on the band's border) */
:where(*)+.gh-newsletter:not(.gh-newsletter--compact){margin-block-start:var(--gh-ref-space-1000)}
.gh-newsletter__form{flex:0 0 26rem;min-width:0}
.gh-newsletter__form .gh-input-group{inline-size:100%}
.gh-newsletter__form[hidden]{display:none}

/* compact: one column, label-size title, sm topic chips (narrow slots) */
.gh-newsletter.gh-newsletter--compact{flex-direction:column;align-items:stretch;gap:var(--gh-ref-space-300);padding:0}
.gh-newsletter--compact .gh-newsletter__text{gap:var(--gh-ref-space-200)}
.gh-newsletter--compact .gh-newsletter__title{font-size:var(--gh-type-label-size);font-weight:var(--gh-ref-font-weight-bold);line-height:var(--gh-type-label-line-height)}
.gh-newsletter--compact .gh-newsletter__form{flex:none}

@media (max-width:860px){
  .gh-newsletter.gh-newsletter:not(.gh-newsletter--compact){flex-direction:column;align-items:stretch;gap:var(--gh-ref-space-600);padding:var(--gh-ref-space-700) var(--gh-ref-space-500)}
  .gh-newsletter__title{font-size:var(--gh-type-heading-3-size);line-height:var(--gh-type-heading-3-line-height)}
  .gh-newsletter__form{flex:none}
}


/* ===== components/note.css ===== */
/* ==========================================================================
   gh-note — timestamped lesson note + gh-composer (Group C)
   Consolidates: lesson .note-c (+ .fresh), lesson .composer, review .composer (label with pin number, key hint),
   assignment .reply, profile .cm-form.
   A just-saved note gets .is-new (accent wash that fades out).
   ========================================================================== */
.gh-note{display:flex;flex-direction:column;gap:var(--gh-ref-space-100);padding:var(--gh-ref-space-300);border-radius:var(--gh-ref-radius-md);border:1px solid var(--gh-color-border-subtle);
  background:var(--gh-color-surface-1);font-size:var(--gh-type-body-sm-size);line-height:var(--gh-type-body-sm-line-height);transition:background-color var(--gh-ref-duration-slower),border-color var(--gh-motion-duration-slow)}
.gh-note.is-new{background:var(--gh-color-accent-soft);border-color:var(--gh-color-accent-border)}
.gh-note__head{display:flex;align-items:center;gap:var(--gh-ref-space-200);min-height:1.875rem}
.gh-note__head small{font-size:var(--gh-type-caption-size);color:var(--gh-color-text-tertiary)}
.gh-note__actions{margin-inline-start:auto;display:flex;gap:var(--gh-ref-space-50)}
.gh-note__body{color:var(--gh-color-text-primary);white-space:pre-line}
.gh-notes{display:grid;gap:var(--gh-ref-space-200)}

/* composer: textarea + action row; used for notes, comments, replies and instructor feedback */
.gh-composer{display:flex;flex-direction:column;padding:var(--gh-ref-space-150);border-radius:var(--gh-radius-inner);background:var(--gh-color-surface-2);border:1px solid var(--gh-color-border-default);
  transition:border-color var(--gh-motion-duration-base)}
.gh-composer:focus-within{border-color:var(--gh-color-accent-border)}
.gh-composer__label{display:flex;align-items:center;gap:var(--gh-ref-space-150);font-size:var(--gh-type-caption-size);color:var(--gh-color-text-tertiary);padding:var(--gh-ref-space-100) var(--gh-ref-space-200) 0}
.gh-composer__input{inline-size:100%;min-block-size:3.5rem;resize:vertical;background:none;border:0;padding:var(--gh-ref-space-150) var(--gh-ref-space-200);font-size:var(--gh-type-body-sm-size);line-height:var(--gh-type-body-sm-line-height);color:var(--gh-color-text-primary)}
.gh-composer__input:focus-visible{outline:none}
.gh-composer__input::placeholder{color:var(--gh-color-text-tertiary)}
.gh-composer__row{display:flex;align-items:center;gap:var(--gh-ref-space-200);flex-wrap:wrap;padding:var(--gh-ref-space-50) var(--gh-ref-space-100)}
.gh-composer__row>:last-child{margin-inline-start:auto}
.gh-composer__hint{font-size:var(--gh-type-caption-size);color:var(--gh-color-text-tertiary);display:inline-flex;gap:var(--gh-ref-space-100);align-items:center}
/* single-line pill composer (reply, comment) */
.gh-composer--inline{flex-direction:row;align-items:center;padding:var(--gh-ref-space-100);border-radius:var(--gh-radius-pill)}
.gh-composer--inline .gh-composer__input{min-block-size:0;block-size:2.25rem;resize:none;padding-block:0;padding-inline:var(--gh-ref-space-300)}


/* ===== components/option.css ===== */
/* ==========================================================================
   @component option — gh-option: ONE look and ONE set of states for every choosable / actionable row — v0.3, gap A3
   Used by: gh-listbox (role=option) · gh-search listbox (gh-option--lg, role=option) · gh-menu (gh-menu__item,
   role=menuitem*). menu.css (group B) keeps the menu container, label, check, separator and danger colour; the row
   look below is loaded AFTER it (bundle order: menu.css → option.css) so menu items consume gh-option.
   Markup:
   <li class="gh-option [gh-option--lg]" role="option" data-value="…">
     <span class="gh-option__icon">…</span>
     <span class="gh-option__text"><span class="gh-option__title">Title</span><span class="gh-option__desc">…</span></span>
     <span class="gh-option__end">…</span></li>
   States (same for all three):
     hover ............................ surface-3
     active  [aria-selected=true] (listbox, combobox: aria-activedescendant) · :focus-visible (menu: real focus)
             → surface-3 + 2px accent hairline at the inline start; icon tile one step brighter
     checked [aria-checked=true] (menuitemradio / -checkbox) → primary text + check icon (menu.css)
     disabled [aria-disabled=true] → disabled text, no hover
   Match highlight inside a row: <mark class="gh-highlight"> (GH.highlight) → accent text, no fill (highlight.css).
   Legacy aliases (v0.1 combobox markup, do not use in new code): gh-search__option, -icon, -text, -title, -meta, -end.
   ========================================================================== */
.gh-option,.gh-search__option,.gh-menu__item{--_h:2.5rem;--_icon:1.75rem;
  display:flex;align-items:center;gap:var(--gh-ref-space-250);inline-size:100%;min-inline-size:0;min-block-size:var(--_h);
  padding:var(--gh-ref-space-150) var(--gh-ref-space-250);border-radius:var(--gh-radius-control);border-inline-start:2px solid transparent;
  font-size:var(--gh-type-label-size);font-weight:var(--gh-ref-font-weight-medium);line-height:1.5;
  color:var(--gh-color-text-primary);text-align:start;text-decoration:none;cursor:pointer;-webkit-tap-highlight-color:transparent;
  transition:background-color var(--gh-motion-duration-fast) var(--gh-motion-ease)}
/* large (combobox suggestions, touch-size rows) */
.gh-option--lg,.gh-search__option{--_h:var(--gh-ref-size-touch-min);--_icon:2.125rem;font-size:var(--gh-ref-font-size-300)}

/* states */
.gh-option:hover,.gh-search__option:hover,.gh-menu__item:hover{background:var(--gh-color-surface-3);color:var(--gh-color-text-primary)}
.gh-option[aria-selected="true"],.gh-search__option[aria-selected="true"],.gh-menu__item:focus-visible{
  background:var(--gh-color-surface-3);color:var(--gh-color-text-primary);border-inline-start-color:var(--gh-color-accent-ink)}
.gh-menu__item:focus{background:var(--gh-color-surface-3)}
.gh-menu__item:focus-visible{outline-offset:-2px}
.gh-option[aria-disabled="true"],.gh-menu__item[aria-disabled="true"]{color:var(--gh-color-text-disabled);background:none;border-inline-start-color:transparent;cursor:not-allowed}
.gh-menu__item--danger,.gh-menu__item--danger:is(:hover,:focus){color:var(--gh-color-status-danger)}

/* parts */
.gh-option__icon,.gh-search__option-icon{flex:none;display:grid;place-items:center;overflow:hidden;inline-size:var(--_icon);block-size:var(--_icon);
  border-radius:var(--gh-radius-control);background:var(--gh-color-surface-3);color:var(--gh-color-text-secondary)}
:is(.gh-option,.gh-search__option)[aria-selected="true"] :is(.gh-option__icon,.gh-search__option-icon){background:var(--gh-color-surface-4);color:var(--gh-color-text-primary)}
.gh-menu__item>.gh-icon{flex:none;color:var(--gh-color-text-secondary)}
.gh-menu__item:is(:hover,:focus)>.gh-icon{color:var(--gh-color-text-primary)}
.gh-option__text,.gh-search__option-text,.gh-menu__text{flex:1;min-inline-size:0;display:flex;flex-direction:column}
.gh-option__desc,.gh-search__option-meta,.gh-menu__desc{font-size:var(--gh-type-caption-size);font-weight:var(--gh-ref-font-weight-regular);color:var(--gh-color-text-tertiary)}
.gh-option__end,.gh-search__option-end,.gh-menu__hint{flex:none;margin-inline-start:auto;font-size:var(--gh-type-caption-size);font-weight:var(--gh-ref-font-weight-regular);color:var(--gh-color-text-tertiary)}


/* ===== components/otp-input.css ===== */
/* ==========================================================================
   @component otp-input — gh-otp (one-time code, n single-digit cells, always LTR)
   Source: auth .otp (+ .otp-meta timer/resend, .err shake, .ok). States moved to attributes:
   aria-invalid="true" on the group (wrong code; shakes once unless reduced motion) · .is-valid (accepted) · :disabled cells (verifying).
   Markup: <div class="gh-otp" role="group" aria-label="کد ۶ رقمی" data-gh-otp>
             <input class="gh-otp__cell" inputmode="numeric" autocomplete="one-time-code" maxlength="1" aria-label="رقم ۱"> ×6 </div>
   JS: auto-advance, Backspace goes back, ←/→ move, paste fills all, Persian/Arabic digits normalised, fires gh:complete.
   ========================================================================== */
.gh-otp{--_n:6;display:grid;grid-template-columns:repeat(var(--_n),minmax(0,1fr));gap:var(--gh-ref-space-200);direction:ltr;max-inline-size:calc(var(--_n) * 64px)}
.gh-otp--4{--_n:4}
.gh-otp__cell{inline-size:100%;min-inline-size:0;block-size:60px;margin:0;padding:0;text-align:center;border-radius:var(--gh-radius-inner);
  background:var(--gh-color-surface-1);border:1px solid var(--gh-color-border-default);color:var(--gh-color-text-primary);caret-color:var(--gh-color-accent-ink);
  font-family:inherit;font-size:var(--gh-ref-font-size-800);font-weight:var(--gh-ref-font-weight-light);
  transition:border-color var(--gh-motion-duration-base) var(--gh-motion-ease),background-color var(--gh-motion-duration-base) var(--gh-motion-ease)}
.gh-otp__cell:hover{border-color:var(--gh-color-border-strong)}
.gh-otp__cell:focus{border-color:var(--gh-color-accent-ink)}
.gh-otp__cell:focus-visible{border-radius:var(--gh-radius-inner);outline-offset:1px;outline-color:var(--gh-color-focus-field);box-shadow:0 0 0 3px var(--gh-color-focus-field-halo)}
.gh-otp__cell:not(:placeholder-shown){background:var(--gh-color-surface-2);border-color:var(--gh-color-border-strong)}
.gh-otp__cell:disabled{opacity:.6}
.gh-otp[aria-invalid="true"] .gh-otp__cell{border-color:var(--gh-color-status-danger);color:var(--gh-color-status-danger);animation:gh-otp-shake .36s}
.gh-otp.is-valid .gh-otp__cell{border-color:var(--gh-color-status-success-border);color:var(--gh-color-status-success);opacity:1}
@keyframes gh-otp-shake{20%,60%{transform:translateX(-4px)}40%,80%{transform:translateX(4px)}}
@media (max-width:380px){.gh-otp{gap:var(--gh-ref-space-150)}.gh-otp__cell{block-size:52px;font-size:var(--gh-ref-font-size-700)}}
/* meta row under the cells: timer + resend */
.gh-otp-meta{display:flex;align-items:center;justify-content:space-between;gap:var(--gh-ref-space-300);min-block-size:34px;font-size:var(--gh-ref-font-size-200);color:var(--gh-color-text-secondary)}
.gh-otp-meta__timer{display:inline-flex;align-items:center;gap:var(--gh-ref-space-150)}
.gh-otp-meta__timer b{font-weight:var(--gh-ref-font-weight-semibold);color:var(--gh-color-text-primary);direction:ltr;unicode-bidi:isolate}


/* ===== components/page-title.css ===== */
/* ==========================================================================
   Page title — the one big heading of a page or of a hero tile, with an optional dim tail.
   v0.2 (gap B1). Replaces .cs-intro__title/__dim (courses), .db-continue__title (dashboard),
   .pf-name__title (profile), .hm-head__title / .hm-final__title (home).
   Sizes:  default = page (display)      --xl = marketing hero (display-xl)
           --hero  = hero tile (heading-2) --profile = person / entity name (heading-1)
   Tail:   __dim  inline, dimmer second clause («دوره‌ها <span class="gh-page-title__dim">…</span>»)
           __sub  block line under the title, still part of the heading (read with it)
   <em> inside the title = the one accent phrase (no italics).
   ========================================================================== */
.gh-page-title{margin:0;min-width:0;font-size:var(--gh-type-display-size);font-weight:var(--gh-type-display-weight);line-height:var(--gh-type-display-line-height);color:var(--gh-color-text-primary);overflow-wrap:break-word}
.gh-page-title em{font-style:normal;color:var(--gh-color-accent-ink)}
.gh-page-title:focus{outline:none} /* programmatic focus target after a view change */
.gh-page-title__dim{color:var(--gh-color-text-tertiary);font-weight:var(--gh-ref-font-weight-light)}
.gh-page-title__sub{display:block;margin-block-start:var(--gh-ref-space-200);font-size:var(--gh-type-body-lg-size);font-weight:var(--gh-ref-font-weight-regular);line-height:var(--gh-type-body-lg-line-height);color:var(--gh-color-text-secondary)}

.gh-page-title--xl{font-size:var(--gh-type-display-xl-size);font-weight:var(--gh-type-display-xl-weight);line-height:var(--gh-type-display-xl-line-height)}
.gh-page-title--hero{font-size:var(--gh-type-heading-2-size);font-weight:var(--gh-ref-font-weight-extrabold);line-height:var(--gh-type-heading-2-line-height)}
.gh-page-title--profile{font-size:var(--gh-type-heading-1-size);font-weight:var(--gh-ref-font-weight-extrabold);line-height:var(--gh-type-heading-1-line-height)}
.gh-page-title--hero .gh-page-title__sub,.gh-page-title--profile .gh-page-title__sub{margin-block-start:var(--gh-ref-space-100);font-size:var(--gh-type-body-size)}

@media (max-width:860px){
  .gh-page-title{font-size:var(--gh-type-heading-1-size);line-height:var(--gh-type-heading-1-line-height)}
  .gh-page-title__sub{font-size:var(--gh-type-body-size)}
  .gh-page-title--xl{font-size:var(--gh-type-display-size);line-height:var(--gh-type-display-line-height)}
  .gh-page-title--hero{font-size:var(--gh-type-heading-3-size);line-height:var(--gh-type-heading-3-line-height)}
  .gh-page-title--profile{font-size:var(--gh-type-heading-2-size);line-height:var(--gh-type-heading-2-line-height)}
}


/* ===== components/pagination.css ===== */
/* ==========================================================================
   Pagination + load more.
   Load more (.more, courses) is the default for catalogues; numbered pages for tables/archives.
   ========================================================================== */
.gh-pagination{display:flex;justify-content:center}
.gh-pagination__list{display:flex;align-items:center;flex-wrap:wrap;gap:var(--gh-ref-space-100)}
.gh-pagination__link{display:inline-flex;align-items:center;justify-content:center;gap:var(--gh-ref-space-150);min-width:40px;height:40px;padding-inline:var(--gh-ref-space-250);border-radius:var(--gh-radius-pill);
  font-size:var(--gh-type-label-size);font-weight:var(--gh-ref-font-weight-medium);color:var(--gh-color-text-secondary)}
.gh-pagination__link:hover{background:var(--gh-color-surface-2);color:var(--gh-color-text-primary)}
.gh-pagination__link[aria-current="page"]{background:var(--gh-color-surface-inverse);color:var(--gh-color-text-inverse);font-weight:var(--gh-ref-font-weight-bold)}
.gh-pagination__link[aria-disabled="true"]{color:var(--gh-color-text-disabled);pointer-events:none}
.gh-pagination__link:focus-visible{border-radius:var(--gh-radius-pill)}
.gh-pagination__step{border:1px solid var(--gh-color-border-default)}
.gh-pagination__gap{min-width:24px;text-align:center;color:var(--gh-color-text-tertiary)}
.gh-pagination__status{display:none;font-size:var(--gh-type-label-size);color:var(--gh-color-text-secondary)}
@media (max-width:560px){
  /* only prev / «صفحهٔ ۳ از ۱۲» / next on phones */
  .gh-pagination__list>li:not(:first-child):not(:last-child):not(.gh-pagination__status){display:none}
  .gh-pagination__status{display:block;padding-inline:var(--gh-ref-space-300)}
  .gh-pagination__step .gh-pagination__text{display:none}
}

/* A pager ends its list: the block after it (a band, a card, the next section) starts one section step below — never on
   the pager (owner 1405-08-26: the showcase pager sat on the newsletter's border). Covers the pager itself, and a list
   block (or its wrapper) whose last child is the pager. Zero specificity: a block with its own margin keeps it. */
:where(.gh-pagination,.gh-load-more)+:where(*),
:where(:has(>:is(.gh-pagination,.gh-load-more):last-child),:has(>:last-child>:is(.gh-pagination,.gh-load-more):last-child))+:where(*){margin-block-start:var(--gh-ref-space-1000)}

.gh-load-more{display:flex;flex-direction:column;align-items:center;gap:var(--gh-ref-space-250);padding-top:var(--gh-ref-space-700)}
.gh-load-more__status{font-size:var(--gh-type-label-sm-size);color:var(--gh-color-text-tertiary)}
/* how much of the result set is shown = gh-progress gh-progress--sm gh-progress--neutral (progress.css) */
.gh-load-more>.gh-progress{width:220px;max-width:100%}


/* ===== components/play-button.css ===== */
/* ==========================================================================
   gh-play + gh-media-trigger — big play mark and media preview trigger, outside the player (Group C, v0.2 C1)
   Consolidates: dashboard .db-play (continue thumbnail), course .co-pv (free-preview trigger with caption).
   gh-play is the round accent mark (filled play icon, ink on lime). It is usually decorative (aria-hidden) inside a
   gh-media-trigger, which is the real <a>/<button> with the accessible name. As a standalone <button class="gh-play">
   it needs an aria-label. Media canvas stays dark and colour-neutral (--gh-color-surface-media).
   ========================================================================== */
.gh-play{--gh-play-size:4rem;display:inline-grid;place-items:center;flex:none;inline-size:var(--gh-play-size);block-size:var(--gh-play-size);padding:0;border-radius:50%;
  background:var(--gh-color-accent-default);color:var(--gh-color-accent-on);transition:background-color var(--gh-motion-duration-fast),transform var(--gh-motion-duration-fast) var(--gh-motion-ease)}
.gh-play>.gh-icon{inline-size:calc(var(--gh-play-size) * .4);block-size:calc(var(--gh-play-size) * .4);fill:currentColor}
.gh-play--sm{--gh-play-size:2.75rem}
.gh-play--lg{--gh-play-size:4.75rem}
button.gh-play:hover,a.gh-play:hover{background:var(--gh-color-accent-hover);transform:scale(1.06)}

/* trigger: artwork + centred play mark + optional caption bar / corner badge */
.gh-media-trigger{position:relative;display:block;inline-size:100%;overflow:hidden;padding:0;border-radius:var(--gh-radius-inner);background:var(--gh-color-surface-media);
  color:var(--gh-color-text-primary);text-align:start;isolation:isolate}
.gh-media-trigger--flush{border-radius:0}
.gh-media-trigger:focus-visible{outline-offset:calc(-1 * var(--gh-ref-space-100));border-radius:var(--gh-radius-inner)}
.gh-media-trigger--flush:focus-visible{border-radius:var(--gh-radius-tile)}
.gh-media-trigger__art,.gh-media-trigger>svg:first-child,.gh-media-trigger>img:first-child{position:absolute;inset:0;inline-size:100%;block-size:100%;object-fit:cover;
  transition:transform var(--gh-ref-duration-slower) var(--gh-motion-ease)}
.gh-media-trigger:hover .gh-media-trigger__art{transform:scale(1.03)}
.gh-media-trigger>.gh-play{position:absolute;z-index:1;inset:0;margin:auto}
.gh-media-trigger:hover>.gh-play{background:var(--gh-color-accent-hover);transform:scale(1.06)}
/* caption bar (title + sub + LTR duration) */
.gh-media-trigger__cap{position:absolute;z-index:1;inset-inline:var(--gh-ref-space-300);bottom:var(--gh-ref-space-300);display:flex;align-items:center;gap:var(--gh-ref-space-200);
  padding:var(--gh-ref-space-200) var(--gh-ref-space-300);border-radius:var(--gh-ref-radius-md);background:var(--gh-color-bg-header);-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);
  font-size:var(--gh-type-label-sm-size);line-height:1.5;color:var(--gh-color-text-primary)}
.gh-media-trigger__cap b{font-weight:var(--gh-ref-font-weight-semibold)}
.gh-media-trigger__cap small{display:block;font-size:var(--gh-type-caption-size);color:var(--gh-color-text-secondary)}
.gh-media-trigger__time{margin-inline-start:auto;direction:ltr;unicode-bidi:isolate;font-size:var(--gh-type-caption-size);color:var(--gh-color-text-secondary)}
/* corner badge (a gh-tag--media with time) */
.gh-media-trigger__badge{position:absolute;z-index:1;bottom:var(--gh-ref-space-300);inset-inline-end:var(--gh-ref-space-300)}
@media (prefers-reduced-motion:reduce){
  .gh-play,.gh-media-trigger__art{transition:none}
  .gh-media-trigger:hover .gh-media-trigger__art,.gh-media-trigger:hover>.gh-play,button.gh-play:hover,a.gh-play:hover{transform:none}
}
:root[data-motion="reduce"] .gh-media-trigger:hover .gh-media-trigger__art,:root[data-motion="reduce"] .gh-media-trigger:hover>.gh-play{transform:none}


/* ===== components/popover.css ===== */
/* ==========================================================================
   Popover — non-modal floating panel anchored to a trigger (data-gh-popover).
   Consolidates .pop-wrap/.pop (a11y settings, every page), .role-pop (instructor), quick-preview frame.
   Open state = the panel's native [hidden] attribute + trigger aria-expanded. Floating → shadow allowed.
   ========================================================================== */
.gh-popover-anchor{position:relative;display:inline-flex}
.gh-popover{position:absolute;top:calc(100% + var(--gh-ref-space-250));inset-inline-end:0;z-index:var(--gh-ref-z-popover);
  width:300px;max-width:calc(100vw - 2 * var(--gh-ref-space-400));padding:var(--gh-ref-space-400);
  background:var(--gh-color-surface-2);border:1px solid var(--gh-color-border-default);border-radius:var(--gh-radius-inner);box-shadow:var(--gh-shadow-overlay-sm);
  text-align:start;animation:gh-popover-in var(--gh-motion-duration-base) var(--gh-motion-ease)}
.gh-popover--start{inset-inline:0 auto}
.gh-popover--up{top:auto;bottom:calc(100% + var(--gh-ref-space-250))}
.gh-popover--wide{width:380px}
.gh-popover__title{margin-bottom:var(--gh-ref-space-250);font-size:var(--gh-type-label-size);font-weight:var(--gh-ref-font-weight-bold)}
.gh-popover__row{display:flex;align-items:center;justify-content:space-between;gap:var(--gh-ref-space-300);min-height:44px;padding-block:var(--gh-ref-space-150);font-size:var(--gh-type-label-size);color:var(--gh-color-text-secondary)}
.gh-popover__row+.gh-popover__row{border-block-start:1px solid var(--gh-color-border-subtle)}
.gh-popover__foot{display:flex;gap:var(--gh-ref-space-200);justify-content:flex-end;margin-top:var(--gh-ref-space-300)}
@keyframes gh-popover-in{from{opacity:0;transform:translateY(-4px)}}


/* ===== components/progress.css ===== */
/* ==========================================================================
   gh-progress — bar, segmented by chapters, ring (Group C)
   Consolidates: base .bar, dashboard .chsegs/.chsegs-ax + .journey + .ring, assignment .score .ring,
   courses .pband .crs, profile .fb-nums .pbar + .cc-grade .bar, lesson .och .mb, lesson .cd (countdown ring).
   Value via --gh-progress-value (0–100) + role="progressbar" aria-valuenow. Fill follows reading direction.
   ========================================================================== */

/* ---------- bar ---------- */
.gh-progress{--gh-progress-h:8px;display:block;position:relative;block-size:var(--gh-progress-h);border-radius:var(--gh-radius-pill);background:var(--gh-color-surface-4);overflow:hidden;min-inline-size:2.5rem}
.gh-progress::before{content:"";position:absolute;inset-block:0;inset-inline-start:0;inline-size:calc(var(--gh-progress-value,0) * 1%);border-radius:inherit;background:var(--gh-color-data-you);
  transition:inline-size var(--gh-motion-duration-slow) var(--gh-motion-ease)}
.gh-progress--sm{--gh-progress-h:4px}
.gh-progress--lg{--gh-progress-h:12px}
.gh-progress--neutral::before{background:var(--gh-color-text-tertiary)}
/* indeterminate (no aria-valuenow) */
.gh-progress:not([aria-valuenow])::before{inline-size:35%;animation:gh-progress-run 1.2s var(--gh-motion-ease) infinite}
@keyframes gh-progress-run{from{transform:translateX(-120%)}to{transform:translateX(320%)}}
[dir="rtl"] .gh-progress:not([aria-valuenow])::before{animation-name:gh-progress-run-rtl}
@keyframes gh-progress-run-rtl{from{transform:translateX(120%)}to{transform:translateX(-320%)}}

/* label + value row above a bar */
.gh-progress-field{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:var(--gh-ref-space-150) var(--gh-ref-space-300);align-items:baseline;font-size:var(--gh-type-label-sm-size);color:var(--gh-color-text-secondary)}
.gh-progress-field>.gh-progress{grid-column:1/-1}
.gh-progress-field b{color:var(--gh-color-text-primary);font-weight:var(--gh-ref-font-weight-semibold)}

/* ---------- segmented by chapters (gh-chapters) ----------
   Segments are buttons (jump to chapter), width ∝ duration via --gh-weight. Done = neutral, current = accent fill. */
.gh-chapters{display:grid;gap:var(--gh-ref-space-200);min-width:0}
.gh-chapters__track{display:flex;gap:var(--gh-ref-space-100)}
.gh-chapters__seg{flex:var(--gh-weight,1) 1 0;min-width:0;position:relative;block-size:10px;border-radius:3px;background:var(--gh-color-surface-4);padding:0;overflow:visible}
.gh-chapters__seg::before{content:"";position:absolute;inset-block:0;inset-inline-start:0;inline-size:calc(var(--gh-progress-value,0) * 1%);border-radius:inherit;background:var(--gh-color-data-you)}
.gh-chapters__seg::after{content:"";position:absolute;inset:-10px 0}
.gh-chapters__seg.is-done{background:var(--gh-color-text-tertiary)}
.gh-chapters__seg.is-done::before{display:none}
.gh-chapters__seg[aria-current]{box-shadow:0 0 0 2px var(--gh-color-bg-canvas),0 0 0 3px var(--gh-color-accent-border)}
.gh-chapters__seg:hover{filter:brightness(1.3)}
.gh-chapters__labels{display:flex;gap:var(--gh-ref-space-100);font-size:var(--gh-type-caption-size);color:var(--gh-color-text-tertiary)}
.gh-chapters__labels>span{flex:var(--gh-weight,1) 1 0;min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.gh-chapters__labels>[aria-current]{color:var(--gh-color-text-primary);font-weight:var(--gh-ref-font-weight-semibold)}
/* thin variant for cards (courses in a path, pins resolved) */
.gh-chapters--thin .gh-chapters__seg{block-size:5px;border-radius:3px}
.gh-chapters--thin .gh-chapters__seg::after{display:none}

/* ---------- ring ---------- */
.gh-ring{--gh-ring-size:8.25rem;--gh-ring-stroke:10;position:relative;inline-size:var(--gh-ring-size);block-size:var(--gh-ring-size);flex:none}
.gh-ring>svg{inline-size:100%;block-size:100%;transform:rotate(-90deg)}
.gh-ring circle{fill:none;stroke-width:var(--gh-ring-stroke)}
.gh-ring__track{stroke:var(--gh-color-surface-3)}
.gh-ring__fill{stroke:var(--gh-color-data-you);stroke-linecap:round;stroke-dasharray:100;stroke-dashoffset:calc(100 - var(--gh-progress-value,0));transition:stroke-dashoffset var(--gh-ref-duration-slower) var(--gh-motion-ease)}
.gh-ring__compare{stroke:var(--gh-color-data-compare);stroke-width:2;stroke-dasharray:.6 99.4;stroke-dashoffset:calc(.3 - var(--gh-compare,0))}
.gh-ring__label{position:absolute;inset:0;display:grid;place-content:center;text-align:center;line-height:1.2}
.gh-ring__label b{display:block;font-size:var(--gh-type-figure-lg-size);font-weight:var(--gh-type-figure-lg-weight)}
.gh-ring__label small{font-size:var(--gh-type-caption-size);color:var(--gh-color-text-tertiary)}
.gh-ring--sm{--gh-ring-size:3.5rem;--gh-ring-stroke:9}
.gh-ring--sm .gh-ring__label b{font-size:var(--gh-type-label-size);font-weight:var(--gh-ref-font-weight-semibold)}
.gh-ring--lg{--gh-ring-size:10rem}
.gh-ring--lg .gh-ring__label b{font-size:var(--gh-type-figure-xl-size)}

/* ---------- reading progress (v0.3 C2) ----------
   <div class="gh-progress gh-progress--reading" data-gh-reading="#prose" aria-hidden="true"></div> right after the site
   header: edge-to-edge, sticky under the header, 3px. Decorative — position is told in words (TOC, «minutes left»).
   JS: one passive scroll listener + rAF for all bars; one read (getBoundingClientRect) then one write per frame.
   The fill is a transform (scaleX), never a width change → no layout, no transition (it follows the scroll exactly). */
.gh-progress--reading{--gh-progress-h:3px;position:sticky;top:var(--gh-layout-header-height);z-index:var(--gh-ref-z-sticky);inline-size:100%;min-inline-size:0;
  margin-block-end:calc(var(--gh-progress-h) * -1);border-radius:0;background:transparent;pointer-events:none}
.gh-progress--reading::before,.gh-progress--reading:not([aria-valuenow])::before{inline-size:100%;border-radius:0;transform:scaleX(calc(var(--gh-progress-value,0) / 100));transform-origin:0 50%;
  transition:none;animation:none;will-change:transform}
[dir="rtl"] .gh-progress--reading::before,[dir="rtl"] .gh-progress--reading:not([aria-valuenow])::before{transform-origin:100% 50%}
@media print{.gh-progress--reading{display:none}}


/* ===== components/prose.css ===== */
/* ==========================================================================
   Prose — long-read rhythm for Persian text (v0.3, gap B4). Extends `.gh-prose` from foundations.css
   (which only sets measure + paragraph spacing) — same class, no new block.
   Rules (Persian reading): ~65 characters per line, line-height 2 (room for dots above and below), paragraphs
   separated by space (no indent), never letter-spaced, text-align start (no justify: browsers stretch Persian
   with gaps, not kashida), no hyphenation. Every vertical gap is in em so the rhythm follows the text size
   (and the user's text-size setting).
     .gh-prose          base: inherits the font size; children flow with a 1.1em rhythm
     .gh-prose--lg      article body: body-lg (18px), measure 38rem; drops to body size on phones
     .gh-prose--sm      short rich text (FAQ answers, descriptions): body-sm, line-height 1.9
   Children styled: p, .gh-prose__lead, h2–h4, figure + figcaption (.gh-prose__media frame), ul/ol (plain or gh-list),
   table (gh-table / gh-table-wrap) + caption, blockquote / gh-quote (pull quote), code / pre / kbd, hr, a, aside/gh-panel.
   ========================================================================== */
.gh-prose{--gh-prose-gap:1.1em;--gh-prose-measure:68ch;
  min-inline-size:0;max-inline-size:var(--gh-prose-measure);line-height:2;color:var(--gh-color-text-primary);text-align:start;hyphens:none;overflow-wrap:break-word}
.gh-prose--lg{--gh-prose-measure:38rem;font-size:var(--gh-type-body-lg-size)}
.gh-prose--sm{--gh-prose-gap:.8em;font-size:var(--gh-type-body-sm-size);line-height:1.9;color:var(--gh-color-text-secondary)}

/* flow: every block child gets the same gap; headings, figures, tables and asides open more room */
.gh-prose>*{margin-block:0}
.gh-prose>*+*,.gh-prose p+p{margin-block-start:var(--gh-prose-gap)}
.gh-prose p{text-wrap:pretty}
.gh-prose__lead{font-size:var(--gh-type-heading-4-size);line-height:1.95}
.gh-prose strong,.gh-prose b{font-weight:var(--gh-ref-font-weight-bold)}
.gh-prose em{font-style:normal;font-weight:var(--gh-ref-font-weight-semibold)}  /* no italic in Lahzeh: emphasis = weight */
.gh-prose .gh-ltr{font-size:.92em}

/* headings — sizes from the type scale; space above > space below so a heading belongs to its text */
.gh-prose :is(h2,h3,h4){color:var(--gh-color-text-primary);text-wrap:balance}
.gh-prose>h2{margin-block-start:2.2em;font-size:var(--gh-type-heading-2-size);font-weight:var(--gh-ref-font-weight-extrabold);line-height:1.5}
.gh-prose>h3{margin-block-start:1.8em;font-size:var(--gh-type-heading-3-size);font-weight:var(--gh-ref-font-weight-bold);line-height:1.55}
.gh-prose>h4{margin-block-start:1.6em;font-size:var(--gh-type-heading-4-size);font-weight:var(--gh-ref-font-weight-bold);line-height:1.6}
.gh-prose>:is(h2,h3,h4)+*{margin-block-start:.6em}
.gh-prose>:is(h2,h3,h4):first-child{margin-block-start:0}
/* a heading reached from a TOC must land above the scroll-spy line or the previous link stays current */
.gh-prose :is(h2,h3,h4).gh-anchor-target{scroll-margin-top:var(--gh-ref-space-1200)}

/* links in running text: underlined (colour alone is not enough), accent on hover */
.gh-prose a:not([class]){color:var(--gh-color-text-primary);text-decoration:underline;text-decoration-color:var(--gh-color-border-strong);text-underline-offset:.3em}
.gh-prose a:not([class]):hover{color:var(--gh-color-accent-ink);text-decoration-color:currentColor}

/* figures: art frame + caption; caption starts with «شکل ۱.» in <b> */
.gh-prose>figure{margin-block:2em}
.gh-prose__media{border-radius:var(--gh-radius-inner);overflow:hidden;background:var(--gh-color-surface-media)}
.gh-prose__media>:is(img,svg,video){display:block;inline-size:100%;block-size:auto}
.gh-prose figcaption{display:block;margin-block-start:var(--gh-ref-space-300);font-size:var(--gh-type-caption-size);line-height:1.9;color:var(--gh-color-text-tertiary);text-align:start}
.gh-prose figcaption b{color:var(--gh-color-text-secondary);font-weight:var(--gh-ref-font-weight-semibold)}

/* lists: plain ul/ol get Persian markers; gh-list variants keep their own marks at a calmer size */
.gh-prose>:is(ul,ol):not([class]){display:grid;gap:.4em;padding-inline-start:1.4em}
.gh-prose>ul:not([class]){list-style:disc}
.gh-prose>ol:not([class]){list-style:persian}
.gh-prose>:is(ul,ol):not([class])>li::marker{color:var(--gh-color-text-tertiary)}
.gh-prose>.gh-list{font-size:var(--gh-type-body-size);line-height:1.9}
.gh-prose--sm>.gh-list{font-size:inherit}

/* tables: caption reads as a figure caption; wrap scrolls sideways on phones */
.gh-prose>:is(.gh-table,.gh-table-wrap){margin-block:1.6em 1.8em;font-size:var(--gh-type-label-size);line-height:1.7}
.gh-prose .gh-table caption{padding-block-end:var(--gh-ref-space-300);font-size:var(--gh-type-caption-size);font-weight:var(--gh-ref-font-weight-regular);line-height:1.9;color:var(--gh-color-text-tertiary)}
.gh-prose .gh-table th[scope="row"]{white-space:nowrap}

/* quotes: plain blockquote and the gh-quote pull quote share the lime inline-start rule */
.gh-prose>:is(blockquote,.gh-quote){margin-block:1.8em;padding-inline-start:var(--gh-ref-space-500);border-inline-start:3px solid var(--gh-color-accent-ink)}
.gh-prose>blockquote{font-size:var(--gh-type-heading-4-size);line-height:1.8;color:var(--gh-color-text-primary)}
.gh-prose>.gh-quote .gh-quote__text{line-height:1.8}

/* code: Latin, isolated, slightly smaller; pre scrolls inside itself */
.gh-prose :not(pre)>code{padding:.1em .35em;border-radius:var(--gh-radius-kbd);background:var(--gh-color-surface-3);font-family:var(--gh-font-family-latin);font-size:.88em;direction:ltr;unicode-bidi:isolate}
.gh-prose>pre{direction:ltr;text-align:start;overflow-x:auto;overscroll-behavior-x:contain;padding:var(--gh-ref-space-400);border-radius:var(--gh-radius-inner);background:var(--gh-color-surface-2);border:1px solid var(--gh-color-border-subtle);
  font-family:var(--gh-font-family-latin);font-size:var(--gh-type-label-sm-size);line-height:1.7}

/* break between parts; asides / panels / callouts inside the text open the same room as a figure
   (block margins collapse, so the larger gap of the two neighbours wins) */
.gh-prose>hr{block-size:0;margin-block:2.4em;border:0;border-block-start:1px solid var(--gh-color-border-subtle)}
.gh-prose>:is(aside,.gh-panel,.gh-callout){margin-block:2.2em}

@media (max-width:860px){
  .gh-prose--lg{font-size:var(--gh-type-body-size)}
  .gh-prose--lg .gh-prose__lead{font-size:var(--gh-type-body-lg-size)}
  .gh-prose--lg>h2{font-size:var(--gh-type-heading-3-size)}
  .gh-prose--lg>h3{font-size:var(--gh-type-heading-4-size)}
}


/* ===== components/purchase-card.css ===== */
/* ==========================================================================
   gh-price + gh-purchase — price display and the course purchase card (Group C)
   Consolidates: course .buy (.ph/.amt/.sub/.sched/.ctas/.mini/.code/.inc/.guar/.social), base .card .price,
   courses .cgrid .card .price (.free/.old), checkout .money + .sum-rows total, home pricing.
   Money: number then «تومان»; free = «رایگان»; old price struck through with an accessible label.
   Plans: one-time / instalments (gh-schedule shows the instalments) — plan switch is group A's gh-segmented.
   ========================================================================== */
.gh-price{display:inline-flex;align-items:baseline;flex-wrap:wrap;gap:var(--gh-ref-space-100) var(--gh-ref-space-200);min-width:0}
.gh-price__amount{font-size:var(--gh-ref-font-size-400);font-weight:var(--gh-ref-font-weight-bold);color:var(--gh-color-text-primary);white-space:nowrap}
.gh-price__unit{font-size:var(--gh-type-caption-size);font-weight:var(--gh-ref-font-weight-regular);color:var(--gh-color-text-tertiary)}
.gh-price__old{font-size:var(--gh-type-caption-size);color:var(--gh-color-text-tertiary);text-decoration:line-through;text-decoration-thickness:1px;white-space:nowrap}
.gh-price__off{display:inline-flex;align-items:center;block-size:1.375rem;padding-inline:var(--gh-ref-space-200);border-radius:var(--gh-radius-pill);background:var(--gh-color-accent-default);color:var(--gh-color-accent-on);
  font-size:var(--gh-type-caption-size);font-weight:var(--gh-ref-font-weight-bold);white-space:nowrap}
.gh-price--free .gh-price__amount{color:var(--gh-color-accent-ink)}
.gh-price--lg .gh-price__amount{font-size:var(--gh-type-display-size);font-weight:var(--gh-ref-font-weight-thin);line-height:1.15}
.gh-price--lg .gh-price__unit{font-size:var(--gh-type-label-size);color:var(--gh-color-text-secondary)}
.gh-price--lg .gh-price__old{font-size:var(--gh-type-label-size)}

.gh-purchase{display:flex;flex-direction:column;gap:var(--gh-ref-space-400);padding:var(--gh-tile-padding);border-radius:var(--gh-radius-tile);background:var(--gh-color-surface-2);border:1px solid var(--gh-color-border-subtle)}
.gh-purchase--sticky{position:sticky;top:calc(var(--gh-layout-header-height) + var(--gh-ref-space-300))}
.gh-purchase__head{display:flex;align-items:center;justify-content:space-between;gap:var(--gh-ref-space-250);flex-wrap:wrap;font-size:var(--gh-type-label-size);color:var(--gh-color-text-secondary)}
.gh-purchase__amount{min-block-size:3.9rem;display:flex;flex-direction:column;gap:var(--gh-ref-space-100)}
.gh-purchase__sub{font-size:var(--gh-type-label-sm-size);color:var(--gh-color-text-tertiary);line-height:1.7}
.gh-purchase__plan[hidden]{display:none}
.gh-purchase__ctas{display:grid;gap:var(--gh-ref-space-200)}
.gh-purchase__mini{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:var(--gh-ref-space-150)}
.gh-purchase__mini>button{min-block-size:3.625rem;border-radius:var(--gh-ref-radius-md);border:1px solid var(--gh-color-border-default);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;
  font-size:var(--gh-type-caption-size);color:var(--gh-color-text-secondary);line-height:1.3;padding:var(--gh-ref-space-200)}
.gh-purchase__mini>button:hover{background:var(--gh-color-surface-3);color:var(--gh-color-text-primary)}
.gh-purchase__mini>button[aria-pressed="true"]{background:var(--gh-color-accent-soft);border-color:var(--gh-color-accent-border);color:var(--gh-color-accent-ink)}
.gh-purchase__mini>button[aria-pressed="true"] .gh-icon{fill:currentColor}
.gh-purchase__section{padding-block-start:var(--gh-ref-space-400);border-block-start:1px solid var(--gh-color-border-subtle)}
.gh-purchase__includes{display:grid;gap:var(--gh-ref-space-150)}
.gh-purchase__includes li{display:flex;gap:var(--gh-ref-space-250);align-items:center;font-size:var(--gh-type-label-size);color:var(--gh-color-text-secondary);line-height:1.6}
.gh-purchase__includes .gh-icon{color:var(--gh-color-text-tertiary)}
.gh-purchase__guarantee{display:flex;gap:var(--gh-ref-space-250);align-items:center;padding:var(--gh-ref-space-300) var(--gh-ref-space-400);border-radius:var(--gh-radius-inner);background:var(--gh-color-surface-1);
  border:1px solid var(--gh-color-border-subtle);font-size:var(--gh-type-label-sm-size);color:var(--gh-color-text-secondary);line-height:1.6}
.gh-purchase__guarantee b{display:block;color:var(--gh-color-text-primary);font-size:var(--gh-type-label-size)}
.gh-purchase__guarantee .gh-icon{color:var(--gh-color-status-success);inline-size:1.375rem;block-size:1.375rem}
.gh-purchase__code-toggle{display:flex;align-items:center;gap:var(--gh-ref-space-200);inline-size:100%;font-size:var(--gh-type-label-size);color:var(--gh-color-text-secondary);font-weight:var(--gh-ref-font-weight-medium);border-radius:var(--gh-radius-control)}
.gh-purchase__code-toggle .gh-icon:last-child{margin-inline-start:auto;transition:transform var(--gh-motion-duration-base)}
.gh-purchase__code-toggle[aria-expanded="true"] .gh-icon:last-child{transform:rotate(180deg)}
.gh-purchase .gh-schedule{padding:var(--gh-ref-space-300) var(--gh-ref-space-300) var(--gh-ref-space-200);border-radius:var(--gh-radius-inner);background:var(--gh-color-surface-1);border:1px solid var(--gh-color-border-subtle)}
@media (max-width:560px){.gh-price--lg .gh-price__amount{font-size:var(--gh-type-figure-lg-size)}}


/* ===== components/queue-row.css ===== */
/* ==========================================================================
   gh-queue-row — dense selectable row in a work queue (Group C)
   Consolidates: review .qrow (+ aria-current, .done, .st new/draft), instructor .orow (oldest waiting) and .att li
   (students needing attention), dashboard .evr (deadline event row → gh-queue-row with __date).
   Selected = aria-current="true" (accent edge bar); done = .is-done. Arrow keys / J K move in a data-gh-queue list.
   v0.3 C1: link variant (--link: the title link __link stretches over the whole row; at most ONE separate action in
   __end stays clickable above it) and the large thumbnail lead (__lead--thumb, empty = __lead--empty).
   ========================================================================== */
.gh-queue{display:grid;gap:var(--gh-ref-space-100)}
.gh-queue:has(>.gh-queue-row--boxed){gap:var(--gh-ref-space-200)} /* boxed rows are separately framed cards: a 4px stack made them touch; the list-item step (space-200) as in the other card lists; plain rows keep the tight list rhythm */
.gh-queue-row{position:relative;display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:start;gap:var(--gh-ref-space-100) var(--gh-ref-space-250);inline-size:100%;text-align:start;
  padding:var(--gh-ref-space-250);border-radius:var(--gh-radius-inner);border:1px solid transparent;color:var(--gh-color-text-primary)}
/* no lead / date before the main column: main first (a missing lead must not squeeze the trailing tag / end into 0px) */
.gh-queue-row:has(>.gh-queue-row__main:first-child){grid-template-columns:minmax(0,1fr) auto}
.gh-queue-row:hover{background:var(--gh-color-surface-2)}
.gh-queue-row[aria-current="true"]{background:var(--gh-color-surface-3);border-color:var(--gh-color-border-default)}
.gh-queue-row[aria-current="true"]::before{content:"";position:absolute;inset-inline-start:-1px;top:var(--gh-ref-space-300);bottom:var(--gh-ref-space-300);inline-size:3px;border-radius:2px;background:var(--gh-color-accent-ink)}
.gh-queue-row__lead{inline-size:2.25rem;block-size:2.25rem;border-radius:var(--gh-ref-radius-sm);overflow:hidden;flex:none;display:grid;place-items:center;background:var(--gh-color-surface-3);
  font-size:var(--gh-type-label-sm-size);font-weight:var(--gh-ref-font-weight-bold);margin-block-start:2px}
.gh-queue-row__lead--round{border-radius:50%}
.gh-queue-row__lead svg:not(.gh-icon){inline-size:100%;block-size:100%} /* thumbnails fill the lead; icons keep their size */
.gh-queue-row__main{min-width:0;display:flex;flex-direction:column}
.gh-queue-row__title{display:flex;align-items:center;gap:var(--gh-ref-space-150);font-size:var(--gh-type-label-size);font-weight:var(--gh-ref-font-weight-semibold);line-height:1.5;min-width:0}
.gh-queue-row__title>span{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.gh-queue-row__sub{font-size:var(--gh-type-caption-size);color:var(--gh-color-text-secondary);line-height:1.55;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.gh-queue-row__tags{display:flex;align-items:center;gap:var(--gh-ref-space-150);flex-wrap:wrap;margin-block-start:var(--gh-ref-space-150)}
.gh-queue-row__end{display:flex;flex-direction:column;align-items:flex-end;gap:var(--gh-ref-space-100);font-size:var(--gh-type-caption-size);color:var(--gh-color-text-tertiary);white-space:nowrap;padding-block-start:3px}
.gh-queue-row__state--new{color:var(--gh-color-text-primary);font-weight:var(--gh-ref-font-weight-semibold);display:inline-flex;align-items:center;gap:var(--gh-ref-space-100)}
.gh-queue-row__state--new::before{content:"";inline-size:7px;block-size:7px;border-radius:50%;background:var(--gh-color-accent-ink)}
.gh-queue-row__state--draft{color:var(--gh-color-status-warning)} /* instructor's unsent draft — not AI (violet is AI-only, ADR 0006) */
.gh-queue-row.is-done{opacity:.6}
.gh-queue-row.is-done .gh-queue-row__title>span{text-decoration:line-through;text-decoration-color:var(--gh-color-text-tertiary)}
/* date block (deadline rows) */
.gh-queue-row__date{inline-size:2.5rem;flex:none;text-align:center;line-height:1.15}
.gh-queue-row__date b{display:block;font-size:var(--gh-type-heading-3-size);font-weight:var(--gh-ref-font-weight-light)}
.gh-queue-row__date small{font-size:var(--gh-type-caption-size);color:var(--gh-color-text-tertiary)}
.gh-queue-row--boxed{background:var(--gh-color-surface-2);border-color:var(--gh-color-border-subtle);align-items:center}
.gh-queue-row--boxed:hover{border-color:var(--gh-color-border-strong)}
/* ---------- link variant (v0.3 C1) ----------
   <li class="gh-queue-row gh-queue-row--link"> … <span class="gh-queue-row__title"><a class="gh-queue-row__link" href>…</a></span> … <span class="gh-queue-row__end"><button>one action</button></span>
   One Tab stop for the row (the link, named by the title) + one for the action. The link's ::after covers the row;
   every other control in the row is lifted above it. Focus ring on the whole row. */
.gh-queue-row__link{display:flex;min-width:0;color:inherit;text-decoration:none}
.gh-queue-row__link>span{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.gh-queue-row__link::after{content:"";position:absolute;inset:0;border-radius:inherit}
.gh-queue-row__link:focus-visible{outline:none}
.gh-queue-row--link:has(.gh-queue-row__link:focus-visible){outline:var(--gh-focus-width) solid var(--gh-color-focus-ring);outline-offset:var(--gh-focus-offset)}
.gh-queue-row--link:hover .gh-queue-row__link{color:var(--gh-color-accent-ink)}
.gh-queue-row--link :is(a,button,input,select,label,[tabindex]):not(.gh-queue-row__link){position:relative;z-index:1}
.gh-queue-row--link{cursor:pointer}
/* large thumbnail lead: artwork preview (latest version); --empty = nothing sent yet (dashed, icon) */
.gh-queue-row__lead--thumb{--gh-queue-thumb:3.5rem;inline-size:var(--gh-queue-thumb);block-size:var(--gh-queue-thumb);border-radius:var(--gh-radius-inner);background:var(--gh-color-surface-media);margin-block-start:0}
.gh-queue-row__lead--empty{background:var(--gh-color-surface-3);border:1px dashed var(--gh-color-border-strong);color:var(--gh-color-text-tertiary)}
@media (max-width:860px){.gh-queue-row__lead--thumb{--gh-queue-thumb:2.75rem}}


/* ===== components/quote.css ===== */
/* ==========================================================================
   Quote — testimonial / pull-quote: the words, then who said it (+ optional proof at the end).
   v0.2 (gap B2). Replaces .hm-quote (home) and .au-quote (auth).
   Markup: figure.gh-quote > blockquote.gh-quote__text + figcaption.gh-quote__by
           (avatar + .gh-quote__who > b + small, or plain text with .gh-sep) [+ .gh-quote__end]
   Default = compact (beside a stat, in a form column); --lg = a testimonial tile.
   <em> in the text = the one accent phrase. Quote marks «» are part of the text.
   ========================================================================== */
.gh-quote{display:flex;flex-direction:column;gap:var(--gh-ref-space-150);margin:0;min-width:0}
.gh-quote__text{margin:0;font-size:var(--gh-type-heading-4-size);font-weight:var(--gh-ref-font-weight-bold);line-height:var(--gh-type-body-lg-line-height);color:var(--gh-color-text-primary)}
.gh-quote__text p{margin:0}
.gh-quote__text em{font-style:normal;color:var(--gh-color-accent-ink)}
.gh-quote__by{display:flex;align-items:center;flex-wrap:wrap;row-gap:var(--gh-ref-space-200);min-width:0;font-size:var(--gh-type-caption-size);color:var(--gh-color-text-tertiary)}
.gh-quote__by>.gh-avatar{margin-inline-end:var(--gh-ref-space-250)}
.gh-quote__who{display:flex;flex-direction:column;min-width:0;font-size:var(--gh-type-label-size);line-height:var(--gh-type-label-line-height)}
.gh-quote__who b{color:var(--gh-color-text-primary);font-weight:var(--gh-ref-font-weight-semibold)}
.gh-quote__who small{display:flex;align-items:center;flex-wrap:wrap;font-size:var(--gh-type-caption-size);color:var(--gh-color-text-tertiary)}
/* proof / extra at the end of the caption row (before→after artwork, rating) */
.gh-quote__end{margin-inline-start:auto;padding-inline-start:var(--gh-ref-space-250);min-width:0}

/* --lg: testimonial tile — lighter, bigger words; caption sits at the bottom of the tile */
.gh-quote--lg{gap:var(--gh-ref-space-300)}
.gh-quote--lg .gh-quote__text{font-size:var(--gh-type-heading-3-size);font-weight:var(--gh-ref-font-weight-medium)}
.gh-quote--lg .gh-quote__by{margin-block-start:auto;padding-block-start:var(--gh-ref-space-200)}

@media (max-width:860px){
  .gh-quote--lg .gh-quote__text{font-size:var(--gh-type-body-lg-size)}
  .gh-quote__end{margin-inline-start:0;padding-inline-start:0;inline-size:100%}
}


/* ===== components/range.css ===== */
/* ==========================================================================
   @component range — gh-range (native <input type="range">) + gh-range-field (label · live value · scale)
   Sources: lesson .vol input (accent-color only), compare sliders (.vcmp range overlays — those stay invisible inputs
   owned by feedback-canvas, group C). New canonical styling: 4px track, lime fill to the value, 18px thumb.
   Direction: follows the document (RTL fills from the right). Media volume/scrubber: put dir="ltr" on the input (SYSTEM_SPEC §5).
   JS (data-gh-range): keeps --gh-range-pct in sync and writes the value (Persian digits + data-unit) into the linked <output>.
   ========================================================================== */
.gh-range{--gh-range-pct:50%;--_fill:var(--gh-color-data-you);--_track:var(--gh-color-surface-4);--_dir:to right;
  appearance:none;-webkit-appearance:none;display:block;inline-size:100%;min-inline-size:0;block-size:24px;margin:0;background:transparent;cursor:pointer}
.gh-range:dir(rtl){--_dir:to left}
.gh-range:focus-visible{outline:none}
.gh-range::-webkit-slider-runnable-track{block-size:4px;border-radius:var(--gh-radius-pill);background:linear-gradient(var(--_dir),var(--_fill) var(--gh-range-pct),var(--_track) var(--gh-range-pct))}
.gh-range::-moz-range-track{block-size:4px;border-radius:var(--gh-radius-pill);background:var(--_track)}
.gh-range::-moz-range-progress{block-size:4px;border-radius:var(--gh-radius-pill);background:var(--_fill)}
.gh-range::-webkit-slider-thumb{-webkit-appearance:none;inline-size:18px;block-size:18px;margin-block-start:-7px;border-radius:50%;background:var(--gh-color-text-primary);
  border:3px solid var(--gh-color-bg-canvas);box-shadow:0 0 0 1px var(--gh-color-border-strong);transition:transform var(--gh-motion-duration-fast) var(--gh-motion-ease)}
.gh-range::-moz-range-thumb{inline-size:18px;block-size:18px;border-radius:50%;background:var(--gh-color-text-primary);border:3px solid var(--gh-color-bg-canvas);box-shadow:0 0 0 1px var(--gh-color-border-strong)}
.gh-range:hover::-webkit-slider-thumb{transform:scale(1.12)}
.gh-range:focus-visible::-webkit-slider-thumb{box-shadow:0 0 0 2px var(--gh-color-bg-canvas),0 0 0 4px var(--gh-color-focus-ring)}
.gh-range:focus-visible::-moz-range-thumb{box-shadow:0 0 0 2px var(--gh-color-bg-canvas),0 0 0 4px var(--gh-color-focus-ring)}
.gh-range:disabled{opacity:.45;cursor:not-allowed}
.gh-range--neutral{--_fill:var(--gh-color-text-secondary)}
@media (pointer:coarse){
  .gh-range{block-size:var(--gh-ref-size-touch-min)}
  .gh-range::-webkit-slider-thumb{inline-size:24px;block-size:24px;margin-block-start:-10px}
  .gh-range::-moz-range-thumb{inline-size:24px;block-size:24px}
}

.gh-range-field{display:flex;flex-direction:column;gap:var(--gh-ref-space-150);min-inline-size:0}
.gh-range-field__head{display:flex;align-items:baseline;justify-content:space-between;gap:var(--gh-ref-space-300);font-size:var(--gh-ref-font-size-200);font-weight:var(--gh-ref-font-weight-semibold)}
.gh-range-field__value{font-size:var(--gh-ref-font-size-200);font-weight:var(--gh-ref-font-weight-bold);color:var(--gh-color-accent-ink)}
.gh-range-field__scale{display:flex;justify-content:space-between;font-size:var(--gh-type-caption-size);color:var(--gh-color-text-tertiary)}


/* ===== components/rating.css ===== */
/* ==========================================================================
   @component rating — gh-stars (display, fractional) · gh-rating (input, 5 native radios)
   Consolidates: checkout/course/courses .stars (+ .off, .lg) and .rate (score + star + count), instructor #rStars.
   Filled stars use the TEXT colour, empty = surface-4 (lime stays reserved for action / «you»).
   Display: <span class="gh-stars" style="--value:4.5" role="img" aria-label="۴٫۵ از ۵"></span>   (one element, mask-based, any fraction)
   Input:   <fieldset class="gh-rating" data-gh-rating><legend class="gh-sr-only">امتیاز به دوره</legend>
              <label class="gh-rating__item"><input class="gh-sr-only" type="radio" name="r" value="1"><span class="gh-sr-only">۱ ستاره: ضعیف</span></label> ×5
              <output class="gh-rating__label" aria-live="polite"></output></fieldset>
   Native radios give arrow-key support; hover previews; :has() fills every star up to the checked one.
   ========================================================================== */
.gh-stars{--value:0;--_s:14px;display:inline-block;flex:none;inline-size:calc(var(--_s) * 5 + 4px);block-size:var(--_s);vertical-align:-2px;
  background:linear-gradient(to left,var(--gh-color-text-primary) calc(var(--value) / 5 * 100%),var(--gh-color-surface-4) 0);
  -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z'/%3E%3C/svg%3E") 0 0/calc(var(--_s) + 1px) var(--_s) repeat-x;
  mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z'/%3E%3C/svg%3E") 0 0/calc(var(--_s) + 1px) var(--_s) repeat-x}
.gh-stars:dir(ltr){background:linear-gradient(to right,var(--gh-color-text-primary) calc(var(--value) / 5 * 100%),var(--gh-color-surface-4) 0)}
.gh-stars--sm{--_s:12px}
.gh-stars--lg{--_s:20px}
/* score line: «۴٫۸ ★ (۲۳۰ نظر)» */
.gh-score{display:inline-flex;align-items:center;gap:var(--gh-ref-space-150);font-size:var(--gh-ref-font-size-100);color:var(--gh-color-text-tertiary);white-space:nowrap}
.gh-score b{color:var(--gh-color-text-primary);font-weight:var(--gh-ref-font-weight-bold)}

/* input */
.gh-rating{display:inline-flex;align-items:center;gap:var(--gh-ref-space-100);border:0;margin:0;padding:0;min-inline-size:0}
.gh-rating__item{--_c:var(--gh-color-surface-4);position:relative;display:grid;place-items:center;inline-size:36px;block-size:36px;border-radius:var(--gh-radius-control);cursor:pointer;
  -webkit-tap-highlight-color:transparent}
.gh-rating__item::before{content:"";inline-size:26px;block-size:26px;background:var(--_c);transition:background-color var(--gh-motion-duration-fast) var(--gh-motion-ease),transform var(--gh-motion-duration-fast) var(--gh-motion-ease);
  -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z'/%3E%3C/svg%3E") center/contain no-repeat;
  mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z'/%3E%3C/svg%3E") center/contain no-repeat}
.gh-rating__item:has(input:focus-visible){outline:var(--gh-focus-width) solid var(--gh-color-focus-ring);outline-offset:0}
/* committed value: the checked star and every star before it */
.gh-rating__item:has(input:checked),.gh-rating__item:has(~ .gh-rating__item input:checked){--_c:var(--gh-color-text-primary)}
/* hover preview overrides the committed value */
.gh-rating:hover .gh-rating__item{--_c:var(--gh-color-surface-4)}
.gh-rating:hover .gh-rating__item:hover,.gh-rating:hover .gh-rating__item:has(~ .gh-rating__item:hover){--_c:var(--gh-color-text-secondary)}
.gh-rating__item:hover::before{transform:scale(1.1)}
.gh-rating__label{margin-inline-start:var(--gh-ref-space-200);font-size:var(--gh-ref-font-size-200);color:var(--gh-color-text-secondary);min-inline-size:4em}
.gh-rating:has(input:disabled){opacity:.5;pointer-events:none}
.gh-rating--sm .gh-rating__item{inline-size:28px;block-size:28px}
.gh-rating--sm .gh-rating__item::before{inline-size:20px;block-size:20px}
@media (pointer:coarse){.gh-rating__item{inline-size:var(--gh-ref-size-touch-min);block-size:var(--gh-ref-size-touch-min)}.gh-rating{gap:0}}


/* ===== components/result.css ===== */
/* ==========================================================================
   Result — the outcome of a flow: big status mark + title + one line + actions.
   v0.2 (gap B3). Replaces .ck-done / .ck-done--fail (checkout); fits auth / assignment «sent» moments.
   Not an empty state (gh-empty says «nothing here yet»); a result says «this just happened».
   Tone = modifier: default success (accent mark — the user's win), --danger, --neutral (pending / info).
   Start-aligned by default (reads with the content under it); --center for a stand-alone screen.
   ========================================================================== */
.gh-result{display:flex;flex-direction:column;align-items:flex-start;gap:var(--gh-ref-space-300);min-width:0}
.gh-tile.gh-result{padding:var(--gh-ref-space-800)}
.gh-result__mark{display:grid;place-items:center;flex:none;inline-size:3.5rem;block-size:3.5rem;border-radius:50%;
  background:var(--gh-color-accent-default);color:var(--gh-color-accent-on)}
.gh-result__title{margin:0;font-size:var(--gh-type-heading-1-size);font-weight:var(--gh-type-heading-1-weight);line-height:var(--gh-type-heading-1-line-height);color:var(--gh-color-text-primary)}
.gh-result__title:focus{outline:none} /* focus moves here when the result appears */
.gh-result__text{max-inline-size:52ch;color:var(--gh-color-text-secondary)}
.gh-result__text b{color:var(--gh-color-text-primary);font-weight:var(--gh-ref-font-weight-semibold)}
.gh-result__actions{display:flex;align-items:center;flex-wrap:wrap;gap:var(--gh-ref-space-200);margin-block-start:var(--gh-ref-space-200)}

.gh-result--danger .gh-result__mark{background:var(--gh-color-status-danger-soft);color:var(--gh-color-status-danger)}
.gh-result--neutral .gh-result__mark{background:var(--gh-color-surface-3);color:var(--gh-color-text-secondary)}
.gh-result--center{align-items:center;text-align:center}
.gh-result--center .gh-result__actions{justify-content:center}

@media (max-width:860px){
  .gh-tile.gh-result{padding:var(--gh-ref-space-500)}
  .gh-result__title{font-size:var(--gh-type-heading-2-size);line-height:var(--gh-type-heading-2-line-height)}
  .gh-result__actions{inline-size:100%}
}


/* ===== components/rubric.css ===== */
/* ==========================================================================
   gh-rubric — score input 1–5 (instructor) and result (student) (Group C)
   Consolidates: review .rub/.rub-r/.rub-s/.rub-desc/.overall (input, keys 1–5, previous-version marker),
   assignment .rub (result bullet bars + instructor note + delta) → result uses gh-barlist rows.
   Scale = role="radiogroup", options role="radio" + aria-checked; the fill up to the checked option is drawn with
   :has() (no classes). Previous version = neutral tick (comparison is never violet).
   ========================================================================== */
.gh-rubric{display:grid;gap:var(--gh-ref-space-100)}
.gh-rubric__row{display:grid;grid-template-columns:minmax(0,1fr) auto 2.5rem;align-items:center;gap:var(--gh-ref-space-250);padding:var(--gh-ref-space-150) var(--gh-ref-space-200);
  border-radius:var(--gh-ref-radius-sm);border:1px solid transparent}
.gh-rubric__row:focus-within{border-color:var(--gh-color-accent-border);background:var(--gh-color-accent-soft)}
.gh-rubric__name{font-size:var(--gh-type-label-sm-size);font-weight:var(--gh-ref-font-weight-semibold);line-height:1.4;min-width:0}
.gh-rubric__name small{display:block;font-size:var(--gh-type-caption-size);font-weight:var(--gh-ref-font-weight-regular);color:var(--gh-color-text-tertiary)}
.gh-rubric__scale{display:flex;gap:var(--gh-ref-space-100)} /* separately framed score buttons: 3px read as touching (§4b.5 collision); the smallest step of the scale */
.gh-rubric__opt{position:relative;inline-size:2rem;block-size:2rem;border-radius:var(--gh-ref-radius-sm);display:grid;place-items:center;padding:0;
  background:var(--gh-color-surface-3);color:var(--gh-color-text-tertiary);font-size:var(--gh-type-label-sm-size);font-weight:var(--gh-ref-font-weight-bold)}
.gh-rubric__opt:hover{background:var(--gh-color-surface-4);color:var(--gh-color-text-primary)}
.gh-rubric__scale:has([aria-checked="true"]) .gh-rubric__opt:not([aria-checked="true"]):not([aria-checked="true"] ~ .gh-rubric__opt){background:var(--gh-color-surface-4);color:var(--gh-color-text-secondary)}
.gh-rubric__scale .gh-rubric__opt[aria-checked="true"]{background:var(--gh-color-accent-default);color:var(--gh-color-accent-on)}
.gh-rubric__opt.is-previous::after{content:"";position:absolute;top:-6px;inset-inline:0;margin-inline:auto;inline-size:2px;block-size:6px;border-radius:1px;background:var(--gh-color-data-compare)}
.gh-rubric__prev{font-size:var(--gh-type-caption-size);color:var(--gh-color-text-tertiary);text-align:center;line-height:1.3}
.gh-rubric__prev b{display:block;font-size:var(--gh-type-label-size);font-weight:var(--gh-ref-font-weight-semibold);color:var(--gh-color-text-secondary)}
.gh-rubric__desc{font-size:var(--gh-type-caption-size);color:var(--gh-color-text-secondary);padding:var(--gh-ref-space-100) var(--gh-ref-space-200) 0;min-block-size:1.7em}
.gh-rubric__desc b{color:var(--gh-color-text-primary);font-weight:var(--gh-ref-font-weight-semibold)}
/* overall score line (input and result) */
.gh-rubric__total{display:flex;align-items:center;gap:var(--gh-ref-space-300);flex-wrap:wrap;margin-block-start:var(--gh-ref-space-200);padding:var(--gh-ref-space-300) var(--gh-ref-space-400);
  border-radius:var(--gh-radius-inner);background:var(--gh-color-surface-2);border:1px solid var(--gh-color-border-subtle)}
.gh-rubric__total>:last-child{margin-inline-start:auto;text-align:end;font-size:var(--gh-type-caption-size);color:var(--gh-color-text-secondary);line-height:1.6}
@media (max-width:560px){
  .gh-rubric__row{grid-template-columns:minmax(0,1fr) 2.5rem}
  .gh-rubric__scale{grid-column:1/-1;grid-row:2}
  .gh-rubric__opt{flex:1;inline-size:auto;block-size:2.75rem}
}


/* ===== components/save-bar.css ===== */
/* ==========================================================================
   Save bar — floating «unsaved changes» bar for settings forms (data-gh-savebar="<form id>").
   Consolidates .savebar (settings) + .save-st autosave indicator (review → gh-save-state).
   Visible state = .is-open (no ARIA state exists); error = .is-error. Floating → shadow allowed.
   ========================================================================== */
.gh-save-bar{position:fixed;inset-inline:0;bottom:var(--gh-ref-space-600);z-index:var(--gh-ref-z-fixed);display:flex;align-items:center;gap:var(--gh-ref-space-200);
  width:min(600px,calc(100% - 2 * var(--gh-ref-space-400)));margin-inline:auto;padding:var(--gh-ref-space-200);padding-inline-start:var(--gh-ref-space-500);
  border-radius:var(--gh-radius-pill);background:var(--gh-color-surface-3);border:1px solid var(--gh-color-border-strong);box-shadow:var(--gh-shadow-overlay-sm);
  opacity:0;visibility:hidden;transform:translateY(24px);
  transition:opacity var(--gh-motion-duration-slow) var(--gh-motion-ease),transform var(--gh-motion-duration-slow) var(--gh-motion-ease),visibility 0s linear var(--gh-motion-duration-slow)}
.gh-save-bar.is-open{opacity:1;visibility:visible;transform:none;transition-delay:0s}
.gh-save-bar__dot{width:8px;height:8px;border-radius:50%;flex:none;background:var(--gh-color-status-warning)}
.gh-save-bar__text{flex:1;min-width:0;font-size:var(--gh-type-label-size);font-weight:var(--gh-ref-font-weight-medium)}
.gh-save-bar.is-error .gh-save-bar__dot{background:var(--gh-color-status-danger)}
.gh-save-bar.is-error .gh-save-bar__text{color:var(--gh-color-status-danger)}
/* inside the app shell: centre over the main column, clear the tabbar */
.gh-app-shell .gh-save-bar{inset-inline-start:var(--gh-layout-sidebar-width)}
@media (max-width:1100px){
  .gh-app-shell .gh-save-bar{inset-inline-start:0}
  body:has(.gh-tabbar) .gh-save-bar{bottom:calc(var(--gh-layout-tabbar-height) + var(--gh-ref-space-300))}
}
@media (max-width:560px){.gh-save-bar{padding-inline-start:var(--gh-ref-space-400)}.gh-save-bar__text{font-size:var(--gh-type-label-sm-size)}}

/* autosave indicator (aria-live=polite): «ذخیره شد» / «در حال ذخیره…» / «ذخیره نشد» */
.gh-save-state{display:inline-flex;align-items:center;gap:var(--gh-ref-space-150);font-size:var(--gh-type-caption-size);color:var(--gh-color-text-tertiary)}
.gh-save-state::before{content:"";width:6px;height:6px;border-radius:50%;background:var(--gh-color-status-success)}
.gh-save-state[aria-busy="true"]::before{background:var(--gh-color-status-warning)}
.gh-save-state--error{color:var(--gh-color-status-danger)}
.gh-save-state--error::before{background:var(--gh-color-status-danger)}


/* ===== components/search-combobox.css ===== */
/* ==========================================================================
   @component search-combobox — gh-search (search field + suggestions listbox)
   Consolidates: courses .sbox + .sugg (hero search with grouped suggestions), lesson/quiz .fld-s (pill search),
   instructor/review .fld.pill + .fld-wrap, review .snip (filterable snippet list). The header .search-btn and
   the command palette belong to group B.
   Markup:
   <div class="gh-search" data-gh-combobox>
     <svg class="gh-icon gh-search__icon">…i-search</svg>
     <input class="gh-search__input" type="search" role="combobox" aria-expanded="false" aria-controls="L" aria-autocomplete="list">
     <button class="gh-icon-btn gh-icon-btn--sm gh-search__clear" type="button" aria-label="پاک کردن" hidden>…</button>
     <button class="gh-btn gh-btn--primary gh-search__submit">جست‌وجو</button>      (optional)
     <div class="gh-search__listbox" id="L" role="listbox" hidden>
       <div role="group" aria-labelledby="g1"><div class="gh-search__group" id="g1">دوره‌ها</div>
         <div class="gh-option gh-option--lg" role="option" id="o1" data-gh-value="…">…</div></div>
       <p class="gh-search__empty" hidden>…</p></div></div>
   Sizes: md (44, default) · --lg (56, page hero). JS: arrows, Enter, Esc, GH.highlight → <mark class="gh-highlight"> in .gh-option__title, aria-activedescendant.
   ========================================================================== */
.gh-search{--_h:var(--gh-input-height);--_inset:var(--gh-ref-space-100);--_btn-h:calc(var(--_h) - 2px - 2 * var(--_inset));position:relative;display:flex;align-items:center;min-inline-size:0;inline-size:100%;block-size:var(--_h);
  border-radius:var(--gh-radius-pill);background:var(--gh-input-bg);border:1px solid var(--gh-color-border-default);
  transition:border-color var(--gh-motion-duration-base) var(--gh-motion-ease)}
.gh-search:hover{border-color:var(--gh-color-border-strong)}
.gh-search:focus-within{border-color:var(--gh-color-accent-ink)}
.gh-search:has(.gh-search__input:focus-visible){outline:var(--gh-focus-width) solid var(--gh-color-focus-field);outline-offset:1px;box-shadow:0 0 0 3px var(--gh-color-focus-field-halo)}
.gh-search--lg{--_h:56px}
.gh-search--sm{--_h:36px}
.gh-search__icon{flex:none;margin-inline-start:var(--gh-ref-space-400);color:var(--gh-color-text-secondary);pointer-events:none}
.gh-search--sm .gh-search__icon{margin-inline-start:var(--gh-ref-space-300)}
.gh-search__input{flex:1;min-inline-size:0;block-size:100%;margin:0;padding-inline:var(--gh-ref-space-250);background:none;border:0;border-radius:inherit;
  color:var(--gh-color-text-primary);font-family:inherit;font-size:var(--gh-ref-font-size-300)}
.gh-search--lg .gh-search__input{font-size:var(--gh-ref-font-size-400)}
.gh-search--sm .gh-search__input{font-size:var(--gh-ref-font-size-200);padding-inline:var(--gh-ref-space-200)}
.gh-search__input:focus-visible{outline:none}
.gh-search__input::placeholder{color:var(--gh-color-text-tertiary);opacity:1}
.gh-search__input::-webkit-search-cancel-button{-webkit-appearance:none}
.gh-search__clear{margin-inline-end:var(--_inset)}
/* submit: equal insets (§4b.3) — box height minus border minus one --_inset each side, --_inset from the inline end */
.gh-search__submit{flex:none;margin-inline-end:var(--_inset);--_h:var(--_btn-h);block-size:var(--_btn-h)}
.gh-search:not(.gh-search--lg) .gh-search__submit{--_px:var(--gh-ref-space-400);font-size:var(--gh-ref-font-size-100)}

/* listbox (popover layer → shadow allowed) */
.gh-search__listbox{position:absolute;inset-block-start:calc(100% + var(--gh-ref-space-200));inset-inline:0;z-index:var(--gh-ref-z-popover);
  max-block-size:min(420px,60vh);overflow:auto;overscroll-behavior:contain;padding:var(--gh-ref-space-200);
  background:var(--gh-color-surface-2);border:1px solid var(--gh-color-border-default);border-radius:var(--gh-radius-inner);box-shadow:var(--gh-shadow-overlay-sm)}
.gh-search__group{padding:var(--gh-ref-space-250) var(--gh-ref-space-250) var(--gh-ref-space-100);font-size:var(--gh-ref-font-size-75);font-weight:var(--gh-ref-font-weight-semibold);color:var(--gh-color-text-tertiary)}
/* suggestion rows = gh-option gh-option--lg (option.css, v0.3 gap A3); match = mark.gh-highlight (highlight.css) */
.gh-search__empty{padding:var(--gh-ref-space-300) var(--gh-ref-space-250);font-size:var(--gh-ref-font-size-200);color:var(--gh-color-text-tertiary)}
.gh-search__status{position:absolute;inline-size:1px;block-size:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}


/* ===== components/search-trigger.css ===== */
/* ==========================================================================
   Search trigger — the pill that opens the command palette (⌘K / Ctrl+K).
   Consolidates .search-btn (header, topbar, learn-bar). Behaviour: data-gh-cmdk-open.
   ========================================================================== */
.gh-search-trigger{
  display:inline-flex;align-items:center;gap:var(--gh-ref-space-250);flex:none;
  width:250px;max-width:100%;height:38px;padding-inline:var(--gh-ref-space-300) var(--gh-ref-space-200);
  border-radius:var(--gh-radius-pill);background:var(--gh-color-surface-1);border:1px solid var(--gh-color-border-default);
  color:var(--gh-color-text-tertiary);font-size:var(--gh-type-label-size);white-space:nowrap;
  transition:border-color var(--gh-motion-duration-fast) var(--gh-motion-ease),color var(--gh-motion-duration-fast) var(--gh-motion-ease);
}
.gh-search-trigger:hover{border-color:var(--gh-color-border-strong);color:var(--gh-color-text-secondary)}
.gh-search-trigger:focus-visible{border-radius:var(--gh-radius-pill)}
.gh-search-trigger__label{overflow:hidden;text-overflow:ellipsis;min-width:0}
.gh-search-trigger__keys{margin-inline-start:auto;display:flex;gap:3px;direction:ltr;flex:none}
.gh-search-trigger--wide{width:340px}
/* icon-only (mobile, narrow bars) */
.gh-search-trigger--compact{width:auto;padding-inline:var(--gh-ref-space-250)}
.gh-search-trigger--compact .gh-search-trigger__label,.gh-search-trigger--compact .gh-search-trigger__keys{display:none}
@media (max-width:860px){
  .gh-search-trigger{width:auto;height:40px;padding-inline:var(--gh-ref-space-250)}
  .gh-search-trigger__label,.gh-search-trigger__keys{display:none}
}


/* ===== components/section-head.css ===== */
/* ==========================================================================
   Section head — eyebrow + title (+ dim second line) + lede, actions at the end.
   Consolidates .sec-head/.h2/.lede (home), .st-h (course, courses, checkout), .sec-hd (settings),
   .greet (dashboard, instructor) and .co-head (checkout).
   ========================================================================== */
.gh-section-head{display:flex;align-items:flex-end;justify-content:space-between;flex-wrap:wrap;gap:var(--gh-ref-space-400) var(--gh-ref-space-600);margin-bottom:var(--gh-ref-space-600)}
.gh-section-head>*{min-width:0}
.gh-section-head__title{overflow-wrap:break-word;margin-top:var(--gh-ref-space-200);font-size:var(--gh-type-display-size);font-weight:var(--gh-type-display-weight);line-height:var(--gh-type-display-line-height)}
.gh-section-head__title:first-child{margin-top:0}
/* dim second clause: «طراحی لوگو <span class="gh-section-head__dim">از ایده تا اجرا</span>» */
.gh-section-head__dim{color:var(--gh-color-text-tertiary);font-weight:var(--gh-ref-font-weight-light)}
.gh-section-head__lede{margin-top:var(--gh-ref-space-150);max-width:60ch;color:var(--gh-color-text-secondary)}
.gh-section-head__lede b{color:var(--gh-color-text-primary);font-weight:var(--gh-ref-font-weight-semibold)}
.gh-section-head__actions{display:flex;align-items:center;flex-wrap:wrap;gap:var(--gh-ref-space-200)}
/* page title (dashboard greeting, checkout, settings section) */
.gh-section-head--page .gh-section-head__title{font-size:var(--gh-type-heading-1-size);font-weight:var(--gh-ref-font-weight-black);line-height:var(--gh-type-heading-1-line-height)}
/* section inside a long page (curriculum, reviews, FAQ) */
.gh-section-head--sm{margin-bottom:var(--gh-ref-space-400)}
.gh-section-head--sm .gh-section-head__title{font-size:var(--gh-type-heading-2-size);font-weight:var(--gh-ref-font-weight-extrabold);line-height:var(--gh-type-heading-2-line-height)}
.gh-section-head--sm .gh-section-head__lede{font-size:var(--gh-type-body-sm-size)}
.gh-section-head__title:focus{outline:none} /* programmatic focus target after in-page navigation */

@media (max-width:860px){
  .gh-section-head{margin-bottom:var(--gh-ref-space-400)}
  .gh-section-head__title{font-size:var(--gh-type-heading-1-size)}
  .gh-section-head--page .gh-section-head__title{font-size:var(--gh-type-heading-1-size)}
  .gh-section-head--sm .gh-section-head__title{font-size:var(--gh-type-heading-3-size)}
}


/* ===== components/section-nav.css ===== */
/* ==========================================================================
   Section nav — vertical list of sections (settings). Side rail on desktop; on mobile it is the
   list screen itself (rows with description + chevron). Consolidates .snav / .snav-me / .snav-l / .danger-l.
   ========================================================================== */
.gh-section-nav{display:flex;flex-direction:column;gap:2px;min-width:0}
/* doubled specificity: .gh-tile (later in the bundle) sets position:relative */
.gh-section-nav--sticky.gh-section-nav--sticky{position:sticky;top:calc(var(--gh-layout-header-height) + var(--gh-ref-space-300))}
.gh-section-nav__list{display:grid;gap:2px}
.gh-section-nav__list+.gh-section-nav__list{margin-top:var(--gh-ref-space-200);padding-top:var(--gh-ref-space-200);border-block-start:1px solid var(--gh-color-border-subtle)}
.gh-section-nav__link{display:flex;align-items:center;gap:var(--gh-ref-space-300);min-height:48px;padding:var(--gh-ref-space-200) var(--gh-ref-space-250);border-radius:var(--gh-radius-inner);color:var(--gh-color-text-secondary);min-width:0}
.gh-section-nav__link:hover{background:var(--gh-color-surface-2);color:var(--gh-color-text-primary)}
.gh-section-nav__link:focus-visible{border-radius:var(--gh-radius-inner)}
.gh-section-nav__icon{display:grid;place-items:center;width:32px;height:32px;border-radius:9px;background:var(--gh-color-surface-2);color:var(--gh-color-text-secondary);flex:none}
.gh-section-nav__text{flex:1;min-width:0;line-height:var(--gh-type-label-line-height)}
.gh-section-nav__label{display:block;font-size:var(--gh-type-label-size);font-weight:var(--gh-ref-font-weight-medium)}
.gh-section-nav__desc{display:none;margin-top:2px;font-size:var(--gh-type-caption-size);color:var(--gh-color-text-tertiary)}
.gh-section-nav__link>.gh-badge{flex:none;padding-inline:var(--gh-ref-space-200)}  /* counts use gh-badge (tag.css) */
/* needs attention (unverified email…) — always pair with a title / sr text */
.gh-section-nav__dot{width:8px;height:8px;border-radius:50%;flex:none;background:var(--gh-color-status-warning)}
.gh-section-nav__chevron{display:none;color:var(--gh-color-text-tertiary);flex:none}
.gh-section-nav__link[aria-current="page"]{background:var(--gh-color-surface-2);color:var(--gh-color-text-primary)}
.gh-section-nav__link[aria-current="page"] .gh-section-nav__icon{background:var(--gh-color-accent-soft);color:var(--gh-color-accent-ink)}
.gh-section-nav__link[aria-current="page"] .gh-section-nav__label{font-weight:var(--gh-ref-font-weight-semibold)}
.gh-section-nav__list--danger .gh-section-nav__icon{color:var(--gh-color-status-danger)}
.gh-section-nav__list--danger .gh-section-nav__link[aria-current="page"] .gh-section-nav__icon{background:var(--gh-color-status-danger-soft);color:var(--gh-color-status-danger)}

/* list screen on mobile (or forced with --list) */
@media (max-width:860px){
  .gh-section-nav:not(.gh-section-nav--rail){position:static}
  .gh-section-nav:not(.gh-section-nav--rail) .gh-section-nav__link{padding:var(--gh-ref-space-300) var(--gh-ref-space-200);border-radius:0}
  .gh-section-nav:not(.gh-section-nav--rail) .gh-section-nav__desc,
  .gh-section-nav:not(.gh-section-nav--rail) .gh-section-nav__chevron{display:block}
  .gh-section-nav:not(.gh-section-nav--rail) li+li>.gh-section-nav__link{border-block-start:1px solid var(--gh-color-border-subtle)}
  .gh-section-nav:not(.gh-section-nav--rail) .gh-section-nav__link[aria-current="page"]{background:none}
}
.gh-section-nav--list .gh-section-nav__link{padding:var(--gh-ref-space-300) var(--gh-ref-space-200);border-radius:0}
.gh-section-nav--list .gh-section-nav__desc,.gh-section-nav--list .gh-section-nav__chevron{display:block}
.gh-section-nav--list li+li>.gh-section-nav__link{border-block-start:1px solid var(--gh-color-border-subtle)}
/* profile card at the top of the rail reuses gh-me-card (app-shell.css) */
.gh-section-nav>.gh-me-card{margin-top:0;margin-bottom:var(--gh-ref-space-200)}


/* ===== components/segmented.css ===== */
/* ==========================================================================
   @component segmented — gh-segmented (single choice among 2–5 short options)
   Consolidates: base .seg (aria-pressed / aria-selected), profile/settings .seg[role=radiogroup] (aria-checked),
   courses .seg.vseg (icon-only view switch), review .tools (tool group, inverse + kbd hint).
   Markup: <div class="gh-segmented" role="radiogroup" aria-label="…" data-gh-segmented>
             <button class="gh-segmented__item" role="radio" aria-checked="true">…</button> …</div>
   (role=group + aria-pressed is also supported, e.g. toolbars.) Arrow keys move + select (roving tabindex).
   Modifiers: --block (equal widths, full row) · --icon (square icon-only items) · --strong (inverse selection; toolbars) · --sm
   ========================================================================== */
.gh-segmented{--_h:30px;display:inline-flex;align-items:center;gap:2px;padding:3px;max-inline-size:100%;border-radius:var(--gh-radius-pill);
  overflow-x:auto;scrollbar-width:none;overscroll-behavior-x:contain; /* narrower than its items: scrolls inside its frame, items never paint over the border (§4b.1) */
  background:var(--gh-color-surface-2);border:1px solid var(--gh-color-border-subtle);vertical-align:middle}
.gh-segmented--sm{--_h:26px}
.gh-segmented--block{display:flex;inline-size:100%}
.gh-segmented--block>.gh-segmented__item{flex:1 1 0;min-inline-size:0}

.gh-segmented__item{position:relative;display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;gap:var(--gh-ref-space-150);
  block-size:var(--_h);min-inline-size:var(--_h);padding-inline:var(--gh-ref-space-300);border-radius:var(--gh-radius-pill);border:0;background:transparent;
  color:var(--gh-color-text-secondary);font-family:inherit;font-size:var(--gh-ref-font-size-100);font-weight:var(--gh-ref-font-weight-medium);line-height:1;
  white-space:nowrap;cursor:pointer;-webkit-tap-highlight-color:transparent;
  transition:background-color var(--gh-motion-duration-base) var(--gh-motion-ease),color var(--gh-motion-duration-base) var(--gh-motion-ease)}
.gh-segmented__item:hover{color:var(--gh-color-text-primary)}
.gh-segmented__item:focus-visible{border-radius:var(--gh-radius-pill);outline-offset:0}
.gh-segmented__item[aria-checked="true"],.gh-segmented__item[aria-pressed="true"],.gh-segmented__item[aria-selected="true"]{background:var(--gh-color-surface-4);color:var(--gh-color-text-primary)}
.gh-segmented__item:disabled{color:var(--gh-color-text-disabled);cursor:not-allowed}
.gh-segmented--icon .gh-segmented__item{padding-inline:0;inline-size:calc(var(--_h) + 6px)}
.gh-segmented__item .gh-kbd{block-size:16px;min-inline-size:16px;padding-inline:3px;border-block-end-width:1px;background:transparent;color:inherit;border-color:currentColor;opacity:.55}

.gh-segmented--strong .gh-segmented__item[aria-checked="true"],.gh-segmented--strong .gh-segmented__item[aria-pressed="true"]{background:var(--gh-color-surface-inverse);color:var(--gh-color-text-inverse)}

@media (pointer:coarse){
  .gh-segmented__item::before{content:"";position:absolute;inset:min(0px,calc((100% - var(--gh-ref-size-touch-min)) / 2)) 0}
}


/* ===== components/select.css ===== */
/* ==========================================================================
   @component select — gh-select (native <select> in a wrapper that draws the chevron) · gh-select--pill
   Consolidates: auth/profile/settings select.inp, checkout/course/courses select.input (+ .rtools pill override),
   base .filters select (pill, 34px), instructor/review .sel (select-pill). All used inline SVG chevrons with raw hex —
   the wrapper's ::after mask is coloured by tokens instead, so it follows high-contrast mode.
   Markup: <span class="gh-select"><select id="…" aria-describedby="…">…</select></span>
   Modifiers: --pill (toolbar sort/filter, 34px) · --sm · --lg · --block. States: :disabled, aria-invalid on the <select>.
   ========================================================================== */
.gh-select{--_h:var(--gh-input-height);--_r:var(--gh-input-radius);--_pi:var(--gh-ref-space-400);position:relative;display:inline-flex;min-inline-size:0;vertical-align:middle;inline-size:100%}
.gh-select>select{appearance:none;-webkit-appearance:none;inline-size:100%;min-inline-size:0;block-size:var(--_h);margin:0;
  padding-inline:var(--_pi) calc(var(--_pi) + 22px);border-radius:var(--_r);background:var(--gh-input-bg);border:1px solid var(--gh-color-border-default);
  color:var(--gh-color-text-primary);font-family:inherit;font-size:var(--gh-ref-font-size-300);text-overflow:ellipsis;cursor:pointer;
  transition:border-color var(--gh-motion-duration-base) var(--gh-motion-ease)}
.gh-select>select:hover{border-color:var(--gh-color-border-strong)}
.gh-select>select:focus{border-color:var(--gh-color-accent-ink)}
.gh-select>select:focus-visible{border-radius:var(--_r);outline-offset:1px;outline-color:var(--gh-color-focus-field);box-shadow:0 0 0 3px var(--gh-color-focus-field-halo)}
.gh-select>select[aria-invalid="true"]{border-color:var(--gh-color-status-danger)}
.gh-select>select:disabled{opacity:.5;cursor:not-allowed}
.gh-select>select option{background:var(--gh-color-surface-2);color:var(--gh-color-text-primary)}
.gh-select::after{content:"";position:absolute;inset-block:0;inset-inline-end:var(--_pi);margin-block:auto;inline-size:14px;block-size:14px;pointer-events:none;
  background:var(--gh-color-text-secondary);
  -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center/contain no-repeat;
  mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center/contain no-repeat}
.gh-select--pill{--_h:var(--gh-button-height-sm);--_r:var(--gh-radius-pill);--_pi:var(--gh-ref-space-300);inline-size:auto}
.gh-select--pill>select,.gh-select--sm>select{font-size:var(--gh-ref-font-size-100)}
.gh-select--sm{--_h:36px;--_pi:var(--gh-ref-space-300)}
.gh-select--lg{--_h:var(--gh-ref-size-control-lg)}
/* inline label + pill select in toolbars: «مرتب‌سازی: [جدیدترین ▾]» */
.gh-select-inline{display:inline-flex;align-items:center;gap:var(--gh-ref-space-150);font-size:var(--gh-ref-font-size-100);color:var(--gh-color-text-tertiary);white-space:nowrap}
@media (pointer:coarse){.gh-select--pill{--_h:40px}}


/* ===== components/sheet.css ===== */
/* ==========================================================================
   Bottom sheet — task panel that slides up from the bottom (filters, actions, site menu on mobile).
   Consolidates .sheet/.sheet-box/.grab (review), .fpanel bottom-sheet mode + .scrim (courses).
   Same behaviour API as the modal: [hidden] + data-gh-open / data-gh-close (role=dialog, aria-modal).
   ========================================================================== */
.gh-sheet{position:fixed;inset:0;z-index:var(--gh-ref-z-overlay);display:flex;align-items:flex-end;justify-content:center;background:var(--gh-color-bg-scrim);animation:gh-sheet-fade var(--gh-motion-duration-base) var(--gh-motion-ease)}
.gh-sheet__panel{display:flex;flex-direction:column;width:min(640px,100%);max-height:88dvh;
  background:var(--gh-color-surface-1);border:1px solid var(--gh-color-border-default);border-block-end:0;border-radius:var(--gh-radius-tile) var(--gh-radius-tile) 0 0;
  box-shadow:var(--gh-shadow-overlay-lg);animation:gh-sheet-up var(--gh-motion-duration-slow) var(--gh-motion-ease)}
.gh-sheet__grab{flex:none;width:40px;height:4px;margin:var(--gh-ref-space-250) auto 0;border-radius:2px;background:var(--gh-color-border-strong)}
.gh-sheet__head{display:flex;align-items:center;gap:var(--gh-ref-space-200);padding:var(--gh-ref-space-250) var(--gh-ref-space-400) var(--gh-ref-space-300);border-block-end:1px solid var(--gh-color-border-subtle);flex:none}
.gh-sheet__title{flex:1;min-width:0;font-size:var(--gh-type-body-lg-size);font-weight:var(--gh-ref-font-weight-extrabold);line-height:var(--gh-type-label-line-height)}
.gh-sheet__title:focus{outline:none}
.gh-sheet__body{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;padding:var(--gh-ref-space-300) var(--gh-ref-space-400)}
.gh-sheet__foot{display:flex;gap:var(--gh-ref-space-200);flex:none;padding:var(--gh-ref-space-300) var(--gh-ref-space-400) calc(var(--gh-ref-space-300) + env(safe-area-inset-bottom));border-block-start:1px solid var(--gh-color-border-subtle);background:var(--gh-color-surface-1)}
.gh-sheet__foot>:last-child{flex:1}
/* side drawer from the inline-end edge (desktop filter panel, detail drawer) */
.gh-sheet--side{align-items:stretch;justify-content:flex-end}
.gh-sheet--side .gh-sheet__panel{width:min(420px,100%);max-height:none;border-radius:0;border:0;border-inline-start:1px solid var(--gh-color-border-default);animation-name:gh-sheet-fade}
.gh-sheet--side .gh-sheet__grab{display:none}
@keyframes gh-sheet-fade{from{opacity:0}}
@keyframes gh-sheet-up{from{transform:translateY(40px);opacity:0}}


/* ===== components/shortcut-sheet.css ===== */
/* ==========================================================================
   Shortcut sheet — grouped keyboard map, usually inside a gh-modal («?» opens it).
   Consolidates .kbs-g (lesson) and .keys (review); quiz/dashboard key hints use the same rows.
   Keys are <kbd class="gh-kbd"> in an LTR-isolated group.
   ========================================================================== */
.gh-shortcuts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 var(--gh-ref-space-700)}
.gh-shortcuts__group{display:contents}
.gh-shortcuts__title{grid-column:1/-1;margin-top:var(--gh-ref-space-400);margin-bottom:var(--gh-ref-space-100);font-size:var(--gh-type-caption-size);font-weight:var(--gh-ref-font-weight-semibold);color:var(--gh-color-text-tertiary)}
.gh-shortcuts__title:first-child{margin-top:0}
.gh-shortcuts__row{display:flex;align-items:center;justify-content:space-between;gap:var(--gh-ref-space-300);min-height:40px;padding-block:var(--gh-ref-space-150);border-block-end:1px solid var(--gh-color-border-subtle);font-size:var(--gh-type-label-size);color:var(--gh-color-text-secondary)}
.gh-shortcuts__keys{display:flex;align-items:center;gap:var(--gh-ref-space-100);direction:ltr;unicode-bidi:isolate;flex:none;color:var(--gh-color-text-tertiary);font-size:var(--gh-type-caption-size)}
/* inline list of hints (side tile, under a quiz) */
.gh-shortcuts--compact{grid-template-columns:minmax(0,1fr);gap:var(--gh-ref-space-150)}
.gh-shortcuts--compact .gh-shortcuts__row{min-height:0;padding:0;border:0;font-size:var(--gh-type-caption-size);color:var(--gh-color-text-tertiary)}
@media (max-width:560px){.gh-shortcuts{grid-template-columns:minmax(0,1fr)}}


/* ===== components/site-footer.css ===== */
/* ==========================================================================
   Site footer — brand column + link columns + base row.
   Consolidates .foot/.cols/.base (home, courses, course, checkout, auth, profile, review).
   ========================================================================== */
.gh-site-footer{margin-top:var(--gh-ref-space-300);padding-block:var(--gh-ref-space-1200) var(--gh-ref-space-1800);border-block-start:1px solid var(--gh-color-border-subtle)}
.gh-site-footer__cols{display:grid;grid-template-columns:2fr repeat(4,minmax(0,1fr));gap:var(--gh-ref-space-600)}
.gh-site-footer__about{margin-top:var(--gh-ref-space-300);max-width:300px;font-size:var(--gh-type-body-sm-size);color:var(--gh-color-text-secondary)}
.gh-site-footer__title{margin-bottom:var(--gh-ref-space-250);font-size:var(--gh-type-label-size);font-weight:var(--gh-ref-font-weight-bold)}
.gh-site-footer__links li{font-size:var(--gh-type-label-size);line-height:2.1;color:var(--gh-color-text-secondary)}
.gh-site-footer__links a{display:inline-block;border-radius:var(--gh-radius-control)}
.gh-site-footer__links a:hover{color:var(--gh-color-text-primary)}
.gh-site-footer__base{display:flex;justify-content:space-between;flex-wrap:wrap;gap:var(--gh-ref-space-400);margin-top:var(--gh-ref-space-1000);padding-top:var(--gh-ref-space-500);border-block-start:1px solid var(--gh-color-border-subtle);font-size:var(--gh-type-caption-size);color:var(--gh-color-text-tertiary)}
@media (max-width:860px){
  .gh-site-footer{padding-block:var(--gh-ref-space-1000) var(--gh-ref-space-1200)}
  .gh-site-footer__cols{grid-template-columns:repeat(2,minmax(0,1fr))}
  .gh-site-footer__cols>:first-child{grid-column:1/-1}
  .gh-site-footer__links li{line-height:2.6}  /* ≥ 44px rows on touch */
}
/* touch: each link's hit area reaches 44px tall without changing the row rhythm (the rows stay 2.6 lines) */
@media (pointer:coarse){.gh-site-footer__links a{position:relative}.gh-site-footer__links a::before{content:"";position:absolute;inset:min(0px,calc((100% - var(--gh-ref-size-touch-min)) / 2)) 0}}


/* ===== components/site-header.css ===== */
/* ==========================================================================
   Site header (public pages) — sticky, blurred, hairline.
   Consolidates .hdr/.nav/.tools/.menu-btn (home, courses, course, checkout, auth, profile) + .nav-current.
   Below 1240px the nav collapses into a menu button that opens a gh-sheet («منو»).
   ========================================================================== */
.gh-site-header{position:sticky;top:0;z-index:var(--gh-ref-z-sticky);background:var(--gh-color-bg-header);-webkit-backdrop-filter:blur(14px);backdrop-filter:blur(14px);border-block-end:1px solid var(--gh-color-border-subtle)}
.gh-site-header__inner{display:flex;align-items:center;gap:var(--gh-ref-space-700);height:var(--gh-layout-header-height);min-width:0}
.gh-site-header__nav{display:flex;gap:var(--gh-ref-space-100);min-width:0}
.gh-site-header__link{display:inline-flex;align-items:center;min-height:34px;padding:var(--gh-ref-space-150) var(--gh-ref-space-300);border-radius:var(--gh-radius-pill);font-size:var(--gh-type-label-size);font-weight:var(--gh-ref-font-weight-medium);color:var(--gh-color-text-secondary);white-space:nowrap}
.gh-site-header__link:hover{color:var(--gh-color-text-primary);background:var(--gh-color-surface-2)}
.gh-site-header__link[aria-current="page"]{color:var(--gh-color-text-primary);background:var(--gh-color-surface-2)}
.gh-site-header__link:focus-visible{border-radius:var(--gh-radius-pill)}
.gh-site-header__tools{margin-inline-start:auto;display:flex;align-items:center;gap:var(--gh-ref-space-200);min-width:0}
.gh-site-header .gh-site-header__menu{display:none}

/* mobile menu list (inside a gh-sheet) */
.gh-site-menu{display:grid;gap:2px}
.gh-site-menu a{display:flex;align-items:center;gap:var(--gh-ref-space-300);min-height:48px;padding-inline:var(--gh-ref-space-300);border-radius:var(--gh-radius-inner);font-weight:var(--gh-ref-font-weight-medium);color:var(--gh-color-text-secondary)}
.gh-site-menu a:hover{background:var(--gh-color-surface-3);color:var(--gh-color-text-primary)}
.gh-site-menu a[aria-current="page"]{background:var(--gh-color-surface-3);color:var(--gh-color-text-primary)}

@media (max-width:1240px){
  .gh-site-header__nav{display:none}
  .gh-site-header .gh-site-header__menu{display:inline-grid}
}
@media (max-width:860px){
  .gh-site-header__inner{gap:var(--gh-ref-space-250);height:60px}
  /* secondary actions (e.g. «ورود» ghost button) hide; the primary CTA stays */
  .gh-site-header .gh-site-header__optional{display:none}
  /* the one-click theme switch gives its room back on phones; the theme stays in the «نمایش» popover (ADR 0028) */
  .gh-site-header__tools>[data-gh-theme-toggle]{display:none}
}


/* ===== components/skeleton.css ===== */
/* ==========================================================================
   Skeleton — neutral loading placeholder: gentle pulse, no shimmer gradient.
   Consolidates .skel (auth/profile/settings, courses, checkout), .skel::after (instructor, review),
   .sk-b (lesson). Put aria-busy="true" + a visually hidden «در حال بارگذاری…» on the container.
   ========================================================================== */
.gh-skeleton{display:block;height:12px;border-radius:var(--gh-radius-control);background:var(--gh-color-surface-3);animation:gh-skeleton-pulse 1.4s ease-in-out infinite}
.gh-skeleton--text{height:.7em;margin-block:.35em;border-radius:4px}
.gh-skeleton--title{height:1.1em;width:60%;border-radius:6px}
.gh-skeleton--circle{width:32px;height:32px;border-radius:50%;flex:none}
.gh-skeleton--block{height:auto;aspect-ratio:16/9;border-radius:var(--gh-radius-inner)}
.gh-skeleton--on-raised{background:var(--gh-color-surface-4)}
/* row: avatar + two lines (queue, comments, notifications) */
.gh-skeleton-row{display:grid;grid-template-columns:32px minmax(0,1fr);align-items:center;gap:var(--gh-ref-space-250);padding:var(--gh-ref-space-250)}
.gh-skeleton-row__lines{display:grid;gap:7px}
.gh-skeleton-row__lines .gh-skeleton{height:10px}
.gh-skeleton-row__lines .gh-skeleton:last-child{width:62%}
/* line primitives (v0.2, gap B9): body lines of a busy card / list item, no inline styles needed.
   Height follows the text it stands for; width modifiers give the ragged edge of real copy. */
.gh-skeleton__line{display:block;inline-size:100%;block-size:.8rem;border-radius:4px;background:var(--gh-color-surface-3);animation:gh-skeleton-pulse 1.4s ease-in-out infinite}
.gh-skeleton__line--title{block-size:1.1rem;border-radius:6px}
.gh-skeleton__line--xs{inline-size:30%}
.gh-skeleton__line--sm{inline-size:45%}
.gh-skeleton__line--md{inline-size:60%}
.gh-skeleton__line--lg{inline-size:70%}
.gh-skeleton__line--xl{inline-size:85%}
.gh-skeleton-lines{display:grid;gap:var(--gh-ref-space-200);min-width:0}
@keyframes gh-skeleton-pulse{50%{opacity:.45}}


/* ===== components/sla.css ===== */
/* ==========================================================================
   gh-sla — response-time indicator (Group C)
   Consolidates: instructor .sla + review .sla (identical copies), course .fbw .sla (promise box → gh-sla--block).
   Always colour + icon + words («۶ ساعت مانده», «۲ ساعت دیر»), never colour alone.
   --ok on time, --warn close to the limit (< 25% left), --late past the promise.
   ========================================================================== */
.gh-sla{display:inline-flex;align-items:center;gap:var(--gh-ref-space-100);block-size:1.375rem;padding-inline:var(--gh-ref-space-150) var(--gh-ref-space-200);border-radius:var(--gh-radius-pill);
  background:var(--gh-color-surface-3);color:var(--gh-color-text-secondary);font-size:var(--gh-type-caption-size);font-weight:var(--gh-ref-font-weight-semibold);white-space:nowrap}
.gh-sla .gh-icon{inline-size:.8rem;block-size:.8rem;stroke-width:2}
.gh-sla--ok{background:var(--gh-color-status-success-soft);color:var(--gh-color-status-success)}
.gh-sla--warn{background:var(--gh-color-status-warning-soft);color:var(--gh-color-status-warning)}
.gh-sla--late{background:var(--gh-color-status-danger-soft);color:var(--gh-color-status-danger)}
/* block: promise box with a thin figure (course page, assignment waiting) */
.gh-sla--block{display:flex;block-size:auto;gap:var(--gh-ref-space-400);padding:var(--gh-ref-space-300) var(--gh-ref-space-400);border-radius:var(--gh-radius-inner);
  background:var(--gh-color-surface-2);border:1px solid var(--gh-color-border-subtle);color:var(--gh-color-text-secondary);font-weight:var(--gh-ref-font-weight-regular);white-space:normal;line-height:1.5}
.gh-sla--block .gh-sla__figure{font-size:var(--gh-type-figure-md-size);font-weight:var(--gh-ref-font-weight-thin);line-height:1;color:var(--gh-color-text-primary);white-space:nowrap}
.gh-sla--block .gh-sla__figure small{font-size:var(--gh-type-label-sm-size);color:var(--gh-color-text-secondary);font-weight:var(--gh-ref-font-weight-regular)}
.gh-sla--block small{display:block;font-size:var(--gh-type-caption-size);color:var(--gh-color-text-tertiary)}
.gh-sla--block .gh-progress{margin-block-start:var(--gh-ref-space-150)}


/* ===== components/sortable.css ===== */
/* ==========================================================================
   @component sortable — gh-sortable (reorder a short list: drag · move buttons · Alt+↑/↓) — v0.2, gap A3
   Replaces: quiz .qz-ord (drag-to-order question, built from gh-panel rows).
   Markup:
   <ol class="gh-sortable" data-gh-sortable aria-label="…" aria-describedby="help">
     <li class="gh-sortable__item" data-value="a">
       <svg class="gh-icon gh-sortable__grip" aria-hidden="true">…i-grip</svg>
       <span class="gh-sortable__index">۱</span>
       <span class="gh-sortable__text">…</span>
       <span class="gh-sortable__moves">
         <button class="gh-icon-btn gh-icon-btn--sm" type="button" data-gh-move="-1">…i-chev-u</button>
         <button class="gh-icon-btn gh-icon-btn--sm" type="button" data-gh-move="1">…i-chev</button></span></li></ol>
   <p class="gh-sortable__help" id="help">…Alt + ↑/↓…</p>
   JS (actions.js «sortable»): roving focus (↑/↓ Home End), Alt+↑/↓ moves, buttons move, mouse drag (HTML5 DnD),
   touch / pen drag (pointer events: grip = immediate, row = long-press; v0.3 gap A2),
   renumbers, disables end buttons, labels buttons with the item text, announces «… حالا در جای n از N» in a polite
   live region, emits gh:change {value:[data-value…], item, from, to}. Locked: data-gh-locked="true" (after an answer).
   Result states (quiz): .is-correct · .is-incorrect on items (colour + a gh-tag with words, never colour alone).
   ========================================================================== */
.gh-sortable{display:grid;gap:var(--gh-ref-space-200);margin:0;padding:0;list-style:none}
.gh-sortable__item{--_bd:var(--gh-color-border-subtle);--_bg:var(--gh-color-surface-2);
  display:flex;align-items:center;gap:var(--gh-ref-space-250);min-inline-size:0;min-block-size:var(--gh-ref-size-touch-min);
  padding:var(--gh-ref-space-200) var(--gh-ref-space-300) var(--gh-ref-space-200) var(--gh-ref-space-200);
  background:var(--_bg);border:1px solid var(--_bd);border-radius:var(--gh-radius-inner);
  color:var(--gh-color-text-primary);font-size:var(--gh-type-label-size);line-height:1.6;cursor:grab;
  -webkit-user-select:none;user-select:none;
  transition:border-color var(--gh-motion-duration-base) var(--gh-motion-ease),background-color var(--gh-motion-duration-base) var(--gh-motion-ease),opacity var(--gh-motion-duration-base) var(--gh-motion-ease)}
.gh-sortable__item:hover{--_bd:var(--gh-color-border-strong)}
.gh-sortable__item:focus-visible{border-radius:var(--gh-radius-inner)}
.gh-sortable__grip{flex:none;color:var(--gh-color-text-tertiary)}
.gh-sortable__index{flex:none;display:grid;place-items:center;inline-size:1.625rem;block-size:1.625rem;border-radius:var(--gh-radius-control);
  background:var(--gh-color-surface-3);font-size:var(--gh-type-caption-size);font-weight:var(--gh-ref-font-weight-semibold);color:var(--gh-color-text-secondary)}
.gh-sortable__text{flex:1;min-inline-size:0}
.gh-sortable__moves{display:flex;gap:var(--gh-ref-space-50);flex:none}
.gh-sortable__help{display:flex;align-items:center;flex-wrap:wrap;gap:var(--gh-ref-space-100);margin-block-start:var(--gh-ref-space-300);
  font-size:var(--gh-type-caption-size);color:var(--gh-color-text-tertiary)}

/* drag + move feedback */
.gh-sortable__item.is-dragging{opacity:.5;cursor:grabbing}
.gh-sortable__item.is-over{--_bd:var(--gh-color-accent-border)}
.gh-sortable__item.is-moved{--_bg:var(--gh-color-surface-3)}
.gh-sortable__item.is-moved .gh-sortable__index{background:var(--gh-color-accent-default);color:var(--gh-color-accent-on)}

/* locked (answer checked) + result states */
.gh-sortable[data-gh-locked="true"] .gh-sortable__item{cursor:default}
.gh-sortable[data-gh-locked="true"] :is(.gh-sortable__moves,.gh-sortable__grip){display:none}
.gh-sortable[data-gh-locked="true"]~.gh-sortable__help{display:none}
.gh-sortable__item.is-correct{--_bd:var(--gh-color-status-success-border)}
.gh-sortable__item.is-incorrect{--_bd:var(--gh-color-status-danger)}
.gh-sortable__item.is-correct .gh-sortable__index{background:var(--gh-color-status-success-soft);color:var(--gh-color-status-success)}
.gh-sortable__item.is-incorrect .gh-sortable__index{background:var(--gh-color-status-danger-soft);color:var(--gh-color-status-danger)}

/* touch / pen drag (v0.3, gap A2) — pointer events: press the grip and drag at once, or long-press anywhere on the
   row (≈ 0.35 s, a scroll that starts first wins). The row follows the finger (transform only) and the others make
   room live; release drops it. The grip blocks native panning; the rest of the row still scrolls the page. */
.gh-sortable__grip{touch-action:none}
.gh-sortable__item{-webkit-touch-callout:none}
.gh-sortable__item.is-lifted{position:relative;z-index:1;--_bd:var(--gh-color-accent-border);--_bg:var(--gh-color-surface-3);
  box-shadow:var(--gh-shadow-overlay-sm);transition:none;cursor:grabbing}
@media (pointer:coarse){
  .gh-sortable__item{cursor:default}
  /* 44px hit area around the 18px grip without moving the layout */
  .gh-sortable__grip{box-sizing:content-box;padding:var(--gh-ref-space-250);margin:calc(-1 * var(--gh-ref-space-250))}
}


/* ===== components/spinner.css ===== */
/* ==========================================================================
   Spinner — indeterminate busy indicator. Consolidates .spin (16px in buttons: auth/profile/settings;
   44px page/player loading: checkout, lesson, assignment). Inline = currentColor arc; --lg = track + lime arc.
   With reduced motion the ring stops; pair with text («در حال پرداخت…») so it never relies on motion.
   ========================================================================== */
.gh-spinner{display:inline-block;width:16px;height:16px;flex:none;border-radius:50%;border:2px solid currentColor;border-inline-end-color:transparent;vertical-align:-.15em;
  animation:gh-spin .7s linear infinite}
.gh-spinner--md{width:24px;height:24px;border-width:2.5px}
.gh-spinner--lg{width:44px;height:44px;border-width:3px;border-color:var(--gh-color-surface-4);border-block-start-color:var(--gh-color-accent-ink);animation-duration:.9s}
.gh-spinner--center{display:block;margin-inline:auto}
:root[data-motion="reduce"] .gh-spinner{border-inline-end-color:currentColor;opacity:.5}
:root[data-motion="reduce"] .gh-spinner--lg{opacity:1;border-color:var(--gh-color-surface-4);border-block-start-color:var(--gh-color-accent-ink)}
@keyframes gh-spin{to{transform:rotate(360deg)}}
/* busy region: spinner + label, centred */
.gh-busy{display:flex;flex-direction:column;align-items:center;gap:var(--gh-ref-space-300);padding:var(--gh-ref-space-800) var(--gh-ref-space-400);text-align:center;color:var(--gh-color-text-secondary);font-size:var(--gh-type-body-sm-size)}


/* ===== components/stackbar.css ===== */
/* ==========================================================================
   gh-stackbar — one bar split into parts of a whole (Group C, v0.2 C5)
   Consolidates: settings .st-stor (offline storage: ours / other sites / free), course .co-chbar (lesson time share per
   chapter, drawn in the accordion meta slot — see accordion-meta.css).
   Colour rule (ADR 0006/0017): at most ONE accent part (the one the takeaway names, «you»); every other part is neutral
   (mark / strong / muted); the empty remainder is the track. Never status colours. 2px surface gap between parts.
   Parts are sized by --gh-share (percent of the whole bar). Each part can be focusable (tabindex=0, role=img, aria-label,
   data-gh-tip). Always pair with a gh-legend (≥ 2 encodings) and, in a chart frame, the data table.
   JS: GH.stackbar(el, {total, unit, parts:[{label, value, tone}], label}) renders parts + legend + table.
   ========================================================================== */
.gh-stackbar{--gh-stackbar-h:.875rem;--gh-stackbar-gap:2px;display:flex;flex-direction:column;gap:var(--gh-ref-space-300);min-inline-size:0}
.gh-stackbar__track{display:flex;gap:var(--gh-stackbar-gap);block-size:var(--gh-stackbar-h);border-radius:var(--gh-radius-pill);background:var(--gh-color-data-track);overflow:hidden}
.gh-stackbar__part{display:block;flex:0 1 auto;min-inline-size:0;inline-size:calc(var(--gh-share,0) * 1%);block-size:100%;background:var(--gh-color-data-mark);
  transition:inline-size var(--gh-motion-duration-slow) var(--gh-motion-ease)}
.gh-stackbar__part--you{background:var(--gh-color-data-you)}
.gh-stackbar__part--strong{background:var(--gh-color-data-mark-strong)}
.gh-stackbar__part--muted{background:var(--gh-color-text-disabled)}
.gh-stackbar__part:focus-visible{outline-offset:-2px}
.gh-stackbar__part:hover{filter:brightness(1.2)}
.gh-stackbar__part[hidden]{display:none}
/* legend keys for the neutral tones (gh-legend__key--you / --track already exist in chart.css) */
.gh-legend__key--strong{background:var(--gh-color-data-mark-strong)}
.gh-legend__key--muted{background:var(--gh-color-text-disabled)}
/* mini: a thin inline bar (no track, rounded parts). --gh-stackbar-w sets its length relative to its slot. */
.gh-stackbar--mini{--gh-stackbar-h:.375rem;flex-direction:row;display:inline-flex;inline-size:var(--gh-stackbar-w,100%);vertical-align:middle}
.gh-stackbar--mini .gh-stackbar__track{flex:1;background:none;border-radius:0}
.gh-stackbar--mini .gh-stackbar__part{border-radius:2px;min-inline-size:2px}
@media (forced-colors:active){.gh-stackbar__track{border:1px solid CanvasText}.gh-stackbar__part{background:CanvasText}.gh-stackbar__part--you{background:Highlight}}


/* ===== components/stat.css ===== */
/* ==========================================================================
   gh-stat — KPI / stat figure with delta and sparkline (Group C)
   Consolidates: instructor .kpi, review .stat-inline, dashboard .kstrip + .mini-kpis + .finish + .est,
   home .live .big, course .inst-k + .rv-score, courses .qp .stats, profile .fb-nums, review .overall,
   assignment .score-trend, auth .sp-eta.
   Figures are thin (weight 200); label in sentence case without a colon; delta = sign + period, colour =
   direction × whether up is good (gh-delta--good / --bad), always with an icon or sign, never colour alone.
   ========================================================================== */
.gh-stat{display:flex;flex-direction:column;gap:var(--gh-ref-space-50);min-width:0}
.gh-stat__label{display:flex;align-items:center;gap:var(--gh-ref-space-150);font-size:var(--gh-type-label-sm-size);color:var(--gh-color-text-secondary);line-height:var(--gh-ref-font-line-height-snug)}
.gh-stat__label .gh-icon{color:var(--gh-color-text-tertiary)}
/* number + unit are ONE line («۵۷ ساعت», owner 1405-08-26): the unit stays inline right after the number (no space in
   the markup, so no break opportunity between them) and is itself unbreakable; a cell too narrow for both shrinks the
   unit (container queries below: cells of --tiles, KPI grids that set container-type), it does not break the line.
   A compound value («۴ ساعت و ۲۰ دقیقه») may wrap only between its number + unit pairs. */
.gh-stat__value{font-size:var(--gh-type-figure-lg-size);font-weight:var(--gh-type-figure-lg-weight);line-height:var(--gh-type-figure-lg-line-height);color:var(--gh-color-text-primary)}
.gh-stat__value small{font-size:var(--gh-type-label-sm-size);font-weight:var(--gh-ref-font-weight-regular);color:var(--gh-color-text-secondary);margin-inline-start:var(--gh-ref-space-100);display:inline;white-space:nowrap}
.gh-stat__value.is-provisional{color:var(--gh-color-text-tertiary)}
.gh-stat__meta{font-size:var(--gh-type-caption-size);color:var(--gh-color-text-tertiary);display:flex;align-items:center;gap:var(--gh-ref-space-100);flex-wrap:wrap;line-height:var(--gh-type-caption-line-height)}
.gh-stat .gh-sparkline{margin-block-start:auto;padding-block-start:var(--gh-ref-space-200)}
.gh-stat--sm .gh-stat__value{font-size:var(--gh-type-figure-md-size);font-weight:var(--gh-ref-font-weight-thin)}
.gh-stat--lg .gh-stat__value{font-size:var(--gh-type-figure-xl-size);font-weight:var(--gh-type-figure-xl-weight)}
/* boxed: a KPI tile inside a tile grid (surface-1) or inside a tile (surface-2 via --inset) */
.gh-stat--box{padding:var(--gh-ref-space-400) var(--gh-ref-space-400);border-radius:var(--gh-radius-tile);background:var(--gh-color-surface-1);border:1px solid var(--gh-color-border-subtle)}
.gh-stat--inset{padding:var(--gh-ref-space-300) var(--gh-ref-space-400);border-radius:var(--gh-radius-inner);background:var(--gh-color-surface-2);border:1px solid var(--gh-color-border-subtle)}
.gh-stat--center{text-align:center;align-items:center}
/* tile cells size their figure by their own width: a narrow cell (4 tiles on a phone) gets the md figure */
.gh-stat-group--tiles>.gh-stat{container-type:inline-size} /* grid track sizes the cell, so containment is safe */
@container (max-width:9.5rem){.gh-stat__value{font-size:var(--gh-type-figure-md-size)}.gh-stat__label{font-size:var(--gh-type-caption-size)}
  .gh-stat-group--tiles>.gh-stat>*{margin-inline:calc(var(--gh-ref-space-100) * -1)} /* narrow cell: content uses 12px of the 16px inline padding so a word never reaches the frame; wide cells keep the original padding */}
/* truly narrow cell (4 tiles on a 360px phone, a long unit «میلیون تومان»): a value with a unit steps down, unit first —
   still on the number's line */
@container (max-width:8rem){.gh-stat__value:has(>small){font-size:var(--gh-ref-font-size-600)}.gh-stat__value small{font-size:var(--gh-type-caption-size);margin-inline-start:var(--gh-ref-space-50)}}
@container (max-width:6.5rem){.gh-stat__value small{font-size:var(--gh-ref-font-size-50)}}

/* delta */
.gh-delta{display:inline-flex;align-items:center;gap:var(--gh-ref-space-50);font-size:var(--gh-type-caption-size);font-weight:var(--gh-ref-font-weight-bold);color:var(--gh-color-text-tertiary);white-space:nowrap}
.gh-delta .gh-icon{inline-size:.85em;block-size:.85em;stroke-width:2.4}
.gh-delta__n{direction:ltr;unicode-bidi:isolate}
.gh-delta--good{color:var(--gh-color-status-success)}
.gh-delta--bad{color:var(--gh-color-status-danger)}
.gh-delta--down .gh-icon{transform:rotate(180deg)}

/* group: a row of stats separated by hairlines (tool headers, tile strips, popover footers) */
.gh-stat-group{display:flex;flex-wrap:wrap;row-gap:var(--gh-ref-space-300)}
.gh-stat-group>.gh-stat{flex:1 1 0;padding-inline:var(--gh-ref-space-400)}
/* only the plain (hairline) group drops the first cell's start padding — boxed cells (--tiles) keep it (§4b.1) */
.gh-stat-group:not(.gh-stat-group--tiles)>.gh-stat:first-child{padding-inline-start:0}
.gh-stat-group>.gh-stat+.gh-stat{border-inline-start:1px solid var(--gh-color-border-subtle)}
/* doubled class: wins over host layouts it is combined with (e.g. .gh-tile__foot is flex + align-items:center, which
   shrank each cell to its content — unequal heights, and the inline-size container collapsed so units wrapped) */
.gh-stat-group.gh-stat-group--tiles{display:grid;align-items:stretch;grid-template-columns:repeat(auto-fit,minmax(min(100%,11rem),1fr));gap:var(--gh-layout-gap)}
.gh-stat-group--tiles>.gh-stat{padding:var(--gh-ref-space-300) var(--gh-ref-space-400);border:1px solid var(--gh-color-border-subtle);border-radius:var(--gh-radius-inner);background:var(--gh-color-surface-2)}
.gh-stat-group--tiles>.gh-stat+.gh-stat{border-inline-start:1px solid var(--gh-color-border-subtle)}
@media (max-width:560px){
  .gh-stat-group:not(.gh-stat-group--tiles)>.gh-stat{flex-basis:40%}
  .gh-stat-group:not(.gh-stat-group--tiles)>.gh-stat:nth-child(odd){padding-inline-start:0;border-inline-start:0}
}


/* ===== components/stepper.css ===== */
/* ==========================================================================
   @component stepper — gh-stepper (number: − value +), the value is typed directly (owner rule 1405-08-26)
   Source: base .stepper (text-size control in every page's settings popover, dashboard weekly goal, settings text size).
   Markup: <div class="gh-stepper" role="group" aria-labelledby="goalL" data-gh-stepper data-min="1" data-max="20" data-step="1" data-value="5" data-unit="ساعت">
             <button class="gh-stepper__btn" type="button" data-gh-step="-1" aria-label="کم کردن هدف">−</button>
             <span class="gh-stepper__field"><input class="gh-stepper__value" type="text" inputmode="numeric" role="spinbutton"
               autocomplete="off" aria-labelledby="goalL" aria-valuemin="1" aria-valuemax="20" aria-valuenow="5"
               aria-valuetext="۵ ساعت" value="۵"><span class="gh-stepper__unit" aria-hidden="true">ساعت</span></span>
             <button class="gh-stepper__btn" type="button" data-gh-step="1" aria-label="زیاد کردن هدف">+</button></div>
   The value is a text input (spinbutton): click and type Persian or Latin digits (shown in Persian); Enter / blur
   validates (clamped to min–max, snapped to the step), Esc restores, ↑ ↓ step, PageUp / PageDown jump 10 steps,
   Home / End = min / max. The unit sits outside the editable part, inside the frame; clicking it focuses the number.
   The frame is CONTENT-SIZED (fit-content) — never stretched by a form column or grid cell — and sits at the start edge.
   The input's width follows the longest allowed value (--gh-stepper-ch, set by the JS from min / max / value).
   Legacy markup with <output class="gh-stepper__value"> is upgraded by the JS (lint flags it: tools/build.py).
   The text-size control uses the same markup with data-gh-setting="scale" (handled by core). Buttons disable at the bounds.
   Size: --lg (36 buttons, forms).
   ========================================================================== */
.gh-stepper{--_b:28px;display:inline-flex;align-items:center;gap:var(--gh-ref-space-50);inline-size:fit-content;max-inline-size:100%;justify-self:start;
  padding:3px;border:1px solid var(--gh-color-border-default);border-radius:var(--gh-radius-pill);background:var(--gh-color-surface-1);vertical-align:middle;flex:none}
.gh-stepper--lg{--_b:36px}
.gh-stepper__btn{position:relative;inline-size:var(--_b);block-size:var(--_b);border-radius:50%;display:grid;place-items:center;flex:none;padding:0;border:0;background:transparent;
  color:var(--gh-color-text-primary);font-family:inherit;font-size:var(--gh-ref-font-size-500);line-height:1;cursor:pointer;
  transition:background-color var(--gh-motion-duration-fast) var(--gh-motion-ease)}
.gh-stepper__btn:hover:not(:disabled){background:var(--gh-color-surface-4)}
.gh-stepper__btn:focus-visible{border-radius:50%}
.gh-stepper__btn:disabled{color:var(--gh-color-text-disabled);cursor:not-allowed}
/* the editable part + its unit: one focus ring around both, text cursor over both */
.gh-stepper__field{display:inline-flex;align-items:baseline;justify-content:center;gap:var(--gh-ref-space-50);min-block-size:var(--_b);align-self:stretch;
  padding-inline:var(--gh-ref-space-150);border-radius:var(--gh-radius-control);cursor:text;white-space:nowrap;
  font-size:var(--gh-ref-font-size-200);font-weight:var(--gh-ref-font-weight-semibold);color:var(--gh-color-text-primary);line-height:var(--_b)}
.gh-stepper__field:hover{background:var(--gh-color-surface-3)}
.gh-stepper__field:focus-within{background:var(--gh-color-surface-3);outline:var(--gh-focus-width) solid var(--gh-color-focus-field);outline-offset:0;box-shadow:0 0 0 3px var(--gh-color-focus-field-halo)}
.gh-stepper__value{inline-size:calc(var(--gh-stepper-ch, 3) * 1.25ch + 4px);min-inline-size:2ch;margin:0;padding:0;border:0;border-radius:0;background:transparent;
  font:inherit;line-height:inherit;color:inherit;text-align:center;appearance:textfield;-moz-appearance:textfield;cursor:text}
.gh-stepper__value::-webkit-outer-spin-button,.gh-stepper__value::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}
.gh-stepper__value:focus,.gh-stepper__value:focus-visible{outline:none;box-shadow:none}
.gh-stepper__value[aria-invalid="true"]{color:var(--gh-color-status-danger)}
.gh-stepper__unit{color:var(--gh-color-text-secondary);font-weight:var(--gh-ref-font-weight-medium)}
/* legacy read-only <output> (upgraded by the JS; kept so an un-upgraded page still reads) */
output.gh-stepper__value{display:inline-block;inline-size:auto;min-inline-size:0;padding-inline:var(--gh-ref-space-150);white-space:nowrap}
@media (pointer:coarse){.gh-stepper__btn::before{content:"";position:absolute;inset:min(0px,calc((100% - var(--gh-ref-size-touch-min)) / 2))}}


/* ===== components/steps.css ===== */
/* ==========================================================================
   Steps — ONE component for every multi-step progress, four looks:
     default  numbered wizard (checkout .wiz)              — markers + labels + connectors
     --status labelled tracks with a description (assignment .ssteps)
     --bar    thin equal segments, accent = progress (auth onboarding .stepbar)
     --dots   thin segments, accent = where you are (quiz .qprog .segs)
   State lives in ARIA: the current item has aria-current="step"; every item BEFORE it is done
   (CSS :has), so markup never carries done/cur/next classes. --complete marks all done.
   ========================================================================== */
.gh-steps{display:flex;align-items:flex-start;min-width:0;counter-reset:gh-step}
.gh-steps__item{--gh-step-color:var(--gh-color-text-tertiary);display:flex;align-items:center;gap:var(--gh-ref-space-250);flex:none;min-width:0;
  font-size:var(--gh-type-label-size);color:var(--gh-step-color);white-space:nowrap}
/* connector line before every item but the first */
.gh-steps__item+.gh-steps__item::before{content:"";flex:none;width:48px;height:2px;margin-inline:var(--gh-ref-space-300);border-radius:1px;background:var(--gh-color-surface-4)}
.gh-steps__marker{display:grid;place-items:center;width:30px;height:30px;flex:none;border-radius:50%;border:1.5px solid var(--gh-color-border-strong);
  font-size:var(--gh-type-label-sm-size);font-weight:var(--gh-ref-font-weight-bold);color:var(--gh-color-text-tertiary)}
.gh-steps__check{display:none;width:15px;height:15px;stroke-width:2.4}
.gh-steps__label{min-width:0}
.gh-steps__desc{display:block;font-size:var(--gh-type-caption-size);font-weight:var(--gh-ref-font-weight-regular);color:var(--gh-color-text-tertiary);white-space:normal}
/* a done step can be a button back to that step */
.gh-steps__link{display:flex;align-items:center;gap:var(--gh-ref-space-250);padding:2px var(--gh-ref-space-200) 2px 2px;border-radius:var(--gh-radius-pill);color:inherit}
.gh-steps__link:hover{color:var(--gh-color-text-primary)}
.gh-steps__link:focus-visible{border-radius:var(--gh-radius-pill)}

/* done = before the current step (or everything in a --complete list) */
.gh-steps__item:has(~ [aria-current="step"]),.gh-steps--complete .gh-steps__item{--gh-step-color:var(--gh-color-text-secondary)}
.gh-steps__item:has(~ [aria-current="step"]) .gh-steps__marker,.gh-steps--complete .gh-steps__marker{background:var(--gh-color-surface-4);border-color:var(--gh-color-surface-4);color:var(--gh-color-text-primary)}
.gh-steps__item:has(~ [aria-current="step"]) .gh-steps__num,.gh-steps--complete .gh-steps__num{display:none}
.gh-steps__item:has(~ [aria-current="step"]) .gh-steps__check,.gh-steps--complete .gh-steps__check{display:block}
.gh-steps__item:has(~ [aria-current="step"])+.gh-steps__item::before,.gh-steps--complete .gh-steps__item+.gh-steps__item::before,
.gh-steps__item[aria-current="step"]::before{background:var(--gh-color-text-tertiary)}
/* current */
.gh-steps__item[aria-current="step"]{--gh-step-color:var(--gh-color-text-primary);font-weight:var(--gh-ref-font-weight-semibold)}
.gh-steps__item[aria-current="step"] .gh-steps__marker{background:var(--gh-color-accent-default);border-color:var(--gh-color-accent-default);color:var(--gh-color-accent-on)}

@media (max-width:860px){
  /* wizard: labels under markers, connectors between them */
  .gh-steps:not(.gh-steps--status):not(.gh-steps--bar):not(.gh-steps--dots){width:100%}
  .gh-steps:not(.gh-steps--status):not(.gh-steps--bar):not(.gh-steps--dots) .gh-steps__item{position:relative;flex:1;flex-direction:column;gap:var(--gh-ref-space-100);font-size:var(--gh-type-caption-size);text-align:center;white-space:normal}
  .gh-steps:not(.gh-steps--status):not(.gh-steps--bar):not(.gh-steps--dots) .gh-steps__item+.gh-steps__item::before{position:absolute;top:14px;inset-inline-end:calc(50% + 20px);width:calc(100% - 40px);margin:0}
  .gh-steps:not(.gh-steps--status):not(.gh-steps--bar):not(.gh-steps--dots) .gh-steps__link{flex-direction:column;gap:var(--gh-ref-space-100);padding:0}
  .gh-steps:not(.gh-steps--status):not(.gh-steps--bar):not(.gh-steps--dots) .gh-steps__desc{display:none}
}

/* ---------- --status: track + title + description per step ---------- */
.gh-steps--status{display:grid;grid-template-columns:repeat(auto-fit,minmax(0,1fr));gap:var(--gh-ref-space-150)}
.gh-steps--status .gh-steps__item{flex-direction:column;align-items:stretch;gap:var(--gh-ref-space-200);white-space:normal;font-weight:var(--gh-ref-font-weight-semibold)}
.gh-steps--status .gh-steps__item::before,.gh-steps--status .gh-steps__item+.gh-steps__item::before{content:"";display:block;width:auto;height:6px;margin:0;border-radius:3px;background:var(--gh-color-surface-4)}
.gh-steps--status .gh-steps__marker{display:none}
.gh-steps--status .gh-steps__label{display:flex;flex-direction:column;line-height:var(--gh-type-label-line-height)}
.gh-steps--status .gh-steps__title{display:flex;align-items:center;gap:var(--gh-ref-space-150)}
.gh-steps--status .gh-steps__title .gh-steps__check{display:none;width:15px;height:15px;color:var(--gh-color-status-success)}
.gh-steps--status .gh-steps__item:has(~ [aria-current="step"])::before,.gh-steps--status.gh-steps--complete .gh-steps__item::before{background:var(--gh-color-text-tertiary)}
.gh-steps--status .gh-steps__item:has(~ [aria-current="step"]) .gh-steps__check,.gh-steps--status.gh-steps--complete .gh-steps__check{display:block}
.gh-steps--status .gh-steps__item[aria-current="step"]{--gh-step-color:var(--gh-color-accent-ink)}
.gh-steps--status .gh-steps__item[aria-current="step"]::before{background:var(--gh-color-data-you)}
.gh-steps--status .gh-steps__item[aria-current="step"]~.gh-steps__item{font-weight:var(--gh-ref-font-weight-medium)}
@media (max-width:560px){
  .gh-steps--status{grid-template-columns:repeat(2,minmax(0,1fr));row-gap:var(--gh-ref-space-300)}
}

/* ---------- --bar and --dots: segments only; labels stay for screen readers ---------- */
.gh-steps--bar,.gh-steps--dots{align-items:center;gap:var(--gh-ref-space-150);width:100%}
.gh-steps--dots{gap:var(--gh-ref-space-100)}
.gh-steps--bar .gh-steps__item,.gh-steps--dots .gh-steps__item{position:relative;flex:1;height:4px;border-radius:2px;background:var(--gh-color-surface-4);overflow:hidden;
  transition:background-color var(--gh-motion-duration-base) var(--gh-motion-ease)}
.gh-steps--dots .gh-steps__item{height:6px;border-radius:3px}
.gh-steps--bar .gh-steps__item+.gh-steps__item::before,.gh-steps--dots .gh-steps__item+.gh-steps__item::before{content:none}
.gh-steps--bar .gh-steps__marker,.gh-steps--dots .gh-steps__marker{display:none}
.gh-steps--bar .gh-steps__label,.gh-steps--dots .gh-steps__label{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
/* bar: done = accent (progress), current = partly filled (--gh-step-progress, default 45%) */
.gh-steps--bar .gh-steps__item:has(~ [aria-current="step"]),.gh-steps--bar.gh-steps--complete .gh-steps__item{background:var(--gh-color-data-you)}
.gh-steps--bar .gh-steps__item[aria-current="step"]::after{content:"";position:absolute;inset-block:0;inset-inline-start:0;width:var(--gh-step-progress,45%);border-radius:2px;background:var(--gh-color-data-you)}
/* dots: done = neutral, current = accent */
.gh-steps--dots .gh-steps__item:has(~ [aria-current="step"]),.gh-steps--dots.gh-steps--complete .gh-steps__item{background:var(--gh-color-text-tertiary)}
.gh-steps--dots .gh-steps__item[aria-current="step"]{background:var(--gh-color-data-you)}
/* a flagged / unanswered question in a quiz */
.gh-steps--dots .gh-steps__item--flag{box-shadow:inset 0 0 0 1.5px var(--gh-color-status-warning)}

/* counter next to bar/dots: «سؤال ۳ از ۱۰» */
.gh-steps-meta{display:flex;align-items:center;gap:var(--gh-ref-space-250);font-size:var(--gh-type-label-sm-size);color:var(--gh-color-text-secondary);white-space:nowrap}
.gh-steps-meta b{color:var(--gh-color-text-primary);font-weight:var(--gh-ref-font-weight-semibold)}
.gh-steps-meta>.gh-steps{width:220px;flex:0 1 220px;min-width:2.5rem} /* shrinks before the counter runs out of its box */


/* ===== components/story-card.css ===== */
/* ==========================================================================
   gh-story — 9:16 shareable story card (artwork, title, author, link + QR) (Group C)
   Consolidates: profile .story-card (+ data-bg art/lime, data-light), dashboard .story.
   Background: default media black, --art (artwork's dominant colour via --gh-story-bg), --accent (lime, ink text).
   Export size 1080×1920; the preview scales by inline-size only.
   ========================================================================== */
.gh-story{--gh-story-bg:var(--gh-color-surface-media);--gh-story-text:var(--gh-color-text-primary);--gh-story-muted:var(--gh-color-text-secondary);
  inline-size:var(--gh-story-w,16.875rem);max-inline-size:100%;aspect-ratio:9/16;display:flex;flex-direction:column;gap:var(--gh-ref-space-300);padding:var(--gh-ref-space-400);
  border-radius:18px;border:1px solid var(--gh-color-border-default);background:var(--gh-story-bg);color:var(--gh-story-text);overflow:hidden}
.gh-story--accent{--gh-story-bg:var(--gh-color-accent-default);--gh-story-text:var(--gh-color-accent-on);--gh-story-muted:var(--gh-color-accent-on)}
.gh-story--light{--gh-story-text:var(--gh-color-text-inverse);--gh-story-muted:var(--gh-color-text-inverse)}
.gh-story__top{display:flex;align-items:center;justify-content:space-between;gap:var(--gh-ref-space-200);font-size:var(--gh-type-label-sm-size);font-weight:var(--gh-ref-font-weight-black)}
.gh-story__mark{display:inline-flex;align-items:center;gap:var(--gh-ref-space-150)}
.gh-story__mark::before{content:"";inline-size:1.25rem;block-size:1.25rem;border-radius:6px;background:var(--gh-color-accent-default)}
.gh-story--accent .gh-story__mark::before{background:var(--gh-color-accent-on)}
.gh-story__kind{font-size:var(--gh-ref-font-size-50);font-weight:var(--gh-ref-font-weight-medium);color:var(--gh-story-muted);border:1px solid currentColor;border-radius:var(--gh-radius-pill);padding-inline:var(--gh-ref-space-200);opacity:.85}
.gh-story__art{position:relative;flex:1;min-block-size:0;border-radius:var(--gh-ref-radius-md);overflow:hidden}
.gh-story__art>svg,.gh-story__art>img{inline-size:100%;block-size:100%;object-fit:cover}
.gh-story__art .gh-artwork__badge{position:absolute;top:var(--gh-ref-space-200);inset-inline-start:var(--gh-ref-space-200)}
.gh-story__title{font-size:var(--gh-ref-font-size-500);font-weight:var(--gh-ref-font-weight-heavy);line-height:1.4}
.gh-story__sub{display:block;font-size:var(--gh-type-caption-size);color:var(--gh-story-muted);line-height:1.6;opacity:.9}
.gh-story__foot{display:flex;align-items:center;gap:var(--gh-ref-space-200);padding-block-start:var(--gh-ref-space-250);border-block-start:1px solid currentColor;border-block-start-color:color-mix(in srgb,currentColor 20%,transparent)}
.gh-story__foot>span:not([class]){flex:1;min-width:0;line-height:1.35;font-size:var(--gh-type-caption-size)}
.gh-story__foot b{display:block;font-weight:var(--gh-ref-font-weight-bold)}
.gh-story__foot small{display:block;font-size:var(--gh-ref-font-size-50);color:var(--gh-story-muted);direction:ltr;text-align:end;font-family:var(--gh-font-family-latin);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.gh-story__qr{inline-size:2.5rem;block-size:2.5rem;flex:none;padding:3px;border-radius:6px;background:var(--gh-color-surface-inverse);color:var(--gh-color-text-inverse)}
.gh-story__qr svg{inline-size:100%;block-size:100%}
.gh-story--sm{--gh-story-w:9.5rem;padding:var(--gh-ref-space-200);gap:var(--gh-ref-space-150);border-radius:var(--gh-ref-radius-md)}
.gh-story--sm .gh-story__title{font-size:var(--gh-type-caption-size)}
.gh-story--sm :is(.gh-story__top,.gh-story__foot,.gh-story__sub){display:none}


/* ===== components/switch.css ===== */
/* ==========================================================================
   @component switch — gh-switch (+ gh-toggle-row: label · description · trailing control)
   Consolidates: base .switch[aria-checked], auth/profile/settings .trow (toggle-row), courses .fpanel .sw-row.
   Markup: <button class="gh-switch" role="switch" aria-checked="false" aria-labelledby="…" data-gh-switch></button>
   A switch applies immediately (settings, filters). For «I agree» in a form use a checkbox instead.
   States: aria-checked, :disabled (locked), aria-busy (saving).
   ========================================================================== */
.gh-switch{position:relative;flex:none;display:inline-block;inline-size:40px;block-size:24px;padding:0;border-radius:var(--gh-radius-pill);
  border:1px solid var(--gh-color-border-strong);background:var(--gh-color-surface-4);cursor:pointer;vertical-align:middle;
  -webkit-tap-highlight-color:transparent;transition:background-color var(--gh-motion-duration-base) var(--gh-motion-ease),border-color var(--gh-motion-duration-base) var(--gh-motion-ease)}
.gh-switch::after{content:"";position:absolute;inset-block-start:3px;inset-inline-start:3px;inline-size:16px;block-size:16px;border-radius:50%;
  background:var(--gh-color-text-secondary);transition:inset-inline-start var(--gh-motion-duration-base) var(--gh-motion-ease),background-color var(--gh-motion-duration-base) var(--gh-motion-ease)}
.gh-switch:hover{border-color:var(--gh-color-text-tertiary)}
.gh-switch:focus-visible{border-radius:var(--gh-radius-pill)}
.gh-switch[aria-checked="true"]{background:var(--gh-color-accent-default);border-color:var(--gh-color-accent-default)}
.gh-switch[aria-checked="true"]::after{inset-inline-start:19px;background:var(--gh-color-accent-on)}
.gh-switch:disabled,.gh-switch[aria-disabled="true"]{cursor:not-allowed;opacity:.45}
.gh-switch[aria-busy="true"]::after{animation:gh-switch-pulse .8s ease-in-out infinite alternate}
@keyframes gh-switch-pulse{to{opacity:.35}}
@media (pointer:coarse){
  .gh-switch::before{content:"";position:absolute;inset:-11px -4px}
}

/* toggle-row — setting with label + description and a trailing control (switch / select / segmented / button) */
.gh-toggle-row{display:flex;flex-wrap:wrap;align-items:center;gap:var(--gh-ref-space-400);padding-block:var(--gh-ref-space-300);min-inline-size:0}
.gh-toggle-row+.gh-toggle-row{border-block-start:1px solid var(--gh-color-border-subtle)}
.gh-toggle-row__text{flex:1;min-inline-size:0}
.gh-toggle-row__label{display:block;font-size:var(--gh-ref-font-size-300);font-weight:var(--gh-ref-font-weight-semibold);line-height:1.6;color:var(--gh-color-text-primary)}
.gh-toggle-row__desc{display:block;font-size:var(--gh-type-caption-size);line-height:1.65;color:var(--gh-color-text-tertiary)}
.gh-toggle-row>:last-child{flex:none}
.gh-toggle-row[aria-disabled="true"]{opacity:.5}


/* ===== components/tabs.css ===== */
/* ==========================================================================
   Tabs — underline tabs with optional icon + count. role=tablist, roving tabindex, arrows (data-gh-tabs).
   Consolidates .utabs (lesson side panel, profile — sticky), notification .tabs (dashboard).
   ========================================================================== */
.gh-tabs{display:flex;gap:var(--gh-ref-space-100);border-block-end:1px solid var(--gh-color-border-subtle);overflow-x:auto;scrollbar-width:none;overscroll-behavior-x:contain;min-width:0}
.gh-tabs::-webkit-scrollbar{display:none}
.gh-tabs__tab{position:relative;flex:none;display:inline-flex;align-items:center;gap:var(--gh-ref-space-200);height:52px;padding-inline:var(--gh-ref-space-300);
  font-size:var(--gh-type-label-size);font-weight:var(--gh-ref-font-weight-medium);color:var(--gh-color-text-secondary);white-space:nowrap;
  transition:color var(--gh-motion-duration-fast) var(--gh-motion-ease)}
.gh-tabs__tab::after{content:"";position:absolute;inset-inline:var(--gh-ref-space-200);bottom:-1px;height:2px;border-radius:2px;background:transparent;transition:background-color var(--gh-motion-duration-fast) var(--gh-motion-ease)}
.gh-tabs__tab:hover{color:var(--gh-color-text-primary)}
.gh-tabs__tab[aria-selected="true"]{color:var(--gh-color-text-primary);font-weight:var(--gh-ref-font-weight-semibold)}
.gh-tabs__tab[aria-selected="true"]::after{background:var(--gh-color-accent-ink)}
.gh-tabs__tab[aria-selected="true"]>.gh-icon{color:var(--gh-color-accent-ink)}
.gh-tabs__tab:focus-visible{outline-offset:-4px}
.gh-tabs__tab:disabled,.gh-tabs__tab[aria-disabled="true"]{color:var(--gh-color-text-disabled)}
/* counts: <span class="gh-badge"> (tag.css) inside the tab */
/* compact: inside a side panel / tile head */
.gh-tabs--sm .gh-tabs__tab{height:44px;padding-inline:var(--gh-ref-space-250);font-size:var(--gh-type-label-sm-size)}
/* full-width (equal) tabs: mobile view switchers */
.gh-tabs--fill .gh-tabs__tab{flex:1;justify-content:center}
/* sticky under the site header (profile) */
.gh-tabs--sticky{position:sticky;top:var(--gh-layout-header-height);z-index:calc(var(--gh-ref-z-sticky) - 1);background:var(--gh-color-bg-header);-webkit-backdrop-filter:blur(14px);backdrop-filter:blur(14px)}
.gh-tab-panel{padding-top:var(--gh-ref-space-500);min-width:0}
.gh-tab-panel:focus-visible{outline-offset:-2px;border-radius:var(--gh-radius-inner)}


/* ===== components/tag.css ===== */
/* ==========================================================================
   @component tag / badge — gh-tag (status/label, not interactive) · gh-badge (count)
   Consolidates: base .tag (.acc/.solid/.ok/.warn/.vi/.d), course-card .tag.dk (on media), filter .cnt,
   side-nav .cnt, .is-rec «پیشنهاد» pill, quiz .rs result pill. Danger + info tones were missing — added.
   Tones: neutral (default) · --accent · --solid (accent fill; one per card) · --ai · --success · --warning · --danger · --info
   · --media (on artwork/cover). Size: --sm (20). Dot: .gh-tag__dot (colour + word, never colour alone).
   ========================================================================== */
.gh-tag{--_bg:var(--gh-color-surface-3);--_fg:var(--gh-color-text-secondary);
  display:inline-flex;align-items:center;gap:var(--gh-ref-space-150);block-size:var(--gh-tag-height);padding-inline:var(--gh-ref-space-250);
  border-radius:var(--gh-radius-pill);background:var(--_bg);color:var(--_fg);
  font-size:var(--gh-ref-font-size-75);font-weight:var(--gh-ref-font-weight-semibold);line-height:1;white-space:nowrap;vertical-align:middle}
.gh-tag .gh-icon{inline-size:13px;block-size:13px}
.gh-tag--sm{block-size:20px;padding-inline:var(--gh-ref-space-200);font-size:var(--gh-ref-font-size-50)}
.gh-tag--accent{--_bg:var(--gh-color-accent-soft);--_fg:var(--gh-color-accent-ink)}
.gh-tag--solid{--_bg:var(--gh-color-accent-default);--_fg:var(--gh-color-accent-on)}
.gh-tag--ai{--_bg:var(--gh-color-ai-soft);--_fg:var(--gh-color-ai-default)}
.gh-tag--success{--_bg:var(--gh-color-status-success-soft);--_fg:var(--gh-color-status-success)}
.gh-tag--warning{--_bg:var(--gh-color-status-warning-soft);--_fg:var(--gh-color-status-warning)}
.gh-tag--danger{--_bg:var(--gh-color-status-danger-soft);--_fg:var(--gh-color-status-danger)}
.gh-tag--info{--_bg:var(--gh-color-status-info-soft);--_fg:var(--gh-color-status-info)}
.gh-tag--outline{--_bg:transparent;box-shadow:inset 0 0 0 1px var(--gh-color-border-default)}
/* on artwork / course covers: always-dark scrim chip, text stays light in every theme */
.gh-tag--media{--_bg:var(--gh-color-bg-header);--_fg:var(--gh-color-text-primary);backdrop-filter:blur(6px)}
.gh-tag__dot{inline-size:6px;block-size:6px;border-radius:50%;background:currentColor;flex:none}

/* count badge (nav items, filter groups, tabs) */
.gh-badge{display:inline-grid;place-items:center;min-inline-size:20px;block-size:20px;padding-inline:5px;border-radius:var(--gh-radius-pill);
  background:var(--gh-color-surface-3);color:var(--gh-color-text-secondary);
  font-size:var(--gh-ref-font-size-50);font-weight:var(--gh-ref-font-weight-bold);line-height:1;vertical-align:middle}
.gh-badge--accent{background:var(--gh-color-accent-default);color:var(--gh-color-accent-on)}
.gh-badge--sm{min-inline-size:16px;block-size:16px;padding-inline:4px}


/* ===== components/thumb-pick.css ===== */
/* ==========================================================================
   @component thumb-pick — gh-thumb-pick (choose one image from a grid of thumbnails) — v0.2, gap A4
   Replaces: profile .pf-pick (story-card artwork picker). For a labelled card with an image use gh-choice--media.
   Markup:
   <div class="gh-thumb-pick" role="radiogroup" aria-label="انتخاب اثر" data-gh-thumb-pick>
     <button class="gh-thumb-pick__item" type="button" role="radio" aria-checked="true" aria-label="لوگوی کافه دانه" data-value="1">
       <img alt=""> | <svg aria-hidden="true">…</svg></button> …</div>
   JS (actions.js «thumb-pick», delegated so items may be re-rendered): click / Space / Enter selects, arrows move +
   select (RTL-aware), Home/End, roving tabindex, emits gh:change {value, item} on the group.
   Columns: default 6 · --cols-4 · --cols-3 (or set --gh-thumb-pick-cols). Selected: 2px accent frame + inner ink ring
   + corner check (shape, not colour alone). Thumbnails sit on the colour-neutral media surface.
   ========================================================================== */
.gh-thumb-pick{--_cols:var(--gh-thumb-pick-cols,6);display:grid;grid-template-columns:repeat(var(--_cols),minmax(0,1fr));gap:var(--gh-ref-space-150)}
.gh-thumb-pick--cols-4{--_cols:4}
.gh-thumb-pick--cols-3{--_cols:3}
.gh-thumb-pick__item{position:relative;display:block;aspect-ratio:1;inline-size:100%;margin:0;padding:0;overflow:hidden;cursor:pointer;
  border-radius:var(--gh-radius-control);border:2px solid transparent;background:var(--gh-color-surface-media);color:inherit;
  -webkit-tap-highlight-color:transparent;transition:border-color var(--gh-motion-duration-base) var(--gh-motion-ease)}
.gh-thumb-pick__item>img,.gh-thumb-pick__item>svg{display:block;inline-size:100%;block-size:100%;object-fit:cover}
.gh-thumb-pick__item:hover{border-color:var(--gh-color-border-strong)}
.gh-thumb-pick__item:focus-visible{border-radius:var(--gh-radius-control)}
.gh-thumb-pick__item[aria-checked="true"]{border-color:var(--gh-color-accent-ink);box-shadow:inset 0 0 0 2px var(--gh-color-bg-canvas)}
/* corner check: accent disc (::after) + check glyph masked from an inline SVG (::before), so no sprite is needed */
.gh-thumb-pick__item::after,.gh-thumb-pick__item::before{content:"";position:absolute;inset-block-start:4px;inset-inline-end:4px;inline-size:1.125rem;block-size:1.125rem;border-radius:50%;
  opacity:0;transform:scale(.6);transition:opacity var(--gh-motion-duration-fast) var(--gh-motion-ease),transform var(--gh-motion-duration-fast) var(--gh-motion-ease)}
.gh-thumb-pick__item::after{background:var(--gh-color-accent-default)}
.gh-thumb-pick__item::before{z-index:1;background:var(--gh-color-accent-on);
  -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-6 -6 36 36' fill='none' stroke='white' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center/100% no-repeat;
  mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-6 -6 36 36' fill='none' stroke='white' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center/100% no-repeat}
.gh-thumb-pick__item[aria-checked="true"]::before{opacity:1;transform:none}
.gh-thumb-pick__item[aria-checked="true"]::after{opacity:1;transform:none}
.gh-thumb-pick__item:disabled,.gh-thumb-pick__item[aria-disabled="true"]{opacity:.4;cursor:not-allowed}
.gh-thumb-pick__item:disabled:hover{border-color:transparent}


/* ===== components/tile.css ===== */
/* ==========================================================================
   Tile + inner panel — the bento building blocks.
   Consolidates .t / .t.raise / .t.flush / .t-head / .ti / .takeaway / .t-foot (base.css, every page),
   .inner, .cf-box, .f-prev, .name-prev, .pane (review) into ONE tile and ONE panel.
   Depth = surface step + hairline. Never a shadow (tiles are not floating layers).
   ========================================================================== */
.gh-tile{
  --gh-tile-pad:var(--gh-tile-padding);
  position:relative;display:flex;flex-direction:column;min-width:0;
  padding:var(--gh-tile-pad);
  background:var(--gh-color-surface-1);border:1px solid var(--gh-color-border-subtle);border-radius:var(--gh-tile-radius);
}
.gh-tile--raise{background:var(--gh-color-surface-2)}
.gh-tile--flush{padding:0;overflow:hidden}
/* head → body step (space-400) owned at tile level, so a page's list reset on the same element (`.x{margin:0}`) cannot
   glue the body to its title (§4b.2b); --pane (below) and page rules scoped to the tile still override */
.gh-tile>.gh-tile__body,
.gh-tile:where(:not(.gh-tile--flush))>.gh-tile__head+:where(:not(.gh-tile__foot)){margin-top:var(--gh-ref-space-400)} /* whatever block follows the title (body, tabs, form, button row, panel) */
/* padded region inside a flush tile (head above a table, body under a cover) */
.gh-tile__pad{padding:var(--gh-tile-pad)}
.gh-tile--flush>.gh-tile__head{padding:var(--gh-tile-pad) var(--gh-tile-pad) var(--gh-ref-space-400)}
/* full-height tool column (review queue / canvas / feedback): head, scrolling body, sticky foot */
.gh-tile--pane{padding:0;overflow:hidden;min-height:0}
.gh-tile--pane>.gh-tile__head{padding:var(--gh-ref-space-400);border-block-end:1px solid var(--gh-color-border-subtle);flex:none}
.gh-tile--pane>.gh-tile__body{flex:1;min-height:0;margin:0;overflow:auto;overscroll-behavior:contain}
.gh-tile--pane>.gh-tile__foot{flex:none;margin:0;padding:var(--gh-ref-space-300) var(--gh-ref-space-400);border-block-start:1px solid var(--gh-color-border-subtle)}
/* whole tile is a link / button */
.gh-tile--link{color:inherit;text-align:start;transition:border-color var(--gh-motion-duration-fast) var(--gh-motion-ease),background-color var(--gh-motion-duration-fast) var(--gh-motion-ease)}
.gh-tile--link:hover{border-color:var(--gh-color-border-strong)}
.gh-tile--link:focus-visible{border-radius:var(--gh-tile-radius)}

.gh-tile__head{display:flex;align-items:center;flex-wrap:wrap;gap:var(--gh-ref-space-250);min-width:0}
.gh-tile__head>*{min-width:0}
.gh-tile__icon{display:grid;place-items:center;flex:none;width:30px;height:30px;border-radius:var(--gh-radius-control);background:var(--gh-color-surface-3);color:var(--gh-color-text-secondary)}
.gh-tile__icon--accent{background:var(--gh-color-accent-soft);color:var(--gh-color-accent-ink)}
.gh-tile__icon--ai{background:var(--gh-color-ai-soft);color:var(--gh-color-ai-default)}
.gh-tile__title{font-size:var(--gh-type-heading-4-size);font-weight:var(--gh-type-heading-4-weight);line-height:var(--gh-type-heading-4-line-height)}
.gh-tile__title--lg{font-size:var(--gh-type-heading-3-size);font-weight:var(--gh-ref-font-weight-extrabold)}
.gh-tile__end{margin-inline-start:auto;display:flex;align-items:center;gap:var(--gh-ref-space-200);font-size:var(--gh-type-label-sm-size);color:var(--gh-color-text-tertiary)}
/* one-line conclusion under a title (charts, KPIs): text, not decoration */
.gh-tile__takeaway{margin-top:var(--gh-ref-space-100);font-size:var(--gh-type-body-sm-size);line-height:var(--gh-type-body-sm-line-height);color:var(--gh-color-text-secondary)}
.gh-tile__takeaway b{color:var(--gh-color-text-primary);font-weight:var(--gh-ref-font-weight-semibold)}
.gh-tile__body{margin-top:var(--gh-ref-space-400);min-width:0}
.gh-tile__foot{margin-top:auto;padding-top:var(--gh-ref-space-400);display:flex;align-items:center;flex-wrap:wrap;gap:var(--gh-ref-space-200)}

/* ---------- inner panel: a quieter box inside a tile ---------- */
.gh-panel{
  min-width:0;padding:var(--gh-ref-space-300) var(--gh-ref-space-400);
  background:var(--gh-color-surface-2);border:1px solid var(--gh-color-border-subtle);border-radius:var(--gh-radius-inner);
  font-size:var(--gh-type-body-sm-size);line-height:var(--gh-type-body-sm-line-height);color:var(--gh-color-text-secondary);
}
.gh-panel b,.gh-panel strong{color:var(--gh-color-text-primary);font-weight:var(--gh-ref-font-weight-semibold)}
.gh-panel--sunken{background:var(--gh-color-surface-1)}     /* inside a raised tile / modal */
.gh-panel--dashed{background:none;border-style:dashed;border-color:var(--gh-color-border-default)}  /* preview, «add» slot */
.gh-panel--accent{background:var(--gh-color-accent-soft);border-color:var(--gh-color-accent-border)}
.gh-panel--flush{padding:0;overflow:hidden}
a.gh-panel:hover,button.gh-panel:hover{border-color:var(--gh-color-border-strong)}
button.gh-panel{width:100%;text-align:start}

@media (max-width:860px){
  .gh-tile{--gh-tile-pad:var(--gh-tile-padding-mobile)}
}


/* ===== components/toast.css ===== */
/* ==========================================================================
   Toast — transient status message, optional action («بازگردانی» / undo). Created by GH.toast().
   Consolidates .toast (every page). role=status, aria-live=polite. Bottom-centre, above tabbar / action bar.
   ========================================================================== */
.gh-toast{position:fixed;inset-inline:0;bottom:var(--gh-ref-space-600);z-index:var(--gh-ref-z-toast);display:flex;align-items:center;gap:var(--gh-ref-space-300);
  width:max-content;max-width:calc(100% - 2 * var(--gh-ref-space-400));margin-inline:auto;padding:var(--gh-ref-space-250) var(--gh-ref-space-500);
  border-radius:var(--gh-radius-pill);background:var(--gh-color-surface-inverse);color:var(--gh-color-text-inverse);box-shadow:var(--gh-shadow-overlay-sm);
  font-size:var(--gh-type-label-size);font-weight:var(--gh-ref-font-weight-semibold);line-height:var(--gh-type-label-line-height);
  opacity:0;visibility:hidden;transform:translateY(20px);
  transition:opacity var(--gh-motion-duration-base) var(--gh-motion-ease),transform var(--gh-motion-duration-base) var(--gh-motion-ease),visibility 0s linear var(--gh-motion-duration-base)}
.gh-toast.is-open{opacity:1;visibility:visible;transform:none;transition-delay:0s}
.gh-toast>span{min-width:0}
.gh-toast__action{flex:none;display:inline-flex;align-items:center;height:30px;margin-block:-4px;margin-inline-end:calc(var(--gh-ref-space-300) * -1);padding-inline:var(--gh-ref-space-300);
  border-radius:var(--gh-radius-pill);border:1px solid currentColor;color:inherit;font-weight:var(--gh-ref-font-weight-bold)}
.gh-toast__action:hover{background:var(--gh-color-text-inverse);color:var(--gh-color-surface-inverse)}
.gh-toast__action:focus-visible{outline-color:var(--gh-color-text-inverse);border-radius:var(--gh-radius-pill)}
/* keep clear of the mobile tabbar / sticky action bar */
@media (max-width:1100px){body:has(.gh-tabbar) .gh-toast{bottom:calc(var(--gh-layout-tabbar-height) + var(--gh-ref-space-400))}}
@media (max-width:860px){body:has(.gh-action-bar) .gh-toast{bottom:calc(76px + var(--gh-ref-space-300))}}


/* ===== components/tooltip.css ===== */
/* ==========================================================================
   Tooltip — styles the single #gh-tooltip node that core.js creates for [data-gh-tip] (hover + focus).
   Consolidates .tip (every page, charts). JS sets physical left/top at the trigger's top-centre.
   Short supplementary text only — never the only place for essential info or interactive content.
   ========================================================================== */
.gh-tooltip{position:fixed;z-index:var(--gh-ref-z-tooltip);pointer-events:none;width:max-content;max-width:min(260px,calc(100vw - 16px));
  padding:7px 11px;border-radius:var(--gh-radius-control);background:var(--gh-color-surface-inverse);color:var(--gh-color-text-inverse);
  font-size:var(--gh-type-label-sm-size);font-weight:var(--gh-ref-font-weight-medium);line-height:var(--gh-type-caption-line-height);text-align:center;
  box-shadow:var(--gh-shadow-overlay-sm);opacity:0;transform:translate(-50%,calc(-100% - 10px));transition:opacity var(--gh-motion-duration-fast) var(--gh-motion-ease)}
.gh-tooltip.is-open{opacity:1}
.gh-tooltip b,.gh-tooltip strong{font-weight:var(--gh-ref-font-weight-extrabold)}
/* arrow follows the trigger when core.js shifts the tooltip to stay inside the viewport (--gh-tip-arrow, measured from the physical left) */
/* Bug fix 1405-08-23: a `[dir] …{inset-inline:auto}` reset out-ranked the centring rule, so the arrow fell to the left edge.
   Now one rule positions the arrow with physical `left` only (no inset-inline anywhere on ::after). */
.gh-tooltip::after{content:"";position:absolute;top:100%;width:0;height:0;border:6px solid transparent;border-block-start-color:var(--gh-color-surface-inverse);translate:-50% 0}
.gh-tooltip::after{left:var(--gh-tip-arrow,50%)} /* gh-lint-ignore: pointer-positioned by JS (SYSTEM_SPEC §3) */
/* shown below the trigger when there is no room above */
.gh-tooltip.is-below{transform:translate(-50%,10px)}
.gh-tooltip.is-below::after{top:auto;bottom:100%;border-block-start-color:transparent;border-block-end-color:var(--gh-color-surface-inverse)}


/* ===== components/transcript.css ===== */
/* ==========================================================================
   gh-transcript — synced transcript (Group C) + gh-timestamp (shared seek chip)
   Consolidates: lesson .trl / .tr-tools (transcript list, search highlight, follow toggle), lesson .tsc
   (timestamp chip in notes), base .src a .ts (AI sources), lesson .ai-a .src .ts.
   Current line = aria-current="true"; lines after it are dimmed with :has() — no extra classes.
   ========================================================================== */
.gh-transcript{display:flex;flex-direction:column;gap:var(--gh-ref-space-250);min-height:0}
.gh-transcript__tools{display:flex;align-items:center;gap:var(--gh-ref-space-250);flex-wrap:wrap}
.gh-transcript__tools>:first-child{flex:1 1 10rem;min-width:0}
.gh-transcript__follow{display:inline-flex;align-items:center;gap:var(--gh-ref-space-200);font-size:var(--gh-type-caption-size);color:var(--gh-color-text-tertiary);white-space:nowrap}
.gh-transcript__list{display:grid;gap:var(--gh-ref-space-50);max-block-size:var(--gh-transcript-h,22rem);overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:var(--gh-color-surface-4) transparent;padding:var(--gh-ref-space-50)}
.gh-transcript__line{display:grid;grid-template-columns:3rem minmax(0,1fr);gap:var(--gh-ref-space-200);inline-size:100%;text-align:start;padding:var(--gh-ref-space-200);border-radius:var(--gh-ref-radius-sm);
  font-size:var(--gh-type-body-sm-size);line-height:var(--gh-type-body-sm-line-height);color:var(--gh-color-text-secondary);transition:background-color var(--gh-motion-duration-base),color var(--gh-motion-duration-base)}
.gh-transcript__line:hover{background:var(--gh-color-surface-2);color:var(--gh-color-text-primary)}
.gh-transcript__time{font-size:var(--gh-type-caption-size);font-weight:var(--gh-ref-font-weight-semibold);color:var(--gh-color-text-tertiary);padding-block-start:.3em;direction:ltr;text-align:end}
.gh-transcript__line[aria-current]{background:var(--gh-color-surface-3);color:var(--gh-color-text-primary)}
.gh-transcript__line[aria-current] .gh-transcript__time{color:var(--gh-color-accent-ink)}
.gh-transcript__list>li:has([aria-current])~li .gh-transcript__line:not(:hover){color:var(--gh-color-text-tertiary)}
.gh-transcript__hit{background:var(--gh-color-accent-soft);color:var(--gh-color-text-primary);border-radius:4px;padding-inline:2px;box-shadow:inset 0 -2px 0 var(--gh-color-accent-border)}
.gh-transcript__empty{padding:var(--gh-ref-space-500) var(--gh-ref-space-200);text-align:center;font-size:var(--gh-type-body-sm-size);color:var(--gh-color-text-tertiary)}

/* timestamp chip: a seek link («۰۴:۱۲») */
.gh-timestamp{display:inline-flex;align-items:center;gap:var(--gh-ref-space-100);block-size:1.625rem;padding-inline:var(--gh-ref-space-200);border-radius:var(--gh-radius-pill);
  background:var(--gh-color-accent-soft);color:var(--gh-color-accent-ink);font-size:var(--gh-type-caption-size);font-weight:var(--gh-ref-font-weight-semibold);white-space:nowrap}
.gh-timestamp:hover{background:var(--gh-color-accent-border);color:var(--gh-color-text-primary)}
.gh-timestamp .gh-icon{inline-size:.85rem;block-size:.85rem}
.gh-timestamp__t{direction:ltr;unicode-bidi:isolate}


/* ===== components/video-player.css ===== */
/* ==========================================================================
   gh-player — video player chrome (Group C)
   Consolidates: lesson .vp (stage, big play, badges, subtitles, controls, chapter-segmented scrubber, hover preview,
   speed/quality/subtitle menus, loading/error/ended states), course .pvm .player, base .player .ctrl .scrub.
   Media direction (SYSTEM_SPEC §5, v0.1): the control bar is LTR (tape metaphor): ← rewinds, play sits at the
   left, the scrubber fills left → right. Persian labels inside it are isolated with dir="rtl".
   The canvas is always dark (--gh-color-surface-media). States: is-playing, is-idle, aria-busy, is-error, is-ended, is-pip.
   ========================================================================== */
.gh-player{--gh-player-scrim:var(--gh-color-media-scrim);container-type:inline-size;position:relative;aspect-ratio:16/9;overflow:hidden;isolation:isolate;border-radius:var(--gh-radius-tile);
  background:var(--gh-color-surface-media);border:1px solid var(--gh-color-border-subtle);color:var(--gh-color-text-primary);user-select:none;-webkit-user-select:none}
.gh-player:fullscreen{border-radius:0;border:0}
.gh-player__stage{position:absolute;inset:0}
.gh-player__stage>svg,.gh-player__stage>video,.gh-player__stage>img{inline-size:100%;block-size:100%;object-fit:cover}
.gh-player__hit{position:absolute;inset:0;z-index:1;inline-size:100%;block-size:100%}
.gh-player__hit:focus-visible{outline-offset:-4px;border-radius:var(--gh-radius-tile)}
.gh-player__big{position:absolute;z-index:2;inset:0;margin:auto;inline-size:4.75rem;block-size:4.75rem;border-radius:50%;display:grid;place-items:center;
  background:var(--gh-color-accent-default);color:var(--gh-color-accent-on);transition:transform var(--gh-motion-duration-fast),opacity var(--gh-motion-duration-fast)}
.gh-player__big:hover{transform:scale(1.06)}
.gh-player__big .gh-icon{inline-size:1.75rem;block-size:1.75rem;fill:currentColor}
.gh-player.is-playing .gh-player__big{opacity:0;pointer-events:none}
.gh-player__badges{position:absolute;z-index:2;top:var(--gh-ref-space-300);inset-inline-start:var(--gh-ref-space-300);display:flex;gap:var(--gh-ref-space-100);flex-wrap:wrap}
.gh-player__badges>span{font-size:var(--gh-type-caption-size);font-weight:var(--gh-ref-font-weight-semibold);background:var(--gh-player-scrim);padding:var(--gh-ref-space-50) var(--gh-ref-space-250);border-radius:var(--gh-radius-pill)}
/* captions */
.gh-player__captions{position:absolute;z-index:2;inset-inline:8%;bottom:6.75rem;text-align:center;pointer-events:none;transition:bottom var(--gh-motion-duration-slow) var(--gh-motion-ease)}
.gh-player__captions>span{background:var(--gh-player-scrim);font-size:var(--gh-player-cc-size,1.125rem);font-weight:var(--gh-ref-font-weight-medium);line-height:2;padding:var(--gh-ref-space-50) var(--gh-ref-space-300);border-radius:var(--gh-ref-radius-sm);
  -webkit-box-decoration-break:clone;box-decoration-break:clone}
.gh-player__captions[hidden]{display:none}
.gh-player.is-idle .gh-player__captions{bottom:var(--gh-ref-space-500)}
/* control bar */
.gh-player__controls{position:absolute;z-index:3;inset-inline:var(--gh-ref-space-300);bottom:var(--gh-ref-space-300);direction:ltr;padding:var(--gh-ref-space-100) var(--gh-ref-space-250) var(--gh-ref-space-150);
  border-radius:var(--gh-radius-inner);background:var(--gh-player-scrim);border:1px solid var(--gh-color-border-default);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);
  transition:opacity var(--gh-motion-duration-slow),transform var(--gh-motion-duration-slow)}
.gh-player.is-idle .gh-player__controls{opacity:0;transform:translateY(8px);pointer-events:none}
.gh-player.is-idle{cursor:none}
/* scrubber (role=slider), chapter segments ∝ duration (--gh-weight) */
.gh-player__scrub{position:relative;display:flex;align-items:center;gap:3px;block-size:1.375rem;cursor:pointer;touch-action:none;border-radius:var(--gh-radius-control)}
.gh-player__scrub:focus-visible{outline-offset:0}
.gh-player__seg{position:relative;flex:var(--gh-weight,1) 1 0;min-width:0;block-size:4px;border-radius:2px;background:var(--gh-color-border-strong);transition:block-size var(--gh-motion-duration-fast)}
.gh-player__seg>i{position:absolute;inset-block:0;inset-inline-start:0;border-radius:inherit}
.gh-player__buffer{inline-size:var(--gh-buffered,0%);background:var(--gh-color-border-strong)}
.gh-player__played{inline-size:var(--gh-played,0%);background:var(--gh-color-accent-default)}
.gh-player__scrub:hover .gh-player__seg,.gh-player__scrub:focus-visible .gh-player__seg{block-size:7px}
.gh-player__knob{position:absolute;top:50%;inset-inline-start:var(--gh-progress,0%);inline-size:14px;block-size:14px;margin-block-start:-7px;margin-inline-start:-7px;border-radius:50%;
  background:var(--gh-color-text-primary);border:3px solid var(--gh-color-accent-ink);pointer-events:none}
.gh-player__preview{position:absolute;bottom:calc(100% + var(--gh-ref-space-250));inset-inline-start:var(--gh-preview-x,50%);inline-size:11.5rem;margin-inline-start:-5.75rem;padding:var(--gh-ref-space-100);
  border-radius:var(--gh-ref-radius-md);background:var(--gh-color-surface-2);border:1px solid var(--gh-color-border-default);box-shadow:var(--gh-shadow-overlay-sm);pointer-events:none;
  opacity:0;transition:opacity var(--gh-motion-duration-fast)}
.gh-player__preview.is-open{opacity:1}
.gh-player__preview-art{aspect-ratio:16/9;border-radius:var(--gh-ref-radius-sm);overflow:hidden;background:var(--gh-color-surface-media)}
.gh-player__preview-art svg{inline-size:100%;block-size:100%}
.gh-player__preview-cap{direction:rtl;display:flex;justify-content:space-between;gap:var(--gh-ref-space-200);padding:var(--gh-ref-space-150) var(--gh-ref-space-100) var(--gh-ref-space-50);font-size:var(--gh-type-caption-size);line-height:1.5}
.gh-player__preview-cap b{font-weight:var(--gh-ref-font-weight-semibold);overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.gh-player__preview-cap span{flex:none;direction:ltr;color:var(--gh-color-text-secondary)}
/* button row */
.gh-player__row{display:flex;align-items:center;gap:var(--gh-ref-space-50);min-width:0}
.gh-player__btn{position:relative;flex:none;block-size:2.25rem;min-inline-size:2.25rem;padding-inline:var(--gh-ref-space-200);display:inline-grid;place-items:center;
  border-radius:var(--gh-radius-control);font-size:var(--gh-type-label-sm-size);font-weight:var(--gh-ref-font-weight-semibold);color:var(--gh-color-text-primary)}
.gh-player__btn:hover{background:var(--gh-color-border-default)}
.gh-player__btn[aria-pressed="true"]{color:var(--gh-color-accent-ink)}
.gh-player__btn[aria-pressed="true"]::after{content:"";position:absolute;bottom:3px;inset-inline:35%;block-size:2px;border-radius:1px;background:currentColor}
.gh-player__btn--play{inline-size:2.5rem;block-size:2.5rem;border-radius:50%;background:var(--gh-color-accent-default);color:var(--gh-color-accent-on);margin-inline-end:var(--gh-ref-space-150)}
.gh-player__btn--play:hover{background:var(--gh-color-accent-hover)}
.gh-player__btn--play .gh-icon{fill:currentColor}
.gh-player__time{font-size:var(--gh-type-label-sm-size);white-space:nowrap;padding-inline:var(--gh-ref-space-200)}
.gh-player__time span{color:var(--gh-color-text-tertiary)}
.gh-player__chapter{min-width:0;flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-size:var(--gh-type-label-sm-size);color:var(--gh-color-text-secondary)}
.gh-player__chapter b{color:var(--gh-color-text-primary);font-weight:var(--gh-ref-font-weight-semibold)}
.gh-player__menu-wrap{position:relative}
/* settings menu (speed / captions size): role=menu with menuitemradio — opened from the control bar */
.gh-player__menu{position:absolute;z-index:20;bottom:calc(100% + var(--gh-ref-space-300));inset-inline-end:calc(-1 * var(--gh-ref-space-150));min-inline-size:12rem;padding:var(--gh-ref-space-150);
  border-radius:var(--gh-radius-inner);background:var(--gh-color-surface-2);border:1px solid var(--gh-color-border-default);box-shadow:var(--gh-shadow-overlay-sm)}
.gh-player__menu>*{direction:rtl;text-align:start}
.gh-player__menu h5{font-size:var(--gh-type-caption-size);font-weight:var(--gh-ref-font-weight-semibold);color:var(--gh-color-text-tertiary);padding:var(--gh-ref-space-150) var(--gh-ref-space-250) var(--gh-ref-space-100)}
.gh-player__menu [role="menuitemradio"]{display:flex;align-items:center;gap:var(--gh-ref-space-250);inline-size:100%;block-size:2.25rem;padding-inline:var(--gh-ref-space-250);border-radius:var(--gh-radius-control);
  font-size:var(--gh-type-label-size);color:var(--gh-color-text-secondary)}
.gh-player__menu [role="menuitemradio"]:hover,.gh-player__menu [role="menuitemradio"]:focus-visible{background:var(--gh-color-surface-3);color:var(--gh-color-text-primary)}
.gh-player__menu [role="menuitemradio"] .gh-icon{visibility:hidden;color:var(--gh-color-accent-ink)}
.gh-player__menu [aria-checked="true"]{color:var(--gh-color-text-primary)}
.gh-player__menu [aria-checked="true"] .gh-icon{visibility:visible}
.gh-player__menu small{margin-inline-start:auto;font-size:var(--gh-type-caption-size);color:var(--gh-color-text-tertiary)}
/* states: loading / error / ended overlay */
.gh-player__state{position:absolute;inset:0;z-index:6;display:none;place-content:center;justify-items:center;gap:var(--gh-ref-space-200);padding:var(--gh-ref-space-600);text-align:center;background:var(--gh-player-scrim)}
.gh-player__state h4{font-size:var(--gh-type-heading-3-size);font-weight:var(--gh-ref-font-weight-bold)}
.gh-player__state p{font-size:var(--gh-type-body-sm-size);color:var(--gh-color-text-secondary)}
.gh-player[aria-busy="true"] .gh-player__state--loading,.gh-player.is-error .gh-player__state--error,.gh-player.is-ended .gh-player__state--ended{display:grid}
.gh-player[aria-busy="true"] :is(.gh-player__controls,.gh-player__big,.gh-player__captions),
.gh-player.is-error :is(.gh-player__controls,.gh-player__big,.gh-player__captions),
.gh-player.is-ended :is(.gh-player__big,.gh-player__captions){display:none}
.gh-player__spinner{inline-size:2.75rem;block-size:2.75rem;border-radius:50%;border:3px solid var(--gh-color-surface-4);border-block-start-color:var(--gh-color-accent-ink);animation:gh-player-spin .9s linear infinite}
@keyframes gh-player-spin{to{transform:rotate(360deg)}}
.gh-player__state--error > .gh-icon{inline-size:3rem;block-size:3rem;padding:.75rem;border-radius:50%;background:var(--gh-color-status-danger-soft);color:var(--gh-color-status-danger);box-sizing:border-box}
/* picture-in-picture (simulated in docs; real PiP uses the video element API) */
.gh-player.is-pip{position:fixed;z-index:var(--gh-ref-z-fixed);inset-inline-end:var(--gh-ref-space-400);bottom:var(--gh-ref-space-400);inline-size:min(22rem,calc(100vw - 2rem));box-shadow:var(--gh-shadow-overlay-lg)}
.gh-player.is-pip .gh-player__chapter,.gh-player.is-pip .gh-player__captions{display:none}
@media (max-width:560px){.gh-player{border-radius:var(--gh-radius-inner)}}
/* the player sizes its chrome by its own width (it can sit in a narrow column on desktop too) */
@container (max-width:560px){
  .gh-player__controls{inset-inline:var(--gh-ref-space-150);bottom:var(--gh-ref-space-150);padding-inline:var(--gh-ref-space-150)}
  .gh-player__chapter,.gh-player__hide-sm{display:none}
  .gh-player__row{justify-content:space-between}
  .gh-player__btn{min-inline-size:2rem;padding-inline:var(--gh-ref-space-100)}
  .gh-player__time{padding-inline:var(--gh-ref-space-100);font-size:var(--gh-type-caption-size)}
  .gh-player__big{inline-size:3.5rem;block-size:3.5rem}
  .gh-player__captions{bottom:5rem}
  .gh-player__captions>span{font-size:var(--gh-ref-font-size-200)}
  .gh-player__badges{display:none}
}
/* ≤ 400px the full button row no longer fits: the volume slider folds behind the mute button (as --compact) so the
   row never runs past the bar's frame (§4b.1) */
@container (max-width:400px){
  .gh-player__vol{inline-size:0;margin:0;opacity:0}
  .gh-player__volume:hover .gh-player__vol,.gh-player__volume:focus-within .gh-player__vol{inline-size:4.5rem;margin-inline:var(--gh-ref-space-50) var(--gh-ref-space-150);opacity:1}
}
@container (max-width:380px){.gh-player__hide-xs{display:none}}

/* ---------- volume (v0.2 C3): mute button + LTR slider. ↑/↓ anywhere in the player change it by 5 %, M mutes. ----------
   <div class="gh-player__volume"> button[data-gh-action="mute"] + input.gh-range.gh-player__vol[data-gh-player-volume][dir=ltr] */
.gh-player__volume{display:inline-flex;align-items:center;flex:none}
.gh-player__vol{--_track:var(--gh-color-border-strong);inline-size:4.5rem;margin-inline:var(--gh-ref-space-50) var(--gh-ref-space-150);transition:inline-size var(--gh-motion-duration-base) var(--gh-motion-ease)}
.gh-player__vol::-webkit-slider-thumb{border-color:var(--gh-color-surface-media)}
.gh-player__volume:has([data-gh-action="mute"][aria-pressed="true"]) .gh-player__vol{--_fill:var(--gh-color-text-tertiary)}
/* compact: the slider folds behind the mute button until hovered or focused */
.gh-player__volume--compact .gh-player__vol{inline-size:0;margin:0;opacity:0}
.gh-player__volume--compact:hover .gh-player__vol,.gh-player__volume--compact:focus-within .gh-player__vol{inline-size:4.5rem;margin-inline:var(--gh-ref-space-50) var(--gh-ref-space-150);opacity:1}

/* ---------- static preview (v0.2 C2): a picture of the player for marketing / app tours — no behaviour ----------
   <div class="gh-player gh-player--preview" role="img" aria-label="…">: __stage + __controls (aria-hidden) with
   __row > span.__btn--play + span.__time + .gh-progress (value = position) + span.__time + optional gh-tag--media.
   No data-gh-player, no buttons: nothing in it is focusable. Controls are a flat strip on the bottom edge, scaled down. */
.gh-player--preview{aspect-ratio:16/9;border:0;border-radius:var(--gh-radius-inner);pointer-events:none}
.gh-player--preview .gh-player__controls{inset-inline:0;bottom:0;padding:var(--gh-ref-space-250) var(--gh-ref-space-300);border:0;border-radius:0;-webkit-backdrop-filter:none;backdrop-filter:none;background:var(--gh-player-scrim)}
.gh-player--preview .gh-player__row{gap:var(--gh-ref-space-250);font-size:var(--gh-type-caption-size)}
.gh-player--preview .gh-player__btn--play{inline-size:1.875rem;block-size:1.875rem;min-inline-size:1.875rem;margin:0;padding:0}
.gh-player--preview .gh-player__btn--play .gh-icon{inline-size:var(--gh-icon-sm);block-size:var(--gh-icon-sm)}
.gh-player--preview .gh-player__time{padding:0;font-size:var(--gh-type-caption-size)}
.gh-player--preview .gh-progress{flex:1;min-inline-size:2rem}
/* a picture, not a loading bar: never the indeterminate animation even without aria-valuenow */
.gh-player--preview .gh-progress::before{inline-size:calc(var(--gh-progress-value,0) * 1%);animation:none;transform:none}


/* ===== components/wordmark.css ===== */
/* ==========================================================================
   Wordmark — the lime mark + «قلموم». Used by site header, sidebar, focus bar, footer.
   ========================================================================== */
.gh-wordmark{display:inline-flex;align-items:center;gap:var(--gh-ref-space-250);font-size:var(--gh-type-heading-3-size);font-weight:var(--gh-ref-font-weight-black);line-height:1;color:var(--gh-color-text-primary);white-space:nowrap;flex:none}
.gh-wordmark__mark{display:grid;place-items:center;width:28px;height:28px;border-radius:var(--gh-radius-control);background:var(--gh-color-accent-default);color:var(--gh-color-accent-on);flex:none}
.gh-wordmark__mark svg{width:16px;height:16px;fill:currentColor;stroke:none}
.gh-wordmark--mark-only{gap:0}
a.gh-wordmark:focus-visible{border-radius:var(--gh-radius-control)}
@media (max-width:420px){.gh-wordmark{font-size:var(--gh-type-body-lg-size)}}
/* Owner's brand files («هویت بصری», 1405-08-27). --logo: an uploaded logotype replaces mark + name (same 28px line);
   --custom: an uploaded sign replaces the lime square. A light-skin variant (…--light) swaps in under data-theme=light. */
.gh-wordmark--logo{gap:0}
.gh-wordmark__logo{display:block;height:28px;width:auto;max-width:180px;object-fit:contain}
.gh-wordmark__mark--custom{background:none}
.gh-wordmark__img{display:block;width:28px;height:28px;object-fit:contain}
.gh-wordmark__logo--light,.gh-wordmark__img--light{display:none}
:root[data-theme="light"] .gh-wordmark__logo--light,:root[data-theme="light"] .gh-wordmark__img--light{display:block}
:root[data-theme="light"] .gh-wordmark__logo--dark,:root[data-theme="light"] .gh-wordmark__img--dark{display:none}
@media (max-width:420px){.gh-wordmark__logo{height:24px;max-width:140px}}
