/* Reflect Video Tutorials: shared styles for the library and the video pages. */
:root {
  --bg: #f5f6fa;
  --surface: #ffffff;
  --surface-2: #eef1f6;
  --border: #dfe4ec;
  --text: #121826;
  --muted: #5a6476;
  --faint: #8a93a4;
  --accent: #b45309;
  --accent-strong: #d97706;
  --accent-soft: #fdf1dc;
  --on-accent: #ffffff;
  --navy: #0d1424;
  --mark: #fde68a;
  --mark-text: #3b2a05;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 6px 22px rgba(16, 24, 40, .07);
  --shadow-lift: 0 2px 4px rgba(16, 24, 40, .06), 0 16px 40px rgba(16, 24, 40, .14);
  --lvl-beginner: #047857; --lvl-beginner-bg: #dcfce7;
  --lvl-intermediate: #1d4ed8; --lvl-intermediate-bg: #dbeafe;
  --lvl-advanced: #7e22ce; --lvl-advanced-bg: #f3e8ff;
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0f1c; --surface: #111a2c; --surface-2: #17223a; --border: #24314d; --text: #e7ebf3; --muted: #a0aac0; --faint: #74809a;
    --accent: #f5a524; --accent-strong: #f59e0b; --accent-soft: rgba(245, 158, 11, .13); --on-accent: #1a1204;
    --mark: rgba(245, 158, 11, .38); --mark-text: #fff7e6;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 26px rgba(0, 0, 0, .28); --shadow-lift: 0 2px 6px rgba(0, 0, 0, .35), 0 18px 44px rgba(0, 0, 0, .45);
    --lvl-beginner: #6ee7b7; --lvl-beginner-bg: rgba(16, 185, 129, .14);
    --lvl-intermediate: #93c5fd; --lvl-intermediate-bg: rgba(59, 130, 246, .16);
    --lvl-advanced: #d8b4fe; --lvl-advanced-bg: rgba(168, 85, 247, .16);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a0f1c; --surface: #111a2c; --surface-2: #17223a; --border: #24314d; --text: #e7ebf3; --muted: #a0aac0; --faint: #74809a;
  --accent: #f5a524; --accent-strong: #f59e0b; --accent-soft: rgba(245, 158, 11, .13); --on-accent: #1a1204;
  --mark: rgba(245, 158, 11, .38); --mark-text: #fff7e6;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 26px rgba(0, 0, 0, .28); --shadow-lift: 0 2px 6px rgba(0, 0, 0, .35), 0 18px 44px rgba(0, 0, 0, .45);
  --lvl-beginner: #6ee7b7; --lvl-beginner-bg: rgba(16, 185, 129, .14);
  --lvl-intermediate: #93c5fd; --lvl-intermediate-bg: rgba(59, 130, 246, .16);
  --lvl-advanced: #d8b4fe; --lvl-advanced-bg: rgba(168, 85, 247, .16);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 76px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.6 "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
body.no-scroll { overflow: hidden; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0; letter-spacing: -.01em; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
kbd {
  display: inline-block; min-width: 1.6em; padding: 1px 6px; border: 1px solid var(--border); border-bottom-width: 2px;
  border-radius: 6px; background: var(--surface); font: 12px/1.5 ui-monospace, "Cascadia Mono", Consolas, monospace; text-align: center; color: var(--muted);
}
mark { background: var(--mark); color: var(--mark-text); border-radius: 3px; padding: 0 2px; }
code { font: 13px ui-monospace, "Cascadia Mono", Consolas, monospace; }
:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 2px; }
svg { flex: none; }
.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.spacer { flex: 1; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--border);
}
.topbar-in { display: flex; align-items: center; gap: 14px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-size: 17px; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand b { color: var(--accent); font-weight: 700; }
.back-link { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-weight: 600; padding: 6px 10px 6px 6px; border-radius: 8px; }
.back-link:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--muted); cursor: pointer;
}
.icon-btn:hover { color: var(--text); border-color: var(--faint); }
.mini-search {
  display: flex; align-items: center; gap: 8px; width: 260px; height: 36px; padding: 0 12px; border: 1px solid var(--border);
  border-radius: 10px; background: var(--surface); color: var(--faint);
}
.mini-search:focus-within { border-color: var(--accent-strong); }
.mini-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--text); font: inherit; font-size: 14px; }

