/* Narrated lesson videos — the /videos pages plus the inline card on a /know topic.
 *
 * Page-scoped plain CSS (linked by the pages that need it), like 20-simulate.css and
 * 20-slides.css: no Tailwind class is invented here, so nothing needs a Tailwind
 * rebuild, and none of it can leak onto a page that doesn't link it.
 *
 * The accent is violet — the /videos hub's own hue, distinct from the cyan of Know,
 * the emerald of Learn and the sky of the Animation button, so a video control is
 * recognisable wherever it appears. The subject catalogue gives each video
 * its syllabus topic's own glyph and hue on a dark poster card.
 */

:root {
  --video-accent: 167, 139, 250;      /* violet-400 */
  --video-surface: rgba(255, 255, 255, 0.03);
  --video-border: rgba(255, 255, 255, 0.08);
}

/* ── The launch button (sits beside Simulate / Animation / View Slides) ───── */
/* Sits in a row with Simulate (amber), Animation (sky), View Slides (indigo) and
 * Handout (cyan). Sizing comes from the same utility classes they all carry, so this
 * only sets the colour — violet, distinct from the other four — and matches their
 * hover/focus treatment exactly: lighten the text on hover, and a ring via box-shadow
 * rather than an outline, so the four buttons behave identically under the keyboard. */
.video-launch {
  border-color: rgba(var(--video-accent), 0.35);
  background: rgba(var(--video-accent), 0.12);
  color: rgb(196, 181, 253);            /* violet-300 */
  text-decoration: none;
}
.video-launch:hover { background: rgba(var(--video-accent), 0.20); color: rgb(221, 214, 254); }
.video-launch-short { display: none; }
.video-launch:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(var(--video-accent), 0.55);
}

/* ── Lead card (one per /know topic page) ─────────────────────────────────────
 * A thumbnail beside its title, ~150px tall — NOT a player. The full-width 16:9
 * <video> this replaced pushed the topic's notes below the fold at every width, and
 * the notes are what the page is for. Pressing play swaps `.video-card-body` for a
 * real <video> (video-card.js), which then fills the card.
 */
.video-card {
  margin: 0 0 1.25rem;
  border: 1px solid var(--video-border);
  border-radius: 1rem;
  background: var(--video-surface);
  overflow: hidden;
}
.video-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.875rem 0;
}
.video-card-eyebrow {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgb(196, 181, 253);
}
.video-card-open {
  font-size: 0.75rem;
  color: rgb(148, 163, 184);            /* slate-400 */
  text-decoration: none;
  white-space: nowrap;
}
.video-card-open:hover { color: rgb(226, 232, 240); }
.video-card-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.25rem 0.9rem; }
a.video-card-open[href^="/vocab/"] { color: rgb(196, 181, 253); font-weight: 600; }
.video-practise { margin: 0.35rem 0 0; font-size: 0.875rem; }
.video-practise a { color: rgb(196, 181, 253); font-weight: 600; text-decoration: none; }
.video-practise a:hover { text-decoration: underline; }
.video-series-h { margin: 0.25rem 0 0.6rem; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: rgb(148, 163, 184); }
.video-series { margin-bottom: 1.5rem; }

.video-card-body {
  display: flex;
  gap: 0.875rem;
  padding: 0.7rem 0.875rem 0.875rem;
}
.video-card-thumb {
  position: relative;
  flex: 0 0 auto;
  width: 40%;
  max-width: 15rem;
  aspect-ratio: 16 / 9;
  border-radius: 0.6rem;
  overflow: hidden;
  background: #0b1020;                  /* the render's own matte */
  display: block;
}
.video-card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.video-card-playmark {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  opacity: 0.9;
  transition: transform 0.15s ease;
}
.video-card-playmark svg { width: 2rem; height: 2rem; filter: drop-shadow(0 1px 6px rgba(0,0,0,.6)); }
.video-card-thumb:hover .video-card-playmark { transform: scale(1.08); }
.video-card-len {
  position: absolute;
  right: 0.3rem;
  bottom: 0.3rem;
  padding: 0.05rem 0.3rem;
  border-radius: 0.25rem;
  background: rgba(2, 6, 23, 0.78);
  font-size: 0.72rem;  /* 11.5px: 10.4px was below legible on phones */
  font-variant-numeric: tabular-nums;
  color: rgb(226, 232, 240);
}
.video-card-text {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;                          /* long titles truncate instead of pushing */
  justify-content: center;
}
.video-card-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: rgb(241, 245, 249);
}
.video-card-desc {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.45;
  color: rgb(148, 163, 184);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.video-card-actions {
  margin: 0.15rem 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.video-card-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.6rem;
  border: 1px solid rgba(var(--video-accent), 0.3);
  border-radius: 0.375rem;
  background: rgba(var(--video-accent), 0.12);
  color: rgb(196, 181, 253);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
}
.video-card-btn:hover { background: rgba(var(--video-accent), 0.22); }
.video-card-btn:focus-visible {
  outline: 2px solid rgba(var(--video-accent), 0.6);
  outline-offset: 2px;
}
.video-card-note { font-size: 0.7rem; color: rgb(148, 163, 184); }   /* slate-500 read 2.7:1 on the card */

/* Once playing, the <video> replaces the body and fills the card. */
.video-card-player,
.video-player {
  display: block;
  width: 100%;
  max-height: 78vh;
  aspect-ratio: 16 / 9;
  background: #0b1020;                  /* no black-bar flash before the first frame */
}
.video-player {
  border: 1px solid var(--video-border);
  border-radius: 0.875rem;
  overflow: hidden;
}

/* The watch page's player + its end card share a positioning context. */
.video-stage { position: relative; }
/* Buffering (video-watch.js): a spinner over the picture so a slow start never looks dead. */
.video-stage.is-buffering::after {
  content: ""; position: absolute; z-index: 3; left: 50%; top: 45%; width: 52px; height: 52px;
  margin: -26px 0 0 -26px; border-radius: 50%; pointer-events: none;
  border: 4px solid rgba(255, 255, 255, .25); border-top-color: #fff;
  background: rgba(2, 6, 23, .35); animation: video-buffer-spin .8s linear infinite;
}
@keyframes video-buffer-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .video-stage.is-buffering::after { animation-duration: 2.4s; } }

/* ── Proportional chapter strip ───────────────────────────────────────────────
 * One segment per chapter, `flex-grow` set to its length in the template — so the
 * strip IS the shape of the lesson (a long worked example reads as a long block).
 * The native scrubber keeps fine seeking; this is the map above it.
 */
.video-strip {
  display: flex;
  gap: 2px;
  margin-top: 0.4rem;
  height: 0.45rem;
}
.video-strip-seg {
  flex: 1 1 0;
  min-width: 2px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.15s ease;
}
.video-strip-seg:hover { background: rgba(var(--video-accent), 0.55); transform: scaleY(1.5); }
.video-strip-seg:focus-visible {
  outline: 2px solid rgba(var(--video-accent), 0.6);
  outline-offset: 2px;
}
.video-strip-seg[aria-current="true"] { background: rgb(var(--video-accent)); }
/* Everything before the current chapter reads as "watched". */
.video-strip-seg[data-played="1"] { background: rgba(var(--video-accent), 0.45); }

/* ── End card (up next) ──────────────────────────────────────────────────────── */
.video-endcard {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 1rem;
  border-radius: 0.875rem;
  background: rgba(2, 6, 23, 0.9);
  backdrop-filter: blur(3px);
  text-align: center;
}
.video-endcard[hidden] { display: none; }
.video-endcard-label {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgb(196, 181, 253);
}
.video-endcard-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: #fff;
}
.video-endcard-meta { margin: 0; font-size: 0.78rem; color: rgb(148, 163, 184); }
.video-endcard-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.video-endcard-go {
  padding: 0.4rem 0.9rem;
  border-radius: 0.4rem;
  background: rgba(var(--video-accent), 0.9);
  color: #0b1020;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
}
.video-endcard-go:hover { background: rgb(var(--video-accent)); }
.video-endcard-btn {
  padding: 0.4rem 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 0.4rem;
  background: transparent;
  color: rgb(226, 232, 240);
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}
.video-endcard-btn:hover { background: rgba(255, 255, 255, 0.08); }

