/* Client listening page: one track list and one persistent player.
   Phones: bottom sheet. Tablets: inset card. Room for two panes: docked right panel. */

.listen {
  --player-space: 280px;

  max-width: 760px;
  margin: 0 auto;
  padding: 28px var(--gutter) calc(var(--player-space) + 28px);
}

.listen__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.listen__studio {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 0.95rem;
  font-weight: 500;
}

.listen__studio::before {
  content: "";
  width: 18px;
  height: 2px;
  border-radius: 1px;
  background: var(--signal);
}

.listen__project {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  font-weight: 400;
}

.listen__title {
  font: 500 clamp(2.5rem, 9vw, 4.25rem) / 0.98 var(--display);
  letter-spacing: 0.005em;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

/* The artist is the client: secondary to the title, but not a footnote. */
.listen__artist {
  color: color-mix(in srgb, var(--ink) 82%, var(--ink-soft));
  font-size: 1.3rem;
  font-weight: 500;
}

.listen__download {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--ink);
  font-size: 0.925rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.listen__download:hover {
  border-color: var(--ink-soft);
}

.listen__download .icon {
  width: 18px;
  height: 18px;
}

.update-notice {
  position: sticky;
  top: 12px;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 16px;
  margin-bottom: 12px;
  padding: 10px 16px;
  border-radius: var(--radius);
  background: var(--signal);
  color: var(--console-deep);
  font-size: 0.95rem;
  font-weight: 500;
  box-shadow: var(--shadow-raised);
}

.update-notice .link-button {
  min-height: 32px;
  color: var(--console-deep);
  text-decoration: underline;
}

/* Track list */

.tracklist {
  display: grid;
}

.track {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 60px;
  padding: 8px 14px;
  border: 0;
  border-radius: 12px;
  background: none;
  text-align: left;
}

.tracklist li + li {
  border-top: 1px solid var(--line);
}

.tracklist li:has(> [aria-current]),
.tracklist li:has(> [aria-current]) + li {
  border-top-color: transparent;
}

.track:hover {
  background: rgb(255 255 255 / 0.04);
}

.track[aria-current] {
  background: var(--accent-soft);
}

.track__number {
  display: grid;
  place-items: center;
  color: var(--ink-faint);
  font: 500 1.05rem / 1 var(--display);
  font-variant-numeric: tabular-nums;
}

.track__title {
  overflow-wrap: anywhere;
  font-size: 1.1rem;
}

.track__length {
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.track .playing-bars {
  display: none;
  color: var(--accent);
}

.track[aria-current] .track__index {
  display: none;
}

.track[aria-current] .playing-bars {
  display: block;
}

.track[aria-current] .track__title {
  font-weight: 600;
}

.playing-bars rect {
  transform-box: fill-box;
  transform-origin: center;
}

.track[data-playing] .playing-bars rect,
.player__mini[data-playing] .playing-bars rect {
  animation: playing-bar 900ms ease-in-out infinite alternate;
}

.track[data-playing] .playing-bars rect:nth-child(2),
.player__mini[data-playing] .playing-bars rect:nth-child(2) {
  animation-delay: -300ms;
}

.track[data-playing] .playing-bars rect:nth-child(3),
.player__mini[data-playing] .playing-bars rect:nth-child(3) {
  animation-delay: -600ms;
}

@keyframes playing-bar {
  from { transform: scaleY(0.35); }
  to { transform: scaleY(1); }
}

/* Player */

.player {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px var(--gutter) calc(14px + var(--safe-bottom));
  border-radius: 22px 22px 0 0;
  background: var(--surface);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.08), 0 -16px 40px rgb(2 10 22 / 0.45);
}

.player > :not(.discussion) {
  flex: none;
}

.player__resize {
  display: none;
}

/* Minimising the sheet leaves a slim bar, so the track list is easy to browse */

.player__toggle {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--ink-soft);
}

.player__toggle:hover {
  background: rgb(255 255 255 / 0.08);
  color: var(--ink);
}

.player__toggle .icon {
  width: 24px;
  height: 24px;
}

.player__collapse {
  position: absolute;
  top: 10px;
  right: 12px;
}

.player[data-composing] .player__collapse {
  display: none;
}

.player__header {
  padding-right: 36px;
}

.player__mini {
  display: none;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  cursor: pointer;
}

