/* Marzley Tech learning hub. Uses the site's colour tokens from home.css (light and dark). */
.learn-body { background: var(--bg); color: var(--fg); font-family: var(--font); margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
.learn-body .muted { color: var(--fg-muted); }
.learn-body .small { font-size: 14px; }
.learn-body a { color: var(--blue); }
.learn-body .btn { min-height: 44px; padding: 0 18px; font-size: 15px; text-decoration: none; }
.learn-body .btn-sm { min-height: 38px; padding: 0 14px; font-size: 14px; gap: 8px; }
.learn-body .btn-solid { color: var(--navy); }
.learn-body .btn-solid:hover { background: #ffc733; }
.learn-body .btn-line, .learn-body .btn-ghost { background: transparent; color: var(--heading); border-color: var(--line); }
.learn-body .btn-line:hover, .learn-body .btn-ghost:hover { border-color: var(--heading); }
.learn-body .btn:disabled { opacity: .6; cursor: wait; }
.learn-body .btn:focus-visible, .learn-body a:focus-visible, .learn-body button:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
.linklike { background: none; border: 0; padding: 0; color: var(--blue); font: inherit; text-decoration: underline; cursor: pointer; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--heading); cursor: pointer; font-size: 16px; }
.icon-btn:hover { border-color: var(--heading); }
.spinner.sm { display: inline-block; width: 16px; height: 16px; border-width: 3px; vertical-align: -3px; border-color: var(--line); border-top-color: var(--amber); }
.learn-loading { display: flex; align-items: center; gap: 12px; color: var(--fg-muted); padding: 40px 0; }
.learn-loading .spinner { border-color: var(--line); border-top-color: var(--amber); width: 28px; height: 28px; }
.tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--current-bg); color: var(--amber-text); vertical-align: middle; }

/* ---------- top bar ---------- */
.learn-top { position: sticky; top: 0; z-index: 40; background: var(--header-bg); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.learn-top-in { display: flex; align-items: center; gap: 14px; height: 64px; padding: 0 clamp(12px, 3vw, 28px); max-width: 1600px; margin: 0 auto; }
.learn-top .brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 18px; color: var(--heading); text-decoration: none; }
.learn-top .brand .accent { color: var(--amber-text); }
.learn-home { font-weight: 700; color: var(--heading) !important; text-decoration: none; padding: 4px 10px; border-radius: 999px; background: var(--current-bg); font-size: 14px; }
.learn-nav { display: flex; gap: 4px; margin-left: 8px; }
.learn-nav a { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px; color: var(--fg-muted); text-decoration: none; font-weight: 600; font-size: 15px; }
.learn-nav a:hover { color: var(--heading); background: var(--pill-bg); }
.learn-nav a.is-current { color: var(--heading); background: var(--current-bg); box-shadow: inset 0 -2px 0 var(--amber); }
.learn-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.user-menu { position: relative; }
.user-btn { border: 0; background: none; padding: 0; cursor: pointer; }
.avatar { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--navy); color: var(--amber); font-weight: 800; flex: none; }
[data-theme=dark] .avatar { background: var(--highlight); }
.user-pop { position: absolute; right: 0; top: calc(100% + 8px); width: 260px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 16px; }
.user-pop p { margin: 0 0 4px; }
.user-name { font-weight: 700; color: var(--heading); }
.user-email, .user-progress { font-size: 14px; color: var(--fg-muted); overflow-wrap: anywhere; }
.user-pop .btn { margin-top: 10px; width: 100%; }

/* ---------- layout ---------- */
.learn-shell { flex: 1; width: 100%; max-width: 1600px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr); }
body.has-side .learn-shell { grid-template-columns: 280px minmax(0, 1fr); }
.learn-main { padding: clamp(16px, 3vw, 36px) clamp(16px, 4vw, 48px) 64px; min-width: 0; outline: none; }
.learn-side { position: sticky; top: 64px; height: calc(100vh - 64px); overflow-y: auto; border-right: 1px solid var(--line); background: var(--card); padding: 16px 12px 32px; }
.track-tabs { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 4px 14px; border-bottom: 1px solid var(--line); }
.track-tabs a { padding: 6px 10px; border-radius: 8px; font-size: 13px; font-weight: 700; color: var(--fg-muted); text-decoration: none; background: var(--bg); }
.track-tabs a.is-current, .track-tabs a:hover { background: var(--navy); color: #fff; }
[data-theme=dark] .track-tabs a.is-current, [data-theme=dark] .track-tabs a:hover { background: var(--amber); color: var(--navy); }
.side-title { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--fg-muted); margin: 18px 8px 8px; }
.lesson-list { list-style: none; margin: 0; padding: 0; }
.lesson-list a { display: flex; align-items: flex-start; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--fg); text-decoration: none; font-size: 15px; line-height: 1.35; }
.lesson-list a:hover { background: var(--bg); }
.lesson-list a.is-current { background: var(--current-bg); color: var(--heading); font-weight: 700; box-shadow: inset 3px 0 0 var(--amber); }
.lesson-list .tick { color: var(--line); margin-top: 2px; }
.lesson-list a.done .tick { color: var(--green); }
.side-practice { display: flex; align-items: center; gap: 8px; margin: 16px 8px 0; padding: 10px 12px; border: 1px dashed var(--field-border); border-radius: 10px; font-weight: 700; text-decoration: none; color: var(--heading) !important; }
.side-scrim { display: none; }
.side-toggle { display: none; }
.side-toggle:not([hidden]) { display: inline-grid; }

