/* Animation course: watch + practice video chrome
   Brand accent aligned with practice UI (sky/cyan, not 参考产品 purple). */

.video-watch-shell {
  --vw-accent: #38bdf8;
  --vw-accent-soft: rgba(56, 189, 248, 0.14);
  --vw-accent-soft-strong: rgba(56, 189, 248, 0.24);
  --vw-accent-border: rgba(56, 189, 248, 0.55);
  --vw-accent-text: #bae6fd;
  --vw-accent-muted: #7dd3fc;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  background: #0c1117;
  color: #f3f4f6;
  overflow: hidden;
}
.video-watch-shell.is-fullscreen {
  background: #000;
}

.video-watch-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  height: 3.5rem;
  padding: 0 1rem;
  border-bottom: 1px solid rgb(38 38 42);
  flex-shrink: 0;
}

.video-watch-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.5rem;
  color: #d1d5db;
}
.video-watch-back:hover { background: rgb(255 255 255 / 0.06); color: #fff; }

.video-watch-title {
  flex: 1;
  min-width: 0;
  font-size: 0.95rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.video-watch-practice-link {
  flex-shrink: 0;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  background: linear-gradient(90deg, #0ea5e9 0%, #38bdf8 55%, #2dd4bf 100%);
  color: #0f172a;
  font-size: 0.8rem;
  font-weight: 700;
}
.video-watch-practice-link:hover { filter: brightness(1.05); }

/* Mode switch: 观看 | 中译英 */
.vw-mode-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  flex-shrink: 0;
  padding: 0.2rem;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.06);
  border: 1px solid rgb(255 255 255 / 0.1);
}
.vw-mode-switch__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3.6rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 650;
  color: #9ca3af;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}
.vw-mode-switch__btn:hover { color: #e5e7eb; }
.vw-mode-switch__btn.is-active {
  background: linear-gradient(90deg, #0ea5e9 0%, #38bdf8 55%, #2dd4bf 100%);
  color: #0f172a;
}

.video-watch-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  /* ≈ 参考产品: px-2 pt-2 pb-2 lg:px-6 lg:pt-3 lg:pb-4 */
  padding: 0.35rem 0.5rem 0.5rem;
}

@media (min-width: 900px) {
  .video-watch-body {
    /* 参考产品: lg:w-[360px] sidebar + gap ≈ 12px */
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 0.75rem;
    padding: 0.5rem 1.25rem 0.75rem;
  }
  .video-watch-shell.is-list-hidden .video-watch-body {
    grid-template-columns: 1fr;
  }
}

.video-watch-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

/* ≈ 参考产品 .watching-material */
.video-watch-player-wrap {
  --vw-subtitle-dock-h: min(26vh, 14.5rem);
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  flex: 1;
  padding: 0;
  gap: 0;
  overflow: hidden;
  border-radius: 0.5rem;
  margin: 0;
  background: #0a0a0a;
}

/* ≈ 参考产品 .watching-video-stage — fills leftover after fixed subtitle dock */
.video-watch-stage {
  position: relative;
  flex: 1 1 0;
  min-height: 0;
  max-height: none;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px 0;
  border-radius: 0;
  background: transparent;
  overflow: hidden;
}

.video-watch-player {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: contain;
  background: transparent;
}
.video-watch-shell.is-fullscreen .video-watch-player {
  max-height: none;
}

.vw-big-play {
  display: none !important;
}

/* ≈ 参考产品 .subtitle-dock — grows for long sentences (capped at ~half the
   player wrap) so the full English word row + Chinese sentence stay visible */
.vw-caption {
  flex: 0 1 auto;
  min-height: var(--vw-subtitle-dock-h);
  max-height: min(52%, 24rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  justify-content: safe center;
  gap: 0.35rem;
  padding: 0.35rem 1rem 0.5rem;
  text-align: center;
  box-sizing: border-box;
  overflow: hidden;
}

.vw-caption-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  width: 100%;
  min-height: 0;
}

.vw-caption-words {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 0.55rem 1.1rem;
}

.vw-word {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  min-width: 2.25rem;
}

.vw-word__ipa {
  font-size: 0.75rem;
  line-height: 1.2;
  color: rgba(255, 255, 255, 0.55);
  font-family: ui-sans-serif, system-ui, sans-serif;
}

/* 参考产品 word-text ≈ 25.5px / medium */
.vw-word__en {
  font-size: clamp(1.35rem, 1.7vw, 1.6rem);
  font-weight: 500;
  color: #fff;
  line-height: 1.4;
  letter-spacing: 0.01em;
}

.vw-word__bar {
  width: 100%;
  min-width: 1.5rem;
  height: 3px;
  margin-top: 0.08rem;
  border-radius: 999px;
  background: var(--vw-word-color, #94a3b8);
}

/* 参考产品 gloss text-[11px] */
.vw-word__zh {
  margin-top: 0.12rem;
  max-width: 5.5em;
  font-size: 11px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.375;
  text-align: center;
}

/* 参考产品 POS ≈ 10px */
.vw-word__pos {
  font-size: 10px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.25;
  white-space: nowrap;
}

/* 参考产品 full ZH ≈ 21.6px with top rule */
.vw-caption-zh {
  margin: 0.5rem 0 0;
  padding-top: 0.55rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: clamp(1.2rem, 1.4vw, 1.35rem);
  font-weight: 400;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.5;
}

.vw-caption.hide-ipa .vw-word__ipa { display: none; }
.vw-caption.hide-en .vw-word__en,
.vw-caption.hide-en .vw-word__bar { display: none; }
.vw-caption.hide-gloss .vw-word__zh,
.vw-caption.hide-gloss .vw-word__pos { display: none; }
.vw-caption.hide-zh .vw-caption-zh { display: none; }

/* Long sentences: JS adds .is-compact — drop per-word IPA/POS and shrink type
   so wrapped word rows + full Chinese sentence fit inside the dock */
.vw-caption.is-compact .vw-word__ipa,
.vw-caption.is-compact .vw-word__pos { display: none; }
.vw-caption.is-compact .vw-caption-words { gap: 0.35rem 0.7rem; }
.vw-caption.is-compact .vw-word { min-width: 1.75rem; }
.vw-caption.is-compact .vw-word__en {
  font-size: clamp(1.05rem, 1.35vw, 1.3rem);
  line-height: 1.3;
}
.vw-caption.is-compact .vw-word__zh {
  font-size: 10px;
  max-width: 4.5em;
}
.vw-caption.is-compact .vw-caption-zh {
  margin-top: 0.3rem;
  padding-top: 0.35rem;
  font-size: clamp(1rem, 1.2vw, 1.15rem);
  line-height: 1.4;
}
.vw-caption.is-compact-zh .vw-word__zh { display: none; }

/* Between-sentence hold: keep last caption visible while video plays through a gap */
.video-watch-shell.is-line-gap .vw-caption {
  opacity: 0.88;
}

/* Bottom control bar */
.video-watch-controls {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  min-height: 3.25rem;
  padding: 0.55rem 0.85rem 0.65rem;
  border-top: 1px solid rgb(38 38 42);
  background: #0f141b;
}

.vw-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 0.45rem;
  color: #e5e7eb;
  background: transparent;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
}
.vw-btn:hover:not(:disabled) { background: rgb(255 255 255 / 0.08); color: var(--vw-accent); }
.vw-btn:disabled { opacity: 0.35; cursor: default; }
.vw-btn.hidden,
.vw-icon-play.hidden,
.vw-icon-pause.hidden,
.vw-icon-vol.hidden,
.vw-icon-muted.hidden,
.vw-icon-fs.hidden,
.vw-icon-fs-exit.hidden { display: none; }

.vw-chip {
  width: auto;
  min-width: 2.4rem;
  padding: 0 0.55rem;
  font-size: 0.78rem;
  font-weight: 700;
}

.vw-time {
  font-size: 0.72rem;
  color: #9ca3af;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  min-width: 5.6rem;
  flex-shrink: 0;
}

.vw-progress-track {
  position: relative;
  flex: 1;
  height: 0.38rem;
  border-radius: 999px;
  background: rgb(55 65 81);
  cursor: pointer;
  overflow: visible;
  min-width: 4rem;
}

.vw-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #0ea5e9 0%, #38bdf8 70%, #2dd4bf 100%);
  border-radius: inherit;
}

.vw-progress-ticks {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.vw-tick {
  position: absolute;
  top: -2px;
  width: 2px;
  height: calc(100% + 4px);
  background: rgb(255 255 255 / 0.35);
  transform: translateX(-50%);
  border-radius: 1px;
}

.vw-counter {
  font-size: 0.72rem;
  color: #9ca3af;
  font-variant-numeric: tabular-nums;
  min-width: 2.6rem;
  text-align: right;
  flex-shrink: 0;
}

.vw-menu-wrap {
  position: relative;
  flex-shrink: 0;
}

.vw-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.45rem);
  z-index: 40;
  min-width: 6.5rem;
  padding: 0.35rem;
  border-radius: 0.65rem;
  border: 1px solid rgb(55 65 81);
  background: #1c1c1f;
  box-shadow: 0 12px 30px rgb(0 0 0 / 0.35);
}
.vw-menu--wide { min-width: 9.5rem; }
.vw-menu[hidden] { display: none; }

