@layer components {
  :root {
    --player-block-size: 6rem;
  }

  body:has(#player:not([hidden])) main {
    padding-block-end: var(--player-block-size);
  }

  .player:not([hidden]) {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--color-raised);
    color: var(--color-foreground);
    border-top: 1px solid var(--color-border);
  }

  .player__toggle,
  .player__skip {
    flex: none;
    width: 2.75rem;
    height: 2.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: inherit;
    cursor: pointer;
  }

  .player__toggle-icon[hidden] {
    display: none;
  }

  .player__body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2xs);
  }

  .player__title {
    font-family: var(--font-serif);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .player__time {
    display: flex;
    align-items: center;
    gap: var(--spacing-2xs);
    font-size: var(--font-size-sm);
  }

  .player__progress {
    flex: 1;
    appearance: none;
    background: var(--color-border);
    border-radius: 0;
    height: 2px;
  }

  .player__progress::-webkit-slider-runnable-track {
    background: transparent;
  }

  .player__progress::-webkit-slider-thumb {
    appearance: none;
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    background: var(--color-signal);
  }

  .player__progress::-moz-range-track {
    background: transparent;
  }

  .player__progress::-moz-range-thumb {
    width: 8px;
    height: 8px;
    border: none;
    border-radius: var(--radius-full);
    background: var(--color-signal);
  }

  .play-button:not(.btn) {
    flex: none;
    width: 2.75rem;
    height: 2.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: inherit;
    cursor: pointer;
  }

  .play-button-icon[hidden] {
    display: none;
  }

  .download-button {
    flex: none;
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--color-muted);
    cursor: pointer;
  }

  .download-button-icon[hidden] {
    display: none;
  }
}