/* ── Toolbar under the player (speed readout + share) ────────────────────────── */
.video-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.6rem;
}
.video-tool {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--video-border);
  border-radius: 0.375rem;
  background: rgba(255, 255, 255, 0.02);
  color: rgb(148, 163, 184);
  font: inherit;
  font-size: 0.75rem;
  cursor: pointer;
}
.video-tool:hover { color: rgb(226, 232, 240); border-color: rgba(255, 255, 255, 0.18); }
.video-tool:focus-visible {
  outline: 2px solid rgba(var(--video-accent), 0.6);
  outline-offset: 2px;
}
.video-tool[data-rate]:not([data-rate="1"]) { color: rgb(196, 181, 253); }
.video-keys { font-size: 0.7rem; color: rgb(100, 116, 139); }   /* slate-600 read 2.7:1 */
@media (max-width: 560px) { .video-keys { display: none; } }

@media (max-width: 560px) {
  /* Phones: the thumbnail goes full width above the text — a 40% thumb next to two
     lines of clamped prose is unreadable at 375px. */
  .video-card-body { flex-direction: column; gap: 0.6rem; }
  .video-card-thumb { width: 100%; max-width: none; }
  .video-card-desc { -webkit-line-clamp: 3; }
}

/* ── List rows (/videos/<subject>, "more videos") ─────────────────────────── */
.video-list { display: flex; flex-direction: column; gap: 0.5rem; }
.video-row {
  display: flex;
  gap: 0.875rem;
  align-items: stretch;
  padding: 0.6rem;
  border: 1px solid var(--video-border);
  border-radius: 0.875rem;
  background: var(--video-surface);
  text-decoration: none;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.video-row:hover {
  border-color: rgba(var(--accent-rgb, var(--video-accent)), 0.45);
  background: rgba(var(--accent-rgb, var(--video-accent)), 0.07);
}
.video-row--featured {
  border-color: rgba(var(--accent-rgb), 0.3);
  background: linear-gradient(105deg, rgba(var(--accent-rgb), 0.14), transparent 72%), #0b1222;
  box-shadow: inset 3px 0 rgba(var(--accent-rgb), 0.7);
}
.video-row--featured:hover { background: linear-gradient(105deg, rgba(var(--accent-rgb), 0.22), transparent 72%), #0b1222; }
.video-row--featured .video-row-meta { display: flex; align-items: center; gap: 0.55rem; }
.video-row--featured .video-row-icon {
  display: inline-grid; flex: none; width: 2.3rem; height: 2.3rem; place-items: center;
  border: 1px solid rgba(var(--accent-rgb), 0.48); border-radius: 0.7rem;
  background: rgba(var(--accent-rgb), 0.18); color: rgb(var(--accent-rgb));
}
.video-row--featured .video-row-icon svg { width: 1.3rem; height: 1.3rem; }
.video-row--featured .video-row-eyebrow { color: rgb(var(--accent-rgb)); }
html[data-theme="light"] .video-row--featured { background: linear-gradient(105deg, rgba(var(--accent-rgb), 0.15), transparent 75%), #fff; }
.video-row:focus-visible {
  outline: 2px solid rgba(var(--video-accent), 0.6);
  outline-offset: 2px;
}
.video-row-thumb {
  position: relative;
  flex: 0 0 auto;
  width: 9.5rem;
  aspect-ratio: 16 / 9;
  border-radius: 0.6rem;
  overflow: hidden;
  background: #0b1020;
}
.video-row-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.video-row-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  opacity: 0.86;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
}
.video-row-len {
  position: absolute;
  right: 0.3rem;
  bottom: 0.3rem;
  padding: 0.05rem 0.3rem;
  border-radius: 0.25rem;
  background: rgba(2, 6, 23, 0.78);
  font-size: 0.72rem;  /* 11.5px: 10.4px was below legible on phones */
  font-variant-numeric: tabular-nums;
  color: rgb(226, 232, 240);
}
.video-row-tick {
  position: absolute;
  left: 0.3rem;
  bottom: 0.3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 999px;
  background: rgba(var(--video-accent), 0.95);
  color: #0b1020;
}
.video-row-tick svg { width: 0.7rem; height: 0.7rem; }
/* Partial progress: a bar along the thumbnail's bottom edge, the convention every
   video UI uses — no label, so it costs no row height. */
.video-row-progress {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.18);
}
.video-row-progress > span {
  display: block;
  height: 100%;
  background: rgb(var(--video-accent));
}
.video-row-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.15rem;
  min-width: 0;                          /* long titles must truncate, not push the row */
}
.video-row-eyebrow {
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgb(100, 116, 139);
}
.video-row-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: rgb(241, 245, 249);
}
.video-row-desc {
  font-size: 0.78rem;
  line-height: 1.4;
  color: rgb(148, 163, 184);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.video-row-meta { display: contents; }

/* Compact subject tiles keep several lessons in view. The dark matte gives every
 * hue a consistent base, while the radial wash and border show the topic colour.
 * The /videos hub and watch-page rows keep their original layout. */
.video-subject-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}
.video-subject-list .video-row {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0.6rem;
  overflow: hidden;
  border-color: rgba(var(--accent-rgb), 0.3);
  border-radius: 0.95rem;
  background: radial-gradient(ellipse at 8% 0%, rgba(var(--accent-rgb), 0.17), transparent 68%),
              linear-gradient(150deg, #10192c, #080c19 78%);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.055), 0 12px 28px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.video-subject-list .video-row:hover {
  transform: translateY(-3px);
  border-color: rgba(var(--accent-rgb), 0.72);
  background: radial-gradient(ellipse at 8% 0%, rgba(var(--accent-rgb), 0.22), transparent 68%),
              linear-gradient(150deg, #10192c, #080c19 78%);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.07),
              0 18px 36px rgba(0, 0, 0, 0.32), 0 0 24px rgba(var(--accent-rgb), 0.1);
}
.video-subject-list .video-row:focus-visible {
  outline-color: rgb(var(--accent-rgb));
  outline-offset: 3px;
}
.video-subject-list .video-row-thumb {
  flex: 0 0 10rem;
  width: 10rem;
  aspect-ratio: 16 / 9;
  align-self: center;
  border-radius: 0.6rem;
}
.video-subject-list .video-row-thumb::after {
  content: "";
  position: absolute;
  inset: 45% 0 0;
  background: linear-gradient(transparent, rgba(5, 8, 18, 0.75));
  pointer-events: none;
}
.video-subject-list .video-row-play,
.video-subject-list .video-row-len,
.video-subject-list .video-row-tick,
.video-subject-list .video-row-progress { z-index: 1; }
.video-subject-list .video-row-play svg {
  width: 2rem;
  height: 2rem;
  padding: 0.45rem;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 999px;
  background: rgba(7, 12, 25, 0.58);
  backdrop-filter: blur(8px);
  box-shadow: 0 5px 24px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s ease, background-color 0.2s ease;
}
.video-subject-list .video-row:hover .video-row-play svg {
  transform: scale(1.1);
  background: rgba(var(--accent-rgb), 0.28);
}
.video-subject-list .video-row-len {
  right: 0.35rem;
  bottom: 0.35rem;
  padding: 0.08rem 0.3rem;
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 0.45rem;
  background: rgba(5, 8, 18, 0.82);
  font-size: 0.72rem;
}
.video-subject-list .video-row-body {
  flex: 1;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.1rem 0.3rem 0.1rem 0.8rem;
}
.video-subject-list .video-row-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
}
/* A row with neither icon nor eyebrow (the /learn subject page's vocabulary series) had an
   empty 2.75rem band above its title. */
.video-subject-list .video-row-meta:not(:has(> *)) { display: none; }
.video-subject-list .video-row-icon {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid rgba(var(--accent-rgb), 0.48);
  border-radius: 0.75rem;
  background: rgba(var(--accent-rgb), 0.14);
  color: rgb(var(--accent-rgb));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.07), 0 0 20px rgba(var(--accent-rgb), 0.12);
}
.video-subject-list .video-row-icon svg { width: 1.6rem; height: 1.6rem; }
.video-subject-list .video-row-eyebrow {
  color: rgb(var(--accent-rgb));
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.13em;
}
.video-subject-list .video-row-title {
  color: #f8fafc;
  font-size: 0.94rem;
  line-height: 1.25;
  letter-spacing: -0.015em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.video-subject-list .video-row-desc {
  color: #a9b6cc;
  font-size: 0.72rem;
  line-height: 1.35;
  -webkit-line-clamp: 1;
}
/* Subject video pages use paper cards in the light theme. The video stills remain
 * dark images, giving each topic a clear preview without turning the whole grid dark. */
html[data-theme="light"] .video-subject-list .video-row {
  border-color: rgba(var(--accent-rgb), 0.38);
  background:
    radial-gradient(ellipse at 0% 0%, rgba(var(--accent-rgb), 0.16), transparent 69%),
    linear-gradient(145deg, #fff, #f5f9ff 82%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.96),
              0 2px 6px rgba(30, 55, 95, 0.08),
              0 10px 24px -17px rgba(var(--accent-rgb), 0.45);
}
html[data-theme="light"] .video-subject-list .video-row:hover {
  border-color: rgba(var(--accent-rgb), 0.7);
  background:
    radial-gradient(ellipse at 0% 0%, rgba(var(--accent-rgb), 0.23), transparent 71%),
    linear-gradient(145deg, #fff, #edf5ff 82%);
  box-shadow: inset 0 1px 0 #fff,
              0 7px 16px -8px rgba(30, 55, 95, 0.19),
              0 17px 29px -18px rgba(var(--accent-rgb), 0.42);
}
html[data-theme="light"] .video-subject-list .video-row-thumb {
  box-shadow: 0 0 0 1px rgba(27, 51, 83, 0.13);
}
html[data-theme="light"] .video-subject-list .video-row-icon {
  background: rgba(var(--accent-rgb), 0.17);
  color: color-mix(in srgb, rgb(var(--accent-rgb)) 52%, #173550);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8),
              0 0 0 1px rgba(var(--accent-rgb), 0.18);
}
html[data-theme="light"] .video-subject-list .video-row-play,
html[data-theme="light"] .video-subject-list .video-row-len { color: #fff; }
html[data-theme="light"] .video-subject-list .video-row-len { background: rgba(5, 8, 18, 0.82); }
html[data-theme="light"] .video-subject-list .video-row-eyebrow {
  color: color-mix(in srgb, rgb(var(--accent-rgb)) 48%, #173550);
}
html[data-theme="light"] .video-subject-list .video-row-title { color: #18324f; }
html[data-theme="light"] .video-subject-list .video-row-desc { color: #526782; }
html[data-theme="light"] .video-subject-list .video-row-progress { background: rgba(255, 255, 255, 0.18); }

/* Card grid (owner 2026-11-21): every list shows the whole 16:9 designed thumbnail
 * (scripts/build_video_cards.py) above a two-line title; no description. */
.video-list.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr));
  gap: 1rem;
}
.video-list.video-grid .video-row {
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: 0;
  overflow: hidden;
  border-color: rgba(var(--accent-rgb, var(--video-accent)), 0.28);
  border-radius: 1rem;
  background: linear-gradient(170deg, #0f1830, #080c19 80%);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.05), 0 10px 26px rgba(0, 0, 0, 0.22);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.video-list.video-grid .video-row:hover {
  transform: translateY(-3px);
  border-color: rgba(var(--accent-rgb, var(--video-accent)), 0.7);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.32), 0 0 24px rgba(var(--accent-rgb, var(--video-accent)), 0.14);
}
.video-list.video-grid .video-row-thumb {
  flex: none;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 0;
  align-self: auto;
}
.video-list.video-grid .video-row-thumb::after { content: none; }
.video-list.video-grid .video-row-play { opacity: 0; transition: opacity 0.2s ease; }
.video-list.video-grid .video-row:hover .video-row-play,
.video-list.video-grid .video-row:focus-visible .video-row-play { opacity: 1; }
.video-list.video-grid .video-row-body {
  flex: 1;
  justify-content: flex-start;
  gap: 0.3rem;
  padding: 0.7rem 0.85rem 0.85rem;
}
.video-list.video-grid .video-row-meta { display: flex; align-items: center; gap: 0.45rem; min-height: 0; }
.video-list.video-grid .video-row-meta:not(:has(> *)) { display: none; }
.video-list.video-grid .video-row-icon {
  display: inline-grid; place-items: center; flex: none;
  width: 1.6rem; height: 1.6rem; border-radius: 0.5rem;
  border: 1px solid rgba(var(--accent-rgb), 0.45);
  background: rgba(var(--accent-rgb), 0.15); color: rgb(var(--accent-rgb));
  box-shadow: none;
}
.video-list.video-grid .video-row-icon svg { width: 1rem; height: 1rem; }
.video-list.video-grid .video-row-eyebrow {
  color: rgb(var(--accent-rgb, var(--video-accent)));
  font-size: 0.66rem; font-weight: 700; letter-spacing: 0.12em;
}
.video-list.video-grid .video-row-title {
  color: #f8fafc; font-size: 0.95rem; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.video-list.video-grid .video-row--featured { box-shadow: inset 0 3px rgba(var(--accent-rgb), 0.75), 0 10px 26px rgba(0, 0, 0, 0.22); }
html[data-theme="light"] .video-list.video-grid .video-row {
  background: linear-gradient(170deg, #fff, #f4f8ff 85%);
  box-shadow: 0 2px 6px rgba(30, 55, 95, 0.08), 0 12px 24px -18px rgba(var(--accent-rgb, 30, 55, 95), 0.45);
}
html[data-theme="light"] .video-list.video-grid .video-row-title { color: #18324f; }
html[data-theme="light"] .video-list.video-grid .video-row-eyebrow {
  color: color-mix(in srgb, rgb(var(--accent-rgb, var(--video-accent))) 50%, #173550);
}
@media (max-width: 560px) {
  .video-list.video-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; }
  .video-list.video-grid .video-row-body { padding: 0.5rem 0.6rem 0.65rem; }
  .video-list.video-grid .video-row-title { font-size: 0.82rem; }
}
@media (prefers-reduced-motion: reduce) {
  .video-list.video-grid .video-row { transition: none; }
  .video-list.video-grid .video-row:hover { transform: none; }
}

@media (max-width: 900px) {
  .video-subject-list { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .video-subject-list .video-row,
  .video-subject-list .video-row-play svg { transition: none; }
  .video-subject-list .video-row:hover { transform: none; }
  .video-subject-list .video-row:hover .video-row-play svg { transform: none; }
}
@media (max-width: 480px) {
  .video-row-thumb { width: 6.5rem; }
  .video-row-desc { display: none; }
  .video-subject-list .video-row-thumb { flex-basis: 36%; width: 36%; }
  /* A ~120px thumbnail: the 2rem play disc and the duration badge collided. */
  .video-subject-list .video-row-play svg { width: 1.6rem; height: 1.6rem; padding: 0.35rem; }
  .video-subject-list .video-row-len { right: 0.25rem; bottom: 0.25rem; padding: 0 0.25rem; line-height: 1.35; }
}

/* ── Watch page ───────────────────────────────────────────────────────────── */
.video-h2 {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgb(148, 163, 184);
}
/* ── The theatre layout ──────────────────────────────────────────────────────
 * Chapters | player | resources across the top, transcript directly under the
 * player. Two things drive this:
 *
 *  1. The transcript has to be visible WHILE the video plays. Stacked under a
 *     chapter list and a description it started a full screen down, which makes it
 *     a document rather than a read-along.
 *  2. The page had the width already. Every other page is a 64rem prose column;
 *     a 16:9 player in the middle of one leaves two empty margins, which is exactly
 *     where a jump list and a resource panel want to be.
 *
 * `main_class` (base.html) widens ONLY this page. The columns are named areas, so
 * the phone layout is a different grid over the same DOM — nothing is duplicated
 * and the transcript keeps its place right under the video there too.
 */
#site-main.video-wide { max-width: 104rem; }

.video-layout {
  display: grid;
  gap: 1.25rem 1.5rem;
  align-items: start;
  grid-template-columns: minmax(13rem, 17rem) minmax(0, 1fr) minmax(15rem, 19rem);
  grid-template-areas:
    "chapters stage      aside"
    "chapters under      aside"
    "chapters transcript aside";
}
.video-chapters { grid-area: chapters; }
.video-stage { grid-area: stage; }
.video-aside { grid-area: aside; }
/* Strip + tools + resume: ONE item, so they can't be auto-flowed into implicit rows
 * (placed individually they landed under the transcript instead of under the player). */
.video-underbar { grid-area: under; min-width: 0; }
.video-below { grid-area: transcript; min-width: 0; display: grid; gap: 1.25rem;
  grid-template-columns: minmax(0, 2fr) minmax(15rem, 1fr); align-items: start; }
.video-transcript-slot { min-width: 0; }
@media (max-width: 1099px) { .video-below { grid-template-columns: minmax(0, 1fr); } }
.video-underbar .video-strip { margin-top: 0; }

/* Side panels stretch to the row's height WITHOUT contributing to it: `height: 0`
 * + `min-height: 100%` makes a grid item that a long chapter list can never push
 * taller than the video beside it. Overflow then scrolls inside the panel, and
 * video-watch.js keeps the current chapter in view (by setting scrollTop — never
 * scrollIntoView, which would drag the whole page with it). */
@media (min-width: 1100px) {
  .video-chapters,
  .video-aside {
    position: sticky;
    top: 1rem;
    align-self: start;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 0.25rem;
  }
}

/* Tablet: two columns — chapters keep the player company, resources move below it
 * (they are links, not something you consult mid-play). */
@media (max-width: 1099px) and (min-width: 761px) {
  .video-layout {
    grid-template-columns: minmax(11rem, 15rem) minmax(0, 1fr);
    grid-template-areas:
      "chapters stage"
      "chapters under"
      "chapters transcript"
      "aside    aside";
  }
  .video-chapters { max-height: 30rem; overflow-y: auto; }
  .video-aside {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    gap: 0.75rem 1.5rem;
    align-items: start;
  }
  .video-aside .video-h2 { grid-column: 1 / -1; }
}

/* Phone: one column, and the transcript comes BEFORE the chapter list — the strip
 * above it already navigates, and the read-along is what a phone viewer wants next
 * to the video. */
@media (max-width: 760px) {
  .video-layout {
    grid-template-columns: minmax(0, 1fr);
    /* Chapters before the transcript (usage 11-28): on a phone the list sat below the
       transcript and comments, and most viewers came for one part of a long lesson. */
    grid-template-areas: "stage" "under" "chapters" "transcript" "aside";
  }
  .video-chapter-list { max-height: 15rem; }
}
.video-chapter-list {
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
  max-height: 22rem;
  overflow-y: auto;
}
.video-chapter {
  display: flex;
  gap: 0.7rem;
  width: 100%;
  padding: 0.4rem 0.5rem;
  border: 0;
  border-radius: 0.5rem;
  background: transparent;
  color: rgb(203, 213, 225);
  font: inherit;
  font-size: 0.85rem;
  text-align: left;
  cursor: pointer;
}
.video-chapter:hover { background: rgba(255, 255, 255, 0.06); }
.video-chapter:focus-visible {
  outline: 2px solid rgba(var(--video-accent), 0.6);
  outline-offset: -2px;
}
.video-chapter[aria-current="true"] {
  background: rgba(var(--video-accent), 0.14);
  color: #fff;
}
.video-chapter-time {
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
  color: rgb(148, 163, 184);
}
.video-chapter[aria-current="true"] .video-chapter-time { color: rgb(196, 181, 253); }
.video-chapter-title { min-width: 0; }

.video-chip,
.video-download {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.375rem 0.625rem;
  border: 1px solid rgba(var(--video-accent), 0.3);
  border-radius: 0.375rem;
  background: rgba(var(--video-accent), 0.1);
  color: rgb(196, 181, 253);
  font-size: 0.75rem;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.15s ease;
}
.video-chip:hover,
.video-download:hover { background: rgba(var(--video-accent), 0.2); }

/* Resume banner — revealed by video-watch.js only when a position is remembered. */
.video-resume {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.6rem;
}
.video-resume[hidden] { display: none; }
.video-resume-go {
  padding: 0.375rem 0.7rem;
  border: 1px solid rgba(var(--video-accent), 0.35);
  border-radius: 0.375rem;
  background: rgba(var(--video-accent), 0.16);
  color: rgb(221, 214, 254);
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
}
.video-resume-go:hover { background: rgba(var(--video-accent), 0.26); }
.video-resume-note {
  color: rgb(203, 213, 225);
  font-size: 0.78rem;
}
.video-resume-dismiss {
  border: 0;
  background: transparent;
  color: rgb(100, 116, 139);
  font: inherit;
  font-size: 0.75rem;
  cursor: pointer;
}
.video-resume-dismiss:hover { color: rgb(203, 213, 225); }

/* ── Read-along transcript ────────────────────────────────────────────────────
 * The narration, grouped by chapter, in EN / 中文 / both. The language toggle only
 * flips which paragraphs DISPLAY — both stay in the DOM, so a reader can search the
 * page (⌘F) in either language and a crawler sees the English either way.
 */
.video-transcript {
  border: 1px solid var(--video-border);
  border-radius: 1rem;
  /* OPAQUE and darker than the page, unlike the `--video-surface` white wash the other
   * panels use. This one is a wall of small bilingual text that a reader follows for
   * seventeen minutes, so it is the one surface where the site's starfield showing
   * through costs legibility rather than adding depth. Sits below the body (1,4,14) so
   * the text gains contrast (12.4:1 for the English line, 6.5:1 for the Chinese). */
  background: #060b18;
  padding: 0.5rem 0.875rem 0.875rem;
}
.video-transcript-summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  list-style: none;
  padding: 0.35rem 0;
}
.video-transcript-summary::-webkit-details-marker { display: none; }
.video-transcript-summary:focus-visible {
  outline: 2px solid rgba(var(--video-accent), 0.6);
  outline-offset: 2px;
  border-radius: 0.35rem;
}
.video-transcript-chevron {
  width: 0.9rem;
  height: 0.9rem;
  color: rgb(100, 116, 139);
  transition: transform 0.15s ease;
}
.video-transcript[open] .video-transcript-chevron { transform: rotate(90deg); }

.video-transcript-toggle {
  display: inline-flex;
  gap: 0.25rem;
  margin: 0.25rem 0 0.75rem;
  padding: 0.15rem;
  border: 1px solid var(--video-border);
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.02);
}
.video-transcript-toggle button {
  padding: 0.2rem 0.6rem;
  border: 0;
  border-radius: 0.35rem;
  background: transparent;
  color: rgb(148, 163, 184);
  font: inherit;
  font-size: 0.75rem;
  cursor: pointer;
}
.video-transcript-toggle button:hover { color: rgb(226, 232, 240); }
.video-transcript-toggle button[aria-pressed="true"] {
  background: rgba(var(--video-accent), 0.18);
  color: rgb(221, 214, 254);
}

/* Toggle row: languages left, follow/expand right. */
.video-transcript-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.video-transcript-opts { display: inline-flex; gap: 0.35rem; }
.video-transcript-opt {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.55rem;
  border: 1px solid var(--video-border);
  border-radius: 0.5rem;
  background: transparent;
  color: rgb(148, 163, 184);
  font: inherit;
  font-size: 0.72rem;
  cursor: pointer;
}
.video-transcript-opt svg { width: 0.8rem; height: 0.8rem; }
.video-transcript-opt:hover { color: rgb(226, 232, 240); }
.video-transcript-opt[aria-pressed="true"] {
  border-color: rgba(var(--video-accent), 0.4);
  background: rgba(var(--video-accent), 0.16);
  color: rgb(221, 214, 254);
}

/* The scroll box. Capped so the player stays on screen while reading along; the
 * Expand button lifts the cap for reading the lesson as a document. */
.video-transcript-body {
  max-height: min(28rem, 48vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 0.35rem;
  /* NO `scroll-behavior: smooth` here on purpose — it would also apply to the
   * instant scrolls video-watch.js performs after a seek (CSS smooth wins over a
   * `behavior: "auto"` call), and a multi-thousand-pixel animation never arrives
   * before the next tick recomputes. The script picks smooth vs instant per jump. */
}
.video-transcript[data-expanded="1"] .video-transcript-body { max-height: none; }

/* Chapter eyebrow — sticks to the top of the scroll box so the section being spoken
   is always named, however far into it the reader has scrolled. */
.video-transcript-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  gap: 0.6rem;
  width: 100%;
  padding: 0.3rem;
  margin: 0.6rem 0 0.15rem -0.3rem;
  border: 0;
  border-radius: 0.35rem;
  /* Opaque: lines scroll UNDER this, and a translucent chip would show them through. */
  background: #0f1729;
  color: rgb(203, 213, 225);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.video-tr-chapter:first-child > .video-transcript-head { margin-top: 0; }
button.video-transcript-head:hover { background: #16203a; }
button.video-transcript-head:focus-visible {
  outline: 2px solid rgba(var(--video-accent), 0.6);
  outline-offset: -2px;
}
.video-transcript-head--static { cursor: default; }
.video-transcript-time {
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  color: rgb(148, 163, 184);
}

/* ── One spoken sentence + its translation ───────────────────────────────────
 * The pair is ONE element: English on top, Chinese directly beneath it, so the eye
 * moves down one line rather than across a gap to a matching paragraph. Both stay in
 * the DOM in every view (⌘F finds either language; a crawler always sees the English)
 * — the language toggle only flips which half DISPLAYS, driven by one attribute on
 * the container so no JS has to walk the list.
 */
.video-tr-line {
  display: block;
  padding: 0.3rem 0.45rem;
  margin-left: -0.45rem;
  border-left: 2px solid transparent;
  border-radius: 0.35rem;
  cursor: pointer;
}
.video-tr-line:hover { background: rgba(255, 255, 255, 0.05); }
.video-tr-line:focus-visible {
  outline: 2px solid rgba(var(--video-accent), 0.55);
  outline-offset: -2px;
}
.video-tr-line[aria-current="true"] {
  background: rgba(var(--video-accent), 0.13);
  border-left-color: rgb(var(--video-accent));
}
.video-tr-en,
.video-tr-zh { display: block; }
.video-tr-en {
  font-size: 0.9rem;
  line-height: 1.55;
  color: rgb(203, 213, 225);
}
.video-tr-zh {
  margin-top: 0.1rem;
  font-size: 0.82rem;
  line-height: 1.5;
  color: rgb(139, 152, 172);
}
.video-tr-line[aria-current="true"] .video-tr-en { color: #fff; }
.video-tr-line[aria-current="true"] .video-tr-zh { color: rgb(186, 196, 214); }

.video-transcript[data-view="en"] .video-tr-zh,
.video-transcript[data-view="zh"] .video-tr-en { display: none; }
/* Single-language views lose the pair's second line, so tighten the rhythm. */
.video-transcript[data-view="en"] .video-tr-line,
.video-transcript[data-view="zh"] .video-tr-line { padding-top: 0.22rem; padding-bottom: 0.22rem; }

/* ── Aside: about, links, lessons, up next ───────────────────────────────────── */
.video-about-text {
  margin: 0.5rem 0 0;
  font-size: 0.82rem;
  line-height: 1.6;
  color: rgb(203, 213, 225);
}
.video-aside-h3 {
  margin: 1.1rem 0 0.4rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgb(100, 116, 139);
}
.video-links,
.video-lesson-links {
  margin: 0.6rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  /* minmax(0,1fr): an auto track grew to the longest nowrap title and the page scrolled
     sideways at 360px; the title's ellipsis needs a bounded track. */
  grid-template-columns: minmax(0, 1fr);
  gap: 0.3rem;
}
.video-links a,
.video-lesson-links a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.4rem;
  margin-left: -0.4rem;
  border-radius: 0.5rem;
  color: rgb(148, 163, 184);
  font-size: 0.8rem;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.video-links a:hover,
.video-lesson-links a:hover { background: rgba(255, 255, 255, 0.05); color: rgb(226, 232, 240); }
.video-links svg { width: 0.9rem; height: 0.9rem; flex: 0 0 auto; }
.video-lesson-links .practice-card-icon-bg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  flex: 0 0 auto;
  border-radius: 0.4rem;
}
.video-lesson-links .practice-card-icon { width: 0.85rem; height: 0.85rem; }
.video-lesson-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Up next: the poster is the affordance, so it leads. */
.video-next-card {
  display: block;
  border: 1px solid var(--video-border);
  border-radius: 0.75rem;
  overflow: hidden;
  background: var(--video-surface);
  text-decoration: none;
  transition: border-color 0.15s ease;
}
.video-next-card:hover { border-color: rgba(var(--video-accent), 0.45); }
.video-next-card img { display: block; width: 100%; height: auto; }
.video-next-title {
  display: block;
  padding: 0.5rem 0.6rem 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: rgb(226, 232, 240);
}
.video-next-meta {
  display: block;
  padding: 0.1rem 0.6rem 0.55rem;
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  color: rgb(148, 163, 184);   /* slate-500 read 2.7:1 on the card */
}
.video-prev-link {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.6rem;
  color: rgb(100, 116, 139);
  font-size: 0.75rem;
  text-decoration: none;
}
.video-prev-link:hover { color: rgb(203, 213, 225); }
.video-prev-link svg { width: 0.85rem; height: 0.85rem; flex: 0 0 auto; }
.video-prev-link span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── The topic row's watch button (/learn/<subject>) ──────────────────────────
 * It used to sit inside the accordion BODY, on a line of its own above the
 * lesson list — so it read as a property of that list rather than of the topic,
 * and it was invisible while the topic was collapsed, which is exactly when a
 * student is deciding whether to watch. In the <summary> it is always reachable.
 *
 * ⚠ No JS guard, and that is deliberate rather than an oversight. A click
 * anywhere in a <summary> toggles the accordion, but an ACTIVATABLE descendant
 * consumes the activation, so a real <a href> does not. Measured all three ways
 * on the live page first: a bare <span> toggles; the same span with a
 * `stopPropagation` wrapper STILL toggles (the toggle is summary's default
 * action, not a listener, so only preventDefault would reach it — and that would
 * cancel the navigation too); a real anchor does not toggle at all.
 *
 * On phones the action uses its short visible label while keeping the full accessible
 * name. The title may wrap to two lines without pushing the action below it.
 */
.lx-topic-summary { flex-wrap: wrap; }
.lx-topic-watch { display: flex; gap: 0.5rem; }

@media (max-width: 639px) {
  .lx-topic-watch { order: 0; flex-basis: auto; margin-top: 0; }
  .lx-topic-watch .video-launch { min-height: 2.5rem; padding: 0.35rem 0.5rem; }
  .lx-topic-watch .video-launch-full { display: none; }
  .lx-topic-watch .video-launch-short { display: inline; }
  /* Tighter row: a one-word title wider than its ~112px column ("Electrochemistry") was cut. */
  summary:has(> .lx-topic-watch) { flex-wrap: nowrap; gap: 0.35rem; padding-left: 0.75rem; padding-right: 0.75rem; }
  summary:has(> .lx-topic-watch) .learn-topic-title {
    min-width: 0; white-space: normal; overflow: hidden; text-overflow: unset;
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  }  /* Room for the title (owner 11-27: "Human re-source management" sat one word per line beside
     number, icon, count, Video and chevron): the row drops its decorative topic icon and the
     button its word; the play glyph and the accessible name stay. */
  summary:has(> .lx-topic-watch) > .practice-card-icon-bg { display: none; }
  .lx-topic-watch .video-launch-short { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .lx-topic-watch .video-launch { padding: 0.35rem 0.6rem; }
}
/* ── Browser-drawn subtitles (video-subs.js) ──────────────────────────────────
 * No text is burned into a soft video; video-subs.js places the active cues inside the
 * frame's reserved subtitle band and sizes them from the picture height (inline styles +
 * --vsubs-en/--vsubs-zh). Below 560 px they sit in a strip under the picture instead.
 */
.vsubs-box { position: relative; container-type: inline-size; }
.vsubs { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; text-align: center;
         pointer-events: none; padding: 0 3%; }
.vsubs > div { margin: 0; line-height: 0; }
.vsubs > div + div { margin-top: calc(var(--vsubs-en, 24px) * 0.16); }
.vsubs span { display: inline-block; max-width: 100%; background: rgba(0, 0, 0, .62); color: #fff;
              border-radius: 0.18em; padding: 0.04em 0.4em; line-height: 1.22; white-space: nowrap;
              font: 500 var(--vsubs-en, 24px)/1.22 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                    "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", "Noto Sans SC", sans-serif; }
.vsubs .vsubs-zh span { font-size: var(--vsubs-zh, 25px); }
.vsubs.vsubs-wrap span { white-space: normal; }
.vsubs span:empty { display: none; }
.vsubs-box[data-subs-mode="off"] .vsubs { display: none; }
.vsubs-box:fullscreen, .vsubs-box:-webkit-full-screen {
  display: flex; align-items: center; justify-content: center; background: #000; border-radius: 0;
}
.vsubs-box:fullscreen video, .vsubs-box:-webkit-full-screen video {
  width: 100%; height: 100%; max-height: none; aspect-ratio: auto; border: 0; border-radius: 0;
  object-fit: contain;
}
@container (max-width: 560px) {
  .vsubs { position: static; padding: 6px 4% 8px; background: #000; width: auto !important; }
  .vsubs span { background: none; padding: 0; white-space: normal; font-size: 15px; line-height: 1.35; }
  .vsubs .vsubs-zh span { font-size: 16px; }
  .vsubs > div + div { margin-top: 0; }
  .vsubs-box:not([data-subs-mode="off"]):not([data-subs-mode="both"]) .vsubs { min-height: calc(2 * 1.35 * 15px + 14px); }
  .vsubs-box[data-subs-mode="both"] .vsubs { min-height: calc(4 * 1.35 * 15px + 18px); }
  /* The strip and the picture read as one player: square where they meet, rounded below. */
  .vsubs-box:not([data-subs-mode="off"]) .vsubs { border-radius: 0 0 0.875rem 0.875rem; }
  .vsubs-box:not([data-subs-mode="off"]) .video-player { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
}
/* appearance: none drops the native look but not its grey (239, 239, 239) fill: without a
   background the label sat on a grey block inside the button, in both themes. */
.video-subs-select { appearance: none; -webkit-appearance: none; background: transparent; color: inherit;
                     padding-right: 0.75rem; }

/* ── Subtitle quick buttons, likes, comments (video-social.js) ─────────────────── */
.video-subs-quick { display: inline-flex; gap: 0.35rem; }
.video-tool[aria-pressed="true"] { color: rgb(226, 232, 240); border-color: rgba(167, 139, 250, 0.55); background: rgba(167, 139, 250, 0.14); }
.video-tool[data-rate] svg { color: rgba(251, 191, 36, 0.85); }
.video-tool[data-video-share] svg { color: rgba(56, 189, 248, 0.85); }
.video-tool--subs svg, .video-tool--lang svg { color: rgba(167, 139, 250, 0.9); }
.video-tool--subs-off svg { color: rgba(148, 163, 184, 0.9); }
.video-react { display: inline-flex; gap: 0.4rem; margin-left: auto; }
.video-react-btn {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.3rem 0.65rem; border-radius: 999px; border: 1px solid var(--video-border);
  background: rgba(255, 255, 255, 0.02); color: rgb(148, 163, 184);
  font: inherit; font-size: 0.75rem; font-variant-numeric: tabular-nums; cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.video-react-btn svg { width: 0.95rem; height: 0.95rem; }
.video-react-btn--up svg { color: rgb(52, 211, 153); }
.video-react-btn--down svg { color: rgb(248, 113, 113); }
.video-react-btn--up:hover { border-color: rgba(52, 211, 153, 0.5); color: rgb(209, 250, 229); }
.video-react-btn--down:hover { border-color: rgba(248, 113, 113, 0.5); color: rgb(254, 226, 226); }
.video-react-btn--up[aria-pressed="true"] { background: rgba(52, 211, 153, 0.18); border-color: rgba(52, 211, 153, 0.6); color: rgb(167, 243, 208); }
.video-react-btn--down[aria-pressed="true"] { background: rgba(248, 113, 113, 0.18); border-color: rgba(248, 113, 113, 0.6); color: rgb(254, 202, 202); }
.video-react-btn--up[aria-pressed="true"] svg, .video-react-btn--down[aria-pressed="true"] svg { fill: currentColor; fill-opacity: 0.25; }

.video-comments {
  min-width: 0; padding: 0.9rem 1rem; border: 1px solid var(--video-border);
  border-radius: 0.75rem; background: var(--video-surface);
}
.video-comments .video-h2 { display: flex; align-items: center; gap: 0.45rem; }
.video-comments-icon { width: 0.95rem; height: 0.95rem; color: rgb(56, 189, 248); }
.video-comments-count { color: rgb(100, 116, 139); font-weight: 500; letter-spacing: 0; }
.video-comment-form { margin-top: 0.7rem; }
.video-comment-input {
  display: block; width: 100%; resize: vertical; min-height: 3.2rem;
  padding: 0.5rem 0.6rem; border-radius: 0.5rem; border: 1px solid var(--video-border);
  background: rgba(255, 255, 255, 0.03); color: rgb(226, 232, 240);
  font: inherit; font-size: 0.82rem; line-height: 1.5;
}
.video-comment-input:focus { outline: none; border-color: rgba(56, 189, 248, 0.55); }
.video-comment-form-row { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.4rem; }
.video-comment-msg { flex: 1; font-size: 0.72rem; color: rgb(248, 113, 113); }
.video-comment-post, .video-comment-cancel, .video-comment-signin-btn {
  padding: 0.3rem 0.8rem; border-radius: 0.4rem; font: inherit; font-size: 0.75rem; cursor: pointer;
}
.video-comment-post { border: 1px solid rgba(56, 189, 248, 0.55); background: rgba(56, 189, 248, 0.16); color: rgb(186, 230, 253); }
.video-comment-post:hover { background: rgba(56, 189, 248, 0.26); }
.video-comment-post:disabled { opacity: 0.5; cursor: wait; }
.video-comment-cancel { border: 1px solid var(--video-border); background: transparent; color: rgb(148, 163, 184); }
.video-comment-signin { margin: 0.7rem 0 0; }
.video-comment-signin-btn { border: 1px solid rgba(56, 189, 248, 0.45); background: rgba(56, 189, 248, 0.1); color: rgb(186, 230, 253); }
.video-comment-list, .video-comment-replies { margin: 0; padding: 0; list-style: none; }
.video-comment-list { margin-top: 0.8rem; display: grid; gap: 0.85rem; max-height: 34rem; overflow-y: auto; overscroll-behavior: contain; }
.video-comment-replies { margin: 0.55rem 0 0 1.1rem; padding-left: 0.75rem; border-left: 2px solid rgba(255, 255, 255, 0.07); display: grid; gap: 0.6rem; }
.video-comment-head { display: flex; align-items: center; gap: 0.45rem; font-size: 0.75rem; }
.video-comment-avatar {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  width: 1.45rem; height: 1.45rem; border-radius: 999px; font-size: 0.7rem; font-weight: 700;
  background: hsl(var(--hue, 200) 70% 60% / 0.2); color: hsl(var(--hue, 200) 80% 75%);
}
.video-comment-author { font-weight: 600; color: rgb(226, 232, 240); }
.video-comment--deleted .video-comment-author { font-weight: 400; color: rgb(100, 116, 139); }
.video-comment-time { color: rgb(100, 116, 139); font-size: 0.7rem; }
.video-comment-body { margin: 0.25rem 0 0 1.9rem; font-size: 0.82rem; line-height: 1.55; color: rgb(203, 213, 225); white-space: pre-wrap; overflow-wrap: anywhere; }
.video-comment-actions { display: flex; gap: 0.7rem; margin: 0.2rem 0 0 1.9rem; }
.video-comment-action { padding: 0; border: 0; background: none; font: inherit; font-size: 0.7rem; color: rgb(100, 116, 139); cursor: pointer; }
.video-comment-action:hover { color: rgb(125, 211, 252); }
.video-comment-action--delete:hover { color: rgb(248, 113, 113); }
.video-comment-form--reply { margin: 0.45rem 0 0 1.9rem; }
.video-comment-empty { margin: 0.8rem 0 0; font-size: 0.78rem; color: rgb(148, 163, 184); }

/* Light colour on the page's icons: noticeable, never loud. */
.video-link--notes svg { color: rgba(103, 232, 249, 0.85); }
.video-link--code svg { color: rgba(196, 181, 253, 0.9); }
.video-link--download svg { color: rgba(110, 231, 183, 0.85); }
.video-lesson-links .practice-card-icon-bg {
  background: rgba(var(--accent-rgb), 0.12);
  border: 1px solid rgba(var(--accent-rgb), 0.28);
  color: rgba(var(--accent-rgb), 0.85);
}
.video-aside > .video-links { margin-top: 0; }
.video-watch .video-chip svg:not([viewBox="0 0 28 20"]) { color: rgba(251, 191, 36, 0.85); }
.video-watch .slides-launch svg { color: rgba(56, 189, 248, 0.85); }
.video-transcript-opt[data-transcript-follow] svg { color: rgba(56, 189, 248, 0.85); }
.video-transcript-opt[data-transcript-expand] svg { color: rgba(167, 139, 250, 0.85); }
.video-transcript-chevron { color: rgba(56, 189, 248, 0.7); }
.video-prev-link svg { color: rgba(167, 139, 250, 0.85); }
/* ── Parts mode (video-watch.js): end-of-part card, the toggle, watched ticks ─── */
.video-part-end {
  position: absolute; inset: 0; z-index: 3;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.35rem; padding: 1rem; border-radius: 0.875rem;
  background: rgba(2, 6, 23, 0.86); backdrop-filter: blur(3px); text-align: center;
}
.video-part-end[hidden] { display: none; }
.video-part-end-done { margin: 0; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.06em; color: rgb(134, 239, 172); }
.video-part-end-next { margin: 0; max-width: 34rem; font-size: 1.1rem; font-weight: 600; color: #fff; }
.video-part-end-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; margin-top: 0.45rem; }
.video-part-end-actions .video-endcard-go { border: 0; font: inherit; font-size: 0.85rem; font-weight: 700; cursor: pointer; }
.video-part-end-count { margin: 0.2rem 0 0; font-size: 0.8rem; color: rgb(203, 213, 225); font-variant-numeric: tabular-nums; }
@media (max-width: 520px) {
  .video-part-end { gap: 0.2rem; padding: 0.5rem; }
  .video-part-end-next { font-size: 0.92rem; }
  .video-part-end-actions { margin-top: 0.2rem; gap: 0.35rem; }
  .video-part-end-actions .video-endcard-btn, .video-part-end-actions .video-endcard-go { padding: 0.3rem 0.6rem; }
}
.video-chapters-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.35rem 0.75rem; }
.video-chapters-head .video-h2 { margin: 0; }
.video-parts-toggle { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.78rem; color: rgb(203, 213, 225); cursor: pointer; }
.video-parts-toggle input { width: 1rem; height: 1rem; accent-color: rgb(var(--video-accent)); cursor: pointer; }
.video-chapter.is-seen .video-chapter-time::after { content: " ✓"; color: rgb(134, 239, 172); font-weight: 700; }
html[data-theme="light"] .video-part-end { background: rgba(250, 251, 252, 0.93); }
html[data-theme="light"] .video-part-end-done { color: rgb(21, 128, 61); }
html[data-theme="light"] .video-part-end-next { color: rgb(15, 23, 42); }
html[data-theme="light"] .video-part-end-count, html[data-theme="light"] .video-parts-toggle { color: rgb(51, 65, 85); }
html[data-theme="light"] .video-chapter.is-seen .video-chapter-time::after { color: rgb(21, 128, 61); }

/* ▼▼ LIGHT THEME — GENERATED by scripts/build_light_theme.py from the rules above. Do not edit by hand: run the builder. Hand tuning goes in 36-theme-light.css. ▼▼ */
:root[data-theme="light"]{--video-surface:rgb(15 23 42/0.03);--video-border:rgb(15 23 42/0.112)}
html[data-theme="light"] .video-launch{color:rgb(28 0 132)}
html[data-theme="light"] .video-launch:hover{color:rgb(23 0 133)}
html[data-theme="light"] .video-launch:focus-visible{box-shadow:0px 0px 0px 2px color-mix(in srgb,rgba(var(--video-accent), 0.55) 62%,#0f172a)}
html[data-theme="light"] .video-card-eyebrow{color:rgb(28 0 132)}
html[data-theme="light"] .video-card-open{color:rgb(61 75 94)}
html[data-theme="light"] .video-card-open:hover{color:rgb(44 63 88)}
html[data-theme="light"] a.video-card-open[href^="/vocab/"]{color:rgb(28 0 132)}
html[data-theme="light"] .video-practise a{color:rgb(28 0 132)}
html[data-theme="light"] .video-series-h{color:rgb(61 75 94)}
html[data-theme="light"] .video-card-playmark{color:rgb(51 63 82)}
html[data-theme="light"] .video-card-playmark svg{filter:drop-shadow(0px 1px 6px rgb(15 23 42/0.192))}
html[data-theme="light"] .video-card-len{background-color:rgb(250 251 252/0.78);color:rgb(44 63 88)}
html[data-theme="light"] .video-card-title{color:rgb(38 66 94)}
html[data-theme="light"] .video-card-desc{color:rgb(61 75 94)}
html[data-theme="light"] .video-card-btn{color:rgb(28 0 132)}
html[data-theme="light"] .video-card-note{color:rgb(61 75 94)}
html[data-theme="light"] .video-strip-seg{background-color:rgb(15 23 42/0.12)}
html[data-theme="light"] .video-endcard{background-color:rgb(250 251 252/0.9)}
html[data-theme="light"] .video-endcard-label{color:rgb(28 0 132)}
html[data-theme="light"] .video-endcard-title{color:rgb(51 63 82)}
html[data-theme="light"] .video-endcard-meta{color:rgb(61 75 94)}
html[data-theme="light"] .video-endcard-btn{border-color:rgb(15 23 42/0.18);color:rgb(44 63 88)}
html[data-theme="light"] .video-endcard-btn:hover{background-color:rgb(15 23 42/0.08)}
html[data-theme="light"] .video-tool{background-color:rgb(15 23 42/0.02);color:rgb(61 75 94)}
html[data-theme="light"] .video-tool:hover{color:rgb(44 63 88);border-color:rgb(15 23 42/0.18)}
html[data-theme="light"] .video-tool[data-rate]:not([data-rate="1"]){color:rgb(28 0 132)}
html[data-theme="light"] .video-keys{color:rgb(87 101 122)}
html[data-theme="light"] .video-row--featured{background:linear-gradient(105deg, rgba(var(--accent-rgb), 0.14), transparent 72%), rgb(246 247 250);box-shadow:inset 3px 0px rgb(15 23 42/0.14)}
html[data-theme="light"] .video-row--featured:hover{background:linear-gradient(105deg, rgba(var(--accent-rgb), 0.22), transparent 72%), rgb(246 247 250)}
html[data-theme="light"] .video-row--featured .video-row-icon{color:color-mix(in srgb,rgb(var(--accent-rgb)) 44%,#0f172a)}
html[data-theme="light"] .video-row--featured .video-row-eyebrow{color:color-mix(in srgb,rgb(var(--accent-rgb)) 44%,#0f172a)}
html[data-theme="light"] .video-row-play{color:rgb(51 63 82);text-shadow:0px 1px 6px rgb(15 23 42/0.192)}
html[data-theme="light"] .video-row-len{background-color:rgb(250 251 252/0.78);color:rgb(44 63 88)}
html[data-theme="light"] .video-row-progress{background-color:rgb(15 23 42/0.18)}
html[data-theme="light"] .video-row-eyebrow{color:rgb(87 101 122)}
html[data-theme="light"] .video-row-title{color:rgb(38 66 94)}
html[data-theme="light"] .video-row-desc{color:rgb(61 75 94)}
html[data-theme="light"] .video-list.video-grid .video-row{background-image:linear-gradient(170deg, rgb(243 244 249), rgb(248 249 252) 80%);box-shadow:0px 10px 26px rgb(15 23 42/0.07)}
html[data-theme="light"] .video-list.video-grid .video-row:hover{box-shadow:0px 18px 36px rgb(15 23 42/0.102),0 0 24px rgba(var(--accent-rgb, var(--video-accent)), 0.14)}
html[data-theme="light"] .video-list.video-grid .video-row-icon{color:color-mix(in srgb,rgb(var(--accent-rgb)) 44%,#0f172a)}
html[data-theme="light"] .video-list.video-grid .video-row-title{color:rgb(38 66 94)}
html[data-theme="light"] .video-list.video-grid .video-row--featured{box-shadow:inset 0px 3px rgb(15 23 42/0.14),0px 10px 26px rgb(15 23 42/0.07)}
html[data-theme="light"] .video-h2{color:rgb(61 75 94)}
html[data-theme="light"] .video-chapter{color:rgb(48 65 85)}
html[data-theme="light"] .video-chapter:hover{background-color:rgb(15 23 42/0.06)}
html[data-theme="light"] .video-chapter[aria-current="true"]{color:rgb(51 63 82)}
html[data-theme="light"] .video-chapter-time{color:rgb(61 75 94)}
html[data-theme="light"] .video-chapter[aria-current="true"] .video-chapter-time{color:rgb(28 0 132)}
html[data-theme="light"] .video-chip,html[data-theme="light"] .video-download{color:rgb(28 0 132)}
html[data-theme="light"] .video-resume-go{color:rgb(23 0 133)}
html[data-theme="light"] .video-resume-note{color:rgb(48 65 85)}
html[data-theme="light"] .video-resume-dismiss{color:rgb(87 101 122)}
html[data-theme="light"] .video-resume-dismiss:hover{color:rgb(48 65 85)}
html[data-theme="light"] .video-transcript{background-color:rgb(249 250 252)}
html[data-theme="light"] .video-transcript-chevron{color:rgb(87 101 122)}
html[data-theme="light"] .video-transcript-toggle{background-color:rgb(15 23 42/0.02)}
html[data-theme="light"] .video-transcript-toggle button{color:rgb(61 75 94)}
html[data-theme="light"] .video-transcript-toggle button:hover{color:rgb(44 63 88)}
html[data-theme="light"] .video-transcript-toggle button[aria-pressed="true"]{color:rgb(23 0 133)}
html[data-theme="light"] .video-transcript-opt{color:rgb(61 75 94)}
html[data-theme="light"] .video-transcript-opt:hover{color:rgb(44 63 88)}
html[data-theme="light"] .video-transcript-opt[aria-pressed="true"]{color:rgb(23 0 133)}
html[data-theme="light"] .video-transcript-head{background-color:rgb(244 246 249);color:rgb(48 65 85)}
html[data-theme="light"] button.video-transcript-head:hover{background-color:rgb(239 241 247)}
html[data-theme="light"] .video-transcript-time{color:rgb(61 75 94)}
html[data-theme="light"] .video-tr-line:hover{background-color:rgb(15 23 42/0.05)}
html[data-theme="light"] .video-tr-en{color:rgb(48 65 85)}
html[data-theme="light"] .video-tr-zh{color:rgb(70 81 97)}
html[data-theme="light"] .video-tr-line[aria-current="true"] .video-tr-en{color:rgb(51 63 82)}
html[data-theme="light"] .video-tr-line[aria-current="true"] .video-tr-zh{color:rgb(49 61 84)}
html[data-theme="light"] .video-about-text{color:rgb(48 65 85)}
html[data-theme="light"] .video-aside-h3{color:rgb(87 101 122)}
html[data-theme="light"] .video-links a,html[data-theme="light"] .video-lesson-links a{color:rgb(61 75 94)}
html[data-theme="light"] .video-links a:hover,html[data-theme="light"] .video-lesson-links a:hover{background-color:rgb(15 23 42/0.05);color:rgb(44 63 88)}
html[data-theme="light"] .video-next-title{color:rgb(44 63 88)}
html[data-theme="light"] .video-next-meta{color:rgb(61 75 94)}
html[data-theme="light"] .video-prev-link{color:rgb(87 101 122)}
html[data-theme="light"] .video-prev-link:hover{color:rgb(48 65 85)}
html[data-theme="light"] .video-tool[aria-pressed="true"]{color:rgb(44 63 88)}
html[data-theme="light"] .video-tool[data-rate] svg{color:rgb(97 70 0/0.85)}
html[data-theme="light"] .video-tool[data-video-share] svg{color:rgb(1 81 116/0.85)}
html[data-theme="light"] .video-tool--subs svg,html[data-theme="light"] .video-tool--lang svg{color:rgb(35 2 130/0.9)}
html[data-theme="light"] .video-tool--subs-off svg{color:rgb(61 75 94/0.9)}
html[data-theme="light"] .video-react-btn{background-color:rgb(15 23 42/0.02);color:rgb(61 75 94)}
html[data-theme="light"] .video-react-btn--up svg{color:rgb(22 112 79)}
html[data-theme="light"] .video-react-btn--down svg{color:rgb(135 3 3)}
html[data-theme="light"] .video-react-btn--up:hover{color:rgb(10 115 61)}
html[data-theme="light"] .video-react-btn--down:hover{color:rgb(131 1 1)}
html[data-theme="light"] .video-react-btn--up[aria-pressed="true"]{color:rgb(13 112 66)}
html[data-theme="light"] .video-react-btn--down[aria-pressed="true"]{color:rgb(133 0 0)}
html[data-theme="light"] .video-comments-icon{color:rgb(2 107 154)}
html[data-theme="light"] .video-comments-count{color:rgb(87 101 122)}
html[data-theme="light"] .video-comment-input{background-color:rgb(15 23 42/0.03);color:rgb(44 63 88)}
html[data-theme="light"] .video-comment-msg{color:rgb(135 3 3)}
html[data-theme="light"] .video-comment-post{color:rgb(1 87 132)}
html[data-theme="light"] .video-comment-cancel{color:rgb(61 75 94)}
html[data-theme="light"] .video-comment-signin-btn{color:rgb(1 87 132)}
html[data-theme="light"] .video-comment-replies{border-left-color:rgb(15 23 42/0.098)}
html[data-theme="light"] .video-comment-avatar{color:color-mix(in srgb,hsl(var(--hue, 200) 80% 75%) 44%,#0f172a)}
html[data-theme="light"] .video-comment-author{color:rgb(44 63 88)}
html[data-theme="light"] .video-comment--deleted .video-comment-author{color:rgb(87 101 122)}
html[data-theme="light"] .video-comment-time{color:rgb(87 101 122)}
html[data-theme="light"] .video-comment-body{color:rgb(48 65 85)}
html[data-theme="light"] .video-comment-action{color:rgb(87 101 122)}
html[data-theme="light"] .video-comment-action:hover{color:rgb(0 90 133)}
html[data-theme="light"] .video-comment-action--delete:hover{color:rgb(135 3 3)}
html[data-theme="light"] .video-comment-empty{color:rgb(61 75 94)}
html[data-theme="light"] .video-link--notes svg{color:rgb(1 85 96/0.85)}
html[data-theme="light"] .video-link--code svg{color:rgb(28 0 132/0.9)}
html[data-theme="light"] .video-link--download svg{color:rgb(12 84 55/0.85)}
html[data-theme="light"] .video-lesson-links .practice-card-icon-bg{color:color-mix(in srgb,rgba(var(--accent-rgb), 0.85) 44%,#0f172a)}
html[data-theme="light"] .video-watch .video-chip svg:not([viewBox="0 0 28 20"]){color:rgb(97 70 0/0.85)}
html[data-theme="light"] .video-watch .slides-launch svg{color:rgb(1 81 116/0.85)}
html[data-theme="light"] .video-transcript-opt[data-transcript-follow] svg{color:rgb(1 81 116/0.85)}
html[data-theme="light"] .video-transcript-opt[data-transcript-expand] svg{color:rgb(35 2 130/0.85)}
html[data-theme="light"] .video-transcript-chevron{color:rgb(1 81 116/0.85)}
html[data-theme="light"] .video-prev-link svg{color:rgb(35 2 130/0.85)}
html[data-theme="light"] .video-part-end{background-color:rgb(250 251 252/0.86)}
html[data-theme="light"] .video-part-end-done{color:rgb(12 113 49)}
html[data-theme="light"] .video-part-end-next{color:rgb(51 63 82)}
html[data-theme="light"] .video-part-end-count{color:rgb(48 65 85)}
html[data-theme="light"] .video-parts-toggle{color:rgb(48 65 85)}
html[data-theme="light"] .video-chapter.is-seen .video-chapter-time::after{color:rgb(12 113 49)}
/* ▲▲ LIGHT THEME END ▲▲ */
