/* Mobile first. Course page = app shell (sidebar + app bar), inspired by the GoRiyadh CRM. */
:root {
  --navy: #151c28;
  --navy-2: #24324a;
  --bg: #f3f5f7;
  --side: #ffffff;
  --surf: #ffffff;
  --surf2: #f3f5f7;
  --surf3: #e9edf1;
  --line: #e2e7ec;
  --text: #151c28;
  --muted: #556170;
  --faint: #6b7686;
  --acc: #11766a;
  --acc-bg: #157f72;
  --acc-hover: #0f6b60;
  --acc-bg-hover: #0f6b60;
  --acc-soft: rgba(27, 153, 137, 0.12);
  --acc-bright: #28bfab;
  --ok: #157f3b;
  --ko: #b42318;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-card: 0 1px 2px rgba(21, 28, 40, 0.06);
  --shadow-float: 0 6px 20px rgba(21, 28, 40, .14);
  --shadow-drawer: 0 0 40px rgba(21, 28, 40, .25);
  --backdrop: rgba(21, 28, 40, .45);
  --appbar-bg: rgba(255, 255, 255, .92);
  --bottombar-bg: rgba(255, 255, 255, .96);
  --hero-line: transparent;
  --notice-bg: #fffbeb;
  --notice-line: #f6e05e;
  --notice-text: #744210;
  --notice-strong: #5f370e;
  --supports-bg: #f0fbf9;
  --supports-line: #c6eee8;
  --supports-dash: #9fd9cf;
  --ok-bg: #ecfdf3;
  --ko-bg: #fef3f2;
  --appbar-h: 56px;
  --bottombar-h: 64px;
  --sidebar-w: 320px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Dark appearance: set on <html> by theme.js (course page only; "system" resolves to light or dark). */
html[data-theme="light"] { color-scheme: light; }
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e131a;
  --side: #131a23;
  --surf: #171f2a;
  --surf2: #1e2833;
  --surf3: #283442;
  --line: #2a3543;
  --text: #e7ecf2;
  --muted: #aab5c3;
  --faint: #8d99aa;
  --acc: #45d1bd;
  --acc-hover: #7be3d4;
  --acc-soft: rgba(69, 209, 189, .14);
  --acc-bright: #2fc6b1;
  --ok: #4cc38a;
  --ko: #f4776b;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow-float: 0 6px 20px rgba(0, 0, 0, .45);
  --shadow-drawer: 0 0 40px rgba(0, 0, 0, .5);
  --backdrop: rgba(0, 0, 0, .6);
  --appbar-bg: rgba(19, 26, 35, .9);
  --bottombar-bg: rgba(19, 26, 35, .96);
  --hero-line: #2a3543;
  --notice-bg: rgba(234, 179, 8, .1);
  --notice-line: rgba(234, 179, 8, .35);
  --notice-text: #f1dc9a;
  --notice-strong: #fbe9b4;
  --supports-bg: rgba(69, 209, 189, .07);
  --supports-line: rgba(69, 209, 189, .25);
  --supports-dash: rgba(69, 209, 189, .4);
  --ok-bg: rgba(76, 195, 138, .12);
  --ko-bg: rgba(244, 119, 107, .12);
}
.logo-dark { display: none; }
html[data-theme="dark"] .logo-light { display: none; }
html[data-theme="dark"] .logo-dark { display: block; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--text); background: var(--bg); line-height: 1.6; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; }
a { color: var(--acc); }
a:hover { color: var(--acc-hover); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--acc-bg); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--navy); color: #fff; }
.skip-link:focus { top: 12px; }
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em; min-height: 44px; padding: .65em 1.15em;
  border-radius: 12px; border: 0; font-weight: 700; text-decoration: none; cursor: pointer; transition: background .12s ease, transform .12s ease;
}
.btn-primary { background: var(--acc-bg); color: #fff; }
.btn-primary:hover { background: var(--acc-bg-hover); color: #fff; }
.btn-ghost { background: rgba(255, 255, 255, .08); color: #fff; border: 1px solid rgba(255, 255, 255, .22); }
.btn-ghost:hover { background: rgba(255, 255, 255, .16); color: #fff; }
.btn-light { background: var(--surf); color: var(--text); border: 1px solid var(--line); }
.btn[aria-disabled="true"] { opacity: .55; pointer-events: none; }

/* ---------- Closure page ---------- */
.closure {
  min-height: 100dvh; display: grid; place-items: center; padding: 40px 20px; color: #fff; text-align: center;
  background: radial-gradient(1100px 650px at 50% -10%, var(--navy-2) 0%, var(--navy) 62%);
}
.closure .wrap { max-width: 760px; }
.closure .logo { width: 120px; height: auto; margin: 0 auto 26px; display: block; filter: drop-shadow(0 8px 24px rgba(0, 0, 0, .4)); }
.closure h1 { font-size: clamp(30px, 7vw, 56px); line-height: 1.12; margin: 0 0 16px; letter-spacing: -.02em; }
.closure .lead { color: #cbd5e0; font-size: clamp(17px, 2.4vw, 21px); margin: 0 auto 28px; max-width: 54ch; }
.closure .actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.closure .btn-primary { box-shadow: 0 10px 28px rgba(21, 127, 114, .35); }
.facts { margin: 30px auto 0; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; padding: 0; list-style: none; }
.facts li { padding: .3em .85em; border-radius: 999px; background: rgba(40, 191, 171, .14); color: #9be7dc; font-size: 14px; }
.socials { margin-top: 32px; display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; }
.socials a { color: #cbd5e0; text-decoration: none; border-bottom: 1px dashed transparent; }
.socials a:hover { color: #fff; border-bottom-color: #fff; }
.closure footer { margin-top: 44px; color: #8a94a6; font-size: 14px; }
.closure footer a { color: #8a94a6; }

/* ---------- Course app shell (mobile first) ---------- */
.course { padding-bottom: calc(var(--bottombar-h) + env(safe-area-inset-bottom)); }

.appbar {
  position: sticky; top: 0; z-index: 30; height: var(--appbar-h); display: flex; align-items: center; gap: 10px;
  padding: 0 12px; background: var(--appbar-bg); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line);
}
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; flex: none;
  border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--muted); cursor: pointer;
}
.icon-btn:hover { background: var(--surf2); color: var(--text); }
.icon-btn[disabled] { opacity: .35; pointer-events: none; }
.appbar .nav-toggle, .appbar .lesson-nav { display: none; }
.appbar-brand { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--text); text-decoration: none; font-weight: 700; }
.appbar-brand img { width: 32px; height: 32px; flex: none; }
.appbar-brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appbar-current { display: none; }
.progress-pill { margin-left: auto; flex: none; padding: 4px 10px; border-radius: 999px; background: var(--acc-soft); color: var(--acc); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Sidebar = off-canvas drawer on phones, persistent panel on desktop. */
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 50; width: min(88vw, 360px); display: flex; flex-direction: column;
  background: var(--side); border-right: 1px solid var(--line); transform: translateX(-102%); transition: transform .22s ease;
  visibility: hidden;
}
.nav-open .sidebar { transform: none; visibility: visible; box-shadow: var(--shadow-drawer); }
.backdrop { position: fixed; inset: 0; z-index: 40; background: var(--backdrop); opacity: 0; pointer-events: none; transition: opacity .22s ease; }
.nav-open .backdrop { opacity: 1; pointer-events: auto; }
.nav-open { overflow: hidden; }

.sidebar-head { padding: 14px 14px 12px; border-bottom: 1px solid var(--line); }
.sidebar-brand { display: flex; align-items: center; gap: 10px; }
.sidebar-brand a { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--text); text-decoration: none; }
.sidebar-brand img { width: 36px; height: 36px; flex: none; }
.sidebar-brand strong { display: block; font-size: 15px; line-height: 1.25; }
.sidebar-brand small { display: block; color: var(--faint); font-size: 12px; }
.sidebar-brand .icon-btn { margin-left: auto; }
.progress { margin-top: 12px; }
.progress-label { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 6px; font-variant-numeric: tabular-nums; }
.progress-track { height: 6px; border-radius: 999px; background: var(--surf3); overflow: hidden; }
.progress-fill { height: 100%; width: 0; border-radius: inherit; background: var(--acc-bg); transition: width .3s ease; }
.nav-search { position: relative; display: block; margin-top: 16px; }
.nav-search .icon { position: absolute; left: 11px; top: 50%; width: 18px; height: 18px; margin-top: -9px; color: var(--faint); pointer-events: none; }
.nav-search input {
  width: 100%; height: 40px; padding: 0 12px 0 36px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surf2); font: inherit; font-size: 16px; color: var(--text);
}
.nav-search input:focus { outline: 2px solid var(--acc-bg); outline-offset: 0; background: var(--surf); }

.nav-tree { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 8px 8px 16px; }
.nav-tree ol { list-style: none; margin: 0; padding: 0; }
.nav-section > details > summary {
  display: flex; flex-direction: column; gap: 1px; padding: 10px 10px 8px; cursor: pointer; list-style: none; border-radius: var(--radius-sm);
}
.nav-section > details > summary::-webkit-details-marker { display: none; }
.nav-section > details > summary:hover { background: var(--surf2); }
.nav-part { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--acc); }
.nav-section-title { font-weight: 700; font-size: 14px; line-height: 1.3; }
.nav-link {
  display: flex; align-items: flex-start; gap: 8px; min-height: 40px; padding: 8px 10px; border-radius: var(--radius-sm);
  color: var(--muted); text-decoration: none; font-size: 14px; line-height: 1.35;
}
.nav-link:hover { background: var(--surf2); color: var(--text); }
.nav-link[aria-current] { background: var(--acc-soft); color: var(--acc); font-weight: 600; }
.nav-sub .nav-link { padding-left: 26px; font-size: 13px; min-height: 36px; }
.nav-num { flex: none; min-width: 2.4em; color: var(--faint); font-variant-numeric: tabular-nums; font-size: 12px; padding-top: 1px; }
.nav-sub .nav-num { min-width: 3.2em; }
.nav-title { flex: 1; min-width: 0; }
.nav-meta { flex: none; color: var(--faint); font-size: 12px; font-variant-numeric: tabular-nums; padding-top: 1px; }
.nav-link.seen .nav-meta::before { content: "✓ "; color: var(--acc); font-weight: 700; }
.nav-empty { padding: 16px 10px; color: var(--faint); font-size: 14px; }
.is-filtered-out { display: none !important; }
.sidebar-foot { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); font-size: 13px; }
.sidebar-foot a { color: var(--muted); text-decoration: none; }
.sidebar-foot a:hover { color: var(--acc); }

/* Appearance menu (top right of the app bar). Hidden until theme.js runs, since it needs JS. */
.theme { position: relative; flex: none; display: none; }
html[data-theme] .theme { display: block; }
.theme-icon { display: none; }
html[data-theme-choice="system"] .theme-icon-system,
html[data-theme-choice="light"] .theme-icon-light,
html[data-theme-choice="dark"] .theme-icon-dark { display: flex; }
.theme-btn[aria-expanded="true"] { background: var(--surf2); color: var(--text); }
.theme-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; width: 196px; padding: 6px;
  background: var(--surf); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-float);
}
.theme-menu[hidden] { display: none; }
.theme-menu fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.theme-menu legend { padding: 6px 10px 4px; color: var(--faint); font-size: 12px; font-weight: 600; }
.theme-option {
  position: relative; display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 0 10px;
  border-radius: 8px; color: var(--muted); font-size: 14px; cursor: pointer;
}
.theme-option input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.theme-option:hover { background: var(--surf2); color: var(--text); }
.theme-option:has(input:checked) { background: var(--acc-soft); color: var(--acc); font-weight: 600; }
.theme-option:has(input:focus-visible) { outline: 2px solid var(--acc-bg); outline-offset: -2px; }

