/* ===== KOSHERMUSIK PLAYER — mini bar + Now Playing sheet (loaded last, overrides appui) =====
   Design goals: immersive artwork-tinted background, big forgiving hit areas
   (every control >= 48px, sliders have a tall invisible hit zone), custom icons. */

:root {
  --kp-red: var(--ricky-red, #ff2d2d);
  --kp-red-soft: rgba(255, 45, 45, 0.16);
  --kp-text: #fff;
  --kp-dim: rgba(255, 255, 255, 0.58);
  --kp-faint: rgba(255, 255, 255, 0.14);
  --kp-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Mini bar: floating glass card ---------- */
html body.koshermusik-page .km-now-playing-mini {
  left: 8px;
  right: 8px;
  bottom: calc(var(--km-tab-bar-total, 64px) + 8px);
  height: 64px;
  max-width: 760px;
  margin: 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 18px;
  background: rgba(22, 22, 24, 0.78);
  backdrop-filter: blur(30px) saturate(1.6);
  -webkit-backdrop-filter: blur(30px) saturate(1.6);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  padding: 0 8px 0 8px;
  gap: 12px;
  overflow: hidden;
  transition: transform 0.45s var(--kp-ease), opacity 0.3s ease;
}

html body.koshermusik-page .km-now-playing-mini.is-hidden {
  transform: translateY(calc(100% + 60px));
  opacity: 0;
}

html body.koshermusik-page .km-mini-art-wrap { width: 48px; height: 48px; }
html body.koshermusik-page .km-mini-artwork,
html body.koshermusik-page .km-mini-art-placeholder { border-radius: 12px; }

html body.koshermusik-page .km-mini-title { font-size: 0.9rem; font-weight: 650; }
html body.koshermusik-page .km-mini-artist { font-size: 0.74rem; }

html body.koshermusik-page .km-mini-play,
html body.koshermusik-page .km-mini-next {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 0;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s var(--kp-ease), background 0.2s ease;
}
/* invisible expander so the real hit area is larger than the visible disc */
html body.koshermusik-page .km-mini-play::after,
html body.koshermusik-page .km-mini-next::after {
  content: '';
  position: absolute;
  inset: -6px;
}
html body.koshermusik-page .km-mini-play { background: #fff; }
html body.koshermusik-page .km-mini-play svg { width: 22px; height: 22px; fill: #0b0b0c; }
html body.koshermusik-page .km-mini-next { background: transparent; }
html body.koshermusik-page .km-mini-next svg { width: 24px; height: 24px; fill: rgba(255, 255, 255, 0.85); pointer-events: none; }
html body.koshermusik-page .km-mini-play:hover { transform: scale(1.06); }
html body.koshermusik-page .km-mini-next:hover { background: rgba(255, 255, 255, 0.08); }
html body.koshermusik-page .km-mini-play:active,
html body.koshermusik-page .km-mini-next:active { transform: scale(0.9); }

html body.koshermusik-page .km-mini-progress-bar {
  left: 14px;
  right: 14px;
  width: auto;
  bottom: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(90deg, #ff6b6b, var(--kp-red));
}

/* ---------- Now Playing sheet ---------- */
#kmNowPlayingSheet.km-now-playing-sheet {
  display: block;
  padding: 0;
  background: #070708;
  color: var(--kp-text);
  overflow-y: auto;
  transition: transform 0.55s var(--kp-ease);
}

#kmNowPlayingSheet .km-sheet-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
#kmNowPlayingSheet .km-sheet-bg img {
  position: absolute;
  inset: -20%;
  width: 140%;
  height: 140%;
  object-fit: cover;
  filter: blur(70px) saturate(1.8) brightness(0.55);
  opacity: 0.9;
  transform: scale(1.1);
  transition: opacity 0.6s ease;
}
#kmNowPlayingSheet .km-sheet-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(7, 7, 8, 0.15) 0%, rgba(7, 7, 8, 0.55) 55%, #070708 100%);
}

#kmNowPlayingSheet .km-sheet-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top, 0px) + 8px) 22px calc(env(safe-area-inset-bottom, 0px) + 40px);
  display: flex;
  flex-direction: column;
}

/* header */
#kmNowPlayingSheet .km-sheet-head {
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
#kmNowPlayingSheet .km-sheet-head-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  text-align: center;
}
#kmNowPlayingSheet .km-sheet-eyebrow {
  font-family: 'Syne', sans-serif;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--kp-dim);
}
#kmNowPlayingSheet .km-sheet-album {
  max-width: 100%;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.86rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}

