/*
  Shidur on the web: Material 3 styles (DESIGN-PHILOSOPHY.md). Colors are the --md-sys-color-* roles;
  theme.js sets them from the accent or the station. The defaults below are the baseline purple
  scheme, for the first paint. Logical properties (inline-start/end) keep Hebrew mirrored.
*/

:root {
  --md-sys-color-primary: #6750A4;
  --md-sys-color-on-primary: #FFFFFF;
  --md-sys-color-primary-container: #E9DDFF;
  --md-sys-color-on-primary-container: #150D56;
  --md-sys-color-secondary: #645A76;
  --md-sys-color-on-secondary: #FFFFFF;
  --md-sys-color-secondary-container: #E9DDFF;
  --md-sys-color-on-secondary-container: #1F172F;
  --md-sys-color-tertiary: #894C5B;
  --md-sys-color-error: #B02D2A;
  --md-sys-color-on-error: #FFFFFF;
  --md-sys-color-error-container: #FFDAD4;
  --md-sys-color-on-error-container: #3C0700;
  --md-sys-color-surface: #FBF8FF;
  --md-sys-color-on-surface: #1D1A21;
  --md-sys-color-on-surface-variant: #4A4453;
  --md-sys-color-inverse-surface: #322F36;
  --md-sys-color-inverse-on-surface: #F3EFF9;
  --md-sys-color-inverse-primary: #D2BBFF;
  --md-sys-color-outline: #7A7485;
  --md-sys-color-outline-variant: #CAC4D6;
  --md-sys-color-scrim: #000000;
  --md-sys-color-surface-container-lowest: #FFFFFF;
  --md-sys-color-surface-container-low: #F6F2FB;
  --md-sys-color-surface-container: #F0ECF6;
  --md-sys-color-surface-container-high: #EAE7F0;
  --md-sys-color-surface-container-highest: #E4E1EA;

  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans Hebrew', 'Noto Sans', 'Helvetica Neue', Arial, sans-serif;
  --nav-height: 80px;
  --rail-width: 80px;
  --mini-height: 64px;
  --pane-width: 400px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --ease-standard: cubic-bezier(0.2, 0, 0, 1);
  --ease-decelerate: cubic-bezier(0.05, 0.7, 0.1, 1);
  /* Spatial motion: a slight overshoot, like a spring. */
  --ease-spring: cubic-bezier(0.34, 1.32, 0.64, 1);
  --elevation-3: 0 1px 3px rgb(0 0 0 / 0.3), 0 4px 8px 3px rgb(0 0 0 / 0.15);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --md-sys-color-primary: #D2BBFF;
    --md-sys-color-on-primary: #32226F;
    --md-sys-color-primary-container: #4C3889;
    --md-sys-color-on-primary-container: #E9DDFF;
    --md-sys-color-secondary: #CDC1E2;
    --md-sys-color-on-secondary: #342C46;
    --md-sys-color-secondary-container: #4B425E;
    --md-sys-color-on-secondary-container: #E9DDFF;
    --md-sys-color-tertiary: #FAB3C3;
    --md-sys-color-error: #FFB4A8;
    --md-sys-color-on-error: #690008;
    --md-sys-color-error-container: #910715;
    --md-sys-color-on-error-container: #FFDAD4;
    --md-sys-color-surface: #151219;
    --md-sys-color-on-surface: #E4E1EA;
    --md-sys-color-on-surface-variant: #CAC4D6;
    --md-sys-color-inverse-surface: #E4E1EA;
    --md-sys-color-inverse-on-surface: #322F36;
    --md-sys-color-inverse-primary: #6750A4;
    --md-sys-color-outline: #948E9F;
    --md-sys-color-outline-variant: #4A4453;
    --md-sys-color-surface-container-lowest: #100D15;
    --md-sys-color-surface-container-low: #1D1A21;
    --md-sys-color-surface-container: #211E25;
    --md-sys-color-surface-container-high: #2B2930;
    --md-sys-color-surface-container-highest: #36343B;
  }
}