.bottombar {
  position: fixed; inset: auto 0 0 0; z-index: 30; display: grid; grid-template-columns: 1fr 1fr 1fr;
  height: calc(var(--bottombar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: var(--bottombar-bg); backdrop-filter: blur(10px); border-top: 1px solid var(--line);
}
.bottombar button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 0; background: none;
  color: var(--muted); font-size: 11px; font-weight: 600; cursor: pointer;
}
.bottombar button:hover, .bottombar .nav-toggle { color: var(--acc); }
.bottombar button[disabled] { opacity: .35; pointer-events: none; }

/* Main column */
.main { padding: 16px 14px 32px; max-width: 900px; margin: 0 auto; }
.hero-card { background: radial-gradient(700px 360px at 10% -20%, var(--navy-2) 0%, var(--navy) 60%); color: #fff; border: 1px solid var(--hero-line); border-radius: var(--radius); padding: 22px 18px; }
.hero-card h1 { font-size: clamp(26px, 6vw, 40px); line-height: 1.1; margin: 0 0 8px; letter-spacing: -.02em; }
.hero-card p { color: #cbd5e0; margin: 0 0 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0 0 18px; list-style: none; }
.chips li { padding: .25em .8em; border-radius: 999px; background: rgba(40, 191, 171, .16); color: #9be7dc; font-size: 13px; }
.hero-card .actions { display: flex; flex-direction: column; gap: 8px; }
.hero-card .actions .btn[hidden] { display: none; }

.notice { margin: 14px 0 22px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--notice-bg); border: 1px solid var(--notice-line); color: var(--notice-text); font-size: 14px; }
.notice strong { color: var(--notice-strong); }

.part { margin-bottom: 40px; }
.part > h2 { font-size: clamp(22px, 5vw, 30px); line-height: 1.2; margin: 0 0 14px; letter-spacing: -.01em; }
.part > h2 span { display: block; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--acc); margin-bottom: 2px; }
[data-item] { scroll-margin-top: calc(var(--appbar-h) + 12px); }
.lesson { background: var(--surf); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-card); padding: 16px; margin-bottom: 14px; }
.lesson > h3, .topic > h4 { margin: 0 0 12px; line-height: 1.3; }
.lesson > h3 { font-size: 19px; }
.topic { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 16px; }
.topic > h4 { font-size: 17px; }
.num { color: var(--faint); font-weight: 600; font-variant-numeric: tabular-nums; margin-right: .35em; }

.video { margin: 0 0 12px; }
.video-frame { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: var(--navy); margin: 0 -4px; }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-facade { all: unset; position: absolute; inset: 0; cursor: pointer; display: block; }
.video-facade img { width: 100%; height: 100%; object-fit: cover; display: block; transition: filter .15s ease; }
.video-facade:hover img { filter: brightness(.85); }
.video-facade:focus-visible { outline: 3px solid var(--acc-bright); outline-offset: -3px; }
.play { position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%; background: rgba(21, 127, 114, .92); box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
.play::after { content: ""; position: absolute; left: 26px; top: 20px; border-style: solid; border-width: 12px 0 12px 19px; border-color: transparent transparent transparent #fff; }
.duration { position: absolute; right: 10px; bottom: 10px; padding: 2px 8px; border-radius: 6px; background: rgba(0, 0, 0, .7); color: #fff; font-size: 13px; font-variant-numeric: tabular-nums; }
.video figcaption { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; margin-top: 8px; font-size: 14px; color: var(--faint); }
.dl-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; min-height: 32px; }
.dl-hint { flex-basis: 100%; font-size: 12px; color: var(--faint); margin-top: -4px; }

/* Back to top: desktop only (phones have the bottom bar and the native status-bar tap). */
.to-top { display: none; }

.content { color: var(--muted); overflow-wrap: anywhere; }
.content h4, .content h5 { color: var(--text); margin: 18px 0 8px; }
.content figure { margin: 12px 0; }
.content img { border-radius: var(--radius-sm); border: 1px solid var(--line); }
.content blockquote { margin: 12px 0; padding: 8px 14px; border-left: 4px solid var(--acc-bright); background: var(--surf2); }
.table-wrap { overflow-x: auto; margin: 12px -4px; -webkit-overflow-scrolling: touch; }
.content table { border-collapse: collapse; width: 100%; min-width: 560px; font-size: 14px; }
.content th, .content td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.content th { background: var(--surf2); color: var(--text); }

.supports { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: var(--supports-bg); border: 1px solid var(--supports-line); }
.supports h5, .part-supports h3 { margin: 0 0 6px; font-size: 15px; color: var(--text); }
.supports ul, .part-supports ul { margin: 0; padding-left: 1.2em; }
.supports li, .part-supports li { margin: 4px 0; }
.kind { font-size: 11px; color: var(--faint); text-transform: uppercase; margin-left: .4em; }
.part-supports { background: var(--surf); border: 1px dashed var(--supports-dash); border-radius: var(--radius); padding: 16px 18px; }

.quiz { margin-top: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surf2); }
.quiz > summary { padding: 12px 14px; cursor: pointer; font-weight: 700; color: var(--text); min-height: 44px; }
.quiz > summary span { font-weight: 400; color: var(--faint); }
.quiz form { padding: 0 14px 14px; }
.quiz fieldset { border: 0; border-top: 1px solid var(--line); margin: 0; padding: 14px 0; min-width: 0; }
.quiz legend { font-weight: 600; color: var(--text); padding: 0; margin-bottom: 8px; float: left; width: 100%; }
.quiz label { display: flex; gap: 10px; align-items: flex-start; min-height: 44px; padding: 10px 12px; margin: 6px 0; border-radius: var(--radius-sm); background: var(--surf); border: 1px solid var(--line); cursor: pointer; clear: both; }
.quiz label.is-correct { border-color: var(--ok); background: var(--ok-bg); }
.quiz label.is-wrong { border-color: var(--ko); background: var(--ko-bg); }
.quiz input { margin-top: .3em; accent-color: var(--acc-bg); width: 18px; height: 18px; flex: none; }
.q-feedback { margin-top: 6px; font-size: 14px; }
.q-feedback.ok { color: var(--ok); }
.q-feedback.ko { color: var(--ko); }
.quiz-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.quiz-score { font-weight: 700; margin: 0; }
.final-exam { background: var(--surf); border: 2px solid var(--acc-bright); border-radius: var(--radius); padding: 18px; }
.final-exam h2 { margin-top: 0; }

/* One step at a time (enabled by JS; without JS the whole course stays readable). */
.paged [data-step]:not(.is-active),
.paged .part:not(.has-active):not(.is-active),
.paged .lesson[data-group]:not(.has-active) { display: none; }
.paged .part { margin-bottom: 0; }
.paged .lesson[data-group] > .topic.is-active { border-top: 0; margin-top: 4px; padding-top: 0; }
.step-nav { display: none; }
.paged .step-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0 8px; }
.step-link {
  display: flex; align-items: center; gap: 8px; min-height: 64px; padding: 10px 12px; border-radius: 12px;
  background: var(--surf); border: 1px solid var(--line); color: var(--text); text-decoration: none; min-width: 0;
}
.step-link:hover { border-color: var(--acc-bright); color: var(--text); }
.step-link span { display: flex; flex-direction: column; min-width: 0; }
.step-link small { color: var(--faint); font-size: 12px; }
.step-link strong { font-size: 14px; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.step-link-next { justify-content: flex-end; text-align: right; grid-column: 2; }
.step-link[hidden] { display: none; }
.step-link .icon { color: var(--acc); }

/* Toolbox cards */
.tools { margin-top: 4px; }
.tool-group { margin-top: 18px; }
.tool-group h4 { margin: 0 0 8px; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--acc); }
.tool-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: 10px; }
.tool-card {
  display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 14px; border-radius: 12px;
  background: var(--surf); border: 1px solid var(--line); color: var(--muted); text-decoration: none;
}
a.tool-card:hover { border-color: var(--acc-bright); box-shadow: var(--shadow-card); color: var(--muted); }
.tool-name { color: var(--text); font-size: 15px; }
.tool-desc { font-size: 14px; line-height: 1.45; }
.tool-cta { margin-top: auto; padding-top: 6px; color: var(--acc); font-weight: 600; font-size: 14px; }

