#visual-stage { --vc-width: min(100%, 56rem, max(23rem, calc((100svh - 14.5rem) * 2))); }
#visual-stage .stage-heading, .vc-stage { width: var(--vc-width, min(100%, 56rem)); margin-inline: auto; }
.vc-stage {
  --vc-accent: #72ead5;
  --vc-border: #294454;
  display: grid;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--vc-border);
  border-radius: 14px;
  background: #0b1723;
  box-shadow: 0 20px 55px #03081055;
}
.vc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 10px clamp(12px, 2vw, 22px);
  background: linear-gradient(115deg, #142e3b, #101f2d 63%, #0d1b29);
  border-bottom: 1px solid var(--vc-border);
}
.vc-programme { min-width: 0; }
.vc-programme h3 {
  margin: 4px 0 0;
  color: #f3f8fc;
  font-size: clamp(17px, 3.1vw, 28px);
  line-height: 1.14;
  letter-spacing: -.04em;
}
.vc-eyebrow, .vc-playlist-heading, .vc-lesson-number, .vc-lesson-duration, .vc-time {
  font: 650 11px/1.2 ui-monospace, "Cascadia Mono", monospace;
  letter-spacing: .07em;
}
.vc-eyebrow { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; color: #aec1d0; text-transform: uppercase; }
.vc-divider { width: 1px; height: 10px; background: #456171; }
.vc-signal { width: 6px; height: 6px; border-radius: 50%; background: #849bab; }
.vc-stage[data-playback="playing"] .vc-signal {
  background: var(--vc-accent);
  box-shadow: 0 0 9px #72ead58c;
}
.vc-playlist { min-width: 0; width: min(43%, 16.5rem); }
.vc-playlist-heading {
  display: flex;
  justify-content: space-between;
  gap: 5px;
  margin-bottom: 4px;
  color: #aec1d0;
  text-transform: uppercase;
}
.vc-playlist-heading span:last-child { color: var(--vc-accent); }
.vc-lesson {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 38px;
  padding: 5px 8px;
  border: 1px solid #3c6a70;
  border-radius: 8px;
  background: #153039;
  color: #edf6fd;
  font: 650 12px/1.2 system-ui, sans-serif;
  text-align: left;
  transition: background-color .18s ease, border-color .18s ease;
}
.vc-lesson:hover:enabled { background: #204651; border-color: #78cfca; }
.vc-lesson:disabled { cursor: default; }
.vc-lesson-number {
  padding: 3px 4px;
  border-radius: 4px;
  background: #1c4448;
  color: var(--vc-accent);
}
.vc-lesson-duration { color: #adc8d2; }
.vc-media { min-width: 0; min-height: 0; background: #091620; }
.vc-media video { display: block; width: 100%; height: auto; aspect-ratio: 1228 / 594; object-fit: contain; background: #091620; }
.vc-controls {
  display: grid;
  grid-template-columns: auto minmax(38px, 1fr) auto auto;
  align-items: center;
  gap: clamp(6px, 1.35vw, 17px);
  padding: 8px clamp(10px, 2.4vw, 27px);
  border-top: 1px solid var(--vc-border);
  background: #101f2d;
}
.vc-stage [hidden] { display: none; }
.vc-controls button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  gap: 5px;
  padding: 0 10px;
  border: 1px solid #39586a;
  border-radius: 8px;
  background: #172e3e;
  color: #eff7fc;
  font: 650 13px/1 system-ui, sans-serif;
  cursor: pointer;
  transition: background-color .18s ease, border-color .18s ease, transform .18s ease;
}
.vc-controls button:hover { background: #22495a; border-color: #78cfca; }
.vc-controls button:active { transform: scale(.96); }
.vc-controls button:focus-visible, .vc-seek:focus-visible, .vc-lesson:focus-visible { outline: 2px solid var(--vc-accent); outline-offset: 3px; }
.vc-controls button svg { width: 19px; height: 19px; }
.vc-controls .vc-play { min-width: 86px; color: #092820; background: #8cebd8; border-color: #8cebd8; }
.vc-controls .vc-play:hover { background: #b2f5e9; }
.vc-controls .vc-fullscreen { width: 40px; padding: 0; }
.vc-pause-icon, .vc-play[aria-label^="Pause "] .vc-play-icon { display: none; }
.vc-play[aria-label^="Pause "] .vc-pause-icon { display: block; }
.vc-seek { display: block; min-width: 0; width: 100%; min-height: 32px; margin: 0; accent-color: var(--vc-accent); cursor: pointer; }
.vc-seek:disabled { opacity: .58; cursor: default; }
.vc-time { color: #e6f1f9; font-variant-numeric: tabular-nums; white-space: nowrap; }
.vc-time-separator, #vc-duration { color: #9bb0bf; }
.vc-stage:is(:fullscreen, [data-expanded]) {
  width: 100%;
  height: 100%;
  grid-template-rows: auto minmax(0, 1fr) auto;
  border: 0;
  border-radius: 0;
}
.vc-stage:is(:fullscreen, [data-expanded]) .vc-media video { height: 100%; }
.vc-stage[data-expanded] { position: fixed; inset: 0; z-index: 100; }
body:has(.vc-stage[data-expanded]) { overflow: hidden; }
@media(max-width: 420px) {
  .vc-header { flex-wrap: wrap; padding: 10px; gap: 8px; }
  .vc-playlist { width: 100%; }
  .vc-eyebrow, .vc-playlist-heading, .vc-lesson-number, .vc-lesson-duration, .vc-time { font-size: 10px; letter-spacing: 0; }
  .vc-controls .vc-play { min-width: 62px; padding: 0 5px; }
  .vc-controls .vc-fullscreen { width: 36px; }
}
@media(prefers-reduced-motion: reduce) {
  .vc-controls button, .vc-lesson { transition: none; }
  .vc-controls button:active { transform: none; }
}

/* Controlled widening within the existing page grid; no shell/player changes. */
@media(min-width:900px) { #visual-stage { --vc-width:min(92%,74rem); } }

/* Compact workstation chrome. The lesson canvas receives the saved height. */
.vc-header { min-height:54px; padding:7px 14px; gap:10px; background:#10232f; }
.vc-programme h3 { font-size:clamp(16px,1.65vw,20px); line-height:1.2; margin:3px 0 0; letter-spacing:-.025em; }
.vc-eyebrow { font-size:9px; letter-spacing:.08em; }
.vc-navigation { min-width:0; border-bottom:1px solid #294454; background:#0c1c28; }
.vc-desktop-rail { display:grid; grid-template-columns:28px minmax(0,1fr) 28px; align-items:stretch; height:54px; }
.vc-desktop-rail>button { padding:0; border:0; background:transparent; color:#a3bdca; font:22px/1 system-ui,sans-serif; cursor:pointer; }
.vc-desktop-rail>button:disabled { opacity:.23; cursor:default; }
.vc-playlist { display:flex; width:100%; min-width:0; gap:0; overflow-x:auto; scrollbar-width:none; overscroll-behavior-x:contain; scroll-snap-type:x proximity; }
.vc-playlist::-webkit-scrollbar { display:none; }
.vc-lesson { flex:0 0 clamp(156px,20%,210px); width:auto; min-width:0; min-height:0; padding:7px 10px; gap:8px; border:0!important; border-bottom:2px solid transparent!important; border-radius:0; background:transparent!important; box-shadow:none; scroll-snap-align:start; }
.vc-lesson+.vc-lesson { margin-top:0!important; }
.vc-lesson[aria-current] { border-bottom-color:#72ead5!important; background:#16333d!important; }
.vc-lesson:hover:enabled { background:#142b36!important; }
.vc-lesson:disabled { opacity:.48; }
.vc-lesson-copy { display:grid; min-width:0; gap:3px; }
.vc-lesson-name { font:650 12px/1.15 system-ui,sans-serif; white-space:nowrap; }
.vc-lesson-meta { color:#9cb5c4; font:9px/1.2 system-ui,sans-serif; white-space:nowrap; }
.vc-lesson-number { color:#84b8ba; background:transparent; border:0; padding:0; font:600 10px ui-monospace,monospace; }
.vc-lesson[data-lesson-state="COMPLETED"] .vc-lesson-number { color:#a5c9bc; }
.vc-controls { height:52px; padding:4px 12px; gap:10px; }
.vc-controls button { min-height:34px; border-radius:5px; padding-inline:8px; font-size:11px; }
.vc-controls .vc-play { min-width:73px; background:#21443f; color:#c0f4e6; border-color:#45736b; }
.vc-controls .vc-play:hover { background:#2a5951; }
.vc-controls .vc-fullscreen { width:34px; }
.vc-controls button svg { width:16px; height:16px; }
.vc-time { font-size:10px; letter-spacing:0; }
.vc-seek { min-height:30px; }
.vc-mobile-selector { display:none; }
.vc-lesson-sheet { position:fixed; inset:auto 8px 12px; width:min(460px,calc(100% - 16px)); max-height:min(72svh,600px); margin:0 auto; padding:0; border:1px solid #3c596a; border-radius:10px; background:#0d202d; color:#dcecf4; box-shadow:0 20px 80px #0008; }
.vc-lesson-sheet::backdrop { background:#020c15aa; }
.vc-sheet-header { display:flex; justify-content:space-between; align-items:center; padding:12px 14px; border-bottom:1px solid #294454; font-size:12px; }
.vc-sheet-header button { border:0; background:transparent; color:#c5d9e4; font-size:20px; padding:0 6px; cursor:pointer; }
.vc-sheet-list { max-height:calc(72svh - 60px); overflow:auto; padding:4px 0; }
.vc-sheet-list button { display:grid; grid-template-columns:25px 1fr; align-items:center; gap:3px 8px; width:100%; padding:12px 16px; border:0; border-left:2px solid transparent; background:transparent; color:#dcecf4; text-align:left; cursor:pointer; }
.vc-sheet-list button[aria-current] { border-left-color:#72ead5; background:#17353e; }
.vc-sheet-list button:disabled { opacity:.5; cursor:default; }
.vc-sheet-list .vc-lesson-meta { grid-column:2; }
.vc-sheet-title { font-size:13px; font-weight:600; }
.vc-navigation button:focus-visible { outline:2px solid #72ead5; outline-offset:-3px; }
.vc-stage:is(:fullscreen,[data-expanded]) { grid-template-rows:auto auto minmax(0,1fr) auto; }
@media(max-width:640px) {
 .vc-header { flex-wrap:nowrap; padding:7px 10px; min-height:52px; }
 .vc-programme h3 { font-size:16px; }
 .vc-desktop-rail { display:none; }
 .vc-mobile-selector { display:block; width:100%; height:38px; padding:0 10px; border:0; background:#0c1c28; color:#a3d6d2; text-align:left; font:600 11px/1.2 ui-monospace,monospace; cursor:pointer; }
 .vc-controls { height:48px; padding:4px 9px; gap:7px; }
 .vc-controls .vc-play { min-width:63px; }
 .vc-controls .vc-fullscreen { width:32px; }
}
@media(prefers-reduced-motion:reduce) { .vc-playlist { scroll-behavior:auto; } }

.vc-header>.vc-playlist { display:none; }
.vc-lesson { flex-basis:clamp(184px,20%,210px); }

/* Final baseline: one responsive outer frame, regardless of lesson adapter. */
#visual-companion {
 --vc-canvas-height:clamp(382px,calc(48svh + 32px),482px);
 --vc-header-height:54px;
 --vc-navigation-height:55px;
 --vc-transport-height:52px;
 height:calc(var(--vc-header-height) + var(--vc-navigation-height) + var(--vc-canvas-height) + var(--vc-transport-height) + 2px);
 grid-template-rows:var(--vc-header-height) var(--vc-navigation-height) minmax(0,1fr) var(--vc-transport-height);
}
#visual-companion>.vc-header { grid-row:1; height:100%; }
#visual-companion>.vc-navigation { grid-row:2; }
#visual-companion>.vc-media, #visual-companion>.vc-topology-lab { grid-row:3; min-height:0; height:100%; }
#visual-companion>.vc-controls { grid-row:4; height:100%; }
#visual-companion .vc-media video { width:100%; height:100%; aspect-ratio:auto; object-fit:contain; }
#visual-companion:is(:fullscreen,[data-expanded]) { height:100%; }
@media(max-width:640px) {
 #visual-companion {
  --vc-canvas-height:clamp(442px,calc(57svh + 32px),522px);
  --vc-header-height:68px;
  --vc-navigation-height:39px;
  --vc-transport-height:48px;
 }
}