#kmNowPlayingSheet .km-sheet-close,
#kmNowPlayingSheet .km-sheet-iconbtn {
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  margin: 0;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s ease, transform 0.15s var(--kp-ease);
}
#kmNowPlayingSheet .km-sheet-close:hover,
#kmNowPlayingSheet .km-sheet-iconbtn:hover { background: rgba(255, 255, 255, 0.16); }
#kmNowPlayingSheet .km-sheet-close:active,
#kmNowPlayingSheet .km-sheet-iconbtn:active { transform: scale(0.9); }
#kmNowPlayingSheet .km-sheet-close svg,
#kmNowPlayingSheet .km-sheet-iconbtn svg { width: 22px; height: 22px; pointer-events: none; fill: none; }
#kmNowPlayingSheet .km-sheet-iconbtn svg path[fill="currentColor"] { fill: currentColor; }

/* artwork */
#kmNowPlayingSheet .km-sheet-main { display: flex; flex-direction: column; }

#kmNowPlayingSheet .km-sheet-artwork {
  width: min(100%, 380px, 46vh);
  /* svh = height with the browser bars showing (vh ignores them on iOS, pushing volume off-screen);
     the art gets what's left after header, title, progress, controls and volume (~470px) */
  width: min(100%, 380px, 46svh, calc(100svh - 470px));
  min-width: 96px;
  aspect-ratio: 1;
  height: auto;
  margin: 18px auto 26px;
  border-radius: 22px;
  overflow: hidden;
  background: #151517;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.06);
  transform: scale(0.88);
  transition: transform 0.6s var(--kp-ease), box-shadow 0.6s ease;
}
#kmNowPlayingSheet.is-playing .km-sheet-artwork { transform: scale(1); }
#kmNowPlayingSheet .km-sheet-artwork img { width: 100%; height: 100%; object-fit: cover; display: block; }
#kmNowPlayingSheet .km-sheet-art-placeholder {
  width: 100%; height: 100%; display: grid; place-items: center;
  background: linear-gradient(145deg, rgba(255, 45, 45, 0.25), rgba(255, 255, 255, 0.04));
}
#kmNowPlayingSheet .km-sheet-art-placeholder svg { width: 38%; height: 38%; color: rgba(255, 255, 255, 0.7); }

/* title row */
#kmNowPlayingSheet .km-sheet-track-info {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  margin: 0 0 14px;
}
#kmNowPlayingSheet .km-sheet-track-text { flex: 1; min-width: 0; }
#kmNowPlayingSheet .km-sheet-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#kmNowPlayingSheet .km-sheet-artist {
  font-size: 0.98rem;
  color: var(--kp-dim);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#kmNowPlayingSheet .km-sheet-like {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s ease, transform 0.2s var(--kp-ease), color 0.2s ease;
}
#kmNowPlayingSheet .km-sheet-like svg { width: 24px; height: 24px; pointer-events: none; fill: none; }
#kmNowPlayingSheet .km-sheet-like:hover { background: rgba(255, 255, 255, 0.16); }
#kmNowPlayingSheet .km-sheet-like:active { transform: scale(0.88); }
#kmNowPlayingSheet .km-sheet-like.is-liked { color: var(--kp-red); background: var(--kp-red-soft); }
#kmNowPlayingSheet .km-sheet-like.is-liked svg { fill: currentColor; animation: kpPop 0.35s var(--kp-ease); }
@keyframes kpPop { 0% { transform: scale(0.6); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }

/* progress: 36px hit zone around a slim rail */
#kmNowPlayingSheet .km-sheet-progress { margin: 0 0 8px; max-width: none; width: 100%; padding: 0; }
#kmNowPlayingSheet .km-sheet-progress-track {
  position: relative;
  height: 36px;
  display: flex;
  align-items: center;
  cursor: pointer;
  touch-action: none;
  background: none;
  border-radius: 0;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
#kmNowPlayingSheet .km-sheet-progress-rail {
  position: relative;
  width: 100%;
  height: 5px;
  border-radius: 5px;
  background: var(--kp-faint);
  transition: height 0.18s ease;
}
#kmNowPlayingSheet .km-sheet-progress-track:hover .km-sheet-progress-rail,
#kmNowPlayingSheet.is-seeking .km-sheet-progress-rail,
#kmNowPlayingSheet .km-sheet-progress-track:focus-visible .km-sheet-progress-rail { height: 9px; }
#kmNowPlayingSheet .km-sheet-progress-fill {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: #fff;
  transform: scaleX(0);
  transform-origin: 0 50%;
  will-change: transform;
}
#kmNowPlayingSheet .km-sheet-progress-thumb {
  position: absolute;
  top: 50%;
  left: 0;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  transform: scale(0);
  transition: transform 0.18s var(--kp-ease);
}
#kmNowPlayingSheet .km-sheet-progress-track:hover .km-sheet-progress-thumb,
#kmNowPlayingSheet.is-seeking .km-sheet-progress-thumb,
#kmNowPlayingSheet .km-sheet-progress-track:focus-visible .km-sheet-progress-thumb { transform: scale(1); }
@media (hover: none) {
  #kmNowPlayingSheet .km-sheet-progress-thumb { transform: scale(0.75); }
}
#kmNowPlayingSheet .km-sheet-progress-times {
  display: flex;
  justify-content: space-between;
  margin-top: -4px;
  font-size: 0.74rem;
  font-variant-numeric: tabular-nums;
  color: var(--kp-dim);
}