.vw-menu > button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.45rem 0.65rem;
  border: none;
  border-radius: 0.4rem;
  background: transparent;
  color: #e5e7eb;
  font-size: 0.82rem;
  cursor: pointer;
}
.vw-menu > button:hover { background: var(--vw-accent-soft); color: var(--vw-accent-text); }

.vw-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.55rem;
  font-size: 0.8rem;
  color: #e5e7eb;
  cursor: pointer;
  border-radius: 0.4rem;
}
.vw-toggle:hover { background: rgb(255 255 255 / 0.06); }
.vw-toggle input { accent-color: var(--vw-accent); }

.video-watch-sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-top: 1px solid rgb(38 38 42);
  background: #0f141b;
}
.video-watch-sidebar[hidden] { display: none !important; }

@media (min-width: 900px) {
  .video-watch-sidebar {
    border-top: none;
    border-left: 1px solid rgb(38 38 42);
  }
}

.video-watch-sidebar-head {
  flex-shrink: 0;
  padding: 0.75rem 0.9rem 0.4rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: #e5e7eb;
}

.video-watch-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  list-style: none;
  margin: 0;
  padding: 0.25rem 0.45rem 1rem;
}

.video-watch-item {
  display: grid;
  grid-template-columns: 2.75rem 1fr;
  grid-template-rows: auto auto;
  column-gap: 0.55rem;
  row-gap: 0.15rem;
  padding: 0.6rem 0.65rem;
  border-radius: 0.65rem;
  cursor: pointer;
  margin-bottom: 0.15rem;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.video-watch-item:hover { background: rgb(255 255 255 / 0.04); }
.video-watch-item.is-active {
  background: rgba(56, 189, 248, 0.16);
  border-color: rgba(56, 189, 248, 0.65);
  box-shadow: inset 3px 0 0 #38bdf8;
}
.video-watch-item.is-active.is-playing {
  background: rgba(56, 189, 248, 0.26);
}
.video-watch-item.is-active .video-watch-item-en {
  color: #e0f2fe;
}

.video-watch-item-time {
  grid-row: 1 / span 2;
  font-size: 0.7rem;
  color: #6b7280;
  padding-top: 0.15rem;
  font-variant-numeric: tabular-nums;
}
.video-watch-item.is-active .video-watch-item-time {
  color: var(--vw-accent-muted);
  font-weight: 700;
}

.video-watch-item-en {
  font-size: 0.92rem;
  font-weight: 650;
  color: #f9fafb;
  line-height: 1.35;
}

.video-watch-item-zh {
  font-size: 0.78rem;
  color: #9ca3af;
  line-height: 1.35;
}

/* Practice page — default small strip for non-video / fallback */
.phrase-video-stage {
  display: none;
  width: 100%;
  max-width: 48rem;
  margin: 0 auto 0.75rem;
  border-radius: 0.85rem;
  overflow: hidden;
  background: #000;
  aspect-ratio: 16 / 9;
  max-height: 36vh;
}
.phrase-video-stage.is-visible { display: block; }
.phrase-video-frame {
  width: 100%;
  height: 100%;
}
.phrase-video-stage video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.phrase-practice-dock {
  width: 100%;
}

/*
 * Video lesson 中译英 — match 参考产品 immersive:
 * video wrap flex:1, practice dock min(38vh, 22rem)
 */
#phrase-practice-shell.is-video-lesson main > .relative.flex.min-h-0.flex-1 {
  min-height: 0;
}