/* Base */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  background: var(--md-sys-color-surface);
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--md-sys-color-surface);
  color: var(--md-sys-color-on-surface);
  font: 400 16px/24px var(--font);
  -webkit-tap-highlight-color: transparent;
}

body.is-locked {
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: var(--md-sys-color-primary);
}

:focus-visible {
  outline: 3px solid var(--md-sys-color-secondary);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: fixed;
  inset-inline-start: 16px;
  top: -64px;
  z-index: 100;
  padding: 8px 16px;
  border-radius: 20px;
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  text-decoration: none;
}

.skip-link:focus {
  top: 16px;
}

.icon {
  display: block;
  flex: none;
  fill: currentColor;
}

[dir='rtl'] .icon--mirror {
  transform: scaleX(-1);
}

.tabular {
  font-variant-numeric: tabular-nums;
}

/* Type scale */

.headline-medium { font-size: 28px; line-height: 36px; font-weight: 400; }
.headline-small { font-size: 24px; line-height: 32px; font-weight: 400; }
.title-large { font-size: 22px; line-height: 28px; font-weight: 400; }
.title-medium { font-size: 16px; line-height: 24px; font-weight: 500; }
.title-small { font-size: 14px; line-height: 20px; font-weight: 500; }
.body-large { font-size: 16px; line-height: 24px; }
.body-medium { font-size: 14px; line-height: 20px; }
.body-small { font-size: 12px; line-height: 16px; }
.label-large { font-size: 14px; line-height: 20px; font-weight: 500; }
.label-medium { font-size: 12px; line-height: 16px; font-weight: 500; }
.bold { font-weight: 700; }
.semibold { font-weight: 600; }
.muted { color: var(--md-sys-color-on-surface-variant); }

.ellipsis {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.clamp-2 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

/* State layers: a veil of the content color on hover, focus and press. */

.state {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.state::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: currentColor;
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms var(--ease-standard);
}

@media (hover: hover) {
  .state:hover::after {
    opacity: 0.08;
  }
}

.state:focus-visible::after,
.state:active::after {
  opacity: 0.12;
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 24px;
  border: 0;
  border-radius: 20px;
  background: transparent;
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.btn--filled {
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
}

.btn--tonal {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
}

.btn--outlined {
  border: 1px solid var(--md-sys-color-outline);
  color: var(--md-sys-color-primary);
}

.btn--text {
  padding: 0 12px;
  color: var(--md-sys-color-primary);
}

.icon-btn {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--md-sys-color-on-surface-variant);
  text-decoration: none;
}

.icon-btn:disabled {
  opacity: 0.38;
  cursor: default;
}

.icon-btn[aria-pressed='true'],
.icon-btn[data-on='true'] {
  color: var(--md-sys-color-primary);
}

.icon-btn[data-on='true'] .icon {
  animation: pop 300ms var(--ease-spring);
}

@keyframes pop {
  50% {
    transform: scale(1.25);
  }
}

/* Chips and segmented buttons */

.chips {
  display: flex;
  gap: 8px;
  padding: 8px 16px;
  overflow-x: auto;
  scrollbar-width: none;
}

.chips::-webkit-scrollbar {
  display: none;
}

.chip {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 16px;
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: 8px;
  background: transparent;
  color: var(--md-sys-color-on-surface-variant);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

.chip[aria-pressed='true'],
.chip[aria-current='page'] {
  padding-inline-start: 8px;
  border-color: transparent;
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
}

.chip select {
  border: 0;
  background: transparent;
  color: inherit;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
}

.chip select:focus-visible {
  outline: none;
}

.chip:has(select:focus-visible) {
  outline: 3px solid var(--md-sys-color-secondary);
  outline-offset: 2px;
}

.segmented {
  display: flex;
  width: 100%;
  border: 1px solid var(--md-sys-color-outline);
  border-radius: 20px;
  overflow: hidden;
}

.segmented button {
  display: inline-flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  font-size: 14px;
  font-weight: 500;
}

.segmented button + button {
  border-inline-start: 1px solid var(--md-sys-color-outline);
}

.segmented button[aria-pressed='true'] {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
}

/* Switch */

.switch {
  position: relative;
  flex: none;
  width: 52px;
  height: 32px;
  border: 2px solid var(--md-sys-color-outline);
  border-radius: 16px;
  background: var(--md-sys-color-surface-container-highest);
  transition: background-color 200ms var(--ease-standard), border-color 200ms var(--ease-standard);
}

.switch::before {
  content: '';
  position: absolute;
  top: 50%;
  inset-inline-start: 6px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--md-sys-color-outline);
  transform: translateY(-50%);
  transition: inset-inline-start 250ms var(--ease-spring), width 250ms var(--ease-spring), height 250ms var(--ease-spring),
    background-color 200ms var(--ease-standard);
}

[aria-checked='true'] > .switch {
  border-color: var(--md-sys-color-primary);
  background: var(--md-sys-color-primary);
}

[aria-checked='true'] > .switch::before {
  inset-inline-start: 22px;
  width: 24px;
  height: 24px;
  background: var(--md-sys-color-on-primary);
}

[aria-disabled='true'] {
  opacity: 0.38;
  cursor: default;
}

/* Range (volume) */

.range {
  flex: 1;
  height: 32px;
  accent-color: var(--md-sys-color-primary);
  background: transparent;
  cursor: pointer;
}

/* App shell */

.app {
  min-height: 100dvh;
  --bottom-space: calc(var(--nav-height) + var(--safe-bottom));
}

.app[data-mini='true'] {
  --bottom-space: calc(var(--nav-height) + var(--safe-bottom) + var(--mini-height) + 8px);
}

.content {
  padding-bottom: calc(var(--bottom-space) + 24px);
}

.screen {
  position: relative;
  isolation: isolate;
  max-width: 1120px;
  margin-inline: auto;
}

.screen--narrow {
  max-width: 760px;
}

[data-gradient='true'] .screen::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  z-index: -1;
  height: 320px;
  background: linear-gradient(to bottom, color-mix(in srgb, var(--md-sys-color-primary) 16%, transparent), transparent);
  pointer-events: none;
}

