/* Compact controls share the same order and touch targets in every study section. */
.study-player { container-name:study-player; container-type:inline-size; margin: 14px 0 20px; padding: 16px; border: 1px solid #d7a8c44d; border-radius: 12px; background: linear-gradient(125deg,#c68cac0d,#cab9df08); color: inherit; }
.reader > .study-player { margin: 0; padding: 18px 30px; border-width: 0 0 1px; border-radius: 0; border-bottom-color: #d9ccdf; background: linear-gradient(125deg,#fffafd,#f3edf8); color: #63435b; }
.study-player-selection { display:flex; gap:12px; flex-wrap:wrap; align-items:flex-end; }
.study-player-selection > label { display:flex; flex:1 1 260px; flex-direction:column; gap:6px; min-width:0; }
.study-player-selection > label > span { font-size:12px; font-weight:700; opacity:.8; }
.study-player-selection select { width:100%; min-width:0; max-width:100%; height:42px; border:1px solid #b991b45e; border-radius:7px; color:inherit; background:transparent; padding:8px 28px 8px 11px; font:inherit; font-size:13px; }
.study-player select option { color:#4d3347; background:#fff9fc; }
.study-player-progress { min-width:0; margin-top:10px; }
.study-player-seek[type="range"] { display:block; width:100%; min-width:0; height:32px; margin:0; padding:0; border:0; border-radius:4px; appearance:none; -webkit-appearance:none; background:transparent; color:#96577f; accent-color:#96577f; box-shadow:none; cursor:pointer; }
.study-player-seek[type="range"]::-webkit-slider-runnable-track { height:4px; border-radius:4px; background:linear-gradient(to right,#96577f var(--seek-progress,0%),#d8c6d4 var(--seek-progress,0%)); }
.study-player-seek[type="range"]::-webkit-slider-thumb { width:18px; height:18px; margin-top:-7px; border:2px solid #fff9fc; border-radius:50%; appearance:none; -webkit-appearance:none; background:#96577f; box-shadow:0 0 0 1px #96577f; }
.study-player-seek[type="range"]::-moz-range-track { height:4px; border-radius:4px; background:#d8c6d4; }
.study-player-seek[type="range"]::-moz-range-progress { height:4px; border-radius:4px; background:#96577f; }
.study-player-seek[type="range"]::-moz-range-thumb { width:15px; height:15px; border:2px solid #fff9fc; border-radius:50%; background:#96577f; box-shadow:0 0 0 1px #96577f; }
.study-player-seek[type="range"]:disabled { opacity:.35; cursor:default; }
.study-player-seek[type="range"]:focus-visible { outline:3px solid #8cc3b8; outline-offset:2px; }
.study-player-times { display:flex; justify-content:space-between; gap:12px; margin-top:-2px; font-size:11px; font-variant-numeric:tabular-nums; opacity:.8; }
.study-player-transport { display:flex; flex-wrap:nowrap; gap:8px; align-items:center; margin-top:14px; }
.study-player-button { display:inline-flex; align-items:center; justify-content:center; gap:8px; min-width:42px; width:42px; min-height:42px; flex:0 0 42px; padding:8px; border:1px solid #b991b45e; border-radius:8px; background:transparent; color:inherit; cursor:pointer; font:inherit; }
.study-player-button.study-player-play { width:auto; min-width:126px; flex:1 1 150px; max-width:260px; background:#e6b4d1; color:#342036; border-color:#e6b4d1; font-size:13px; font-weight:700; }
.study-player-button:disabled { opacity:.35; cursor:default; }
.study-player-icon { width:21px; height:21px; flex:0 0 21px; }
.study-player-speed { display:flex; flex:0 0 66px; margin-left:auto; }
.study-player-speed select { width:66px; min-height:42px; border:1px solid #b991b45e; border-radius:8px; background:transparent; color:inherit; padding:6px; font:inherit; font-size:13px; }
.study-player-detail { margin:10px 0 0!important; font-size:12px!important; line-height:1.5!important; color:inherit!important; opacity:.76; overflow-wrap:anywhere; }
.study-player-detail:empty { display:none; }
.study-player button:focus-visible,.study-player select:focus-visible { outline:3px solid #8cc3b8; outline-offset:3px; }
@media(max-width:560px) {
  .study-player,.reader > .study-player { padding:13px; }
  .study-player-selection { gap:9px; }
  .study-player-selection > label { flex-basis:100%; }
  .study-player-transport { gap:6px; }
  .study-player-button { min-width:40px; width:40px; flex-basis:40px; }
  .study-player-button.study-player-play { min-width:76px; flex-basis:108px; max-width:none; font-size:12px; padding:7px 5px; gap:5px; }
  .study-player-speed { flex-basis:59px; }
  .study-player-speed select { width:59px; font-size:12px; }
}
/* Narrow cards keep the main transport on one row and the tools below it.
   The query uses the actual card width, including a narrow mobile reader. */
@container study-player (max-width:430px) {
  .study-player-transport { display:grid; grid-template-columns:40px minmax(76px,1fr) 59px; gap:6px; }
  .study-player-button[data-action="section-audio-prev"] { grid-column:1; grid-row:1; }
  .study-player-button.study-player-play { grid-column:2; grid-row:1; width:100%; min-width:76px; max-width:none; }
  .study-player-button[data-action="section-audio-next"] { grid-column:3; grid-row:1; justify-self:end; }
  .study-player-button[data-action="section-audio-restart"] { grid-column:1; grid-row:2; }
  .study-player-list { grid-column:2; grid-row:2; justify-self:center; }
  .study-player-speed { grid-column:3; grid-row:2; justify-self:end; margin-left:0; }
}
@media(max-width:360px) {
  .study-player-transport { display:grid; grid-template-columns:40px minmax(76px,1fr) 59px; gap:6px; }
  .study-player-button[data-action="section-audio-prev"] { grid-column:1; grid-row:1; }
  .study-player-button.study-player-play { grid-column:2; grid-row:1; width:100%; min-width:76px; max-width:none; }
  .study-player-button[data-action="section-audio-next"] { grid-column:3; grid-row:1; justify-self:end; }
  .study-player-button[data-action="section-audio-restart"] { grid-column:1; grid-row:2; }
  .study-player-list { grid-column:2; grid-row:2; justify-self:center; }
  .study-player-speed { grid-column:3; grid-row:2; justify-self:end; margin-left:0; }
}
/* Only the Play/Pause target changes in an expanded horizontal viewer. */
@media(orientation:landscape) {
  #reader-viewer .viewer-transport > .audio-play,
  #class-slide-viewer .slide-transport > .slide-play {
    flex:0 1 118px; width:118px; min-width:110px; max-width:140px;
  }
}

.audio-select-list svg { width:22px; height:22px; flex:0 0 22px; }
.audio-select-list { min-width:42px; min-height:42px; padding:8px!important; display:inline-flex; align-items:center; justify-content:center; }
.viewer-player-selection { margin:0 0 8px; }
.viewer-player-selection label { display:flex; align-items:center; justify-content:center; gap:10px; font-size:12px; color:#d9c7df; }
.viewer-player-selection select { min-height:36px; max-width:min(100%,360px); border:1px solid #b991b45e; border-radius:7px; padding:6px 10px; background:#33243b; color:#f6eaf3; font:inherit; }
@media(orientation:landscape) and (max-height:560px) { .viewer-player-selection { margin-bottom:4px; } .viewer-player-selection select { min-height:32px; padding:3px 8px; } }

/* The same player surface is used against every section background. */
.study-player { background:linear-gradient(125deg,#fffafd,#f3edf8); color:#63435b; border-color:#d5bdd0; }
/* The floating player stays available after Play, even while these controls are visible. */