#phrase-practice-shell.is-video-lesson .phrase-hud-row,
#phrase-practice-shell.is-video-lesson #phrase-combo-slot {
  display: none;
}

#phrase-practice-shell.is-video-lesson #phrase-question-view {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
  padding-bottom: 0;
}

#phrase-practice-shell.is-video-lesson .phrase-practice-body {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  max-width: none;
  justify-content: stretch;
  align-items: stretch;
  gap: 0;
}

#phrase-practice-shell.is-video-lesson .phrase-video-stage.is-visible {
  position: relative;
  display: flex;
  flex: 1 1 0%;
  min-height: 0;
  max-height: none;
  max-width: none;
  width: 100%;
  margin: 0;
  aspect-ratio: auto;
  border-radius: 0;
  background: transparent;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.5rem 0;
  overflow: hidden;
  /* Prevent dock paint/layout from affecting this box */
  contain: layout style;
  isolation: isolate;
}

#phrase-practice-shell.is-video-lesson .phrase-video-frame {
  position: absolute;
  /* Prefer left/top px from pinVideoChrome — avoid translate() with live video
     (compositor jitter when seek + answer swap happen together). */
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  /* Prefer JS-pinned px size; CSS fallback keeps aspect */
  height: calc(100% - 0.5rem);
  width: auto;
  max-width: calc(100% - 1rem);
  max-height: calc(100% - 0.5rem);
  aspect-ratio: 16 / 9;
  border-radius: 0.5rem;
  overflow: hidden;
  background: #000;
  backface-visibility: hidden;
  contain: paint;
}