.navbar {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  height: calc(var(--nav-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--md-sys-color-surface-container);
}

.nav-item {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--md-sys-color-on-surface-variant);
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  text-decoration: none;
}

.nav-item__indicator {
  display: grid;
  place-items: center;
  width: 64px;
  height: 32px;
  border-radius: 16px;
  transition: background-color 200ms var(--ease-standard);
}

.nav-item[aria-current='page'] {
  color: var(--md-sys-color-on-surface);
}

.nav-item[aria-current='page'] .nav-item__indicator {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
}

@media (hover: hover) {
  .nav-item:hover .nav-item__indicator {
    background: color-mix(in srgb, var(--md-sys-color-on-surface) 8%, transparent);
  }

  .nav-item[aria-current='page']:hover .nav-item__indicator {
    background: var(--md-sys-color-secondary-container);
  }
}

.rail {
  display: none;
}

@media (min-width: 600px) {
  .app {
    --bottom-space: var(--safe-bottom);
    padding-inline-start: var(--rail-width);
  }

  .app[data-mini='true'] {
    --bottom-space: calc(var(--safe-bottom) + var(--mini-height) + 16px);
  }

  .navbar {
    display: none;
  }

  .rail {
    position: fixed;
    inset-block: 0;
    inset-inline-start: 0;
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: var(--rail-width);
    padding-top: 16px;
    background: var(--md-sys-color-surface);
  }

  .rail__logo {
    width: 40px;
    height: 40px;
    margin-bottom: 16px;
    border-radius: 12px;
  }

  .rail .nav-item {
    flex: none;
    width: 100%;
    padding-block: 4px;
  }

  .rail .nav-item__indicator {
    width: 56px;
  }
}

/* Top of the screens */

.top-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 64px;
  padding: 8px 4px 0 16px;
  padding-inline: 16px 4px;
}

.top-bar__title {
  flex: 1;
  min-width: 0;
  margin: 0;
}

.top-bar--back {
  padding-inline-start: 4px;
}

.search-field {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 12px;
  min-width: 0;
  height: 56px;
  padding-inline: 16px;
  border-radius: 28px;
  background: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface-variant);
  text-decoration: none;
}