/* ---------- home ---------- */
.hero-learn { display: grid; grid-template-columns: 1.3fr 1fr; gap: 32px; align-items: center; padding: 16px 0 24px; }
.eyebrow { color: var(--amber-text); font-weight: 800; text-transform: uppercase; letter-spacing: .08em; font-size: 13px; margin: 0 0 8px; }
.hero-learn h1 { font-size: clamp(30px, 4.4vw, 50px); line-height: 1.08; color: var(--heading); margin: 0 0 14px; letter-spacing: -.02em; }
.lead { font-size: 18px; color: var(--fg-muted); max-width: 62ch; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.hero-code pre { margin: 0; background: #0b1b35; color: #e2e8f0; border-radius: 18px; padding: 26px; font: 16px/1.8 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; box-shadow: var(--shadow-lg); white-space: pre-wrap; border: 1px solid #1e3a7a; }
.c-k { color: #ffb800; } .c-s { color: #86efac; } .c-t { color: #7cb4ff; }
.home-sec { margin-top: 36px; }
.home-sec h2, .list-page h1 { color: var(--heading); font-size: clamp(22px, 2.6vw, 30px); margin: 0 0 16px; }
.sec-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.sec-head a { font-weight: 700; }
.track-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.track-card { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 20px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); text-decoration: none; color: var(--fg); box-shadow: var(--shadow); transition: transform .2s var(--ease), border-color .2s; }
.track-card:hover { transform: translateY(-3px); border-color: var(--amber); }
.track-card > i { font-size: 34px; }
.t-html > i { color: #e34f26; } .t-css > i { color: #2965f1; } .t-javascript > i { color: #d4a300; } .t-python > i { color: #3776ab; } .t-sql > i { color: #059669; }
[data-theme=dark] .t-css > i { color: #7cb4ff; } [data-theme=dark] .t-python > i { color: #7cb4ff; } [data-theme=dark] .t-javascript > i { color: #fbbf24; }
.track-card h3 { margin: 6px 0 0; color: var(--heading); font-size: 20px; }
.track-card p { margin: 0; color: var(--fg-muted); font-size: 14px; flex: 1; }
.track-meta { font-size: 13px; font-weight: 700; color: var(--fg-muted); }
.bar { display: block; height: 6px; border-radius: 6px; background: var(--bg); overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--green); }

/* ---------- lesson ---------- */
.lesson { max-width: 900px; }
.lesson.has-toc { margin: 0 auto; }
@media (min-width: 1200px) { .lesson.has-toc { max-width: 1180px; } .lesson.has-toc .lesson-wrap ~ *, .lesson.has-toc > :not(.lesson-wrap):not(.read-progress) { max-width: 890px; } }
.crumbs { font-size: 14px; color: var(--fg-muted); margin: 0 0 12px; }
.lesson-body h1 { font-size: clamp(28px, 3.4vw, 40px); color: var(--heading); margin: 8px 0 16px; letter-spacing: -.01em; }
.lesson-body h2 { font-size: 24px; color: var(--heading); margin: 32px 0 10px; }
.lesson-body h3 { font-size: 20px; color: var(--heading); margin: 32px 0 10px; }
.lesson-body h4 { font-size: 18px; color: var(--heading); margin: 24px 0 8px; }
.lesson-body p, .lesson-body li { font-size: 17px; line-height: 1.7; }
.lesson-body code, .ex-task code, .ex-result code, .video-desc code { font: .9em ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--pill-bg); color: var(--heading); padding: 2px 6px; border-radius: 6px; }
.code-sample { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--amber); border-radius: 10px; padding: 14px 16px; overflow-x: auto; font: 15px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.code-sample code { background: none; padding: 0; }
.tip { display: flex; gap: 12px; background: var(--current-bg); border-left: 4px solid var(--amber); border-radius: 10px; padding: 12px 16px; margin: 20px 0; }
.tip i { color: var(--amber-text); margin-top: 5px; }
.tip p { margin: 0; }
.table-wrap { overflow-x: auto; margin: 16px 0; }
.lesson-body table { border-collapse: collapse; min-width: 60%; background: var(--card); }
.lesson-body th, .lesson-body td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; font-size: 15px; }
.lesson-body th { background: var(--bg); color: var(--heading); }
.pager { display: flex; justify-content: space-between; gap: 12px; margin: 36px 0 0; flex-wrap: wrap; }
.pager-top { margin: 0 0 12px; }
.pager .btn { max-width: 100%; }
.done-row { margin-top: 28px; }

/* ---------- try it ---------- */
.try { margin: 18px 0 24px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--card); box-shadow: var(--shadow); }
.try-bar, .pane-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px 8px 14px; background: var(--bg); border-bottom: 1px solid var(--line); }
.try-lang, .pane-bar > span { font-size: 13px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--fg-muted); }
.try-btns, .pane-bar > div { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.try-reset, .try-open { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--fg-muted); cursor: pointer; text-decoration: none; }
.try-reset:hover, .try-open:hover { color: var(--heading); border-color: var(--heading); }
.try-body { display: grid; grid-template-columns: minmax(0, 1fr); }
.try-editor .CodeMirror, .pane-editor .CodeMirror { height: auto; min-height: 120px; font: 15px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.try-editor .CodeMirror-scroll { max-height: 460px; }
.try-output { border-top: 1px dashed var(--line); }
.run-frame { display: block; width: 100%; height: 240px; border: 0; background: #fff; resize: vertical; }
[data-theme=dark] .run-frame { background: #0b1628; }
kbd { font: 11px ui-monospace, monospace; padding: 1px 5px; border-radius: 4px; background: rgba(11, 27, 53, .12); }
.plain-editor { width: 100%; min-height: 160px; border: 0; padding: 12px; font: 15px/1.55 ui-monospace, monospace; background: var(--card); color: var(--fg); resize: vertical; box-sizing: border-box; }

/* CodeMirror in dark mode */
[data-theme=dark] .CodeMirror { background: #0b1628; color: #e2e8f0; }
[data-theme=dark] .CodeMirror-gutters { background: #0f1b31; border-color: #1e2e4a; }
[data-theme=dark] .CodeMirror-linenumber { color: #6b7a90; }
[data-theme=dark] .CodeMirror-cursor { border-left-color: #ffb800; }
[data-theme=dark] .CodeMirror-activeline-background { background: rgba(124, 180, 255, .07); }
[data-theme=dark] .CodeMirror-selected, [data-theme=dark] .CodeMirror-focused .CodeMirror-selected { background: rgba(124, 180, 255, .25); }
[data-theme=dark] .cm-s-default .cm-keyword { color: #f472b6; }
[data-theme=dark] .cm-s-default .cm-string { color: #86efac; }
[data-theme=dark] .cm-s-default .cm-tag { color: #7cb4ff; }
[data-theme=dark] .cm-s-default .cm-attribute { color: #fbbf24; }
[data-theme=dark] .cm-s-default .cm-number { color: #fca5a5; }
[data-theme=dark] .cm-s-default .cm-comment, [data-theme=dark] .cm-s-default .cm-meta { color: #8fa1ba; }
[data-theme=dark] .cm-s-default .cm-def, [data-theme=dark] .cm-s-default .cm-variable-2 { color: #93c5fd; }
[data-theme=dark] .cm-s-default .cm-property, [data-theme=dark] .cm-s-default .cm-builtin { color: #c4b5fd; }
[data-theme=dark] .cm-s-default .cm-qualifier, [data-theme=dark] .cm-s-default .cm-atom { color: #fdba74; }
[data-theme=dark] .CodeMirror-matchingbracket { color: #fff !important; background: rgba(255, 184, 0, .3); }

/* ---------- exercise ---------- */
.exercise { margin-top: 40px; padding: 20px; border-radius: 16px; background: var(--card); border: 2px solid var(--amber); }
.exercise h2 { margin: 0 0 6px; color: var(--heading); font-size: 22px; display: flex; gap: 10px; align-items: center; }
.exercise h2 i { color: var(--amber-text); }
.ex-task p { font-size: 17px; margin: 6px 0; }
.exercise .try { margin-bottom: 8px; }
.ex-result { min-height: 24px; margin: 8px 0 0; font-size: 16px; }
.ex-result .ok { color: var(--green); font-weight: 700; }
.ex-result .bad { color: #b91c1c; font-weight: 600; }
[data-theme=dark] .ex-result .bad { color: #fca5a5; }
.ex-result a { margin-left: 6px; }

/* ---------- practice ---------- */
.practice-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.practice-head h1 { margin: 0; color: var(--heading); font-size: 28px; }
.lang-pick { display: flex; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 4px; flex-wrap: wrap; }
.lang-pick button { border: 0; background: none; padding: 8px 14px; border-radius: 8px; font: inherit; font-weight: 700; font-size: 14px; color: var(--fg-muted); cursor: pointer; }
.lang-pick button[aria-selected=true] { background: var(--navy); color: #fff; }
[data-theme=dark] .lang-pick button[aria-selected=true] { background: var(--amber); color: var(--navy); }
.practice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pane { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--card); min-height: 62vh; }
.pane-editor { flex: 1; display: flex; flex-direction: column; }
.pane-editor .CodeMirror { flex: 1; height: 100%; min-height: 56vh; }
.pane-output { flex: 1; display: flex; }
.pane-output .run-frame { height: auto; min-height: 56vh; flex: 1; resize: none; }

/* ---------- videos ---------- */
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.video-card { text-decoration: none; color: var(--fg); display: block; }
.thumb { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: linear-gradient(135deg, #0b1b35, #1e3a7a); color: rgba(255, 255, 255, .8); font-size: 44px; }
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .3s var(--ease); }
.video-card:hover .thumb img { transform: scale(1.04); }
.thumb .dur, .thumb .price { position: absolute; font-size: 12px; font-weight: 800; padding: 3px 8px; border-radius: 6px; }
.thumb .dur { right: 8px; bottom: 8px; background: rgba(0, 0, 0, .78); color: #fff; }
.thumb .price { left: 8px; top: 8px; background: var(--amber); color: var(--navy); }
.thumb .price.open { background: #047857; color: #fff; }
.video-card h2, .video-card h3 { margin: 10px 0 4px; font-size: 17px; color: var(--heading); line-height: 1.3; }
.video-card .meta, .note-card .meta { margin: 0; font-size: 13px; color: var(--fg-muted); }
.video-page { max-width: 1060px; }
.player { position: relative; border-radius: 16px; overflow: hidden; background: #000; aspect-ratio: 16 / 9; }
.player:fullscreen { border-radius: 0; aspect-ratio: auto; width: 100vw; height: 100vh; }
.wm { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 2; }
.wm-tile { position: absolute; inset: 0; background-repeat: repeat; }
.wm-tag { position: absolute; max-width: 60%; padding: 3px 8px; border-radius: 6px; font: 600 clamp(11px, 1.4vw, 15px)/1.3 system-ui, sans-serif; color: rgba(255, 255, 255, .55); text-shadow: 0 1px 2px rgba(0, 0, 0, .7); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: opacity .4s ease; user-select: none; }
.wm-full { position: absolute; top: 10px; right: 10px; z-index: 3; width: 40px; height: 40px; border-radius: 10px; border: 0; background: rgba(0, 0, 0, .55); color: #fff; font-size: 16px; cursor: pointer; opacity: .75; }
.wm-full:hover, .wm-full:focus-visible { opacity: 1; }
.wm-full.pulse { opacity: 1; background: var(--amber); color: var(--navy); animation: wm-pulse .8s ease 3; }
@keyframes wm-pulse { 50% { transform: scale(1.15); } }
.wm-hint { position: absolute; top: 14px; right: 60px; z-index: 3; margin: 0; padding: 8px 12px; border-radius: 10px; background: rgba(0, 0, 0, .8); color: #fff; font-size: 14px; }
.player video { width: 100%; height: 100%; display: block; background: #000; }
.locked { position: relative; height: 100%; display: grid; place-items: center; background: linear-gradient(135deg, #0b1b35, #1e3a7a) center / cover; padding: 16px; }
.locked::before { content: ""; position: absolute; inset: 0; background: rgba(8, 17, 31, .72); backdrop-filter: blur(3px); }
.lock-card { position: relative; text-align: center; color: #fff; max-width: 440px; }
.lock-card > i { font-size: 30px; color: var(--amber); }
.lock-card h2 { margin: 8px 0 6px; font-size: clamp(20px, 3vw, 26px); color: #fff; }
.lock-card p { margin: 0 0 14px; color: rgba(255, 255, 255, .85); }
.lock-card a { color: var(--amber); }
.unlock-form label { display: block; text-align: left; font-weight: 700; font-size: 14px; margin-bottom: 6px; }
.unlock-row { display: flex; gap: 8px; }
.unlock-row input { flex: 1; min-width: 0; min-height: 44px; border-radius: 10px; border: 2px solid rgba(255, 255, 255, .3); background: rgba(255, 255, 255, .95); color: #0f172a; padding: 0 12px; font: inherit; }
.u-msg { min-height: 22px; margin: 8px 0 0; font-size: 14px; }
.video-page h1 { font-size: clamp(22px, 2.6vw, 28px); color: var(--heading); margin: 16px 0 6px; }
.video-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; color: var(--fg-muted); font-size: 14px; }
.video-acts { display: flex; gap: 8px; }
.pill-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--heading); font: inherit; font-weight: 700; cursor: pointer; }
.pill-btn[aria-pressed=true] { background: var(--current-bg); border-color: var(--amber); }
.pill-btn:disabled { opacity: .55; cursor: not-allowed; }
.video-desc { margin-top: 14px; padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.video-desc p { margin: 0 0 8px; }
.comments { margin-top: 26px; }
.comments h2 { font-size: 20px; color: var(--heading); }
.c-form { display: flex; gap: 12px; margin-bottom: 20px; }
.c-field { flex: 1; }
.c-field textarea { width: 100%; box-sizing: border-box; border: 1px solid var(--field-border); background: var(--field-bg); color: var(--fg); border-radius: 10px; padding: 10px 12px; font: inherit; resize: vertical; }
.c-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 8px; }
.comment-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.comment { display: flex; gap: 12px; }
.comment.is-hidden { opacity: .55; }
.c-head { margin: 0; font-size: 14px; }
.c-head span { color: var(--fg-muted); }
.c-text { margin: 4px 0; overflow-wrap: anywhere; }
.c-del { font-size: 13px; }

/* ---------- notes ---------- */
.note-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.note-card { display: flex; gap: 14px; padding: 16px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); text-decoration: none; color: var(--fg); }
.note-card:hover { border-color: var(--amber); }
.note-card > i { font-size: 34px; color: #dc2626; }
.note-card h2, .note-card h3 { margin: 0 0 4px; font-size: 16px; color: var(--heading); }
.note-card p { margin: 0 0 4px; font-size: 14px; color: var(--fg-muted); }
.reader-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.reader-head h1 { margin: 0; color: var(--heading); font-size: clamp(22px, 2.8vw, 30px); }
.reader-head p { margin: 4px 0 0; }
.reader-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.z-val, .pg { font-size: 14px; color: var(--fg-muted); min-width: 44px; text-align: center; }
.pages { display: flex; flex-direction: column; align-items: center; gap: 14px; overflow-x: auto; padding: 16px 0; background: var(--bg); }
.page { position: relative; background: #fff; box-shadow: var(--shadow); flex: none; max-width: none; }
.page canvas { display: block; width: 100%; height: 100%; }
.pnum { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); color: #94a3b8; font-weight: 700; }

/* ---------- empty states, dialog, footer ---------- */
.empty { text-align: center; padding: 48px 16px; color: var(--fg-muted); border: 1px dashed var(--line); border-radius: 16px; grid-column: 1 / -1; }
.empty > i { font-size: 34px; color: var(--fg-faint); }
.learn-dialog { width: min(440px, calc(100vw - 32px)); border: 0; border-radius: 18px; padding: 26px; background: var(--card); color: var(--fg); box-shadow: var(--shadow-lg); }
.learn-dialog::backdrop { background: rgba(8, 17, 31, .6); }
.learn-dialog h2 { margin: 0 0 6px; color: var(--heading); font-size: 22px; padding-right: 40px; }
.dialog-close { position: absolute; right: 14px; top: 14px; margin: 0; }
.gsi-box { display: flex; justify-content: center; min-height: 44px; margin: 18px 0 6px; }
.or { display: flex; align-items: center; gap: 10px; color: var(--fg-faint); font-size: 13px; margin: 14px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.code-form { display: grid; gap: 12px; }
.code-form label { font-weight: 700; font-size: 14px; }
.code-form input { min-height: 44px; border-radius: 10px; border: 1px solid var(--field-border); background: var(--field-bg); color: var(--fg); padding: 0 12px; font: inherit; }
.form-msg { margin: 0; min-height: 20px; font-size: 14px; color: var(--fg-muted); }
.learn-foot { text-align: center; padding: 20px 16px; border-top: 1px solid var(--line); color: var(--fg-muted); font-size: 14px; }
.learn-foot p { margin: 0; }

/* ---------- smaller screens ---------- */
@media (max-width: 1100px) {
    .learn-nav a { padding: 8px 10px; }
    .learn-nav a i { display: none; }
}
@media (max-width: 900px) {
    .side-toggle:not([hidden]) { display: inline-grid; }
    body.has-side .learn-shell { grid-template-columns: minmax(0, 1fr); }
    .learn-side { position: fixed; z-index: 50; left: 0; top: 64px; bottom: 0; height: auto; width: min(300px, 86vw); transform: translateX(-102%); transition: transform .25s var(--ease); box-shadow: var(--shadow-lg); }
    body.side-open .learn-side { transform: none; }
    body.side-open .side-scrim { display: block; position: fixed; inset: 64px 0 0; z-index: 45; background: rgba(8, 17, 31, .5); }
    .hero-learn { grid-template-columns: 1fr; }
    .hero-code { display: none; }
    .practice-grid { grid-template-columns: 1fr; }
    .pane { min-height: 0; }
    .pane-editor .CodeMirror { min-height: 300px; }
    .pane-output .run-frame { min-height: 280px; }
}
@media (max-width: 760px) {
    .learn-top { backdrop-filter: none; background: var(--card); }   /* a blur here would trap the fixed bottom bar inside the header */
    .learn-top-in { gap: 8px; }
    .learn-top .brand span, .learn-home { display: none; }
    .learn-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; margin: 0; justify-content: space-around; background: var(--card); border-top: 1px solid var(--line); padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); }
    .learn-nav a { flex-direction: column; gap: 2px; font-size: 12px; padding: 6px 8px; }
    .learn-nav a i { display: inline-block; font-size: 18px; }
    .learn-nav a.is-current { box-shadow: none; }
    .learn-body { padding-bottom: 64px; }
    .lesson-body p, .lesson-body li { font-size: 16px; }
    .unlock-row { flex-direction: column; }
    .run-frame { height: 200px; }
}

/* The site zooms up on very large screens (home.css); the code editor and admin work best unzoomed */
html { zoom: 1; }

.free-badges { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; padding: 0; }
.free-badges li { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-size: 14px; font-weight: 700; color: var(--heading); }
.free-badges i { color: var(--green); }
.learn-actions .portal-link { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 14px 0 5px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--heading); text-decoration: none; font-weight: 700; font-size: 14px; line-height: 1; white-space: nowrap; box-shadow: 0 1px 2px rgba(11, 27, 53, .06); transition: border-color .2s, box-shadow .2s, transform .2s; }
.learn-actions .portal-link i { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--navy); color: var(--amber); font-size: 14px; }
[data-theme=dark] .learn-actions .portal-link i { background: var(--amber); color: var(--navy); }
.learn-actions .portal-link:hover, .learn-actions .portal-link:focus-visible { border-color: var(--amber); box-shadow: 0 4px 14px rgba(11, 27, 53, .12); transform: translateY(-1px); color: var(--heading); }
@media (prefers-reduced-motion: reduce) { .learn-actions .portal-link { transition: none; } .learn-actions .portal-link:hover { transform: none; } }
@media (max-width: 1100px) { .learn-actions .portal-link { padding: 0 4px; } .learn-actions .portal-link span { display: none; } }

/* ---------- practice questions and tools ---------- */
.quiz, .tool { margin: 22px 0; padding: 18px 20px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); }
.quiz h3, .tool h3 { margin: 0 0 12px; font-size: 18px; color: var(--heading); display: flex; gap: 10px; align-items: center; }
.quiz h3 i, .tool h3 i { color: var(--amber-text); }
.quiz ol { margin: 0; padding-left: 22px; display: grid; gap: 14px; }
.quiz-q { margin: 0 0 6px; font-weight: 600; }
.quiz-row, .tool-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.quiz-row input, .tool-row input, .tool-field input { min-height: 40px; min-width: 0; flex: 1 1 180px; border-radius: 10px; border: 1px solid var(--field-border); background: var(--field-bg); color: var(--fg); padding: 0 12px; font: 15px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.quiz li.ok input, .tool-field.ok input { border-color: var(--green); box-shadow: 0 0 0 2px rgba(5, 150, 105, .15); }
.quiz li.bad input, .tool-field.bad input { border-color: #dc2626; }
.quiz-fb { margin: 6px 0 0; min-height: 20px; font-size: 14px; }
.quiz li.ok .quiz-fb { color: var(--green); font-weight: 700; }
.quiz li.bad .quiz-fb { color: #b91c1c; }
[data-theme=dark] .quiz li.bad .quiz-fb { color: #fca5a5; }
.quiz-score, .tool-score { margin: 12px 0 0; font-weight: 700; color: var(--fg-muted); }
.tool-row label { font-weight: 700; font-size: 14px; }
.tool-out { margin-top: 12px; }
.tool-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.tool-table th, .tool-table td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tool-table th { width: 42%; color: var(--fg-muted); font-weight: 600; }
.tool-table td { font-weight: 700; color: var(--heading); overflow-wrap: anywhere; }
.tool-table.chmod th, .tool-table.chmod td { text-align: center; width: auto; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.tool-field { display: grid; gap: 4px; font-size: 13px; font-weight: 700; color: var(--fg-muted); }
.tool-q { margin: 0 0 12px; font-size: 16px; }
.tool-btns { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; }
.tool-bits { display: flex; gap: 4px; flex-wrap: wrap; margin: 14px 0 0; }
.tool-bits span { display: grid; place-items: center; width: 52px; padding: 6px 0; border-radius: 8px; background: var(--bg); font-size: 12px; color: var(--fg-muted); }
.tool-bits span b { font-size: 20px; color: var(--fg-faint); }
.tool-bits span.on { background: var(--current-bg); }
.tool-bits span.on b { color: var(--amber-text); }
.chmod-sym { padding: 6px 10px; border-radius: 8px; background: var(--bg); }
.s-networking > i { color: #0891b2; } .s-make-money-online > i { color: #059669; } .s-git > i { color: #f05033; } .s-linux > i { color: #0f172a; }
.s-php > i { color: #777bb3; } .s-cybersecurity > i { color: #dc2626; } .s-hosting > i { color: #2563eb; } .s-marketing > i { color: #d97706; } .s-it-basics > i { color: #475569; }
[data-theme=dark] .s-linux > i, [data-theme=dark] .s-it-basics > i { color: #cbd5e1; }
.learn-actions .btn { white-space: nowrap; }

/* ---------- subject groups, keep-learning box, free channels ---------- */
.group-jump { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; }
.group-jump a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--heading); font-weight: 600; font-size: 14px; text-decoration: none; }
.group-jump a:hover { border-color: var(--amber); }
.group-jump i { color: var(--amber-text); }
.track-group { margin-top: 28px; scroll-margin-top: 90px; }
.group-title { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; color: var(--heading); font-size: 19px; }
.group-title i { color: var(--amber-text); }
.group-title .muted { font-size: 14px; font-weight: 600; }
.more-box { margin: 32px 0 0; padding: 18px 20px; border-radius: 16px; background: var(--current-bg); border: 1px solid var(--line); }
.more-box h2 { margin: 0 0 10px; font-size: 18px; color: var(--heading); display: flex; gap: 8px; align-items: center; }
.more-box h2 i { color: var(--amber-text); }
.more-box ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.more-box a { display: inline-flex; gap: 8px; align-items: center; font-weight: 600; }
.more-box .fa-youtube { color: #dc2626; }
.channel-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.channel-list a { display: flex; gap: 12px; align-items: flex-start; height: 100%; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); color: var(--fg); text-decoration: none; }
.channel-list a:hover { border-color: var(--amber); }
.channel-list i { color: #dc2626; font-size: 22px; margin-top: 2px; }
.channel-list strong { display: block; color: var(--heading); }
.channel-list span { font-size: 14px; color: var(--fg-muted); }

/* Plain list of every lesson, shown before the app loads (and to search engines / without JavaScript) */
.learn-static h1 { color: var(--heading); margin: 0 0 8px; }
.learn-static > ul { list-style: none; padding: 0; display: grid; gap: 18px; }
.learn-static h3 { margin: 0 0 4px; color: var(--heading); }
.learn-static ul ul { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 0; list-style: none; font-size: 14px; }
html.js .learn-static { display: none; }

/* ---------- practice: examples menu and language details ---------- */
.ex-select { height: 34px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--heading); font: inherit; font-size: 13px; font-weight: 600; padding: 0 8px; margin-right: 6px; max-width: 140px; }
.practice-info { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; margin-top: 18px; padding: 20px 22px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); }
.practice-info h2 { margin: 0 0 8px; font-size: 20px; color: var(--heading); }
.practice-info h3 { margin: 0 0 8px; font-size: 16px; color: var(--heading); }
.practice-info p { margin: 0 0 10px; }
.pi-uses { display: flex; flex-wrap: wrap; gap: 6px; }
.pi-tips ul { margin: 0 0 12px; padding-left: 18px; display: grid; gap: 6px; }
.pi-tips li { font-size: 14px; }
@media (max-width: 800px) { .practice-info { grid-template-columns: 1fr; } }
.practice-info > * { min-width: 0; }
.practice-info li, .practice-info p { overflow-wrap: anywhere; }
.lang-group { align-self: center; padding: 0 4px 0 8px; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--amber-text); }
.lang-group:first-child { padding-left: 4px; }
.lang-pick { max-width: 100%; }
.practice-head { align-items: flex-start; }

/* ---------- "What went wrong" helper ---------- */
.cm-err-line { background: rgba(220, 38, 38, .12) !important; }
.practice-help, .try-help { margin-top: 12px; display: grid; gap: 10px; }
.try-help { margin: 0; padding: 0 12px 12px; }
.help-card { border-radius: 12px; padding: 14px 16px; border: 1px solid var(--line); background: var(--card); font-size: 15px; }
.help-card p { margin: 0 0 8px; }
.help-err { border-left: 4px solid #dc2626; }
.help-tips { border-left: 4px solid var(--amber); }
.help-title { font-weight: 800; color: var(--heading); display: flex; gap: 8px; align-items: center; }
.help-err .help-title i { color: #dc2626; }
.help-tips .help-title i { color: var(--amber-text); }
.help-line code, .help-card li code { overflow-wrap: anywhere; }
.help-ex-label { margin-bottom: 4px !important; font-weight: 700; }
.help-ex { margin: 0 0 8px; padding: 10px 12px; border-radius: 8px; background: #0b1b35; color: #e2e8f0; font-size: 13px; overflow: auto; }
.help-raw summary { cursor: pointer; color: var(--fg-muted); font-size: 13px; }
.help-raw pre { white-space: pre-wrap; font-size: 12px; color: var(--fg-muted); max-height: 200px; overflow: auto; }
.help-tips ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.help-go { font-weight: 700; }

/* ---------- Videos inside lessons ---------- */
.lesson-video { margin: 24px 0; padding: 16px; border-radius: 16px; background: var(--current-bg); border: 1px solid var(--line); }
.lesson-video h2 { margin: 0 0 12px; font-size: 18px; color: var(--heading); display: flex; gap: 8px; align-items: center; }
.lesson-video h2 i { color: #dc2626; }
.yt { margin: 0 0 12px; }
.yt-play, .yt iframe { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 12px; overflow: hidden; background: #0b1b35; padding: 0; cursor: pointer; }
.yt-play img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: .92; transition: opacity .2s; }
.yt-play:hover img, .yt-play:focus-visible img { opacity: 1; }
.yt-play:focus-visible { outline: 3px solid var(--amber, #ffb800); outline-offset: 3px; }
.yt-btn { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 68px; height: 48px; border-radius: 14px; background: #dc2626; color: #fff; display: grid; place-items: center; font-size: 20px; box-shadow: 0 8px 24px rgba(0,0,0,.35); transition: transform .2s; }
.yt-play:hover .yt-btn { transform: translate(-50%, -50%) scale(1.08); }
.yt-list { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 18px; background: linear-gradient(135deg, #0b1b35, #1e3a8a); }
.yt figcaption { margin-top: 8px; font-size: 14px; color: var(--fg-muted); }
.yt figcaption i { color: #dc2626; }
.yt figcaption a { font-weight: 600; }
.more-videos { margin-top: 4px; }
.more-videos summary { cursor: pointer; font-weight: 700; color: var(--heading); padding: 6px 0; }
.more-videos .yt { margin-top: 10px; }
.yt-note { margin: 4px 0 0; font-size: 12px; color: var(--fg-muted); }
@media print { .lesson-video, .yt { display: none !important; } }

/* ---------- Course notes (a whole subject as one printable book) ---------- */
.notes-h { margin: 28px 0 12px; font-size: 20px; color: var(--heading); }
.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.book-card { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); color: var(--fg); text-decoration: none; }
.book-card:hover, .book-card:focus-visible { border-color: var(--amber); }
.book-card > i { flex: none; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 10px; background: var(--current-bg); color: var(--amber-text); font-size: 20px; }
.book-card strong { display: block; color: var(--heading); }
.book-card .muted { font-size: 13px; }
.book { max-width: 820px; margin: 0 auto; }
.book-head { padding: 8px 0 16px; border-bottom: 3px solid var(--amber); margin-bottom: 20px; }
.book-head h1 { margin: 4px 0 8px; }
.book-tools { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 6px; }
.book-meta { font-size: 13px; }
.book-toc { padding: 16px 20px; border-radius: 14px; background: var(--current-bg); border: 1px solid var(--line); margin-bottom: 28px; }
.book-toc h2 { margin: 0 0 8px; font-size: 18px; }
.book-toc ol { margin: 0; padding-left: 22px; columns: 2 260px; column-gap: 28px; }
.book-toc li { margin: 3px 0; break-inside: avoid; }
.book-part { padding: 8px 0 24px; border-bottom: 1px dashed var(--line); margin-bottom: 20px; }
.book-num { margin: 0; font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--amber-text); }
.book-part h2 { margin-top: 6px; }
.book-quiz, .book-ex { margin: 18px 0; padding: 14px 18px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); }
.book-quiz h3, .book-ex h3 { margin: 0 0 8px; font-size: 16px; display: flex; gap: 8px; align-items: center; }
.book-quiz li { margin: 6px 0; }
.book-quiz details { display: inline; margin-left: 6px; }
.book-quiz summary { display: inline; cursor: pointer; color: var(--blue); font-size: 14px; }
.book-open { font-size: 14px; }
.book-foot { margin: 24px 0; font-size: 13px; color: var(--fg-muted); text-align: center; }
@media print {
  body { background: #fff !important; color: #000 !important; }
  .learn-top, .learn-side, header, nav:not(.book-toc), .crumbs, .book-tools, .book-open, #side, .side, .more-box, .to-top, .skip-link, footer:not(.book-foot) { display: none !important; }
  .book { max-width: none; }
  .book-part { break-inside: auto; border: 0; }
  .book-part + .book-part { break-before: page; }
  .book-toc { background: none; }
  .book-quiz details { display: inline; }
  .book-quiz details > * { display: inline !important; }
  pre, .code-sample { white-space: pre-wrap; break-inside: avoid; border: 1px solid #ccc; }
  a { color: #000; text-decoration: none; }
}

/* Subjects in the side menu, sorted into categories that open and close */
.subject-menu { padding: 0 2px 12px; border-bottom: 1px solid var(--line); }
.side-title-top { margin-top: 12px; }
.subj-group { border-radius: 10px; }
.subj-group + .subj-group { margin-top: 2px; }
.subj-group > summary { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; cursor: pointer; list-style: none; font-weight: 800; font-size: 14px; color: var(--heading); }
.subj-group > summary::-webkit-details-marker { display: none; }
.subj-group > summary .subj-caret { font-size: 11px; color: var(--fg-muted); transition: transform .2s; }
.subj-group[open] > summary .subj-caret { transform: rotate(180deg); }
.subj-group > summary:hover { background: var(--bg); }
.subj-group > summary > i { width: 18px; text-align: center; color: var(--amber-text); }
.subj-group > summary > span:first-of-type { flex: 1; }
.subj-n { margin-left: auto; min-width: 24px; padding: 1px 7px; border-radius: 999px; background: var(--bg); color: var(--fg-muted); font-size: 12px; font-weight: 700; text-align: center; }
.subj-list { list-style: none; margin: 2px 0 8px; padding: 0 0 0 10px; border-left: 2px solid var(--line); margin-left: 18px; }
.subj-list a { display: flex; align-items: center; gap: 9px; padding: 7px 10px; border-radius: 8px; color: var(--fg); text-decoration: none; font-size: 14px; line-height: 1.3; }
.subj-list a i { width: 16px; text-align: center; color: var(--fg-muted); }
.subj-list a:hover { background: var(--bg); }
.subj-list a.is-current { background: var(--navy); color: #fff; font-weight: 700; }
.subj-list a.is-current i, .subj-list a.is-current .subj-n { color: #fff; background: transparent; }
[data-theme=dark] .subj-list a.is-current { background: var(--amber); color: var(--navy); }
[data-theme=dark] .subj-list a.is-current i, [data-theme=dark] .subj-list a.is-current .subj-n { color: var(--navy); }

/* Live search */
.lsearch { position: relative; }
.lsearch-box { display: flex; align-items: center; gap: 10px; padding: 0 12px; height: 42px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.lsearch-box:focus-within { border-color: var(--heading); box-shadow: 0 0 0 3px rgba(255, 184, 0, .35); }
.lsearch-box i { color: var(--fg-muted); }
.lsearch-box input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--fg); font: inherit; font-size: 15px; outline: none; }
.lsearch-box input::-webkit-search-cancel-button { cursor: pointer; }
.lsearch-box kbd { padding: 1px 7px; border: 1px solid var(--line); border-radius: 6px; font-size: 12px; color: var(--fg-muted); background: var(--bg); }
.lsearch-big .lsearch-box { height: 54px; border-radius: 14px; border-width: 2px; }
.lsearch-big .lsearch-box input { font-size: 17px; }
.hero-learn #hub-search { margin: 20px 0 0; max-width: 620px; }
.lsearch-res { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 6px); max-height: min(70vh, 560px); overflow-y: auto; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 40px rgba(11, 27, 53, .18); padding: 6px; }
.learn-side .lsearch-res { max-height: 60vh; }
.learn-side .lsearch-list small:not(.lsearch-sub) { display: none; }
.lsearch-page .lsearch-res { position: static; max-height: none; box-shadow: none; border: 0; padding: 12px 0 0; background: transparent; }
.lsearch-h { margin: 10px 10px 4px; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--fg-muted); }
.lsearch-h span { font-weight: 600; letter-spacing: 0; text-transform: none; }
.lsearch-list { list-style: none; margin: 0; padding: 0; }
.lsearch-list a { display: flex; gap: 12px; align-items: flex-start; padding: 9px 10px; border-radius: 10px; color: var(--fg); text-decoration: none; }
.lsearch-list a:hover, .lsearch-list a:focus { background: var(--bg); outline: none; box-shadow: inset 3px 0 0 var(--amber); }
.lsearch-list a > i { margin-top: 3px; width: 18px; text-align: center; color: var(--amber-text); }
.lsearch-list strong { display: block; color: var(--heading); font-size: 15px; }
.lsearch-list small { display: block; color: var(--fg-muted); font-size: 13px; line-height: 1.45; margin-top: 2px; }
.lsearch-list small.lsearch-sub { font-weight: 700; color: var(--fg-muted); }
.lsearch-page .lsearch-list a { padding: 14px; border: 1px solid var(--line); background: var(--card); margin-bottom: 8px; }
.lsearch mark { background: rgba(255, 184, 0, .4); color: inherit; border-radius: 3px; padding: 0 1px; }
.lsearch-msg { margin: 10px; color: var(--fg-muted); }
.lsearch-all { display: block; margin: 6px 4px 2px; padding: 10px; border-radius: 10px; text-align: center; font-weight: 700; background: var(--bg); text-decoration: none; }
.search-page { max-width: 860px; margin: 0 auto; }
.search-page h1 { font-size: clamp(26px, 3.5vw, 36px); color: var(--heading); margin: 8px 0 18px; }
.search-page h1 i { color: var(--amber-text); }
@media (max-width: 760px) { .lsearch-box kbd { display: none; } }
@media print { .lsearch, .side-search, .search-btn { display: none !important; } }

/* Likes, ratings and reviews under each lesson (kept low-key, below the lesson) */
.lesson-social { margin-top: 36px; padding-top: 22px; border-top: 1px dashed var(--line); }
.ls-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.ls-q { margin: 0; font-weight: 700; color: var(--heading); }
.ls-like .ls-n { padding-left: 6px; margin-left: 2px; border-left: 1px solid var(--line); color: var(--fg-muted); }
.ls-rating { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.stars, .c-head .stars { display: inline-flex; gap: 1px; color: #e0a100; font-size: 13px; }
[data-theme=dark] .stars { color: var(--amber); }
.ls-reviews { margin-top: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.ls-reviews > summary { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 14px 16px; cursor: pointer; list-style: none; }
.ls-reviews > summary::-webkit-details-marker { display: none; }
.ls-reviews > summary .subj-caret { margin-left: auto; }
.ls-reviews[open] > summary .subj-caret { transform: rotate(180deg); }
.ls-sum { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; color: var(--heading); }
.ls-reviews > .c-form, .ls-reviews > .rv-signin, .ls-reviews > .rv-list { margin: 0 16px 16px; }
.rv-signin { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.rv-main { flex: 1; min-width: 0; }
.c-body { margin: 4px 0; overflow-wrap: anywhere; line-height: 1.55; }
.rv-tools { margin: 2px 0 0; font-size: 13px; }
.rv-replies { margin-top: 12px; padding-left: 14px; border-left: 2px solid var(--line); gap: 12px; }
.rv-replies .avatar { width: 30px; height: 30px; font-size: 13px; }
.rv-staff > .avatar { background: var(--amber); color: var(--navy); }
.tag-staff { background: var(--amber) !important; color: var(--navy) !important; }
.rv-reply { margin-top: 10px; }
.rv-reply textarea { width: 100%; box-sizing: border-box; border: 1px solid var(--field-border); background: var(--field-bg); color: var(--fg); border-radius: 10px; padding: 8px 10px; font: inherit; }
.linklike.danger { color: #c62828; }
.star-pick { border: 0; padding: 0; margin: 0 0 8px; min-width: 0; }
.star-pick legend { float: left; padding: 0; margin: 3px 10px 0 0; font-size: 14px; color: var(--fg-muted); }
.star-row { display: inline-flex; flex-direction: row-reverse; gap: 2px; }
.star-pick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.star-pick label { cursor: pointer; font-size: 20px; color: var(--line); padding: 0 1px; }
.star-row label:hover, .star-row label:hover ~ label, .star-row input:checked ~ label { color: #e0a100; }
.star-pick input:focus-visible + label { outline: 3px solid var(--amber); border-radius: 4px; }
@media print { .lesson-social { display: none !important; } }

/* Static (pre-rendered) course and lesson pages: /learn/<subject>/ and /learn/<subject>/<lesson>/ */
.static-main { max-width: 900px; margin: 0 auto; padding: 24px clamp(16px, 4vw, 32px) 64px; display: block; }
.static-learn .learn-top-in .learn-nav { margin-left: 8px; }
.static-course h1, .static-lesson h1 { font-size: clamp(28px, 4vw, 40px); line-height: 1.15; color: var(--heading); margin: 8px 0 12px; }
.static-meta { color: var(--fg-muted); font-size: 14px; margin: 18px 0; }
.static-ctas { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 26px; }
.static-lessons { padding-left: 0; list-style: none; display: grid; gap: 6px; }
.static-lessons a { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--fg); text-decoration: none; font-weight: 600; }
.static-lessons a:hover { border-color: var(--amber); }
.static-n { display: inline-grid; place-items: center; min-width: 30px; height: 30px; border-radius: 50%; background: var(--current-bg); color: var(--amber-text); font-size: 13px; font-weight: 800; }
.static-live { margin: 0 0 22px; padding: 14px 16px; border-radius: 14px; background: var(--current-bg); border: 1px solid var(--amber); }
.static-live p { margin: 0 0 10px; }
.static-live p:last-child { margin: 0; }
.static-code { margin: 16px 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--card); }
.static-code figcaption { padding: 8px 12px; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--fg-muted); border-bottom: 1px solid var(--line); }
.static-code pre { margin: 0; padding: 14px; overflow-x: auto; font-size: 14px; line-height: 1.55; }
.static-table { overflow-x: auto; margin: 16px 0; }
.static-table table { border-collapse: collapse; width: 100%; font-size: 15px; }
.static-table th, .static-table td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.static-table th { background: var(--current-bg); }
.static-quiz { margin: 26px 0; padding: 16px 18px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); }
.static-quiz ol { padding-left: 20px; }
.static-quiz li { margin-bottom: 10px; }
.static-quiz li p { margin: 0 0 4px; }
.static-quiz summary { cursor: pointer; color: var(--blue); font-size: 14px; }
.static-note, .static-videos { margin: 16px 0; padding: 12px 14px; border-left: 3px solid var(--amber); background: var(--card); border-radius: 8px; }
.static-exercise { margin: 26px 0; padding: 16px 18px; border-radius: 14px; border: 1px dashed var(--amber); }
.static-lesson .lesson-body blockquote { margin: 16px 0; padding: 10px 16px; border-left: 3px solid var(--amber); background: var(--card); border-radius: 8px; }
@media print { .static-live, .static-ctas, .pager { display: none !important; } }
.static-code pre code { background: none; padding: 0; border: 0; font-size: inherit; color: inherit; white-space: pre; }

/* ---------- folding the lesson list away on wide screens ---------- */
.side-fold { display: flex; align-items: center; gap: 8px; width: 100%; margin: 0 0 12px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--fg-muted); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.side-fold:hover { color: var(--heading); border-color: var(--field-border); }
@media (min-width: 901px) {
    body.has-side.side-folded .learn-shell { grid-template-columns: minmax(0, 1fr); }
    body.has-side.side-folded .learn-side { display: none; }
}
@media (max-width: 900px) { .side-fold { display: none; } }

/* ---------- long lessons: progress, contents and section ticks ---------- */
.read-progress { position: sticky; top: 64px; z-index: 30; height: 4px; margin: calc(-1 * clamp(16px, 3vw, 36px)) 0 clamp(12px, 2vw, 24px); background: transparent; }
.read-progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--amber), var(--green)); border-radius: 0 4px 4px 0; transition: width .1s linear; }
.lesson-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: -4px 0 18px; color: var(--fg-muted); font-size: 14px; font-weight: 600; }
.lesson-meta i { color: var(--amber-text); margin-right: 4px; }
.lesson-wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 40px; }
.lesson-toc { order: -1; margin: 0 0 18px; }
.lesson-toc details { border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.lesson-toc summary { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 10px; padding: 12px 14px; cursor: pointer; font-weight: 800; color: var(--heading); list-style: none; }
.lesson-toc summary::-webkit-details-marker { display: none; }
.toc-count { white-space: nowrap; font-size: 12px; font-weight: 700; color: var(--fg-muted); }
.lesson-toc ol { list-style: none; margin: 0; padding: 0 8px 10px; max-height: calc(100vh - 200px); overflow-y: auto; }
.lesson-toc a { display: flex; gap: 8px; align-items: flex-start; padding: 6px 8px; border-radius: 8px; color: var(--fg-muted); text-decoration: none; font-size: 14px; line-height: 1.35; }
.lesson-toc a i { color: var(--line); margin-top: 2px; font-size: 13px; }
.lesson-toc a.got i { color: var(--green); }
.lesson-toc a:hover { background: var(--bg); color: var(--heading); }
.lesson-toc a.is-current { color: var(--heading); font-weight: 700; background: var(--current-bg); box-shadow: inset 3px 0 0 var(--amber); }
@media (min-width: 1200px) {
    .lesson-wrap { grid-template-columns: minmax(0, 1fr) 250px; }
    .lesson-toc { order: 0; margin: 0; }
    .lesson-toc details { position: sticky; top: 84px; }
}
.lsec { scroll-margin-top: 84px; }
.lsec-done { margin: 18px 0 8px; }
.lsec-done .btn.is-on { border-color: var(--green); color: var(--green); }

/* ---------- callout boxes in lessons ---------- */
.callout { margin: 22px 0; border: 1px solid var(--line); border-left: 4px solid var(--blue); border-radius: 12px; background: var(--card); padding: 12px 16px; }
.callout-title { margin: 0 0 6px; font-weight: 800; color: var(--heading); display: flex; gap: 8px; align-items: baseline; }
.callout-title i { color: var(--blue); }
.callout-body > :first-child { margin-top: 0; }
.callout-body > :last-child { margin-bottom: 0; }
.callout-tip { border-left-color: var(--amber); background: var(--current-bg); }
.callout-tip .callout-title i, .callout-kenya .callout-title i { color: var(--amber-text); }
.callout-warning { border-left-color: #dc2626; }
.callout-warning .callout-title i { color: #dc2626; }
.callout-example, .callout-career { border-left-color: var(--green); }
.callout-example .callout-title i, .callout-career .callout-title i { color: var(--green); }
.callout-define { border-left-color: #7c3aed; }
.callout-define .callout-title i { color: #7c3aed; }
.callout-kenya { border-left-color: var(--amber); }
.callout-think { border-left-color: #7c3aed; padding: 0; }
.callout-think summary { display: flex; align-items: center; gap: 10px; padding: 12px 16px; cursor: pointer; list-style: none; color: var(--heading); }
.callout-think summary::-webkit-details-marker { display: none; }
.callout-think summary i { color: #7c3aed; }
.callout-think summary span { flex: 1; }
.callout-think summary em { font-style: normal; font-size: 13px; font-weight: 700; color: var(--blue); white-space: nowrap; }
.callout-think[open] summary em { visibility: hidden; }
.callout-think .callout-body { padding: 0 16px 14px 42px; }
[data-theme=dark] .callout-warning .callout-title i { color: #f87171; }
[data-theme=dark] .callout-define .callout-title i, [data-theme=dark] .callout-think summary i { color: #a78bfa; }
@media print { .read-progress, .lesson-toc, .lsec-done, .side-fold { display: none !important; } .callout-think .callout-body { display: block; } }

.lesson-toc .toc-sub { list-style: none; margin: 0 0 4px 22px; padding: 0; max-height: none; overflow: visible; border-left: 1px solid var(--line); }
.lesson-toc .toc-sub a { padding: 3px 8px; font-size: 13px; }
.lsec-sub { scroll-margin-top: 84px; }
.lesson-body hr { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }
