/* Subtwine styles — one material's page (R6): its head with the watch and
   learn steps, the two columns, the player card with the transport under the
   picture, the subtitle settings popover, the burned-in subtitle mask and the
   tool row.
   Loaded from index.html in the order web_manifest.py declares. */
.work {
  padding:0 20px 20px;
}
.work-head {
  display:flex;
  align-items:center;
  gap:14px;
  padding:12px 0;
  min-width:0;
  flex-wrap:wrap;
}
.work-head .back {
  padding:0 10px 0 6px;
  flex:none;
}
.work-title {
  min-width:0;
  flex:1 1 240px;
}
.work-title h1 {
  font-size:16px;
  font-weight:650;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.work-meta {
  display:flex;
  gap:6px;
  flex-wrap:wrap;
  margin-top:3px;
  min-width:0;
}
/* The subtitle languages may be many: they cut at the edge with an ellipsis
   (the full list is the title), which a flex container would not do. */
#material-targets {
  display:block;
  min-width:0;
}
.pill {
  display:inline-flex;
  align-items:center;
  gap:5px;
  font-size:11.5px;
  padding:1px 8px;
  border-radius:99px;
  background:var(--surface-2);
  color:var(--ink-2);
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.work-nav {
  display:flex;
  align-items:center;
  gap:8px;
  flex:none;
  min-width:0;
}
.steps {
  display:flex;
  gap:4px;
  padding:3px;
  border-radius:11px;
  background:var(--surface-2);
  flex:none;
}
.steps a {
  display:inline-flex;
  align-items:center;
  gap:7px;
  height:34px;
  padding:0 14px 0 10px;
  border-radius:8px;
  font-size:13.5px;
  color:var(--ink-2);
  white-space:nowrap;
}
.steps a:hover {
  color:var(--ink);
}
.steps a[aria-selected=true] {
  background:var(--seg-on);
  color:var(--ink);
  box-shadow:var(--seg-shadow);
  font-weight:600;
}
.steps a[aria-selected=true] .i {
  color:var(--accent);
}
.work-nav .btn.soft {
  height:40px;
  border-radius:10px;
}

/* ---- the two columns ---- */
.workbench {
  display:grid;
  grid-template-columns:minmax(0,1fr) 380px;
  gap:20px;
  align-items:start;
}
.study-column {
  min-width:0;
  display:grid;
  gap:12px;
  align-content:start;
}

/* ---- the player ---- */
.player-card {
  border:1px solid var(--line);
  border-radius:14px;
  overflow:hidden;
  background:var(--surface);
}
.stage {
  position:relative;
  background:var(--player);
  aspect-ratio:var(--ar,16 / 9);
  max-height:calc(100vh - 250px);
  width:100%;
  overflow:hidden;
  container-type:inline-size;
}
.stage video {
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit:contain;
  display:block;
  background:var(--player);
}
.audio-art {
  position:absolute;
  inset:0;
  display:grid;
  place-items:center;
  align-content:center;
  /* The play button sits in the gap between the wave and its line. */
  gap:84px;
  color:rgba(255,255,255,.7);
  background:linear-gradient(135deg,color-mix(in srgb,var(--accent) 55%,#000),#101122);
  pointer-events:none;
}
.audio-art .wave {
  display:flex;
  gap:4px;
  align-items:center;
  height:44px;
}
.audio-art .wave i {
  display:block;
  width:4px;
  border-radius:2px;
  background:rgba(255,255,255,.75);
  height:14px;
}
.audio-art .wave i:nth-child(2n) {height:30px;}
.audio-art .wave i:nth-child(3n) {height:40px;}
.audio-art .wave i:nth-child(5n) {height:22px;}
.audio-art p {
  margin:0;
  font-size:12px;
  letter-spacing:.04em;
}
.big-play {
  position:absolute;
  left:50%;
  top:50%;
  transform:translate(-50%,-50%);
  width:58px;
  height:58px;
  border-radius:50%;
  background:rgba(255,255,255,.92);
  color:#111;
  display:grid;
  place-items:center;
  box-shadow:0 6px 24px rgba(0,0,0,.35);
  z-index:4;
}
.big-play:hover {
  background:#fff;
}
.big-play span {
  margin-inline-start:3px;
}
.stage.playing .big-play {
  opacity:0;
  pointer-events:none;
}
.stage.playing:focus-within .big-play:focus-visible {
  opacity:1;
}

/* The cover for subtitles burned into the picture. Its corner handle is small
   to look at and a full 44px to touch. */
.subtitle-mask {
  position:absolute;
  left:10%;
  top:72%;
  width:80%;
  height:16%;
  background:var(--player);
  z-index:3;
  cursor:move;
  touch-action:none;
  min-width:40px;
  min-height:20px;
}
.subtitle-mask span {
  color:rgba(255,255,255,.45);
  font-size:10px;
  position:absolute;
  top:4px;
  left:6px;
  opacity:0;
  pointer-events:none;
}
.subtitle-mask:hover span,
.subtitle-mask:focus-visible span,
.subtitle-mask.dragging span {
  opacity:1;
}
.subtitle-mask b {
  position:absolute;
  right:0;
  bottom:0;
  width:14px;
  height:14px;
  border-right:2px solid rgba(255,255,255,.5);
  border-bottom:2px solid rgba(255,255,255,.5);
  cursor:nwse-resize;
}
.subtitle-mask b::after {
  content:"";
  position:absolute;
  right:-15px;
  bottom:-15px;
  width:44px;
  height:44px;
}

/* ---- the transport ---- */
.controls {
  display:flex;
  align-items:center;
  gap:6px;
  padding:8px 10px;
  border-top:1px solid var(--line-soft);
  min-width:0;
  position:relative;
}
.time {
  font-size:12.5px;
  color:var(--ink-2);
  font-variant-numeric:tabular-nums;
  white-space:nowrap;
}
.time em {
  font-style:normal;
  color:var(--muted);
}
.seek {
  appearance:none;
  -webkit-appearance:none;
  flex:1 1 auto;
  min-width:40px;
  height:16px;
  background:transparent;
}
.seek::-webkit-slider-runnable-track {
  height:4px;
  border-radius:2px;
  background:linear-gradient(to right,
    var(--accent) var(--seek-played,0%),
    var(--line-strong) var(--seek-played,0%));
}
.seek::-webkit-slider-thumb {
  appearance:none;
  -webkit-appearance:none;
  width:12px;
  height:12px;
  margin-top:-4px;
  border:0;
  border-radius:50%;
  background:var(--accent);
  box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 25%,transparent);
}
.seek:disabled::-webkit-slider-thumb {
  opacity:0;
}
.mini-sel {
  height:30px;
  border:1px solid var(--line);
  border-radius:7px;
  background:var(--surface);
  padding:0 6px;
  font-size:12.5px;
  max-width:100%;
}
.aa {
  font-weight:700;
  font-size:13px;
}
.cap-set-wrap {
  position:relative;
}
.cap-set {
  position:absolute;
  inset-inline-end:-40px;
  bottom:40px;
  width:310px;
  max-width:calc(100vw - 40px);
  padding:12px 14px;
  display:grid;
  gap:10px;
}
.cs-row {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  font-size:13px;
  color:var(--ink-2);
}
.cs-row input[type=range] {
  flex:1;
  max-width:150px;
}
.cs-actions {
  display:flex;
  justify-content:flex-end;
}

/* ---- the tool row ---- */
.tool-row {
  display:flex;
  align-items:center;
  gap:6px;
  flex-wrap:wrap;
}
.tool {
  display:inline-flex;
  align-items:center;
  gap:6px;
  min-height:32px;
  padding:0 11px;
  border-radius:8px;
  font-size:13px;
  color:var(--ink-2);
  border:1px solid transparent;
  cursor:pointer;
}
.tool:hover:not(:disabled) {
  background:var(--hover);
  color:var(--ink);
}
.tool[aria-pressed=true],
.tool-switch:has(input:checked) {
  background:var(--accent-soft);
  color:var(--accent-ink);
}
.tool-switch input {
  position:absolute;
  opacity:0;
  width:1px;
  height:1px;
}
.tool-switch:has(input:focus-visible) {
  outline:2px solid var(--accent);
  outline-offset:2px;
}
.kbd-hint {
  display:inline-flex;
  align-items:center;
  gap:6px;
  font-size:12px;
  color:var(--faint);
  padding:0 8px;
}
.next-step {
  margin-inline-start:auto;
  color:var(--accent);
  font-weight:600;
}
.mode-dictation .tool-row {
  display:none;
}

/* ---- the expanded stage ---- */
.stage.expanded {
  position:fixed;
  inset:0;
  z-index:95;
  width:100vw;
  height:100vh;
  max-height:none;
  aspect-ratio:auto;
}
.fullscreen-exit {
  position:absolute;
  right:18px;
  top:15px;
  z-index:15;
  color:#fff;
  background:rgba(0,0,0,.5);
  padding:10px 15px;
}

@media (max-width:1100px) {
  .workbench {
    grid-template-columns:minmax(0,1fr) 320px;
  }
}
@media (max-width:900px) {
  .workbench {
    grid-template-columns:minmax(0,1fr);
  }
  .stage {
    max-height:none;
  }
  .work-nav {
    order:5;
    width:100%;
  }
  .steps {
    flex:1;
  }
  .steps a {
    flex:1;
    justify-content:center;
  }
}
@media (max-width:640px) {
  .work {
    padding:0 12px 16px;
  }
  .work-head {
    gap:8px;
  }
  .work-head .back span:not(.i) {
    display:none;
  }
  .steps a {
    padding:0 8px;
    gap:5px;
    font-size:13px;
  }
  /* T033 review H2: the row of the two steps, Export and More must fit any
     interface language. The steps share what is left and, if a label is
     still too long, shorten it with an ellipsis; Export keeps its icon and its name for
     assistive technology (and as its tooltip) but not its visible label;
     More never shrinks, so it always stays on screen. */
  .work-nav {
    min-width:0;
  }
  .steps {
    flex:1 1 auto;
    min-width:0;
  }
  .steps a {
    flex:1 1 auto;
    min-width:0;
  }
  .steps a > span[data-i18n] {
    min-width:0;
    overflow:hidden;
    text-overflow:ellipsis;
  }
  .steps a .i,
  .steps a .lock-tag {
    flex:none;
  }
  #export-button {
    position:relative;
    flex:none;
    padding-inline:10px;
  }
  #export-button > span[data-i18n] {
    position:absolute;
    width:1px;
    height:1px;
    overflow:hidden;
    clip:rect(0 0 0 0);
    clip-path:inset(50%);
    white-space:nowrap;
  }
  #top-more-button {
    flex:none;
  }
  .big-play {
    width:44px;
    height:44px;
  }
  .controls {
    flex-wrap:wrap;
    gap:4px;
  }
  .controls .seek {
    order:10;
    flex-basis:100%;
  }
  .kbd-hint {
    display:none;
  }
  .cap-set {
    position:fixed;
    left:16px;
    right:16px;
    bottom:16px;
    width:auto;
    max-width:none;
  }
}
@media (max-width:420px) {
  /* On a phone the two steps keep their words, not their pictures (T033). */
  .steps a > .i {
    display:none;
  }
}