.search-field input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--md-sys-color-on-surface);
  font-size: 16px;
}

.search-field input::placeholder {
  color: var(--md-sys-color-on-surface-variant);
  opacity: 1;
}

.search-field:has(input:focus-visible) {
  outline: 3px solid var(--md-sys-color-secondary);
  outline-offset: 2px;
}

.search-field input::-webkit-search-cancel-button {
  display: none;
}

.home-top {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 4px 0 16px;
  padding-inline: 16px 4px;
}

.search-top {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px;
  padding-inline-start: 4px;
  background: var(--md-sys-color-surface);
}

/* Artwork */

.art {
  position: relative;
  display: grid;
  flex: none;
  place-items: center;
  width: var(--art-size, 48px);
  height: var(--art-size, 48px);
  border-radius: calc(var(--art-size, 48px) * var(--art-corner, 0.28));
  overflow: hidden;
  background: var(--md-sys-color-surface-container-highest);
}

.art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.art--raw img {
  padding: 10%;
  object-fit: contain;
  background: #FFFFFF;
}

.art__mono {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
}

.badge {
  position: absolute;
  bottom: 4px;
  inset-inline-end: 4px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
}

/* Shelves and tiles */

.shelf__header {
  display: flex;
  align-items: center;
  padding: 16px 16px 8px;
}

.shelf__title {
  min-width: 0;
  margin: 0;
  font-size: 22px;
  line-height: 28px;
  font-weight: 600;
}

.shelf__link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  /* The negative margins line the text up with the tiles; the width makes room for them. */
  max-width: calc(100% + 16px);
  margin: -4px -8px;
  padding: 4px 8px;
  border-radius: 12px;
  color: inherit;
  text-decoration: none;
}

.shelf__row {
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 0 10px 4px;
  overflow-x: auto;
  list-style: none;
  scroll-padding-inline: 10px;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}

.shelf__row::-webkit-scrollbar {
  display: none;
}

.shelf__row > li {
  display: flex;
  flex: none;
}

@media (pointer: fine) {
  .shelf__row {
    scrollbar-width: thin;
    scrollbar-color: var(--md-sys-color-outline-variant) transparent;
  }
}

.tile {
  --art-size: 72px;
  display: flex;
  flex: none;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border: 0;
  border-radius: 20px;
  background: transparent;
  scroll-snap-align: start;
}

.tile--large {
  --art-size: 112px;
}

.tile__art {
  position: relative;
}

.tile__label {
  width: calc(var(--art-size) + 12px);
  text-align: center;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  justify-items: center;
  gap: 4px;
  padding: 0 10px;
}

/* Lists */

.list {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0 8px;
  list-style: none;
}

.row {
  display: flex;
  align-items: center;
  min-height: 72px;
  padding-inline-end: 4px;
  border-radius: 16px;
}

.row.is-current {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
}

.row.is-current .muted,
.row.is-current .icon-btn:not([data-on='true']) {
  color: var(--md-sys-color-on-secondary-container);
}

.row__main {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 16px;
  min-width: 0;
  min-height: 72px;
  padding: 8px 8px 8px 8px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  text-align: start;
}

.row__text {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.row__eq {
  color: var(--md-sys-color-primary);
}

.row.is-current .row__eq {
  color: var(--md-sys-color-primary);
}

/* Cards, banners and empty states */

.card {
  margin: 8px 16px;
  padding: 16px;
  border-radius: 12px;
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
}

.card__title {
  margin: 0 0 4px;
}

.card__body {
  margin: 0;
}

.card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.card--android {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.card--android .icon {
  margin-top: 2px;
}

.banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 16px;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface);
}

.empty {
  padding: 48px 24px;
  text-align: center;
}

.center {
  display: flex;
  justify-content: center;
  padding-top: 24px;
}

/* Settings */

.group-label {
  margin: 24px 32px 8px;
  color: var(--md-sys-color-primary);
}

.group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0 16px;
  border-radius: 24px;
  overflow: hidden;
}

