.library-category-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 3px;
  min-width: 0;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--input);
}

.library-category-tabs > [data-library-category] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 0;
  min-height: 36px;
  padding: 5px 10px;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  overflow-wrap: anywhere;
}

.library-category-tabs > [data-library-category] svg {
  width: 14px;
  height: 14px;
}

.library-category-tabs > [data-library-category]:hover {
  color: var(--text);
}

.library-category-tabs > [data-library-category]:is(.active, [aria-pressed="true"]) {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  background: color-mix(in srgb, var(--accent) 10%, var(--panel2));
  color: var(--text);
}

.library-category-tabs > [data-library-category]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.studio-library-categories {
  padding: 12px 13px 0;
}

.studio-library-categories [data-library-category] {
  flex: 1 1 65px;
  padding-inline: 5px;
  font-size: 10px;
}

.library-modal-nav {
  display: flex;
  justify-content: center;
  margin-block-end: 16px;
}

.library-modal-nav.library-category-tabs,
.library-modal-nav .library-category-tabs {
  width: fit-content;
  max-width: 100%;
  justify-content: center;
  margin-inline: auto;
}

.library-custom-table {
  margin-block-start: 16px;
}

.library-category-content,
.library-table-grid {
  min-width: 0;
}

.library-table-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(218px, 100%), 1fr));
  gap: 9px;
}

.library-table-grid > .preset-card {
  min-width: 0;
  height: 100%;
  margin: 0;
}

.library-table-grid > .preset-card > span,
.library-accessory-copy {
  min-width: 0;
  overflow-wrap: anywhere;
}

#left-panel .library-accessory-card .library-accessory-thumbnail {
  display: grid;
  place-items: center;
  width: 100%;
  height: 60px;
  color: var(--muted);
  font-size: 10px;
}

#left-panel .library-accessory-thumbnail:has(img)::before {
  content: '';
  grid-area: 1 / 1;
  align-self: end;
  width: 76%;
  height: 11%;
  margin-bottom: 5px;
  border-radius: 50%;
  background: var(--library-shadow);
  filter: blur(1.5px);
}

#left-panel .library-accessory-thumbnail img {
  grid-area: 1 / 1;
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: brightness(1.28);
}

[data-theme=light] #left-panel .library-accessory-thumbnail img {
  filter: brightness(1.37);
}

.library-accessory-card .library-accessory-details {
  line-height: 1.45;
}

.library-accessory-card .library-accessory-material {
  margin-block: 3px 6px;
  line-height: 1.35;
}

.library-accessory-card .library-accessory-trial {
  margin-block-end: 0;
  color: var(--accent);
}

@media (max-width: 540px) {
  .library-category-tabs > [data-library-category] {
    min-height: 44px;
  }

  .library-modal-nav > .library-category-tabs,
  .library-modal-nav.library-category-tabs {
    width: 100%;
  }

  .library-modal-nav [data-library-category] {
    flex: 1 1 75px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  :is(.library-category-content, .library-table-grid) :is(.preset-card, .accessory-card),
  .library-accessory-card {
    animation: library-card-arrive 210ms ease-out var(--library-card-delay, 0ms) backwards;
  }

  :is(.library-category-content, .library-table-grid) :is(.preset-card, .accessory-card):nth-child(2) { --library-card-delay: 16ms; }
  :is(.library-category-content, .library-table-grid) :is(.preset-card, .accessory-card):nth-child(3) { --library-card-delay: 32ms; }
  :is(.library-category-content, .library-table-grid) :is(.preset-card, .accessory-card):nth-child(4) { --library-card-delay: 48ms; }
  :is(.library-category-content, .library-table-grid) :is(.preset-card, .accessory-card):nth-child(5) { --library-card-delay: 64ms; }
  :is(.library-category-content, .library-table-grid) :is(.preset-card, .accessory-card):nth-child(6) { --library-card-delay: 80ms; }
  :is(.library-category-content, .library-table-grid) :is(.preset-card, .accessory-card):nth-child(n + 7) { --library-card-delay: 96ms; }

  @keyframes library-card-arrive {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
  }
}

:is(.library-category-tabs, .studio-library-categories, .library-modal-nav, .library-category-content)[hidden] {
  display: none;
}