/* ---------- library hero & search ---------- */
.hero { padding: 54px 0 26px; background:
  radial-gradient(900px 300px at 85% -60px, var(--accent-soft), transparent 70%),
  radial-gradient(700px 260px at 0% 0%, color-mix(in srgb, var(--lvl-intermediate-bg) 80%, transparent), transparent 70%); }
.kicker { margin: 0 0 8px; color: var(--accent); font-weight: 700; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
.hero h1 { font-size: clamp(28px, 4vw, 42px); font-weight: 750; max-width: 760px; }
.hero .lead { max-width: 720px; margin: 12px 0 26px; color: var(--muted); font-size: 17px; }
.search {
  position: relative; display: flex; align-items: center; gap: 12px; max-width: 760px; height: 58px; padding: 0 14px 0 18px;
  background: var(--surface); border: 1.5px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); color: var(--faint); cursor: text;
}
.search:focus-within { border-color: var(--accent-strong); box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow); }
.search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; color: var(--text); font: inherit; font-size: 17px; }
.search input::-webkit-search-cancel-button { display: none; }
.search .clear { display: none; width: 30px; height: 30px; border: 0; }
.search.has-text .clear { display: inline-grid; }
.search.has-text kbd { display: none; }
.search.small { height: 38px; max-width: 280px; flex: 1 1 200px; padding: 0 10px 0 12px; border-radius: 10px; box-shadow: none; gap: 8px; }
.search.small input { font-size: 14px; }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 18px; }
.filters .sep { width: 1px; height: 22px; background: var(--border); margin: 0 4px; }
.stats { margin: 16px 0 0; color: var(--faint); font-size: 13.5px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; padding: 6px 13px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--muted); font-size: 13.5px; font-weight: 600; cursor: pointer; line-height: 1.3;
}
.chip:hover { border-color: var(--accent-strong); color: var(--text); text-decoration: none; }
.chip.on { background: var(--navy); border-color: var(--navy); color: #fff; }
:root[data-theme="dark"] .chip.on { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--on-accent); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chip.on { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--on-accent); } }
.chips.small .chip { padding: 3px 10px; font-size: 12.5px; font-weight: 500; background: var(--surface-2); border-color: transparent; }
.chips.small .chip:hover { border-color: var(--accent-strong); }

/* ---------- library results ---------- */
.group { margin: 34px 0 10px; }
.group-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 16px; }
.group-head h2 { font-size: 21px; }
.group-head span { color: var(--faint); font-size: 14px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 22px; }

.card {
  position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .18s ease, box-shadow .18s ease, border-color .18s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); border-color: color-mix(in srgb, var(--accent-strong) 45%, var(--border)); }
.thumb { position: relative; aspect-ratio: 1912 / 987; background: var(--navy); overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top left; transition: transform .35s ease; }
.card:hover .thumb img { transform: scale(1.03); }
.dur {
  position: absolute; right: 10px; bottom: 10px; padding: 2px 8px; border-radius: 6px; background: rgba(8, 12, 22, .82);
  color: #fff; font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.play-ov {
  position: absolute; inset: 0; margin: auto; width: 62px; height: 62px; display: grid; place-items: center; border-radius: 50%;
  background: rgba(245, 158, 11, .95); color: #1a1204; box-shadow: 0 8px 24px rgba(0, 0, 0, .35); opacity: 0; transform: scale(.85); transition: .2s;
}
.play-ov svg { width: 26px; height: 26px; margin-left: 3px; }
.card:hover .play-ov { opacity: 1; transform: scale(1); }
.bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255, 255, 255, .25); }
.bar i { display: block; height: 100%; background: var(--accent-strong); }
.card-body { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px 18px; flex: 1; }
.eyebrow { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; color: var(--faint); font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.eyebrow .dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; }
.lvl { padding: 1px 8px; border-radius: 999px; font-size: 11.5px; letter-spacing: .03em; }
.lvl-beginner { color: var(--lvl-beginner); background: var(--lvl-beginner-bg); }
.lvl-intermediate { color: var(--lvl-intermediate); background: var(--lvl-intermediate-bg); }
.lvl-advanced { color: var(--lvl-advanced); background: var(--lvl-advanced-bg); }
.card h3 { font-size: 19px; font-weight: 700; }
.card h3 a { color: var(--text); }
.card h3 a:hover { text-decoration: none; }
.stretch::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.summary { margin: 0; color: var(--muted); }
.learn-head { margin-top: 2px; font-size: 12.5px; font-weight: 700; color: var(--text); text-transform: uppercase; letter-spacing: .05em; }
.learn { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.learn li { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; }
.learn li svg { margin-top: 3px; color: var(--lvl-beginner); width: 16px; height: 16px; }
.more { color: var(--faint); font-size: 13px; margin-top: -4px; }
.card .chips { position: relative; z-index: 2; margin-top: 2px; }
.card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; }
.card-meta span { display: inline-flex; align-items: center; gap: 6px; }
.card-meta svg { width: 15px; height: 15px; color: var(--faint); }
.card-meta .hits { color: var(--accent); font-weight: 600; }
.card-meta .hits svg { color: var(--accent); }
.status { margin-left: auto; padding: 2px 10px; border-radius: 999px; font-weight: 600; font-size: 12px; }
.status.new { background: var(--accent-soft); color: var(--accent); }
.status.part { background: var(--lvl-intermediate-bg); color: var(--lvl-intermediate); }
.status.done { background: var(--lvl-beginner-bg); color: var(--lvl-beginner); }

