.record-player {
  --paper:#f3eee3; --ink:#17242c; --faded:#746f66;
  flex:1; min-height:0; position:relative; display:grid;
  grid-template-rows:auto minmax(0,1fr) auto; background:var(--paper); color:var(--ink);
  border:1px solid #292c31; overflow:hidden; container-type:size;
}
.record-header,.record-controls {display:flex; align-items:center; justify-content:space-between; gap:14px;}
.record-header {justify-content:flex-end;padding:clamp(5px,1.7cqh,14px) 4cqw 0;}
.record-library summary {color:#535656;}
.record-library {z-index:3;}
.record-library summary,.follow-song {cursor:pointer;font:12px/1.5 monospace;}
.record-library summary {list-style:none; padding:4px 0 4px 12px;}
.record-library summary::-webkit-details-marker {display:none;}
.record-library summary::before {content:'☰'; margin-right:7px;}
.record-library {position:relative;}
.record-menu {position:absolute;right:0;top:100%;width:min(285px,88cqw);color:var(--ink);background:#f5f0e6;
  border:1px solid #565952;box-shadow:2px 3px 0 #28314040;display:grid;grid-template-rows:minmax(0,1fr) auto;max-height:74cqh;}
.record-groups {padding:4px;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;}
.record-groups h3 {margin:0;padding:10px 9px 5px;color:#5b605e;font:600 11px/1.3 monospace;}
.record-groups section+section {border-top:1px solid #d3cec2;margin-top:5px;}
.record-groups button {position:relative;display:block;width:100%;text-align:left;cursor:pointer;
  padding:7px 9px 7px 25px;border:0;background:transparent;color:inherit;font:13px/1.35 monospace;}
.record-groups button.browsed {background:#dde3ea;outline:1px dotted #5e6a7c;outline-offset:-2px;}
.record-groups button.browsed::before,.record-groups button[aria-current=true]::before {
  content:'';position:absolute;left:9px;top:50%;width:6px;height:12px;transform:translateY(-50%);background:currentColor;}
.record-groups button.browsed:not([aria-current=true])::before {animation:record-cursor 1s steps(1,end) infinite;}
@keyframes record-cursor {50% {opacity:0;}}
.record-groups button[aria-current=true] {background:#172e70;color:#fffaf0;outline:none;}
.record-menu small {padding:6px 12px;border-top:1px solid #d3cec2;font:10px/1.25 monospace;color:#626258;}
@media (prefers-reduced-motion:reduce) {.record-groups button.browsed::before {animation:none!important;}}
.record-main {
  min-height:0;display:grid;align-items:center;
  grid-template-columns:minmax(0,.8fr) minmax(0,1.2fr);
  column-gap:clamp(24px,6.5cqw,90px);
  padding:0 clamp(24px,6.5cqw,96px);
}
.record-left {
  --sleeve-size:min(100%,43cqh,30cqw,340px);
  min-width:0;display:grid;justify-items:center;align-content:center;
}
.leaving-sleeve {position:absolute;inset:0;pointer-events:none;}
.record-pocket {position:relative;width:var(--sleeve-size);aspect-ratio:1;perspective:740px;}
.sleeve-tilt {position:relative;width:100%;height:100%;pointer-events:none;
  box-shadow:1px 2px 0 #a29c90,2px 6px 12px #30261c32;}
.player-sleeve {display:block;width:100%;height:100%;object-fit:cover;}
.record-caption {width:var(--sleeve-size);max-width:100%;margin-top:clamp(9px,2.3cqh,18px);}
.record-caption h2 {margin:0;font:400 clamp(19px,2.8cqw,35px)/1.06 R,Georgia,serif;letter-spacing:-.035em;}
.record-caption p {margin:5px 0 0;font:10px/1.4 monospace;color:#67645d;}
.record-right {min-width:0;min-height:0;height:100%;position:relative;display:grid;align-content:center;
  grid-template-rows:auto minmax(0,min(54cqh,100%));}
.record-lyric-head {display:flex;align-items:center;justify-content:space-between;
  color:#67645d;font:11px monospace;}
.record-right:has(.synced) .record-lyric-head {position:absolute;right:0;top:1cqh;z-index:1;}
.record-right:has(.synced) .record-lyric-head > span {display:none;}
.follow-song {border:0;background:none;color:#304f89;text-decoration:underline;padding:0;}
.record-lines {grid-row:2;position:relative;overflow:auto;overscroll-behavior:contain;min-height:0;scrollbar-width:thin;}
.record-lines.synced {mask-image:linear-gradient(transparent,#000 10%,#000 90%,transparent);scrollbar-width:none;}
.record-lines.synced::before,.record-lines.synced::after {content:'';display:block;height:50%;}
.record-lines > button {
  display:block;width:100%;text-align:left;padding:.60em .1em .60em 0;text-wrap:balance;
  border:0;background:none;color:#827b70;
  font:400 clamp(20px,2.85cqw,34px)/1.18 R,Georgia,serif;letter-spacing:-.033em;
  transition:color 160ms ease-out,opacity 220ms ease;cursor:pointer;
}
.record-lines.synced:not(.browsing) > button {opacity:0;pointer-events:none;}
.record-lines.synced:not(.browsing) > .lyric-neighbor {opacity:.58;pointer-events:auto;}
.record-lines.synced:not(.browsing) > .lyric-center,
.record-lines.synced:not(.browsing) > button:focus-visible {opacity:1;pointer-events:auto;}
.record-lines.synced > button:focus-visible {outline-offset:-1px;}
.record-lines > button[aria-current=true] {color:#48596c;}
.record-lines > button[aria-current=true] span {
  color:transparent;
  background-image:linear-gradient(90deg,#102c50 var(--ink-stop,0%),#536379 calc(var(--ink-stop,0%) + 12%));
  -webkit-background-clip:text;background-clip:text;
}
.record-lines.browsing > button,.record-lines > button:focus-visible {color:#615d57;}
.record-lines > button:focus-visible {outline:1px dotted #536379;outline-offset:-2px;}
@media (hover:hover) {
  .record-lines > button:hover {color:#4d5863;}
}
@media (prefers-contrast:more), (forced-colors:active) {
  .record-lines > button {color:var(--ink);}
  .record-lines > button[aria-current=true] {text-decoration:underline;text-underline-offset:.14em;}
  .record-lines > button[aria-current=true] span {color:inherit;background:none;}
}
.record-right[hidden] {display:none;}
.record-main.art-only {display:grid;grid-template:1fr / 1fr;justify-items:center;align-items:center;}
.record-main.art-only .record-left {display:grid;justify-items:center;text-align:center;}
.record-main.art-only .record-pocket {width:min(33cqw,36cqh,310px);}
.record-lines > p {font:18px/1.4 R,serif;}
.record-controls {width:min(78%,760px);margin:0 auto;gap:12px;padding:6px 0 clamp(10px,3.2cqh,24px);}
.record-play {flex:none;width:38px;height:38px;border-radius:50%;border:1px solid #182831;background:#1a2a36;color:#fff9ed;font:18px/1 system-ui;}
.record-play {display:grid;place-items:center;padding:0;cursor:pointer;}
.record-play-icon {position:relative;width:16px;height:16px;pointer-events:none;}
.record-play-icon::before,.record-play-icon::after {
  content:"";position:absolute;inset:0;background:currentColor;
  transition:clip-path 220ms cubic-bezier(.32,0,.2,1);
}
/* The two pieces share an edge until the pause bars separate. */
.record-play-icon::before {clip-path:polygon(19% 5%,53% 24%,53% 76%,19% 95%);}
.record-play-icon::after {clip-path:polygon(50% 22%,96% 49%,96% 51%,50% 78%);}
.record-play.is-playing .record-play-icon::before {clip-path:polygon(16% 8%,40% 8%,40% 92%,16% 92%);}
.record-play.is-playing .record-play-icon::after {clip-path:polygon(60% 8%,84% 8%,84% 92%,60% 92%);}
@media (prefers-reduced-motion:reduce) {
  .record-play-icon::before,.record-play-icon::after {transition:none;}
}
.record-play:disabled {opacity:.4;}
.record-controls time {font:12px monospace;color:#31404a;font-variant-numeric:tabular-nums;}
.record-seek {flex:1;min-width:28px;appearance:none;height:20px;margin:0;background:transparent;cursor:pointer;}
.record-seek::-webkit-slider-runnable-track {height:3px;background:linear-gradient(to right,#304c6a var(--played,0%),#bdbab1 0);}
.record-seek::-webkit-slider-thumb {appearance:none;width:10px;height:14px;margin-top:-5px;background:#273d50;border-radius:2px;}
.record-seek::-moz-range-track {height:3px;background:#bdbab1;}
.record-seek::-moz-range-progress {height:3px;background:#304c6a;}
.record-error {position:absolute;bottom:42px;left:12px;background:var(--paper);padding:4px;}
@container (max-width:570px) {
  .record-main {align-items:stretch;grid-template-columns:1fr;grid-template-rows:auto minmax(0,1fr);padding:0 7cqw;}
  .record-left {display:flex;align-items:center;gap:15px;padding:clamp(5px,2cqh,14px) 0;}
  .record-pocket {width:min(17cqw,13cqh);flex:none;}
  .record-caption {margin:0;width:auto;min-width:0;}
  .record-right {grid-template-rows:auto minmax(0,1fr);padding:3cqh 0;}
  .record-lines > button {font-size:clamp(19px,5.2cqw,27px);}
  .record-controls {width:86%;}
}
@container (max-height:340px) {
  .record-header {padding-top:3px;}
  .record-right {grid-template-rows:auto minmax(0,1fr);}
  .record-controls {padding-block:3px;}
  .record-play {width:30px;height:30px;}
}
@media (prefers-reduced-motion:reduce) {
  .player-sleeve,.record-lines > button {transition:none;transform:none;}
}

.record-caption .track-note-link,.record-caption .track-stream-link {
  display:inline-block;margin-top:.7em;background:transparent;border:0;padding:0;color:#354a66;
  font:11px/1.4 monospace;text-decoration:underline;text-underline-offset:3px;cursor:pointer;
}
.record-song-note {grid-row:2;align-self:center;overflow:auto;max-height:100%;margin:0;font:clamp(17px,2.3cqw,25px)/1.48 R,Georgia,serif;}
.record-player [hidden] {display:none!important;}

/* Progress-bar comparison is available from the design review link. */
.seek-options {display:flex;align-items:center;gap:2px;margin-right:auto;border:1px solid #b9b3a5;border-radius:3px;padding:2px;}
.seek-options button {border:0;border-radius:2px;background:transparent;color:#535750;padding:4px 8px;cursor:pointer;font:11px/1.3 monospace;}
.seek-options button[aria-pressed=true] {background:#273d50;color:#faf5e7;}
.seek-study {flex:1;position:relative;min-width:0;--position:0%;--brass:#b0854e;}
.study-track {position:relative;height:34px;display:grid;align-items:center;}
.study-surface {position:absolute;inset:0 4px;pointer-events:none;}
.seek-study .record-seek {position:absolute;inset:0;display:block;width:100%;height:100%;opacity:0;}
.study-track:focus-within {outline:1px dotted #4b5462;outline-offset:2px;}
.study-ink,.study-head {position:absolute;display:block;}
.study-head {left:var(--position);transform:translateX(-50%);top:50%;}
[data-mode=tape] .study-surface {top:7px;bottom:7px;border-radius:3px;
  background:linear-gradient(#273333,#192626);box-shadow:inset 0 1px 2px #07100f,0 1px 0 #fff9eb;}
[data-mode=tape] .study-ink {inset:3px 6px;background:
  repeating-linear-gradient(90deg,#c6c2a3 0 1px,transparent 1px 8%) 0 1px/100% 8px no-repeat,
  repeating-linear-gradient(90deg,#8b9181 0 1px,transparent 1px 2%) 0 1px/100% 4px no-repeat;}
[data-mode=tape] .study-head {height:24px;width:6px;margin-top:-12px;border-radius:1px;background:linear-gradient(90deg,#a97338,#f3d08b 42%,#ce9957 75%);box-shadow:1px 1px 2px #191c1788;}
[data-mode=wave] .study-ink {inset:2px 0;background:linear-gradient(to right,#21466c var(--position),#aaa9a1 var(--position));mask:var(--wave-mask) center / 100% 100% no-repeat;-webkit-mask:var(--wave-mask) center / 100% 100% no-repeat;}
[data-mode=wave] .study-head {width:2px;height:32px;margin-top:-16px;background:#234361;}
[data-mode=wave] .study-head::before {content:'';position:absolute;left:-2px;top:-1px;width:6px;height:4px;background:#234361;}
[data-mode=phrases] .study-track {height:15px;}
[data-mode=phrases] .study-ink {inset:7px 0 auto;height:2px;background:linear-gradient(to right,#9a6336 var(--position),#c5bfb3 var(--position));}
[data-mode=phrases] .study-head {width:7px;height:7px;margin-top:-3px;border-radius:50%;background:#925d33;}
.phrase-marks {display:flex;margin:0 4px;gap:6px;}
.phrase-marks button {min-width:0;flex:1;text-align:left;cursor:pointer;display:grid;gap:2px;border:0;border-left:1px solid #c8bca7;padding:2px 4px 2px 6px;background:transparent;color:#5c5a54;}
.phrase-marks small {font:9px monospace;color:#806a50;}
.phrase-marks span {display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font:italic 14px/1.2 R,Georgia,serif;}
.phrase-marks .passed-mark,.phrase-marks button:hover {border-color:#9c643c;background:#e8decc;color:#302f2b;}
.study-hint {position:absolute;z-index:2;bottom:calc(100% + 4px);transform:translateX(-50%);padding:5px 8px;background:#26363d;color:#fff9ec;border-radius:3px;max-width:100%;width:max-content;box-sizing:border-box;pointer-events:none;text-align:center;font:11px/1.3 monospace;}
@container (max-width:500px) {
  .seek-options button {padding-inline:5px;}
  .record-controls:has(.seek-study) {width:94%;gap:6px;}
  .phrase-marks {gap:2px;}
  .phrase-marks span {font-size:12px;}
}

.precision-seek {position:relative;flex:1;min-width:28px;height:32px;}
.precision-seek canvas {position:absolute;top:calc(50% - 4px);left:3px;width:calc(100% - 6px);height:8px;pointer-events:none;}
.precision-seek .record-seek {
  position:absolute;inset:0;width:100%;height:100%;min-width:0;padding:0;border:0;
  --needle:#505e62;
  --tip:polygon(0 0,100% 0,60% 28%,60% 100%,40% 100%,40% 28%);
}
.precision-seek .record-seek::-webkit-slider-runnable-track {height:100%;background:transparent;}
.precision-seek .record-seek::-webkit-slider-thumb {
  width:6px;height:13px;margin-top:8px;border:0;border-radius:0;background:var(--needle);clip-path:var(--tip);transition:background-color 120ms;
}
.precision-seek .record-seek::-moz-range-track,.precision-seek .record-seek::-moz-range-progress {background:transparent;}
.precision-seek .record-seek::-moz-range-thumb {
  width:6px;height:13px;border:0;border-radius:0;background:var(--needle);clip-path:var(--tip);
}
.precision-seek .record-seek:active,.precision-seek .record-seek:focus-visible {--needle:#18354a;}
.precision-seek .record-seek:focus-visible {outline:1px dotted #747e80;outline-offset:1px;}

.record-caption .sleeve-date {display:block;margin-top:3px;color:#67645d;font:10px/1.4 monospace;}
.record-caption .track-note-link:not([hidden]) {margin-right:12px;}
.record-song-note {white-space:pre-line;}
@container (min-width:571px) and (min-height:500px) {
  .record-left {transform:translateY(2.5cqh);}
}
@media (max-width:760px), (pointer:coarse) and (orientation:landscape) and (max-height:550px) and (max-width:1000px) {
  .record-library summary, .record-groups button { min-height:44px; }
  .record-library summary { display:flex; align-items:center; }
  .record-play { min-width:44px; min-height:44px; }
  .precision-seek { height:44px; }
}
@container (max-width:520px) and (min-height:450px) {
  .record-main { padding-inline:5cqw; }
  .record-left { gap:4cqw; }
  .record-pocket { width:min(31cqw,21cqh); }
  .record-caption h2 { font-size:clamp(21px,6cqw,29px); }
  .record-caption p, .record-caption .sleeve-date { font-size:11px; }
}

@media (max-width:760px) and (orientation:portrait) {
  .record-header { padding:0 5cqw; }
  .record-main:not(.art-only) { grid-template: auto minmax(0,1fr) / minmax(0,1fr); padding-inline:5cqw; }
  .record-main:not(.art-only) .record-left { display:flex; gap:4cqw; padding:6px 0 12px; border-bottom:1px solid #c7c1b3; }
  .record-main:not(.art-only) .record-pocket { width:min(30cqw,22cqh); }
  .record-right { padding:1.5cqh 0; }
  .record-controls { width:90%; padding-bottom:clamp(6px,2cqh,16px); }
}