/* transport */
#kmNowPlayingSheet .km-sheet-controls {
  display: grid;
  grid-template-columns: 1fr 1fr 84px 1fr 1fr;
  align-items: center;
  justify-items: center;
  gap: 0;
  width: 100%;
  max-width: none;
  margin: 8px 0 14px;
}
#kmNowPlayingSheet .km-sheet-ctrl {
  position: relative;
  width: 56px;
  height: 56px;
  min-width: 56px;
  min-height: 56px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: rgba(255, 255, 255, 0.92);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s var(--kp-ease);
}
#kmNowPlayingSheet .km-sheet-ctrl::after { content: ''; position: absolute; inset: -4px; }
#kmNowPlayingSheet .km-sheet-ctrl svg { width: 28px; height: 28px; pointer-events: none; }
#kmNowPlayingSheet .km-sheet-ctrl:hover { background: rgba(255, 255, 255, 0.09); }
#kmNowPlayingSheet .km-sheet-ctrl:active { transform: scale(0.88); }

#kmNowPlayingSheet .km-sheet-ctrl.km-ctrl-skip svg { width: 32px; height: 32px; }

#kmNowPlayingSheet .km-sheet-ctrl.km-ctrl-play {
  width: 80px;
  height: 80px;
  background: #fff;
  color: #0b0b0c;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), 0 0 0 0 rgba(255, 255, 255, 0.35);
}
#kmNowPlayingSheet .km-sheet-ctrl.km-ctrl-play svg { width: 34px; height: 34px; fill: currentColor; }
#kmNowPlayingSheet .km-sheet-ctrl.km-ctrl-play:hover { background: #fff; transform: scale(1.05); }
#kmNowPlayingSheet .km-sheet-ctrl.km-ctrl-play:active { transform: scale(0.93); }
#kmNowPlayingSheet.is-playing .km-sheet-ctrl.km-ctrl-play { animation: kpPulse 2.6s ease-out infinite; }
@keyframes kpPulse { 0% { box-shadow: 0 10px 30px rgba(0,0,0,.45), 0 0 0 0 rgba(255,255,255,.28); } 70%,100% { box-shadow: 0 10px 30px rgba(0,0,0,.45), 0 0 0 18px rgba(255,255,255,0); } }

/* shuffle / repeat: dim until active, red + glow dot when on */
#kmNowPlayingSheet .km-ctrl-mode { color: rgba(255, 255, 255, 0.5); }
#kmNowPlayingSheet .km-ctrl-mode.is-active { color: var(--kp-red); background: var(--kp-red-soft); }
#kmNowPlayingSheet .km-mode-dot {
  position: absolute; bottom: 5px; left: 50%; width: 4px; height: 4px; margin-left: -2px;
  border-radius: 50%; background: var(--kp-red); opacity: 0; transform: scale(0); transition: all 0.2s var(--kp-ease);
}
#kmNowPlayingSheet .km-ctrl-mode.is-active .km-mode-dot { opacity: 1; transform: scale(1); }
#kmNowPlayingSheet .km-mode-tag {
  position: absolute; bottom: 3px; left: 50%; transform: translateX(-50%);
  font-family: 'Syne', sans-serif; font-size: 0.5rem; font-weight: 800; letter-spacing: 0.12em;
  color: var(--kp-red); line-height: 1; pointer-events: none;
}
#kmNowPlayingSheet .km-sheet-ctrl[data-mode="album"] svg,
#kmNowPlayingSheet .km-sheet-ctrl[data-mode="one"] svg { transform: translateY(-4px); }

