.shelf-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
}
.shelf-toolbar-actions .new-album-button {
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 5px 13px;
  min-height: 38px;
  background: var(--paper);
}
.shelf-edit-toggle {
  font-size: 12px;
  color: var(--muted);
  padding: 9px 6px;
  min-height: 38px;
  white-space: nowrap;
}
.shelf-edit-toggle:hover,
.shelf-edit-toggle[aria-pressed='true'] {
  color: var(--rust);
}
.shelf-edit-toggle[aria-pressed='true'] {
  text-decoration: underline;
  text-underline-offset: 5px;
}
.shelf-panel {
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  transition:
    grid-template-columns 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    gap 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}
.shelf-panel .album-detail {
  min-width: 0;
  transition:
    opacity 0.22s,
    transform 0.45s;
  overflow: hidden;
}
.shelf-panel.is-shelf-editing {
  grid-template-columns: minmax(0, 2.5fr) minmax(0, 0fr);
  gap: 0;
}
.shelf-panel.is-shelf-editing .album-detail {
  opacity: 0;
  pointer-events: none;
  transform: translateX(26px);
  max-height: 0;
  padding: 0;
}
.shelf-panel .books {
  transition: height 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}
.shelf-panel.is-shelf-editing .books {
  height: 380px;
  padding-top: 40px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
}
.shelf-panel.is-shelf-editing .books.is-crowded {
  justify-content: flex-start;
}
.shelf-panel.is-shelf-editing .shelf-book {
  height: calc(var(--height) * 1.12);
  transition:
    height 0.55s,
    width 0.6s cubic-bezier(0.22, 1, 0.36, 1),
    flex-basis 0.6s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.3s;
  touch-action: none;
  cursor: grab;
}
.shelf-panel.is-shelf-editing .shelf-book[aria-pressed='true'] {
  width: 230px;
  flex-basis: 230px;
}
.shelf-panel.is-shelf-editing .shelf-book[aria-pressed='true'] .cover-photo {
  height: 165px;
}
.shelf-panel.is-shelf-editing .shelf-book:active {
  cursor: grabbing;
}
.shelf-edit-note {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.8;
  margin-top: 15px;
  min-height: 20px;
}
.shelf-edit-note.is-error {
  color: var(--rust);
}
.shelf-delete-book {
  position: absolute;
  z-index: 8;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--paper);
  color: var(--rust);
  border: 1px solid var(--line);
  font-size: 21px;
  line-height: 1;
  box-shadow: 0 3px 9px oklch(20% 0.02 60 / 0.12);
}
.shelf-delete-book:hover {
  background: var(--rust);
  color: var(--paper);
}
.shelf-book.is-shelf-dragging {
  opacity: 0.22;
}
.shelf-drag-ghost {
  position: fixed !important;
  z-index: 80 !important;
  margin: 0 !important;
  pointer-events: none !important;
  transition: none !important;
  transform: rotate(-3deg) !important;
  filter: drop-shadow(0 18px 16px oklch(20% 0.02 60 / 0.22));
  opacity: 0.94;
}
.shelf-dragging {
  cursor: grabbing;
  user-select: none;
}
.shelf-delete-dialog form label {
  display: block;
  font-size: 12px;
  margin: 18px 0 9px;
}
.shelf-delete-dialog input {
  width: 100%;
  font: inherit;
  font-size: 12px;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 11px;
  background: var(--bg);
  color: var(--ink);
}
.shelf-delete-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}
.shelf-delete-dialog .primary-button {
  width: auto;
  margin: 0;
  min-height: 42px;
  gap: 12px;
}
.shelf-delete-dialog #shelf-delete-error {
  color: var(--rust);
  font-size: 12px;
  line-height: 1.8;
}
@media (max-width: 1000px) and (min-width: 721px) {
  .shelf-panel {
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  }
  .shelf-panel.is-shelf-editing {
    grid-template-columns: minmax(0, 2.35fr) minmax(0, 0fr);
  }
}
@media (max-width: 720px) {
  .shelf-toolbar {
    flex-wrap: wrap;
    gap: 0;
  }
  .shelf-tabs {
    gap: 19px;
  }
  .shelf-toolbar-actions {
    gap: 7px;
    margin-left: auto;
  }
  .shelf-toolbar-actions .new-album-button {
    font-size: 11px;
    padding-inline: 9px;
    min-height: 36px;
  }
  .shelf-edit-toggle {
    font-size: 11px;
    padding-inline: 3px;
  }
  .shelf-panel .album-detail {
    transition:
      opacity 0.2s,
      max-height 0.45s,
      padding 0.45s;
    max-height: 500px;
  }
  .shelf-panel.is-shelf-editing .album-detail {
    max-height: 0;
    padding-block: 0;
    margin: 0;
    transform: none;
  }
  .shelf-panel.is-shelf-editing .books {
    height: 340px;
    padding-inline: 16px;
    padding-top: 32px;
  }
  .shelf-panel.is-shelf-editing .shelf-book {
    height: calc(var(--height) * 0.98);
  }
  .shelf-panel.is-shelf-editing .shelf-book[aria-pressed='true'] {
    width: 193px;
    flex-basis: 193px;
  }
  .shelf-panel.is-shelf-editing .shelf-book[aria-pressed='true'] .cover-photo {
    height: 142px;
  }
  .shelf-edit-note {
    font-size: 10px;
  }
  .shelf-delete-actions {
    flex-wrap: wrap;
  }
}
@media (prefers-reduced-motion: reduce) {
  .shelf-panel,
  .shelf-panel .album-detail,
  .shelf-panel .books,
  .shelf-panel.is-shelf-editing .shelf-book {
    transition: none;
  }
}
