/* Both views of the recording share one clock, one scale and one play control. */
.audio-demo {
  --progress: 0%;
  --accent: #a0daff;
  min-width: 0;
  color-scheme: dark;
  color: #f2f5f6;
  background: #12181d;
  border: 1px solid #45505a;
  border-radius: 12px;
  padding: 16px 18px 14px;
}
.demo-head,
.demo-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.demo-head > span:first-child { display: inline-flex; align-items: center; gap: 8px; font-size: .91rem; font-weight: 590; }
.demo-head .ico { color: var(--accent); }
.audio-time,
.demo-foot > span { color: #b6c0c8; font-size: .77rem; }
.audio-time { font-variant-numeric: tabular-nums; white-space: nowrap; }
.audio-main { display: flex; align-items: center; gap: 13px; padding: 14px 0 12px; }
.play-button {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: #d6eeff;
  color: #102331;
}
.play-button:hover { background: #fff; }
.play-button .ico { width: 19px; height: 19px; }
.waveform { position: relative; flex: 1; min-width: 0; height: 32px; color: #7f9eb1; }
.waveform svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.wave-after,
.audio-demo:has([data-track="after"][aria-pressed="true"]) .wave-before { display: none; }
.audio-demo:has([data-track="after"][aria-pressed="true"]) .wave-after { display: block; }
.waveform::after {
  content: "";
  position: absolute;
  top: 2px;
  bottom: 2px;
  left: clamp(0px, var(--progress), calc(100% - 1px));
  width: 1px;
  background: var(--accent);
  pointer-events: none;
}
.ab-choice { display: flex; align-items: center; gap: 2px; background: #0a0e10; padding: 2px; border-radius: 5px; }
.ab-choice button {
  border: 0;
  border-radius: 3px;
  padding: 4px 10px;
  background: transparent;
  color: #b5c0c9;
  font-size: .78rem;
  line-height: 1.3;
}
.ab-choice button[aria-pressed="true"] { background: #2d3a43; color: #d9efff; }
.ab-choice button:hover { color: #fff; }
.audio-demo [data-audio-error]:not(:empty) { padding-top: 8px; font-size: .8rem; color: #ffb2b6; }
.audio-demo noscript a { color: var(--accent); text-decoration: underline; }
.audio-demo :is(a, button, input):focus-visible { outline: 2px solid #a0daff; outline-offset: 3px; }

.screening-edition .audio-demo {
  color: #f6f8ff;
  background: #151c2f;
  border: 0;
  border-radius: 16px;
  padding: clamp(1.15rem, 2.7vw, 2.45rem);
  box-shadow: 0 16px 32px -22px rgb(11 20 45 / .48);
}
.screening-edition .audio-demo .demo-head { flex-wrap: wrap; gap: .5rem 1rem; }
.screening-edition .audio-demo .demo-head > span:first-child {
  gap: .58rem;
  color: #f6f8ff;
  font: 560 clamp(1rem, 1.3vw, 1.2rem)/1.3 Rubik, Inter, sans-serif;
}
.screening-edition .audio-demo .demo-head .ico { color: #a9bdff; }
.screening-edition .audio-demo :is(.audio-time, .demo-foot > span) { color: #b9c6e0; font-size: .85rem; }
.screening-edition .audio-demo .audio-main { gap: clamp(.9rem, 2.2vw, 1.8rem); padding: clamp(1.45rem, 2.8vw, 2.5rem) 0; }
.screening-edition .audio-demo .play-button {
  width: clamp(50px, 4.8vw, 65px);
  height: clamp(50px, 4.8vw, 65px);
  color: #13203c;
  background: #a9bdff;
}
.screening-edition .audio-demo .play-button:hover { background: #c2cfff; }
.screening-edition .audio-demo .play-button .ico { width: 40%; height: 40%; }
.screening-edition .audio-demo .waveform { color: #a9bdff; height: clamp(47px, 5vw, 75px); }
.screening-edition .audio-demo .wave-after { color: #77e6d0; }
.screening-edition .audio-demo .waveform::after {
  left: clamp(0px, var(--progress), calc(100% - 2px));
  width: 2px;
  background: #f6f8ff;
}
.screening-edition .audio-demo .demo-foot { flex-wrap: wrap; gap: .7rem 1rem; padding-top: 1rem; border-top: 1px solid #374158; }
.screening-edition .audio-demo .ab-choice { padding: 3px; gap: 2px; background: #0a1020; border-radius: 9px; }
.screening-edition .audio-demo .ab-choice button {
  min-width: 66px;
  min-height: 44px;
  padding: .45rem .9rem;
  border-radius: 6px;
  color: #c4cfe8;
  font-size: .92rem;
  font-weight: 620;
}
.screening-edition .audio-demo .ab-choice button:hover { background: #29344d; }
.screening-edition .audio-demo .ab-choice button[aria-pressed="true"] { color: #101c35; background: #a9bdff; }
.screening-edition .audio-demo .ab-choice button[data-track="after"][aria-pressed="true"] { background: #77e6d0; }
.screening-edition .audio-demo :is(button, input, a):focus-visible { outline: 2px solid #8ff8de; outline-offset: 3px; }
.screening-edition .audio-demo [data-audio-error]:not(:empty) { color: #ffb6b3; }
.screening-edition .audio-demo noscript a { color: #bacaff; }

.demo-volume {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  color: #c4cfe0;
  font-size: .83rem;
  font-variant-numeric: tabular-nums;
}
.demo-volume label { display: flex; align-items: center; flex: 1; gap: 12px; min-width: 0; }
.demo-volume [data-volume-value] { min-width: 3.3ch; text-align: end; white-space: nowrap; }
.demo-volume input {
  --level: 25%;
  display: block;
  flex: 1;
  min-width: 38px;
  width: 0;
  height: 30px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 4px;
  appearance: none;
  background: transparent;
  accent-color: #a9bdff;
  cursor: pointer;
}
.demo-volume input::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(to right, #a9bdff var(--level), #45516a var(--level));
}
.demo-volume input::-webkit-slider-thumb {
  appearance: none;
  width: 14px;
  height: 14px;
  margin-top: -5px;
  border: 0;
  border-radius: 50%;
  background: #c3d0ff;
}
.demo-volume input::-moz-range-track { height: 4px; border-radius: 4px; background: #45516a; }
.demo-volume input::-moz-range-progress { height: 4px; border-radius: 4px; background: #a9bdff; }
.demo-volume input::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: #c3d0ff; }
html:not(.js) .audio-demo :is(.demo-volume, .play-button, .ab-choice, .audio-time) { display: none; }

@media (max-width: 760px) {
  .audio-demo { padding: 13px 14px 11px; }
  .audio-main { padding: 10px 0; }
}
@media (forced-colors: active) {
  .audio-demo button { border: 1px solid ButtonText; }
  .audio-demo .ab-choice button[aria-pressed="true"] { outline: 2px solid Highlight; outline-offset: -4px; }
  .audio-demo .waveform::after { background: Highlight; }
  .demo-volume input { appearance: auto; }
  .demo-volume input::-webkit-slider-runnable-track { background: Canvas; }
  .demo-volume input::-webkit-slider-thumb { background: Highlight; }
}