#phrase-practice-shell.is-video-lesson .phrase-video-frame.is-pinned {
  transform: none;
}

#phrase-practice-shell.is-video-lesson .phrase-video-stage video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  /* Keep decoded frames from causing compositor jumps */
  transform: translateZ(0);
}

/*
 * 参考产品 immersive-desktop-dock:
 *   h-[min(38vh,22rem)]  py-2 px-4  flex justify-center
 *   inner card my-auto  (vertically centered — this is the gap under video)
 * Chinese stays outside the swap slot so submit cannot move it.
 */
#phrase-practice-shell.is-video-lesson .phrase-practice-dock {
  --phrase-practice-dock-h: min(38vh, 22rem);
  position: relative;
  flex: 0 0 var(--phrase-practice-dock-h);
  flex-grow: 0;
  flex-shrink: 0;
  height: var(--phrase-practice-dock-h);
  min-height: var(--phrase-practice-dock-h);
  max-height: var(--phrase-practice-dock-h);
  width: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* 参考产品's my-auto gap ≈ 121px under the video. Top-pad (not centering)
     so a taller answer slot cannot steal that space. */
  justify-content: flex-start;
  padding: 7.5rem 1rem 0.5rem;
  box-sizing: border-box;
  contain: layout style;
}

#phrase-practice-shell.is-video-lesson .phrase-dock-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 100%;
  flex: 0 0 auto;
}

/* 参考产品 .practice-question-prompt: text-xl md:text-3xl / 400 / 36px, mb 0.75rem */
#phrase-practice-shell.is-video-lesson #phrase-zh {
  margin: 0 0 0.75rem;
  font-size: 1.875rem;
  font-weight: 400;
  line-height: 2.25rem;
  color: #f9fafb;
  flex: 0 0 auto;
}

