/* 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. Cards reuse the site's glass surface
 * (white/[0.03] over the navy page) rather than inventing a second card style.
 */

: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: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-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.65rem;
  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(100, 116, 139); }

/* 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; }

/* ── 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 { margin-left: auto; font-size: 0.7rem; color: rgb(71, 85, 105); }
@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: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.65rem;
  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;
}
@media (max-width: 480px) {
  .video-row-thumb { width: 6.5rem; }
  .video-row-desc { display: none; }
}

/* ── 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-transcript-slot { grid-area: transcript; min-width: 0; }
.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);
    grid-template-areas: "stage" "under" "transcript" "chapters" "aside";
  }
  .video-chapter-list { max-height: 18rem; }
}
.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-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;
  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(100, 116, 139);
}
.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;
}
