.fred-adaptive-quality,
.fred-video-playback-speed {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  color: inherit;
  font: inherit;
  font-size: 12px;
  white-space: nowrap;
}
.fred-adaptive-quality[hidden] { display: none !important; }
.fred-adaptive-quality select,
[data-fred-video-controls] .fred-adaptive-quality select,
.fred-video-playback-speed select,
[data-fred-video-controls] .fred-video-playback-speed select {
  max-width: 85px;
  min-height: 44px;
  height: 44px;
  padding: 3px 5px;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 6px;
  background: #172335;
  color: #fff;
  font: inherit;
  cursor: pointer;
}
.fred-adaptive-quality select:focus-visible,
.fred-video-playback-speed select:focus-visible { outline: 2px solid #95c7ff; outline-offset: 2px; }
.fred-video-playback-speed { flex: 0 0 auto; }
.fred-video-playback-speed select { min-width: 65px; font-variant-numeric: tabular-nums; }
.fred-video-settings { display:flex; align-items:center; justify-content:flex-end; flex-wrap:wrap; gap:10px; padding:8px 12px; background:#172335; color:#fff; border-radius:0 0 10px 10px; font:500 12px/1.4 system-ui,sans-serif; }
.fred-video-settings:empty { display:none; }
video[hidden] + .fred-video-settings,
video.hide + .fred-video-settings { display:none; }
[data-hover-video-shell] .fred-video-settings,
[data-program-video-shell] .fred-video-settings,
.lcx-start-video-shell .fred-video-settings,
.lcx-speaking-canvas-shell .fred-video-settings { position:absolute; bottom:10px; left:10px; right:auto; z-index:8; padding:4px 8px; border:1px solid #ffffff45; border-radius:10px; background:#172335e8; }
.lcx-speaking-prompt-video.hide + .fred-video-settings { display:none; }
[data-fred-video-controls] .fred-video-controls-actions { flex-wrap:wrap; }
.ks-player-controls .fred-video-playback-speed { order:-1; }
.ks-player-controls .ks-player-actions { flex-wrap:nowrap; }
.fred-adaptive-status {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
@media (max-width: 480px) {
  .fred-adaptive-quality > span,
  .fred-video-playback-speed > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .fred-adaptive-quality select { max-width: 68px; }
}
@container (max-width: 480px) {
  .fred-video-playback-speed > span { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
}
/* The smallest lesson card is only 244px wide on a 320px phone. Keep all
   controls inside the image with two deliberate rows, never a clipped wrap. */
@container (max-width: 280px) {
  .ks-video-host [data-fred-video-controls].ks-player-controls:not([hidden]) { grid-template-columns:44px minmax(0,1fr); grid-template-rows:44px 44px; padding:8px 4px 4px; gap:2px; }
  .ks-player-controls > .ks-player-button { grid-row:1; grid-column:1; }
  .ks-video-host .ks-player-controls .ks-player-seek { grid-row:1; grid-column:2; }
  .ks-video-host .ks-player-controls .ks-player-actions { grid-row:2; grid-column:1/-1; justify-content:flex-end; gap:2px; }
}