.setting {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  min-height: 56px;
  padding: 12px 16px;
  padding-inline-end: 20px;
  border: 0;
  border-radius: 4px;
  background: var(--md-sys-color-surface-container);
  color: var(--md-sys-color-on-surface);
  text-align: start;
  text-decoration: none;
}

.setting--block {
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}

.setting__text {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.swatch {
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--swatch);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--md-sys-color-on-surface) 12%, transparent);
}

.swatch[aria-pressed='true'] {
  outline: 3px solid var(--md-sys-color-on-surface);
  outline-offset: 3px;
}

.about-note {
  margin: 16px 32px 0;
}

/* Mini player */

.mini {
  position: fixed;
  inset-inline: 8px;
  bottom: calc(var(--nav-height) + var(--safe-bottom) + 8px);
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--mini-height);
  padding-inline: 10px 4px;
  border-radius: 16px;
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
  box-shadow: var(--elevation-3);
  touch-action: none;
  transition: transform 300ms var(--ease-spring);
}

.mini__open {
  position: absolute;
  inset: 0;
  z-index: 0;
  border: 0;
  border-radius: inherit;
  background: transparent;
}

.mini > :not(.mini__open) {
  position: relative;
  z-index: 1;
}

.mini__art {
  --art-size: 44px;
  pointer-events: none;
}

.mini__text {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  pointer-events: none;
}

.mini .icon-btn {
  color: inherit;
}

@media (min-width: 600px) {
  .mini {
    inset-inline-start: calc(var(--rail-width) + 8px);
    bottom: calc(var(--safe-bottom) + 8px);
    max-width: 720px;
  }
}

/* Full player */

.player-sheet {
  position: fixed;
  inset: 0;
  z-index: 40;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--md-sys-color-surface);
  color: var(--md-sys-color-on-surface);
  transform: translateY(100%);
  visibility: hidden;
  transition: transform 400ms var(--ease-decelerate), visibility 0s linear 400ms;
}

.player-sheet[data-open='true'] {
  transform: none;
  visibility: visible;
  transition: transform 400ms var(--ease-decelerate), visibility 0s;
}

.player-sheet.is-dragging {
  transition: none;
}

.pane {
  display: none;
}

@media (min-width: 1000px) {
  .app[data-pane='true'] {
    padding-inline-end: var(--pane-width);
  }

  .app[data-pane='true'] .pane {
    position: fixed;
    inset-block: 0;
    inset-inline-end: 0;
    z-index: 20;
    display: block;
    width: var(--pane-width);
    overflow-y: auto;
    background: var(--md-sys-color-surface);
    color: var(--md-sys-color-on-surface);
    border-inline-start: 1px solid var(--md-sys-color-outline-variant);
  }

  .app[data-pane='true'] .mini,
  .app[data-pane='true'] .player-sheet {
    display: none;
  }

  .app[data-pane='true'] {
    --bottom-space: var(--safe-bottom);
  }
}

.hero {
  --art-size: min(78vw, 42dvh, 340px);
  --art-corner: 0.22;
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100%;
  padding: 8px 24px calc(24px + var(--safe-bottom));
}

.pane .hero {
  --art-size: min(280px, 38dvh);
}

[data-gradient='true'] .hero::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  z-index: -1;
  height: 60%;
  background: linear-gradient(to bottom, color-mix(in srgb, var(--md-sys-color-primary-container) 85%, transparent), transparent);
  pointer-events: none;
}

.hero__top {
  display: flex;
  align-self: stretch;
  justify-content: space-between;
  margin-inline: -12px;
}

.player-sheet [data-drag-handle] {
  touch-action: none;
}

.hero .icon-btn {
  color: var(--md-sys-color-on-surface-variant);
}

.hero .icon-btn[data-on='true'] {
  color: var(--md-sys-color-primary);
}

.hero__art {
  /* The free height goes above the artwork and below the last control, centering the player. */
  margin-top: auto;
  padding-top: 16px;
  transform: scale(0.92);
  transition: transform 450ms var(--ease-spring);
}

.hero::after {
  content: '';
  margin-top: auto;
}

.hero[data-active='true'] .hero__art {
  transform: none;
}