/* volume: whole 48px row is the hit zone */
#kmNowPlayingSheet .km-sheet-volume {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: none;
  margin: 0 0 22px;
  padding: 0;
  touch-action: none;
}
#kmNowPlayingSheet .km-sheet-mute { background: transparent; flex-shrink: 0; color: var(--kp-dim); }
#kmNowPlayingSheet .km-sheet-mute:hover { color: #fff; }

#kmNowPlayingSheet .km-sheet-volume input[type="range"] {
  --km-vol: 70%;
  flex: 1;
  min-width: 0;
  width: 100%;
  height: 48px;
  margin: 0;
  padding: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
  cursor: pointer;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}
#kmNowPlayingSheet .km-sheet-volume input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 6px;
  background: linear-gradient(to right, #fff var(--km-vol), var(--kp-faint) var(--km-vol));
}
#kmNowPlayingSheet .km-sheet-volume input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  margin-top: -8px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  transition: transform 0.15s var(--kp-ease);
}
#kmNowPlayingSheet .km-sheet-volume input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.2); }
#kmNowPlayingSheet .km-sheet-volume input[type="range"]::-moz-range-track { height: 6px; border-radius: 6px; background: var(--kp-faint); }
#kmNowPlayingSheet .km-sheet-volume input[type="range"]::-moz-range-progress { height: 6px; border-radius: 6px; background: #fff; }
#kmNowPlayingSheet .km-sheet-volume input[type="range"]::-moz-range-thumb { width: 22px; height: 22px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.5); }
#kmNowPlayingSheet .km-sheet-volume input[type="range"]:focus-visible { outline: 2px solid rgba(255,255,255,.5); outline-offset: 2px; border-radius: 8px; }

/* up next */
#kmNowPlayingSheet .km-sheet-queue {
  max-width: none;
  width: 100%;
  padding: 16px 12px 10px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
#kmNowPlayingSheet .km-sheet-queue-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 6px 8px; }
#kmNowPlayingSheet .km-sheet-queue-title { margin: 0; font-family: 'Syne', sans-serif; font-size: 0.78rem; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; color: #fff; }
#kmNowPlayingSheet .km-sheet-queue-chip {
  font-size: 0.66rem; font-weight: 700; letter-spacing: 0.04em; padding: 4px 10px;
  border-radius: 99px; background: var(--kp-red-soft); color: #ff8a8a;
}
#kmNowPlayingSheet .km-sheet-queue-list { display: flex; flex-direction: column; gap: 2px; }
#kmNowPlayingSheet .km-sheet-queue-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 60px;
  padding: 6px 8px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: inherit;
  text-align: left;
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.18s ease, transform 0.12s ease;
}
#kmNowPlayingSheet .km-sheet-queue-item:hover { background: rgba(255, 255, 255, 0.07); }
#kmNowPlayingSheet .km-sheet-queue-item:active { transform: scale(0.985); }
#kmNowPlayingSheet .km-sheet-queue-art { width: 46px; height: 46px; flex-shrink: 0; border-radius: 9px; overflow: hidden; background: linear-gradient(145deg, rgba(255,45,45,.3), rgba(255,255,255,.05)); }
#kmNowPlayingSheet .km-sheet-queue-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
#kmNowPlayingSheet .km-sheet-queue-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
#kmNowPlayingSheet .km-sheet-queue-name { font-size: 0.92rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#kmNowPlayingSheet .km-sheet-queue-artist { font-size: 0.76rem; color: var(--kp-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#kmNowPlayingSheet .km-sheet-queue-dur { font-size: 0.76rem; color: var(--kp-dim); font-variant-numeric: tabular-nums; }
#kmNowPlayingSheet .km-sheet-queue-next {
  position: absolute; top: 6px; right: 8px; font-family: 'Syne', sans-serif; font-size: 0.5rem; font-weight: 800;
  letter-spacing: 0.14em; color: var(--kp-red); display: none;
}
#kmNowPlayingSheet .km-sheet-queue-empty { padding: 18px 10px; text-align: center; font-size: 0.86rem; color: var(--kp-dim); }
#kmNowPlayingSheet .km-sheet-queue-empty strong { color: #fff; }