/* Locked slot — blanks and answer share the same box, no height change on submit */
#phrase-practice-shell.is-video-lesson .phrase-dock-slot {
  position: relative;
  width: 100%;
  height: 8.75rem;
  min-height: 8.75rem;
  max-height: 8.75rem;
  flex: 0 0 8.75rem;
  overflow: hidden;
}

#phrase-practice-shell.is-video-lesson .phrase-dock-practice,
#phrase-practice-shell.is-video-lesson .phrase-dock-completion {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0;
  box-sizing: border-box;
  overflow: hidden;
  text-align: center;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: none;
}

#phrase-practice-shell.is-video-lesson .phrase-dock-practice.is-hidden,
#phrase-practice-shell.is-video-lesson .phrase-dock-completion.is-hidden,
#phrase-practice-shell.is-video-lesson .phrase-dock-completion.hidden,
#phrase-practice-shell.is-video-lesson .phrase-dock-practice.hidden {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  display: flex !important;
}

/* 参考产品 blanks: 48px / 66px, no IPA/gloss under the line.
   Completed words use .jlb-letter-compact (taller by default) — lock it to the
   same 3rem slot box so every underline shares one baseline. */
#phrase-practice-shell.is-video-lesson .phrase-dictation-blanks {
  margin-top: 0 !important;
  min-height: 4.125rem;
  align-items: flex-end !important;
  /* Never let the fixed-height dock flex-shrink this box — offsetHeight must
     stay the natural content height so fitDockBlanks can measure overflow
     (a shrunk box reported "fits" and long lines were clipped untypeable). */
  flex: 0 0 auto;
}
/* --jlb-dock-font (set by fitDockBlanks) shrinks letters + slots together so
   long sentences wrap sooner and stay fully typable inside the fixed dock. */
#phrase-practice-shell.is-video-lesson .jlb-blank {
  font-size: var(--jlb-dock-font, 3rem) !important;
  font-weight: 400 !important;
  min-height: calc(var(--jlb-dock-font, 3rem) * 1.375) !important;
  height: calc(var(--jlb-dock-font, 3rem) * 1.375) !important;
  padding: 0 calc(var(--jlb-dock-font, 3rem) * 0.25) 0 !important;
  margin-bottom: 0 !important;
}
#phrase-practice-shell.is-video-lesson .jlb-blank.has-letter-slots {
  min-height: calc(var(--jlb-dock-font, 3rem) * 1.375) !important;
  height: calc(var(--jlb-dock-font, 3rem) * 1.375) !important;
  padding: 0 calc(var(--jlb-dock-font, 3rem) * 0.25) 0 !important;
  justify-content: flex-end;
  overflow: visible;
}
#phrase-practice-shell.is-video-lesson .jlb-blank.has-letter-slots .jlb-typed,
#phrase-practice-shell.is-video-lesson .jlb-blank.has-letter-slots .jlb-letter-row {
  height: var(--jlb-dock-font, 3rem);
  min-height: var(--jlb-dock-font, 3rem);
  align-items: stretch;
}
#phrase-practice-shell.is-video-lesson .jlb-letter-slot,
#phrase-practice-shell.is-video-lesson .jlb-letter-compact {
  min-width: calc(var(--jlb-dock-font, 3rem) * 0.52) !important;
  height: var(--jlb-dock-font, 3rem) !important;
  min-height: var(--jlb-dock-font, 3rem) !important;
  padding: 0 0.08rem 0 !important;
  border-bottom-width: 3px !important;
  box-sizing: border-box !important;
  align-items: flex-end;
}
#phrase-practice-shell.is-video-lesson .jlb-letter-compact {
  font-size: var(--jlb-dock-font, 3rem) !important;
  font-weight: 400 !important;
  gap: 0.18rem;
}
#phrase-practice-shell.is-video-lesson .jlb-letter-glyph,
#phrase-practice-shell.is-video-lesson .jlb-letter-compact-glyph {
  font-size: var(--jlb-dock-font, 3rem) !important;
  font-weight: 400 !important;
  line-height: 1 !important;
}
#phrase-practice-shell.is-video-lesson .jlb-letter-slot .jlb-caret {
  height: calc(var(--jlb-dock-font, 3rem) * 0.8) !important;
  bottom: 3px !important;
}
#phrase-practice-shell.is-video-lesson .jlb-token-meta {
  display: none;
}
#phrase-practice-shell.is-video-lesson .letter-match-line {
  height: 3px;
  transform: none !important;
  animation: none !important;
}