.player__mini .playing-bars {
  width: 22px;
  height: 22px;
  color: var(--accent);
}

.player__mini-text {
  display: grid;
  flex: 1;
  min-width: 0;
}

.player__mini-title {
  overflow: hidden;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player__mini-meta {
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.transport__play.transport__play--mini {
  width: 48px;
  height: 48px;
  box-shadow: none;
}

.transport__play.transport__play--mini .icon {
  width: 22px;
  height: 22px;
}

.player__progress {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 3px;
  background: var(--accent);
}

.player[data-collapsed] {
  gap: 0;
  padding-block: 8px calc(8px + var(--safe-bottom));
  overflow: hidden;
}

.player[data-collapsed] > :not(.player__mini) {
  display: none;
}

.player[data-collapsed] .player__mini {
  display: flex;
}

.player__header {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.player__title {
  overflow: hidden;
  font: 500 1.6rem / 1.3 var(--display);
  letter-spacing: 0.005em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player__versions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.select--compact {
  width: auto;
  min-height: 34px;
  padding: 0 30px 0 10px;
  font-size: 0.925rem;
}

.player__versions[data-earlier] .select {
  border-color: color-mix(in srgb, var(--money) 60%, transparent);
  background-color: var(--money-soft);
}

.player__earlier {
  color: var(--caution);
  font-size: 0.875rem;
  font-weight: 600;
}

.waveform {
  position: relative;
  height: 64px;
  border-radius: 6px;
  cursor: pointer;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.waveform canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.waveform:has(.marker) {
  box-sizing: content-box;
  padding-top: 28px;
}

.waveform__markers {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.marker {
  position: absolute;
  top: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: hsl(var(--hue, 215) 75% 78%);
  box-shadow: 0 0 0 2px var(--surface);
  color: var(--console-deep);
  font-size: 0.7rem;
  font-weight: 700;
  transform: translateX(-50%);
  pointer-events: auto;
}

.marker[data-producer] {
  background: var(--ink);
  color: var(--console-deep);
}

.marker::before {
  content: "";
  position: absolute;
  inset: -8px;
}

.marker::after {
  content: "";
  position: absolute;
  top: 100%;
  left: calc(50% - 1px);
  width: 2px;
  height: calc(var(--wave-height, 64px) + 6px);
  background: hsl(var(--hue, 215) 75% 78%);
  opacity: 0.6;
  pointer-events: none;
}

.marker[data-movable] {
  cursor: grab;
  touch-action: none;
}

.marker--dragging {
  z-index: 2;
  cursor: grabbing;
}

.marker--draft {
  width: 12px;
  height: 12px;
  margin-top: 5px;
  background: var(--ink);
}

.marker[data-producer]::after {
  background: var(--ink);
}

.marker--draft::after {
  height: calc(var(--wave-height, 64px) + 11px);
  background: var(--ink);
  opacity: 1;
}

.player__times {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: -4px;
  color: var(--ink-soft);
  font-size: 0.875rem;
}

.player__status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.player__status .link-button {
  min-height: 32px;
}

.transport {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
}

.transport__skip {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--ink);
}

.transport__skip .icon {
  width: 26px;
  height: 26px;
}

.transport__skip:hover:not(:disabled) {
  background: rgb(255 255 255 / 0.08);
}

.transport__skip:disabled {
  color: var(--wave);
  cursor: default;
}

.transport__play {
  position: relative;
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  border: 0;
  border-radius: 50%;
  background: var(--ink);
  color: var(--console-deep);
  box-shadow: 0 10px 28px rgb(2 10 22 / 0.4);
  transition: transform 120ms, background-color 120ms;
}

.transport__play:hover {
  background: #fff;
}

.transport__play:active {
  transform: scale(0.96);
}

.transport__play .icon {
  width: 30px;
  height: 30px;
}

.transport__play:not([data-playing]) .icon--pause,
.transport__play[data-playing] .icon--play {
  display: none;
}

.transport__play[data-loading]::after,
.spinner {
  content: "";
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

.transport__play[data-loading]::after {
  position: absolute;
  inset: -6px;
  border-top-color: var(--accent);
}

.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .transport__play[data-loading]::after,
  .spinner {
    border-color: var(--accent-soft);
    border-top-color: var(--accent);
  }
}

/* Comments */

.discussion {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.discussion__comments {
  display: grid;
  align-content: start;
  gap: 2px;
  max-height: min(26dvh, 240px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.discussion__comments:empty {
  display: none;
}

.comment {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
  padding: 8px 2px;
  border-radius: var(--radius);
}

.comment + .comment {
  border-top: 1px solid var(--line);
  border-radius: 0;
}

.comment__avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: hsl(var(--hue) 75% 78%);
  color: var(--console-deep);
  font-size: 0.9rem;
  font-weight: 650;
}

.comment__avatar[data-producer] {
  background: var(--ink);
  color: var(--console-deep);
}

.comment__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  font-size: 0.9rem;
}

.comment__author {
  font-weight: 650;
}

.comment__time {
  border: 0;
  cursor: pointer;
}

.comment__time:hover {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.comment__body {
  margin-top: 2px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.comment__actions {
  display: flex;
  gap: 10px;
}

.comment__edited {
  color: var(--ink-faint);
  font-size: 0.8rem;
}

.comment__action {
  min-height: 32px;
  color: var(--ink-faint);
  font-size: 0.8rem;
  font-weight: 500;
}

/* The studio, signed in, sees its own controls in pink: nothing pink ever reaches the client. */
.studio-view {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 16px;
  margin-bottom: 24px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--comment-soft);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--comment) 35%, transparent);
  color: var(--comment-strong);
  font-size: 0.9rem;
}

.studio-view__back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--comment);
  font-weight: 600;
  text-decoration: none;
}

.studio-view__back:hover {
  text-decoration: underline;
}

.studio-view__back .icon {
  width: 16px;
  height: 16px;
}

.listen[data-studio] .comment__action {
  color: var(--comment);
}

/* Every comment the studio sees lines up the same, so the new ones' tint runs edge to edge between the rules. */
.listen[data-studio] .discussion__comments {
  gap: 0;
}

.listen[data-studio] .comment {
  padding-inline: 10px;
  border-radius: 0;
}

.comment[data-unread] {
  background: var(--comment-soft);
  box-shadow: inset 3px 0 0 var(--comment);
}

.marker[data-unread] {
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--comment);
}

.discussion__review {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 16px;
  min-height: 40px;
  padding: 4px 12px;
  border-radius: var(--radius);
  background: var(--comment);
  color: var(--console-deep);
  font-size: 0.875rem;
  font-weight: 600;
}

.discussion__mark-all {
  order: 1;
  margin-left: auto;
  color: var(--console-deep);
  font-size: 0.875rem;
  font-weight: 600;
}

.discussion__hide-read {
  gap: 8px;
}

.discussion__hide-read input {
  width: 34px;
  height: 20px;
  background: rgb(13 36 64 / 0.3);
}

.discussion__hide-read input::after {
  width: 14px;
  height: 14px;
}

.discussion__hide-read input:checked {
  background: var(--console-deep);
}

.discussion__hide-read input:checked::after {
  transform: translateX(14px);
}

.discussion__caught-up {
  padding: 10px 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.track__name {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.track__unread {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 4px;
  padding: 2px 9px 2px 7px;
  border-radius: 999px;
  background: var(--comment);
  color: var(--console-deep);
  font-size: 0.8rem;
  font-weight: 650;
}

.track__unread .icon {
  width: 1.1em;
  height: 1.1em;
}

/* The open composer sits in its own panel, so it reads as active. */
.composer {
  display: grid;
  gap: 10px;
  padding: 10px 12px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--sunken);
}

.discussion__add {
  width: 100%;
}

.discussion__add .icon {
  width: 18px;
  height: 18px;
}

.composer__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-right: -6px;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.composer__when {
  display: inline-flex;
  margin: 0;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.composer__option {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--ink-soft);
  cursor: pointer;
}

.composer__option:has(:checked) {
  background: var(--ink);
  color: var(--console-deep);
}

.composer__option:has(:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.composer__time {
  width: 4.5ch;
  padding: 1px 4px;
  border: 0;
  border-bottom: 1px dashed currentColor;
  border-radius: 0;
  background: none;
  color: inherit;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
}

.composer__time:focus {
  outline: none;
  border-bottom-style: solid;
}

.composer__now {
  font-size: 0.875rem;
}

.composer__elsewhere {
  font-size: 0.875rem;
}

.composer__cancel {
  margin-left: auto;
}

.composer__error {
  margin-top: 4px;
  color: var(--danger);
  font-size: 0.85rem;
  font-weight: 600;
}

.input[aria-invalid="true"] {
  border-color: var(--danger);
  background: var(--danger-soft);
  box-shadow: 0 0 0 3px rgb(185 50 38 / 0.15);
}

.input--flagged {
  animation: flag 360ms ease-in-out;
}

@keyframes flag {
  20%, 60% { transform: translateX(-5px); }
  40%, 80% { transform: translateX(5px); }
}

.composer__row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.composer__body {
  flex: 1;
  min-width: 0;
  max-height: 140px;
  padding: 10px 12px;
  font-size: 16px;
  line-height: 1.4;
  resize: none;
}

.composer__name .input {
  font-size: 16px;
}

.composer__identity {
  font-size: 0.8rem;
}

.composer__identity .link-button {
  font-size: inherit;
}

/* Phones and tablets: writing expands the sheet to nearly full height, with the
   composer high enough to stay clear of the on-screen keyboard. */
.player[data-composing] {
  top: calc(env(safe-area-inset-top, 0px) + 40px);
}

.player[data-composing] .discussion,
.player[data-composing] .discussion__comments {
  flex: 1;
  max-height: none;
}

/* Tablets: the same sheet as an inset card */
@media (min-width: 600px) {
  .player {
    right: auto;
    bottom: calc(16px + var(--safe-bottom));
    left: 50%;
    width: min(640px, 100% - 32px);
    padding: 20px 28px 16px;
    border-radius: 22px;
    transform: translateX(-50%);
    box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.08), 0 20px 50px rgb(2 10 22 / 0.5);
  }

  .player[data-composing] {
    top: calc(env(safe-area-inset-top, 0px) + 24px);
  }

  .listen {
    padding-bottom: calc(var(--player-space) + 48px);
  }
}

/* Room for two panes, including short landscape phones: docked right panel */
@media (min-width: 960px) and (min-height: 560px), (min-width: 700px) and (max-height: 559px) and (orientation: landscape) {
  .listen {
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(320px, 36vw, 440px);
    grid-template-rows: repeat(5, auto) 1fr;
    align-items: start;
    max-width: 1240px;
    padding: 0;
  }

  .listen__header, .update-notice, .stage-notice, .listen__flash, .tracklist {
    grid-column: 1;
    margin-inline: var(--gutter);
  }

  /* Viewing as the studio: a bar across the top, with the player below it. */
  .listen[data-studio] {
    --studio-bar: 48px;
  }

  .studio-view {
    position: sticky;
    top: 0;
    z-index: 6;
    grid-column: 1 / -1;
    grid-row: 1;
    flex-wrap: nowrap;
    height: var(--studio-bar);
    margin: 0;
    padding: 0 var(--gutter);
    border-radius: 0;
    background: color-mix(in srgb, var(--comment) 16%, #0b1f38);
    box-shadow: inset 0 -1px 0 color-mix(in srgb, var(--comment) 40%, transparent);
  }

  .studio-view__text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .studio-view__back {
    flex: none;
  }

  .listen[data-studio] .player {
    grid-row: 2 / -1;
    top: var(--studio-bar);
    height: calc(100dvh - var(--studio-bar));
  }

  .listen__header {
    padding-top: 32px;
  }

  .tracklist {
    padding-bottom: 32px;
  }

  .player {
    position: sticky;
    top: 0;
    z-index: 5;
    grid-column: 2;
    grid-row: 1 / -1;
    justify-self: unsafe end;
    align-content: start;
    gap: 16px;
    height: 100dvh;
    padding: 32px 28px 24px;
    overflow: hidden;
    border-left: 1px solid var(--line);
    border-radius: 0;
    /* Opaque, so it looks the same whether or not it's been dragged over the track list. */
    background: #0b1f38;
    transition: box-shadow 200ms;
    transform: none;
    box-shadow: none;
  }

  .player__title {
    font-size: 2rem;
    white-space: normal;
  }

  .listen__header {
    padding-bottom: 12px;
  }

  .player__collapse {
    display: none;
  }

  .player__header {
    padding-right: 0;
  }

  /* Dragged wider than its column, the player covers the end of the track list. */
  .listen[data-player-wide] .player {
    box-shadow: -24px 0 60px rgb(2 10 22 / 0.5);
  }

  .player__resize {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 2;
    display: block;
    width: 12px;
    cursor: col-resize;
    touch-action: none;
  }

  .player__resize::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 4px;
    width: 4px;
    height: 48px;
    border-radius: 2px;
    background: var(--line-strong);
    transform: translateY(-50%);
    transition: background-color 120ms, height 120ms;
  }

  .player__resize:is(:hover, :focus-visible)::after, .listen[data-resizing] .player__resize::after {
    height: 96px;
    background: var(--accent);
  }

  .player__resize:focus-visible {
    outline: none;
  }

  .listen[data-resizing] {
    cursor: col-resize;
    user-select: none;
  }

  .waveform {
    --wave-height: 96px;
    height: 96px;
    margin-top: 12px;
  }

  .player[data-composing] {
    top: 0;
  }

  .discussion, .discussion__comments {
    flex: 1;
    max-height: none;
  }
}

@media (min-width: 700px) and (max-height: 559px) and (orientation: landscape) {
  .listen__header {
    padding-top: 16px;
  }

  .player {
    gap: 10px;
    padding: 16px 20px calc(12px + var(--safe-bottom));
    overflow-y: auto;
  }

  .waveform {
    --wave-height: 56px;
    height: 56px;
    margin-top: 0;
  }
}

@media (min-width: 1240px) and (min-height: 560px) {
  body:has(.listen) {
    padding: 24px;
  }

  .listen {
    min-height: calc(100dvh - 48px);
    overflow: clip;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgb(255 255 255 / 0.015);
  }

  .player, .player[data-composing] {
    top: 24px;
    height: calc(100dvh - 48px);
  }

  .studio-view {
    top: 24px;
  }

  .listen[data-studio] .player {
    top: calc(24px + var(--studio-bar));
    height: calc(100dvh - 48px - var(--studio-bar));
  }
}

/* Diagnostics */

.diagnostics {
  display: grid;
  gap: 16px;
  max-width: 640px;
  margin: 0 auto;
  padding: 32px var(--gutter) calc(48px + var(--safe-bottom));
}

.diagnostics__results {
  display: grid;
  gap: 6px;
}

.diagnostics__results li {
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 0.925rem;
}

.diagnostics__results li[data-result="pass"] { box-shadow: inset 4px 0 0 #1c8a4a; }
.diagnostics__results li[data-result="fail"] { box-shadow: inset 4px 0 0 var(--danger); color: var(--danger); }

.diagnostics__manual {
  display: grid;
  gap: 8px;
  justify-items: start;
  margin-top: 16px;
}

.diagnostics__device {
  overflow-x: auto;
  color: var(--ink-soft);
  font-size: 0.75rem;
  white-space: pre-wrap;
}

/* Deposit and final files at the client's link */

.listen__flash {
  margin-bottom: 16px;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--good-soft);
  color: var(--good);
  font-weight: 600;
}

.stage-notice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 16px;
  padding: 12px 12px 12px 16px;
  border: 1px solid var(--money);
  border-radius: var(--radius);
  background: var(--money-soft);
  color: var(--ink);
  font-size: 0.95rem;
  text-decoration: none;
}

.stage-notice__action {
  color: var(--money);
  font-weight: 600;
}

.pay {
  display: grid;
  justify-items: start;
  gap: 12px;
  margin-bottom: 28px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow-raised);
}

.pay__title {
  font: 500 2rem / 1.1 var(--display);
  letter-spacing: 0.005em;
}

.pay__lede {
  color: var(--ink-soft);
}

.pay__sums {
  display: grid;
  width: 100%;
  margin: 4px 0;
}

.pay__sums div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.pay__sums dt {
  color: var(--ink-soft);
}

.pay__sums dd {
  margin: 0;
}

.pay__sums .pay__sums-due {
  align-items: baseline;
  padding-top: 14px;
  border-bottom: 0;
  font-weight: 600;
}

.pay__sums-due dd {
  color: var(--money);
  font-size: 2rem;
  line-height: 1;
}

.pay__sums .pay__sums-due dt {
  color: var(--ink);
}

.pay form, .pay__button {
  width: 100%;
}

.pay__button {
  min-height: 52px;
  font-size: 1.05rem;
}

.pay__fine {
  color: var(--ink-faint);
  font-size: 0.875rem;
}

.file-list--client {
  padding: 4px 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgb(255 255 255 / 0.03);
}

.client-file {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
  padding: 8px 0;
}

.client-file__download {
  border-radius: 50%;
  background: none;
}

.client-file + .client-file {
  border-top: 1px solid var(--line);
}

.client-file__main {
  display: grid;
  min-width: 0;
}

.client-file__label {
  overflow-wrap: anywhere;
  font-size: 1.025rem;
  font-weight: 500;
}

.client-file__meta {
  font-size: 0.875rem;
}

.client-file__locked {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
}

.client-file__locked .icon {
  width: 1em;
  height: 1em;
}

/* Pages at the client's link without the player: deposit, final files, test checkout */
.client-page {
  max-width: 640px;
  margin: 0 auto;
  padding: 28px var(--gutter) calc(64px + var(--safe-bottom));
}

@media (min-width: 960px) {
  .client-page {
    padding-top: 56px;
  }
}

.client-page .listen__header {
  margin-inline: 0;
  padding-top: 0;
}

.client-page .listen__flash {
  margin-inline: 0;
}

/* The stand-in for Stripe's payment page: a wireframe, so it reads as neither Convey nor the real thing */

.mock-checkout {
  --wire: #6b7280;
  min-height: 100dvh;
  background: #fff;
  color: #374151;
  font: 15px / 1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.mock-checkout__banner {
  padding: 12px var(--gutter);
  border-bottom: 2px dashed var(--wire);
  background: repeating-linear-gradient(-45deg, #f3f4f6 0 12px, #fff 12px 24px);
  color: #111827;
  text-align: center;
}

.mock-checkout__page {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 48px;
  max-width: 920px;
  margin: 0 auto;
  padding: 56px var(--gutter);
}

.mock-checkout__summary, .mock-checkout__form {
  display: grid;
  align-content: start;
  gap: 16px;
}

.mock-checkout__back, .mock-checkout__cancel {
  color: inherit;
}

.mock-checkout__label {
  margin-top: 24px;
}

.mock-checkout__amount {
  color: #111827;
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1.1;
}

.mock-checkout__heading {
  color: #111827;
  font-size: 1.15rem;
  font-weight: 700;
}

.mock-checkout__field {
  display: grid;
  gap: 4px;
  font-size: 0.85rem;
}

.mock-checkout__box {
  height: 42px;
  border: 1.5px dashed var(--wire);
  border-radius: 4px;
  background: linear-gradient(#d1d5db, #d1d5db) no-repeat 12px center / 38% 8px;
}

.mock-checkout__box--card {
  height: 84px;
  background:
    linear-gradient(#d1d5db, #d1d5db) no-repeat 12px 17px / 55% 8px,
    linear-gradient(#d1d5db, #d1d5db) no-repeat 12px 59px / 18% 8px,
    linear-gradient(#d1d5db, #d1d5db) no-repeat 60% 59px / 12% 8px,
    linear-gradient(var(--wire), var(--wire)) no-repeat 0 41px / 100% 1.5px,
    linear-gradient(var(--wire), var(--wire)) no-repeat 50% 42px / 1.5px 42px;
}

.mock-checkout__pay {
  width: 100%;
  min-height: 48px;
  margin-top: 8px;
  border: 2px solid #111827;
  border-radius: 4px;
  background: #111827;
  color: #fff;
  font-weight: 700;
}

.mock-checkout__pay:hover {
  background: #374151;
}

.mock-checkout__cancel {
  justify-self: center;
  font-size: 0.85rem;
}

@media (max-width: 640px) {
  .mock-checkout__page {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
    padding-block: 32px;
  }

  .mock-checkout__label {
    margin-top: 8px;
  }
}

/* Inputs and selects in the listening room sit below the surface, not on it. */
.room .input, .room .select {
  border-color: var(--line-strong);
  background-color: var(--sunken);
}

.room .select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23a7b6c9'%3E%3Cpath d='M5.3 7.3a1 1 0 0 1 1.4 0L10 10.6l3.3-3.3a1 1 0 1 1 1.4 1.4l-4 4a1 1 0 0 1-1.4 0l-4-4a1 1 0 0 1 0-1.4Z'/%3E%3C/svg%3E");
}

.room .button--secondary {
  background: transparent;
}

.room .button--secondary:hover {
  border-color: var(--ink-soft);
  background: rgb(255 255 255 / 0.05);
}

