.playlist-show {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  padding: var(--space-5) var(--space-5) var(--space-7);
  min-height: 100vh;
}

.playlist-show__header {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  padding-top: var(--space-2);
}

.playlist-show__back {
  position: absolute;
  top: 0;
  left: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: var(--color-text-base);
  background: transparent;
  border-radius: var(--radius-circle);
  text-decoration: none;
  transition: background-color 0.15s ease;
  z-index: 1;
}

.playlist-show__back:hover {
  background-color: var(--color-bg-elevated);
  text-decoration: none;
}

.playlist-show__hero {
  margin-top: var(--space-7);
  display: flex;
  align-items: flex-end;
  min-height: 180px;
  padding: var(--space-5);
  border-radius: var(--radius-comfortable);
  background: linear-gradient(
    180deg,
    var(--color-announcement) 0%,
    color-mix(in srgb, var(--color-announcement) 35%, var(--color-bg-base)) 100%
  );
  box-shadow: var(--shadow-heavy);
}

.playlist-show__hero--image {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
  overflow: hidden;
}

.playlist-show__hero--image::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 0.7) 100%
  );
  pointer-events: none;
}

.playlist-show__hero--image .playlist-show__name {
  position: relative;
  z-index: 1;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.playlist-show__name {
  font-family: var(--font-title);
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-text-base);
  margin: 0;
  text-align: left;
  word-break: break-word;
}

.playlist-show__name-link {
  color: inherit;
  text-decoration: none;
  position: relative;
  z-index: 1;
}

.playlist-show__name-link:hover .playlist-show__name {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.playlist-show__hero--image .playlist-show__name-link {
  z-index: 2;
}

.playlist-show__name-form {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
}

.playlist-show__name-input.clear-input {
  font-family: var(--font-title);
  font-size: 2rem;
  font-weight: 700;
  flex: 1 1 0;
  min-width: 0;
  width: 100%;
}

.playlist-show__name-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border: 0;
  border-radius: var(--radius-circle);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
  text-decoration: none;
}

.playlist-show__name-btn--save {
  background-color: var(--color-accent);
  color: var(--color-text-light);
}

.playlist-show__name-btn--save:hover {
  background-color: var(--color-accent-hover);
}

.playlist-show__name-btn--cancel {
  background-color: var(--color-bg-base);
  color: var(--color-text-light);
}

.playlist-show__name-btn--cancel:hover {
  background-color: var(--color-bg-surface);
  color: var(--color-text-light);
  text-decoration: none;
}

.playlist-show__name-error {
  position: relative;
  z-index: 2;
  margin: var(--space-2) 0 0;
  font-family: var(--font-ui);
  font-size: 0.875rem;
  color: var(--color-negative);
}

.playlist-show__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.playlist-show__icon-form {
  margin: 0;
  display: contents;
}

.playlist-show__actions-left {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--space-3);
}

.playlist-show__icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: transparent;
  border: 0;
  padding: 0;
  color: var(--color-text-muted);
  cursor: pointer;
  border-radius: var(--radius-circle);
  transition: color 0.15s ease, transform 0.1s ease;
}

.playlist-show__icon-btn:hover {
  color: var(--color-text-base);
}

.playlist-show__icon-btn:active {
  transform: scale(0.96);
}

.playlist-show__play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background-color: var(--color-accent);
  color: var(--color-bg-base);
  border: 0;
  padding: 0;
  border-radius: var(--radius-circle);
  cursor: pointer;
  transition: transform 0.1s ease, background-color 0.15s ease;
}

.playlist-show__play .icon svg {
  width: 25px;
  height: 25px;
}

.playlist-show__play:hover {
  background-color: var(--color-accent-hover);
  transform: scale(1.04);
}

.playlist-show__play:active {
  transform: scale(0.96);
}

.playlist-show__songs {
  list-style: none;
  margin: 0 0 50px 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.playlist-song {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2);
  border-radius: var(--radius-standard);
  transition: background-color 0.15s ease;
}

.playlist-song:hover {
  background-color: var(--color-bg-surface);
}

.playlist-song__art {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: var(--radius-subtle);
  object-fit: cover;
}

.playlist-song__art--placeholder {
  background-color: var(--color-bg-elevated);
}

.playlist-song__link {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-decoration: none;
  color: inherit;
}

.playlist-song__link:hover {
  text-decoration: none;
}

.playlist-song__meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.playlist-song__name {
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text-base);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.playlist-song.is-selected .playlist-song__name,
.playlist-song.is-selected .playlist-song__authors {
  color: var(--color-accent);
}

.playlist-song__authors {
  font-family: var(--font-ui);
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--color-text-muted);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.playlist-song__heart {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: transparent;
  border: 0;
  padding: 0;
  color: var(--color-text-muted);
  cursor: pointer;
  border-radius: var(--radius-circle);
  flex-shrink: 0;
  transition: color 0.15s ease, transform 0.1s ease;
}

.playlist-song__heart:hover {
  color: var(--color-text-base);
}

.playlist-song__heart:active {
  transform: scale(0.94);
}

.playlist-show__empty {
  font-family: var(--font-ui);
  font-size: 0.95rem;
  color: var(--color-text-muted);
  text-align: center;
  padding: var(--space-9) 0;
  margin: 0;
}