/* desktop: artwork + controls left, queue right */
@media (min-width: 960px) {
  #kmNowPlayingSheet .km-sheet-inner {
    max-width: 1040px;
    display: grid;
    grid-template-columns: minmax(380px, 460px) 1fr;
    grid-template-rows: auto 1fr;
    column-gap: 56px;
    padding-top: 14px;
  }
  #kmNowPlayingSheet .km-sheet-artwork { width: min(100%, 380px, 38vh); width: min(100%, 380px, 38svh, calc(100svh - 540px)); margin: 6px auto 18px; }
  #kmNowPlayingSheet .km-sheet-volume { margin-bottom: 8px; }
  #kmNowPlayingSheet .km-sheet-head { grid-column: 1 / -1; max-width: 460px; width: 100%; margin: 0 auto 0 0; }
  #kmNowPlayingSheet .km-sheet-main { grid-column: 1; }
  #kmNowPlayingSheet .km-sheet-queue { grid-column: 2; grid-row: 2; align-self: start; margin-top: 18px; max-height: calc(100vh - 140px); overflow: auto; }
}

@media (max-height: 700px) {
  #kmNowPlayingSheet .km-sheet-artwork { width: min(100%, 300px, 40vh); width: min(100%, 300px, calc(100svh - 440px)); margin: 8px auto 16px; }
  #kmNowPlayingSheet .km-sheet-controls { margin: 4px 0 6px; }
}

@media (prefers-reduced-motion: reduce) {
  #kmNowPlayingSheet *, html body.koshermusik-page .km-now-playing-mini { animation: none !important; transition-duration: 0.01ms !important; }
}

/* ===== Playlists / liked songs ===== */
.km-pl-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 14px;
  margin: 0 -2px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.km-pl-chips::-webkit-scrollbar { display: none; }