.hero__title {
  margin: 24px 0 4px;
  font-size: 28px;
  line-height: 36px;
  font-weight: 700;
  text-align: center;
}

.hero__sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--md-sys-color-on-surface-variant);
}

.live {
  color: var(--md-sys-color-error);
  font-size: 12px;
  font-weight: 500;
}

.hero__status {
  min-height: 24px;
  margin: 12px 0 0;
  text-align: center;
}

.controls {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 24px;
}

.controls .icon-btn {
  width: 56px;
  height: 56px;
  color: var(--md-sys-color-on-surface);
}

.play-btn {
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  padding: 0;
  border: 0;
  border-radius: 44px;
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  transition: border-radius 350ms var(--ease-spring);
}

.play-btn[data-active='true'] {
  border-radius: 28px;
}

.mini .play-mini {
  width: 48px;
  height: 48px;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
}

.sleep-left {
  margin: 4px 0 0;
  color: var(--md-sys-color-primary);
}

.volume {
  display: none;
}

@media (pointer: fine) {
  .volume {
    display: flex;
    align-items: center;
    gap: 8px;
    width: min(320px, 100%);
    margin-top: 12px;
    color: var(--md-sys-color-on-surface-variant);
  }
}

.error-card {
  width: min(480px, 100%);
  margin-top: 16px;
  padding: 16px 16px 8px;
  border-radius: 12px;
  background: var(--md-sys-color-error-container);
  color: var(--md-sys-color-on-error-container);
}

.error-card p {
  margin: 0;
}

.error-card .btn--text {
  color: var(--md-sys-color-on-error-container);
}

.spinner {
  width: var(--spinner-size, 36px);
  height: var(--spinner-size, 36px);
  border: 3px solid currentColor;
  border-inline-end-color: transparent;
  border-radius: 50%;
  animation: spin 900ms linear infinite;
}

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

/* Bottom sheets, menus and messages */

.scrim {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--md-sys-color-scrim) 32%, transparent);
  animation: fade-in 200ms var(--ease-standard);
}

.modal-sheet {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 51;
  max-width: 640px;
  max-height: 90dvh;
  margin-inline: auto;
  padding: 0 24px calc(24px + var(--safe-bottom));
  overflow-y: auto;
  border-radius: 28px 28px 0 0;
  background: var(--md-sys-color-surface-container-low);
  color: var(--md-sys-color-on-surface);
  animation: slide-up 350ms var(--ease-decelerate);
}

.modal-sheet__handle {
  width: 32px;
  height: 4px;
  margin: 16px auto;
  border-radius: 2px;
  background: color-mix(in srgb, var(--md-sys-color-on-surface-variant) 40%, transparent);
}

.modal-sheet__header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 8px;
}

.modal-sheet h2 {
  margin: 0;
}

.sheet-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  margin-top: 8px;
}

.divider {
  height: 1px;
  margin: 12px 0;
  border: 0;
  background: var(--md-sys-color-outline-variant);
}

.snackbar {
  position: fixed;
  inset-inline: 16px;
  bottom: calc(var(--bottom-space) + 16px);
  z-index: 60;
  max-width: 560px;
  margin-inline: auto;
  padding: 14px 16px;
  border-radius: 4px;
  background: var(--md-sys-color-inverse-surface);
  color: var(--md-sys-color-inverse-on-surface);
  box-shadow: var(--elevation-3);
  animation: fade-in 200ms var(--ease-standard);
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

@keyframes slide-up {
  from {
    transform: translateY(100%);
  }
}

/* Loading and errors before the app starts */

.boot {
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: 24px;
  text-align: center;
}

.boot__logo {
  width: 96px;
  height: 96px;
  border-radius: 28px;
}

/* Reduced motion: no springs, loops or slides. */

[data-motion='false'] *,
[data-motion='false'] *::before,
[data-motion='false'] *::after {
  transition-duration: 1ms !important;
  animation-duration: 1ms !important;
  animation-iteration-count: 1 !important;
}

[data-motion='false'] .hero__art {
  transform: none;
}

[data-motion='false'] .spinner {
  border-inline-end-color: currentColor;
  opacity: 0.6;
}
