/* Compact reference-style Library Cleanup layout. */
.library-cleanup-section .scan-review-metadata {
  display: grid;
  grid-column: 1 / -1;
  gap: 12px;
  min-width: 0;
  margin-top: 16px;
}
.library-cleanup-section .saved-autofill-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--panel-soft);
  border: 1px solid var(--border);
  color: var(--text);
}
.library-cleanup-section .saved-autofill-copy,
.library-cleanup-section .sync-status {
  min-width: 0;
  overflow-wrap: anywhere;
}
.library-cleanup-section .saved-autofill-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
/* A real wrapper is required: modern details elements have an internal content
   box, so grid on details itself does not lay out the action buttons. */
#root .library-check-page > .library-cleanup-section > details.scan-review-actions.library-cleanup-details,
#root .library-check-page > .library-cleanup-section > details.scan-review-actions.library-cleanup-details[open] {
  display: block !important;
  box-sizing: border-box !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  justify-self: stretch !important;
  margin: 16px 0 0 !important;
}
#root .library-check-page .library-cleanup-section .library-cleanup-tools-grid {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
  width: 100%;
  min-width: 0;
}
#root .library-check-page .library-cleanup-section .library-cleanup-tools-grid > button {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 52px;
  margin: 0 !important;
  padding: 10px 12px !important;
  white-space: normal !important;
}
#root .library-check-page .library-cleanup-section .library-cleanup-tools-grid > button > span {
  display: inline !important;
}
html body #root .app-shell .library-check-page .library-cleanup-section .library-cleanup-tools-grid > button {
  width: 100% !important;
  max-width: 100% !important;
  white-space: normal !important;
  justify-content: center !important;
}
html body #root .app-shell .library-check-page .library-cleanup-section .library-cleanup-tools-grid > button > span {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: static !important;
  font-size: .9rem !important;
  line-height: 1.3 !important;
  width: auto !important;
  height: auto !important;
  max-width: none !important;
  overflow: visible !important;
  white-space: normal !important;
  flex: 1 1 auto;
}
html body #root .app-shell .library-check-page .library-cleanup-section .library-cleanup-tools-grid > button > svg,
html body #root .app-shell .library-check-page .library-cleanup-section .library-cleanup-tools-grid > button > strong {
  position: static !important;
  flex: 0 0 auto;
}
#root .library-check-page .library-cleanup-section .library-cleanup-tools-grid > button.library-delete-trigger,
#root .library-check-page .library-cleanup-section .library-cleanup-tools-grid > button.library-delete-trigger > span,
#root .library-check-page .library-cleanup-section .library-cleanup-tools-grid > button.library-delete-trigger > svg {
  color: var(--danger) !important;
  background: var(--panel-soft) !important;
  border-color: var(--danger) !important;
}
@media (max-width: 1200px) {
  #root .library-check-page .library-cleanup-section .library-cleanup-tools-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 720px) {
  #root .library-check-page .library-cleanup-section .library-cleanup-tools-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}
.library-cleanup-section {
  position: relative;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  align-content: start;
  min-height: 0 !important;
  overflow: hidden;
}

.library-cleanup-section .library-cleanup-heading {
  grid-column: 1 / -1 !important;
  padding-right: 240px !important;
}

.library-cleanup-section .library-cleanup-details {
  grid-column: 1 / -1 !important;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: visible !important;
}

.library-cleanup-section .library-cleanup-details[open] {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  column-gap: 20px !important;
  row-gap: 16px !important;
  width: 100% !important;
  margin-top: 18px !important;
}

.library-cleanup-section .library-cleanup-details > button {
  box-sizing: border-box !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 52px !important;
  margin: 0 !important;
  padding: 10px 12px !important;
  justify-content: center !important;
  white-space: normal !important;
  line-height: 1.2 !important;
}

.library-cleanup-section .library-cleanup-details > button:disabled {
  opacity: .56;
  box-shadow: none !important;
}

.library-cleanup-section .library-cleanup-details > summary {
  position: absolute !important;
  top: 18px !important;
  right: 20px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: auto !important;
  min-width: 210px !important;
  min-height: 46px !important;
  padding: 10px 16px !important;
  border: 1px solid var(--border) !important;
  border-radius: 10px !important;
  background: var(--panel-soft) !important;
  color: var(--text) !important;
  box-shadow: none !important;
  font-size: .92rem !important;
  font-weight: 750 !important;
  line-height: 1.2 !important;
  list-style: none !important;
  cursor: pointer;
}

.library-cleanup-section .library-cleanup-details > summary::after {
  content: "⌄" !important;
  display: inline-block !important;
  margin-left: 10px !important;
  color: var(--gold) !important;
}

.library-cleanup-section .library-cleanup-details[open] > summary::after {
  transform: rotate(180deg);
}

.library-cleanup-section .library-cleanup-details > summary::marker,
.library-cleanup-section .library-cleanup-details > summary::-webkit-details-marker {
  display: none !important;
  content: "" !important;
}

@media (max-width: 720px) {
  .library-cleanup-section .library-cleanup-heading {
    padding-right: 0 !important;
  }

  .library-cleanup-section .library-cleanup-details > summary {
    position: static !important;
    width: 100% !important;
    min-width: 0 !important;
    margin-top: 16px !important;
  }

  .library-cleanup-section .library-cleanup-details[open] {
    grid-template-columns: 1fr !important;
    row-gap: 12px !important;
    margin-top: 10px !important;
  }
}

@media (min-width: 721px) and (max-width: 1200px) {
  .library-cleanup-section .library-cleanup-details[open] {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}