.km-pl-chip {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.85);
  font: 600 0.84rem 'Space Grotesk', sans-serif;
  white-space: nowrap;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s ease, color 0.2s ease, transform 0.12s ease, border-color 0.2s ease;
}
.km-pl-chip:hover { background: rgba(255, 255, 255, 0.12); }
.km-pl-chip:active { transform: scale(0.96); }
.km-pl-chip.is-active { background: #fff; color: #0b0b0c; border-color: #fff; }
.km-pl-chip-count {
  font-size: 0.7rem; font-weight: 700; padding: 2px 7px; border-radius: 99px;
  background: rgba(255, 255, 255, 0.14); color: inherit;
}
.km-pl-chip.is-active .km-pl-chip-count { background: rgba(0, 0, 0, 0.12); }
.km-pl-chip--new { border-style: dashed; color: var(--kp-red, #ff2d2d); background: transparent; }

.km-pl-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 12px 14px; margin-bottom: 14px; border-radius: 16px;
  background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.07);
}
.km-pl-toolbar[hidden] { display: none; }
.km-pl-toolbar-info { font-size: 0.86rem; color: rgba(255, 255, 255, 0.6); }
.km-pl-toolbar-info strong { color: #fff; }
.km-pl-toolbar-actions { display: flex; gap: 8px; align-items: center; }

.km-pl-btn {
  min-height: 44px; padding: 0 18px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 99px; font: 700 0.86rem 'Space Grotesk', sans-serif; color: #fff;
  background: rgba(255, 255, 255, 0.1); cursor: pointer; touch-action: manipulation;
  -webkit-tap-highlight-color: transparent; transition: background 0.2s ease, transform 0.12s ease, opacity 0.2s ease;
}
.km-pl-btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.km-pl-btn:hover { background: rgba(255, 255, 255, 0.18); }
.km-pl-btn:active { transform: scale(0.96); }
.km-pl-btn:disabled { opacity: 0.4; pointer-events: none; }
.km-pl-btn--primary { background: #fff; color: #0b0b0c; }
.km-pl-btn--primary:hover { background: #fff; }
.km-pl-btn--ghost { background: rgba(255, 255, 255, 0.1); }
.km-pl-btn--icon { width: 44px; padding: 0; }
.km-pl-btn--danger:hover { background: rgba(255, 60, 60, 0.25); color: #ff8a8a; }
.km-pl-btn--danger-solid { background: #e5303a; }
.km-pl-btn--danger-solid:hover { background: #ff3b46; }
.km-pl-btn--new { width: 100%; margin-top: 12px; background: transparent; border: 1px dashed rgba(255, 255, 255, 0.25); }

/* song-row add / remove buttons */
.km-song-row-add, .km-song-row-remove {
  flex-shrink: 0; width: 44px; height: 44px; display: grid; place-items: center; padding: 0;
  border: 0; border-radius: 50%; background: transparent; color: rgba(255, 255, 255, 0.45);
  cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  transition: background 0.2s ease, color 0.2s ease, transform 0.12s ease;
}
.km-song-row-add svg, .km-song-row-remove svg { width: 20px; height: 20px; pointer-events: none; }
.km-song-row-add:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.km-song-row-remove:hover { background: rgba(255, 60, 60, 0.2); color: #ff8a8a; }
.km-song-row-add:active, .km-song-row-remove:active { transform: scale(0.88); }
.km-song-row-like { min-width: 44px; min-height: 44px; }

/* sheet add-to-playlist button sits beside the heart */
#kmNowPlayingSheet .km-sheet-addpl svg { fill: none; }
#kmNowPlayingSheet .km-sheet-addpl.is-liked { color: #fff; background: rgba(255, 255, 255, 0.08); }

/* modal / bottom sheet */
.km-pl-modal { position: fixed; inset: 0; z-index: 3000; display: flex; align-items: flex-end; justify-content: center; opacity: 0; transition: opacity 0.22s ease; }
.km-pl-modal.is-open { opacity: 1; }
.km-pl-modal-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.62); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.km-pl-modal-card {
  position: relative; width: 100%; max-width: 480px; max-height: 82vh; overflow-y: auto;
  padding: 10px 20px calc(env(safe-area-inset-bottom, 0px) + 22px);
  border-radius: 26px 26px 0 0; background: #151517; border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.6); color: #fff;
  transform: translateY(40px); transition: transform 0.35s var(--kp-ease, ease);
}
.km-pl-modal.is-open .km-pl-modal-card { transform: translateY(0); }
@media (min-width: 640px) {
  .km-pl-modal { align-items: center; }
  .km-pl-modal-card { border-radius: 26px; padding-top: 22px; padding-bottom: 22px; }
}
.km-pl-modal-handle { width: 38px; height: 4px; margin: 0 auto 14px; border-radius: 4px; background: rgba(255, 255, 255, 0.22); }
.km-pl-modal-title { margin: 0 0 4px; font: 700 1.15rem 'Space Grotesk', sans-serif; }
.km-pl-modal-sub { margin: 0 0 14px; font-size: 0.86rem; color: rgba(255, 255, 255, 0.55); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.km-pl-modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.km-pl-modal-actions .km-pl-btn { flex: 1; }
.km-pl-input {
  width: 100%; height: 52px; margin-top: 14px; padding: 0 16px; border-radius: 14px; font: 500 1rem 'Space Grotesk', sans-serif;
  color: #fff; background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.12); outline: none;
}
.km-pl-input:focus { border-color: rgba(255, 255, 255, 0.5); background: rgba(255, 255, 255, 0.1); }

.km-pl-pick-list { display: flex; flex-direction: column; gap: 4px; }
.km-pl-pick {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 8px 10px;
  border: 0; border-radius: 14px; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent; transition: background 0.18s ease;
}
.km-pl-pick:hover { background: rgba(255, 255, 255, 0.07); }
.km-pl-pick-icon { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(145deg, rgba(255, 45, 45, 0.3), rgba(255, 255, 255, 0.06)); }
.km-pl-pick-icon svg { width: 22px; height: 22px; }
.km-pl-pick-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.km-pl-pick-name { font-weight: 600; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.km-pl-pick-count { font-size: 0.76rem; color: rgba(255, 255, 255, 0.5); }
.km-pl-check { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; border: 2px solid rgba(255, 255, 255, 0.25); color: transparent; transition: all 0.2s var(--kp-ease, ease); }
.km-pl-check svg { width: 14px; height: 14px; }
.km-pl-pick.is-on .km-pl-check { background: #fff; border-color: #fff; color: #0b0b0c; }
.km-pl-empty-note { padding: 14px 4px; color: rgba(255, 255, 255, 0.55); font-size: 0.9rem; }

.km-pl-toast {
  position: fixed; left: 50%; bottom: calc(var(--km-tab-bar-total, 64px) + 90px); z-index: 3100;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none; max-width: 86vw;
  padding: 12px 20px; border-radius: 99px; background: #fff; color: #0b0b0c; font: 700 0.86rem 'Space Grotesk', sans-serif;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); transition: opacity 0.25s ease, transform 0.35s var(--kp-ease, ease);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.km-pl-toast.is-show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 560px) {
  .km-song-row { gap: 8px; padding: 8px 6px 8px 10px; }
  .km-song-row .km-song-row-plays { display: none; }
  .km-song-row .km-song-row-num { min-width: 16px; width: 16px; font-size: 0.7rem; }
  .km-song-row .km-song-row-info { flex: 1 1 0; min-width: 0; }
  .km-song-row .km-song-row-dur { font-size: 0.72rem; }
  .km-song-row-add, .km-song-row-remove, .km-song-row-like { width: 40px; height: 40px; min-width: 40px; min-height: 40px; padding: 0; }
}

/* ===== More menu: scrollable on short phones (links + theme were cut off below the fold) ===== */
html body.koshermusik-page .km-more-menu-panel {
  max-height: min(88dvh, 88vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

/* ===== Home "Tap to listen" button ===== */
.km-listen-btn {
  display: flex; align-items: center; gap: 14px; margin: 22px auto 0; padding: 10px 12px 10px 10px;
  width: min(100%, 360px); border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 22px; text-align: left; color: #fff;
  background: linear-gradient(135deg, rgba(255, 45, 45, 0.35), rgba(255, 255, 255, 0.07));
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45), 0 0 0 0 rgba(255, 45, 45, 0.4);
  cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s ease, background 0.2s ease; animation: kpListenPulse 2.8s ease-out infinite;
}
.km-listen-btn[hidden] { display: none; }
.km-listen-btn:active { transform: scale(0.97); }
.km-listen-btn.is-playing { animation: none; background: rgba(255, 255, 255, 0.08); }
@keyframes kpListenPulse { 0% { box-shadow: 0 14px 40px rgba(0,0,0,.45), 0 0 0 0 rgba(255,45,45,.45); } 70%,100% { box-shadow: 0 14px 40px rgba(0,0,0,.45), 0 0 0 16px rgba(255,45,45,0); } }
.km-listen-art { width: 56px; height: 56px; flex-shrink: 0; border-radius: 14px; background: #111 center / cover no-repeat; }
.km-listen-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.km-listen-label { font: 800 0.62rem 'Syne', sans-serif; letter-spacing: 0.18em; text-transform: uppercase; color: rgba(255, 255, 255, 0.7); }
.km-listen-track { font: 700 1rem 'Space Grotesk', sans-serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.km-listen-action { width: 48px; height: 48px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; background: #fff; color: #0b0b0c; }
.km-listen-play { width: 22px; height: 22px; }
.km-listen-eq { display: none; gap: 3px; align-items: flex-end; height: 18px; }
.km-listen-eq i { width: 3px; border-radius: 2px; background: #0b0b0c; animation: kpEq 0.9s ease-in-out infinite; }
.km-listen-eq i:nth-child(2) { animation-delay: 0.15s; } .km-listen-eq i:nth-child(3) { animation-delay: 0.3s; } .km-listen-eq i:nth-child(4) { animation-delay: 0.45s; }
@keyframes kpEq { 0%,100% { height: 5px; } 50% { height: 18px; } }
.km-listen-btn.is-playing .km-listen-play { display: none; }
.km-listen-btn.is-playing .km-listen-eq { display: flex; }
@media (prefers-reduced-motion: reduce) { .km-listen-btn, .km-listen-eq i { animation: none; } }

/* song detail modal buttons: 44px minimum on touch */
.km-song-detail-actions button { min-height: 44px; }

/* ===== Live waveform in the seek bar ===== */
#kmNowPlayingSheet .km-sheet-progress-track { height: 64px; }
#kmNowPlayingSheet .km-sheet-wave {
  position: absolute; inset: 0; width: 100%; height: 100%; display: none; pointer-events: none;
}
#kmNowPlayingSheet.has-wave .km-sheet-wave { display: block; }
/* when the wave is on it replaces the thin rail visually (rail still handles seeking) */
#kmNowPlayingSheet.has-wave .km-sheet-progress-rail { background: transparent; height: 100%; }
#kmNowPlayingSheet.has-wave .km-sheet-progress-fill,
#kmNowPlayingSheet.has-wave .km-sheet-progress-thumb { display: none; }
#kmNowPlayingSheet.has-wave .km-sheet-progress-times { margin-top: 0; }

/* More-menu switch row */
.km-wave-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-bottom: 14px; margin-bottom: 4px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.km-wave-row-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.km-wave-row-hint { font-size: 0.74rem; line-height: 1.35; color: rgba(255, 255, 255, 0.5); }
.km-switch { position: relative; flex-shrink: 0; width: 56px; height: 34px; border: 0; border-radius: 99px; background: rgba(255, 255, 255, 0.16); cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; transition: background 0.2s ease; }
.km-switch::after { content: ''; position: absolute; inset: -6px; }
.km-switch i { position: absolute; top: 4px; left: 4px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4); transition: transform 0.25s var(--kp-ease, ease); }
.km-switch.is-on { background: var(--kp-red, #ff2d2d); }
.km-switch.is-on i { transform: translateX(22px); }
.km-audio-controls .km-wave-row { flex-direction: row !important; align-items: center; }

/* ===== Share sheet with live preview ===== */
.km-share-card { max-width: 560px; }
.km-share-preview { margin: 4px 0 14px; border-radius: 18px; overflow: hidden; background: #0d0d0f; }
.km-share-preview iframe { display: block; width: 100%; border: 0; }
.km-share-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.km-share-actions .km-pl-btn { flex: 1 1 140px; }
.km-share-card .km-pl-modal-sub { white-space: normal; }

/* shuffle: re-deal animation + chip that turns it off */
#kmNowPlayingSheet #kmSheetShuffle.is-dealing svg { animation: kpDeal .5s var(--kp-ease); }
@keyframes kpDeal { 0% { transform: rotate(0) scale(1); } 40% { transform: rotate(-18deg) scale(1.25); } 100% { transform: rotate(0) scale(1); } }
#kmNowPlayingSheet .km-sheet-queue-chip { display: inline-flex; gap: 6px; align-items: center; }
#kmNowPlayingSheet .km-chip-off { font: inherit; color: inherit; background: none; border: 0; padding: 4px 2px; cursor: pointer; }

/* buffering: spinning ring on the play buttons while a song loads (slow WAVs no longer look frozen) */
#kmNowPlayingSheet .km-sheet-ctrl.km-ctrl-play.is-buffering::before,
html body.koshermusik-page .km-mini-play.is-buffering::before {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.16);
  border-top-color: var(--kp-red);
  animation: kpSpin 0.8s linear infinite;
  pointer-events: none;
}
html body.koshermusik-page .km-mini-play.is-buffering::before { inset: -3px; }
#kmNowPlayingSheet .km-sheet-ctrl.km-ctrl-play.is-buffering { animation: none; }
@keyframes kpSpin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  #kmNowPlayingSheet .km-sheet-ctrl.km-ctrl-play.is-buffering::before,
  html body.koshermusik-page .km-mini-play.is-buffering::before { animation-duration: 2.4s; }
}

/* keyboard focus on the transport controls */
#kmNowPlayingSheet .km-sheet-ctrl:focus-visible,
#kmNowPlayingSheet .km-sheet-iconbtn:focus-visible,
#kmNowPlayingSheet .km-sheet-like:focus-visible,
html body.koshermusik-page .km-mini-play:focus-visible,
html body.koshermusik-page .km-mini-next:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.7);
  outline-offset: 3px;
}
html body.koshermusik-page .km-now-playing-mini:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.55);
  outline-offset: 2px;
}

/* iOS / iPadOS: volume is hardware-only, so the row shows mute + a hint instead of a dead slider */
#kmNowPlayingSheet .km-sheet-volume.is-mute-only { justify-content: flex-start; }
#kmNowPlayingSheet .km-sheet-volume.is-mute-only input[type="range"] { display: none; }
#kmNowPlayingSheet .km-sheet-vol-hint { font-size: 0.78rem; color: var(--kp-dim); }

/* sheet header: studio + share buttons on the right */
#kmNowPlayingSheet .km-sheet-head { grid-template-columns: 104px 1fr 104px; }
#kmNowPlayingSheet .km-sheet-head-right { display: flex; gap: 8px; justify-content: flex-end; }