.playlist-show__songs[data-controller~="sortable"] .playlist-song {
  touch-action: manipulation;
  user-select: none;
}

.playlist-song.sortable-chosen {
  background-color: var(--color-bg-elevated);
  box-shadow: var(--shadow-medium);
}

.playlist-song.sortable-ghost {
  opacity: 0.35;
  background-color: var(--color-bg-surface);
}

.playlist-song.sortable-drag {
  background-color: var(--color-bg-card);
  box-shadow: var(--shadow-heavy);
  border-radius: var(--radius-standard);
}

/* ===== Create-options modal ===== */

.create-options__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.create-options__option {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-2);
  text-decoration: none;
  color: var(--color-text-base);
  border-radius: var(--radius-standard);
  transition: background-color 0.15s ease;
}

.create-options__option:hover {
  background-color: var(--color-bg-elevated);
  text-decoration: none;
}

.create-options__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-circle);
  background-color: var(--color-bg-elevated);
  color: var(--color-text-base);
  flex-shrink: 0;
}

.create-options__name {
  flex: 1;
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 700;
}

.create-options__chevron {
  color: var(--color-text-muted);
  display: inline-flex;
}

/* ===== Footer "Create" button (button_to wraps in form) ===== */

.footer-nav__form {
  margin: 0;
  display: contents;
}

.footer-nav__item--button {
  background: transparent;
  border: 0;
  cursor: pointer;
  font: inherit;
}

/* ===== New playlist form ===== */

.playlist-new {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  padding: var(--space-5) var(--space-5) var(--space-7);
}

.playlist-new__header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.playlist-new__back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: var(--color-text-base);
  border-radius: var(--radius-circle);
  text-decoration: none;
}

.playlist-new__back:hover {
  background-color: var(--color-bg-elevated);
}

.playlist-new__title {
  font-family: var(--font-title);
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
}

.playlist-new__grid {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: var(--space-5);
  align-items: start;
}

@media (max-width: 480px) {
  .playlist-new__grid {
    grid-template-columns: 120px 1fr;
    gap: var(--space-3);
  }
}

.playlist-new__cover {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  background-color: var(--color-bg-card);
  border-radius: var(--radius-medium);
  overflow: hidden;
  cursor: pointer;
}

.playlist-new__file {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.playlist-new__preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.playlist-new__placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  color: var(--color-text-muted);
  font-family: var(--font-ui);
  font-size: 0.875rem;
}

.playlist-new__fields {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.playlist-new__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  cursor: pointer;
}

.playlist-new__toggle-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.playlist-new__toggle-title {
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-text-base);
}

.playlist-new__toggle-sub {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle__input {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.toggle__slider {
  position: absolute;
  inset: 0;
  background-color: var(--color-border);
  border-radius: var(--radius-full-pill);
  transition: background-color 0.2s ease;
}

.toggle__slider::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-circle);
  background-color: var(--color-text-base);
  transition: transform 0.2s ease;
}

.toggle__input:checked + .toggle__slider {
  background-color: var(--color-accent);
}

.toggle__input:checked + .toggle__slider::before {
  transform: translateX(20px);
}

.playlist-new__actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-7);
}

/* ===== Song-picker modal ===== */

.song-picker {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-height: 65vh;
}

.song-picker__search {
  position: relative;
  display: flex;
  align-items: center;
}

.song-picker__search-icon {
  position: absolute;
  left: var(--space-3);
  color: var(--color-text-muted);
  display: inline-flex;
  pointer-events: none;
}

.song-picker__input {
  width: 100%;
  padding: var(--space-3) var(--space-3) var(--space-3) calc(var(--space-3) * 3);
  background-color: var(--color-bg-elevated);
  border: 0;
  border-radius: var(--radius-pill);
  color: var(--color-text-base);
  font-family: var(--font-ui);
  font-size: 0.95rem;
}

.song-picker__input::placeholder {
  color: var(--color-text-muted);
}

.song-picker__input:focus {
  outline: none;
  box-shadow: var(--shadow-input-focus);
}

.song-picker__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  overflow-y: auto;
}

.song-picker__item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2);
  border-radius: var(--radius-standard);
}

.song-picker__art {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-subtle);
  object-fit: cover;
  background-color: var(--color-bg-elevated);
  flex-shrink: 0;
}

.song-picker__art--placeholder {
  background: linear-gradient(135deg, var(--color-bg-card), var(--color-bg-elevated));
}

.song-picker__meta {
  flex: 1;
  min-width: 0;
}

.song-picker__name {
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-text-base);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.song-picker__authors {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.song-picker__heart {
  background: transparent;
  border: 0;
  color: var(--color-text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2);
  border-radius: var(--radius-circle);
}

.song-picker__heart:hover {
  color: var(--color-text-base);
}

.song-picker__heart.heart-active {
  color: var(--color-accent);
}

.song-picker__heart[disabled] {
  cursor: default;
}

.song-picker__empty {
  text-align: center;
  color: var(--color-text-muted);
  padding: var(--space-5) 0;
  font-family: var(--font-ui);
  font-size: 0.875rem;
}