/* 参考产品 in-dock answer: compact IPA 12 / word 24 medium / gloss 12 / POS 10 */
#phrase-practice-shell.is-video-lesson .phrase-dock-completion .grammar-card-grid--completion {
  gap: 0.75rem 0.875rem;
  max-width: min(96vw, 68rem);
  align-items: flex-end;
}
#phrase-practice-shell.is-video-lesson .phrase-dock-completion .grammar-group {
  padding-top: 0.55rem;
}
#phrase-practice-shell.is-video-lesson .phrase-dock-completion .grammar-group__body {
  padding: 0.55rem 0.55rem 0.4rem;
  min-height: 0;
  border-radius: 0.875rem;
}
#phrase-practice-shell.is-video-lesson .phrase-dock-completion .grammar-group__tokens {
  gap: 0.35rem 0.55rem;
}
#phrase-practice-shell.is-video-lesson .phrase-dock-completion .grammar-group__word {
  font-size: 1.5rem;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0;
}
#phrase-practice-shell.is-video-lesson .phrase-dock-completion .grammar-group__ipa {
  font-size: 0.75rem;
  min-height: 0.75rem;
  color: rgb(148 163 184);
}
#phrase-practice-shell.is-video-lesson .phrase-dock-completion .grammar-group__zh {
  font-size: 0.75rem;
  font-weight: 500;
  color: rgb(209 213 219);
}
#phrase-practice-shell.is-video-lesson .phrase-dock-completion .grammar-group__pos {
  font-size: 10px;
  font-weight: 400;
  color: rgb(156 163 175);
}
#phrase-practice-shell.is-video-lesson .phrase-dock-completion .grammar-group__badge {
  font-size: 9px;
  font-weight: 500;
  padding: 0.12rem 0.4rem;
  letter-spacing: 1px;
}
#phrase-practice-shell.is-video-lesson .phrase-completion-zh--dock {
  display: none;
}

#phrase-practice-shell.is-video-lesson .phrase-video-frame .practice-combo-host {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  overflow: visible;
}

/* Footer: reserve countdown width so Enter label swap cannot reflow */
#phrase-practice-shell.is-video-lesson #phrase-primary-countdown {
  display: inline-block;
  min-width: 2.25rem;
  text-align: left;
  /* Never display:none — keep geometry identical when countdown appears */
  visibility: visible;
}
#phrase-practice-shell.is-video-lesson #phrase-primary-countdown.hidden,
#phrase-practice-shell.is-video-lesson #phrase-primary-countdown:empty {
  visibility: hidden !important;
  display: inline-block !important;
  min-width: 2.25rem;
}

/* Progress bar width change must not animate layout-adjacent chrome */
#phrase-practice-shell.is-video-lesson #phrase-progress-bar {
  transition: none !important;
}

@media (max-width: 899px) {
  .video-watch-player-wrap {
    margin: 0.25rem 0.3rem 0.1rem;
  }
  .video-watch-stage {
    padding: 6px 8px 0;
  }
  .vw-caption {
    padding: 0.25rem 0.5rem 0.4rem;
  }
  .video-watch-sidebar {
    max-height: 28vh;
  }
  #phrase-practice-shell.is-video-lesson .phrase-practice-dock {
    --phrase-practice-dock-h: min(42vh, 20rem);
    padding-top: 3.25rem;
  }
}