.nav-quiz .nav-link { font-size: 13px; }
.nav-quiz em { font-style: normal; font-weight: 700; color: var(--acc); }
.nav-link.is-parent { color: var(--text); font-weight: 600; }
.bottombar b { font-weight: 700; font-variant-numeric: tabular-nums; }

.course-footer { margin-top: 32px; padding: 24px 0 8px; border-top: 1px solid var(--line); text-align: center; color: var(--faint); font-size: 13px; }
.course-footer .socials { margin: 0 0 10px; }
.course-footer .socials a, .course-footer a { color: var(--muted); }

/* ---------- Tablet ---------- */
@media (min-width: 640px) {
  .main { padding: 24px 24px 40px; }
  .hero-card { padding: 30px 28px; }
  .hero-card .actions { flex-direction: row; flex-wrap: wrap; }
  .lesson { padding: 22px; }
  .video-frame { margin: 0; }
  .part-supports ul { columns: 2 260px; column-gap: 28px; }
  .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Desktop: persistent sidebar like YouTube / the CRM ---------- */
@media (min-width: 1024px) {
  .course { padding-bottom: 0; padding-left: var(--sidebar-w); transition: padding-left .22s ease; }
  .course.nav-collapsed { padding-left: 0; }
  .sidebar { width: var(--sidebar-w); transform: none; visibility: visible; box-shadow: none; transition: transform .22s ease, visibility .22s; }
  .nav-collapsed .sidebar { transform: translateX(-102%); visibility: hidden; }
  .sidebar-brand .js-nav-close, .backdrop, .bottombar { display: none; }
  .nav-open { overflow: visible; }
  .appbar { padding: 0 20px; }
  .appbar .nav-toggle, .appbar .lesson-nav { display: inline-flex; }
  .appbar-brand { display: none; }
  .nav-collapsed .appbar-brand { display: flex; }
  .appbar-current { display: block; margin: 0; min-width: 0; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); font-size: 14px; }
  .appbar-current strong { color: var(--text); }
  .progress-pill { margin-left: 0; }
  .main { padding: 28px 40px 48px; }
  .to-top {
    position: fixed; right: 24px; bottom: 24px; z-index: 20; display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--surf); color: var(--acc);
    box-shadow: var(--shadow-float); cursor: pointer; transition: transform .15s ease, opacity .15s ease;
  }
  .to-top:hover { transform: translateY(-2px); border-color: var(--acc-bright); }
  .to-top[hidden] { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar, .backdrop, .course, .progress-fill, .btn, .video-facade img { transition: none; }
}