.moments { display: grid; gap: 10px; }
.moment {
  display: grid; grid-template-columns: 200px 1fr auto; gap: 18px; align-items: center; padding: 10px 18px 10px 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; color: var(--text); transition: border-color .15s, box-shadow .15s;
}
.moment:hover { text-decoration: none; border-color: var(--accent-strong); box-shadow: var(--shadow); }
.m-thumb { position: relative; aspect-ratio: 1912 / 987; border-radius: 8px; overflow: hidden; background: var(--navy); }
.m-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top left; }
.m-thumb .dur { right: 6px; bottom: 6px; }
.m-body { display: grid; gap: 3px; min-width: 0; }
.m-video { color: var(--faint); font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.m-title { font-weight: 650; font-size: 15.5px; }
.m-text { color: var(--muted); font-size: 14px; }
.m-go { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 650; font-size: 13.5px; }

.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty > svg { width: 40px; height: 40px; color: var(--faint); margin-bottom: 8px; }
.empty h2 { color: var(--text); font-size: 20px; margin-bottom: 6px; }
.empty .chips { justify-content: center; margin-top: 14px; }
.empty.small { padding: 40px 10px; }
.foot { padding: 40px 24px 50px; color: var(--faint); font-size: 13px; }

/* ---------- video page ---------- */
.video-page main { padding-top: 22px; }
.stage { position: relative; aspect-ratio: 1912 / 1080; border-radius: var(--radius); background: #000; box-shadow: var(--shadow-lift); }
.dock { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; background: #000; }
.dock video { width: 100%; height: 100%; display: block; background: #000; }
.undock { display: none; }
.stage.docked .dock {
  position: fixed; inset: auto 20px 20px auto; width: min(440px, 46vw); aspect-ratio: 1912 / 1080; height: auto; z-index: 40;
  border-radius: 12px; box-shadow: 0 18px 50px rgba(0, 0, 0, .45); outline: 1px solid rgba(255, 255, 255, .1); animation: pop .2s ease;
}
.stage.docked .undock {
  display: grid; place-items: center; position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; border: 0; border-radius: 8px;
  background: rgba(8, 12, 22, .75); color: #fff; cursor: pointer; z-index: 2;
}
@keyframes pop { from { transform: translateY(12px); opacity: 0; } }
video::cue { font-size: 26px; line-height: 1.35; background: rgba(8, 12, 22, .82); color: #fff; }

.player-bar { margin-top: 12px; }
.strip { display: flex; gap: 3px; height: 10px; }
.seg { position: relative; min-width: 4px; padding: 0; border: 0; border-radius: 3px; background: var(--border); cursor: pointer; overflow: hidden; }
.seg i { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--accent-strong); }
.seg:hover { background: var(--faint); }
.seg.on { box-shadow: 0 0 0 2px var(--accent-soft); }
.pb-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; margin-top: 10px; }
.now { display: flex; flex-direction: column; min-width: 0; margin-left: 6px; }
.now-n { font-size: 12px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .05em; }
.now-t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 640px; }
.seg-ctl { display: inline-flex; padding: 3px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.seg-ctl button { padding: 4px 9px; border: 0; border-radius: 7px; background: none; color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer; font-variant-numeric: tabular-nums; }
.seg-ctl button[aria-pressed="true"] { background: var(--navy); color: #fff; }
.toggle {
  display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--muted); font-size: 13.5px; font-weight: 600; cursor: pointer;
}
.toggle[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent-strong); color: var(--accent); }
.btn {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px; border: 0; border-radius: 9px;
  background: var(--accent-strong); color: #1a1204; font-weight: 650; font-size: 14px; cursor: pointer;
}
.btn:hover { filter: brightness(1.06); }
.btn svg { width: 15px; height: 15px; }
.link-btn { display: inline-flex; align-items: center; gap: 6px; padding: 4px 0; border: 0; background: none; color: var(--accent); font-weight: 600; font-size: 14px; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.link-btn svg { width: 14px; height: 14px; }
.resume {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; margin-top: 12px; padding: 10px 14px; border-radius: 12px;
  background: var(--accent-soft); color: var(--text); font-size: 14.5px;
}

.intro { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 32px; margin-top: 30px; }
.intro h1 { font-size: clamp(26px, 3.2vw, 36px); font-weight: 750; margin: 10px 0 10px; }
.intro .lead { margin: 0 0 14px; color: var(--muted); font-size: 17px; max-width: 760px; }
.facts { display: flex; flex-wrap: wrap; gap: 8px 20px; color: var(--muted); font-size: 14px; }
.facts span { display: inline-flex; align-items: center; gap: 7px; }
.facts svg { width: 16px; height: 16px; color: var(--faint); }
.learn-box { margin-top: 22px; padding: 20px 22px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.learn-box h2 { font-size: 17px; margin-bottom: 12px; }
.learn.cols { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 26px; }
.learn.cols li { font-size: 14.5px; }
.example { margin: 14px 0 0; padding: 12px 16px; border-left: 3px solid var(--accent-strong); background: var(--surface); border-radius: 0 10px 10px 0; color: var(--muted); font-size: 14px; }
.example b { display: block; color: var(--text); font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 2px; }
.intro-side { display: grid; gap: 14px; align-content: start; }
.side-box { padding: 16px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.side-box h3 { display: flex; align-items: center; gap: 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 12px; }
.side-box h3 svg { width: 16px; height: 16px; }
.dl { display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin: 0 -10px; border-radius: 8px; color: var(--text); font-weight: 550; font-size: 14.5px; }
.dl:hover { background: var(--surface-2); text-decoration: none; }
.dl svg { width: 16px; height: 16px; color: var(--accent); }
.keys dl { display: grid; grid-template-columns: auto 1fr; gap: 7px 12px; margin: 0; font-size: 13.5px; align-items: center; }
.keys dt { white-space: nowrap; }
.keys dd { margin: 0; color: var(--muted); }

.lesson { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 32px; margin-top: 44px; align-items: start; }
.toc { position: sticky; top: 80px; max-height: calc(100vh - 100px); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.toc-head { padding: 14px 16px 10px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); border-bottom: 1px solid var(--border); }
.toc ol { position: relative; list-style: none; margin: 0; padding: 6px; overflow-y: auto; }
.toc a { display: grid; grid-template-columns: 42px 1fr; gap: 6px; padding: 7px 8px; border-radius: 8px; color: var(--muted); font-size: 13.5px; line-height: 1.4; }
.toc a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.toc a.on { background: var(--accent-soft); color: var(--text); font-weight: 600; }
.toc .toc-ts { color: var(--faint); font-variant-numeric: tabular-nums; font-size: 12.5px; padding-top: 1px; }
.toc a.on .toc-ts { color: var(--accent); }

.tr-head {
  position: sticky; top: 60px; z-index: 5; display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; padding: 14px 0 12px;
  background: var(--bg); border-bottom: 1px solid var(--border);
}
.tr-head h2 { font-size: 21px; margin-right: auto; }
.tcount { color: var(--accent); font-size: 13.5px; font-weight: 600; }
.switch { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13.5px; font-weight: 600; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch span { position: relative; width: 34px; height: 20px; border-radius: 999px; background: var(--border); transition: background .15s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .3); transition: transform .15s; }
.switch input:checked + span { background: var(--accent-strong); }
.switch input:checked + span::after { transform: translateX(14px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent-strong); outline-offset: 2px; }

.chapter { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 18px; padding: 26px 0; border-bottom: 1px solid var(--border); scroll-margin-top: 140px; }
.ch-side { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.ts {
  padding: 4px 9px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--accent);
  font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; cursor: pointer;
}
.ts:hover { border-color: var(--accent-strong); }
.ch-n { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--surface-2); color: var(--faint); font-size: 12px; font-weight: 700; }
.chapter.on .ch-n { background: var(--accent-strong); color: #1a1204; }
.chapter.on .ts { background: var(--accent-soft); border-color: var(--accent-strong); }
.ch-main { min-width: 0; }
.ch-main h3 { font-size: 17.5px; font-weight: 700; }
.say { margin: 8px 0 14px; color: var(--muted); font-size: 16px; line-height: 1.7; max-width: 820px; }
.chapter.on .say { color: var(--text); }
.shot { margin: 0 0 10px; }
.shot-btn { position: relative; display: block; width: 100%; padding: 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--navy); cursor: zoom-in; box-shadow: var(--shadow); }
.shot-btn img { width: 100%; height: auto; }
.zoom {
  position: absolute; right: 12px; top: 12px; display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 8px;
  background: rgba(8, 12, 22, .78); color: #fff; font-size: 13px; font-weight: 600; opacity: 0; transition: opacity .15s;
}
.zoom svg { width: 14px; height: 14px; }
.shot-btn:hover .zoom, .shot-btn:focus-visible .zoom { opacity: 1; }
.title-card {
  display: flex; align-items: center; justify-content: center; text-align: center; min-height: 120px; margin: 0 0 10px; padding: 26px;
  border-radius: 12px; background: linear-gradient(135deg, #0d1424, #18233d); color: #dfe5f0; font-size: 16.5px; font-weight: 500;
  border-bottom: 3px solid var(--accent-strong);
}

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 46px 0 60px; }
.pager-card { display: flex; align-items: center; gap: 16px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.pager-card:hover { text-decoration: none; border-color: var(--accent-strong); }
.pager > :last-child.pager-card { flex-direction: row-reverse; text-align: right; }
.pager-card img { width: 150px; aspect-ratio: 1912 / 987; object-fit: cover; object-position: top left; border-radius: 8px; }
.pager-card span { display: grid; gap: 2px; }
.pager-card small { color: var(--accent); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.pager-card b { font-size: 16px; }
.pager-card em { font-style: normal; color: var(--faint); font-size: 13px; }

/* ---------- lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; background: rgba(4, 7, 14, .94); color: #e7ebf3; }
.lightbox[hidden] { display: none; }
.lb-top { display: flex; align-items: center; gap: 12px; padding: 12px 16px; }
.lb-n { color: #a0aac0; font-size: 14px; }
.lightbox .icon-btn { background: rgba(255, 255, 255, .08); border-color: transparent; color: #fff; }
.lb-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 0 10px; }
.lb-stage img { max-width: calc(100% - 120px); max-height: 100%; object-fit: contain; border-radius: 6px; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); background: #fff; }
.lb-nav { flex: none; width: 46px; height: 46px; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .1); color: #fff; cursor: pointer; }
.lb-nav:hover { background: rgba(255, 255, 255, .2); }
.lb-cap { display: grid; gap: 4px; max-width: 980px; width: 100%; margin: 0 auto; padding: 14px 20px 20px; font-size: 15px; }
.lb-cap b { font-size: 16.5px; }
.lb-cap span { color: #b8c1d4; }

/* ---------- smaller screens ---------- */
@media (max-width: 1100px) {
  .lesson { grid-template-columns: 1fr; }
  .toc { display: none; }
  .intro { grid-template-columns: 1fr; }
  .intro-side { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
}
@media (max-width: 760px) {
  .wrap { padding: 0 16px; }
  .mini-search, .back-link { display: none; }
  .hero { padding-top: 34px; }
  .grid { grid-template-columns: 1fr; }
  .learn.cols { grid-template-columns: 1fr; }
  .moment { grid-template-columns: 110px 1fr; gap: 12px; }
  .m-go { display: none; }
  .now-t { max-width: 60vw; }
  .chapter { grid-template-columns: 1fr; gap: 8px; }
  .ch-side { flex-direction: row; }
  .tr-head { top: 60px; }
  .tr-head h2 { width: 100%; }
  .pager { grid-template-columns: 1fr; }
  .pager-card img { width: 110px; }
  .stage.docked .dock { width: 58vw; right: 12px; bottom: 12px; }
  .lb-stage img { max-width: 100%; }
  .lb-nav { display: none; }
  video::cue { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
